/* ===========================================================================
   KRONOS — Türkiye Tarih Atlası · stil katmanı
   Sıcak editöryel / arşiv okuma odası estetiği.
   Krem kâğıt + bordo aksan, yuvarlak hatlar, metin ağırlıklı, okunabilir.
   =========================================================================== */

/* ---- TOKENLAR ----------------------------------------------------------- */
:root {
  /* yüzeyler — sıcak kâğıt tonları */
  --bg-0: oklch(0.975 0.007 300);     /* sayfa zemini · beyazdan hafif mora çalan */
  --bg-1: oklch(0.997 0.003 300);     /* kart / panel · neredeyse beyaz */
  --bg-2: oklch(0.963 0.009 300);     /* yükseltilmiş yüzey */
  --bg-3: oklch(0.933 0.013 300);     /* hover / aktif */
  --line: oklch(0.89 0.011 300);      /* ince çizgi */
  --line-soft: oklch(0.915 0.009 300 / 0.85);

  /* metin — sıcak mürekkep */
  --ink:  oklch(0.27 0.018 50);       /* ana metin */
  --ink-2: oklch(0.43 0.018 52);      /* ikincil */
  --ink-3: oklch(0.53 0.016 56);      /* silik / etiket — WCAG AA: krem zeminde ≥4.5:1 */

  /* aksanlar — JSX bu adları kullanıyor; --amber Tweaks'ten değiştirilebilir */
  --amber: oklch(0.46 0.145 16);      /* birincil — bordo (varsayılan) */
  --amber-dim: color-mix(in oklch, var(--amber) 14%, transparent);
  --cyan:  oklch(0.5 0.075 205);      /* ikincil — sakin petrol mavisi */
  --cyan-dim: color-mix(in oklch, var(--cyan) 14%, transparent);

  /* tema renkleri — krem üzerinde okunan derin, sofistike tonlar */
  --th-reform: oklch(0.5 0.085 205);  /* modernleşme · petrol mavisi */
  --th-sol:    oklch(0.5 0.16 25);    /* devrim · derin kırmızı */
  --th-darbe:  oklch(0.52 0.11 58);   /* darbe · yanık toprak */
  --th-rejim:  oklch(0.47 0.115 305); /* rejim · erik moru */
  --th-kriz:   oklch(0.53 0.15 6);    /* kriz · gül-kızıl */
  --th-dis:    oklch(0.46 0.07 252);  /* dış politika · arduvaz mavi */

  --radius: 12px;
  --radius-lg: 18px;
  --rail-w: 270px;
  --footer-h: 32px;            /* kalıcı kaynak/künye şeridi */

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: var(--font-ui);  /* mono kaldırıldı — terminal hissi gitti */

  --shadow-sm: 0 1px 2px oklch(0.4 0.03 50 / 0.05), 0 2px 8px oklch(0.4 0.03 50 / 0.05);
  --shadow-md: 0 2px 6px oklch(0.4 0.03 50 / 0.06), 0 10px 28px -8px oklch(0.4 0.03 50 / 0.13);
  --shadow-lg: 0 4px 12px oklch(0.4 0.03 50 / 0.08), 0 24px 60px -18px oklch(0.4 0.03 50 / 0.22);

  color-scheme: light;
}

/* ---- KARANLIK MOD ------------------------------------------------------- *
   Aynı editöryel kimlik, gece okuma odası: derin mürekkep-arduvaz yüzeyler,
   sıcak parşömen metin. Tüm renkler token olduğu için tek blok yeter.
   --amber (aksan) JSX'te inline atanır; app.js karanlıkta onu parlatır.        */
html[data-theme="dark"] {
  --bg-0: oklch(0.178 0.013 285);     /* sayfa zemini · derin arduvaz-mürekkep */
  --bg-1: oklch(0.224 0.015 285);     /* kart / panel */
  --bg-2: oklch(0.258 0.017 286);     /* yükseltilmiş yüzey */
  --bg-3: oklch(0.318 0.021 287);     /* hover / aktif */
  --line: oklch(0.365 0.019 287);     /* ince çizgi */
  --line-soft: oklch(0.345 0.017 287 / 0.7);

  --ink:  oklch(0.935 0.012 75);      /* ana metin · sıcak parşömen */
  --ink-2: oklch(0.79 0.014 68);      /* ikincil */
  --ink-3: oklch(0.63 0.014 62);      /* silik / etiket — koyu zeminde AA */

  --amber-dim: color-mix(in oklch, var(--amber) 22%, transparent);
  --cyan:  oklch(0.7 0.085 205);      /* gece için aydınlatılmış petrol */
  --cyan-dim: color-mix(in oklch, var(--cyan) 20%, transparent);

  /* tema renkleri — koyu zeminde okunacak şekilde aydınlatıldı */
  --th-reform: oklch(0.68 0.1 205);
  --th-sol:    oklch(0.66 0.17 25);
  --th-darbe:  oklch(0.7 0.12 62);
  --th-rejim:  oklch(0.66 0.13 305);
  --th-kriz:   oklch(0.68 0.16 8);
  --th-dis:    oklch(0.66 0.09 252);

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3), 0 2px 8px oklch(0 0 0 / 0.32);
  --shadow-md: 0 2px 6px oklch(0 0 0 / 0.36), 0 12px 30px -8px oklch(0 0 0 / 0.55);
  --shadow-lg: 0 4px 14px oklch(0 0 0 / 0.42), 0 28px 70px -18px oklch(0 0 0 / 0.7);

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

#root { height: 100%; }

::selection { background: var(--amber); color: #fff; }

/* yumuşak scrollbarlar */
::-webkit-scrollbar { height: 11px; width: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 8px; border: 3px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: oklch(0.85 0.015 70); }

/* ---- ATMOSFER: çok hafif sıcak kâğıt dokusu --------------------------- */
.atmos {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, oklch(0.99 0.009 300 / 0.9), transparent 60%),
    radial-gradient(ellipse 70% 60% at 100% 100%, oklch(0.955 0.014 308 / 0.55), transparent 65%);
}
.vignette { display: none; }

/* ---- KARANLIK MOD · atmosfer + yüzey ince ayarları --------------------- */
html[data-theme="dark"] .atmos {
  background:
    radial-gradient(ellipse 95% 75% at 50% -14%, oklch(0.3 0.035 286 / 0.7), transparent 62%),
    radial-gradient(ellipse 80% 70% at 100% 112%, oklch(0.31 0.045 300 / 0.5), transparent 66%),
    radial-gradient(ellipse 70% 55% at -5% 100%, color-mix(in oklch, var(--amber) 22%, transparent), transparent 70%);
}
/* arka plan SVG'leri gecede daha okunur — hafif, sıcak aksan tonunda */
html[data-theme="dark"] .atmos-art { opacity: .12; color: color-mix(in oklch, var(--amber) 55%, var(--ink-3)); }
html[data-theme="dark"] .atmos-art .ka-stars { color: color-mix(in oklch, var(--cyan) 60%, var(--ink)); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: oklch(0.45 0.02 287); }
html[data-theme="dark"] .dr-figure img { filter: brightness(.82) sepia(.1) saturate(.9); }
html[data-theme="dark"] .dr-figure:hover img { filter: brightness(.98) saturate(1); }
html[data-theme="dark"] ::selection { background: var(--amber); color: oklch(0.16 0.012 285); }

/* ===========================================================================
   APP KABUĞU
   =========================================================================== */
.app { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }

/* ---- ÜST BAR ----------------------------------------------------------- */
.topbar {
  display: flex; align-items: stretch; height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  flex: none;
}
.brand {
  display: flex; align-items: center; gap: 13px; padding: 0 24px 0 22px;
  border-right: 1px solid var(--line); flex: none;
}
.brand-mark {
  width: 30px; height: 30px; position: relative; flex: none;
  border: 2px solid var(--amber); border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-1);
}
.brand-mark::after {              /* sakin merkez nokta — neon süpürme yok */
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
}
.brand-name {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em;
  font-size: 23px; line-height: 1.05; color: var(--ink); white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.02em;
  color: var(--ink-3); margin-top: 3px; font-weight: 500; white-space: nowrap;
}

.modes { display: flex; align-items: center; gap: 4px; padding: 0 14px; }
.mode-btn {
  appearance: none; background: none; border: none; cursor: pointer;
  color: var(--ink-2); font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  letter-spacing: 0.005em; padding: 9px 16px; border-radius: 100px;
  display: flex; align-items: center; gap: 9px;
  position: relative; transition: color .18s, background .18s;
}
.mode-btn:hover { color: var(--ink); background: var(--bg-2); }
.mode-btn .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3);
  transition: all .18s; opacity: 0.5;
}
.mode-btn.active { color: var(--amber); background: var(--amber-dim); }
.mode-btn.active .dot { background: var(--amber); opacity: 1; }

.topbar-right {
  margin-left: auto; display: flex; align-items: center; gap: 22px;
  padding: 0 24px; border-left: 1px solid var(--line);
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3);
  letter-spacing: 0.01em; font-weight: 500;
}
.stat { display: flex; align-items: center; gap: 8px; }
.stat b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.clock { color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* aydınlık ↔ karanlık tema düğmesi */
.theme-toggle {
  --tt-cut: var(--bg-1);
  appearance: none; flex: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--ink-2);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.theme-toggle:hover {
  color: var(--amber); background: var(--bg-2); --tt-cut: var(--bg-2);
  border-color: color-mix(in oklch, var(--amber) 45%, var(--line)); transform: translateY(-1px);
}
.theme-toggle:active { transform: translateY(0); }
.theme-toggle.is-dark { color: var(--amber); }
.tt-glyph { display: block; overflow: visible; }
.tt-core { transition: r .35s cubic-bezier(.2,.7,.3,1); }
.tt-cut { opacity: 0; transition: opacity .3s ease; }
.theme-toggle.is-dark .tt-cut { opacity: 1; }
.tt-rays { transform-box: fill-box; transform-origin: center;
  transition: opacity .3s ease, transform .4s cubic-bezier(.2,.7,.3,1); }
.theme-toggle.is-dark .tt-rays { opacity: 0; transform: scale(.4) rotate(45deg); }
body[data-motion="0"] .tt-core, body[data-motion="0"] .tt-cut,
body[data-motion="0"] .tt-rays, body[data-motion="0"] .theme-toggle { transition: none; }

/* ---- ARAÇ ÇUBUĞU (filtre + zoom) --------------------------------------- */
.toolbar {
  display: flex; align-items: center; gap: 16px; padding: 11px 22px;
  border-bottom: 1px solid var(--line); background: var(--bg-0);
  flex: none; min-height: 56px;
}
.tb-label {
  font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.1em;
  color: var(--ink-3); text-transform: uppercase; flex: none; font-weight: 600;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0.005em;
  padding: 6px 14px 6px 11px; border: 1px solid var(--line);
  border-radius: 100px; color: var(--ink-2); background: var(--bg-1);
  transition: all .15s; user-select: none; white-space: nowrap;
}
.chip:hover { border-color: oklch(0.82 0.014 70); background: var(--bg-2); color: var(--ink); }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip.off { opacity: 0.45; }
.chip.off .sw { opacity: 0.4; }
.chip.on { color: var(--ink); border-color: color-mix(in oklch, var(--chip-c) 55%, var(--line)); background: color-mix(in oklch, var(--chip-c) 9%, var(--bg-1)); }

.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.zoom-grp { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 100px; overflow: hidden; background: var(--bg-1); }
.zoom-btn {
  appearance: none; border: none; background: transparent; color: var(--ink-2);
  cursor: pointer; width: 34px; height: 32px; font-size: 17px; font-family: var(--font-ui);
  display: grid; place-items: center; transition: all .15s;
}
.zoom-btn:hover { background: var(--bg-3); color: var(--amber); }
.zoom-btn + .zoom-btn { border-left: 1px solid var(--line); }
.era-btn {
  appearance: none; border: 1px solid var(--line); background: var(--bg-1);
  color: var(--ink-2); cursor: pointer; font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.005em; padding: 7px 14px; border-radius: 100px;
  transition: all .15s;
}
.era-btn:hover { background: var(--bg-2); color: var(--ink); border-color: color-mix(in oklch, var(--cyan) 45%, var(--line)); }

.search {
  display: flex; align-items: center; gap: 9px; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: 100px; padding: 0 14px; height: 34px;
  transition: border-color .15s;
}
.search:focus-within { border-color: color-mix(in oklch, var(--amber) 50%, var(--line)); }
.search input {
  background: none; border: none; outline: none; color: var(--ink);
  font-family: var(--font-ui); font-size: 13.5px; width: 160px; letter-spacing: 0.005em;
}
.search input::placeholder { color: var(--ink-3); }
.search .ic { color: var(--ink-3); font-size: 14px; }

/* ===========================================================================
   GÖVDE: rail + timeline + drawer
   =========================================================================== */
.body { flex: 1; display: flex; min-height: 0; position: relative; }

/* ---- SOL RAY (mod bağlamı) --------------------------------------------- */
.rail {
  width: var(--rail-w); flex: none; border-right: 1px solid var(--line);
  background: var(--bg-1); display: flex; flex-direction: column; min-height: 0;
}
.rail-head {
  padding: 18px 20px 14px;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  color: var(--ink); letter-spacing: 0.005em;
  display: flex; align-items: baseline; justify-content: space-between;
}
.rail-head .cnt { color: var(--ink-3); font-family: var(--font-ui); font-size: 13px; font-weight: 600; }
.rail-body { overflow-y: auto; flex: 1; padding: 4px 12px 12px; }

/* desen kartı (rail) */
.pat {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px; margin-bottom: 10px; cursor: pointer; background: var(--bg-1);
  transition: all .16s; box-shadow: var(--shadow-sm);
}
.pat:hover { background: var(--bg-1); border-color: oklch(0.82 0.014 70); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pat.active { border-color: var(--amber); background: color-mix(in oklch, var(--amber) 6%, var(--bg-1)); box-shadow: var(--shadow-md); }
.pat-top { display: flex; align-items: center; gap: 11px; }
.pat-glyph {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  font-size: 13px; color: var(--amber); background: var(--bg-2);
}
.pat.active .pat-glyph { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.pat-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: 0.005em; }
.pat-cnt { margin-left: auto; font-family: var(--font-ui); font-size: 11.5px; color: var(--ink-3); font-weight: 500; white-space: nowrap; }
.pat-sum { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin-top: 10px; }
.pat-cadence { font-family: var(--font-ui); font-size: 11.5px; color: var(--amber); font-weight: 600; margin-top: 9px; letter-spacing: 0.01em; }

/* rail bilgi metni */
.rail-note {
  padding: 16px 20px; font-size: 13px; line-height: 1.65; color: var(--ink-2);
  border-top: 1px solid var(--line-soft);
}
.rail-note b { color: var(--amber); font-weight: 600; }

/* küçük lejand satırı */
.legend-row { display:flex; align-items:center; gap:10px; font-family:var(--font-ui); font-size:12.5px; color:var(--ink-2); padding: 5px 0; }
.legend-row .ln { width: 24px; height: 0; border-top: 2px dashed var(--ink-3); flex: none; }
.legend-row .ln.core { border-top: 2px solid var(--amber); }
.legend-row .ln.user { border-top: 2px dotted var(--cyan); }

/* ===========================================================================
   TIMELINE TUVALİ
   =========================================================================== */
.canvas-wrap { flex: 1; position: relative; min-width: 0; overflow: hidden; background: var(--bg-0); }
.canvas-scroll {
  position: absolute; inset: 0; overflow-x: auto; overflow-y: auto;
  overscroll-behavior: contain; cursor: grab;
}
.canvas-scroll.drag { cursor: grabbing; }
.track {
  position: relative; height: 100%; min-width: 100%;
  /* eksen tek akış öğesi; en alta yerleşir → sticky bottom her kaydırmada alta yapışır.
     mutlak konumlu çocuklar (düğüm/yay/grid) flex dışıdır, etkilenmez. */
  display: flex; flex-direction: column; justify-content: flex-end;
}
/* yıl ekseni — dikey kaydırmada tuvalin altına yapışır, yatayda içerikle birlikte kayar */
.axis {
  position: sticky; bottom: 0; left: 0; height: 44px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, var(--bg-1) 0%, var(--bg-1) 62%, transparent);
  z-index: 6; pointer-events: none;
}
/* dikey grid çizgileri — tuvalin tüm yüksekliği boyunca uzanır */
.grid-ln {
  position: absolute; top: 0; bottom: 44px; width: 1px; z-index: 1;
  background: linear-gradient(to bottom, transparent, var(--line-soft));
  pointer-events: none;
}
.tick { position: absolute; bottom: 0; height: 44px; }
.tick .yr {
  position: absolute; bottom: 13px; left: 0; transform: translateX(-50%);
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.tick.major .yr { color: var(--ink-2); font-weight: 600; }
.tick .notch { position: absolute; bottom: 0; left: 0; width: 1px; height: 7px; background: var(--line); }
.tick.major .notch { height: 11px; background: var(--ink-3); }

/* dönem bantları (Osmanlı / Cumhuriyet / Modern) */
.era-band {
  position: absolute; top: 0; bottom: 44px; z-index: 1; pointer-events: none;
  border-left: 1px dashed var(--line-soft);
}
.era-band .era-tag {
  position: absolute; top: 10px; left: 12px;
  font-family: var(--font-ui); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; opacity: 0.7; white-space: nowrap;
}

/* SVG bağlantı katmanı */
.links-svg { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: visible; }
.link-path { fill: none; stroke: var(--ink-3); stroke-width: 1.6; opacity: 0.0; transition: opacity .3s, stroke .3s; }
.link-path.show { opacity: 0.45; }
.link-path.core { stroke: var(--amber); stroke-width: 2; stroke-dasharray: none; }
.link-path.pattern { stroke: var(--cyan); stroke-dasharray: 5 5; }
.link-path.user { stroke: var(--cyan); stroke-dasharray: 2 5; stroke-width: 1.8; }
.link-path.bond { stroke: #C99A3A; stroke-width: 2; stroke-dasharray: 11 3 2 3; }
.link-path.bond.show { opacity: 0.55; }
.link-path.bond.show.hot { opacity: 0.96; stroke-width: 2.6; }
.link-path.show.hot { opacity: 0.9; }

/* olay düğümü */
.node {
  position: absolute; transform: translate(-50%, 0); z-index: 4;
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
  /* kart metni seçilemez/kopyalanamaz — sürükle-kaydırırken de istenmeyen seçimi önler */
  user-select: none; -webkit-user-select: none;
}
.node-dot {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  background: var(--bg-0); border: 3px solid var(--node-c, var(--ink-3));
  box-shadow: 0 0 0 4px var(--bg-0);
  transition: all .2s; position: relative; z-index: 2;
}
.node-stem {
  width: 2px; background: var(--node-c, var(--line));
  opacity: 0.35; transition: opacity .2s;
}
.node-card {
  width: 178px; background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 10px 13px 11px; position: relative;
  transition: border-color .2s, box-shadow .2s, transform .2s; box-shadow: var(--shadow-sm); overflow: hidden;
  transform-origin: center center;
}
body[data-reactive="1"] .node-card { will-change: transform; }
.node-card::before {                 /* sol tema şeridi */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--node-c, var(--line));
}
.node-yr { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--node-c, var(--ink-3)); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.node-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1.2; margin-top: 3px; letter-spacing: 0.005em; color: var(--ink); text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.node-pats { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.node-pat { font-family: var(--font-ui); font-size: 11px; color: var(--cyan); width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg-2); }
.node-subcnt { font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }

.node:hover { z-index: 7; }
.node:hover .node-dot { transform: scale(1.2); }
.node:hover .node-card { border-color: var(--node-c); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.node:hover .node-stem { opacity: 0.7; }

.node.selected { z-index: 8; }
.node.selected .node-dot { transform: scale(1.3); box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 7px color-mix(in oklch, var(--node-c) 30%, transparent); }
.node.selected .node-card { border-color: var(--node-c); box-shadow: 0 0 0 2px color-mix(in oklch, var(--node-c) 45%, transparent), var(--shadow-md); }
.node.selected .node-stem { opacity: 0.7; }

.node.related .node-card { border-color: color-mix(in oklch, var(--node-c) 55%, var(--line)); box-shadow: var(--shadow-md); }

/* ── İLİŞKİ İŞARETİ: tıklanan olaya bağlı kartlar — ilişki rengiyle çerçeve + numara ── */
.node.rel-marked { z-index: 7; }
.node.rel-marked .node-card {
  border-color: var(--rel-c, var(--node-c));
  box-shadow: 0 0 0 1.5px color-mix(in oklch, var(--rel-c, var(--node-c)) 50%, transparent), var(--shadow-md);
}
.node.rel-marked .node-card::before { background: var(--rel-c, var(--node-c)); width: 4px; }
.node.rel-marked .node-dot { border-color: var(--rel-c, var(--node-c)); transform: scale(1.12); }
.node.rel-marked .node-stem { opacity: 0.6; background: var(--rel-c, var(--node-c)); }
/* numaralı rozet — sol üst köşede yanar (compare rozetiyle çakışmaz) */
.node-rel-badge {
  position: absolute; top: -10px; left: -10px; z-index: 9;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 100px;
  background: var(--rel-c, var(--amber)); color: #fff;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 800; line-height: 1;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
  border: 2px solid var(--bg-1);
  box-shadow: 0 2px 9px color-mix(in oklch, var(--rel-c, var(--amber)) 55%, transparent);
}

/* dim: sönükleştirme TAMAMEN filter: opacity() üzerinden. kr-rise giriş
   animasyonu (fill: both) 'opacity' ÖZELLİĞİNİ 1'e sabitlediğinden opacity
   özelliği kullanılmaz — kullanılsaydı hareket-kapalıyken filtreyle çarpışıp
   (0.34 × 0.4 ≈ 0.14) aşırı soluklaşırdı. filter, animasyonun dokunmadığı
   kanaldır → hareket açık/kapalı her durumda tutarlı ~%40 sönük. */
.node.dim { filter: saturate(0.55) opacity(0.4); }
.node.dim:hover { filter: saturate(0.9) opacity(0.95); }

/* karşılaştır / harita seçim rozeti */
.node-badge {
  position: absolute; top: -9px; right: -9px; z-index: 6;
  width: 23px; height: 23px; border-radius: 50%; background: var(--amber); color: #fff;
  font-family: var(--font-ui); font-size: 12px; font-weight: 700;
  display: grid; place-items: center; box-shadow: var(--shadow-md); border: 2px solid var(--bg-1);
}

/* tuval üstü ipucu */
.canvas-hint {
  position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-ui); font-size: 13px; color: var(--ink-2); font-weight: 500;
  letter-spacing: 0.005em; background: var(--bg-1); border: 1px solid var(--line);
  padding: 9px 18px; border-radius: 100px; z-index: 6; pointer-events: none;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; box-shadow: var(--shadow-md);
}
.canvas-hint b { color: var(--amber); font-weight: 600; }
.canvas-hint kbd {
  font-family: var(--font-ui); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 7px; color: var(--ink-2); font-size: 11px; font-weight: 600;
}

/* boş-durum — hiçbir olay görünmediğinde (tüm temalar kapalı / arama eşleşmesiz) */
.canvas-empty {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  display: grid; place-items: center; padding: 24px;
}
/* makro bant açıkken kartı çizelge alanında ortala, bandın üstünü kapatma */
.canvas-wrap.with-macro .canvas-empty { bottom: 150px; }
.canvas-empty-card {
  pointer-events: auto; max-width: 420px; text-align: center;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px 30px; box-shadow: var(--shadow-md);
}
.canvas-empty-ic {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px; line-height: 1;
  color: var(--amber); background: var(--amber-dim); border: 1px solid color-mix(in oklch, var(--amber) 22%, var(--line));
}
.canvas-empty-h {
  font-family: var(--font-display); font-weight: 600; font-size: 19px;
  color: var(--ink); margin-bottom: 7px; letter-spacing: 0.01em;
}
.canvas-empty-s {
  font-family: var(--font-ui); font-size: 13.5px; line-height: 1.55;
  color: var(--ink-2); font-weight: 500;
}

/* ===========================================================================
   SAĞ DRAWER — detay
   =========================================================================== */
.drawer {
  position: fixed; top: var(--panel-top, 120px); right: 0; bottom: 0; z-index: 20;
  width: min(430px, 94vw); flex: none; border-left: 1px solid var(--line); background: var(--bg-1);
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: var(--shadow-lg);
}
.drawer-head {
  padding: 22px 22px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 14px; position: relative;
  background: var(--bg-1);
}
.drawer-head::before {            /* tema rengi üst şerit */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: var(--dr-c, var(--line));
}
.dr-kicker { font-family: var(--font-ui); font-size: 11.5px; letter-spacing: 0.08em; color: var(--dr-c, var(--ink-3)); text-transform: uppercase; font-weight: 700; }
.dr-date { font-family: var(--font-ui); font-size: 13px; color: var(--ink-2); margin-top: 6px; letter-spacing: 0.01em; font-weight: 500; }
.dr-title { font-family: var(--font-display); font-size: 27px; font-weight: 600; line-height: 1.15; margin-top: 9px; letter-spacing: 0.002em; color: var(--ink); text-wrap: balance; }
.dr-close {
  margin-left: auto; appearance: none; border: 1px solid var(--line); background: var(--bg-1);
  color: var(--ink-2); cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
  font-size: 15px; display: grid; place-items: center; flex: none; transition: all .15s;
}
.dr-close:hover { color: var(--amber); border-color: var(--amber); background: var(--amber-dim); }
.drawer-body { overflow-y: auto; flex: 1; padding: 22px; }

.dr-section { margin-bottom: 26px; }
.dr-h {
  font-family: var(--font-ui); font-size: 11.5px; letter-spacing: 0.08em; color: var(--ink-3);
  text-transform: uppercase; margin-bottom: 11px; display: flex; align-items: center; gap: 10px; font-weight: 700;
}
.dr-h::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.dr-h .h-cnt { color: var(--ink-3); font-weight: 700; }
.dr-summary { font-family: var(--font-display); font-size: 17px; line-height: 1.62; color: var(--ink); }
.dr-detail { font-family: var(--font-display); font-size: 15.5px; line-height: 1.72; color: var(--ink-2); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 0.005em; font-weight: 500;
  padding: 5px 13px; border-radius: 100px; border: 1px solid color-mix(in oklch, var(--tag-c, var(--line)) 35%, var(--line));
  color: var(--tag-c, var(--ink-2)); background: color-mix(in oklch, var(--tag-c, var(--bg-2)) 9%, var(--bg-1));
  display: inline-flex; align-items: center; gap: 7px;
}
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 100px; padding: 6px 13px; display: inline-flex; align-items: center; gap: 8px;
  cursor: default; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.person::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); transition: background .15s; }
.person.person-link { cursor: pointer; }
.person.person-link:hover { background: var(--amber-dim); border-color: color-mix(in oklch, var(--amber) 40%, var(--line)); color: var(--amber); box-shadow: var(--shadow-sm); }
.person.person-link:hover::before { background: var(--amber); }

/* alt konu satır içi kişi */
.sub-person { }
.sub-person.sub-person-link { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.sub-person.sub-person-link:hover { color: var(--amber); }

/* ---- KİŞİ PROFİL PANELİ (PersonDrawer) -------------------------------- */
.pdr-head-inner {
  display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0;
}
.pdr-svg-avatar { border-radius: 50%; box-shadow: 0 2px 8px oklch(0.3 0.04 50 / 0.25); flex-shrink: 0; }
.pdr-back { padding: 10px 20px 2px; }
.pdr-back-btn {
  appearance: none; border: none; background: none; padding: 0; cursor: pointer;
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color .15s;
}
.pdr-back-btn:hover { color: var(--amber); }

.pdr-info-grid { display: flex; flex-direction: column; gap: 8px; }
.pdr-info-row { display: flex; align-items: center; gap: 10px; }
.pdr-info-key { font-family: var(--font-ui); font-size: 11.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; min-width: 90px; flex: none; }

/* desen / tema çubukları */
.pdr-bars { display: flex; flex-direction: column; gap: 9px; }
.pdr-bar-row { display: flex; align-items: center; gap: 10px; }
.pdr-bar-label { display: flex; align-items: center; gap: 6px; min-width: 140px; flex: none; }
.pdr-glyph { font-size: 13px; color: var(--ink-3); flex: none; }
.pdr-pat-name { font-family: var(--font-ui); font-size: 12px; color: var(--ink-2); font-weight: 500; line-height: 1.3; }
.pdr-bar-track {
  flex: 1; height: 6px; border-radius: 100px; background: var(--bg-3); overflow: hidden;
}
.pdr-bar-fill {
  height: 100%; border-radius: 100px;
  background: var(--bc, var(--amber));
  width: var(--bw, 0%);
  transition: width .6s cubic-bezier(.2,.7,.3,1);
}
.pdr-pct {
  font-family: var(--font-ui); font-size: 11px; font-weight: 700;
  color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; min-width: 32px; text-align: right;
}

/* ---- ALT KONULAR (sub-topics) ----------------------------------------- */
.subs { display: flex; flex-direction: column; gap: 10px; }
.sub {
  border: 1px solid var(--line); border-left: 3px solid var(--sub-c, var(--line));
  border-radius: var(--radius); padding: 12px 14px; background: var(--bg-1);
  transition: all .15s; box-shadow: var(--shadow-sm);
}
.sub:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.sub-top { display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px; }
.sub-yr { font-family: var(--font-ui); font-size: 11.5px; font-weight: 700; color: var(--sub-c, var(--ink-3)); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; flex: none; }
.sub-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.sub-glyphs { margin-left: auto; display: inline-flex; gap: 4px; color: var(--cyan); font-size: 12px; flex: none; }
.sub-sum { font-family: var(--font-display); font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.sub-people { margin-top: 7px; font-family: var(--font-ui); font-size: 11.5px; color: var(--ink-3); font-weight: 500; }

/* bağlantı listesi (detayda) — örüntü motoru çıktısı */
.link-item {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px;
  margin-bottom: 10px; cursor: pointer; transition: all .15s; background: var(--bg-1);
}
.link-item:hover { background: var(--bg-1); border-color: var(--li-c, var(--line)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
/* rezonans listesi aç/kapa — ilk 6'dan sonrasını talep üzerine göster */
.reso-more {
  appearance: none; width: 100%; margin-top: 2px; cursor: pointer;
  background: var(--bg-1); border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--ink-2); font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.01em; padding: 10px 14px; transition: all .15s;
}
.reso-more:hover { border-color: color-mix(in oklch, var(--amber) 45%, var(--line)); color: var(--amber); background: var(--amber-dim); }
.li-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.li-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--li-c, var(--ink-3)); flex: none; }
.li-yr { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.li-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.li-via { margin-left: auto; font-family: var(--font-ui); font-size: 10px; color: var(--amber); letter-spacing: 0.04em; font-weight: 700; text-transform: uppercase; }
.li-note { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin-top: 9px; }
.li-arrow { margin-left: auto; color: var(--ink-3); font-size: 13px; }

/* rezonans (örüntü gücü) metre */
.li-reso { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.reso-bar { flex: 1; height: 5px; border-radius: 100px; background: var(--bg-3); overflow: hidden; }
.reso-fill { height: 100%; border-radius: 100px; background: var(--amber); width: var(--w, 0%); }
.reso-val { font-family: var(--font-ui); font-size: 11px; font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; flex: none; }
.li-shared { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.li-chip {
  font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--cyan);
  border: 1px solid color-mix(in oklch, var(--cyan) 30%, var(--line)); border-radius: 100px;
  padding: 2px 9px; background: var(--cyan-dim);
}

/* ===========================================================================
   KARŞILAŞTIRMA GÖRÜNÜMÜ
   =========================================================================== */
.compare {
  position: fixed; top: var(--panel-top, 120px); right: 0; bottom: 0; z-index: 20;
  width: min(640px, 96vw); flex: none; border-left: 1px solid var(--line); background: var(--bg-1);
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: var(--shadow-lg);
}
.cmp-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
}
.cmp-head .cmp-t { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: 0.005em; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 0; }
.cmp-col { overflow-y: auto; padding: 22px; }
.cmp-col + .cmp-col { border-left: 1px solid var(--line); }
.cmp-col.empty { display: grid; place-items: center; text-align: center; color: var(--ink-3); }
.cmp-empty-ic { font-size: 30px; color: var(--line); margin-bottom: 12px; }
.cmp-pick { font-family: var(--font-ui); font-size: 13.5px; line-height: 1.7; letter-spacing: 0.005em; }
.cmp-yr { font-family: var(--font-ui); font-size: 12.5px; color: var(--cc, var(--ink-3)); letter-spacing: 0.02em; font-weight: 600; }
.cmp-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.2; margin: 8px 0 15px; color: var(--ink); text-wrap: balance; }
.cmp-body { font-family: var(--font-display); font-size: 14.5px; line-height: 1.68; color: var(--ink-2); }
.cmp-x { margin-left: auto; }

/* paylaşılan desen analizi (alt şerit) */
.cmp-analysis {
  border-top: 1px solid var(--line); padding: 18px 22px; background: var(--bg-2); flex: none; max-height: 44%; overflow-y: auto;
}
.cmp-shared-h { font-family: var(--font-ui); font-size: 11.5px; letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 12px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.cmp-shared-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cmp-verdict { font-family: var(--font-display); font-size: 15px; line-height: 1.65; color: var(--ink); }
.cmp-verdict b { color: var(--amber); font-weight: 600; }
.cmp-none { font-size: 13.5px; color: var(--ink-3); font-style: italic; }

/* rezonans göstergesi (karşılaştırma) */
.cmp-reso { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.reso-dial {
  --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--bg-3) 0);
  display: grid; place-items: center; position: relative;
}
.reso-dial::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg-2); }
.reso-dial b { position: relative; z-index: 1; font-family: var(--font-ui); font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.reso-meta { font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.reso-meta .reso-lead { font-weight: 700; color: var(--amber); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===========================================================================
   AÇILIŞ EKRANI — sakin
   =========================================================================== */
.boot {
  position: fixed; inset: 0; z-index: 100; background: var(--bg-0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  animation: kr-bootfade .6s ease forwards; animation-delay: 2.0s;
}
@keyframes kr-bootfade { to { opacity: 0; visibility: hidden; } }
.boot-ring {
  width: 52px; height: 52px; border-radius: 50%; border: 2.5px solid var(--line);
  border-top-color: var(--amber); animation: kr-spin 1s cubic-bezier(.5,.1,.5,.9) infinite;
}
@keyframes kr-spin { to { transform: rotate(360deg); } }
.boot-lines { display: none; }   /* terminal log gizli */
.boot-title { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; font-size: 38px; color: var(--ink); }
.boot-title span { color: var(--amber); }
.boot-sub { font-family: var(--font-ui); font-size: 13.5px; color: var(--ink-3); font-weight: 500; letter-spacing: 0.02em; margin-top: -10px; }

/* "şimdi" işaretçisi */
.present { position: absolute; top: 0; bottom: 44px; z-index: 3; pointer-events: none; }
.present-ln {
  position: absolute; top: 0; bottom: 0; left: 0; width: 1.5px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  opacity: 0.5;
}
.present-lbl {
  position: absolute; top: 16px; left: 9px; font-family: var(--font-ui);
  font-size: 11px; letter-spacing: 0.1em; color: var(--cyan); white-space: nowrap; font-weight: 700;
}
.present-sub {
  position: absolute; top: 33px; left: 9px; font-family: var(--font-ui);
  font-size: 11px; color: var(--ink-3); letter-spacing: 0.01em; white-space: nowrap; font-weight: 500;
}

/* küçük yardımcılar */
.mono { font-family: var(--font-ui); }
.empty-state {
  flex: 1; display: grid; place-items: center; text-align: center; padding: 40px;
  color: var(--ink-3);
}
.empty-state .es-ic { font-size: 32px; margin-bottom: 14px; color: var(--line); }
.empty-state .es-t { font-size: 14px; color: var(--ink-2); line-height: 1.6; max-width: 280px; }

/* ---- AYARLAR (tweaks) açma düğmesi — bağımsız sitede gerekli ----------- */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 2147483645;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-1); color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; font-size: 19px;
  box-shadow: var(--shadow-md); transition: all .16s;
}
.fab:hover { color: var(--amber); border-color: var(--amber); transform: rotate(40deg); box-shadow: var(--shadow-lg); }

@media (max-width: 760px) {
  .rail { display: none; }
}

/* ===========================================================================
   DİNAMİK / HAREKET KATMANI
   body[data-motion="1"] etkin; "Hareket" anahtarı ve reduced-motion ile kapanır.
   =========================================================================== */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

/* düğümler sahneye süzülerek girer (x'e göre kademeli) */
@keyframes kr-rise { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
body[data-motion="1"] .node {
  animation: kr-rise .5s cubic-bezier(.2,.7,.3,1) both;
  animation-delay: calc(min(var(--enter-i, 0), 40) * 16ms);
}

/* bağlantı yayları: belirir, solid köprüler çizilir, kesik yaylar akar */
@keyframes kr-arc-in { from { opacity: 0; } }
@keyframes kr-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes kr-flow { to { stroke-dashoffset: -24; } }
body[data-motion="1"] .link-path.show {
  animation: kr-arc-in .55s ease backwards;
  animation-delay: calc(var(--arc-i, 0) * 55ms);
}
body[data-motion="1"] .link-path.core.show {
  stroke-dasharray: 1;
  animation: kr-arc-in .5s ease backwards, kr-draw .7s cubic-bezier(.3,.7,.3,1) backwards;
  animation-delay: calc(var(--arc-i, 0) * 55ms);
}
body[data-motion="1"] .link-path.pattern.show,
body[data-motion="1"] .link-path.user.show {
  animation: kr-arc-in .5s ease backwards, kr-flow 1.1s linear infinite;
}

/* seçili düğümde yayılan nabız halkası */
@keyframes kr-halo {
  0%   { box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 6px color-mix(in oklch, var(--node-c) 42%, transparent); }
  70%  { box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 18px color-mix(in oklch, var(--node-c) 0%, transparent); }
  100% { box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 18px transparent; }
}
body[data-motion="1"] .node.selected .node-dot { animation: kr-halo 1.9s ease-out infinite; }

/* "şimdi" işaretçisi nabzı */
@keyframes kr-present { 0%, 100% { opacity: .28; } 50% { opacity: .62; } }
body[data-motion="1"] .present-ln { animation: kr-present 2.8s ease-in-out infinite; }
@keyframes kr-present-glow { 0%,100% { text-shadow: none; } 50% { text-shadow: 0 0 10px color-mix(in oklch, var(--cyan) 55%, transparent); } }
body[data-motion="1"] .present-lbl { animation: kr-present-glow 2.8s ease-in-out infinite; }

/* rezonans çubuğu 0'dan dolar; karşılaştırma kadranı 0'dan süpürür */
@keyframes kr-fill { from { width: 0; } }
body[data-motion="1"] .reso-fill { animation: kr-fill .9s cubic-bezier(.2,.7,.3,1) backwards; }
body[data-motion="1"] .pdr-bar-fill { animation: kr-fill .7s cubic-bezier(.2,.7,.3,1) backwards; }
@keyframes kr-dial { from { --p: 0; } }
body[data-motion="1"] .reso-dial { animation: kr-dial 1s cubic-bezier(.2,.7,.3,1) backwards; }

/* sağ paneller içeri kayar */
@keyframes kr-panel-in { from { opacity: 0; transform: translateX(26px); } }
body[data-motion="1"] .drawer, body[data-motion="1"] .compare { animation: kr-panel-in .32s cubic-bezier(.2,.7,.3,1) backwards; }

/* alt konu kartları kademeli belirir */
@keyframes kr-sub-in { from { opacity: 0; transform: translateY(8px); } }
body[data-motion="1"] .sub { animation: kr-sub-in .4s ease backwards; animation-delay: calc(var(--sub-i, 0) * 45ms); }
body[data-motion="1"] .link-item { animation: kr-sub-in .42s ease backwards; animation-delay: calc(var(--li-i, 0) * 32ms); }

/* fareyle önizleme: bağlı düğümlere doğru yumuşak nabız */
@keyframes kr-peek { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
body[data-motion="1"] .node.related .node-card { animation: kr-peek 2.4s ease-in-out infinite; }

/* İLİŞKİ İŞARETİ — tıklanınca ilgili kartlar 1·2·3·4… sırasıyla "yanar" */
@keyframes kr-rel-card {
  0%   { box-shadow: 0 0 0 7px color-mix(in oklch, var(--rel-c) 42%, transparent), var(--shadow-md); }
  55%  { box-shadow: 0 0 0 4px color-mix(in oklch, var(--rel-c) 30%, transparent), var(--shadow-md); }
  100% { box-shadow: 0 0 0 1.5px color-mix(in oklch, var(--rel-c) 50%, transparent), var(--shadow-md); }
}
@keyframes kr-rel-badge {
  0%   { opacity: 0; transform: scale(0.2); }
  60%  { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes kr-rel-dot {
  0%   { box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 5px color-mix(in oklch, var(--rel-c) 55%, transparent); }
  100% { box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 11px color-mix(in oklch, var(--rel-c) 0%, transparent); }
}
body[data-motion="1"] .node.rel-marked .node-card {
  animation: kr-rel-card .55s cubic-bezier(.3,.7,.3,1) backwards;
  animation-delay: calc(var(--rel-i, 0) * 95ms);
}
body[data-motion="1"] .node.rel-marked .node-rel-badge {
  animation: kr-rel-badge .46s cubic-bezier(.34,1.56,.64,1) backwards;
  animation-delay: calc(var(--rel-i, 0) * 95ms);
}
body[data-motion="1"] .node.rel-marked .node-dot {
  animation: kr-rel-dot .9s ease-out backwards;
  animation-delay: calc(var(--rel-i, 0) * 95ms);
}

/* canlı saat ve sayaçlar için yumuşak değişim */
.stat b { transition: color .2s; }

/* reduced-motion: tüm dekoratif hareketi durdur */
@media (prefers-reduced-motion: reduce) {
  body[data-motion] .node, body[data-motion] .link-path.show, body[data-motion] .drawer,
  body[data-motion] .compare, body[data-motion] .present-ln, body[data-motion] .present-lbl,
  body[data-motion] .node.selected .node-dot, body[data-motion] .reso-fill,
  body[data-motion] .reso-dial, body[data-motion] .sub, body[data-motion] .link-item,
  body[data-motion] .node.related .node-card,
  body[data-motion] .node.rel-marked .node-card,
  body[data-motion] .node.rel-marked .node-rel-badge,
  body[data-motion] .node.rel-marked .node-dot {
    animation: none !important;
  }
}

/* ===========================================================================
   ÇANKAYA / KİTAP KAYNAĞI KATMANI
   Kaynak okumaları (açılır) + kanon-dışı kitap düğümleri.
   =========================================================================== */
.dr-book {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--amber);
  background: var(--amber-dim); border: 1px solid color-mix(in oklch, var(--amber) 30%, transparent);
  padding: 3px 11px; border-radius: 100px;
}

.readings { display: flex; flex-direction: column; gap: 9px; }
.reading { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); overflow: hidden; transition: border-color .18s; }
.reading.open { border-color: color-mix(in oklch, var(--amber) 35%, var(--line)); }
.reading-head {
  width: 100%; display: flex; align-items: baseline; gap: 9px; text-align: left;
  background: var(--bg-2); border: none; cursor: pointer; padding: 11px 13px;
  font-family: var(--font-ui); color: var(--ink); transition: background .15s;
}
.reading-head:hover { background: var(--bg-3); }
.reading-caret { color: var(--amber); font-size: 11px; flex: none; transition: transform .26s cubic-bezier(.2,.7,.3,1); }
.reading.open .reading-caret { transform: rotate(90deg); }
.reading-src { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--amber); flex: none; white-space: nowrap; }
.reading-title { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.reading-body {
  padding: 13px 15px 15px; font-family: var(--font-display); font-size: 14.5px;
  line-height: 1.72; color: var(--ink-2); white-space: pre-line;
  border-top: 1px solid var(--line-soft);
}

/* ---- REAKTİF AÇILIR/KAPANIR KABUK -------------------------------------- */
.kr-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .34s cubic-bezier(.2,.7,.3,1); }
.kr-collapse.open { grid-template-rows: 1fr; }
.kr-collapse-inner { overflow: hidden; min-height: 0; }
.kr-collapse > .kr-collapse-inner > * { transition: opacity .3s ease, transform .3s ease; }
.kr-collapse:not(.open) > .kr-collapse-inner > * { opacity: 0; transform: translateY(-5px); }
body[data-motion="0"] .kr-collapse { transition: none; }
body[data-motion="0"] .kr-collapse > .kr-collapse-inner > * { transition: none; }

/* açılır/kapanır okuma bölümü başlığı (dr-h görünümünü koruyan buton) */
.dr-h-btn {
  appearance: none; width: 100%; background: none; border: 0; cursor: pointer;
  text-align: left; padding: 0; -webkit-tap-highlight-color: transparent;
}
.dr-h-btn .dr-h-txt { flex: none; }
.dr-caret {
  flex: none; color: var(--amber); font-size: 10px; line-height: 1;
  transition: transform .26s cubic-bezier(.2,.7,.3,1);
}
.dr-collapsible.open .dr-caret { transform: rotate(90deg); }
.dr-h-btn:hover .dr-h-txt { color: var(--ink-2); }
.dr-collapsible .dr-sec-body { padding-top: 2px; }

/* ---- GÖRSEL GALERİSİ (ek görseller) ----------------------------------- */
.dr-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dr-gimg {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2); text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s, border-color .2s;
}
.dr-gimg img {
  display: block; width: 100%; height: 132px; object-fit: cover;
  filter: sepia(.1) saturate(.95);
  transition: filter .35s, transform .55s cubic-bezier(.2,.7,.3,1);
}
.dr-gimg:hover { transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: color-mix(in oklch, var(--amber) 40%, var(--line)); }
.dr-gimg:hover img { filter: none; transform: scale(1.05); }
.dr-gcap {
  display: block; padding: 6px 9px; font-family: var(--font-ui); font-size: 11px;
  color: var(--ink-2); line-height: 1.35; border-top: 1px solid var(--line-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-theme="dark"] .dr-gimg img { filter: brightness(.85) saturate(.92); }
html[data-theme="dark"] .dr-gimg:hover img { filter: brightness(1) saturate(1); }

/* ---- VESİKA & HABER ARŞİVİ -------------------------------------------- */
.dr-archive { display: flex; flex-direction: column; gap: 9px; }
.arc-item {
  display: flex; gap: 11px; align-items: stretch; text-decoration: none;
  border: 1px solid var(--line); border-left: 3px solid var(--ink-3);
  border-radius: var(--radius); background: var(--bg-1); padding: 10px 12px;
  transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
}
.arc-item:hover { background: var(--bg-2); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.arc-vesika { border-left-color: var(--amber); }
.arc-kupur  { border-left-color: var(--cyan); }
.arc-haber  { border-left-color: var(--th-dis); }
.arc-thumb {
  flex: none; width: 54px; height: 54px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
}
.arc-thumb img { width: 100%; height: 100%; object-fit: cover; }
html[data-theme="dark"] .arc-thumb img { filter: brightness(.85); }
.arc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.arc-top { display: flex; align-items: center; gap: 8px; }
.arc-kind {
  font-family: var(--font-ui); font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  padding: 1.5px 7px; border-radius: 100px; flex: none;
}
.arc-vesika .arc-kind { color: var(--amber); background: var(--amber-dim); }
.arc-kupur  .arc-kind { color: var(--cyan); background: var(--cyan-dim); }
.arc-haber  .arc-kind { color: var(--th-dis); background: color-mix(in oklch, var(--th-dis) 15%, transparent); }
.arc-date { font-family: var(--font-ui); font-size: 10.5px; color: var(--ink-3); }
.arc-title { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.arc-src { font-family: var(--font-ui); font-size: 11px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.arc-ext { color: var(--amber); font-weight: 700; }
.arc-item:hover .arc-title { color: var(--amber); }

/* kanon-dışı kitap düğümü — kesik hatlar + sıcak aksan */
.node.book .node-dot { border-style: dashed; }
.node.book .node-card {
  border-style: dashed;
  border-color: color-mix(in oklch, var(--amber) 42%, var(--line));
  background: color-mix(in oklch, var(--amber) 4%, var(--bg-1));
}
.node.book .node-card::before {
  background: repeating-linear-gradient(180deg, var(--amber) 0 5px, transparent 5px 11px);
}
.node-src {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--amber);
  background: var(--amber-dim); padding: 2px 9px; border-radius: 100px;
}

.legend-row .ln.book { border-top: 2px dashed var(--amber); }

/* ===========================================================================
   İKİNCİL / MINOR OLAY BALONCUKLARI
   Küçük hap biçimli kart, ince nokta, kısa sapı: önem hiyerarşisini görsel
   olarak kodlar. Tıklanabilir, çekmece içeriği normaldir.
   =========================================================================== */
.node.minor .node-dot {
  width: 9px; height: 9px;
  border-width: 2px;
  box-shadow: 0 0 0 3px var(--bg-0);
}
.node.minor .node-stem { opacity: 0.22; }
.node.minor .node-card {
  width: 112px;
  padding: 5px 10px 5px 12px;
  border-radius: 100px;
  box-shadow: none;
  border-color: var(--line-soft);
  background: color-mix(in oklch, var(--node-c, var(--ink-3)) 4%, var(--bg-1));
}
.node.minor .node-card::before {
  width: 3px;
  top: 6px; bottom: 6px;
  border-radius: 3px;
}
.node.minor .node-yr {
  font-size: 10px;
  letter-spacing: 0.02em;
}
.node.minor .node-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 1px;
  color: var(--ink-2);
}
.node.minor .node-pats { display: none; }

.node.minor:hover .node-dot { transform: scale(1.15); }
.node.minor:hover .node-card {
  border-color: color-mix(in oklch, var(--node-c) 55%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  background: var(--bg-1);
}
.node.minor.selected .node-dot {
  transform: scale(1.25);
  box-shadow: 0 0 0 3px var(--bg-0), 0 0 0 5px color-mix(in oklch, var(--node-c) 30%, transparent);
}
.node.minor.selected .node-card {
  border-color: var(--node-c);
  border-radius: 100px;
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--node-c) 35%, transparent);
}

/* ===========================================================================
   MAKRO BANT — nüfus · kalkınma · siyasi yapı (zaman eksenine hizalı)
   =========================================================================== */
.canvas-wrap.with-macro .canvas-scroll { bottom: 150px; }
.canvas-wrap.with-macro .canvas-hint { bottom: 166px; }
.macro-band {
  position: absolute; left: 0; right: 0; bottom: 0; height: 150px; z-index: 6;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  overflow: hidden; box-shadow: 0 -8px 24px -16px oklch(0.4 0.03 50 / 0.4);
}
.mb-scroll { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mb-track { position: relative; }
.mb-svg { display: block; }
.mb-gutter {
  position: absolute; left: 0; top: 0; width: 108px; height: 100%; z-index: 3;
  background: linear-gradient(90deg, var(--bg-1) 70%, transparent); pointer-events: none;
}
.mb-glabel {
  position: absolute; left: 13px; font-family: var(--font-ui); font-size: 9px;
  letter-spacing: 0.09em; font-weight: 700; color: var(--ink-3); text-transform: uppercase;
}
.mb-glabel.mb-dem { color: color-mix(in oklch, var(--th-dis) 65%, var(--ink-3)); }
.mb-reg-lbl {
  font-family: var(--font-ui); font-size: 9px; font-weight: 700; letter-spacing: 0.03em;
  fill: #F5EFE4; opacity: 0.95;
}
.mb-pop-area { fill: color-mix(in oklch, var(--amber) 13%, transparent); stroke: none; }
.mb-pop-line { fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linejoin: round; }
.mb-pop-dot { fill: var(--amber); }
.mb-pop-dot.est { fill: var(--bg-1); stroke: var(--amber); stroke-width: 1; }
.mb-dem-line { fill: none; stroke: var(--th-dis); stroke-width: 1.6; stroke-dasharray: 4 3; opacity: 0.92; stroke-linejoin: round; }
.mb-grow.pos { fill: var(--th-reform); opacity: 0.82; }
.mb-grow.neg { fill: var(--th-kriz); opacity: 0.85; }
.mb-grow-base { stroke: var(--line); stroke-width: 1; }
.mb-guide { stroke: var(--amber); stroke-width: 1.4; stroke-dasharray: 3 3; opacity: 0.65; }

/* ===========================================================================
   NEDENSEL YAYLAR (yönlü ok) — "Neden-Sonuç" modu
   =========================================================================== */
.link-path.causal-tetikleyici { stroke: var(--th-kriz);  stroke-dasharray: none; stroke-width: 2.2; }
.link-path.causal-zemin       { stroke: var(--th-dis);   stroke-dasharray: 6 4;  stroke-width: 1.8; }
.link-path.causal-hizlandirici{ stroke: var(--th-darbe); stroke-dasharray: 2 3;  stroke-width: 2; }
.link-path.causal-tepki       { stroke: var(--th-rejim); stroke-dasharray: 9 3 2 3; stroke-width: 1.9; }
.kr-arrow-head { fill: var(--ink-3); fill: context-stroke; }

/* ===========================================================================
   MAKRO BAĞLAM kutusu (olay çekmecesi)
   =========================================================================== */
.macro-ctx { display: flex; flex-direction: column; gap: 9px; }
.mctx-regime {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line);
}
.mctx-regime .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mctx-regime .lbl { font-family: var(--font-display); font-size: 14px; color: var(--ink); font-weight: 600; }
.mctx-regime .sub { margin-left: auto; font-family: var(--font-ui); font-size: 11px; color: var(--ink-3); }
.mctx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mctx-cell { padding: 9px 11px; border-radius: var(--radius); background: var(--bg-1); border: 1px solid var(--line); }
.mctx-cell.full { grid-column: 1 / -1; }
.mctx-key { font-family: var(--font-ui); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.mctx-val { font-family: var(--font-display); font-size: 17px; color: var(--ink); font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mctx-val .u { font-size: 11px; color: var(--ink-3); font-weight: 500; margin-left: 3px; }
.mctx-val.pos { color: var(--th-reform); }
.mctx-val.neg { color: var(--th-kriz); }
.mctx-note { font-family: var(--font-ui); font-size: 11px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.mctx-spark { margin-top: 6px; }

/* ===========================================================================
   NEDEN → OLAY → SONUÇ zinciri (olay çekmecesi + Neden-Sonuç modu)
   =========================================================================== */
.causal-wrap { display: flex; flex-direction: column; gap: 7px; }
.cz-band { display: flex; flex-direction: column; gap: 6px; }
.cz-head {
  display: flex; align-items: center; gap: 7px; font-family: var(--font-ui);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3);
}
.cz-head .ar { font-size: 13px; }
.cz-head.up .ar { color: var(--th-dis); }
.cz-head.down .ar { color: var(--th-kriz); }
.cz-pivot {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid color-mix(in oklch, var(--amber) 40%, var(--line));
  background: color-mix(in oklch, var(--amber) 7%, var(--bg-1));
}
.cz-pivot .yr { font-family: var(--font-ui); font-weight: 700; color: var(--amber); font-size: 12px; font-variant-numeric: tabular-nums; }
.cz-pivot .ttl { font-family: var(--font-display); font-size: 14px; color: var(--ink); font-weight: 600; }
.cz-item {
  display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border-radius: var(--radius);
  background: var(--bg-1); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s; border-left-width: 3px;
}
.cz-item:hover { background: var(--bg-2); transform: translateX(2px); }
.cz-item.up { border-left-color: var(--th-dis); }
.cz-item.down { border-left-color: var(--th-kriz); }
.cz-top { display: flex; align-items: center; gap: 7px; }
.cz-top .yr { font-family: var(--font-ui); font-size: 11px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.cz-top .ttl { font-family: var(--font-display); font-size: 13.5px; color: var(--ink); font-weight: 600; line-height: 1.25; }
.cz-type {
  margin-left: auto; flex: none; font-family: var(--font-ui); font-size: 9px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 100px;
  border: 1px solid currentColor;
}
.cz-type.tetikleyici { color: var(--th-kriz); }
.cz-type.zemin { color: var(--th-dis); }
.cz-type.hizlandirici { color: var(--th-darbe); }
.cz-type.tepki { color: var(--th-rejim); }
.cz-mech { font-family: var(--font-ui); font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.cz-lag { font-family: var(--font-ui); font-size: 10.5px; color: var(--ink-3); }
.cz-empty { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); font-style: italic; padding: 4px 2px; }

/* Neden-Sonuç modu — sol ray içgörü kartları */
.cv-insight {
  padding: 11px 13px; border-radius: var(--radius); background: var(--bg-1);
  border: 1px solid var(--line); margin-bottom: 9px;
}
.cv-insight .k { font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.03em; }
.cv-insight .v { font-family: var(--font-display); font-size: 15px; color: var(--amber); font-weight: 600; margin: 2px 0 4px; }
.cv-insight .d { font-family: var(--font-ui); font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.cz-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 4px; }
.cz-legend .lg { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 11px; color: var(--ink-2); }
.cz-legend .sw { width: 16px; height: 0; border-top-width: 2.4px; border-top-style: solid; }
.cz-legend .sw.tetikleyici { border-color: var(--th-kriz); }
.cz-legend .sw.zemin { border-color: var(--th-dis); border-top-style: dashed; }
.cz-legend .sw.hizlandirici { border-color: var(--th-darbe); border-top-style: dotted; }
.cz-legend .sw.tepki { border-color: var(--th-rejim); border-top-style: dashed; }

/* MAKRO bant aç/kapa düğmesi */
.era-btn.macro-toggle.active {
  background: color-mix(in oklch, var(--amber) 12%, var(--bg-1));
  border-color: color-mix(in oklch, var(--amber) 55%, var(--line));
  color: var(--amber); font-weight: 700;
}

/* ===========================================================================
   SVG SANAT KATMANI (KronosArt) — hatlı, hareketli amblemler
   Tüm dekoratif animasyonlar body[data-motion="1"] ile kapılıdır.
   =========================================================================== */
.ka { display: block; }

/* pusula ibresi · küre yörüngesi · radar süpürmesi — kendi merkezinde döner */
@keyframes ka-spin { to { transform: rotate(360deg); } }
body[data-motion="1"] .ka-needle { animation: ka-spin 14s cubic-bezier(.6,.05,.4,.95) infinite; transform-origin: 24px 24px; }
body[data-motion="1"] .ka-sweep { animation: ka-spin 3.6s linear infinite; transform-origin: 24px 24px; }
body[data-motion="1"] .ka-orbit { animation: ka-spin 7s linear infinite; transform-origin: 24px 24px; }

/* kesikli halkalar usulca akar */
@keyframes ka-dash { to { stroke-dashoffset: -36; } }
body[data-motion="1"] .ka-dash-rot { animation: ka-dash 6s linear infinite; }

/* yıldız nabzı + kıvılcımlar */
@keyframes ka-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
body[data-motion="1"] .ka-pulse { animation: ka-pulse 2.6s ease-in-out infinite; transform-origin: 24px 24px; }
@keyframes ka-spark { 0%,100% { opacity: .15; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-3px); } }
body[data-motion="1"] .ka-spark { animation: ka-spark 3s ease-in-out infinite; }
body[data-motion="1"] .ka-spark-2 { animation-delay: .8s; }
body[data-motion="1"] .ka-spark-3 { animation-delay: 1.7s; }

/* radar/sismograf ışıması */
@keyframes ka-blip { 0%,100% { opacity: .1; } 45% { opacity: 1; } }
body[data-motion="1"] .ka-blip { animation: ka-blip 1.8s ease-in-out infinite; }

/* terazi salınımı */
@keyframes ka-tilt { 0%,100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
body[data-motion="1"] .ka-tilt { animation: ka-tilt 4.5s ease-in-out infinite; transform-origin: 24px 13px; }

/* sismograf çizgisi akar */
@keyframes ka-quake { from { stroke-dashoffset: 1; } to { stroke-dashoffset: -1; } }
body[data-motion="1"] .ka-quake { stroke-dasharray: .65 .35; animation: ka-quake 2.8s linear infinite; }

/* domino taşları: sırayla yatıp kalkan üçlü */
@keyframes ka-tile-tip { 0%,55%,100% { transform: rotate(0); } 12%,40% { transform: rotate(58deg); } }
body[data-motion="1"] .ka-tile { transform-origin: 100% 100%; transform-box: fill-box; }
body[data-motion="1"] .ka-tile-1 { animation: ka-tile-tip 4.2s ease-in-out infinite; }
body[data-motion="1"] .ka-tile-2 { animation: ka-tile-tip 4.2s ease-in-out infinite .35s; }
body[data-motion="1"] .ka-tile-3 { animation: ka-tile-tip 4.2s ease-in-out infinite .7s; }

/* mürekkep çizgisi: bir kez çizilir */
@keyframes ka-ink-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.ka-ink { stroke-dasharray: 1; stroke-dashoffset: 0; }
body[data-motion="1"] .ka-ink { animation: ka-ink-draw 1.1s cubic-bezier(.3,.7,.3,1) backwards; }
.ka-flourish { color: var(--ink-3); opacity: .6; margin: 2px 0 10px; }
.ka-gem { opacity: .8; }

/* ---- ATMOSFER: sayfanın arkasında süzülen harita hatları ---------------- */
.atmos-art {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; color: var(--ink);
  opacity: .05;
}
@keyframes ka-drift-a { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-44px); } }
@keyframes ka-drift-b { 0%,100% { transform: translateX(0); } 50% { transform: translateX(38px); } }
body[data-motion="1"] .ka-drift-1 { animation: ka-drift-a 46s ease-in-out infinite; }
body[data-motion="1"] .ka-drift-2 { animation: ka-drift-b 38s ease-in-out infinite; }
body[data-motion="1"] .ka-rose-spin { animation: ka-spin 120s linear infinite; transform-origin: 0 0; }
.ka-rose { opacity: .8; }
@keyframes ka-mote { 0%,100% { transform: translate(0,0); opacity: .35; } 50% { transform: translate(14px,-22px); opacity: .9; } }
body[data-motion="1"] .ka-mote { animation: ka-mote 17s ease-in-out infinite; }
body[data-motion="1"] .ka-mote-2 { animation-duration: 23s; animation-delay: 3s; }
body[data-motion="1"] .ka-mote-3 { animation-duration: 19s; animation-delay: 7s; }
body[data-motion="1"] .ka-mote-4 { animation-duration: 27s; animation-delay: 11s; }
body[data-motion="1"] .ka-mote-5 { animation-duration: 21s; animation-delay: 5s; }

/* takımyıldız düğümleri — yavaş yanıp sönme (yalnız hareket açıkken) */
.ka-stars { opacity: .75; }
@keyframes ka-twinkle { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
body[data-motion="1"] .ka-twinkle { animation: ka-twinkle 6s ease-in-out infinite; }
body[data-motion="1"] .ka-twk-2 { animation-duration: 7.5s; animation-delay: 1.2s; }
body[data-motion="1"] .ka-twk-3 { animation-duration: 5s; animation-delay: 2.4s; }
body[data-motion="1"] .ka-twk-4 { animation-duration: 8s; animation-delay: .6s; }
body[data-motion="1"] .ka-twk-5 { animation-duration: 6.5s; animation-delay: 3.1s; }

/* boot amblemi */
.boot-emblem { color: var(--amber); margin-bottom: 18px; }
.boot-emblem .ka-ink-1 { animation-delay: .1s; }
.boot-emblem .ka-ink-2 { animation-delay: .7s; }
.boot-emblem .ka-ink-3 { animation-delay: 1s; }

/* ===========================================================================
   ÇEKMECE GÖRSEL KATMANI — olay fotoğrafı + tema amblemi + gerekçe çipleri
   =========================================================================== */
.dr-theme-art {
  flex: none; width: 46px; height: 46px; margin-right: 13px; margin-top: 2px;
  display: grid; place-items: center; opacity: .9;
}
.dr-figure {
  margin: 0 0 22px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2); box-shadow: var(--shadow-sm);
}
.dr-figure img {
  display: block; width: 100%; max-height: 230px; object-fit: cover;
  filter: sepia(.14) saturate(.92);
  transition: transform .6s cubic-bezier(.2,.7,.3,1), filter .4s;
}
.dr-figure:hover img { transform: scale(1.025); filter: sepia(0) saturate(1); }
.dr-figure figcaption {
  padding: 7px 12px; font-family: var(--font-ui); font-size: 11px; color: var(--ink-3);
  border-top: 1px solid var(--line-soft);
}
.dr-figure figcaption a { color: var(--ink-2); text-decoration: none; border-bottom: 1px dotted var(--ink-3); }
.dr-figure figcaption a:hover { color: var(--amber); border-color: var(--amber); }
@keyframes kr-fig-in { from { opacity: 0; transform: translateY(10px); } }
body[data-motion="1"] .dr-figure { animation: kr-fig-in .5s cubic-bezier(.2,.7,.3,1) backwards .08s; }

/* karşılaştırma sütunu küçük görseli */
.cmp-thumb { border-radius: 9px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 12px; }
.cmp-thumb img { display: block; width: 100%; height: 92px; object-fit: cover; filter: sepia(.14) saturate(.92); }

/* motor gerekçe çipleri: bu eşleşme neden kuruldu? */
.li-why { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.li-why-chip {
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .015em;
  padding: 2.5px 9px; border-radius: 100px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink-2);
}
.li-why-chip.w-köprü { color: var(--amber); border-color: color-mix(in oklch, var(--amber) 40%, var(--line)); background: var(--amber-dim); }
.li-why-chip.w-nedensel { color: var(--th-kriz); border-color: color-mix(in oklch, var(--th-kriz) 38%, var(--line)); background: color-mix(in oklch, var(--th-kriz) 8%, var(--bg-1)); }
.li-why-chip.w-desen { color: var(--cyan); border-color: color-mix(in oklch, var(--cyan) 40%, var(--line)); background: var(--cyan-dim); }
.li-why-chip.w-ritim { color: var(--th-rejim); border-color: color-mix(in oklch, var(--th-rejim) 36%, var(--line)); }
.cmp-why { margin: 10px 0 4px; }

/* ===========================================================================
   DOMİNO ETKİSİ MODU — ray, oynatıcı, taş durumları, comet yaylar
   =========================================================================== */
.dom-intro {
  display: flex; gap: 12px; align-items: center; margin: 6px 2px 14px;
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
}
.dom-intro b { color: var(--amber); }
.dom-intro-art { color: var(--amber); flex: none; }

.dom-prob .pat-glyph { font-size: 17px; }
.dom-prob.active .pat-sum { color: var(--ink-2); }

/* oynatıcı şeridi */
.dom-player {
  display: flex; align-items: center; gap: 9px; margin-bottom: 18px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2);
}
.dom-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-1); color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; transition: all .15s; flex: none;
  font-family: var(--font-ui); font-size: 11px; font-weight: 700;
}
.dom-btn:hover { color: var(--amber); border-color: var(--amber); background: var(--amber-dim); }
.dom-btn.big { width: 40px; height: 40px; color: var(--amber); border-color: color-mix(in oklch, var(--amber) 45%, var(--line)); }
.dom-btn.spd.on { color: var(--amber); border-color: var(--amber); background: var(--amber-dim); }
.dom-progress { flex: 1; min-width: 0; }
.dom-prog-track {
  height: 7px; border-radius: 100px; background: var(--bg-3);
  border: 1px solid var(--line-soft); cursor: pointer; overflow: hidden;
}
.dom-prog-fill {
  height: 100%; border-radius: 100px; background: var(--amber);
  transition: width .45s cubic-bezier(.2,.7,.3,1);
}
.dom-prog-lbl { font-family: var(--font-ui); font-size: 10.5px; color: var(--ink-3); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* güncel taş kartı */
.dom-now {
  border: 1px solid color-mix(in oklch, var(--dr-c, var(--amber)) 38%, var(--line));
  border-left: 3px solid var(--dr-c, var(--amber));
  border-radius: var(--radius); background: var(--bg-1); padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
@keyframes kr-dom-now-in { from { opacity: 0; transform: translateY(12px) rotate(.6deg); } }
body[data-motion="1"] .dom-now { animation: kr-dom-now-in .4s cubic-bezier(.2,.7,.3,1) backwards; }
.dom-now-yr { font-family: var(--font-ui); font-size: 12px; font-weight: 700; color: var(--dr-c, var(--amber)); letter-spacing: .04em; }
.dom-now-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.2; margin: 5px 0 7px; cursor: pointer; }
.dom-now-title:hover { color: var(--amber); }
.dom-now-sum { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.dom-causes { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.dom-cause { border-top: 1px dashed var(--line); padding-top: 9px; }
.dom-cause-top { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-family: var(--font-ui); }
.dom-cause-from { font-size: 12px; font-weight: 600; color: var(--ink); }
.dom-cause-verb { font-size: 11px; color: var(--ink-3); font-style: italic; }
.dom-cause-mech { font-size: 12px; color: var(--ink-2); line-height: 1.55; margin-top: 4px; }
.dom-root-note { margin-top: 11px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); font-style: italic; }

/* bitiş özeti */
.dom-final {
  margin-top: 16px; padding: 13px 15px; border-radius: var(--radius);
  border: 1px solid color-mix(in oklch, var(--amber) 35%, var(--line));
  background: color-mix(in oklch, var(--amber) 5%, var(--bg-1));
}
@keyframes kr-dom-final { from { opacity: 0; transform: scale(.97); } }
body[data-motion="1"] .dom-final { animation: kr-dom-final .45s cubic-bezier(.2,.7,.3,1) backwards .2s; }
.dom-final-txt { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin-bottom: 8px; }
.dom-final-roots { font-family: var(--font-ui); font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.dom-final-roots b { color: var(--amber); }

/* devrilenler listesi */
.dom-fallen-list { display: flex; flex-direction: column; gap: 3px; }
.dom-fallen-item {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 9px;
  border-radius: 8px; cursor: pointer; transition: background .14s;
  font-family: var(--font-ui);
}
.dom-fallen-item:hover { background: var(--bg-2); }
.dom-fallen-item.cur { background: var(--amber-dim); }
.dom-fallen-item .li-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--li-c, var(--ink-3)); flex: none; align-self: center; }
.dom-fallen-item .li-yr { font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.dom-fallen-item .li-title { font-size: 12.5px; color: var(--ink); line-height: 1.3; }

/* ---- timeline'da taş durumları ---- */
/* sırası gelmemiş taş: soluk, hafif geride */
/* bekleyen taşlar da filter: opacity() ile soluk — kr-rise 'opacity'yi 1'e
   sabitlediğinden (yukarıdaki .node.dim ile aynı sebep) opacity özelliği değil. */
.node.dom-waiting { filter: saturate(.65) opacity(.45); }
.node.dom-waiting .node-card { transform: translateY(2px); }
/* devrilmiş taş: yerleşmiş, tema rengi canlı */
.node.dom-fallen .node-card {
  border-color: color-mix(in oklch, var(--node-c) 55%, var(--line));
  box-shadow: var(--shadow-sm);
}
.node.dom-fallen .node-dot { transform: scale(1.12); }
/* DEVRİLEN taş: çarpma anı — sarsıl, yerleş, halka yay */
@keyframes kr-dom-strike {
  0%   { transform: translate(-50%, -14px) rotate(-2.4deg); }
  45%  { transform: translate(-50%, 2px) rotate(1.3deg); }
  70%  { transform: translate(-50%, -1px) rotate(-.5deg); }
  100% { transform: translate(-50%, 0) rotate(0); }
}
.node.dom-current { z-index: 9; }
body[data-motion="1"] .node.dom-current { animation: kr-dom-strike .55s cubic-bezier(.3,.7,.3,1) backwards; }
.node.dom-current .node-card {
  border-color: var(--node-c);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--node-c) 45%, transparent), var(--shadow-lg);
}
@keyframes kr-dom-ring {
  0%   { box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 6px color-mix(in oklch, var(--node-c) 55%, transparent); }
  100% { box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 26px transparent; }
}
body[data-motion="1"] .node.dom-current .node-dot { animation: kr-dom-ring 1.1s ease-out infinite; }

/* ---- comet: yay boyunca akan ışık başı ---- */
.link-comet {
  fill: none; stroke: var(--amber); stroke-width: 3.2; stroke-linecap: round;
  stroke-dasharray: .085 1; stroke-dashoffset: 1.085; opacity: 0;
}
@keyframes kr-comet { from { stroke-dashoffset: 1.085; } to { stroke-dashoffset: -.085; } }
body[data-motion="1"] .link-comet { opacity: .95; animation: kr-comet 1.25s cubic-bezier(.45,.1,.45,.9) infinite; }
body[data-motion="0"] .link-comet { display: none; }

/* domino modunda nedensel yaylar biraz daha belirgin */
.link-path.causal-tetikleyici.hot { stroke-width: 2.6; }

/* ===== TARİHSEL BAĞ — YÜZYIL KÖPRÜLERİ ================================== */
/* sol ray kartı */
.bond-card .pat-cnt { color: #C99A3A; font-variant-numeric: tabular-nums; }
.bond-card.active { border-color: #C99A3A; }
.bond-pair { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.bond-pair .pdr-svg-avatar { flex-shrink: 0; }
.bond-pair-names { display: inline-flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.bond-pair-names b { font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.bond-pair-yr { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bond-arrow { color: #C99A3A; font-weight: 700; font-size: 15px; padding: 0 2px; }
.bond-type-line { margin-top: 9px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: #C99A3A; opacity: .92; }

/* sağ panel — karşılıklı iki figür */
.bond-faces { display: flex; align-items: stretch; gap: 8px; margin: 4px 0 6px; }
.bond-face { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 5px; padding: 14px 8px 12px; border-radius: 14px;
  background: color-mix(in oklab, var(--bf-c, #6B2030) 12%, var(--bg-1, #fff));
  border: 1px solid color-mix(in oklab, var(--bf-c, #6B2030) 32%, transparent); }
.bond-face .pdr-svg-avatar { box-shadow: 0 3px 10px rgba(0,0,0,.16); }
.bond-face-name { font-family: var(--font-display), serif; font-size: 15px; font-weight: 600;
  color: var(--ink); line-height: 1.15; }
.bond-face-role { font-size: 11.5px; color: var(--ink-3); line-height: 1.2; }
.bond-face-yr { font-size: 13px; font-weight: 700; color: var(--bf-c, var(--amber));
  font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.bond-face.echo { opacity: .97; }
.bond-face-acts { display: flex; flex-direction: column; gap: 5px; width: 100%; margin-top: 3px; }
.bond-mini-btn { font: inherit; font-size: 11px; padding: 5px 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--bf-c, #6B2030) 40%, transparent);
  background: color-mix(in oklab, var(--bf-c, #6B2030) 16%, transparent); color: var(--ink);
  transition: background .18s, transform .12s; }
.bond-mini-btn:hover { background: color-mix(in oklab, var(--bf-c, #6B2030) 28%, transparent); transform: translateY(-1px); }
.bond-mini-btn.ghost { background: transparent; color: var(--ink-2); }
.bond-vs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  flex: 0 0 44px; }
.bond-vs-glyph { font-size: 20px; color: #C99A3A; }
.bond-vs-gap { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== ZİNCİR (3+ KUŞAK) · SOL RAY GENİŞLİĞİ · KÜNYE ===================== */

/* Tarihsel Bağ modunda sol raya daha çok yer ver (yüzyıl köprüleri öne çıksın) */
body[data-mode="bonds"] .rail { width: 360px; }
@media (max-width: 1180px) { body[data-mode="bonds"] .rail { width: 300px; } }

/* sol ray köprü kartı biraz daha okunur */
.bond-card .pat-name { font-size: 16.5px; }
.bond-pair { gap: 8px; margin-top: 11px; }
.bond-pair-names b { font-size: 13px; }
.bond-chain-badge {
  margin-top: 10px; font-size: 11px; letter-spacing: .02em; font-weight: 600;
  color: #B07A1E; background: color-mix(in oklab, #C99A3A 14%, transparent);
  border: 1px solid color-mix(in oklab, #C99A3A 34%, transparent);
  border-radius: 8px; padding: 5px 9px; display: block; line-height: 1.4;
}

/* sağ panel — çok-kuşaklı zincir (3+) sarmalı */
.bond-chain { flex-wrap: wrap; justify-content: center; gap: 8px 6px; }
.bond-chain.is-chain .bond-face { flex: 1 1 118px; min-width: 112px; }
.bond-chain.is-chain .bond-vs { flex: 0 0 34px; }
.li-chip.chain-chip {
  color: #B07A1E; border-color: color-mix(in oklab, #C99A3A 40%, transparent);
  background: color-mix(in oklab, #C99A3A 12%, transparent);
}

/* Kaynak & Künye */
.prov { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.prov-note { color: var(--ink-2); margin-bottom: 12px; }
.prov-links-h { font-family: var(--font-ui); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.prov-links-cap { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin-bottom: 9px; }
.prov-ai { font-size: 12.5px; color: var(--ink-3); background: var(--bg-2);
  border: 1px dashed var(--line); border-radius: 10px; padding: 9px 11px; line-height: 1.55; }
.prov-links { display: flex; flex-direction: column; gap: 6px; }
.prov-link { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--ink); text-decoration: none;
  transition: border-color .15s, background .15s, transform .12s; }
.prov-link:hover { border-color: var(--amber); background: var(--amber-dim); transform: translateY(-1px); }
.prov-link-t { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; }
.prov-ext { color: var(--amber); font-size: 12px; flex: none; }

/* ===== SİTE ALT BİLGİSİ (kaynak/künye uyarısı) ========================== */
.kr-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--bg-1); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 14px rgba(0,0,0,.05); font-family: var(--font-ui);
}
.kr-footer-toggle {
  width: 100%; height: var(--footer-h); appearance: none; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; gap: 9px; padding: 0 16px;
  color: var(--ink-2); font-size: 12px; line-height: 1.3; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.kr-footer-toggle:hover { color: var(--ink); }
.kr-footer-ic { color: var(--amber); font-size: 13px; flex: none; }
.kr-footer-lead { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kr-footer-lead b { color: var(--ink); font-weight: 600; }
.kr-footer-caret { flex: none; color: var(--amber); font-size: 10px; transition: transform .25s; }
.kr-footer.open .kr-footer-caret { transform: rotate(90deg); }
.kr-footer-more {
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
  padding: 0 16px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
}
.kr-footer.open .kr-footer-more { max-height: 260px; padding: 2px 16px 14px; }
.kr-footer-more p { margin: 0 0 8px; max-width: 1040px; }
.kr-footer-more b { color: var(--ink); font-weight: 600; }
.kr-footer-meta { color: var(--ink-3); font-size: 11.5px; }
body[data-motion="0"] .kr-footer-more, body[data-motion="0"] .kr-footer-caret { transition: none; }

/* footer için yer aç: gövde ve sabit paneller alt şeritle çakışmasın */
.body { padding-bottom: var(--footer-h); }
.drawer, .compare { bottom: var(--footer-h); }
.fab { bottom: calc(18px + var(--footer-h)); }
/* .kr-asst-launch ofseti temel kuralında tanımlı (cascade sırası için) */

/* reduced-motion: sanat katmanını da durdur */
@media (prefers-reduced-motion: reduce) {
  .ka-needle, .ka-sweep, .ka-orbit, .ka-dash-rot, .ka-pulse, .ka-spark, .ka-blip,
  .ka-tilt, .ka-quake, .ka-tile, .ka-ink, .ka-drift-1, .ka-drift-2, .ka-rose-spin,
  .ka-mote, .link-comet, .node.dom-current, .node.dom-current .node-dot,
  .dom-now, .dom-final, .dr-figure {
    animation: none !important;
  }
}

/* ===========================================================================
   TARİH ASİSTANI — Vertex AI destekli sağ slide-over + launcher
   =========================================================================== */
.kr-asst-launch {
  position: fixed; right: 74px; bottom: calc(18px + var(--footer-h)); z-index: 2147483646;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 0 16px 0 14px; height: 44px; border-radius: 22px;
  border: 1px solid color-mix(in oklch, var(--amber) 32%, var(--line));
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: var(--amber); cursor: pointer; font-family: var(--font-ui);
  font-weight: 600; font-size: 13.5px; letter-spacing: .01em;
  box-shadow: var(--shadow-md); transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, border-color .18s, opacity .2s;
}
.kr-asst-launch:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--amber); }
.kr-asst-launch.hidden { opacity: 0; pointer-events: none; transform: translateY(8px) scale(.96); }
.kr-asst-spark { font-size: 15px; line-height: 1; filter: drop-shadow(0 0 6px color-mix(in oklch, var(--amber) 40%, transparent)); }
body[data-motion="1"] .kr-asst-launch .kr-asst-spark { animation: kr-spark 3.4s ease-in-out infinite; }
@keyframes kr-spark { 0%,100% { opacity: .85; transform: scale(1) rotate(0); } 50% { opacity: 1; transform: scale(1.18) rotate(18deg); } }

.kr-asst-scrim {
  position: fixed; inset: 0; z-index: 2147483646; background: oklch(0.3 0.02 50 / 0.18);
  opacity: 0; animation: kr-fade .2s ease forwards; backdrop-filter: blur(1.5px);
}
@keyframes kr-fade { to { opacity: 1; } }
@media (min-width: 1100px) { .kr-asst-scrim { display: none; } }

.kr-asst {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2147483647;
  width: min(440px, 94vw); display: flex; flex-direction: column;
  background: var(--bg-1); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform .34s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.kr-asst.open { transform: translateX(0); }

.kr-asst-head {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px 13px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
}
.kr-asst-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--amber), color-mix(in oklch, var(--amber) 40%, transparent)); }
.kr-asst-id { display: flex; align-items: center; gap: 11px; }
.kr-asst-id .kr-asst-spark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber-dim); color: var(--amber); font-size: 16px; flex: none;
}
.kr-asst-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.kr-asst-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.kr-asst-head-btns { display: flex; align-items: center; gap: 6px; }
.kr-asst-clear {
  border: 1px solid var(--line); background: var(--bg-1); color: var(--ink-2);
  border-radius: 9px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: var(--font-ui);
}
.kr-asst-clear:hover { color: var(--amber); border-color: var(--amber); }
.kr-asst-x {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--ink-3); cursor: pointer; font-size: 14px; transition: all .15s;
}
.kr-asst-x:hover { background: var(--bg-3); color: var(--ink); }

.kr-asst-body { flex: 1; overflow-y: auto; padding: 16px; scroll-behavior: smooth; }

/* boş durum */
.kr-asst-empty { padding: 18px 6px; text-align: center; }
.kr-asst-empty-mark {
  width: 56px; height: 56px; margin: 6px auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; color: var(--amber);
  background: radial-gradient(circle at 50% 40%, var(--amber-dim), transparent 70%);
  border: 1px solid color-mix(in oklch, var(--amber) 24%, var(--line));
}
body[data-motion="1"] .kr-asst-empty-mark { animation: kr-spark 4s ease-in-out infinite; }
.kr-asst-empty-h { font-family: var(--font-display); font-size: 21px; color: var(--ink); margin-bottom: 7px; }
.kr-asst-empty-s { font-size: 13px; line-height: 1.55; color: var(--ink-2); max-width: 330px; margin: 0 auto 18px; }
.kr-asst-sugs { display: flex; flex-direction: column; gap: 8px; }
.kr-sug {
  text-align: left; border: 1px solid var(--line); background: var(--bg-1); color: var(--ink);
  border-radius: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.4; cursor: pointer;
  font-family: var(--font-ui); transition: all .16s; position: relative;
}
.kr-sug::before { content: "✦"; color: var(--amber); margin-right: 8px; font-size: 11px; opacity: .7; }
.kr-sug:hover { border-color: var(--amber); background: var(--amber-dim); transform: translateX(2px); }

/* mesajlar */
.kr-msg { margin-bottom: 16px; }
.kr-msg.user { display: flex; justify-content: flex-end; }
.kr-msg.user .kr-bubble {
  max-width: 84%; background: var(--amber); color: #fff; padding: 9px 13px;
  border-radius: 14px 14px 4px 14px; font-size: 13.5px; line-height: 1.5; box-shadow: var(--shadow-sm);
}
.kr-msg.bot { display: flex; gap: 10px; align-items: flex-start; }
.kr-bot-mark {
  width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber-dim); color: var(--amber); font-size: 12px; margin-top: 2px;
}
.kr-bot-mark.pulse { animation: kr-pulse 1.1s ease-in-out infinite; }
@keyframes kr-pulse { 0%,100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
.kr-bot-body { flex: 1; min-width: 0; }
.kr-msg.bot.err .kr-answer { color: var(--th-sol); }
.kr-answer { font-size: 13.8px; line-height: 1.62; color: var(--ink); }
.kr-asst-p { margin: 0 0 10px; }
.kr-asst-p:last-child { margin-bottom: 0; }

/* kaynak çipleri */
.kr-src-wrap { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.kr-src-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.kr-src-row { display: flex; flex-wrap: wrap; gap: 6px; }
.kr-src {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--ink);
  border-radius: 999px; padding: 5px 11px 5px 9px; font-size: 12px; cursor: pointer;
  font-family: var(--font-ui); transition: all .15s;
}
.kr-src:hover { border-color: var(--src-c, var(--amber)); background: color-mix(in oklch, var(--src-c, var(--amber)) 10%, var(--bg-1)); transform: translateY(-1px); }
.kr-src-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--src-c, var(--amber)); flex: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--src-c, var(--amber)) 16%, transparent); }
.kr-src-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.kr-src-y { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }

/* ilgili sorular */
.kr-rel { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.kr-rel-q {
  text-align: left; border: none; background: transparent; color: var(--amber);
  font-size: 12.5px; cursor: pointer; padding: 3px 2px; font-family: var(--font-ui); line-height: 1.4;
  border-radius: 6px; transition: all .14s;
}
.kr-rel-q span { opacity: .6; }
.kr-rel-q:hover { color: var(--ink); background: var(--amber-dim); padding-left: 6px; }

/* düşünme */
.kr-thinking { display: flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 12.5px; }
.kr-thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); opacity: .4; animation: kr-dot 1.1s ease-in-out infinite; }
.kr-thinking span:nth-child(2) { animation-delay: .15s; }
.kr-thinking span:nth-child(3) { animation-delay: .3s; }
.kr-thinking em { margin-left: 6px; font-style: italic; }
@keyframes kr-dot { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* footer */
.kr-asst-foot {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 6px; border-top: 1px solid var(--line);
  background: var(--bg-1);
}
.kr-asst-input {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 13px;
  padding: 10px 13px; font-family: var(--font-ui); font-size: 13.5px; line-height: 1.45;
  color: var(--ink); background: var(--bg-0); max-height: 120px; transition: border-color .15s, box-shadow .15s;
}
.kr-asst-input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.kr-asst-send {
  width: 40px; height: 40px; flex: none; border-radius: 12px; border: none;
  background: var(--amber); color: #fff; cursor: pointer; font-size: 17px; transition: all .16s;
  box-shadow: var(--shadow-sm);
}
.kr-asst-send:hover:not(:disabled) { transform: translateY(-1px) scale(1.04); box-shadow: var(--shadow-md); }
.kr-asst-send:disabled { opacity: .4; cursor: default; }
.kr-asst-disc { padding: 4px 16px 11px; font-size: 10.5px; color: var(--ink-3); line-height: 1.4; text-align: center; }

@media (max-width: 760px) {
  .kr-asst-launch { right: 70px; bottom: calc(16px + var(--footer-h)); padding: 0 14px; height: 42px; }
  .kr-asst-launch-t { display: none; }
  .kr-asst-launch { padding: 0; width: 42px; justify-content: center; }
  .kr-asst { width: 100vw; }
}

/* asistan cevabı — madde listesi */
.kr-answer-ul { margin: 4px 0 10px; padding-left: 2px; list-style: none; }
.kr-answer-ul li { position: relative; padding-left: 16px; margin-bottom: 6px; line-height: 1.55; }
.kr-answer-ul li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.kr-answer strong { font-weight: 600; color: var(--ink); }
.kr-answer-ul li strong { color: var(--ink); }

/* ---- TOPBAR RESPONSIVE — dar ekranlarda zarif sığma ---------------------- */
@media (max-width: 1180px) {
  .topbar-right { gap: 14px; padding: 0 16px; }
  .topbar-right .clock { display: none; }
}
@media (max-width: 1000px) {
  .topbar-right { display: none; }
  .mode-btn { padding: 9px 12px; font-size: 13px; gap: 6px; }
  .modes { padding: 0 8px; gap: 2px; }
  .brand { padding: 0 16px; }
}
@media (max-width: 860px) {
  /* 7 mod tek satıra sığmaz → yatay kaydır; sağ kenar fade'i "devamı var" sinyali verir
     (scrollbar gizli olduğundan kaydırılabilirlik aksi halde keşfedilemiyordu) */
  .modes {
    overflow-x: auto; scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  }
  .modes::-webkit-scrollbar { display: none; }
  .mode-btn { flex: none; scroll-snap-align: start; min-height: 40px; }
}
@media (max-width: 760px) {
  /* araç çubuğu tek satıra sığmaz → sar: arama satırı doldurur, dönem/zoom alta geçer */
  .toolbar { flex-wrap: wrap; gap: 10px 12px; padding: 10px 14px; }
  .toolbar-right { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 8px; }
  .search { flex: 1 1 180px; }
  .search input { width: 100%; min-width: 0; flex: 1 1 auto; }
}
@media (max-width: 640px) {
  /* marka alt-başlığını gizle → mod gezinmesine yer aç; modlar kalan genişliği alıp kaydırılsın */
  .brand-sub { display: none; }
  .brand { padding: 0 12px; gap: 9px; }
  .brand-name { font-size: 19px; }
  .modes { flex: 1 1 0; min-width: 0; padding: 0 6px; }
}

/* ---- KLAVYE ODAĞI — tutarlı, görünür :focus-visible halkası (a11y) ------ */
:where(a, button, input, textarea, select, [tabindex], [role="button"], [role="link"]):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ===========================================================================
   GLASS SKIN — sıcak/aydınlık glassmorphism (orijinal stilin ÜSTÜNE eklenir)
   Yüzen yüzeyler buzlu cam; metin koyu kalır (okunabilirlik korunur).
   Geri almak için: bu bloğu tümüyle sil.
   =========================================================================== */
:root {
  --glass-blur: 20px;          /* büyük paneller */
  --glass-blur-sm: 11px;       /* kartlar (perf: ~92 kart) */
  --glass-sat: 170%;
  --glass-1: oklch(0.99 0.009 330 / 0.55);      /* ana panel camı */
  --glass-2: oklch(0.985 0.011 330 / 0.4);      /* kontrol/çip camı */
  --glass-read: oklch(0.985 0.008 330 / 0.74);  /* okuma yüzeyi (drawer/asistan/compare) */
  --glass-card: oklch(0.99 0.012 330 / 0.5);    /* olay kartı */
  --glass-brd: oklch(0.62 0.03 320 / 0.2);      /* ince cam kenar */
  --glass-sheen: inset 0 1px 0 0 oklch(1 0 0 / 0.55), inset 0 0 0 1px oklch(1 0 0 / 0.05);
  --glass-shadow: 0 10px 34px -14px oklch(0.35 0.05 330 / 0.32), 0 2px 8px -4px oklch(0.35 0.05 330 / 0.16);
}

/* GLASS SKIN — karanlık varyant: yüzen yüzeyler gece buzlu camı, metin parşömen */
html[data-theme="dark"] {
  --glass-1: oklch(0.245 0.018 286 / 0.62);
  --glass-2: oklch(0.275 0.02 287 / 0.5);
  --glass-read: oklch(0.225 0.016 286 / 0.84);
  --glass-card: oklch(0.255 0.018 286 / 0.55);
  --glass-brd: oklch(0.72 0.02 300 / 0.14);
  --glass-sheen: inset 0 1px 0 0 oklch(1 0 0 / 0.06), inset 0 0 0 1px oklch(1 0 0 / 0.03);
  --glass-shadow: 0 12px 36px -14px oklch(0 0 0 / 0.6), 0 2px 10px -4px oklch(0 0 0 / 0.4);
}
html[data-theme="dark"] .canvas-wrap {
  background: linear-gradient(170deg, oklch(0.205 0.015 286 / 0.8), oklch(0.17 0.022 292 / 0.7));
}
html[data-theme="dark"] .axis {
  background: linear-gradient(to top, oklch(0.2 0.015 286 / 0.9) 0%, oklch(0.2 0.015 286 / 0.9) 60%, transparent);
}
html[data-theme="dark"] .node:hover .node-card,
html[data-theme="dark"] .chip:hover, html[data-theme="dark"] .pat:hover,
html[data-theme="dark"] .link-item:hover, html[data-theme="dark"] .era-btn:hover {
  background: oklch(0.33 0.022 287 / 0.82);
}

/* sade atmosfer — beyazdan hafifçe mora doğru (camın arkasında nazik derinlik) */
.atmos {
  background:
    radial-gradient(105% 90% at 50% 120%, oklch(0.9 0.055 305 / 0.5), transparent 70%),
    linear-gradient(170deg, oklch(0.995 0.003 300) 6%, oklch(0.95 0.038 305) 100%);
}
/* tuvale çok hafif mor sızsın (kart/çekmece camına zemin) — timeline okunur kalsın */
.canvas-wrap { background: linear-gradient(170deg, oklch(0.99 0.006 304 / 0.78), oklch(0.952 0.036 305 / 0.6)); }
.axis { background: linear-gradient(to top, oklch(0.985 0.008 330 / 0.86) 0%, oklch(0.985 0.008 330 / 0.86) 60%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* büyük yüzen paneller → buzlu cam */
.topbar, .toolbar, .rail, .macro-band,
.drawer, .drawer-head, .kr-asst, .kr-asst-head,
.twk-panel, .canvas-hint, .canvas-empty-card, .compare {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
          backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  background: var(--glass-1) !important;
  border-color: var(--glass-brd);
  box-shadow: var(--glass-shadow), var(--glass-sheen);
}
/* okuma yüzeyleri biraz daha opak (uzun metin konforu) */
.drawer, .kr-asst { background: var(--glass-read) !important; }
.drawer-head, .kr-asst-head, .macro-band { background: var(--glass-2) !important; }

/* kartlar / kontroller → hafif cam (perf için düşük blur) */
.node-card, .chip, .pat, .link-item, .reso-more, .search, .zoom-grp, .era-btn,
.kr-asst-launch, .twk-chip, .tag, .person, .kr-asst-sug, .sub, .cmp-thumb, .dr-close, .kr-asst-x {
  -webkit-backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-sat));
          backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-sat));
}
.node-card { background: var(--glass-card); border-color: var(--glass-brd); box-shadow: var(--glass-shadow), var(--glass-sheen); }
.chip, .pat, .link-item, .reso-more, .search, .zoom-grp, .era-btn, .sub, .kr-asst-sug {
  background: var(--glass-2); border-color: var(--glass-brd); box-shadow: var(--glass-sheen);
}
.kr-asst-launch { background: var(--glass-1); border-color: var(--glass-brd); box-shadow: var(--glass-shadow), var(--glass-sheen); }

/* hover'da cam biraz "yoğunlaşsın" — okunabilirlik + geri bildirim */
.node:hover .node-card,
.chip:hover, .pat:hover, .link-item:hover, .era-btn:hover { background: oklch(0.995 0.008 330 / 0.72); }

/* küçük cam yüzeylerde köşe yumuşaklığı clip etsin */
.node-card, .chip, .pat, .link-item, .reso-more, .search, .zoom-grp,
.drawer, .kr-asst, .twk-panel, .canvas-hint, .canvas-empty-card { isolation: isolate; }
