:root {
  --brand: #f7931a;
  --brand-strong: #e8720c;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
html[data-theme="light"] {
  color-scheme: light;
  --page: #f6f6f3;
  --surface-1: #ffffff;
  --surface-2: #f1f0ec;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #85837d;
  --grid: #e6e5df;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.09);
  --border-strong: rgba(11, 11, 11, 0.16);
  --series-1: #2a78d6;
  --series-1-wash: rgba(42, 120, 214, 0.12);
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --critical: #d03b3b;
  --brand-text: #b85a00;
  --brand-wash: rgba(247, 147, 26, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --hero: linear-gradient(135deg, #fff7ec 0%, #ffffff 55%, #eef4fc 100%);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #171716;
  --surface-2: #1f1f1d;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #8d8b84;
  --grid: #2a2a28;
  --axis: #3a3a37;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --series-1: #3987e5;
  --series-1-wash: rgba(57, 135, 229, 0.16);
  --good: #0ca30c;
  --good-text: #2fbf2f;
  --warning: #fab219;
  --critical: #e05252;
  --brand-text: #ffaa45;
  --brand-wash: rgba(247, 147, 26, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --hero: radial-gradient(1100px 380px at 0% 0%, rgba(247, 147, 26, 0.16), transparent 60%),
          radial-gradient(900px 340px at 100% 100%, rgba(57, 135, 229, 0.12), transparent 60%), #141413;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------------- ust cubuk */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-name { font-weight: 700; letter-spacing: 0.04em; font-size: 16px; }
.brand-name b { color: var(--brand-text); font-weight: 800; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--text-secondary); padding: 7px 12px; border-radius: 9px; font-weight: 550;
}
.nav a:hover { color: var(--text-primary); background: var(--surface-2); }
.nav a.active { color: var(--text-primary); background: var(--surface-2); }
.tools { display: flex; gap: 6px; margin-left: auto; }
.tool {
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary);
  font: 600 12.5px/1 system-ui, sans-serif; display: inline-flex; align-items: center; justify-content: center;
}
.tool:hover { color: var(--text-primary); border-color: var(--border-strong); }

/* ---------------- arama */
.search { display: flex; align-items: center; position: relative; }
.search input {
  width: 100%; height: 44px; padding: 0 48px 0 16px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-primary);
  font: 500 14.5px var(--mono); outline: none;
}
.search input::placeholder { font-family: system-ui, sans-serif; color: var(--text-muted); }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.search button {
  position: absolute; right: 5px; height: 34px; width: 38px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--brand); color: #1a1000; display: flex; align-items: center; justify-content: center;
}
.search button:hover { background: var(--brand-strong); }
.search.mini { flex: 1; max-width: 380px; margin-left: 12px; }
.search.mini input { height: 38px; font-size: 13px; }
.search.mini button { height: 30px; width: 32px; }
.search.big input { height: 54px; font-size: 15px; padding-right: 128px; }
.search.big button { width: auto; padding: 0 18px; height: 44px; font-weight: 650; font-size: 14px; gap: 6px; }
.search-error { color: var(--critical); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------------- kahraman */
.hero {
  background: var(--hero); border: 1px solid var(--border); border-radius: 20px;
  padding: 34px 34px 30px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 34px;
  margin-bottom: 18px; box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--brand-text);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12,163,12,.55); } 70% { box-shadow: 0 0 0 8px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }
.hero h1 { font-size: 38px; line-height: 1.12; letter-spacing: -0.025em; margin: 10px 0 12px; font-weight: 750; }
.hero h1 em { font-style: normal; color: var(--brand-text); }
.hero p.lead { color: var(--text-secondary); font-size: 15.5px; margin: 0 0 18px; max-width: 560px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary); font-weight: 550;
}
.badge.brand { background: var(--brand-wash); color: var(--brand-text); border-color: transparent; }
.hero-side { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.hero-side h3 { margin: 0 0 4px; font-size: 15px; }

.connect-box {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 6px 4px;
}
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; }
.kv + .kv { border-top: 1px solid var(--border); }
.kv .k { color: var(--text-muted); font-size: 12.5px; }
.kv .v { font-family: var(--mono); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .v .ph { color: var(--brand-text); }
.copy {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); border-radius: 8px;
  height: 28px; padding: 0 10px; font: 600 12px system-ui, sans-serif; cursor: pointer; white-space: nowrap;
}
.copy:hover { color: var(--text-primary); border-color: var(--border-strong); }

/* ---------------- kutucuklar */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile, .card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.tile { padding: 15px 16px 14px; min-width: 0; }
.tile .label { color: var(--text-secondary); font-size: 12.5px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value small { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-left: 3px; }
.tile .note { color: var(--text-muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.accent { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.tile.accent .value { color: var(--brand-text); }

/* ---------------- kartlar ve yerlesim */
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.card { padding: 18px 18px 14px; min-width: 0; margin-bottom: 18px; }
.grid-main > .card, .grid-2 > .card { margin-bottom: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 15.5px; margin: 0; font-weight: 650; }
.card-head .sub { color: var(--text-muted); font-size: 12.5px; }
.side-stats { display: flex; flex-direction: column; }
.side-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.side-row:last-child { border-bottom: 0; }
.side-row .k { color: var(--text-secondary); font-size: 13px; }
.side-row .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.side-row .v small { display: block; font-weight: 500; color: var(--text-muted); font-size: 11.5px; }

/* ---------------- tablolar */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; color: var(--text-muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
th.r, td.r { text-align: right; }
td.num, th.num { font-variant-numeric: tabular-nums; }
tr.ours td { background: var(--brand-wash); }
tr.ours:hover td { background: var(--brand-wash); }
.link { color: var(--series-1); text-decoration: none; }
.link:hover { text-decoration: underline; }
.empty { color: var(--text-muted); text-align: center; padding: 26px 12px; font-size: 13.5px; }
.rank { display: inline-flex; width: 22px; height: 22px; border-radius: 7px; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-secondary); }
.rank.r1 { background: var(--brand); color: #1a1000; }

/* havuz rozeti */
.pool { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.pool img, .pool .initials { width: 24px; height: 24px; border-radius: 7px; flex: none; }
.pool img { background: #fff; object-fit: contain; padding: 2px; }
.pool img.own { background: transparent; padding: 0; }
.initials { display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; color: #fff; letter-spacing: 0.02em; }
.initials.c0 { background: #5b6b8c; } .initials.c1 { background: #2a78d6; } .initials.c2 { background: #8a5cc7; }
.initials.c3 { background: #1f9e89; } .initials.c4 { background: #c75c5c; } .initials.c5 { background: #b08a1e; }
.initials.c6 { background: #4e8f3a; } .initials.c7 { background: #6c6c6c; }
.tag-ours { font-size: 10.5px; font-weight: 750; letter-spacing: .05em; color: #1a1000; background: var(--brand); padding: 2px 7px; border-radius: 999px; }

/* durum */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.status.on { color: var(--good-text); }
.status.on::before { background: var(--good); }
.status.off { color: var(--text-muted); }

/* ---------------- grafik */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-muted); font-size: 11px; font-family: system-ui, sans-serif; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1-wash); }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .dot { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.chart-empty { height: 240px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13.5px; }
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font-size: 12.5px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); white-space: nowrap;
}
.tooltip .t { color: var(--text-muted); font-size: 11.5px; margin-bottom: 2px; }
.tooltip .v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- cihaz cubuklari */
.bars { display: flex; flex-direction: column; gap: 11px; padding: 4px 0 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.bar-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .meta { color: var(--text-secondary); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--series-1); }

/* ---------------- adres sayfasi */
.addr-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.addr-title { min-width: 0; }
.addr-title .crumb { color: var(--text-muted); font-size: 13px; text-decoration: none; }
.addr-title .crumb:hover { color: var(--text-primary); }
.addr-title h1 { font-size: 22px; margin: 6px 0 0; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.addr-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
.addr-line .mono { font-size: 14px; color: var(--text-secondary); overflow-wrap: anywhere; }
.chance { display: flex; flex-direction: column; gap: 4px; }
.chance .big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- baglan / sss */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.step { padding: 18px; }
.step .n { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #1a1000; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: 15px; }
.step p { margin: 0; color: var(--text-secondary); font-size: 13.5px; }
.prose { color: var(--text-secondary); font-size: 14px; }
.prose h3 { color: var(--text-primary); font-size: 15px; margin: 18px 0 6px; }
.prose p { margin: 0 0 10px; }
.prose .card-head h2 { color: var(--text-primary); }
.prose code, .step code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--text-primary); }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
details.faq { border-bottom: 1px solid var(--border); padding: 12px 0; }
details.faq:last-child { border-bottom: 0; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::after { content: "+"; color: var(--text-muted); font-weight: 400; }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 8px 0 0; color: var(--text-secondary); }

.notice {
  border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--border)); background: color-mix(in srgb, var(--warning) 10%, var(--surface-1));
  border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; font-size: 13.5px; color: var(--text-primary);
}
.notice.error { border-color: color-mix(in srgb, var(--critical) 55%, var(--border)); background: color-mix(in srgb, var(--critical) 9%, var(--surface-1)); }

/* ---------------- alt bilgi, yukleniyor, bildirim */
.footer { border-top: 1px solid var(--border); padding: 22px 0; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .04em; }
.loading { display: flex; justify-content: center; padding: 120px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--brand); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--text-primary); color: var(--page); padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
}

/* ---------------- duyarli */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; }
  .hero h1 { font-size: 30px; }
  .grid-main, .grid-2, .steps { grid-template-columns: minmax(0, 1fr); }
  .search.mini { display: none; }
  .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .value { font-size: 20px; }
  .nav a { padding: 7px 8px; }
  .brand-name { display: none; }
  .kv { grid-template-columns: 84px minmax(0, 1fr) auto; padding: 8px 8px; }
  .search.big input { padding-right: 16px; }
  .kv .v { white-space: normal; overflow-wrap: anywhere; }
  .search.big button { position: static; margin-top: 8px; width: 100%; height: 44px; }
  .search.big { flex-direction: column; align-items: stretch; }
  .hide-sm { display: none; }
}
