/* Kohalugu: a light Nordic look. One self-hosted sans family (the CSP allows no outside fonts),
   off-white paper, a spruce-green accent and the map's red ring as the only warm note. */

@font-face {
  font-family: "Albert Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/albert-sans-latin-wght-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: "Albert Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/albert-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                 U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Albert Sans"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/albert-sans-latin-wght-italic.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: "Albert Sans"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/albert-sans-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                 U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fafaf7;           /* the page: snow-white linen */
  --surface: #fff;         /* paper laid on it: panels, fields, the report */
  --band: #f1f0eb;         /* sunken strips: footer, code, quiet notes */
  --ink: #1a2420;
  --ink-2: #36413c;
  --muted: #5b6661;
  --line: #e3e1da;
  --line-2: #cbc8bf;
  --field: #868e89;        /* form field borders: 3:1 against white */
  --accent: #2b5a4b;       /* spruce */
  --accent-2: #1f4639;
  --accent-soft: #e6efea;
  --accent-ink: #fff;
  --signal: #c4462f;       /* the red ring that marks the place on every map */
  --error: #a8372a;
  --error-soft: #fbeae6;
  --ok: #2c6a4a;
  --ok-soft: #e5f1e9;
  --warn-bg: #fbf1dc;
  --warn-ink: #6e4a0e;
  --font: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 8px;
  --radius-lg: 14px;
  --wrap: 1140px;          /* header, footer, wide pages */
  --text: 760px;           /* reading pages */
  --gutter: 24px;
  color-scheme: light;
}

/* --- base ---------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--text) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 48px var(--gutter) 80px;
}
main.wide { max-width: calc(var(--wrap) + 2 * var(--gutter)); }
main:has(.report-page), main:has(.tiles) { max-width: calc(var(--wrap) + 2 * var(--gutter)); }

h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.1; letter-spacing: -.028em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.35rem, 1.2rem + .5vw, 1.55rem); margin: 1.6em 0 .6em; }
h3 { font-size: 1.12rem; letter-spacing: -.008em; margin: 1.5em 0 .4em; }
p { margin: 0 0 1em; text-wrap: pretty; }
strong, b { font-weight: 650; }
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
a:hover { color: var(--accent-2); text-decoration-color: currentColor; }
code { font: .86em/1.4 var(--mono); background: var(--band); padding: .12em .4em; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.eyebrow {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hint, .muted { color: var(--muted); font-size: .92rem; }
p.hint, p.muted { margin: 12px 0 0; }
.error { color: var(--error); font-weight: 600; }
.ok { color: var(--ok); }
.lead { font-size: clamp(1.08rem, 1rem + .3vw, 1.2rem); line-height: 1.55; color: var(--ink-2); }

/* --- header and footer ------------------------------------------------------------------- */

.site-inner { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
header.site { border-bottom: 1px solid var(--line); }
header.site .site-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; min-height: 76px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; width: 26px; height: 26px; }
.brand-mark .contour { fill: none; stroke: var(--accent); stroke-width: 4; }
.brand-mark .dot { fill: var(--signal); }
.tagline { color: var(--muted); font-size: .9rem; padding-left: 20px; border-left: 1px solid var(--line); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: var(--radius); color: var(--ink); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--band); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--band); }
.nav a.nav-login { border: 1px solid var(--line-2); }
.nav-short { display: none; }
.badge {
  display: inline-block;
  min-width: 1.6em;
  margin-left: 4px;
  padding: 0 .5em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); font-size: .5em; letter-spacing: .08em; vertical-align: middle; }
.sandbox-badge {
  margin: 0;
  padding: 8px var(--gutter);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: .88rem;
  text-align: center;
}

footer.site { background: var(--band); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer.site .site-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 48px; padding-top: 44px; padding-bottom: 44px; }
footer.site .brand { font-size: 1.1rem; }
footer.site .brand-mark { width: 22px; height: 22px; }
.footer-about p { margin: 10px 0 0; max-width: 34em; }
.footer-links { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px 24px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-links button.link { color: var(--ink-2); font-size: inherit; text-decoration: none; }
.footer-links button.link:hover { color: var(--accent); text-decoration: underline; }
.footer-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px;
               padding-top: 20px; border-top: 1px solid var(--line); }
.footer-meta p { margin: 0; }

@media (max-width: 760px) {
  .tagline { display: none; }
  footer.site .site-inner { grid-template-columns: 1fr; }
}

/* --- panels, forms, buttons ------------------------------------------------------------- */

.card {
  margin: 0 0 24px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 540px; margin-inline: auto; }
.card > p.muted:first-child { margin-bottom: 8px; }
p.card { padding: 14px 18px; border-radius: var(--radius); border-color: transparent; font-weight: 500; }
p.card.ok { background: var(--ok-soft); color: var(--ok); }
p.card.error { background: var(--error-soft); color: var(--error); }
p.card.muted { background: var(--band); color: var(--ink-2); font-size: 1rem; }
.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); }
p.card.notice { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); color: var(--ink); font-weight: 400; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
label { font-weight: 600; font-size: .95rem; margin-top: 10px; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 1rem; }
label.check input { flex: none; margin: 3px 0 0; }

input:not([type]), input[type="text"], input[type="email"], input[type="search"], textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 0; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:not([type]):focus, input[type="text"]:focus, input[type="email"]:focus, input[type="search"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
input[readonly] { background: var(--bg); color: var(--ink-2); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.row input { flex: 1 1 240px; width: auto; }

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  font: 600 1rem/1.2 var(--font);
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover, .button-link:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover { background: var(--accent); border-color: var(--accent); }
button.secondary, .button-link.secondary { color: var(--ink); background: var(--surface); border-color: var(--line-2); }
button.secondary:hover, .button-link.secondary:hover { color: var(--ink); background: var(--surface); border-color: var(--ink); }
button.link {
  min-height: 0;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  font-weight: 400;
  font-size: .95rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}
button.link:hover { color: var(--ink); background: none; }

.spinner {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  vertical-align: -2px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* --- lists and tables --------------------------------------------------------------------- */

.reports { list-style: none; padding: 0; margin: 0; }
.reports li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.reports li:last-child { border-bottom: 0; }
.reports li a { flex: 1 1 260px; font-weight: 500; }
span.status {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--band);
  color: var(--ink-2);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
span.status-done { background: var(--ok-soft); color: var(--ok); }
span.status-failed { background: var(--error-soft); color: var(--error); }
span.status-queued, span.status-running { background: var(--accent-soft); color: var(--accent); }
td.status-done { color: var(--ok); }
td.status-failed { color: var(--error); }
td.actions { white-space: nowrap; }
td.actions form { display: inline; }
td.actions form + form { margin-left: 12px; }
button.link.danger { color: var(--error); }

.events { list-style: none; margin: 20px 0 0 4px; padding: 0 0 0 20px; border-left: 2px solid var(--line); color: var(--muted); font-size: .92rem; }
.events li { position: relative; padding: 3px 0; }
.events li::before { content: ""; position: absolute; left: -26px; top: .8em; width: 10px; height: 10px; border-radius: 50%;
                     background: var(--line-2); border: 2px solid var(--surface); }
.events li:last-child { color: var(--ink); }
.events li:last-child::before { background: var(--accent); }

.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
                border-bottom-color: var(--line-2); }
table.data td.num, table.data th.num { text-align: right; }
table.data td:nth-child(2) { white-space: normal; min-width: 180px; }
table.data tr.current td { font-weight: 650; }
table.data tbody tr:hover { background: var(--bg); }
/* the order summary is a two-column receipt, not a data grid: its cells wrap */
table.data.summary { margin: 16px 0 20px; font-size: 1rem; }
table.data.summary td { min-width: 0; padding: 10px 0; white-space: normal; }
table.data.summary td.num { padding-left: 16px; font-size: 1.05rem; font-weight: 600; white-space: nowrap; }
table.data.summary tr.muted td { color: var(--muted); font-size: .9rem; font-weight: 400; }
table.data.summary tr:last-child td { border-bottom: 0; }
table.data.summary tbody tr:hover { background: none; }
a.current { color: var(--ink); font-weight: 650; text-decoration: none; }

details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
pre.form { white-space: pre-wrap; background: var(--band); border-radius: var(--radius); padding: 16px; font: .88rem/1.55 var(--mono); }

/* --- landing ----------------------------------------------------------------------------- */

.intro { display: grid; gap: 48px 64px; align-items: start; padding: 24px 0 72px; }
.intro-copy { padding-top: 28px; }
.intro h1 { font-size: clamp(2.7rem, 1.5rem + 4.6vw, 4.9rem); font-weight: 650; line-height: 1; letter-spacing: -.045em; margin: 0 0 24px; }
.intro .lead { max-width: 34em; margin: 0; }
.intro .hint { max-width: 40em; }
@media (min-width: 980px) { .intro.has-samples { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); } }

.search {
  display: flex;
  gap: 6px;
  max-width: 660px;
  margin: 32px 0 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--field);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search input:not([type]) { flex: 1 1 auto; min-width: 0; min-height: 50px; padding: 0 12px; border: 0; background: none; }
.search input:not([type]):focus { box-shadow: none; }
.search button { flex: none; min-height: 50px; }
.search.compact { max-width: none; margin: 0; }
.search.compact input:not([type]), .search.compact button { min-height: 44px; }
@media (max-width: 560px) {
  .search { flex-direction: column; }
  .search input:not([type]) { min-height: 46px; }
}

.samples { display: grid; gap: 12px; }
.samples .eyebrow { margin: 0 0 2px; }
.sample {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s;
}
.sample:hover { border-color: var(--accent); color: var(--ink); }
.sample img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--band); }
.sample-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sample-title { font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.sample-facts { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.sample.featured { grid-template-columns: 1fr; gap: 0; padding: 0; overflow: hidden; }
.sample.featured img { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; border-bottom: 1px solid var(--line); }
.sample.featured .sample-body { padding: 16px 20px 18px; }
.sample.featured .sample-title { font-size: 1.12rem; }
.sample.no-image { grid-template-columns: 1fr; padding: 16px 20px; }

.section { display: grid; gap: 16px 56px; padding: 64px 0; border-top: 1px solid var(--line); }
.section > h2 { margin: 0; font-size: 1.55rem; }
.section-body > :first-child { margin-top: 0; }
.section-body > :last-child { margin-bottom: 0; }
@media (min-width: 900px) { .section { grid-template-columns: 250px minmax(0, 1fr); } }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 32px; }
.steps li { counter-increment: step; padding-top: 16px; border-top: 2px solid var(--ink); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; margin-bottom: 12px; color: var(--accent);
                    font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.steps strong { display: block; margin-bottom: 6px; font-size: 1.12rem; letter-spacing: -.01em; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.features { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 0 40px; }
.features li { position: relative; padding: 14px 0 14px 30px; border-top: 1px solid var(--line); }
.features li::before { content: ""; position: absolute; left: 2px; top: 1.32em; width: 12px; height: 12px;
                       border: 2.5px solid var(--signal); border-radius: 50%; }
@media (min-width: 700px) { .features { grid-template-columns: 1fr 1fr; } }

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 18px; }
.price {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s;
}
a.price:hover { border-color: var(--accent); color: var(--ink); }
a.price::after { content: "→"; position: absolute; top: 20px; right: 22px; color: var(--muted); transition: transform .15s, color .15s; }
a.price:hover::after { color: var(--accent); transform: translateX(3px); }
.price-title { color: var(--ink-2); font-weight: 600; }
.price-value { margin-top: 6px; font-size: 2.1rem; font-weight: 650; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.price-sub { color: var(--muted); font-size: .9rem; }
.price .button-link { margin-top: 16px; }

/* --- account, preview, follow-ups -------------------------------------------------------- */

.account-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 0 0 32px; }
.account-head h1 { margin: 0 0 4px; }
.account-head p.muted { margin: 0; }
.account-head p.error { flex-basis: 100%; margin: 0; }
.balance { text-align: right; }
.balance-value { display: block; font-size: 3.2rem; font-weight: 650; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.balance-label { display: block; margin: 6px 0 14px; color: var(--muted); }
.logout { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 8px 20px; }

.preview-head { margin: 0 0 32px; }
.preview-head h1 { margin: 0 0 6px; }
.preview-head p.muted { margin: 0; }
.preview { margin-bottom: 40px; }
/* facts, then the map, then the archive titles; on wide screens the map stands beside both */
.preview-grid { display: grid; gap: 36px 40px; align-items: start; }
.preview-grid h2 { margin: 0 0 10px; }
@media (min-width: 820px) {
  .preview-grid.has-map { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: auto 1fr;
                          grid-template-areas: "facts map" "archive map"; }
  .preview-grid.has-map > .preview-facts { grid-area: facts; }
  .preview-grid.has-map > .preview-map { grid-area: map; }
  .preview-grid.has-map > .preview-archive { grid-area: archive; }
}
.preview-facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 22px 24px; }
.preview-facts li { display: flex; flex-direction: column; min-width: 0; padding-top: 10px; border-top: 2px solid var(--ink); }
.preview-facts li.wide { grid-column: 1 / -1; }
.preview-map { margin: 0; }
.preview-map img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.preview-map figcaption { margin-top: 8px; color: var(--muted); font-size: .86rem; }
/* on a phone the map comes first: it is what the visitor came for, the facts follow */
@media (max-width: 819px) {
  .preview-grid.has-map > .preview-map { order: -1; }
}
/* the same place on other maps: the report follows it through time */
.preview-thumbs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preview-thumbs a { display: block; color: var(--ink-2); text-decoration: none; font-size: .84rem; line-height: 1.35; }
.preview-thumbs img { aspect-ratio: 1; object-fit: cover; margin-bottom: 6px; }
.includes-title { margin: 18px 0 6px; font-size: 1rem; }
.includes { margin: 0 0 14px; padding-left: 1.2em; }
.includes li { margin: 3px 0; }

/* the preview's sample report: what the visitor would get, before the price */
.showcase { margin: 0 0 40px; display: grid; gap: 14px; max-width: 720px; }
.showcase h2 { margin: 0; }
.showcase .eyebrow, .showcase p { margin: 0; }
.showcase .mapstrip-title { margin: 6px 0 0; }
.showcase .mapstrip-item { cursor: pointer; }
.showcase .mapstrip-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.showcase-toc { margin: 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 28px; }
.showcase-toc li { margin: 2px 0; break-inside: avoid; }
.showcase > .button-link { justify-self: start; }

/* a phone's way to the order button, shown by site.js while the order section is out of view */
.sticky-cta { display: none; }
@media (max-width: 819px) {
  .sticky-cta:not([hidden]) {
    display: block; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(26, 36, 32, .08);
  }
  .sticky-cta .button-link { display: flex; justify-content: center; align-items: center; width: 100%; }
}
.archive-samples { list-style: none; margin: 0; padding: 0; }
.archive-samples li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.archive-samples li:last-child { border-bottom: 0; }
.archive-samples code { margin-left: 4px; }
/* the places a name fits, each row one link to its preview */
.choices { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.choices li { border-bottom: 1px solid var(--line); }
.choice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 12px 10px; margin: 0 -10px;
          color: var(--ink-2); text-decoration: none; border-radius: var(--radius); }
.choice:hover { background: var(--accent-soft); color: var(--ink); }
.choice-name { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: .2em;
               text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.choice-meta { flex-basis: 100%; color: var(--muted); font-size: .88rem; }
.other-places { color: var(--ink-2); }
.cta { background: var(--accent-soft); border-color: transparent; }
.cta .row { margin-top: 20px; }

.followup { padding: 14px 0; border-top: 1px solid var(--line); }
.followup-q { margin: 0; font-weight: 600; }
.followup-q span.status { margin-left: 8px; }
.followup p.muted { margin-top: 4px; }
.followups form { margin-top: 16px; }
.followups { scroll-margin-top: 16px; }
.followups-lead { font-size: 1.05rem; }

/* --- the report -------------------------------------------------------------------------- */

.report-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px; }
.report-main { min-width: 0; width: 100%; max-width: 860px; margin: 0 auto; }
.report {
  --pad: clamp(20px, 5.5vw, 56px);
  margin: 0 0 24px;
  padding: var(--pad);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 1.03em;
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.report h2 { margin: 2.2em 0 .7em; padding-top: 1.1em; border-top: 1px solid var(--line); font-size: 1.55rem; scroll-margin-top: 16px; }
.report h3 { font-size: 1.15rem; }
.report li::marker { color: var(--muted); }
.report img { display: block; max-width: 100%; height: auto; margin: 16px auto 4px; border: 1px solid var(--line); border-radius: 8px; }
.report img + em, .report p:has(> img) { color: var(--muted); font-size: .9rem; text-align: center; }
.report table { display: block; overflow-x: auto; width: 100%; margin: 1.2em 0 1.6em; border-collapse: collapse; font-size: .92rem; line-height: 1.5; }
/* "anywhere" on the article would let the layout squeeze a date column to one character wide;
   cells wrap at spaces, and a very long word (a bare URL) scrolls the table instead. */
.report th, .report td { padding: 9px 16px 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top;
                         overflow-wrap: break-word; }
.report th { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
             border-bottom: 1.5px solid var(--line-2); }
.report th:first-child, .report td:first-child { min-width: 7em; }
.report th:last-child, .report td:last-child { padding-right: 0; }
.report blockquote { margin: 1.2em 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent); color: var(--ink-2); }
.report .credit { display: block; margin-bottom: 4px; color: var(--muted); font-size: .78rem; text-align: center; }
.link-host { color: var(--muted); font-size: .85em; overflow-wrap: anywhere; }
.report.answer { margin: 0 0 20px; padding: 0; background: none; border: 0; border-radius: 0; }

/* Hero: the oldest map as a banner across the top of the paper, the title under it */
.report .hero { margin: 0 0 24px; }
.report .hero.has-image { margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 28px; }
/* more specific than ".report img", which would otherwise size and frame the banner */
.report .hero-img { display: block; width: 100%; height: clamp(190px, 32vw, 340px); max-width: none; margin: 0; object-fit: cover;
                    border: 0; border-bottom: 1px solid var(--line); border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; }
.report .hero h1 { margin: 0; font-size: clamp(1.75rem, 1.3rem + 1.7vw, 2.45rem); }
.report .hero.has-image h1 { padding: 30px var(--pad) 0; }

/* Key facts: label over value, each under a dark rule */
.facts { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 20px 24px; }
.facts li { display: flex; flex-direction: column; min-width: 0; padding-top: 10px; border-top: 2px solid var(--ink); }
.fact-label { color: var(--muted); font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.fact-value { margin-top: 4px; font-size: 1.4rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.fact-sub { margin-top: 4px; color: var(--muted); font-size: .82rem; line-height: 1.4; }

/* Contents beside the article on wide screens; above it otherwise, as one row that scrolls sideways */
.toc { margin: 0 0 20px; font-size: .9rem; }
.toc-title { margin: 0 0 8px; color: var(--muted); font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0 0 6px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.toc li { flex: none; }
.toc a { display: block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
         color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.toc a:hover, .toc a.current { border-color: var(--accent); color: var(--accent); }
.toc .toc-ask a { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc .toc-ask a:hover, .toc .toc-ask a.current { border-color: var(--accent-2); color: var(--accent-2); }
@media (min-width: 1180px) {
  .report-page:has(> .toc) { grid-template-columns: 220px minmax(0, 860px); justify-content: center; }
  .toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; padding-top: 6px; }
  .toc ol { flex-direction: column; gap: 0; padding: 0; overflow: visible; border-left: 1px solid var(--line); }
  .toc a { margin-left: -1px; padding: 5px 0 5px 14px; border: 0; border-left: 2px solid transparent; border-radius: 0; background: none;
           line-height: 1.35; white-space: normal; }
  .toc a:hover { color: var(--accent); }
  .toc a.current { border-left-color: var(--accent); color: var(--ink); font-weight: 600; }
  .toc .toc-ask a { margin: 12px 0 0 12px; padding: 7px 12px; border: 0; border-radius: var(--radius); background: var(--accent-soft);
                    color: var(--accent); }
  .toc .toc-ask a:hover, .toc .toc-ask a.current { color: var(--accent-2); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
}

/* Timeline: a ruler with one dot per event, then the events down a line */
.timeline { margin: 8px 0 32px; }
.tl-ruler { display: block; overflow: visible; margin-bottom: 18px; }
.tl-axis { stroke: var(--line-2); stroke-width: 1.5; }
.tl-tick { stroke: var(--muted); stroke-width: 1; }
.tl-tick-label { font: 500 11px var(--font); fill: var(--muted); }
.tl-dot { fill: var(--kind, var(--muted)); stroke: var(--surface); stroke-width: 1.5; }
.tl-dot.tl-approx { fill: var(--surface); stroke: var(--kind, var(--muted)); stroke-width: 2; }
.tl { list-style: none; margin: 0 0 0 112px; padding: 4px 0 0 22px; border-left: 1.5px solid var(--line-2); }
.tl-item { position: relative; margin: 0 0 12px; }
.tl-item::before { content: ""; position: absolute; left: -29px; top: 11px; width: 11px; height: 11px; border-radius: 50%;
                   background: var(--kind, var(--muted)); border: 2px solid var(--surface); }
.tl-when { position: absolute; right: calc(100% + 34px); top: 7px; width: 100px; text-align: right;
           font-size: .9rem; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tl-card { padding: 9px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: .95rem; line-height: 1.55; }
.tl-key .tl-card { background: var(--accent-soft); border-color: transparent; box-shadow: inset 3px 0 0 var(--accent); }
.tl-kind { float: right; margin: 2px 0 4px 10px; color: var(--kind, var(--muted)); font-size: .68rem; font-weight: 700;
           letter-spacing: .08em; text-transform: uppercase; }
.tl-text p { margin: 0; }
.tl-source { margin-top: 4px; color: var(--muted); font-size: .82rem; }
.tl-source::before { content: "Allikas: "; }
.tl-cert { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .02em; vertical-align: 1px; }
.tl-map { --kind: #3a6ea5; }
.tl-archive { --kind: #875a26; }
.tl-news { --kind: #2b734f; }
.tl-court { --kind: #7a4e9c; }
.tl-building { --kind: #8a5e0c; }
.tl-photo { --kind: #b0456e; }

/* Figures */
.fig { margin: 28px 0; }
.report .fig img { margin: 0 auto; }
.fig .zoom { display: block; cursor: zoom-in; }
.fig figcaption { margin-top: 8px; color: var(--muted); font-size: .88rem; line-height: 1.5; text-align: center; }
.fig .credit { margin: 2px 0 0; font-size: .76rem; }

/* The same place through time, and the before/after slider */
.mapstrip-wrap { margin: 8px 0 24px; }
.mapstrip-title, .compare-help { color: var(--muted); font-size: .8rem; }
.mapstrip-title { margin: 0 0 8px; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.mapstrip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.mapstrip-item { position: relative; flex: 0 0 150px; width: 150px; height: 150px; overflow: hidden; scroll-snap-align: start;
                 border: 1px solid var(--line); border-radius: 10px; cursor: zoom-in; }
.report .mapstrip-item img { width: 100%; height: 100%; margin: 0; object-fit: cover; border: 0; border-radius: 0; }
.mapstrip-year { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 5px; color: #fff; font-size: .8rem; font-weight: 600;
                 background: linear-gradient(transparent, rgba(10, 14, 12, .78)); }
.compare { position: relative; aspect-ratio: 1 / 1; max-width: 560px; margin: 0 auto; overflow: hidden;
           border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.compare:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.compare-needs-js, .compare-needs-js + .compare-help { display: none; }
.compare-pane { position: absolute; inset: 0; overflow: hidden; }
.report .compare-pane img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none;
                            margin: 0; border: 0; border-radius: 0; }
.compare-top { clip-path: inset(0 0 0 50%); }
.compare-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff;
                   box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.compare-divider::after { content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #1a2420;
  font-size: 18px; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-label { position: absolute; bottom: 10px; padding: 3px 9px; border-radius: 6px; background: rgba(10, 14, 12, .7);
                 color: #fff; font-size: .78rem; pointer-events: none; }
.compare-label-a { left: 10px; }
.compare-label-b { right: 10px; }
.compare-help { margin: 8px 0 24px; text-align: center; }

/* Lightbox */
.lightbox { max-width: 96vw; max-height: 96vh; padding: 0; border: 0; background: transparent; }
.lightbox:not([open]) { display: none; }
.lightbox::backdrop { background: rgba(10, 14, 12, .88); }
.lightbox img { display: block; width: auto; height: auto; max-width: 96vw; max-height: 88vh; margin: 0 auto; border-radius: 6px; }
.lightbox-caption { margin: 10px 0 0; color: #eee; font-size: .9rem; text-align: center; }
.lightbox-close { position: fixed; top: 12px; right: 14px; min-height: 0; padding: 2px 14px; border: 0; border-radius: 8px;
                  background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.6rem; font-weight: 400; line-height: 1.3; }
.lightbox-close:hover { background: rgba(0, 0, 0, .8); color: #fff; }
.lightbox-close:focus-visible { outline-color: #fff; }

/* Above the report: save as PDF, and the owner's switch for sharing it by link */
.report-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 16px; }
.report-tools .button-link[aria-busy="true"] { cursor: progress; opacity: .75; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.share-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
.share-state { color: var(--ink-2); font-size: .95rem; }
.share-state strong { color: var(--ink); font-weight: 600; }
.share-link { margin: 0 0 16px; }
.share-link input[readonly] { flex-basis: 160px; background: var(--surface); }
.share-nudge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin: 0 0 20px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); }
.share-nudge p { flex: 1 1 260px; margin: 0; }
.share-send { margin: 0; }
.share-nudge .share-note { flex: 0 0 100%; margin: 0; color: var(--error); }
.share-nudge .share-note:empty { display: none; }

/* Below the report: the request, follow-up questions */
.meta { background: var(--band); border-color: transparent; }
.meta p { margin: 0 0 8px; }
.meta .row { margin-top: 18px; }
.meta input[readonly] { background: var(--surface); }
.update { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.delete { margin-top: 14px; text-align: right; }
.row > .delete { margin: 0 0 0 auto; }
.print-only { display: none; }

/* --- prose pages ------------------------------------------------------------------------- */

.page-section { margin-top: 56px; padding-top: 4px; border-top: 1px solid var(--line); }

.prose h2 { font-size: 1.25rem; margin-top: 1.9em; }
.prose h3 { font-size: 1.05rem; margin: 1.4em 0 .3em; }
.prose ul, .plain { padding-left: 1.2em; }
.prose li, .plain li { margin: .45em 0; }
.prose li::marker, .plain li::marker { color: var(--muted); }

/* --- admin ------------------------------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.money { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 10px 0 0; font-size: 0.9rem; }
.money dt { color: var(--muted); }
.money dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.loss { color: var(--error); }
.tile-label { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tile-value { margin: 6px 0; font-size: 1.9rem; font-weight: 650; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--muted); font-size: .8rem; }
.bar-col { width: 30%; min-width: 120px; }
svg.bar { display: block; }
svg.bar rect { fill: var(--accent); }
.admin-link { margin-right: auto; }

/* the admin pages' own menu: a row of tabs that scrolls sideways on a phone */
.admin-nav { display: flex; gap: 2px; margin: -16px 0 28px; overflow-x: auto; border-bottom: 1px solid var(--line);
  scrollbar-width: thin; }
.admin-nav a { flex: none; margin-bottom: -1px; padding: 10px 14px; border-bottom: 2px solid transparent;
  color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; }
.admin-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.admin-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
.count { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: .75rem; font-weight: 650; line-height: 1.5; text-align: center; }
.count.warn { background: var(--warn-bg); color: var(--warn-ink); }
.admin-title { font-size: 1.6rem; margin-bottom: .7em; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .9rem; }
.alerts { display: grid; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.alert { padding: 12px 16px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn-ink); }
.alert a { color: inherit; font-weight: 600; }
.alert.error { background: var(--error-soft); color: var(--error); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); font-size: .9rem;
  text-decoration: none; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.filter-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.filter-search input[type="search"] { width: 240px; max-width: 100%; min-height: 40px; }
.filter-search button { min-height: 40px; }
.filter-search .clear { font-size: .9rem; }
td.order-paid { color: var(--ok); }
td.order-review { color: var(--warn-ink); font-weight: 600; }
@media (max-width: 560px) {
  .admin-nav { margin-top: -8px; }
  .filter-search { margin-left: 0; width: 100%; }
  .filter-search input[type="search"] { flex: 1 1 160px; width: auto; }
}

/* --- small screens ----------------------------------------------------------------------- */

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  main { padding-top: 28px; }
  header.site .site-inner { min-height: 64px; column-gap: 12px; }
  .nav a { padding: 8px 10px; }
  /* brand and menu on one row on a phone */
  .nav-full { display: none; }
  .nav-short { display: inline; }
  .card { padding: 22px 20px; }
  .section { padding: 44px 0; }
  .tl { margin-left: 6px; padding-left: 18px; }
  .tl-item::before { left: -25px; top: 7px; }
  .tl-when { position: static; width: auto; margin-bottom: 3px; text-align: left; }
  .mapstrip-item { flex-basis: 120px; width: 120px; height: 120px; }
  .account-head { align-items: flex-start; }
  .balance { text-align: left; }
}

/* --- analytics consent ------------------------------------------------------------------- */

.consent {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 2 * var(--gutter)));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(26, 36, 32, .14);
}
.consent[hidden] { display: none; }
main[tabindex="-1"]:focus { outline: none; }  /* focus parked here after the banner */
.consent p { flex: 1 1 320px; margin: 0; color: var(--ink-2); font-size: .92rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-actions button { min-height: 42px; }
/* on a phone the card took a third of the screen: a bar along the bottom, buttons in one row */
@media (max-width: 600px) {
  .consent { bottom: 0; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0;
             gap: 10px; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); }
  .consent p { flex-basis: 100%; font-size: .8rem; line-height: 1.45; }
  .consent-actions { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .consent-actions button { flex: 1 1 auto; min-height: 38px; padding: 6px 8px; font-size: .84rem; }
}

/* --- chat (Crisp loads on click) ------------------------------------------------------------ */

.chat-launcher {
  position: fixed; z-index: 45; right: 20px; bottom: 20px;
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 999px; box-shadow: 0 8px 24px rgba(26, 36, 32, .18);
}
.chat-launcher[hidden] { display: none; }
.chat-launcher svg { flex: none; }
/* out of the way of the cookie banner while it asks, and above the preview's order bar on a phone */
body:has(#consent:not([hidden])) .chat-launcher { display: none; }
@media (max-width: 819px) {
  .chat-launcher { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); min-height: 42px; padding: 8px 14px; }
  body:has(.sticky-cta:not([hidden])) .chat-launcher { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* --- print ------------------------------------------------------------------------------- */

/* "Salvesta PDF" prints the report page: on A4 it becomes a document of its own, with a cover
   (map, title, facts, contents), a running footer with page numbers, and a colophon at the end.
   Browsers leave backgrounds out by default; the few that carry meaning are forced in. */
@page {
  size: A4;
  margin: 16mm 17mm 18mm;
  @bottom-left { content: "Kohalugu · kohaajaloo raport"; font: 500 7.5pt "Albert Sans", sans-serif; color: #5b6661; }
  @bottom-right { content: counter(page) " / " counter(pages); font: 600 7.5pt "Albert Sans", sans-serif; color: #5b6661; }
}
@page :first {
  @bottom-left { content: none; }
  @bottom-right { content: none; }
}

@media print {
  html, body { background: #fff; }
  body { display: block; min-height: 0; color: var(--ink); font-size: 9.5pt; line-height: 1.5; }
  header.site, footer.site, .sandbox-badge, .toc, .report-tools, .share-link, .share-nudge, .notice, .meta, .followups, .lightbox,
  .compare, .compare-help, .consent, .chat-launcher { display: none !important; }
  main, main.wide, main:has(.report-page) { max-width: none; margin: 0; padding: 0; }
  .report-page { display: block; }
  .report-main { max-width: none; }
  .report { --pad: 0; margin: 0; padding: 0; border: 0; border-radius: 0; font-size: 1em; line-height: 1.55; }
  .print-only { display: block; }
  a { color: inherit; text-decoration: none; }
  p { orphans: 3; widows: 3; }

  /* Cover: brand line, the oldest map, title, facts, contents; the report starts on page 2.
     The page is a little shorter than A4's 263mm so a bigger print scale doesn't spill it; the map
     gives up height when a long title or contents list needs it. */
  .cover { display: flex; flex-direction: column; height: 250mm; break-after: page; }
  .cover-brand { display: flex; align-items: center; gap: 2.5mm; margin: 0 0 7mm; padding-bottom: 3mm;
                 border-bottom: .6pt solid var(--line-2); font-size: 10.5pt; font-weight: 700; letter-spacing: -.02em; }
  .cover-brand .brand-mark { width: 5.5mm; height: 5.5mm; }
  .cover-kind { margin-left: auto; color: var(--muted); font-size: 7pt; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
  .report .hero, .report .hero.has-image { flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; margin: 0 0 7mm; }
  .report .hero-img { flex: 0 1 108mm; height: 108mm; min-height: 45mm; border: 0; border-radius: 2.5mm; object-position: 50% 40%; }
  .report .hero h1, .report .hero.has-image h1 { padding: 0; font-size: 25pt; line-height: 1.08; letter-spacing: -.03em; }
  .report .hero.has-image h1 { margin-top: 7mm; }
  .report .cover:not(.has-image) .hero h1 { margin-top: 30mm; font-size: 32pt; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4mm 5mm; margin: 0 0 8mm; }
  .facts li { padding-top: 2mm; border-top-width: 1.5pt; }
  .fact-label { font-size: 6.5pt; }
  .fact-value { font-size: 13pt; }
  .fact-sub { font-size: 7pt; }
  .cover-toc .toc-title { margin: 0 0 2mm; font-size: 6.5pt; }
  .cover-toc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 8mm; font-size: 8.5pt; line-height: 1.35; }
  .cover-toc li { padding: 1.1mm 0; border-bottom: .5pt solid var(--line); break-inside: avoid; }
  .cover-foot { margin: auto 0 0; padding-top: 3mm; border-top: .6pt solid var(--line-2); color: var(--muted); font-size: 7.5pt; }

  /* Text */
  .report h2 { margin: 9mm 0 3mm; padding-top: 2.5mm; border-top: 1.5pt solid var(--ink); font-size: 15pt; break-after: avoid; }
  .cover + h2, .report > h2:first-of-type { margin-top: 0; }
  .report h3 { margin: 5mm 0 1.5mm; font-size: 11pt; break-after: avoid; }
  .report h4 { break-after: avoid; }
  .report p:has(+ .fig), .report p:has(+ .mapstrip-wrap), .report p:has(+ table) { break-after: avoid; }
  .report > ul, .report > ol, .report li > ul, .report li > ol { padding-left: 5mm; }
  .report blockquote { border-left-width: 1.5pt; }

  /* Tables print whole, with the header row repeated on each page */
  .report table { display: table; overflow: visible; margin: 2mm 0 5mm; font-size: 8pt; line-height: 1.4; }
  .report thead { display: table-header-group; }
  .report th, .report td { padding: 1.6mm 3mm 1.6mm 0; }
  .report th { font-size: 6.5pt; }
  .report tr { break-inside: avoid; }

  /* Images: framed, kept with their captions, short enough that two maps share a page */
  .report img { border-color: var(--line); border-radius: 1.5mm; }
  .fig { margin: 4mm 0 6mm; break-inside: avoid; }
  .fig img { max-height: 88mm; width: auto; }
  .fig figcaption { margin-top: 2mm; font-size: 7.5pt; }
  .fig .credit { font-size: 6.5pt; }
  /* a run of figures with no text between them goes two to a row */
  .fig:has(+ .fig), .fig + .fig { display: inline-block; width: 48.5%; margin: 2mm 0 5mm; vertical-align: top; }
  .fig:has(+ .fig) img, .fig + .fig img { max-height: 80mm; }
  .mapstrip-wrap { margin: 2mm 0 6mm; break-inside: avoid; }
  .mapstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5mm; overflow: visible; padding: 0; }
  .mapstrip-item { width: auto; height: auto; aspect-ratio: 1; border-radius: 1.5mm; }
  .mapstrip-year { print-color-adjust: exact; -webkit-print-color-adjust: exact; font-size: 7pt; padding: 5mm 2mm 1.2mm; }

  /* Timeline */
  .timeline { margin: 2mm 0 6mm; }
  .tl-ruler { break-after: avoid; }
  .tl { margin-left: 24mm; padding-left: 5mm; border-left: 1pt solid var(--line-2); }
  .tl-item { margin-bottom: 2mm; break-inside: avoid; }
  .tl-item::before { left: -6.9mm; top: 2.6mm; width: 2.6mm; height: 2.6mm; border-width: .5mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .tl-when { right: calc(100% + 7.5mm); top: 1.5mm; width: 22mm; font-size: 8pt; }
  .tl-card { padding: 1.8mm 3mm; background: #fff; border-color: var(--line); border-radius: 1.5mm; font-size: 8.5pt; line-height: 1.45; }
  .tl-key .tl-card { background: var(--accent-soft); box-shadow: inset 2pt 0 0 var(--accent); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .tl-kind { font-size: 6pt; }
  .tl-source { font-size: 7pt; }

  /* Sources: a long list of archive links, set small */
  h2.sec-sources ~ :is(ul, ol, p):not(h2.sec-sources ~ h2 ~ *) { font-size: 7.5pt; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
  h2.sec-sources ~ :is(ul, ol):not(h2.sec-sources ~ h2 ~ *) li { margin: .6mm 0; }

  /* Colophon: who made the report, when, and how to read it */
  .colophon { margin-top: 12mm; padding-top: 4mm; border-top: 1.5pt solid var(--ink); color: var(--muted); font-size: 7.5pt; break-inside: avoid; }
  .colophon .brand-mark { width: 6mm; height: 6mm; margin-bottom: 2mm; }
  .colophon p { margin: 0 0 1mm; }
  .colophon strong { color: var(--ink); }
}

/* --- place pages (/kohad) ----------------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 14px; color: var(--muted); font-size: .88rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.place-cta-line { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); font-size: .95rem; }
.page-intro { margin: 20px 0 8px; font-size: 1.06rem; line-height: 1.6; color: var(--ink-2); }
.page-intro p { margin: 0 0 12px; }
.place-links { columns: 2 16em; gap: 24px; padding-left: 18px; margin: 0 0 12px; }
.place-links li { margin: 0 0 6px; break-inside: avoid; }
.places-head { padding: 24px 0 28px; }
.places-head h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -.035em; margin: 0 0 14px; }
.places-head .lead { max-width: 40em; margin: 0; }
.place-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 32px; }
.places-cta { max-width: var(--text); }
.suggestions { padding-left: 18px; }
.suggestions li { margin: 0 0 6px; }
@media print { .crumbs, .place-cta-line { display: none; } }
