:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --text: #1d1d1b;
  --muted: #5f5d57;
  --line: #dedbd3;
  --accent: #c8102e;
  --accent-soft: #fbe7ea;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --na: #8a877f;
  --hl: #fff2a8;
  --hl-line: #d9b300;
  --ink: #2b3f9e;
  --paper: #fffdf7;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 5%);
  --top-h: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #212120;
    --surface-2: #2a2a28;
    --text: #ecebe7;
    --muted: #a8a59d;
    --line: #3a3936;
    --accent: #ff5a6e;
    --accent-soft: #3a1d22;
    --ok: #5fcf93;
    --ok-soft: #1b3326;
    --warn: #f0b552;
    --warn-soft: #3a2c14;
    --na: #8a877f;
    --hl: #4a4113;
    --hl-line: #c9a62a;
    --ink: #9fb0ff;
    --paper: #2a2925;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1:focus { outline: none; }

/* ---- Top bar and layout ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  /* Line the contents up with the centred .layout below (max 1280px). */
  height: var(--top-h); padding: 0 max(32px, calc(50% - 608px)) 0 max(20px, calc(50% - 620px));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.leaf { flex: none; width: 24px; height: 24px; border-radius: 5px; background: var(--accent); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.top-status { display: flex; align-items: center; gap: 14px; font-size: .9rem; color: var(--muted); min-width: 0; }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-progress { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.bar { width: 80px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar span, .big-progress span { display: block; height: 100%; background: var(--ok); transition: width .3s; }

.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1280px; margin: 0 auto; }
.rail {
  position: sticky; top: var(--top-h); align-self: start;
  height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 16px 10px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.rail-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .92rem;
}
.rail-link:hover { background: var(--surface-2); }
.rail-link.active { background: var(--accent-soft); font-weight: 600; }
.rail-link.locked { color: var(--muted); }
.rail-link.review { margin-top: 8px; }
.rail-n { color: var(--muted); font-variant-numeric: tabular-nums; width: 1.2em; text-align: right; }
.rail-t { flex: 1; min-width: 0; }
.rail-rv {
  font-size: .7rem; font-weight: 700; color: var(--ok);
  border: 1.5px solid var(--ok); border-radius: 4px; padding: 0 4px;
}
.main { padding: 24px 32px 64px; min-width: 0; }

/* ---- Status icons ---- */
.si { flex: none; width: 20px; height: 20px; border-radius: 50%; position: relative; }
.si.not-started { border: 2px solid var(--line); }
.si.in-progress {
  background: conic-gradient(var(--warn) var(--p), var(--surface-2) 0);
  box-shadow: inset 0 0 0 2px var(--warn);
}
.si.completed { background: var(--ok); }
.si.completed::after {
  content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.si.home { border-radius: 4px; border: 2px solid var(--muted); }
.si.lock { border-radius: 4px; background: var(--line); }
.si.review-ic { border-radius: 4px; background: var(--ok); }

.chip {
  display: inline-block; font-size: .78rem; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.chip.not-started { background: var(--surface-2); color: var(--muted); }
.chip.in-progress { background: var(--warn-soft); color: var(--warn); }
.chip.completed { background: var(--ok-soft); color: var(--ok); }

/* ---- Cards and buttons ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .88rem; }
.link {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent);
  text-decoration: underline; cursor: pointer;
}
.link.danger { color: var(--muted); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; vertical-align: 1px;
  padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn);
  white-space: nowrap;
}
.banner {
  background: var(--warn-soft); color: var(--warn); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; font-weight: 600;
}
.ph { color: var(--muted); font-style: italic; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; }

/* ---- Overview ---- */
.hello h1 { margin-bottom: .2em; }
.hello { margin-bottom: 18px; }
.name-form .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.name-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
input[type=text], input:not([type]), input[type=date] {
  font: inherit; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.big-progress { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.progress-card p { margin: 0; }
.review-card.locked { color: var(--muted); }
.review-card.done { border-color: var(--ok); }
.review-card.open { border-color: var(--accent); }
.step-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.step-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: var(--text); text-decoration: none; box-shadow: var(--shadow);
}
.step-card:hover { border-color: var(--accent); }
.step-card.completed { border-left: 4px solid var(--ok); }
.step-card.in-progress { border-left: 4px solid var(--warn); }
.step-card h3 { margin: 4px 0 0; }
.step-card p { color: var(--muted); font-size: .9rem; margin: 0; flex: 1; }
.sc-top { display: flex; align-items: center; gap: 8px; }
.sc-n { font-size: .82rem; color: var(--muted); flex: 1; }
.sc-count { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.refs { display: flex; flex-direction: column; gap: 6px; }
.foot { color: var(--muted); font-size: .85rem; margin-top: 24px; }
.foot .made-by { border-top: 1px solid var(--line); padding-top: 12px; }
.foot a { color: inherit; }
.notice { border-left: 4px solid var(--warn); }
.notice h2 { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

/* ---- Step page ---- */
.step-head { margin-bottom: 18px; }
.step-head h1 { margin-bottom: 8px; }
.eyebrow { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.step-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 24px; align-items: start; }
.step-layout .checklist { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow-y: auto; }
.step-body > p, .review-details > p { max-width: 68ch; }
.links { display: flex; flex-direction: column; gap: 4px; margin: 18px 0; font-size: .92rem; }
.links > span { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.cl-head { display: flex; justify-content: space-between; align-items: baseline; }
.cl-head span { color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-note { margin: 0; color: var(--muted); font-size: .9rem; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.item.done { border-color: var(--ok); background: var(--ok-soft); }
.item.na { background: var(--surface-2); }
.item.na .item-text { color: var(--muted); }
.item label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.item input[type=checkbox] { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ok); }
.item-text { font-size: .93rem; }
.item-detail { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.cond-tag { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.seg { display: flex; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn {
  flex: 1; font: inherit; font-size: .82rem; padding: 7px 4px; min-height: 36px;
  background: var(--surface); color: var(--text); border: 0; border-right: 1px solid var(--line); cursor: pointer;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { font-weight: 700; background: var(--surface-2); }
.item.done .seg-btn.on { background: var(--ok); color: #fff; }
.item.na .seg-btn.on { background: var(--na); color: #fff; }
.choice { margin-bottom: 12px; }
.choice-label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.toggle-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle-card {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.toggle-card span { font-size: .85rem; color: var(--muted); }
.toggle-card.on { border-color: var(--ok); background: var(--ok-soft); }
.complete-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.complete-row.done span { color: var(--ok); font-weight: 700; flex: 1; }
.hint { color: var(--muted); font-size: .88rem; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.flag {
  background: var(--warn-soft); color: var(--warn); padding: 10px 14px;
  border-radius: 10px; margin-top: 12px; font-weight: 600;
}
.plain { padding-left: 1.2em; }
.prose ul { padding-left: 1.2em; }

/* ---- Review ---- */
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { width: 22px; height: 8px; border-radius: 4px; background: var(--line); }
.dot.on { background: var(--ok); }
.dot.cur { outline: 2px solid var(--accent); outline-offset: 2px; }
.answers { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ans { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: .93rem; }
.ans > span:nth-child(2) { flex: 1; }
.ans em { font-style: normal; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.ans-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 2px; }
.ans.done .ans-ic { background: var(--ok); }
.ans.done em { color: var(--ok); }
.ans.na .ans-ic { background: var(--na); }
.ans.na em { color: var(--na); }
.ans.missing { background: var(--warn-soft); }
.ans.missing .ans-ic { border: 2px solid var(--warn); }
.ans.missing em { color: var(--warn); }
.review-details { margin: 24px 0; }
.summary h2 { margin-top: 16px; }
.summary .row { margin-top: 14px; }

/* ---- Visuals ---- */
.visual { margin: 18px 0; }
.visual figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.rule-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: .93rem; }
.facts { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.facts th, .facts td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts thead th { background: var(--surface-2); font-size: .82rem; }
.facts.fee td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.facts.fee .total td { font-weight: 700; border-bottom: 0; background: var(--ok-soft); }
.fee-empty { padding: 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }

/* passport page */
.passport { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: .78rem; }
.pp-head { display: flex; justify-content: space-between; padding: 6px 10px; background: var(--accent); color: #fff; font-weight: 700; letter-spacing: .05em; }
.pp-body { display: grid; grid-template-columns: 30% 1fr; gap: 10px; padding: 10px; }
.pp-photo { background: var(--surface-2); border-radius: 4px; padding: 4px; align-self: start; }
.pp-photo svg { width: 100%; display: block; }
.pp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.pp-field { display: flex; flex-direction: column; padding: 2px 4px; border-radius: 4px; }
.pp-label { color: var(--muted); font-size: .68rem; }
.pp-value { font-family: ui-monospace, Menlo, monospace; font-weight: 600; overflow-wrap: anywhere; }
.pp-note { font-size: .68rem; color: var(--warn); font-weight: 700; }
.hl { background: var(--hl); box-shadow: 0 0 0 1.5px var(--hl-line); }
.head { fill: var(--line); }

/* photo front */
.photo-front { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.photo-svg { width: 100%; max-width: 300px; height: auto; }
.photo-bg { fill: #fff; stroke: var(--muted); stroke-width: .4; }
.photo-svg .head { fill: #c9c4b8; }
.guide { stroke: var(--accent); stroke-width: .3; stroke-dasharray: 1 1; }
.dim { stroke: var(--text); stroke-width: .35; }
.dim-fill { fill: var(--text); }
.dim-text { font-size: 3.6px; fill: var(--text); font-weight: 600; }
.dim-small { font-size: 2.8px; fill: var(--muted); }

/* photo back */
.photo-backs { display: flex; flex-wrap: wrap; gap: 24px; }
.photo-back-wrap { width: 210px; }
.photo-back {
  aspect-ratio: 50 / 70; background: var(--paper); border: 1px solid var(--line);
  border-radius: 4px; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow);
}
.photo-back.blank { align-items: center; justify-content: center; color: var(--muted); font-style: italic; }
.stamp {
  border: 2px solid var(--ink); color: var(--ink); border-radius: 6px; padding: 8px;
  font-family: ui-monospace, Menlo, monospace; font-size: .7rem; line-height: 1.4;
  transform: rotate(-3deg); opacity: .9;
}
.stamp-name { font-weight: 800; font-size: .76rem; }
.stamp-date { margin-top: 4px; font-weight: 700; }
.photo-back-label { font-weight: 700; margin: 8px 0 4px; }
.ticks { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
.ticks li::before { display: inline-block; width: 1.3em; font-weight: 800; }
.ticks .yes::before { content: "✓"; color: var(--ok); }
.ticks .no::before { content: "✕"; color: var(--accent); }

/* offices, email, files */
.offices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.office { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .9rem; overflow-wrap: anywhere; }
.office-role { font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.office-name { font-weight: 700; margin-bottom: 4px; }
.email { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.email pre { margin: 0 0 10px; white-space: pre-wrap; font: .86rem/1.5 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.files { display: flex; flex-direction: column; gap: 10px; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font-size: .9rem; }
.file > div { flex: 1; }
.file.ok { border-color: var(--ok); }
.file.bad { opacity: .75; }
.file.bad strong { text-decoration: line-through; }
.file-icon { font-size: .7rem; font-weight: 800; background: var(--accent); color: #fff; padding: 10px 6px; border-radius: 4px; }
.badge { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--accent-soft); color: var(--accent); }

/* form mock */
.form-mock { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.form-mock-head { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
.form-mock-head span { font-size: .75rem; color: var(--muted); font-weight: 700; }
.form-mock-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.ff { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); min-width: 0; }
.ff.wide { grid-column: 1 / -1; }
.ff-label { font-size: .7rem; color: var(--muted); font-weight: 600; }
.ff.sign { min-height: 56px; border: 2px solid var(--accent); background: var(--surface); }
.sig { color: var(--accent); font-weight: 700; font-size: .8rem; }

/* references, two columns */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.col ul { margin: 0; padding-left: 1.1em; }
.col.yes { border-top: 4px solid var(--ok); }
.col.no { border-top: 4px solid var(--accent); }

/* package */
.package { display: flex; flex-direction: column; gap: 12px; }
.envelope {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  font-size: .88rem;
}
.env-from { font-size: .8rem; }
.env-to { align-self: center; font-weight: 600; text-align: center; }
.pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.piece {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 12px 8px; border-radius: 10px; border: 2px dashed var(--line); background: var(--surface); font-size: .85rem;
}
.piece svg { width: 36px; height: 36px; margin-bottom: 4px; }
.piece span { color: var(--muted); font-size: .75rem; }
.piece em { font-style: normal; font-weight: 700; font-size: .75rem; color: var(--warn); margin-top: 4px; }
.piece.done { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.piece.done em { color: var(--ok); }
.piece.na { opacity: .5; }
.piece.na em { color: var(--na); }
.piece.keep { flex-direction: row; text-align: left; gap: 10px; }
.piece.keep span { flex: 1; }
.piece.keep svg { margin: 0; }
/* Tappable pieces: the button fills the tile, with an optional "Doesn't apply" below. */
.piece.tap { padding: 0; gap: 0; align-items: stretch; flex-direction: column; }
.piece-main {
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1;
  padding: 12px 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer;
}
.piece.keep .piece-main { flex-direction: row; text-align: left; gap: 10px; padding: 12px 14px; }
.piece-main:hover { background: var(--surface-2); }
.piece.done .piece-main:hover { background: none; }
.piece-na {
  margin: 0 8px 8px; padding: 6px 4px; min-height: 32px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: .75rem; cursor: pointer;
}
.piece-na[aria-pressed=true] { background: var(--na); border-color: var(--na); color: #fff; font-weight: 700; }
.piece.tap.na { opacity: 1; }
.piece.tap.na .piece-main { opacity: .5; }
.ic { fill: var(--surface-2); stroke: var(--text); stroke-width: 1.4; stroke-linejoin: round; }
.ic-line { fill: none; stroke: var(--text); stroke-width: 1.4; stroke-linecap: round; }

/* wait calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 460px; }
.cal-h { font-size: .72rem; color: var(--muted); text-align: center; font-weight: 700; }
.cal-cell { border-radius: 6px; padding: 4px; min-height: 42px; display: flex; flex-direction: column; font-size: .75rem; background: var(--surface); border: 1px solid var(--line); }
.cal-day { color: var(--muted); }
.cal-n { font-weight: 800; text-align: center; }
.cal-cell.out { opacity: .35; }
.cal-cell.wkend { background: var(--surface-2); }
.cal-cell.biz { background: var(--ok-soft); border-color: var(--ok); }
.cal-cell.start { background: var(--warn-soft); border-color: var(--warn); }
.cal-cell.end { background: var(--ok); color: #fff; }
.cal-cell.end .cal-day { color: #fff; }
.estimate { margin-top: 10px; }

/* ---- Narrow screens ---- */
@media (max-width: 1000px) {
  .step-layout { grid-template-columns: 1fr; }
  .step-layout .checklist { position: static; max-height: none; }
}

@media (max-width: 760px) {
  /* The "For Canadians living in Belize" line sits in a strip above the
     title row. The negative sticky offset lets that strip scroll away, so
     only the compact title row stays pinned while reading. */
  :root { --top-h: 52px; --top-strip: 22px; }
  .top { height: calc(var(--top-h) + var(--top-strip)); padding: var(--top-strip) 16px 0; top: calc(-1 * var(--top-strip)); }
  .brand-sub {
    position: absolute; top: 7px; left: 48px; right: 16px;
    line-height: calc(var(--top-strip) - 7px); font-size: .75rem;
    overflow: hidden; text-overflow: ellipsis;
  }
  .brand-t { font-size: .95rem; }
  .leaf { width: 22px; height: 22px; }
  .bar { width: 48px; }
  .layout { grid-template-columns: 1fr; }
  .rail {
    position: sticky; top: var(--top-h); z-index: 5; height: auto;
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line);
    background: var(--bg); scrollbar-width: none;
  }
  .rail-link { flex: none; padding: 6px 10px; }
  .rail-link .rail-t { display: none; }
  .rail-link.active .rail-t { display: inline; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-link.review { margin-top: 0; }
  .main { padding: 18px 16px 48px; }
  h1 { font-size: 1.4rem; }
  .split, .offices, .two-col, .name-form .fields { grid-template-columns: 1fr; }
  .top .who { display: none; }
  .form-mock-body { grid-template-columns: 1fr; }
  .photo-back-wrap { width: calc(50% - 12px); min-width: 140px; }
  .step-nav .btn { flex: 1; font-size: .85rem; }
}
