/* bina.az qiymet modeli — UI.
 *
 * Xarici srift, CSS kitabxanasi ve ya CDN YOXDUR, qesden: sayt ucuncu
 * terefe sorgu acmir, ilk boyanma xarici seliqeye bagli deyil, ve sistem
 * srift desti her platformada yaxsi gorunur.
 *
 * Gorunus: "kadastr plani" — kagiz rengli fon, zeif sahe torü, bir dene
 * vurgu (tund firuzeyi). research-assistant-in qardasidir, amma eyni deyil:
 * orada metn oxunur, burada reqem oxunur, ona gore reqemler (tabular-nums,
 * ince ayiricilar) ve diaqramlar on plandadir.
 *
 * Diaqram rengleri vurgudan AYRIDIR. `--s-prem` / `--s-std` (narinci / goy)
 * dataviz palitrasinin 1-ci ve 2-ci slotudur, ve validator ile iki rejimde
 * yoxlanilib (2026-10-18: CVD ΔE 9.2 isiqli / 9.4 qaranliq, normal 27+).
 * Vurgunu diaqrama qoymaq "premium" ile "bizim model" menasini qarisdirardi.
 *
 * Isiqli/qaranliq `prefers-color-scheme` ile avtomatikdir. Qaranliq deyerler
 * eyni rampanin oz addimlaridir, avtomatik tersine cevirme deyil.
 */

:root {
  --bg: #f6f5f0;
  --bg-elev: #ffffff;
  --bg-sunk: #f0efe9;
  --plot: #0f6e5e0b;
  --text: #15171a;
  --text-dim: #565b61;
  --text-faint: #80858b;
  --line: #e2e0d8;
  --line-soft: #ecebe5;

  --accent: #0f6e5e;
  --accent-ink: #ffffff;
  --accent-soft: #0f6e5e12;
  --accent-line: #0f6e5e3d;

  /* diaqram */
  --s-std: #2a78d6;       /* standart / bizim model */
  --s-prem: #eb6834;      /* premium */
  --s-base: #a3a19a;      /* muqayise (scikit-learn), sakit boz */
  --s-band: #2a78d61f;
  --grid-line: #e7e5de;
  --axis: #c3c2b7;

  --ok: #1d7a3a;
  --ok-soft: #1d7a3a14;
  --warn: #855800;
  --warn-soft: #f5b62a22;
  --danger: #a3302a;
  --danger-soft: #a3302a10;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px #0000000a, 0 8px 24px -14px #0000001c;
  --maxw: 1160px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111312;
    --bg-elev: #191c1b;
    --bg-sunk: #151817;
    --plot: #4fc1a60a;
    --text: #ecebe6;
    --text-dim: #a8aca9;
    --text-faint: #7d827f;
    --line: #2c302e;
    --line-soft: #222624;

    --accent: #4fc1a6;
    --accent-ink: #08241e;
    --accent-soft: #4fc1a618;
    --accent-line: #4fc1a640;

    --s-std: #3987e5;
    --s-prem: #d95926;
    --s-base: #6f716c;
    --s-band: #3987e526;
    --grid-line: #262a28;
    --axis: #3a3e3c;

    --ok: #5cc27a;
    --ok-soft: #5cc27a18;
    --warn: #e7b45a;
    --warn-soft: #e7b45a1a;
    --danger: #ec8a80;
    --danger-soft: #ec8a8014;

    --shadow: 0 1px 2px #00000040, 0 8px 24px -14px #00000080;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Kadastr toru: iki olcude xett — boyuk "mehelle" ve kicik "sahe". `fixed`,
   sehife surusende terpenmesin deye; maska onu yuxarida saxlayir ki, metnin
   altinda gozu yormasin. */
.bg-plot {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--plot) 1px, transparent 1px),
    linear-gradient(90deg, var(--plot) 1px, transparent 1px),
    linear-gradient(var(--plot) 1px, transparent 1px),
    linear-gradient(90deg, var(--plot) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  mask-image: radial-gradient(ellipse 85% 50% at 50% 0%, #000 30%, transparent 100%);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 8px; z-index: 50; background: var(--bg-elev); padding: 6px 10px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main:focus { outline: none; }

/* --- ust zolaq ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 58px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 9px; color: var(--accent-ink); background: var(--accent);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 14.5px; font-weight: 640; letter-spacing: -0.01em; min-width: 0; }
.brand-text small { font-size: 11.5px; color: var(--text-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--bg-elev); }
.lang-btn {
  border: 0; background: transparent; color: var(--text-faint); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
}
.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Naviqasiya: dar ekranda dord beraber hucre — surusdurme yox, cunki
   gizlenen bolme movcud olmayan bolme kimi gorunur. */
.nav { display: flex; gap: 4px; height: 42px; align-items: stretch; }
.nav a {
  display: flex; align-items: center; padding: 0 12px; font-size: 14px;
  color: var(--text-dim); text-decoration: none; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* --- hero ----------------------------------------------------------------- */
.hero { padding: 40px 0 22px; max-width: 760px; }
.eyebrow {
  margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 12px; font-size: clamp(26px, 4.6vw, 38px); line-height: 1.14;
  font-weight: 680; letter-spacing: -0.026em;
}
.hero p { margin: 0; color: var(--text-dim); font-size: 16px; max-width: 64ch; }

.section-head { margin: 8px 0 12px; }
.section-head h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.012em; }
.section-head p { margin: 0; color: var(--text-dim); font-size: 14px; max-width: 80ch; }

/* --- paneller ------------------------------------------------------------- */
.panel {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; min-width: 0; max-width: 100%;
}
.panel h2 { margin: 0 0 10px; font-size: 17px; letter-spacing: -0.012em; }
.panel h3 { margin: 18px 0 8px; font-size: 14.5px; letter-spacing: -0.008em; }
.muted { color: var(--text-dim); font-size: 13.5px; }
.loading { color: var(--text-faint); font-size: 14px; }

/* --- numune kartlari ------------------------------------------------------ */
.samples { margin-bottom: 22px; }
.sample-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.sample {
  display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0;
  padding: 12px 13px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
  font: inherit; transition: border-color .15s, background .15s, transform .08s;
}
.sample:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.sample:active { transform: translateY(1px); }
.sample:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sample.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.sample-kind {
  align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; background: var(--bg-sunk); color: var(--text-dim);
  border: 1px solid var(--line);
}
.sample-kind.k-hard { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.sample-kind.k-luxury { color: var(--text); }
.sample-title { font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: -0.006em; overflow-wrap: anywhere; }
.sample-sub { font-size: 12px; color: var(--text-faint); overflow-wrap: anywhere; }
.sample-nums {
  display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin-top: 2px;
  font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-dim);
}
.sample-nums b { font-weight: 600; color: var(--text); text-align: right; }
.err-chip { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.err-small { color: var(--ok); }
.err-mid { color: var(--warn); }
.err-big { color: var(--danger); }

/* --- forma ----------------------------------------------------------------- */
.predict-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 980px) {
  .predict-grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
}

.pform-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pform-head h2 { margin: 0; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f-wide { grid-column: 1 / -1; }
.f[hidden] { display: none; }
.f-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.f-label em { font-style: normal; font-weight: 500; color: var(--text-faint); }
.f-sub { font-size: 12px; color: var(--text-faint); }
.f-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-faint); overflow-wrap: anywhere; }
.f-hint[hidden] { display: none; }
.hint-box { margin-top: 14px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--bg-sunk); border: 1px solid var(--line-soft); }
.hint-box code { font-family: var(--mono); font-size: 11.5px; }

input[type="number"], select, textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; font-variant-numeric: tabular-nums;
}
select { padding-right: 6px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
input:disabled { opacity: .55; }
input:invalid:not(:placeholder-shown) { border-color: var(--danger); }
input::placeholder { color: var(--text-faint); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.coords-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.coords-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }

.flag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  padding: 6px 12px 6px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; font-size: 13.5px; color: var(--text-dim);
  transition: border-color .15s, background .15s, color .15s; user-select: none;
}
.pill:hover { border-color: var(--text-faint); }
.pill input { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; flex: none; }
.pill:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.pill:has(input:indeterminate) { border-style: dashed; }
.pill:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill .unk { font-size: 11px; color: var(--text-faint); }

.pform-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.elapsed { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em;
  transition: filter .15s, transform .08s, opacity .15s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-primary:focus-visible, .btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-icon { width: 15px; height: 15px; }
.btn-ghost {
  border: 1px solid var(--line); background: transparent; color: var(--text-dim); cursor: pointer;
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px;
}
.btn-ghost:hover { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

/* --- xeta ----------------------------------------------------------------- */
.error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 100%, var(--bg-elev)); color: var(--danger); margin-bottom: 14px;
}
.error-head { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.error-head > strong { min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; }
.error-icon { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.error-detail { margin: 7px 0 0 26px; padding-left: 16px; font-size: 13.5px; color: var(--text-dim); overflow-wrap: anywhere; }
.error-retry { margin: 9px 0 0 26px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- netice --------------------------------------------------------------- */
.result-empty { text-align: center; color: var(--text-faint); padding: 34px 20px; }
.result-empty p { margin: 8px auto 0; max-width: 38ch; font-size: 14px; }
.empty-art { width: 120px; height: 60px; color: var(--line); }

.r-block { margin-bottom: 14px; }
.r-price-label { font-size: 12.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; }
.r-price { font-size: clamp(36px, 7vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin: 4px 0 2px; overflow-wrap: anywhere; }
.r-price small { font-size: .42em; font-weight: 600; color: var(--text-dim); letter-spacing: 0; }
.r-interval { font-size: 14.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.r-interval b { color: var(--text); font-weight: 600; }

.compare {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bg-sunk); border: 1px solid var(--line-soft);
  font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.compare b { font-weight: 650; }

.facts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; color: var(--text-dim); }
.facts li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; }
.facts svg { width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }
.facts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

details.more { margin-top: 10px; font-size: 13.5px; color: var(--text-dim); }
details.more > summary { cursor: pointer; color: var(--accent); font-weight: 560; width: fit-content; }
details.more > div { margin-top: 6px; padding: 9px 12px; border-left: 2px solid var(--accent-line); }
details.more p { margin: 0 0 6px; }

/* Diaqram konteyneri. SVG eni JS-de konteynerin olculmus enine gore qurulur
   (viewBox = piksel), ona gore srift olcusu dar ekranda kicilmir. */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: inherit; }
.c-axis { stroke: var(--axis); stroke-width: 1; }
.c-grid { stroke: var(--grid-line); stroke-width: 1; }
.c-tick { fill: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.c-label { fill: var(--text-dim); font-size: 12px; }
.c-label-strong { fill: var(--text); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-value { fill: var(--text-dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.c-band { fill: var(--s-band); }
.c-std { fill: var(--s-std); }
.c-prem { fill: var(--s-prem); }
.c-base { fill: var(--s-base); }
.c-line-std { stroke: var(--s-std); }
.c-line-prem { stroke: var(--s-prem); }
.c-line-base { stroke: var(--s-base); }
.c-ring { stroke: var(--bg-elev); stroke-width: 2; }
.c-ink { fill: var(--text); }
.c-thr { stroke: var(--text-faint); stroke-width: 1; }
.c-hit { fill: transparent; cursor: default; }
.c-cross { stroke: var(--text-faint); stroke-width: 1; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-dim); margin: 6px 0 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-std { background: var(--s-std); }
.sw-prem { background: var(--s-prem); }
.sw-base { background: var(--s-base); }
.sw-band { background: var(--s-band); border: 1px solid var(--s-std); }
.sw-ink { background: var(--text); border-radius: 50%; }
.sw-line { width: 14px; height: 2px; border-radius: 1px; }

/* --- pille (tier) --------------------------------------------------------- */
.tier-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 10px; }
.tier-card { padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.tier-card h4 { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.verdict { display: inline-flex; align-items: center; gap: 7px; font-size: 18px; font-weight: 680; letter-spacing: -0.01em; }
.verdict .sw { width: 11px; height: 11px; }
.tier-num { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Olcu cubugu: dolgu ehtimali dasiyir, sonmus hisse eyni rampanin acig
   addimidir — vezivyet butun zolaq boyunca oxunur. 50% xetti qerar heddidir. */
.meter { position: relative; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--s-std) 22%, transparent); margin: 10px 0 4px; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--s-prem); }
.meter-mid { position: absolute; top: -4px; bottom: -4px; width: 2px; left: calc(50% - 1px); background: var(--text-faint); }
.meter-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.callout {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.5;
  border: 1px solid var(--line); background: var(--bg-sunk); color: var(--text-dim);
}
.callout strong { color: var(--text); }
.callout.agree { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: var(--ok-soft); }
.callout.disagree { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); background: var(--warn-soft); }
.callout.disagree strong { color: var(--warn); }

.warns { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.warns li {
  display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  font-size: 13px; line-height: 1.5; color: var(--text-dim); overflow-wrap: anywhere;
}
.warns svg { width: 16px; height: 16px; color: var(--warn); margin-top: 2px; }

/* --- qerar yolu ------------------------------------------------------------ */
details.explain { border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 12px; }
details.explain > summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px;
  font-size: 15px; font-weight: 620; letter-spacing: -0.008em;
}
/* Basliq metni oz span-indadir ve buzule bilir; eks halda uzun basliq
   (dar ekranda) oxu tek basina bir setirde qoyub asagi dusurdu. */
details.explain > summary .ttl { min-width: 0; flex: 0 1 auto; overflow-wrap: anywhere; }
details.explain > summary .count { flex: none; }
details.explain > summary::-webkit-details-marker { display: none; }
details.explain > summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: rotate(-45deg); transition: transform .15s; flex: none; align-self: center;
}
details.explain[open] > summary::before { transform: rotate(45deg); }
details.explain > summary .count { font-size: 12px; font-weight: 500; color: var(--text-faint); }
.explain-lead { font-size: 12.5px; color: var(--text-faint); margin: 6px 0 8px; }

.path { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px;
}
.step:last-child { border-bottom: 0; }
.step-n { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; text-align: right; }
.step-q { min-width: 0; overflow-wrap: anywhere; }
.step-q .ans { display: inline-block; margin-left: 4px; font-weight: 650; }
.ans.yes { color: var(--ok); }
.ans.no { color: var(--danger); }
.step-q .val { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.step-q .imp { color: var(--warn); font-size: 11.5px; }
.step-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nbar { width: 70px; height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.nbar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.step-leaf { background: var(--accent-soft); border-radius: 8px; padding: 9px 8px; border-bottom: 0; margin-top: 4px; }
.step-leaf .step-q { font-weight: 600; }

/* --- neticeler sehifesi ---------------------------------------------------- */
.source-note {
  margin: 0 0 18px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--bg-elev); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  font-size: 13px; line-height: 1.55; color: var(--text-dim); overflow-wrap: anywhere;
}
.source-note code { font-family: var(--mono); font-size: 12px; }
.r-section { margin: 0 0 18px; }
.r-section > h2 { margin: 26px 0 4px; font-size: 19px; letter-spacing: -0.014em; }
.r-section > .sub { margin: 0 0 12px; font-size: 13.5px; color: var(--text-dim); max-width: 85ch; }
.two-col { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile { padding: 13px 14px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--line); min-width: 0; }
.tile-label { font-size: 12px; color: var(--text-dim); line-height: 1.35; }
.tile-value { font-size: 26px; font-weight: 680; letter-spacing: -0.02em; margin-top: 4px; overflow-wrap: anywhere; }
.tile-note { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td.txt, table.data th.txt { text-align: left; }
table.data thead th { font-size: 11.5px; font-weight: 600; color: var(--text-dim); background: var(--bg-sunk); position: sticky; top: 0; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tr.ours td { background: var(--accent-soft); }
table.data tr.ours td:first-child { font-weight: 600; }
table.data th button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; gap: 4px; align-items: center;
}
table.data th button::after { content: "↕"; opacity: .35; font-size: 10px; }
table.data th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; }
table.data th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; }
.src-tag { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.table-caption { font-size: 12px; color: var(--text-faint); margin: 6px 2px 0; }

/* Qarisiqliq matrisi: 2×2 HTML setkasi. Reng doygunlugu xananin setirdeki
   payini dasiyir; esas melumat yene reqemdir, reng yalniz bir baxisda
   diaqonali gormek ucundur. */
.cm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cm { padding: 13px; }
.cm h3 { margin: 0 0 8px; font-size: 14px; }
.cm-table { display: grid; grid-template-columns: auto 1fr 1fr; gap: 3px; font-size: 12px; }
.cm-head { color: var(--text-faint); font-size: 11px; text-align: center; padding: 2px; align-self: end; }
.cm-rowh { color: var(--text-faint); font-size: 11px; writing-mode: horizontal-tb; align-self: center; padding-right: 6px; text-align: right; }
.cm-cell { border-radius: 6px; padding: 10px 6px; text-align: center; font-variant-numeric: tabular-nums; min-width: 0; }
.cm-cell b { display: block; font-size: 17px; font-weight: 680; }
.cm-cell span { font-size: 11px; opacity: .85; }
.cm-foot { font-size: 12px; color: var(--text-dim); margin-top: 8px; font-variant-numeric: tabular-nums; }

/* Temizleme boru xetti */
.pipeline { list-style: none; margin: 0; padding: 0; counter-reset: pipe; display: grid; gap: 0; }
.pipeline li {
  counter-increment: pipe; position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px;
  padding: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--text-dim);
}
.pipeline li::before {
  content: counter(pipe); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-elev); border: 1px solid var(--accent-line); color: var(--accent); font-size: 11.5px; font-weight: 700;
  position: relative; z-index: 1;
}
.pipeline li::after { content: ""; position: absolute; left: 12.5px; top: 26px; bottom: 0; width: 1px; background: var(--accent-line); }
.pipeline li:last-child::after { display: none; }
.pipeline .p-text { overflow-wrap: anywhere; padding-top: 3px; }
.pipeline .p-text code { font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.pipeline .p-num { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.pipeline li.is-key::before { background: var(--accent); color: var(--accent-ink); }

/* Fiqur qalereyasi */
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.fig {
  margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: #fff; cursor: zoom-in; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column;
}
.fig img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.fig span { display: block; padding: 8px 10px; font-size: 12.5px; color: var(--text-dim); background: var(--bg-elev); border-top: 1px solid var(--line); flex: 1; }
.fig:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 96vw); max-height: 94vh; }
.lightbox::backdrop { background: #000000c4; }
.lightbox figure { margin: 0; }
.lightbox img { display: block; max-width: 100%; max-height: 84vh; margin: 0 auto; background: #fff; border-radius: 10px; }
.lightbox figcaption { color: #eee; font-size: 13.5px; text-align: center; margin-top: 8px; }
.lightbox-close {
  position: fixed; top: 12px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #ffffffe6; color: #111; font-size: 22px; line-height: 1; cursor: pointer;
}

/* Testler */
.tests-sum { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.tests-sum .big { font-size: 22px; font-weight: 700; color: var(--ok); }
.tests-sum .bad { color: var(--danger); }
details.tgroup { border-top: 1px solid var(--line-soft); padding: 8px 0; }
details.tgroup > summary { cursor: pointer; font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
details.tgroup > summary code { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
details.tgroup > summary .cnt { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tcases { list-style: none; margin: 6px 0 0; padding: 0 0 0 4px; display: grid; gap: 2px; }
.tcases li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; font-size: 12px; color: var(--text-dim); }
.tcases code { font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; min-width: 0; }
.tcases .s { font-variant-numeric: tabular-nums; color: var(--text-faint); }
.st-ok { color: var(--ok); font-weight: 700; }
.st-bad { color: var(--danger); font-weight: 700; }

details.tbl { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); margin-bottom: 8px; }
details.tbl > summary { cursor: pointer; padding: 9px 12px; font-size: 13.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
details.tbl > summary code { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
details.tbl > summary .cnt { color: var(--text-faint); font-size: 12px; }
details.tbl .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); max-height: 420px; }
.empty-note { padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--text-faint); font-size: 13.5px; }

/* --- layihe sehifesi ------------------------------------------------------- */
.doc-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.doc-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); text-decoration: none; font-size: 13.5px;
}
.doc-link:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.doc-link svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.doc-link small { color: var(--text-faint); font-size: 11.5px; }

.prose-cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .prose-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prose-cols > .wide { grid-column: 1 / -1; } }
.prose { font-size: 15px; line-height: 1.65; overflow-wrap: break-word; }
.prose p { margin: 0 0 .8em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 .8em; padding-left: 1.2em; }
.prose li { margin-bottom: .3em; }
.prose code { font-family: var(--mono); font-size: .86em; padding: 1px 5px; border-radius: 4px; background: var(--bg-sunk); overflow-wrap: anywhere; }
.prose strong { font-weight: 640; }
.formula {
  margin: .6em 0 .9em; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-sunk);
  border: 1px solid var(--line-soft); font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, serif;
  font-size: 15.5px; line-height: 1.7; overflow-x: auto; white-space: nowrap;
}
.formula .fl { display: block; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 11.5px; color: var(--text-faint); white-space: normal; }
.formula var { font-style: italic; }

.funnel { display: grid; gap: 6px; margin: 4px 0 14px; }
.funnel-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; font-size: 12.5px; }
.funnel-row .lbl { display: flex; justify-content: space-between; gap: 8px; color: var(--text-dim); }
.funnel-row .lbl b { color: var(--text); font-variant-numeric: tabular-nums; }
.funnel-row .bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--s-std); }
.funnel-row .bar.split { display: flex; gap: 2px; background: none; }
.funnel-row .bar.split i { display: block; height: 100%; background: var(--s-std); }
.funnel-row .bar.split i:nth-child(2) { opacity: .65; }
.funnel-row .bar.split i:nth-child(3) { opacity: .4; }
.funnel-row .bar.split i:first-child { border-radius: 0; }
.funnel-row .bar.split i:last-child { border-radius: 0 4px 4px 0; }

.team { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 10px; }
.member { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.member b { display: block; font-size: 14px; }
.member a { font-size: 12px; }
.member p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }

.code-wrap { position: relative; }
.code {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-sunk); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--text); overflow-x: auto; white-space: pre;
  tab-size: 2;
}
.copy-btn {
  position: absolute; top: 7px; right: 7px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text-dim);
  border-radius: 7px; padding: 3px 9px; font: inherit; font-size: 11.5px; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-line); }
.copy-btn.done { color: var(--ok); border-color: var(--ok); }
.code-wrap .code { padding-right: 70px; }

/* --- API sehifesi ---------------------------------------------------------- */
.endpoints { display: grid; gap: 12px; margin-bottom: 18px; }
.ep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.ep-head code { font-family: var(--mono); font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.method { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; letter-spacing: .04em; }
.method.get { background: var(--s-band); color: var(--s-std); }
.method.post { background: color-mix(in srgb, var(--s-prem) 16%, transparent); color: var(--s-prem); }
.ep p { margin: 0 0 8px; font-size: 14px; color: var(--text-dim); }
.ep ul { margin: 0 0 8px; padding-left: 1.2em; font-size: 13.5px; color: var(--text-dim); }
.ep code { font-family: var(--mono); font-size: 12.5px; }
.ep .code { margin-top: 6px; }
.console-in { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; resize: vertical; min-height: 200px; }
.console-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.console-status { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.console-status.bad { color: var(--danger); font-weight: 600; }
.console-status.good { color: var(--ok); font-weight: 600; }
.console-out { max-height: 460px; overflow: auto; }

/* --- alt ------------------------------------------------------------------- */
.site-foot { border-top: 1px solid var(--line-soft); margin-top: 48px; padding: 26px 0 40px; }
.foot-inner { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .foot-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.site-foot p { margin: 0 0 4px; font-size: 12.5px; color: var(--text-faint); line-height: 1.55; overflow-wrap: anywhere; }
.site-foot .foot-title { color: var(--text-dim); font-weight: 600; }
.site-foot code { font-family: var(--mono); font-size: 11.5px; }

/* --- ipucu (tooltip) -------------------------------------------------------- */
.tip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 260px;
  padding: 7px 10px; border-radius: 8px; background: var(--text); color: var(--bg);
  font-size: 12px; line-height: 1.45; font-variant-numeric: tabular-nums; box-shadow: var(--shadow);
}
.tip b { font-weight: 650; }

/* --- dar ekran --------------------------------------------------------------- */
/* 320px-de sinanib (bax hesabat): nav dord hucreye bolunur, forma tek
   sutuna kecir, yol addiminin sag sutunu asagi dusur. */
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 26px 0 16px; }
  .nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; height: 40px; }
  .nav a { justify-content: center; padding: 0 2px; font-size: 12.5px; white-space: normal; text-align: center; line-height: 1.15; }
  .panel { padding: 14px; }
  .fgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .sample-grid { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: 22px minmax(0, 1fr); }
  .step-side { grid-column: 2; flex-direction: row; align-items: center; gap: 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-value { font-size: 22px; }
  .brand-text small { display: none; }
}
@media (max-width: 360px) {
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .coords-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .meter-fill, .nbar > i, .funnel-row .bar { background: Highlight; }
  .sw { forced-color-adjust: none; }
}
