/* Autopaměť: "moderní hospoda" - paper, ink, one copper accent. */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1f1b16;
  --muted: #6b6259;
  --rule: #e6dfd5;
  --accent: #b5652b;
  --accent-soft: #f3e3d5;
  --good: #3f7a4a;
  --warn: #a3432b;
  --point: #8a8178;
  --radius: 10px;
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --slab: "Zilla Slab", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f;
    --surface: #211d17;
    --ink: #f1ebe2;
    --muted: #a99f93;
    --rule: #3a332a;
    --accent: #d9894f;
    --accent-soft: #3b2a1d;
    --good: #7fb98a;
    --warn: #e08a70;
    --point: #9c9287;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17140f; --surface: #211d17; --ink: #f1ebe2; --muted: #a99f93; --rule: #3a332a;
  --accent: #d9894f; --accent-soft: #3b2a1d; --good: #7fb98a; --warn: #e08a70; --point: #9c9287;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.5 var(--font); font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
h1, h2 { font-family: var(--slab); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: 1.25rem; margin-top: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { font-size: .9rem; color: var(--muted); }

.top, main, .foot { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; justify-content: space-between; align-items: baseline; padding-top: 18px; padding-bottom: 18px; }
.brand { font-family: var(--slab); font-weight: 700; font-size: 1.4rem; color: var(--ink); text-decoration: none; }
.top nav a { color: var(--muted); text-decoration: none; }
.foot { color: var(--muted); font-size: .85rem; padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--rule); margin-top: 48px; }

.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 10px 14px; }
.error { color: var(--warn); font-weight: 600; }

/* Home */
.hero { padding: 24px 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.paste { display: flex; gap: 8px; margin: 20px 0 8px; }
.paste input {
  flex: 1; min-width: 0; font: inherit; padding: 14px 16px; border-radius: var(--radius);
  border: 2px solid var(--rule); background: var(--surface); color: var(--ink);
}
.paste input:focus { outline: none; border-color: var(--accent); }
button, .button {
  font: 600 1rem var(--font); padding: 14px 22px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-block;
  min-height: 44px;
}
.counters { display: flex; gap: 32px; margin: 24px 0; flex-wrap: wrap; }
.counters strong { display: block; font-family: var(--slab); font-size: 2rem; }
.counters span { color: var(--muted); }
.scope, .example { color: var(--muted); }

/* Report */
.car { padding-top: 8px; }
.car .year { color: var(--muted); font-weight: 600; }
.specs { color: var(--muted); margin: 0 0 6px; }
.adlink { margin: 0 0 12px; }

.position {
  background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--accent);
  border-radius: var(--radius); padding: 18px 20px; margin: 16px 0;
}
.position .asking { margin: 0; color: var(--muted); }
.position .asking strong { color: var(--ink); font-size: 1.15rem; }
.position .headline { font-variant-numeric: lining-nums tabular-nums; font-family: var(--slab); font-weight: 700; font-size: clamp(1.5rem, 5.5vw, 2rem); line-height: 1.2; margin: 6px 0; }
.position .verdict { margin: 0 0 12px; }
.bucket-pod { border-left-color: var(--good); }
.bucket-nad { border-left-color: var(--warn); }
.nodata { border-left-color: var(--rule); }
.bandnums { margin: 8px 0 0; }

.bandbar { position: relative; height: 14px; background: var(--rule); border-radius: 7px; margin: 14px 0 6px; }
.bandbar .range { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); border: 1px dotted var(--accent); border-radius: 7px; }
.bandbar .med { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); }
.bandbar .you { position: absolute; top: -5px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 24px; }
.facts div { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; }
.facts span { display: block; color: var(--muted); font-size: .85rem; }
.facts strong { font-size: 1.15rem; }

.chartbox, .pulse, .comps { margin: 28px 0; }
.chart { width: 100%; height: 340px; }
.chart-short { height: 220px; }
.history-text { display: none; }
.no-js .history-text { display: block; }

.comps table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.comps th, .comps td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); }
.comps th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.comps tr.gone td { color: var(--muted); }
.comps td:last-child { text-align: right; }
.comps td a { display: inline-block; min-width: 32px; min-height: 32px; text-align: center; text-decoration: none; }

.prose { max-width: 38em; }
.prose h2 { margin-top: 1.2em; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .paste { flex-direction: column; }
  .comps th:nth-child(4), .comps td:nth-child(4) { display: none; }
}

/* --- M1-M4 additions --- */
.top nav { display: flex; gap: 16px; }
.top nav a[aria-current] { color: var(--ink); font-weight: 600; }
.footlinks a { color: var(--muted); }
.hero.narrow { max-width: 30em; }

.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 24px; }
.door { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; }
.door .paste { margin: 12px 0 6px; }

.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 12px 14px; color: var(--ink); text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile b { display: block; }
.tile span { color: var(--muted); font-size: .9rem; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 6px 0 12px; }
.actions form { margin: 0; }
button.ghost, .button.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); padding: 9px 16px; min-height: 40px; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--muted); text-decoration: underline; font-weight: 400; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 12px 6px 0; }
form.inline input { font: inherit; padding: 8px 10px; border-radius: var(--radius); border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); min-width: 0; }

.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 7px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.tag.warn { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; margin: 10px 0; }
.card p { margin: 4px 0; }
pre.mail { white-space: pre-wrap; font: .9rem/1.45 var(--font); }
.comps tr.featured td { background: var(--accent-soft); }

.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 8px; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: var(--bg); color: var(--ink); border: 1.5px solid var(--rule); padding: 10px 12px; }
.opt span { font-weight: 400; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.track { margin: 12px 0 8px; }
.track form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

.sellform { display: grid; gap: 12px; max-width: 34em; margin: 12px 0 20px; }
.sellform label { display: grid; gap: 4px; font-weight: 600; }
.sellform input, .sellform select { font: inherit; font-weight: 400; padding: 11px 12px; border-radius: var(--radius);
  border: 2px solid var(--rule); background: var(--surface); color: var(--ink); min-width: 0; }
.sellform input:focus, .sellform select:focus { outline: none; border-color: var(--accent); }
.sellform .row { display: flex; gap: 8px; }
.sellform .row input { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 8px; }
legend { font-weight: 600; padding: 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: 20px; height: 20px; }

.partners ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.partners li { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 2px; }
.partners li .tag { justify-self: start; }
.pager { display: flex; gap: 16px; }

@media (max-width: 640px) {
  .doors { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; }
  .top nav { gap: 12px; font-size: .95rem; }
}
td.good { color: var(--good); font-weight: 600; }
.hero.compact { padding: 8px 0 4px; }
.hero.compact .lead { margin: 0 0 8px; }

/* Home doors: two symmetric tiles, action rows aligned at the same height. */
.door { display: flex; flex-direction: column; }
.door > p:first-of-type { flex: 1; }
.door-action { height: 52px; margin: 12px 0 6px; display: flex; gap: 8px; align-items: stretch; }
.door-action input { padding-top: 0; padding-bottom: 0; }
.door-action button { padding-top: 0; padding-bottom: 0; }
.door-action-center { justify-content: center; }
.door-action-center .button { display: flex; align-items: center; justify-content: center; width: 70%; min-width: 220px; padding: 0 22px; }
.door-note { min-height: 1.5em; margin: 0; text-align: left; }
.door:last-child .door-note { text-align: center; }
/* Counters centred on the page, each centred in itself. */
.counters { justify-content: center; text-align: center; gap: 48px; }
.counters > div { min-width: 200px; }
@media (max-width: 640px) { .door-action { height: auto; } .door-action input, .door-action button { min-height: 48px; } }

/* Model tiles with photos */
.tilegrid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.tile img, .tile .nophoto { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--rule); }
.tiletext { display: grid; gap: 1px; padding: 10px 12px 12px; }
.tiletext b { font-size: 1.02rem; }
.tiletext .gen { color: var(--ink); font-size: .9rem; }
.tile:hover img { filter: saturate(1.1); }
.tiles .more { text-align: center; }
@media (max-width: 480px) { .tilegrid { grid-template-columns: 1fr 1fr; gap: 10px; } .tiletext { padding: 8px 10px 10px; } }
.tile .tiletext { color: var(--ink); font-size: 1rem; }
.tile .tiletext .gen { color: var(--ink); font-size: .9rem; }
.tile .tiletext > span:last-child { color: var(--muted); font-size: .85rem; }
.counters { gap: 8px 48px; }
.counters strong { font-variant-numeric: lining-nums tabular-nums; }

/* Responsive width (2026-09-25): fluid up to 1200 px, readable text measure. */
:root { --page-max: 1200px; --gutter: clamp(16px, 4vw, 48px); }
.top, main, .foot { max-width: var(--page-max); padding-left: var(--gutter); padding-right: var(--gutter); }
.lead, .prose, .hero.narrow, .sellform, .small, .specs { max-width: 46em; }
.chartbox .small { max-width: 60em; }
.chart { height: clamp(300px, 34vw, 440px); }
.chart-short { height: clamp(220px, 22vw, 300px); }
/* Home: model tiles one row of six on wide screens, three on tablets, two on phones. */
.tiles .tilegrid { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1100px) { .tiles .tilegrid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 640px) { .tiles .tilegrid { grid-template-columns: 1fr 1fr; } }
/* Model list: as many 220 px+ columns as fit. */
.hero + .tilegrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Car report and quote on wide screens: price box and facts side by side. */
@media (min-width: 1000px) {
  .report { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .report > * { grid-column: 1 / -1; }
  .report > .position { grid-column: 1; margin-bottom: 0; }
  .report > .facts { grid-column: 2; grid-template-columns: 1fr; margin: 16px 0 0; }
  .report > .track { grid-column: 2; margin-top: 16px; }
  .report > .track form { flex-direction: column; align-items: stretch; }
}
.position .headline, .counters strong, h1, h2 { font-variant-numeric: lining-nums proportional-nums; }
.card-actions { margin: 8px 0 0; }
.mycars h1 { margin-top: 8px; }

/* Data-error report form */
.hp { position: absolute; left: -9999px; }
.fixform { width: 100%; border-collapse: collapse; }
.fixform td, .fixform th { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--rule); font-weight: 400; }
.fixform th { color: var(--muted); font-size: .85rem; }
.fixform input { width: 100%; font: inherit; padding: 8px 10px; border-radius: var(--radius); border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); }
.sellform textarea { font: inherit; font-weight: 400; padding: 11px 12px; border-radius: var(--radius); border: 2px solid var(--rule); background: var(--surface); color: var(--ink); }
.flag { text-decoration: none; opacity: .55; }
.flag:hover { opacity: 1; }
