:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #ccfbf1;
  --price: #0f172a;
  --good: #15803d;
  --good-soft: #dcfce7;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .06), 0 12px 28px rgba(15, 23, 42, .12);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #131c2e;
    --surface-2: #1c2740;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #23314d;
    --accent: #2dd4bf;
    --accent-2: #5eead4;
    --accent-soft: #123a3a;
    --price: #f8fafc;
    --good: #4ade80;
    --good-soft: #14321f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-weight: 400; }
.narrow { max-width: 760px; }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; white-space: nowrap; letter-spacing: -.02em; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); font-size: 16px; }
.cat-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a { padding: 7px 12px; border-radius: 999px; white-space: nowrap; font-weight: 500; font-size: 14px; color: var(--muted); }
.cat-nav a:hover { background: var(--surface-2); color: var(--text); }
.cat-nav a.on { background: var(--accent-soft); color: var(--accent); }
.top-tools { display: flex; align-items: center; gap: 8px; }
.cmp-link { position: relative; font-size: 20px; padding: 4px 6px; }
.cmp-count { position: absolute; top: -4px; right: -6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.cmp-count[hidden] { display: none; }
select, input[type=search] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; min-height: 40px;
}
select:focus, input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.lang-select { min-height: 36px; padding: 6px 8px; font-size: 14px; }

/* hero */
.hero { padding: 36px 0 28px; background: linear-gradient(180deg, var(--accent-soft), transparent 85%); }
.hero h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; }
.hero-sub { color: var(--muted); margin: 8px 0 20px; font-size: 17px; }
.city-pick { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 4px 4px 12px; box-shadow: var(--shadow); margin-bottom: 20px; }
.city-pick select { border: 0; min-width: 200px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--accent-2); }
.tile-icon { font-size: 30px; }
.tile-name { font-weight: 700; font-size: 16px; }
.tile-desc { color: var(--muted); font-size: 13px; flex: 1; }
.tile-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.tile-meta b { color: var(--accent); font-size: 14px; }
.tile-meta small { font-weight: 500; }

/* strips on home */
.strip { margin-top: 28px; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.strip-head h2 { font-size: 19px; font-weight: 700; }
.more { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* category page */
.page-head { padding: 24px 16px 8px; }
.page-head h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; }
.filters-wrap { position: sticky; top: 60px; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.filters input[type=search] { flex: 1 1 200px; min-width: 160px; }
.chip-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip input { position: absolute; opacity: 0; pointer-events: none; }
.fchip span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; }
.fchip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.fchip input:focus-visible + span { outline: 2px solid var(--accent-2); }
.result-count { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.btn-ghost { font: inherit; font-size: 14px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 8px; font-weight: 600; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; font-weight: 700;
  padding: 10px 18px; border-radius: 10px; border: 0; cursor: pointer; font: inherit; font-weight: 700; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.cmp-go { gap: 0; }

.with-side { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 16px; }
.side { display: none; }
@media (min-width: 1240px) {
  .with-side { grid-template-columns: 1fr 300px; }
  .side { display: block; }
  .ad-side { position: sticky; top: 140px; }
}

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid-strip { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card[hidden] { display: none; }
.card-link { display: flex; flex-direction: column; height: 100%; }
.card-img { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img img.ph { object-fit: contain; padding: 18% 22%; opacity: .45; }
.card-body { padding: 12px 14px 44px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-compact .card-body { padding-bottom: 42px; }
.card-company { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.price { margin-top: 4px; color: var(--price); }
.price b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.price small { color: var(--muted); font-size: 13px; }
.price-na { font-size: 13px; color: var(--muted); font-weight: 500; }
.chips { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.chips li { font-size: 12px; background: var(--surface-2); color: var(--muted); padding: 3px 8px; border-radius: 6px; }
.chips .chip-app { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chips .chip-good { background: var(--good-soft); color: var(--good); font-weight: 600; }
.cmp-toggle { position: absolute; left: 14px; bottom: 10px; display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.cmp-toggle input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.cmp-toggle:has(input:checked) { color: var(--accent); font-weight: 600; }

.empty { text-align: center; padding: 40px 0; color: var(--muted); }
.city-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.city-links a { font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

/* compare bar */
.cmp-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(15, 23, 42, .12); }
.cmp-bar[hidden] { display: none; }
.cmp-bar-row { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.cmp-thumbs { display: flex; gap: 6px; flex: 1; overflow: hidden; }
.cmp-thumbs img { width: 56px; height: 38px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
body:has(.cmp-bar:not([hidden])) { padding-bottom: 64px; }

/* compare table */
.compare { margin-top: 12px; overflow-x: auto; }
.cmp-table { border-collapse: separate; border-spacing: 0; min-width: 100%; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.cmp-table th, .cmp-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
.cmp-table tr:last-child td, .cmp-table tr:last-child th { border-bottom: 0; }
.cmp-table th { color: var(--muted); font-weight: 500; white-space: nowrap; width: 140px; position: sticky; left: 0; background: var(--surface); }
.cmp-table td { min-width: 200px; max-width: 280px; }
.cmp-table img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.cmp-table img.ph { object-fit: contain; padding: 14% 20%; opacity: .45; }
.cmp-table .best { color: var(--good); font-weight: 800; }
.cmp-table .big { font-size: 20px; font-weight: 800; }
.cmp-table ul { margin: 0; padding-left: 16px; }
.cmp-remove { font-size: 13px; }

/* ads */
.ad { margin: 20px auto; min-height: 90px; text-align: center; }
.ad-preview { display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted);
  font-size: 13px; background: var(--surface-2); }
.ad-side.ad-preview { min-height: 600px; margin-top: 0; }

/* misc */
.prose { font-size: 16px; line-height: 1.7; white-space: pre-line; }
.foot { margin-top: 48px; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot a { text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; font-size: 14px; }
.foot-links a { text-decoration: none; color: var(--text); font-weight: 500; }
.foot-links a:hover { color: var(--accent); }
.legal h2 { font-size: 18px; margin: 26px 0 8px; }
.legal p { margin: 0 0 8px; line-height: 1.65; }
.imprint { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
.imprint dt { color: var(--muted); }
.imprint dd { margin: 0; }
.imprint a, .legal a { color: var(--accent); }
.partner-tag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: 6px; background: rgba(15, 23, 42, .7); color: #fff; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; z-index: 50; font-size: 14px; }
.toast[hidden] { display: none; }

@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .grid-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .top-row { flex-wrap: wrap; height: auto; padding-top: 8px; gap: 6px 10px; }
  .cat-nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .top-tools { margin-left: auto; }
  .filters-wrap { position: static; }
  .filters { gap: 6px; }
  .filters input[type=search] { flex-basis: 100%; }
  .filters select { flex: 1 1 0; min-width: 0; font-size: 13px; padding: 6px; }
  .chip-filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .chip-filters::-webkit-scrollbar { display: none; }
  .fchip span { white-space: nowrap; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile:last-child { grid-column: span 2; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .card-body { padding: 10px 10px 40px; }
  .price b { font-size: 18px; }
  .cmp-toggle { left: 10px; }
  .city-pick, .city-pick select { width: 100%; }
  .result-count { margin-left: 0; }
}
