/* Atolye > Analitik (public/analitik.js). Ortak tokenlar style.css'ten; siniflar an- onekli. Grafik renkleri kendi tokenlarinda, koyu tema kendi adimlari
   (kategorik sira dataviz dogrulamasindan gecti: validate_palette.js, acik #fff, koyu #18181a). Metin hic seri rengi giymez. */
:root {
  --an-c0: #2a78d6; --an-c1: #eb6834; --an-c2: #1baf7a; --an-c3: #eda100; --an-c4: #e87ba4; --an-c5: #008300; --an-c6: #6250d6; --an-c7: #b4b3ad;
  --an-l1: #cde2fb; --an-l2: #86b6ef; --an-l3: #3987e5; --an-l4: #1c5cab;
  --an-empty: #efefec;
  --an-ok-ink: #17803f;
  --an-spark: #a3a39d;
  --an-tip-bg: #1c1c1a; --an-tip-ink: #f6f6f4;
  --an-hero-a: rgb(42 120 214 / .10); --an-hero-b: rgb(235 104 52 / .07);
  --an-ease: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --an-c0: #3987e5; --an-c1: #d95926; --an-c2: #199e70; --an-c3: #c98500; --an-c4: #d55181; --an-c5: #008300; --an-c6: #9085e9; --an-c7: #5d5d60;
    --an-l1: #184f95; --an-l2: #256abf; --an-l3: #3987e5; --an-l4: #86b6ef;
    --an-empty: #26262a;
    --an-ok-ink: #3ccf7c;
    --an-spark: #6d6d70;
    --an-tip-bg: #e8e8e6; --an-tip-ink: #18181a;
    --an-hero-a: rgb(57 135 229 / .16); --an-hero-b: rgb(217 89 38 / .10);
  }
}

.an-s0 { background: var(--an-c0); } .an-s1 { background: var(--an-c1); } .an-s2 { background: var(--an-c2); } .an-s3 { background: var(--an-c3); }
.an-s4 { background: var(--an-c4); } .an-s5 { background: var(--an-c5); } .an-s6 { background: var(--an-c6); } .an-s7 { background: var(--an-c7); }

.an-wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 20px; min-width: 0; }
.an-wrap > * { min-width: 0; }
.an-m { color: var(--muted); font-size: 12px; font-weight: 400; }

/* Ust serit */
.an-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.an-top h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.an-top .sp { flex: 1; }
.an-scan { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.an-scan.bad { color: var(--bad); }
.an-scan.run i { animation: an-spin 1s linear infinite; }
@keyframes an-spin { to { transform: rotate(360deg); } }
.an-seg-c { display: inline-flex; background: var(--panel-2); border-radius: 8px; padding: 2px; }
.an-seg-c button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; height: 26px; padding: 0 10px; border-radius: 6px; cursor: pointer; transition: transform 160ms ease-out; }
.an-seg-c button[aria-pressed="true"] { background: var(--panel); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.an-seg-c button:active { transform: scale(.97); }
.an-sel { height: 30px; max-width: 200px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; }
.an-ic { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: transform 160ms ease-out; }
.an-ic:active { transform: scale(.97); }
.an-ic:disabled { opacity: .5; cursor: default; }
.an-note { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); padding: 8px 12px; background: var(--panel-2); border-radius: 8px; }
.an-empty { color: var(--muted); }
.an-first-scan { text-align: center; padding: 64px 16px; color: var(--muted); }
.an-first-scan i { font-size: 32px; }
.an-first-scan h2 { margin: 10px 0 6px; font-size: 16px; color: var(--text); font-weight: 600; }
.an-first-scan p { margin: 0 auto; max-width: 52ch; font-size: 13px; line-height: 1.55; text-wrap: pretty; }

/* Hero */
.an-hero { padding: 24px 26px; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(100% 140% at 0% 0%, var(--an-hero-a), transparent 60%), radial-gradient(80% 120% at 100% 0%, var(--an-hero-b), transparent 60%), var(--panel); }
.an-h-e { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.an-h-n { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.an-h-v { font-size: clamp(44px, 7vw, 68px); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; color: var(--text); }
.an-h-u { font-size: 18px; color: var(--muted); }
.an-h-s { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--text); max-width: 72ch; text-wrap: pretty; }
.an-h-c { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.an-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; font: inherit; font-size: 12.5px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.an-chip i.ph-fire { color: var(--an-c1); }
.an-chip-b { cursor: pointer; transition: transform 160ms ease-out; }
.an-chip-b:active { transform: scale(.97); }
.an-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.an-delta.up { color: var(--an-ok-ink); }

/* Toplamlar */
.an-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.an-kpi { position: relative; display: grid; gap: 2px; padding: 12px 14px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.an-k-l { font-size: 12.5px; color: var(--muted); }
.an-k-v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.an-k-s { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); min-height: 16px; }
.an-spark { display: block; width: 100%; height: 26px; margin-top: 4px; overflow: visible; }
.an-spark polyline { stroke: var(--an-spark); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.an-spark.mini { width: 88px; height: 20px; margin: 0; }

/* Basliklar ve kartlar */
.an-sec { display: grid; gap: 10px; min-width: 0; }
.an-sec > h2, .an-card-h h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.an-sec > h2 span { margin-left: 8px; font-weight: 400; font-size: 12px; color: var(--muted); }
.an-card { padding: 14px 16px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.an-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* Rekorlar */
.an-recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.an-rec { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 1px; align-items: center; padding: 11px 12px; text-align: left; font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: transform 160ms ease-out, border-color 160ms ease; }
.an-rec > i { color: var(--muted); font-size: 15px; }
.an-rec:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .an-rec:hover { border-color: var(--off); } }
.an-r-l { font-size: 12px; color: var(--muted); }
.an-r-v { grid-column: 1 / -1; font-size: 18px; font-weight: 600; letter-spacing: -.012em; margin-top: 2px; }
.an-r-d { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.an-r-d em { font-style: normal; color: var(--an-ok-ink); font-weight: 500; }
.an-streak > i { color: var(--an-c1); }

/* Gunluk sutunlar */
.an-plot { position: relative; height: 196px; margin-left: 42px; }
.an-grid span { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.an-grid b { position: absolute; right: 100%; top: -8px; margin-right: 8px; font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-cols { position: absolute; inset: 0 0 0 0; display: flex; align-items: stretch; gap: 2px; }
.an-col { position: relative; flex: 1 1 0; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--off); }
.an-stack { display: flex; flex-direction: column-reverse; gap: 2px; width: 100%; max-width: 24px; height: 100%; justify-content: flex-start; transform-origin: bottom; }
.an-seg { display: block; min-height: 1px; flex: none; }
.an-seg:last-child { border-radius: 3px 3px 0 0; }
@media (hover: hover) and (pointer: fine) { .an-col:hover .an-stack { filter: brightness(1.08); } }
.an-x { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.an-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 30px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.an-legend li { display: inline-flex; align-items: center; gap: 5px; }
.an-sw { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 3px; }

/* Takvim, saatler, arac */
.an-row3 { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr) minmax(220px, 1fr); gap: 10px; align-items: start; }
@media (max-width: 1100px) { .an-row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .an-heat { grid-column: 1 / -1; } }
@media (max-width: 640px) { .an-row3 { grid-template-columns: minmax(0, 1fr); } }
.an-h { display: block; width: 11px; height: 11px; border-radius: 3px; background: var(--an-empty); }
.an-h.l1 { background: var(--an-l1); } .an-h.l2 { background: var(--an-l2); } .an-h.l3 { background: var(--an-l3); } .an-h.l4 { background: var(--an-l4); }
.an-h.now { outline: 1.5px solid var(--text); outline-offset: 1px; }
.an-h[data-day] { cursor: pointer; }
.an-scale { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.an-scale span { margin: 0 3px; }
.an-h-scroll { overflow-x: auto; scrollbar-width: thin; }
.an-h-grid { display: grid; gap: 4px; width: max-content; }
.an-h-m { display: grid; grid-template-columns: repeat(var(--w), 11px); gap: 3px; font-size: 11px; color: var(--muted); height: 14px; }
.an-h-m span { white-space: nowrap; }
.an-h-c2 { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; }
.an-hbars { display: flex; align-items: flex-end; gap: 2px; height: 96px; border-bottom: 1px solid var(--off); }
.an-hb { flex: 1 1 0; height: var(--v); min-height: 1px; background: var(--an-l2); border-radius: 2px 2px 0 0; transform-origin: bottom; }
.an-hb.on { background: var(--an-c0); }
.an-hx { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.an-tools ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.an-tools li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 3px; font-size: 12.5px; }
.an-tools .n { color: var(--text); }
.an-tools .v { color: var(--muted); font-variant-numeric: tabular-nums; }
.an-tools .b { grid-column: 1 / -1; order: 3; height: 6px; background: var(--an-empty); border-radius: 3px; overflow: hidden; }
.an-tools .b i { display: block; height: 100%; background: var(--an-c0); border-radius: 3px; transform-origin: left; }

/* Proje tablosu */
.an-table { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.an-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.an-table thead th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.an-table thead th button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 3px; align-items: center; }
.an-table th.r, .an-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.an-table thead th.r button { flex-direction: row-reverse; }
.an-table tbody th { font-weight: 500; text-align: left; white-space: nowrap; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.an-table tbody th .an-sw { margin-right: 7px; }
.an-table tbody th, .an-table tbody td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.an-table tbody tr:last-child th, .an-table tbody tr:last-child td { border-bottom: 0; }
.an-table tbody tr { cursor: pointer; }
.an-table td.m { color: var(--muted); white-space: nowrap; }
.an-table tr.on { background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) { .an-table tbody tr:hover { background: var(--panel-2); } }
.an-more { justify-self: start; font: inherit; font-size: 12.5px; color: var(--text); height: 30px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: transform 160ms ease-out; }
.an-more:active { transform: scale(.97); }

/* Zaman cizelgesi */
.an-tl { gap: 14px; }
.an-day { display: grid; gap: 8px; scroll-margin-top: 8px; border-radius: 10px; transition: background-color 400ms ease; }
.an-day.flash { background: var(--accent-soft); }
.an-day-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 6px 2px; position: sticky; top: -28px; background: var(--bg); z-index: 1; }
.an-day-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.an-day-s { font-size: 12px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.an-rt { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.an-rt i { color: var(--an-c3); }
.an-g { display: grid; gap: 6px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.an-g-h { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.an-g-n { border: 0; padding: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .an-g-n:hover { text-decoration: underline; text-underline-offset: 2px; } }
.an-g-s { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.an-its { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.an-it { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; align-items: start; }
.an-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; line-height: 19px; }
.an-badge.live { color: var(--an-ok-ink); font-weight: 500; }
.an-it-t { font-size: 13px; line-height: 19px; color: var(--text); overflow-wrap: anywhere; }
.an-it-t a { color: inherit; text-underline-offset: 2px; }
.an-it-s { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 1px; text-wrap: pretty; overflow-wrap: anywhere; }
.an-it-m { font-size: 11.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.an-sub { margin: 1px 0 0; padding: 0 0 0 16px; display: grid; gap: 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.an-lines { display: grid; gap: 2px; }
.an-lab { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.an-d summary { cursor: pointer; font-size: 12.5px; color: var(--muted); width: fit-content; list-style-position: inside; }
.an-d summary span { opacity: .8; }
.an-d[open] summary { margin-bottom: 3px; }

.an-src { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.an-src summary { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.an-src ul { margin: 8px 0 0; padding: 0 0 0 16px; display: grid; gap: 5px; line-height: 1.5; max-width: 86ch; }
.an-src b { color: var(--text); font-weight: 500; }

/* Ipucu */
.an-tip { position: fixed; z-index: 60; pointer-events: none; max-width: 300px; padding: 5px 8px; border-radius: 6px; font-size: 12px; line-height: 1.4; color: var(--an-tip-ink); background: var(--an-tip-bg); opacity: 0; transform: scale(.97); transform-origin: bottom center; transition: opacity 125ms ease-out, transform 125ms ease-out; }
.an-tip.on { opacity: 1; transform: none; }
.an-tip.now { transition-duration: 0ms; }

/* Ilk acilis: bir kez, kisa kademeli. Secim degisince calismaz. */
@media (prefers-reduced-motion: no-preference) {
  .an-enter .an-kpi, .an-enter .an-rec, .an-enter .an-card, .an-enter .an-hero { animation: an-up 320ms var(--an-ease) both; }
  .an-enter .an-kpi:nth-child(2) { animation-delay: 40ms; } .an-enter .an-kpi:nth-child(3) { animation-delay: 80ms; } .an-enter .an-kpi:nth-child(4) { animation-delay: 120ms; }
  .an-enter .an-kpi:nth-child(5) { animation-delay: 160ms; } .an-enter .an-kpi:nth-child(6) { animation-delay: 200ms; } .an-enter .an-kpi:nth-child(7) { animation-delay: 240ms; } .an-enter .an-kpi:nth-child(8) { animation-delay: 280ms; }
  .an-enter .an-stack, .an-enter .an-hb { animation: an-grow 420ms var(--an-ease) both; }
  .an-enter .an-tools .b i { animation: an-growx 420ms var(--an-ease) both; }
}
@keyframes an-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes an-grow { from { transform: scaleY(.04); } to { transform: none; } }
@keyframes an-growx { from { transform: scaleX(.04); } to { transform: none; } }
@media (max-width: 760px) {
  .an-hero { padding: 18px 16px; }
  .an-day-s, .an-g-s { margin-left: 0; width: 100%; }
  .an-it { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .an-plot { margin-left: 34px; }
  .an-day-h { top: -18px; }
}
