:root {
  --paper: #EDF1F6;
  --surface: #FFFFFF;
  --ink: #172033;
  --muted: #566078;
  --line: #C6CFDC;
  --plate: #1E3F7A;
  --plate-ink: #FFFFFF;
  --up: #A8261E;
  --down: #2B6A4C;
  --focus: #E0A400;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1624;
    --surface: #172133;
    --ink: #E6EBF2;
    --muted: #9AA6BA;
    --line: #2C384D;
    --plate: #2A55A0;
    --up: #F07A6E;
    --down: #6CC59A;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
}
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top, main, .foot { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; padding-bottom: 18px; }
.brand { font: 700 24px/1 var(--display); text-decoration: none; letter-spacing: .01em; }
.toplinks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; }
.toplinks a { padding: 8px 0; }
.toplinks a { font-weight: 500; color: var(--muted); }

h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.02; margin: 0; }
h1 { font-size: clamp(42px, 8vw, 76px); letter-spacing: -.01em; max-width: 13ch; }
h2 { font-size: clamp(28px, 4.4vw, 38px); margin-bottom: 6px; }
.lede { font-size: 19px; max-width: 46ch; color: var(--muted); margin: 18px 0 0; }
.hint { color: var(--muted); margin: 0 0 18px; font-size: 15px; }

/* İstanbul kapı numarası levhası: lacivert zemin, beyaz iç çerçeve */
.plate {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--plate); color: var(--plate-ink);
  border-radius: 14px; padding: 16px 30px 14px;
  box-shadow: inset 0 0 0 4px var(--plate), inset 0 0 0 6px var(--plate-ink);
  text-align: center; min-width: 210px;
}
.plate-top, .plate-bottom { font: 600 17px/1.2 var(--display); letter-spacing: .02em; }
.plate-num { font: 700 clamp(64px, 12vw, 104px)/.95 var(--display); font-variant-numeric: tabular-nums; margin: 4px 0; }
.plate-num.plate-message { max-width: 13ch; font-size: clamp(24px, 5vw, 38px); line-height: 1.12; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; padding: 28px 0 44px; }
@media (max-width: 680px) {
  .hero { grid-template-columns: 1fr; gap: 26px; padding-bottom: 32px; }
  .plate-hero { justify-self: start; }
}

section { padding: 36px 0; border-top: 1px solid var(--line); }
.hero { border-top: 0; }

/* Form */
form { display: grid; gap: 18px; max-width: 620px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
label, legend { font-weight: 600; font-size: 15px; padding: 0; }
input, select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100%;
  min-height: 48px;
}
input:focus, select:focus { border-color: var(--plate); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--up); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; font-weight: 500; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: inline-block; min-width: 54px; text-align: center; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.seg input:checked + span { background: var(--plate); color: var(--plate-ink); border-color: var(--plate); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--plate); }
.check label { font-weight: 500; }
.field.check { align-self: end; padding-bottom: 12px; }
.consent label { font-size: 15px; color: var(--muted); font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

button {
  font: 600 20px/1 var(--display); letter-spacing: .02em;
  background: var(--plate); color: var(--plate-ink); border: 0; border-radius: 10px;
  padding: 16px 22px; cursor: pointer; justify-self: start; min-height: 52px;
}
button[disabled] { opacity: .6; cursor: progress; }
button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.error { color: var(--up); font-weight: 600; margin: 0; }

/* Sonuç */
.result .plate { margin: 14px 0 18px; }
.plate-result { animation: hang .5s cubic-bezier(.2,.9,.3,1.2); transform-origin: top center; }
@keyframes hang { from { transform: rotate(-4deg) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .plate-result { animation: none; } }
.verdict { font-size: 20px; max-width: 44ch; margin: 0 0 20px; }
.verdict b.up { color: var(--up); }
.verdict b.down { color: var(--down); }
.verdict.neutral { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Tablo */
.city { font-size: 17px; margin: 0 0 16px; }
.rows { border-top: 2px solid var(--ink); }
.r {
  display: grid; grid-template-columns: 1.3fr 1fr 1.3fr .8fr .8fr .5fr; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline;
  font-variant-numeric: tabular-nums; text-decoration: none; color: inherit;
}
a.r:hover .ad { text-decoration: underline; text-underline-offset: 3px; }
.r .gap { font-weight: 600; }
.r .gap.up { color: var(--up); }
.r .gap.down { color: var(--down); }
.r-head { font-size: 14px; color: var(--muted); font-weight: 600; }
.r .ad { font-weight: 600; }
.r .num { font: 600 21px/1 var(--display); }
.r .wait { color: var(--muted); font-size: 15px; grid-column: 2 / 5; }
.limited-data { display: inline-block; color: var(--muted); font: 500 12px/1.2 var(--body); white-space: nowrap; }
.info-mark {
  display: inline-flex; width: 17px; height: 17px; align-items: center; justify-content: center;
  border: 1px solid currentColor; border-radius: 50%; font: 600 11px/1 var(--body);
  vertical-align: .1em; cursor: help;
}
.r .n { color: var(--muted); text-align: right; }
.r-head span:last-child { text-align: right; }
@media (max-width: 600px) {
  .r { grid-template-columns: 1fr auto; row-gap: 2px; }
  .r-head { display: none; }
  .r .ad { grid-column: 1; }
  .r .n { grid-column: 2; grid-row: 1; }
  .r .num { grid-column: 1; }
  .r .rng, .r .pm2, .r .gap { grid-column: 1 / -1; font-size: 15px; color: var(--muted); font-weight: 400; }
  .r .gap::before { content: "İlana göre: "; color: var(--muted); font-weight: 400; }
  .r .wait { grid-column: 1 / -1; }
  .r .rng::before { content: "Tipik aralık: "; }
  .r .pm2::before { content: "m² başına: "; }
}

.method p { max-width: 64ch; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 28px; padding-bottom: 44px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

/* Aydınlatma metni */
.doc { max-width: 68ch; padding: 20px 0 48px; }
.doc h1 { font-size: clamp(36px, 6vw, 52px); max-width: none; margin-bottom: 18px; }
.doc h2 { font-size: 26px; margin: 28px 0 6px; }

/* Sekmeler */
.tools { padding-top: 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ink); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] {
  font: 600 21px/1 var(--display); letter-spacing: .01em; background: none; color: var(--muted);
  border: 0; border-radius: 10px 10px 0 0; padding: 14px 16px 12px; min-height: 0; white-space: nowrap; flex: none;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--plate); color: var(--plate-ink); }
.tabs [role="tab"]:not([aria-selected="true"]):hover { color: var(--ink); }
.panel > .hint { max-width: 60ch; }
.field.narrow { max-width: calc(50% - 9px); }
@media (max-width: 560px) {
  .field.narrow { max-width: none; }
  .tabs [role="tab"] { font-size: 18px; padding: 12px 12px 10px; }
  .toplinks a:first-child { display: none; }
}
.result { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.result h2 { margin-bottom: 0; }
.aside { color: var(--muted); max-width: 60ch; margin: -6px 0 20px; }
.result .aside:last-child { margin-bottom: 0; }
.card-preview { display: block; width: 100%; max-width: 270px; margin-top: 18px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }

textarea {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%; max-width: 620px;
  border: 1.5px solid var(--line); border-radius: 8px; padding: 12px; resize: vertical; line-height: 1.5;
}
.msg { display: grid; gap: 8px; margin: 0 0 22px; }
.msg label { font-weight: 600; font-size: 15px; }
.msg .actions { margin-top: 4px; }

/* Veri bekleyen ilçeler */
.pending { margin-top: 18px; border-top: 1px solid var(--line); }
.pending summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.pending-list { display: grid; }
.p-row {
  display: grid; grid-template-columns: 1.3fr 1.2fr 1.5fr; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; font-size: 15px;
}
.p-row:hover .ad { text-decoration: underline; text-underline-offset: 3px; }
.p-row .ad { font-weight: 600; }
.p-row .prog { display: flex; align-items: center; gap: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-row .bar { flex: none; width: 64px; height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.p-row .bar::after { content: ""; position: absolute; inset: 0 auto 0 0; background: var(--plate); }
.p-row .bar-0::after { width: 0%; }
.p-row .bar-5::after { width: 5%; }
.p-row .bar-10::after { width: 10%; }
.p-row .bar-15::after { width: 15%; }
.p-row .bar-20::after { width: 20%; }
.p-row .bar-25::after { width: 25%; }
.p-row .bar-30::after { width: 30%; }
.p-row .bar-35::after { width: 35%; }
.p-row .bar-40::after { width: 40%; }
.p-row .bar-45::after { width: 45%; }
.p-row .bar-50::after { width: 50%; }
.p-row .bar-55::after { width: 55%; }
.p-row .bar-60::after { width: 60%; }
.p-row .bar-65::after { width: 65%; }
.p-row .bar-70::after { width: 70%; }
.p-row .bar-75::after { width: 75%; }
.p-row .bar-80::after { width: 80%; }
.p-row .bar-85::after { width: 85%; }
.p-row .bar-90::after { width: 90%; }
.p-row .bar-95::after { width: 95%; }
.p-row .bar-100::after { width: 100%; }
.p-row .pz { color: var(--muted); text-align: right; }
@media (max-width: 600px) {
  .p-row { grid-template-columns: 1fr auto; row-gap: 2px; }
  .p-row .pz { grid-column: 1 / -1; text-align: left; }
}

/* İlçe sayfaları */
.crumbs { font-size: 15px; color: var(--muted); padding-top: 8px; }
.ilce-hero { padding-bottom: 34px; }
.facts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.facts .plate { min-width: 0; padding: 12px 22px 10px; }
.facts .plate-num { font-size: clamp(40px, 7vw, 60px); }
.plate-hero .plate-message { max-width: 12ch; font-size: clamp(22px, 5vw, 36px); line-height: 1.1; }
.facts .plate-top, .facts .plate-bottom { font-size: 15px; }
.odalar .r { grid-template-columns: 1fr 1fr 1.4fr .8fr .5fr; }
.cta-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn-link {
  display: inline-block; font: 600 20px/1 var(--display); letter-spacing: .02em; text-decoration: none;
  background: var(--plate); color: var(--plate-ink); border-radius: 10px; padding: 16px 22px;
}
.btn-link.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.others { columns: 3 160px; gap: 24px; padding: 0; list-style: none; margin: 0; }
.others li { padding: 8px 0; break-inside: avoid; }
@media (max-width: 600px) {
  .odalar .r { grid-template-columns: 1fr auto; }
  .facts .plate { flex: 1 1 140px; }
  .facts .plate-num { overflow-wrap: anywhere; }
}

.tabs .t-s { display: none; }
@media (max-width: 560px) {
  .tabs .t-l { display: none; }
  .tabs .t-s { display: inline; }
  .tabs [role="tab"] { flex: 1 1 auto; padding: 12px 8px 10px; }
}

/* Aylık rapor */
.report { max-width: 68ch; padding: 8px 0 20px; }
.report h1 { font-size: clamp(34px, 5.6vw, 54px); max-width: none; margin: 10px 0 18px; }
.rep-p { font-size: 19px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 26px; margin: 30px 0 22px; max-width: 880px; }
.rep-col h3 { font: 600 20px/1.15 var(--display); margin: 0 0 8px; }
.rep-list { margin: 0; padding: 0; list-style: none; counter-reset: r; border-top: 2px solid var(--ink); }
.rep-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rep-list b { font: 600 19px/1.2 var(--display); white-space: nowrap; }

/* Gömülebilir kutu */
.embed-demo { margin: 6px 0 16px; }
.ke-embed-frame { border: 0; max-width: 100%; }
.embed-demo iframe { border: 0; max-width: 100%; }
.embed-body { background: transparent; overflow-x: hidden; }
.embed-box { display: block; width: 100%; max-width: 300px; padding: 16px 18px 12px; border-radius: 14px; text-align: center; text-decoration: none; color: #fff; background: #1E3F7A; box-shadow: inset 0 0 0 4px #1E3F7A, inset 0 0 0 6px #fff; }
.embed-box .t, .embed-box .b { display: block; font: 600 16px/1.2 var(--display); }
.embed-box .n { display: block; margin: 6px 0; font: 700 clamp(28px, 18vw, 54px)/1 var(--display); font-variant-numeric: tabular-nums; }
.embed-box .s { display: block; overflow-wrap: anywhere; margin-top: 10px; font-size: 13px; opacity: .9; }
.embed-code-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.embed-code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

/* Grafikler */
.chart { margin: 0; }
.chart figcaption { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.ch-tick { fill: var(--muted); font: 12px var(--body); font-variant-numeric: tabular-nums; }
.ch-bar { fill: var(--plate); }
.ch-hit:hover .ch-bar { opacity: .8; }
.ch-line { fill: none; stroke: var(--plate); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dash { stroke-dasharray: 6 5; }
.ch-band { fill: var(--plate); opacity: .12; }
.ch-dot { fill: var(--plate); stroke: var(--paper); stroke-width: 2; }
.ch-lab { fill: var(--ink); font: 600 15px var(--display); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); margin-top: 6px; }
.ch-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--plate); vertical-align: middle; margin-right: 6px; }
.ch-legend i.k-dash { border-top-style: dashed; }
.ch-legend i.k-band { height: 10px; border: 0; background: var(--plate); opacity: .18; border-radius: 2px; }
.z-chart { margin: 0 0 24px; max-width: 720px; }
.z-chart { --chart-color: var(--plate); }
.z-chart h3 { font: 600 20px/1.2 var(--display); margin: 0 0 8px; }
.z-chart .hint { margin-top: 8px; }
.z-chart figcaption { color: var(--ink); font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.z-chart svg { width: 100%; height: auto; max-height: 240px; display: block; overflow: visible; }
.z-gridline { stroke: var(--line); stroke-width: 1; }
.z-axis { fill: var(--muted); font: 12px var(--body); }
.z-history, .z-forecast { fill: none; stroke: var(--chart-color); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.z-forecast { stroke-dasharray: 7 5; }
.z-band { fill: var(--chart-color); opacity: .16; }
.z-point { fill: var(--chart-color); stroke: var(--paper); stroke-width: 1.5; }
.z-chart .ch-legend i { border-color: var(--chart-color); }
.z-chart .ch-legend i.k-band { background: var(--chart-color); }
@media (prefers-color-scheme: dark) {
  .z-chart { --chart-color: #91B5F2; }
}
@media (max-width: 420px) {
  .z-chart { margin-inline: -2px; }
  .z-chart figcaption { font-size: 15px; }
  .z-axis { font-size: 12px; }
}

/* Abonelik */
.abone { margin: 4px 0 24px; padding: 20px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); max-width: 660px; display: grid; gap: 14px; }
.abone[hidden], .abone-disabled[hidden] { display: none; }
[data-email-feature][hidden], [data-email-soon][hidden] { display: none; }
[data-newsletter-slot] { flex-basis: 100%; width: 100%; }
#contactForm { display: grid; gap: 18px; }
#contactForm textarea { width: 100%; padding: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; font: inherit; }
.abone h3 { font: 600 22px/1.15 var(--display); margin: 0; }
.abone .hint { margin: 0; }
.ok-note { color: var(--down); font-weight: 600; margin: 0; }

/* Yönetim paneli */
main.wide, .admin .top { max-width: 1120px; }
.admin-h { font-size: clamp(32px, 5vw, 46px); max-width: none; margin: 4px 0 18px; }
.admin section { padding: 26px 0; }
.admin h2 { font-size: 26px; margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; border-top: 0; padding-top: 0; }
.tile { background: var(--surface); border-radius: 10px; padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 2px; }
.tl { color: var(--muted); font-size: 14px; }
.tv { font: 600 34px/1.1 var(--body); }
.ts { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; margin-bottom: 14px; }
.tbl th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 8px 6px 0; border-bottom: 2px solid var(--ink); }
.tbl td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl .num { text-align: right; }
.tbl .muted, .muted { color: var(--muted); }
.st { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.st-ok { background: color-mix(in srgb, var(--down) 15%, transparent); color: var(--down); }
.st-hata { background: color-mix(in srgb, var(--up) 15%, transparent); color: var(--up); }
.st-bekliyor { background: var(--line); color: var(--ink); }
button.small { font-size: 15px; padding: 7px 12px; min-height: 0; border-radius: 8px; }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; color: var(--muted); font: 500 17px var(--body); padding: 0; min-height: 0; text-decoration: underline; text-underline-offset: 3px; }
.flash { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 10px 14px; }
.login { max-width: 360px; display: grid; gap: 14px; margin-top: 18px; }
@media (max-width: 700px) { .tbl.status td:nth-child(3) { display: none; } }

.data-error { padding: 12px 0; }
#statsRetry { margin: 0 0 16px; }
