/* ---------- tokenlar ---------- */
:root {
  color-scheme: light;
  --surface-1: #ffffff;
  --plane: #f9f9f9;
  --text-primary: #191919;
  --text-secondary: #666666;
  --grid: #e7e7e7;
  --axis: #c2c2c2;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #257de0;
  --good: #006c10;
  --bad: #dc3c3d;
  --hover: rgba(11, 11, 11, 0.04);
  --tip-bg: #191919;
  --tip-ink: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px -16px rgba(11, 11, 11, 0.18);
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #191919;
    --plane: #0b0b0b;
    --text-primary: #efefef;
    --text-secondary: #9c9c9c;
    --grid: #303030;
    --axis: #474747;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #338ced;
    --good: #53c556;
    --hover: rgba(255, 255, 255, 0.05);
    --tip-bg: #efefef;
    --tip-ink: #0b0b0b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -16px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #191919;
  --plane: #0b0b0b;
  --text-primary: #efefef;
  --text-secondary: #9c9c9c;
  --grid: #303030;
  --axis: #474747;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #338ced;
  --good: #53c556;
  --hover: rgba(255, 255, 255, 0.05);
  --tip-bg: #efefef;
  --tip-ink: #0b0b0b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -16px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--plane);
  color: var(--text-primary);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.tnum { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .6rem; z-index: 20; background: var(--surface-1); padding: .5rem .8rem; border-radius: 8px; }

/* ---------- ust bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in oklab, var(--surface-1) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .65rem; }
.brand small { display: block; color: var(--text-secondary); font-size: 12px; }
.brand-mark { width: 28px; height: 28px; flex: 0 0 auto; display: block; border-radius: 7px; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.pill {
  font-size: 12px; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px; padding: .2rem .6rem; white-space: nowrap;
}
.ghost-btn {
  font: inherit; font-size: 13px; color: var(--text-secondary);
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: .32rem .7rem; cursor: pointer;
}
.ghost-btn:hover { background: var(--hover); color: var(--text-primary); }
.ghost-btn:focus-visible, .chip:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- yerlesim ---------- */
main { padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 3rem; max-width: 1400px; margin: 0 auto; }
.status { color: var(--text-secondary); }
.banner {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--surface-1); border-radius: var(--radius);
  padding: .7rem .9rem; margin-bottom: 1rem; font-size: 13.5px; color: var(--text-secondary);
}
.banner strong { color: var(--text-primary); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em;
  background: var(--hover); padding: .1rem .35rem; border-radius: 5px; }

/* filtre satiri: tek satir, grafiklerin ustunde */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  padding: .75rem .9rem; margin-bottom: 1.1rem;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
}
.filter-group { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.filter-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin-right: .15rem; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px; padding: .28rem .7rem;
  display: inline-flex; align-items: center; gap: .35rem;
}
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"], .chip.is-on {
  background: color-mix(in oklab, var(--accent) 12%, var(--surface-1));
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
  color: var(--text-primary); font-weight: 600;
}
.chip-key { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
select, input[type="search"] {
  font: inherit; font-size: 13px; color: var(--text-primary);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: .3rem .5rem;
}

/* ---------- ozet ---------- */
.hero {
  display: grid; gap: 1rem; margin-bottom: 1.1rem;
  grid-template-columns: minmax(230px, 1fr) 2.1fr;
}
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
.hero-main, .tiles { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-main { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; justify-content: center; }
.hero-label { font-size: 13px; color: var(--text-secondary); }
.hero-value { font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 650; line-height: 1.05; letter-spacing: -.02em; margin: .1rem 0 .15rem; }
.hero-unit { font-size: .42em; font-weight: 500; color: var(--text-secondary); margin-left: .25rem; }
.hero-sub { font-size: 13px; color: var(--text-secondary); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); overflow: hidden; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface-1); padding: .85rem .95rem; }
.tile-label { font-size: 12.5px; color: var(--text-secondary); }
.tile-value { font-size: 1.35rem; font-weight: 600; margin-top: .1rem; letter-spacing: -.01em; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .15rem; min-height: 26px; }
.tile-delta { font-size: 12px; color: var(--text-secondary); }
.tile-delta.up { color: var(--good); }
.tile-delta.down { color: var(--bad); }
.spark { display: block; }

/* ---------- kart izgarasi ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card-span2 { grid-column: span 1; }
@media (min-width: 720px) { .card-span2 { grid-column: span 2; } }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.1rem 1.1rem; min-width: 0;
}
.card-wide { grid-column: 1 / -1; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .2rem; }
.card h3 { font-size: 15px; font-weight: 600; margin: 0; }
.card-sub { font-size: 12.5px; color: var(--text-secondary); margin: .15rem 0 0; }
.card-note { font-size: 12px; color: var(--text-secondary); margin: .5rem 0 0; }
.chart-body { width: 100%; margin-top: .6rem; }
.panels { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 780px) { .panels { grid-template-columns: repeat(var(--panels, 2), 1fr); } }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.cell, .seg, .hit { transition: stroke .1s ease; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem .85rem; margin-top: .55rem; font-size: 12.5px; color: var(--text-secondary); }
.legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.legend-key { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.legend-key.is-line { width: 14px; height: 2px; border-radius: 2px; }

/* ---------- tablolar ---------- */
.card-table { margin-top: .8rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.table-scroll { overflow: auto; max-height: 420px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: right; padding: .4rem .55rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th {
  position: sticky; top: 0; background: var(--surface-1); color: var(--text-secondary);
  font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; z-index: 1;
}
.data-table tbody tr:hover { background: var(--hover); }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text-primary); }
.table-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.rec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--border); border-radius: 10px; overflow: hidden; margin-top: .7rem; }
.rec { background: var(--surface-1); padding: .7rem .8rem; }
.rec-label { font-size: 12px; color: var(--text-secondary); }
.rec-value { font-size: 1.05rem; font-weight: 600; }
.rec-meta { font-size: 12px; color: var(--text-secondary); margin-top: .05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta a { color: inherit; }

/* ---------- ipucu ---------- */
.tip {
  position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-ink);
  border-radius: 9px; padding: .5rem .6rem; min-width: 130px; max-width: 280px;
  font-size: 12.5px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  opacity: 0; transition: opacity .09s ease;
}
.tip.is-on { opacity: 1; }
.tip-title { font-weight: 600; margin-bottom: .3rem; opacity: .95; }
.tip-row { display: flex; align-items: center; gap: .45rem; line-height: 1.5; }
.tip-key { width: 12px; height: 2px; border-radius: 2px; flex: 0 0 auto; }
.tip-key-empty { background: currentColor; opacity: .3; }
.tip-label { opacity: .78; margin-right: auto; }
.tip-value { font-weight: 650; font-variant-numeric: tabular-nums; }

.footer {
  border-top: 1px solid var(--border); color: var(--text-secondary);
  font-size: 12px; padding: 1.2rem clamp(1rem, 4vw, 2.5rem) 2rem; max-width: 1400px; margin: 0 auto;
}
.footer p { margin: .2rem 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .topbar, .filters, .ghost-btn { display: none; } .card { break-inside: avoid; } }
