/* Style "Gabinet": calm, medical, white cards, blue-teal accent, green for the cheapest. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f6f9fb;
  --surface: #ffffff;
  --text: #12263a;
  --muted: #5a6b7b;
  --line: #dfe7ee;
  --accent: #0f6b8a;
  --accent-bg: #e6f0f5;
  --on-accent: #ffffff;
  --best: #0b7a55;
  --best-bg: #e3f5ec;
  --code: #7a5300;
  --code-bg: #fff4d6;
  --shadow: 0 1px 2px rgba(18, 38, 58, .06);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1820;
    --surface: #16222c;
    --text: #e4edf3;
    --muted: #93a5b4;
    --line: #26353f;
    --accent: #5bb8d6;
    --accent-bg: #173040;
    --on-accent: #0b1a22;
    --best: #5fd3a6;
    --best-bg: #143a2d;
    --code: #f3cf7a;
    --code-bg: #3a2f14;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 16px; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.logo::before {
  content: ""; width: 14px; height: 14px; background: var(--accent);
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
}
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem; }
.top nav a:hover { background: var(--accent-bg); }
.top nav a[aria-current] { color: var(--accent); background: var(--accent-bg); }

/* Text */
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.15; margin: 24px 0 8px; text-wrap: balance; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 36px 0 10px; text-wrap: balance; }
h3 { font-size: 1rem; margin: 24px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 65ch; margin-top: 0; }
.note, .crumbs { color: var(--muted); font-size: .88rem; }
.crumbs { margin-top: 20px; margin-bottom: 0; }
.crumbs a { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Buttons and chips */
.btn {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--accent); text-decoration: none; font-size: .9rem; font-weight: 500; white-space: nowrap;
}
.btn.primary, button.primary {
  font: inherit; font-weight: 700; padding: 12px 18px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); cursor: pointer; text-align: center; white-space: normal;
}
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: block; padding: 5px 12px; border-radius: 999px; background: var(--accent-bg); color: var(--accent); text-decoration: none; font-weight: 500; font-size: .92rem; }
.chips a:hover { text-decoration: underline; }
.code { font-family: var(--mono); font-size: .78rem; background: var(--code-bg); color: var(--code); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.badge { display: inline-block; background: var(--best-bg); color: var(--best); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }

/* Home hero */
.hero { display: grid; gap: 24px; padding-block: 8px 8px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
.search { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.field { display: grid; gap: 4px; }
.has-suggest { position: relative; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.suggest li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); }
.suggest[hidden] { display: none; }
.field label, .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
input[type=search], input[data-cities], input[type=text] {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; color: var(--muted); font-size: .8rem; margin: 0; }
.stats b { display: block; font-family: var(--mono); font-size: 1.25rem; color: var(--text); }
.steps { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: .92rem; }

/* Price tables: a table on wide screens, cards on phones */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--bg); }
td:not(:first-child) { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child a { font-weight: 500; text-decoration: none; }
td:first-child a:hover { text-decoration: underline; }

.price { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.price s { color: var(--muted); font-size: .8em; }
.price small, td small { display: block; color: var(--muted); font-size: .75rem; font-family: var(--sans); }
.price.best { color: var(--best); font-weight: 500; }
.price.best::after { content: "najtaniej"; display: block; width: fit-content; margin-top: 2px; background: var(--best-bg); color: var(--best); font: 700 .62rem/1.6 var(--sans); padding: 0 6px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.none { color: var(--muted); }

@media (max-width: 640px) {
  table.prices, table.prices tbody { display: block; border: 0; background: none; border-radius: 0; overflow: visible; }
  table.prices thead { display: none; }
  table.prices tr {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  }
  table.prices td { display: block; border: 0; padding: 0; white-space: normal; min-width: 0; }
  table.prices td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  table.prices td[data-lab]::before { content: attr(data-lab); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
}

/* Lab offer cards (test page, basket result) */
.offers { display: grid; gap: 10px; max-width: 640px; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.offer.win { border: 2px solid var(--best); }
.offer .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; }
.offer .lab { font-weight: 700; font-size: 1.05rem; }
.offer .big { font-family: var(--mono); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.offer.win .big { color: var(--best); }
.offer .total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.offer .was { color: var(--muted); font-size: .85rem; }
.offer .was s { font-family: var(--mono); }
.offer .meta { color: var(--muted); font-size: .85rem; min-width: 0; }
.offer.off { box-shadow: none; background: transparent; border-style: dashed; }
.offer ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }

.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: .85rem; }
.buy span { color: var(--muted); }
.buy a { padding: 3px 10px; border-radius: 999px; background: var(--accent-bg); text-decoration: none; font-weight: 500; }
.buy a:hover { text-decoration: underline; }
.offer ul .buy { margin-bottom: 6px; }
#result .offers { max-width: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* City list */
.city-list { columns: 4 170px; padding: 0; list-style: none; }
.city-list li { padding: 3px 0; break-inside: avoid; }
.city-list a { text-decoration: none; }
.city-list small { color: var(--muted); }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.points li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.points small { color: var(--muted); }

/* Basket form */
.basket { display: grid; gap: 12px; }
.basket .fields { display: grid; gap: 12px; }
@media (min-width: 760px) { .basket .fields { grid-template-columns: 1fr 2fr; } }
.basket .cats { columns: 2 340px; column-gap: 12px; }
.basket fieldset { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 6px 14px 10px; margin: 0 0 12px;
  break-inside: avoid; }
.basket legend { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; padding: 0 4px; }
.basket .test { display: inline-flex; align-items: center; gap: 8px; width: 100%; padding: 5px 0; cursor: pointer; }
.basket .test input { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.basket .test[hidden], .basket fieldset[hidden] { display: none; }
.picked:empty { display: none; }
.picked button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border: 0; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent); font: inherit; font-weight: 500; font-size: .92rem; cursor: pointer; }
.picked button span { font-size: 1.1rem; line-height: 1; }
.actions {
  position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line);
}
#result { margin-top: 16px; scroll-margin-top: 12px; }
#result h2 { margin-top: 8px; }

.foot { margin-top: 56px; padding-block: 16px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot-links a { color: var(--muted); }

/* Legal and info pages */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.15rem; margin-top: 28px; }
.prose li { margin-bottom: 4px; }
mark { background: var(--code-bg); color: var(--code); padding: 0 4px; }

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