/* DURUM ODASI — temel stiller: sifirlama, tipografi, kabuk, bilesenler. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink-1);
  font: 400 var(--fs-base)/21px var(--f-sans);
  font-feature-settings: "ss02" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--dost-wash); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 var(--s-2); }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.prose { font: 400 var(--fs-prose)/26px var(--f-serif); max-width: 64ch; color: var(--ink-1); }
.prose em { font-style: italic; }
.micro {
  font: 600 var(--fs-micro)/14px var(--f-cond);
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
}
.cond { font-family: var(--f-cond); }
.dim { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: var(--fs-xs); line-height: 16px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: fixed; left: 8px; top: -60px; z-index: 1000; padding: 8px 12px;
  background: var(--accent); color: var(--dost-ink); border-radius: var(--r-2);
}
.skip-link:focus { top: 8px; }

/* ------------------------------------------------------------ dokular */
.app {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  grid-template-rows: var(--strip) 1fr;
  height: 100vh;
  height: 100dvh;
}
.app::before {
  /* kum masasi ızgarasi + gren, yalnizca bosluklarda */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    var(--grain, none),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 128px 128px, 24px 24px, 24px 24px;
  opacity: 1;
}

/* ------------------------------------------------------------ durum seridi */
.strip {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-3) 0 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-2);
  position: relative; z-index: 20;
  font-size: var(--fs-xs);
}
.strip-brand { display: flex; align-items: center; gap: var(--s-3); height: 100%; flex: none; }
.strip-live { display: contents; }
.strip .mark {
  width: var(--rail); height: 100%; display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--line-2); color: var(--ink-1);
}

/* ------------------------------------------------------------ marka isareti
 * At (oyun) + dort kose vizor (analistin gozu) + kirmizi nisan (kritik kare).
 * Giris: koseler disaridan kilitlenir, tarama cizgisi ati ortaya cikarir, goz yanar.
 * Motor dusunurken ya da analiz surerken tarama dongude akar: isaret durum gostergesidir. */
.brand-mark { display: block; overflow: visible; }
.brand-mark .bm-piece { fill: currentColor; }
.brand-mark .bm-eye { fill: var(--hasim); transform-box: fill-box; transform-origin: center; }
.brand-mark .bm-scan { fill: var(--accent); opacity: 0; }
.brand-mark .bm-c { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: square;
  transition: transform var(--t-base) var(--e-standard); }
.brand-mark.intro .bm-c { animation: bm-lock 640ms var(--e-decel) both; }
.brand-mark.intro .bm-c.tr { animation-delay: 50ms; }
.brand-mark.intro .bm-c.br { animation-delay: 100ms; }
.brand-mark.intro .bm-c.bl { animation-delay: 150ms; }
.brand-mark.intro .bm-piece { animation: bm-reveal 560ms 260ms var(--e-standard) both; }
.brand-mark.intro .bm-scan { animation: bm-scan 560ms 260ms var(--e-standard) both; }
.brand-mark.intro .bm-eye { animation: bm-eye 260ms 820ms var(--e-overshoot) both; }
.brand-mark .tl { --ox: -4px; --oy: -4px; } .brand-mark .tr { --ox: 4px; --oy: -4px; }
.brand-mark .br { --ox: 4px; --oy: 4px; }   .brand-mark .bl { --ox: -4px; --oy: 4px; }
a:hover > .brand-mark .bm-c, .brand-mark.locked .bm-c { transform: translate(calc(var(--ox) / -4), calc(var(--oy) / -4)); }
:root[data-busy] .strip .brand-mark .bm-scan { animation: bm-scan 1.6s var(--e-inout) infinite; }
:root[data-busy] .strip .brand-mark .bm-c { animation: bm-breathe 1.6s var(--e-inout) infinite alternate; }
@keyframes bm-lock { from { transform: translate(var(--ox), var(--oy)); opacity: 0; } 50% { opacity: 1; } to { transform: none; } }
@keyframes bm-reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes bm-scan { 0% { transform: translateY(1px); opacity: 0; } 15% { opacity: .9; } 85% { opacity: .9; }
  100% { transform: translateY(21px); opacity: 0; } }
@keyframes bm-eye { 0% { transform: scale(0); } 60% { transform: scale(1.6); } 100% { transform: scale(1); } }
@keyframes bm-breathe { from { transform: none; } to { transform: translate(calc(var(--ox) / 8), calc(var(--oy) / 8)); } }
.wordmark {
  font: 600 13px/1 var(--f-cond); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-1);
  white-space: nowrap;
}
.chip-status {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: var(--r-1); color: var(--ink-2);
  background: transparent; cursor: default; white-space: nowrap;
  transition: border-color var(--t-fast), color var(--t-fast);
}
button.chip-status { cursor: pointer; }
button.chip-status:hover { border-color: var(--line-3); color: var(--ink-1); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--onay); flex: none; }
.dot.warn { background: var(--dikkat); }
.dot.bad { background: var(--hasim); }
.strip .spacer { flex: 1; }
.strip .counts a { color: var(--ink-2); }
.strip .counts b { color: var(--ink-1); font-family: var(--f-mono); font-weight: 500; }
.search-trigger {
  display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 10px; min-width: 220px;
  border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg-0); color: var(--ink-3);
  cursor: pointer;
}
.search-trigger:hover { border-color: var(--line-3); color: var(--ink-2); }
.kbd {
  font: 500 10px/14px var(--f-mono); padding: 0 4px; border: 1px solid var(--line-3); border-radius: 3px;
  color: var(--ink-3); background: var(--bg-2);
}
.icon-btn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--r-2); background: transparent; color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink-1); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.icon .f { fill: currentColor; stroke: none; }
.icon.sm { width: 16px; height: 16px; }
.demo-band {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(-45deg, transparent 0 10px, var(--dikkat-wash) 10px 20px);
}

/* hedefe kilitlenme (motion.js lockOn): marka isaretinin koseleri, secim dili */
.lockon { position: relative; }
.lockon > .lk { position: absolute; width: 12px; height: 12px; border: 0 solid var(--accent); pointer-events: none;
  animation: lk-in 460ms var(--e-decel) both; }
.lk.tl { left: -4px; top: -4px; border-left-width: 2px; border-top-width: 2px; --ox: -8px; --oy: -8px; }
.lk.tr { right: -4px; top: -4px; border-right-width: 2px; border-top-width: 2px; --ox: 8px; --oy: -8px; animation-delay: 40ms; }
.lk.br { right: -4px; bottom: -4px; border-right-width: 2px; border-bottom-width: 2px; --ox: 8px; --oy: 8px; animation-delay: 80ms; }
.lk.bl { left: -4px; bottom: -4px; border-left-width: 2px; border-bottom-width: 2px; --ox: -8px; --oy: 8px; animation-delay: 120ms; }
@keyframes lk-in { from { transform: translate(var(--ox), var(--oy)); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ ray */
.rail-more { display: none; position: relative; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--ink-3); font: 500 11px/1 var(--f-cond); letter-spacing: .02em; cursor: pointer; }
.rail-more:hover, .rail-more.active { color: var(--ink-1); }
.rail-more .more-ic { display: flex; }
.rail-more.active::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; background: var(--accent); }
.more-sheet { min-width: 260px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 8px 8px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid transparent;
  border-radius: var(--r-2); background: none; color: var(--ink-2); font: 500 12px/1.1 var(--f-cond); cursor: pointer; }
.more-item:hover { background: var(--bg-2); color: var(--ink-1); }
.more-item.active { border-color: var(--accent); color: var(--ink-1); }
.rail {
  grid-row: 2; display: flex; flex-direction: column; align-items: stretch;
  background: var(--bg-1); border-right: 1px solid var(--line-2); padding: var(--s-2) 0;
  position: relative; z-index: 10; overflow-y: auto;
}
.rail a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: 56px; color: var(--ink-3); text-decoration: none;
  font: 500 11px/1 var(--f-cond); letter-spacing: .02em;
  transition: color var(--t-fast);
}
.rail a:hover { color: var(--ink-1); }
.rail a.active { color: var(--ink-1); }
.rail a.active::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: var(--accent);
}
.rail a .badge {
  position: absolute; top: 8px; right: 14px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--accent); color: var(--dost-ink);
  font: 600 10px/16px var(--f-mono); text-align: center;
}
.rail .grow { flex: 1; }

/* ------------------------------------------------------------ gorunum alani */
.main {
  grid-row: 2; grid-column: 2; overflow: auto; position: relative; z-index: 1;
  scroll-behavior: smooth;
}
.view { padding: var(--s-5) var(--s-6) var(--s-9); max-width: 1560px; margin: 0 auto; }
.view-head {
  display: flex; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4);
}
.view-title {
  font: 600 var(--fs-lg)/28px var(--f-cond); letter-spacing: .02em; text-transform: uppercase;
}
.view-sub { color: var(--ink-3); font-size: var(--fs-xs); }

/* ------------------------------------------------------------ yapraklar (sheet) */
.sheet {
  position: relative; background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: var(--r-1); box-shadow: var(--e1); padding: var(--s-4);
  min-width: 0;
}
.sheet + .sheet { margin-top: var(--s-4); }
.sheet-head {
  display: flex; align-items: center; gap: var(--s-2); margin: calc(var(--s-1) * -1) 0 var(--s-3);
  min-height: 22px;
}
.sheet-head .micro { flex: 1; }
.sheet.tab-left { border-left-width: 3px; }
.sheet.registered::before, .sheet.registered::after {
  content: ""; position: absolute; width: 8px; height: 8px; pointer-events: none;
  border-color: var(--line-3); border-style: solid; border-width: 0;
}
.sheet.registered::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.sheet.registered::after { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }
.grid { display: grid; gap: var(--s-4); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.row.tight { gap: var(--s-1); }
.row.between { justify-content: space-between; }

/* ------------------------------------------------------------ retikul (kimlik) */
.reticle { position: relative; }
.reticle::after {
  content: ""; position: absolute; inset: -3px; pointer-events: none;
  --rc: var(--accent); --ra: 10px; --rw: 2px;
  background:
    linear-gradient(var(--rc), var(--rc)) top left / var(--ra) var(--rw),
    linear-gradient(var(--rc), var(--rc)) top left / var(--rw) var(--ra),
    linear-gradient(var(--rc), var(--rc)) top right / var(--ra) var(--rw),
    linear-gradient(var(--rc), var(--rc)) top right / var(--rw) var(--ra),
    linear-gradient(var(--rc), var(--rc)) bottom left / var(--ra) var(--rw),
    linear-gradient(var(--rc), var(--rc)) bottom left / var(--rw) var(--ra),
    linear-gradient(var(--rc), var(--rc)) bottom right / var(--ra) var(--rw),
    linear-gradient(var(--rc), var(--rc)) bottom right / var(--rw) var(--ra);
  background-repeat: no-repeat;
}

/* ------------------------------------------------------------ dugmeler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-2);
  border: 1px solid var(--line-ctl); background: var(--bg-2); color: var(--ink-1);
  font: 500 var(--fs-sm)/1 var(--f-sans); cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-instant);
}
.btn:hover:not(:disabled) { border-color: var(--ink-3); background: var(--bg-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--dost-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.danger { border-color: var(--hasim); color: var(--hasim); background: transparent; }
.btn.danger.armed { background: var(--hasim); color: var(--hasim-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: var(--bg-2); color: var(--ink-1); border-color: transparent; }
.btn.lg { height: 40px; padding: 0 18px; font-size: var(--fs-base); }
.btn.sm { height: 26px; padding: 0 9px; font-size: var(--fs-xs); }
.btn.wide { width: 100%; }
.btn .kbd { margin-left: 4px; }
.btn.primary .kbd { border-color: rgb(0 0 0 / .25); background: transparent; color: inherit; }

/* segmentli secim */
.seg { display: inline-flex; border: 1px solid var(--line-ctl); border-radius: var(--r-2); overflow: hidden; }
.seg button {
  height: 30px; padding: 0 11px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  font: 500 var(--fs-sm)/1 var(--f-sans); border-right: 1px solid var(--line-2);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink-1); background: var(--bg-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--dost-ink); font-weight: 600; }

/* form */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > .micro { margin: 0; }
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  height: 32px; padding: 0 10px; width: 100%;
  background: var(--bg-0); border: 1px solid var(--line-ctl); border-radius: var(--r-2);
  color: var(--ink-1); font-size: var(--fs-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea { height: auto; padding: 8px 10px; font: 400 12px/18px var(--f-mono); resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--dost-wash); }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
label.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--ink-2); }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* fis/etiket */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border: 1px solid var(--line-3); border-radius: var(--r-1); background: transparent;
  color: var(--ink-2); font: 500 var(--fs-xs)/1 var(--f-sans); white-space: nowrap;
}
button.chip { cursor: pointer; }
button.chip:hover { color: var(--ink-1); border-color: var(--ink-3); }
.chip.hasim { border-color: var(--hasim); color: var(--hasim); }
.chip.dost { border-color: var(--dost); color: var(--dost); }
.chip.onay { border-color: var(--onay); color: var(--onay); }
.chip.alt { border-color: var(--alt); color: var(--alt); }
.chip.dikkat { border-color: var(--dikkat); color: var(--dikkat); }
.chip.solid { background: var(--accent); border-color: var(--accent); color: var(--dost-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* tablo */
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-2);
  font: 600 var(--fs-micro)/14px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line-1); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--bg-2); }

/* bos durum */
.empty {
  padding: var(--s-8) var(--s-6); text-align: center; color: var(--ink-2);
  border: 1px dashed var(--line-3); border-radius: var(--r-1); background: var(--bg-1);
}
.empty .prose { margin: 0 auto var(--s-4); }

/* iskelet */
.skel { background: var(--bg-3); border-radius: 2px; height: 14px; margin: 7px 0; position: relative; overflow: hidden; }
.skel.w60 { width: 60%; } .skel.w80 { width: 80%; } .skel.w40 { width: 40%; }
.scanline { position: relative; overflow: hidden; }
.scanline::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; top: 0;
  background: var(--accent); opacity: .5; animation: scan 1200ms linear 2;
}
@keyframes scan { from { transform: translateY(0); } to { transform: translateY(var(--scan-h, 200px)); } }
.busy-line { height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; animation: busy 1.1s linear infinite; }
@keyframes busy { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ilerleme */
.progress { height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transform-origin: left;
  transition: transform var(--t-panel) var(--e-decel); }
.ticks { display: flex; gap: 2px; }
.ticks i { flex: 1; height: 6px; background: var(--bg-3); transition: background var(--t-fast); }
.ticks i.on { background: var(--accent); }

/* bant renkleri */
.band-critical { color: var(--hasim); } .band-weak { color: var(--c-mistake); }
.band-average { color: var(--dikkat); } .band-solid { color: var(--dost); } .band-strong { color: var(--onay); }

/* hamle sinifi */
.cls-book { color: var(--c-book); } .cls-brilliant { color: var(--c-brilliant); }
.cls-great { color: var(--c-great); } .cls-best { color: var(--c-best); }
.cls-excellent { color: var(--c-excellent); } .cls-good { color: var(--c-good); }
.cls-forced { color: var(--c-forced); } .cls-inaccuracy { color: var(--c-inaccuracy); }
.cls-mistake { color: var(--c-mistake); } .cls-blunder { color: var(--c-blunder); }
.badge-cls { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.badge-cls svg { width: 100%; height: 100%; overflow: visible; }

/* ------------------------------------------------------------ katmanlar ustu */
.toasts {
  position: fixed; right: var(--s-4); bottom: var(--s-4); z-index: 300; display: flex; flex-direction: column;
  gap: 8px; align-items: flex-end; pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: 420px; padding: 10px 14px; border-radius: var(--r-2);
  background: var(--bg-2); box-shadow: var(--e2); border-left: 3px solid var(--line-3);
  font-size: var(--fs-sm); display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in var(--t-base) var(--e-decel);
}
.toast.error { border-left-color: var(--hasim); }
.toast.success { border-left-color: var(--onay); }
.toast.info { border-left-color: var(--dost); }
.toast.leaving { animation: toast-out var(--t-fast) var(--e-accel) forwards; }
.toast button { margin-left: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

.overlay {
  position: fixed; inset: 0; z-index: 200; background: rgb(0 0 0 / .5);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh;
  animation: fade-in 140ms var(--e-decel);
}
@keyframes fade-in { from { opacity: 0; } }
.palette {
  width: min(640px, calc(100vw - 32px)); background: var(--bg-2); border-radius: var(--r-3);
  box-shadow: var(--e3); overflow: hidden; animation: drop-in var(--t-base) var(--e-decel);
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } }
.palette input { height: 48px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  background: transparent; font-size: var(--fs-md); padding: 0 16px; }
.palette input:focus { box-shadow: none; }
.palette .results { max-height: 52vh; overflow-y: auto; padding: 6px 0; }
.palette .group { padding: 8px 16px 4px; }
.palette .item {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; color: var(--ink-2);
}
.palette .item .kbd { margin-left: auto; }
.palette .item.active { background: var(--bg-3); color: var(--ink-1); }
.palette .item mark { background: none; color: var(--accent); font-weight: 600; }

.modal {
  width: min(560px, calc(100vw - 32px)); max-height: 80vh; overflow: auto; background: var(--bg-1);
  border-radius: var(--r-3); box-shadow: var(--e3); padding: var(--s-6); animation: drop-in var(--t-base) var(--e-decel);
}
.modal.wide { width: min(880px, calc(100vw - 32px)); }

.popover {
  position: fixed; z-index: 250; background: var(--bg-2); border-radius: var(--r-3); box-shadow: var(--e2);
  padding: var(--s-2) 0; min-width: 260px; animation: pop-in 160ms var(--e-decel);
}
@keyframes pop-in { from { opacity: 0; transform: scale(.98); } }
.popover .item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; color: var(--ink-2); }
.popover .item:hover, .popover .item:focus-visible { background: var(--bg-3); color: var(--ink-1); outline: none; }
.popover hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }

.tip {
  position: fixed; z-index: 260; pointer-events: none; max-width: 300px; padding: 8px 10px;
  background: var(--bg-2); box-shadow: var(--e2); border-radius: var(--r-2); font-size: var(--fs-xs); line-height: 17px;
  color: var(--ink-1);
}

/* monogram */
.mono-tile {
  width: 24px; height: 24px; border-radius: var(--r-1); display: inline-flex; align-items: center; justify-content: center;
  font: 600 10px/1 var(--f-cond); letter-spacing: .04em; color: #fff; flex: none;
}
.mono-tile.lg { width: 40px; height: 40px; font-size: 15px; }
.mono-tile { background: oklch(.5 .13 var(--hue, 250)); }

/* muhur (S4) */
.stamp {
  display: inline-block; padding: 4px 12px; border: 2px solid currentColor; border-radius: 3px;
  font: 600 18px/1.1 var(--f-cond); letter-spacing: .12em; text-transform: uppercase;
  transform: rotate(-6deg); color: var(--hasim);
  -webkit-mask-image: var(--ink-mask, none); mask-image: var(--ink-mask, none);
}
.stamp.onay { color: var(--onay); } .stamp.dost { color: var(--dost); } .stamp.dim { color: var(--ink-2); }
.stamp.small { font-size: 11px; padding: 2px 7px; border-width: 1.5px; }

/* kod adi daktilo imleci */
.caret::after { content: "▌"; color: var(--accent); margin-left: 1px; animation: blink 400ms steps(1) 4; }
@keyframes blink { 50% { opacity: 0; } }

/* sansur bandi (gizliligi kaldir) */
.redact { position: relative; }
.redact::after {
  content: ""; position: absolute; inset: -1px -2px; background: var(--ink-1); border-radius: 1px;
  transform-origin: right; transition: transform 520ms var(--e-inout);
}
.redact.declassified::after { transform: scaleX(0); }

/* kaydirma cubugu */
* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid transparent; background-clip: padding-box; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--line-3); }

/* ------------------------------------------------------------ duyarlilik */
@media (max-width: 1119px) {
  /* Ray daralsa da simgeler yazisiz kalmaz: etiket her genislikte okunur. */
  .search-trigger { min-width: 0; }
  .search-trigger .label { display: none; }
}
@media (max-width: 839px) {
  .app { grid-template-columns: 1fr; grid-template-rows: var(--strip) 1fr 56px; }
  .strip .mark { width: auto; padding: 0 12px; border-right: 0; }
  .rail {
    grid-row: 3; grid-column: 1; flex-direction: row; padding: 0; border-right: 0; border-top: 1px solid var(--line-2);
    overflow-x: auto; overflow-y: hidden;
  }
  .rail { overflow: hidden; }
  .rail a, .rail-more { flex: 1 1 0; min-width: 0; height: 56px; }
  .rail a.rail-x { display: none; }
  .rail-more { display: flex; }
  .rail a span { display: block; }
  .rail a.active::before { left: 12px; right: 12px; top: 0; bottom: auto; width: auto; height: 3px; }
  .rail .grow { display: none; }
  .main { grid-column: 1; }
  .view { padding: var(--s-3) var(--s-2) var(--s-8); }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .strip .counts, .strip .wordmark-full { display: none; }
}

/* ------------------------------------------------------------ hareket azaltma */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduced"]::view-transition-group(*), :root[data-motion="reduced"]::view-transition-old(*),
:root[data-motion="reduced"]::view-transition-new(*) { animation-duration: 1ms !important; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"])::view-transition-group(*), :root:not([data-motion="full"])::view-transition-old(*),
  :root:not([data-motion="full"])::view-transition-new(*) { animation-duration: 1ms !important; }
}
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
  animation-duration: 1ms !important; animation-iteration-count: 1 !important;
  transition-duration: 1ms !important; scroll-behavior: auto !important;
}

/* ------------------------------------------------------------ denetim duzeltmeleri */
.btn.primary:hover:not(:disabled) { border-color: var(--accent); }
.btn.danger:hover:not(:disabled) { border-color: var(--hasim); background: var(--hasim-wash); color: var(--hasim); }
.btn.danger.armed:hover:not(:disabled) { background: var(--hasim); color: var(--hasim-ink); }
.seg button:focus-visible, .movelist .mv:focus-visible, .opening-results button:focus-visible { outline-offset: -2px; position: relative; z-index: 1; }
button.chip { border-color: var(--line-ctl); transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
button.chip:active, .seg button:active { transform: translateY(1px); }
.icon-btn { transition: background var(--t-fast), color var(--t-fast), transform var(--t-instant); }
.icon-btn:active { transform: scale(.94); }
.seg button { transition: background var(--t-fast), color var(--t-fast); }
.view { transition: --accent 520ms var(--e-inout); }
.skel { background: linear-gradient(90deg, var(--bg-3) 40%, color-mix(in srgb, var(--bg-3), var(--line-3) 45%) 50%, var(--bg-3) 60%);
  background-size: 300% 100%; animation: skel 1.3s linear infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* Dokunmatik ve telefon genisligi: her hedef parmakla rahat basilir (en az ~32px). */
@media (pointer: coarse) {
  .icon-btn { width: 40px; height: 40px; }
  .btn { height: 40px; }
  .btn.sm { height: 34px; }
  .seg button { height: 38px; }
  .movelist .mv { min-height: 40px; }
}
@media (pointer: coarse), (max-width: 599px) {
  :root { --strip: 48px; }
  .icon-btn { width: 36px; height: 36px; }
  .btn.sm { height: 32px; }
  button.chip { height: 30px; padding: 0 10px; }
  .pill-link { min-height: 30px; padding: 0 2px; }
  .search-trigger { height: 34px; padding: 0 10px; }
  .strip .btn.ghost.sm { height: 36px; }
  .op-all summary { min-height: 32px; }
}
@media (max-width: 839px) {
  .toasts { left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .app { grid-template-rows: var(--strip) 1fr calc(56px + env(safe-area-inset-bottom)); }
  .rail { padding-bottom: env(safe-area-inset-bottom); scroll-snap-type: x mandatory;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .rail a { scroll-snap-align: start; }
  .hide-sm { display: none !important; }
  .seg { max-width: 100%; overflow-x: auto; }
}
