/* =========================================================
   KolayRötuş — "Atölye" teması (da Vinci eskiz defteri esinli)
   ========================================================= */
:root {
  --paper: #f7f0e2;
  --paper-2: #efe4cf;
  --card: #fffdf7;
  --ink: #3e3028;
  --ink-2: #6b5a4d;
  --ink-3: #8c7b6c;
  --line: #d9cbb2;
  --line-2: #e8dcc6;
  --terra: #b96643;
  --terra-d: #9a4f30;
  --terra-l: #f3dfd3;
  --honey: #d7ab55;
  --honey-l: #f7ead0;
  --olive: #7d8961;
  --olive-d: #5f6a47;
  --olive-l: #e7ead9;
  --danger: #a8402f;
  --danger-l: #f7e1dc;
  --neutral-stage: #e8e7e4; /* resmin çevresi nötr gri: renk değerlendirmesini bozmaz */

  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(62, 48, 40, 0.06), 0 6px 18px rgba(62, 48, 40, 0.08);
  --shadow-lift: 0 2px 4px rgba(62, 48, 40, 0.08), 0 10px 24px rgba(62, 48, 40, 0.14);
  --focus: 0 0 0 3px var(--card), 0 0 0 5px var(--terra);
  --header-h: 64px;
  --footer-h: 40px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* düşük yoğunluklu kâğıt dokusu */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .24 0 0 0 0 .19 0 0 0 0 .16 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--grain), radial-gradient(1200px 600px at 10% -10%, #fbf6ea 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #f1e5cd 0%, transparent 60%);
  background-attachment: fixed;
}
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--terra-d); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; }

.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.hand-note { font-family: var(--hand); font-size: 1.5rem; color: var(--terra); margin: 0; transform: rotate(-2deg); }

/* ---------- Kenar süslemeleri ---------- */
.ornaments { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.orn { position: absolute; opacity: 0.13; }
.orn-gear { width: 170px; left: 18px; bottom: 70px; transform: rotate(-8deg); }
.orn-leaf { width: 120px; right: 26px; top: 90px; transform: rotate(10deg); }
.orn-vitruvian { width: 160px; right: 40px; bottom: 60px; }
body.is-editing .ornaments { display: none; }
@media (max-width: 1100px) { .ornaments { display: none; } }

/* ---------- Üst çubuk ---------- */
.topbar {
  position: relative; z-index: 5;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
}
.topbar::after { /* elde çizilmiş mürekkep çizgisi */
  content: ''; position: absolute; left: 24px; right: 24px; bottom: -4px; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 6' preserveAspectRatio='none'%3E%3Cpath d='M0 3c40-2 80 2 120 0s80-2 120 1 100-2 160 0' fill='none' stroke='%233E3028' stroke-width='1' opacity='.35'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-icon { width: 34px; height: 34px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.7rem; letter-spacing: 0.2px; }

.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; align-items: center; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-weight: 600; font-size: 0.95rem; }
.steps li + li::before { content: ''; width: 34px; height: 2px; margin-right: 6px; background: repeating-linear-gradient(90deg, var(--line) 0 5px, transparent 5px 9px); }
.step-num {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--card); font-family: var(--serif); font-weight: 700; font-size: 1rem;
}
.steps li.is-current { color: var(--ink); }
.steps li.is-current .step-num { background: var(--terra); color: var(--card); border-color: var(--terra); }
.steps li.is-done .step-num { background: var(--olive); color: var(--card); border-color: var(--olive); }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 0.98rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: var(--shadow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--terra); color: #fffdf7; box-shadow: 0 2px 0 var(--terra-d), var(--shadow); }
.btn-primary:hover:not(:disabled) { background: #c06d49; }
.btn-success { background: var(--olive); color: #fffdf7; box-shadow: 0 2px 0 var(--olive-d), var(--shadow); }
.btn-secondary { background: var(--card); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.btn-secondary:hover:not(:disabled) { border-color: var(--terra); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--card); }
.btn-ghost.toggle[aria-pressed='true'] { background: var(--honey-l); border-color: var(--honey); }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: 0.9rem; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--terra-d); font-weight: 700; cursor: pointer; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { color: var(--terra); }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--card);
  cursor: pointer; font-size: 1.3rem; font-weight: 700; line-height: 1;
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.icon-btn img { width: 22px; height: 22px; }
.icon-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn[aria-pressed='true'] { background: var(--honey-l); border-color: var(--honey); }

.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.paper { background-color: var(--card); background-image: var(--grain); }

/* ---------- Karşılama ---------- */
main { position: relative; z-index: 1; }
.welcome { max-width: 1060px; margin: 0 auto; padding: 40px 24px 32px; min-height: calc(100vh - var(--header-h) - var(--footer-h)); }
.hero { text-align: center; margin-bottom: 28px; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin-top: 6px; }
.hero-sub { font-size: 1.15rem; color: var(--ink-2); max-width: 640px; margin: 12px auto 0; }

.drop-wrap { position: relative; display: grid; grid-template-columns: 1fr; justify-items: center; }
.dropzone {
  position: relative;
  width: min(760px, 100%);
  padding: 44px 24px 34px;
  text-align: center;
  border-radius: 6px;
  border: 2px dashed #b9a688;
  box-shadow: 0 1px 0 #e6d8bf, 0 18px 40px -18px rgba(62, 48, 40, 0.35);
  cursor: pointer;
  transform: rotate(-0.4deg);
  transition: transform 0.25s var(--ease), border-color 0.2s, background-color 0.2s;
}
.dropzone::before { /* kâğıt kenar çizgisi */
  content: ''; position: absolute; inset: 10px; border: 1px solid rgba(62, 48, 40, 0.12); border-radius: 3px; pointer-events: none;
}
.dropzone:hover, .dropzone.is-over { transform: rotate(0deg) translateY(-2px); border-color: var(--terra); }
.dropzone.is-over { background-color: #fff8ef; }
.tape { position: absolute; top: -12px; width: 86px; height: 24px; background: rgba(215, 171, 85, 0.45); border: 1px solid rgba(215, 171, 85, 0.6); }
.tape-l { left: 40px; transform: rotate(-6deg); }
.tape-r { right: 40px; transform: rotate(5deg); }
.drop-icon { width: 96px; height: 80px; }
.drop-title { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 700; margin: 10px 0 4px; }
.drop-sub { font-size: 1.1rem; color: var(--ink-2); margin: 0 0 20px; }
.drop-formats { font-size: 0.88rem; color: var(--ink-3); margin: 16px 0 0; }

.mascot-card { position: absolute; right: max(0px, calc(50% - 520px)); bottom: -18px; margin: 0; display: flex; flex-direction: column; align-items: center; width: 170px; }
.mascot { display: block; }
.mascot-lg { width: 112px; height: 112px; animation: bob 4s ease-in-out infinite; }
.speech {
  position: relative; margin: 0; padding: 8px 12px;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px 14px 14px 4px;
  font-family: var(--hand); font-size: 1.25rem; line-height: 1.15; color: var(--ink);
  box-shadow: 2px 3px 0 rgba(62, 48, 40, 0.12);
}
.mascot-card .speech { order: -1; margin-bottom: 6px; text-align: center; border-radius: 14px 14px 4px 14px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }

.features { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.features li { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.features img { width: 36px; height: 36px; }
.features strong { font-family: var(--serif); font-size: 1.25rem; }
.features span { color: var(--ink-2); font-size: 0.95rem; }
.rights-note { text-align: center; color: var(--ink-3); font-size: 0.9rem; margin-top: 22px; }

/* ---------- Düzenleyici yerleşimi ---------- */
.editor {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 384px;
  gap: 16px;
  padding: 16px 20px 8px;
  height: calc(100vh - var(--header-h) - var(--footer-h));
  height: calc(100dvh - var(--header-h) - var(--footer-h));
  min-height: 560px;
}

/* Sol liste */
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 14px; }
.sidebar-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-head .btn { flex: 1 1 120px; white-space: nowrap; }
.sidebar-head .sidebar-actions { order: 3; flex: 1 1 100%; }
.sidebar-actions { flex-wrap: wrap; gap: 4px; }
.counter { margin: 0; font-size: 0.95rem; color: var(--ink-2); }
.counter strong { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.sidebar-actions { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 6px; font-size: 0.92rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 36px; }
.check input { width: 20px; height: 20px; accent-color: var(--terra); }
.thumb-list { list-style: none; padding: 6px 4px 6px 2px; margin: 0; overflow-y: auto; overflow-x: hidden; display: grid; gap: 14px; align-content: start; flex: 1; }

.thumb {
  position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: 6px;
  padding: 8px 8px 8px; box-shadow: 0 1px 0 #eadfc9, 0 6px 14px -8px rgba(62, 48, 40, 0.3);
  cursor: pointer; transition: transform 0.15s var(--ease), border-color 0.15s, box-shadow 0.15s;
}
.thumb:nth-child(odd) { transform: rotate(-0.6deg); }
.thumb:nth-child(even) { transform: rotate(0.5deg); }
.thumb:hover { transform: rotate(0) translateY(-1px); }
.thumb::before { /* tutturucu (raptiye) */
  content: ''; position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8a383, var(--terra) 60%, var(--terra-d)); box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25); z-index: 2;
}
.thumb.is-active { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-l), 0 8px 18px -8px rgba(62, 48, 40, 0.45); }
.thumb.is-active::after { content: 'düzenleniyor'; position: absolute; top: 12px; right: 12px; font-family: var(--hand); font-size: 1rem; background: var(--terra); color: #fff; padding: 0 8px; border-radius: 8px; transform: rotate(3deg); }
.thumb-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--neutral-stage); border-radius: 3px; }
.thumb-name { font-weight: 700; font-size: 0.86rem; margin: 6px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 6px; font-size: 0.8rem; color: var(--ink-2); }
.thumb-meta > span:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.thumb-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 4px; }
.thumb-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; min-height: 32px; cursor: pointer; }
.thumb-check input { width: 18px; height: 18px; accent-color: var(--terra); }
.thumb-remove { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 1.1rem; color: var(--ink-2); }
.thumb-remove:hover { background: var(--danger-l); color: var(--danger); }

.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-queued { background: var(--honey-l); color: #8a6420; }
.status-processing { background: var(--terra-l); color: var(--terra-d); }
.status-processing::before { animation: pulse 1s ease-in-out infinite; }
.status-done { background: var(--olive-l); color: var(--olive-d); }
.status-error { background: var(--danger-l); color: var(--danger); border: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 0.78rem; }
.status-error:hover { text-decoration: underline; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* Orta: önizleme */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.stage-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.tb-group { display: flex; align-items: center; gap: 6px; }
.zoom-label { min-width: 52px; text-align: center; font-weight: 700; font-size: 0.9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stage-canvas { position: relative; flex: 1; min-height: 0; background: var(--neutral-stage); overflow: hidden; }
.viewer-canvas { display: block; width: 100%; height: 100%; outline: none; }
.viewer-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--terra); border-radius: 0; }
.stage-busy {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 253, 247, 0.94); border: 1px solid var(--line); font-weight: 700; font-size: 0.88rem; box-shadow: var(--shadow);
}
.mode-badge { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 6px 12px; border-radius: 10px; background: rgba(62, 48, 40, 0.82); color: #fffdf7; font-size: 0.86rem; font-weight: 700; pointer-events: none; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line-2); min-height: 62px; }
.mascot-tip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mascot-sm { width: 44px; height: 44px; flex: none; }
.speech-sm { font-size: 1.15rem; padding: 5px 10px; border-radius: 12px 12px 12px 3px; }
.progress-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.progress-text { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.92rem; }
.progress-bar { width: 140px; height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--honey), var(--terra)); transition: width 0.3s var(--ease); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--terra-l); border-top-color: var(--terra); animation: spin 0.8s linear infinite; display: inline-block; flex: none; }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sağ: araçlar (sanat malzemeleri paneli) */
.tools { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tool-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; background: var(--paper-2); border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.tool-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 6px; min-height: 64px; border-radius: 12px; border: 1.5px solid transparent;
  background: transparent; cursor: pointer; font-size: 0.74rem; font-weight: 700; line-height: 1.15; text-align: center; color: var(--ink-2);
  transition: background-color 0.15s, transform 0.15s var(--ease);
}
.tool-tab img { width: 28px; height: 28px; }
.tool-tab:hover { background: rgba(255, 253, 247, 0.7); transform: translateY(-1px); }
.tool-tab[aria-selected='true'] { background: var(--card); border-color: var(--terra); color: var(--ink); box-shadow: var(--shadow); }
.tool-panels { flex: 1; overflow-y: auto; min-height: 0; }
.tool-panel { padding: 16px 16px 24px; display: grid; gap: 16px; align-content: start; }
.panel-head h2 { font-size: 1.6rem; }
.panel-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.95rem; }
.section { display: grid; gap: 10px; }
.section-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 7px); }

.tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--honey-l); border: 1px solid #ecd6a6; font-size: 0.9rem; color: #5f4a22; }
.tip-icon { flex: none; font-size: 1.1rem; }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 0.92rem; border: 1px solid; display: grid; gap: 6px; }
.notice-info { background: #f2efe6; border-color: var(--line); color: var(--ink-2); }
.notice-warn { background: var(--danger-l); border-color: #e6bdb3; color: #6e2a1e; }
.notice-ok { background: var(--olive-l); border-color: #cdd3b7; color: #424a2f; }
.notice strong { color: inherit; }
.notice code { background: rgba(62, 48, 40, 0.08); padding: 1px 6px; border-radius: 6px; font-size: 0.86em; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 12px; }
.seg button { min-height: 44px; border: 1.5px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 700; font-size: 0.88rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.1; padding: 4px 2px; }
.seg button[aria-pressed='true'] { background: var(--card); border-color: var(--terra); box-shadow: var(--shadow); }
.seg button .ico { font-size: 1.1rem; }
.seg-lg button { min-height: 56px; font-size: 1rem; flex-direction: row; gap: 8px; }
.seg-lg button .ico { font-size: 1.25rem; }

.field { display: grid; gap: 6px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 0.92rem; }
.field-row output { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 700; }
input[type='range'] { width: 100%; accent-color: var(--terra); height: 28px; cursor: pointer; }
input[type='number'], input[type='text'], select {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 1rem;
}
input[type='number']:focus-visible, select:focus-visible { border-color: var(--terra); }
input[type='color'] { width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.input-invalid { border-color: var(--danger) !important; background: var(--danger-l) !important; }
.field-error { color: var(--danger); font-size: 0.85rem; font-weight: 600; margin: 0; }

details.more { border: 1px solid var(--line-2); border-radius: 12px; background: #fffaf0; }
details.more > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '＋'; color: var(--terra); }
details.more[open] > summary::after { content: '－'; }
details.more .more-body { padding: 0 14px 14px; display: grid; gap: 12px; }

/* Filtre kartları: küçük sanat örnekleri */
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.filter-card { border: none; background: none; padding: 0; cursor: pointer; display: grid; gap: 5px; justify-items: center; text-align: center; }
.filter-card .frame {
  width: 100%; aspect-ratio: 1; padding: 4px; background: #fff; border: 1.5px solid var(--line); border-radius: 4px;
  box-shadow: 0 1px 0 #eadfc9, 0 4px 10px -6px rgba(62, 48, 40, 0.4);
  transition: transform 0.15s var(--ease), border-color 0.15s, box-shadow 0.15s;
}
.filter-card canvas { width: 100%; height: 100%; display: block; background: var(--neutral-stage); }
.filter-card:hover .frame { transform: translateY(-2px) rotate(-0.8deg); box-shadow: var(--shadow-lift); }
.filter-card[aria-pressed='true'] .frame { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-l); }
.filter-card .fname { font-weight: 700; font-size: 0.86rem; line-height: 1.15; }
.filter-card[aria-pressed='true'] .fname { color: var(--terra-d); }
.filter-card .fdesc { font-size: 0.74rem; color: var(--ink-3); line-height: 1.1; margin-top: -3px; }

.sharp-field { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fffaf0; }

/* Arka plan seçenekleri */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--line); cursor: pointer; position: relative; padding: 0; transition: transform 0.15s var(--ease); }
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--terra); }
.swatch-transparent { background: repeating-conic-gradient(#d9d9d9 0 25%, #fff 0 50%) 50% / 14px 14px; }
.swatch-label { font-size: 0.72rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.chip[aria-pressed='true'] { background: var(--terra); border-color: var(--terra); color: #fffdf7; }
.chip:hover:not([aria-pressed='true']) { border-color: var(--terra); }

.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.preset { text-align: left; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; display: grid; gap: 1px; transition: transform 0.15s var(--ease), border-color 0.15s; }
.preset:hover { transform: translateY(-1px); border-color: var(--terra); }
.preset strong { font-size: 0.95rem; }
.preset span { font-size: 0.8rem; color: var(--ink-2); }
.preset[aria-pressed='true'] { border-color: var(--terra); background: #fff6f0; box-shadow: 0 0 0 2px var(--terra-l); }
.size-compare { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #f6f1e6; font-size: 0.92rem; }
.size-compare b { font-family: var(--serif); font-size: 1.15rem; }
.wh-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.wh-grid .x { padding-bottom: 12px; font-weight: 700; color: var(--ink-3); }
.radio-list { display: grid; gap: 6px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card); }
.radio input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--terra); }
.radio:has(input:checked) { border-color: var(--terra); background: #fff6f0; }
.radio small { display: block; color: var(--ink-2); font-size: 0.82rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 auto; }

/* Toplu uygulama kutusu */
.batch {
  border: 1.5px dashed #c9b48f; border-radius: 14px; padding: 12px; display: grid; gap: 10px;
  background: linear-gradient(180deg, #fffaf0, #fdf4e3);
}
.batch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 0.92rem; }
.batch-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.batch-thumbs img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1.5px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.batch-empty { font-size: 0.86rem; color: var(--ink-2); margin: 0; }

.export-summary { padding: 12px; border-radius: 12px; background: #f6f1e6; display: grid; gap: 4px; font-size: 0.92rem; }
.export-summary .fname { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; word-break: break-all; }
.matte-row { display: flex; align-items: center; gap: 10px; }

/* Bildirimler */
.toasts { position: fixed; right: 16px; bottom: calc(var(--footer-h) + 12px); z-index: 50; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lift); font-size: 0.95rem;
  animation: toastIn 0.25s var(--ease);
}
.toast-ok { border-left: 5px solid var(--olive); }
.toast-warn { border-left: 5px solid var(--honey); }
.toast-error { border-left: 5px solid var(--danger); }
.toast-info { border-left: 5px solid var(--terra); }
.toast.out { opacity: 0; transform: translateY(6px); transition: 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.drop-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(62, 48, 40, 0.35); display: grid; place-items: center; }
.drop-overlay .paper { padding: 32px 48px; border: 2px dashed var(--terra); border-radius: 12px; font-family: var(--serif); font-size: 2rem; font-weight: 700; }

.dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; max-width: 520px; color: var(--ink); box-shadow: var(--shadow-lift); }
.dialog::backdrop { background: rgba(62, 48, 40, 0.35); }
.dialog h2 { font-size: 1.8rem; margin-bottom: 8px; }
.help-steps { padding-left: 20px; display: grid; gap: 8px; }

/* Alt bilgi: Tasarım AP Yazılım */
.site-footer {
  position: relative; z-index: 2;
  height: var(--footer-h);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.86rem; color: var(--ink-2); letter-spacing: 0.2px;
  background: var(--paper);
  border-top: 1px solid var(--line-2);
}
.site-footer a { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--line); padding: 2px 0; transition: color 0.15s, border-color 0.15s; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--terra); border-color: var(--terra); }
.footer-flourish { color: var(--terra); font-size: 1rem; opacity: 0.8; }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .editor { grid-template-columns: 200px minmax(0, 1fr) 340px; gap: 12px; padding: 12px; }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .mascot-card { position: static; flex-direction: row; width: auto; margin-top: 18px; gap: 10px; }
  .mascot-card .mascot-lg { width: 64px; height: 64px; }
  .mascot-card .speech { order: 1; margin: 0; border-radius: 14px 14px 14px 4px; }
  .steps .step-text { display: none; }
}

/* ---------- Telefon ve dar tablet ---------- */
@media (max-width: 900px) {
  :root { --header-h: 56px; --footer-h: 36px; }
  .topbar { padding: 0 12px; }
  .brand-name { font-size: 1.4rem; }
  .hide-sm { display: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .welcome { padding: 24px 16px; }
  .dropzone { transform: none; padding: 36px 16px 28px; }

  body.is-editing { overflow: hidden; }
  body.is-editing .site-footer { display: none; }
  .editor {
    display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 0;
    height: calc(100dvh - var(--header-h)); min-height: 0;
  }
  .sidebar { flex: none; padding: 6px 8px; border-radius: 14px; }
  .sidebar-head { gap: 6px; flex-wrap: nowrap; }
  .sidebar-head .btn { flex: 0 0 auto; min-height: 36px; order: 4; }
  .sidebar-head .sidebar-actions { order: 2; flex: 1 1 auto; justify-content: flex-end; gap: 6px; }
  .counter { white-space: nowrap; font-size: 0.85rem; }
  .counter strong { font-size: 1.1rem; }
  .sidebar-actions { margin: 0; flex-wrap: nowrap; font-size: 0.85rem; }
  .sidebar-actions .link-btn { padding: 6px 2px; }
  .hide-xs { display: none; }
  .cap-xs { text-transform: capitalize; }
  .sidebar-actions .check { min-height: 30px; }
  .thumb-list { display: flex; overflow-x: auto; overflow-y: hidden; gap: 10px; padding: 8px 2px 2px; scroll-snap-type: x proximity; }
  .thumb { flex: 0 0 112px; scroll-snap-align: start; padding: 5px; }
  .thumb-img { aspect-ratio: 4 / 3; }
  .thumb.is-active::after { display: none; }
  .thumb-name { display: none; }
  .thumb-meta { position: absolute; left: 8px; top: 8px; }
  .thumb-meta > span:first-child { display: none; }
  .thumb-meta .status { font-size: 0.7rem; padding: 1px 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
  .thumb-row { position: absolute; left: 5px; right: 5px; bottom: 5px; margin: 0; padding: 0 2px; background: rgba(255, 253, 247, 0.9); border-radius: 0 0 3px 3px; }
  .thumb-check { font-size: 0.76rem; min-height: 30px; }
  .thumb-remove { width: 30px; height: 30px; }
  .stage { flex: 1 1 auto; min-height: 160px; border-radius: 14px; }
  .stage-toolbar { padding: 5px 6px; gap: 4px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  .stage-toolbar .tb-group { flex: none; }
  .stage-toolbar .btn-sm { padding: 4px 8px; font-size: 0.8rem; min-height: 36px; }
  .stage-toolbar .icon-btn { width: 36px; height: 36px; }
  .stage-foot { min-height: 0; padding: 4px 8px; }
  .stage-foot:not(:has(.progress-box:not([hidden]))) { display: none; }
  .mascot-tip { display: none; }
  .tools { flex: none; border-radius: 16px 16px 0 0; max-height: 36dvh; display: flex; flex-direction: column-reverse; }
  .tools.is-collapsed .tool-panels { display: none; }
  .tool-tabs { border-radius: 0; border-bottom: none; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tool-tab { min-height: 58px; font-size: 0.7rem; }
  .tool-tab img { width: 24px; height: 24px; }
  .tool-panel { padding: 12px 12px 16px; }
  .panel-head h2 { font-size: 1.35rem; }
  .filter-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .toasts { top: calc(var(--header-h) + 8px); bottom: auto; left: 16px; right: 16px; max-width: none; }
  .stage-toolbar { scrollbar-width: thin; }
}
@media (max-width: 520px) {
  .steps { display: none; }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: 1fr; }
  .stage-toolbar .zoom-label { display: none; }
}

/* Azaltılmış hareket tercihi */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .mascot-lg { animation: none; }
}
