/*
  Travel to Learn mockup.
  Layout: a calm product shell (demo bar, header, stepper) wrapped around a
  college-branded report. Every brand colour and typeface is a token that
  app.js swaps when the demo college changes. The look is deliberately light
  in every theme, because the output is a printed board document.
*/
:root {
  --brand: #C4122F;
  --brand-ink: #8E0B22;
  --brand-soft: #FCE8EA;
  --accent: #F4B740;
  --ink: #1E1A1B;
  --muted: #6B6264;
  --line: #E9E3E3;
  --canvas: #F7F4F3;
  --paper: #FFFFFF;
  --land: #F1EFEC;
  --on-brand: #FFFFFF;
  --warn: #9A5B00;
  --warn-soft: #FFF3DC;
  --ok: #1F7A45;
  --chrome: #17181A;
  --chrome-fg: #F2F2F0;
  --chrome-muted: #A3A5A8;

  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --display-weight: 700;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand);
}

/* ---------- demo bar ---------- */
.demo-bar { background: var(--chrome); color: var(--chrome-fg); }
.demo-bar__inner {
  max-width: 1320px; margin: 0 auto;
  padding-block: 8px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.demo-bar__note { font-size: 13px; color: var(--chrome-muted); display: flex; align-items: center; gap: 8px; }
.pill {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: #2C2E31; color: var(--chrome-fg); border-radius: 999px; padding: 2px 8px;
}

/* segmented control */
.seg { display: inline-flex; background: var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg--demo { background: #2C2E31; }
.seg--demo button { color: var(--chrome-muted); }
.seg--demo button[aria-checked="true"] { background: var(--chrome-fg); color: var(--chrome); }

/* ---------- header ---------- */
.app-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.app-header__inner {
  max-width: 1320px; margin: 0 auto;
  padding-block: 14px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand__name { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand__name strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 19px; letter-spacing: -0.01em; }
.brand__name span { font-size: 12.5px; color: var(--muted); }
[data-college="wexcombe"] h1, [data-college="wexcombe"] h2, [data-college="wexcombe"] .kpi__value, [data-college="wexcombe"] .place { font-stretch: 82%; }
[data-college="wexcombe"] h1 { letter-spacing: -0.005em; }
[data-college="wexcombe"] .brand__name strong { text-transform: uppercase; letter-spacing: .06em; font-stretch: 85%; font-size: 20px; }

.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; }
.stepper li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stepper li + li::before { content: ""; width: 22px; height: 1.5px; background: var(--line); margin-right: 2px; }
.stepper__dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--canvas); border: 1.5px solid var(--line);
  transition: all .25s var(--ease);
}
.stepper li.is-done .stepper__dot { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-ink); }
.stepper li.is-current { color: var(--ink); }
.stepper li.is-current .stepper__dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- views ---------- */
main { max-width: 1320px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 28px 48px; }
.view { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 11px 18px; font-weight: 600; font-size: 14.5px; cursor: pointer;
  border: 1.5px solid transparent; text-decoration: none; line-height: 1.2;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-ink); }
.btn--ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--muted); }
.btn--sm { padding: 8px 12px; font-size: 13.5px; }

/* ---------- upload ---------- */
.upload { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 12px; }
.upload__copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.upload h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
.lede { font-size: 17px; color: var(--muted); max-width: 52ch; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 34px 20px; border-radius: var(--r-lg); cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
  background: var(--paper);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop.is-over { transform: scale(1.01); }
.drop__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.drop__title { font-weight: 600; font-size: 16px; }
.drop__hint { font-size: 13.5px; color: var(--muted); }
.upload__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.privacy { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.privacy svg { color: var(--ok); flex: none; }

.upload__preview {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.mini { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--land); aspect-ratio: 16 / 10; max-width: 100%; }
.mini canvas { width: 100%; height: 100%; display: block; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.ticks li { display: flex; gap: 10px; align-items: baseline; }
.ticks li::before {
  content: ""; width: 14px; height: 8px; flex: none; transform: translateY(-2px) rotate(-45deg);
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand);
}

.template-help { margin-top: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.template-help summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style-position: inside; }
.template-help__body { padding: 0 18px 18px; display: grid; gap: 12px; }
.template-help__body p { color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; background: var(--canvas); padding: 2px 6px; border-radius: 5px; }

/* ---------- check ---------- */
.check { max-width: 680px; margin: 0 auto; padding-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.check h1 { font-size: clamp(26px, 3.4vw, 34px); }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter__fill { height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width .12s linear; }
.check__count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }

.checks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.checks li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px;
  animation: rise .35s var(--ease) both;
}
.checks .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.checks .ic--ok { background: #E3F3E9; color: var(--ok); }
.checks .ic--warn { background: var(--warn-soft); color: var(--warn); }
.checks strong { display: block; font-weight: 600; }
.checks small { display: block; color: var(--muted); font-size: 13px; }
.linkish { background: none; border: 0; padding: 4px 2px; color: var(--brand-ink); font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.issues { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 8px 10px; animation: rise .3s var(--ease) both; }
.issues__more { font-size: 13px; color: var(--muted); padding: 6px 10px 0; }
.notice { background: var(--warn-soft); color: #5C3A00; border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; }
.check__actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; animation: rise .35s var(--ease) both; }

/* ---------- report ---------- */
.report { display: flex; flex-direction: column; gap: 18px; }
.report__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.report__titles { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.report h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; }
.report__sub { color: var(--muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.report__tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.report__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.report__body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.mapcard {
  position: sticky; top: 16px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
  background: var(--land); height: clamp(520px, calc(100vh - 32px), 860px); isolation: isolate;
}
.map { position: absolute; inset: 0; background: var(--land); font-family: var(--font-body); }

.layers { position: absolute; top: 12px; left: 12px; z-index: 500; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 70px); }
.chip {
  border: 1px solid var(--line); background: rgba(255,255,255,.94); border-radius: 999px;
  padding: 6px 12px 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; }
.chip[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.chip[aria-pressed="true"]::before { background: var(--brand); border-color: var(--brand); }

.legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; background: rgba(255,255,255,.96);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; font-size: 12px;
  display: grid; gap: 6px; max-width: 280px;
}
.legend__title { font-weight: 600; color: var(--ink); }
.legend__scale { display: flex; gap: 2px; }
.legend__scale span { flex: 1; height: 10px; }
.legend__scale span:first-child { border-radius: 3px 0 0 3px; }
.legend__scale span:last-child { border-radius: 0 3px 3px 0; }
.legend__ticks { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend__note { color: var(--muted); font-size: 11.5px; line-height: 1.35; }

.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi__value { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 15px; font-weight: 600; margin-left: 2px; color: var(--muted); letter-spacing: 0; }
.kpi__label { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.kpi--lead { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.kpi--lead .kpi__label, .kpi--lead .kpi__value small { color: color-mix(in srgb, var(--on-brand) 78%, var(--brand)); }

.block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.block h2 { font-size: 15px; letter-spacing: -0.005em; }
.foot { font-size: 12px; color: var(--muted); }

.bands { display: grid; gap: 7px; }
.band { display: grid; grid-template-columns: 74px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.band__label { color: var(--muted); }
.band__track { height: 14px; background: var(--canvas); border-radius: 4px; overflow: hidden; }
.band__bar { height: 100%; background: var(--brand); border-radius: 4px; transition: width .5s var(--ease); }
.band__val { text-align: right; font-weight: 600; }

.towns { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.towns li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.towns li:last-child { border-bottom: 0; }
.towns .t-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.towns .t-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.towns .t-far { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 1px 7px; white-space: nowrap; flex: none; }
.towns .t-n { font-weight: 600; }
.towns .t-bar { grid-column: 1 / -1; height: 4px; background: var(--canvas); border-radius: 2px; overflow: hidden; }
.towns .t-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--brand) 70%, white); border-radius: 2px; }

.findings { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; }
.findings li { padding-left: 16px; position: relative; }
.findings li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.findings strong { font-weight: 600; }

.report__foot { font-size: 12px; color: var(--muted); max-width: 90ch; }

/* map furniture (Leaflet) */
.leaflet-container { background: var(--land); font-family: var(--font-body); }
.leaflet-control-attribution { font-size: 10.5px; background: rgba(255,255,255,.8) !important; }
.leaflet-control-zoom a { color: var(--ink) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: 0 1px 2px rgba(0,0,0,.08) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-scale-line { border-color: var(--muted); color: var(--muted); background: rgba(255,255,255,.8); font-size: 10.5px; }
.place {
  font-family: var(--font-display); font-weight: 600; font-size: 12px; color: var(--ink); white-space: nowrap;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 8px #fff; pointer-events: none;
  transform: translate(-50%, -50%); display: inline-block; letter-spacing: .01em;
}
.place--big { font-size: 13.5px; }
.ringlabel {
  font-size: 11px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.9); border-radius: 99px;
  padding: 1px 7px; transform: translate(-50%, -50%); display: inline-block; white-space: nowrap; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.campus { display: flex; align-items: center; gap: 6px; transform: translate(-11px, -11px); white-space: nowrap; pointer-events: none; }
.campus--left { flex-direction: row-reverse; transform: translate(calc(-100% + 11px), -11px); }
.campus__dot {
  width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink);
  display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); flex: none;
}
.campus__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.campus__label { font-size: 12px; font-weight: 700; color: var(--paper); background: var(--ink); padding: 2px 8px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.hex-tip { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 8px; border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.18); font-variant-numeric: tabular-nums; }
.hex-tip::before { display: none; }

/* ---------- sheet (dialog) ---------- */
.sheet { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(20, 18, 19, .42); animation: fade .2s var(--ease) both; }
.sheet__panel {
  position: relative; width: min(560px, 100%); max-height: calc(100% - 32px); overflow: auto;
  background: var(--paper); border-radius: var(--r-lg); padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 16px; animation: pop .28s var(--ease) both;
}
.sheet__panel--wide { width: min(980px, 100%); }
.sheet__close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--canvas); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.sheet h2 { font-size: 20px; padding-right: 40px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.copyrow { display: flex; gap: 8px; }
.copyrow input {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--canvas); color: var(--ink);
}
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.opt span { display: grid; gap: 2px; }
.opt small { color: var(--muted); font-size: 12.5px; }
.opt select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background-color .2s var(--ease); pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.reassure { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--canvas); border-radius: var(--r-md); padding: 12px 14px; }
.reassure svg { color: var(--ok); flex: none; margin-top: 1px; }
.poster-preview { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--canvas); }
.poster-preview img { display: block; width: 100%; height: auto; }
.sheet__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sheet__actions small { color: var(--muted); font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 3000; background: var(--chrome); color: var(--chrome-fg); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: pop .25s var(--ease) both;
  max-width: calc(100% - 32px);
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .report__body { grid-template-columns: minmax(0, 1fr); }
  .mapcard { position: relative; top: 0; height: 560px; }
  .panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .kpis { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .upload { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .stepper__label { display: none; }
  .stepper li.is-current .stepper__label { display: inline; }
}
@media (max-width: 680px) {
  main { padding-block: 18px 36px; }
  .panel { display: flex; align-items: stretch; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .mapcard { height: 500px; }
  .layers { top: 10px; left: 10px; gap: 4px; }
  .chip { padding: 5px 9px 5px 8px; font-size: 12px; }
  .legend { left: 10px; bottom: 10px; padding: 8px 10px; }
  .legend__note { display: none; }
  .leaflet-control-scale { display: none; }
  .kpi__value { font-size: 24px; }
  .report__head { align-items: stretch; }
  .report__tools { width: 100%; justify-content: space-between; }
  .legend { max-width: 230px; }
  .brand__name span { display: none; }
}
@media (max-width: 420px) {
  .report__actions .btn--ghost { padding-inline: 10px; }
  .stepper li + li::before { width: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- print (PDF export) ---------- */
.print-sheet { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; }
  .print-page { width: 297mm; height: 210mm; page-break-after: always; break-after: page; overflow: hidden; }
  .print-page img { width: 100%; height: 100%; object-fit: contain; display: block; }
  .print-text { padding: 16mm 18mm; font-size: 11pt; color: #111; display: grid; gap: 6mm; }
  .print-text h2 { font-size: 18pt; }
  .print-text h3 { font-size: 12pt; margin-top: 2mm; }
  .print-text table { border-collapse: collapse; width: 100%; }
  .print-text td, .print-text th { border-bottom: 0.3mm solid #ccc; padding: 1.6mm 2mm; text-align: left; }
  .print-text ul { margin: 0; padding-left: 5mm; display: grid; gap: 2mm; }
}
