/* Paleta i typografia przeniesione 1:1 z mockupu Claude Design. */
:root {
  --accent: #17509b;
  --accent-dark: #123f7c;
  --ink: #14171c;
  --ink-2: #4b5461;
  --ink-3: #55606f;
  --dim: #6a7180;
  --dim-2: #7d8694;
  --line: #d5dae2;
  --line-2: #e6e9ee;
  --field: #c9d0da;
  --bg: #e3e6eb;
  --panel: #f8f9fb;
  --tint: #e8eff8;
  --tint-line: #bdd1e9;
  --err: #b4372a;
  --err-ink: #96301f;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font-family: "Libre Franklin", system-ui, sans-serif; }
.n { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.k { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); }
.mb10 { margin-bottom: 10px; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { display: flex; align-items: center; padding: 15px 32px;
          background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto;
         font-weight: 600; letter-spacing: -.01em; }
.mark { width: 20px; height: 20px; background: var(--accent); }
.topbar nav { display: flex; gap: 26px; }
.topbar a { font-size: 14px; text-decoration: none; color: var(--ink-2); }
.topbar a.active { color: var(--accent); font-weight: 500; }

.shell { max-width: 1280px; margin: 0 auto; padding: 28px 20px 80px; }
.panel { background: var(--panel); border: 1px solid var(--line); margin-bottom: 28px; }
.cols { display: grid; grid-template-columns: 1fr 392px; gap: 40px; padding: 30px 32px 38px; }
.cols.result { grid-template-columns: 1fr 384px; gap: 44px; padding: 32px; }
.form { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

h1 { font-size: 25px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.015em; }
.lead { margin: 0; font-size: 14px; color: var(--ink-3); }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.grid3[hidden], .grid2[hidden] { display: none; }
.addr-wrap { max-width: 560px; }

.fld { font-size: 12px; color: var(--ink-3); display: block; margin-bottom: 5px; }
.inp { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; color: var(--ink);
       background: #fff; border: 1px solid var(--field); border-radius: 3px; }
.inp:hover { border-color: #97a2b3; }
.inp:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.inp.invalid { border-color: var(--err); box-shadow: 0 0 0 3px rgba(180,55,42,.14); }
.hint { font-size: 11px; margin-top: 4px; color: var(--dim-2); }
.field-error { display: flex; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--err-ink); }

.sg { display: inline-flex; border: 1px solid var(--field); border-radius: 3px;
      overflow: hidden; background: #fff; }
.sg label { padding: 8px 13px; font-size: 13px; cursor: pointer; }
.sg label + label { border-left: 1px solid var(--field); }
.sg input { position: absolute; opacity: 0; width: 0; height: 0; }
.sg label:has(input:checked) { background: var(--accent); color: #fff; }
.sg label:not(:has(input:checked)):hover { background: #eef1f6; }

.bs { font: inherit; font-size: 14px; font-weight: 500; padding: 10px 20px; border: 0;
      border-radius: 3px; background: var(--accent); color: #fff; cursor: pointer; }
.bs:hover { background: var(--accent-dark); }
.bs:disabled { background: #97a2b3; cursor: progress; }
.bl { font: inherit; font-size: 15px; padding: 4px 0; border: 0; background: transparent;
      color: var(--accent); cursor: pointer; }
.bl:hover { text-decoration: underline; }
.bl.small { font-size: 12px; }
.meta { font-size: 12px; margin-left: 8px; color: var(--dim-2); }
.section { padding-top: 20px; border-top: 1px solid var(--line); }
.actions { display: flex; align-items: center; gap: 16px; padding-top: 6px; }

.side { align-self: start; position: sticky; top: 20px; display: flex; flex-direction: column;
        gap: 18px; padding: 22px; background: #fff; border: 1px solid var(--line); }
.side-lead { margin: 6px 0 12px; font-size: 12px; line-height: 1.5; color: var(--dim); }
.accuracy { display: flex; align-items: flex-end; gap: 14px; }
.big { font-size: 50px; line-height: .9; font-weight: 500; color: var(--accent); }
.money { font-size: 14px; padding-bottom: 6px; color: var(--dim); }

.bar { position: relative; height: 10px; background: #eaeef3;
       border: 1px solid var(--line); overflow: hidden; }
.bar-dead { position: absolute; left: 93.75%; right: 0; top: 0; bottom: 0;
            background: repeating-linear-gradient(115deg, var(--field) 0 2px, transparent 2px 6px); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0;
            background: linear-gradient(to right, #2f6cbe, var(--accent)); transition: width 260ms ease; }
.bar-legend { position: relative; height: 34px; margin-top: 3px; font-size: 11px; color: var(--dim-2); }
.bar-legend .tick { position: absolute; left: 93.75%; top: 0; bottom: 0; width: 1px; background: #b6bfcc; }
.bar-legend .left { position: absolute; left: 0; top: 3px; }
.bar-legend .right { position: absolute; right: 0; top: 3px; text-align: right; max-width: 96px; }
.bar-legend .sat { position: absolute; left: 93.75%; top: 18px; transform: translateX(-100%);
                   padding-right: 6px; color: var(--ink-3); }

.ms { display: grid; grid-template-columns: 62px 1fr auto; align-items: baseline; gap: 10px;
      padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line-2); color: #8b93a0; }
.ms.on { color: var(--ink); }
.ms .note { font-size: 12px; }
.ms .val { font-weight: 500; }
.hintbox { padding: 12px 14px; font-size: 13px; line-height: 1.45;
           background: #f2f4f8; border: 1px solid #e0e5ec; color: var(--ink-3); }
.hintbox.sat { background: var(--tint); border-color: var(--tint-line); color: var(--accent-dark); }

.resume { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
/* clamp zamiast stalego 68px: przy dwoch szescioznakowych kwotach plus "zl"
   napis nie miesci sie w kolumnie i jednostka laduje w nowej linii. */
.range { font-size: clamp(30px, 4.4vw, 60px); line-height: 1; font-weight: 500;
         color: var(--accent); white-space: nowrap; letter-spacing: -.02em; }
.range small { font-size: .55em; color: #4a7ec0; }
.scale { position: relative; height: 46px; margin-top: 18px;
         border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.scale-band { position: absolute; top: 14px; height: 10px; background: var(--accent); opacity: .18; }
.scale-mid { position: absolute; top: 6px; bottom: 6px; width: 2px; background: var(--accent); }
.scale-lo { position: absolute; left: 0; bottom: 4px; font-size: 11px; color: var(--dim-2); }
.scale-hi { position: absolute; right: 0; bottom: 4px; font-size: 11px; color: var(--dim-2); }
.stats { display: flex; flex-wrap: wrap; gap: 22px 44px; margin: 22px 0 26px; }
.stat { font-size: 26px; }
.conf { display: flex; align-items: center; gap: 8px; padding-top: 3px; }
.badge { font-size: 13px; padding: 4px 11px; background: var(--accent); color: #fff; }
.dim { font-size: 13px; color: var(--dim); }
.accent { margin-top: 6px; color: var(--accent); }

.notice { display: flex; gap: 14px; padding: 16px 18px; margin-bottom: 26px;
          background: var(--tint); border: 1px solid var(--tint-line); font-size: 14px; line-height: 1.5; }
.notice svg { flex: none; margin-top: 2px; }
.footnote { padding-top: 14px; border-top: 1px solid var(--line);
            font-size: 12px; line-height: 1.6; color: var(--dim-2); }

.row { display: flex; align-items: center; gap: 12px; padding: 11px 0;
       border-bottom: 1px solid var(--line-2); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row .label { flex: 1; }

.prose { padding: 28px 32px; font-size: 14px; line-height: 1.65; color: var(--ink-3); }
.prose h2 { margin: 0 0 10px; font-size: 19px; color: var(--ink); }

@media (max-width: 900px) {
  .shell { padding: 18px 12px 60px; }
  .cols, .cols.result { grid-template-columns: 1fr; gap: 24px; padding: 22px 16px 28px; }
  .side { position: static; }
  .grid3, .grid2 { grid-template-columns: 1fr 1fr; }
  /* Kwota lamie sie po myslniku zamiast wychodzic poza ekran — przy 375 px
     dwie szesciocyfrowe liczby w jednej linii nie zmieszcza sie nigdy. */
  .range { font-size: clamp(24px, 7.4vw, 34px); line-height: 1.12; white-space: normal; }
  .range small { font-size: .6em; }
  /* Trzy pozycje obok siebie nie mieszcza sie; dwie kolumny i tak czytaja sie
     lepiej niz zawijane wartosci. */
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
  .stat { font-size: 19px; white-space: nowrap; }
  .scale-lo, .scale-hi { font-size: 10px; }
  .bs, .bl { min-height: 44px; }
  .row { min-height: 44px; }
  .topbar { padding: 12px 16px; gap: 14px; }
  .topbar nav { gap: 16px; }
  .brand { font-size: 15px; }
}

/* --- autouzupełnianie adresu --- */
.addr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 16px; max-width: 560px; }
.addr-wrap { position: relative; }
.ac { position: absolute; left: 0; right: 0; top: calc(100% - 18px); z-index: 5; margin: 0;
      padding: 0; list-style: none; max-height: 268px; overflow-y: auto;
      background: #fff; border: 1px solid var(--field);
      box-shadow: 0 8px 20px rgba(20,23,28,.10); }
.ac[hidden] { display: none; }
.ac li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
         padding: 9px 12px; font-size: 14px; cursor: pointer; }
.ac li[aria-selected="true"], .ac li:hover { background: var(--tint); }
.ac .district { font-size: 12px; color: var(--dim); white-space: nowrap; }
.ac .empty { color: var(--dim-2); cursor: default; }
.ac .empty:hover { background: transparent; }
.geo-note { margin-top: 6px; font-size: 12px; color: var(--dim-2); }

@media (max-width: 900px) {
  .addr-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* --- strona metodologii --- */
.doc { padding: 36px 44px 44px; max-width: 780px; margin: 0 auto; }
.doc h1 { font-size: 27px; font-weight: 600; margin: 0 0 8px; letter-spacing: -.015em; }
.doc h2 { font-size: 17px; font-weight: 600; margin: 34px 0 10px; letter-spacing: -.01em; }
.doc p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; color: var(--ink-3); }
.doc-lead { font-size: 16px !important; color: var(--ink-2) !important; }
.doc-list { margin: 0 0 12px; padding-left: 20px; font-size: 15px; line-height: 1.7; color: var(--ink-3); }
.doc-list li { margin-bottom: 6px; }
.doc strong { color: var(--ink); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 18px; }
.metric { padding: 16px 18px; background: #fff; border: 1px solid var(--line); }
.metric-val { font-size: 24px; margin: 6px 0 4px; color: var(--accent); }
.metric-note { font-size: 12px; line-height: 1.4; color: var(--dim-2); }
@media (max-width: 900px) {
  .doc { padding: 24px 18px 32px; }
  .metrics { grid-template-columns: 1fr; }
}

/* --- mapa okolicy --- */
.map { height: 240px; border: 1px solid var(--line); background: #eef1f6; }
.map .leaflet-container { font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: -6px;
          font-size: 10.5px; color: var(--dim-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend svg { flex: none; }

/* Etykiety POI na mapie: lekkie, bez ramki i strzałki Leafletu. */
.leaflet-tooltip.poi-label { padding: 1px 5px; font-size: 10px; font-weight: 500;
  color: var(--ink-3); background: rgba(255,255,255,.9); border: 0; border-radius: 2px;
  box-shadow: none; white-space: nowrap; }
.leaflet-tooltip.poi-label::before { display: none; }

/* --- marka --- */
.brand { display: flex; align-items: baseline; gap: 9px; margin-right: auto;
         text-decoration: none; color: inherit; }
.brand .mark { align-self: center; display: block; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: var(--accent); }
.brand-sub { font-size: 12px; color: var(--dim); }
@media (max-width: 640px) { .brand-sub { display: none; } }

/* Marker: the same icon as the row below the map, on a white disc so it reads
   against any tile colour. */
.poi-pin span { display: grid; place-items: center; width: 24px; height: 24px;
                border-radius: 50%; background: #fff;
                border: 1.5px solid var(--pin); box-shadow: 0 1px 3px rgba(20,23,28,.28); }
.leaflet-marker-icon.poi-pin { background: none; border: 0; }
