/* Flue — job book for a stove fitter and sweep.
   One typeface (Bricolage Grotesque, variable), a limestone ground, soot ink,
   brush red for the one thing that matters on each screen. Lists with rules,
   not cards. Everything is legible in daylight on a phone in a van. */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-latin.477b564b86e0.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --ground: #edece7;
  --sheet: #f8f7f4;
  --sheet-strong: #ffffff;
  --ink: #1c1a17;
  --iron: #5e5a53;
  --ash: #8c877d;
  --rule: #d5d2ca;
  --rule-soft: #e3e1da;
  --soot: #1c1a17;
  --soot-ink: #f2efe9;
  --ember: #b4301c;
  --ember-ink: #ffffff;
  --ember-soft: #f6e1dc;
  --brass: #9b7420;
  --brass-soft: #f3e8cc;
  --flue: #3a5a76;
  --flue-soft: #dde6ee;
  --moss: #4a7338;
  --moss-soft: #dfe9d7;
  --focus: #3a5a76;
  --radius: 6px;
  --tap: 44px;
  --nav-h: 60px;
  --rail-w: 176px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Bricolage", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 640; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-stretch: 92%; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75em; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sheet-strong); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--iron); }
.faint { color: var(--ash); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---- chrome ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 var(--gutter);
  background: var(--soot); color: var(--soot-ink);
}
.wordmark { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 720; font-size: 1.3rem; font-stretch: 85%; letter-spacing: -0.01em; }
.wordmark .mark { width: 24px; height: 24px; }
.topbar-business { flex: 1; font-size: 0.9rem; opacity: 0.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; }

.rail {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--sheet-strong); border-top: 1px solid var(--rule);
}
.rail a, .rail button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; font-size: 0.72rem; font-weight: 560; color: var(--iron);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.rail svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail a[aria-current="page"] { color: var(--ink); }
.rail a[aria-current="page"] svg { stroke-width: 2.2; }
.rail .rail-more { display: none; }
.sheet[hidden] { display: none; }
.sheet {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 31;
  background: var(--sheet-strong); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px rgba(28,26,23,0.18);
  padding: 6px; display: grid;
}
.sheet a, .sheet .linklike { display: block; padding: 12px 14px; text-decoration: none; font-weight: 560; border-radius: var(--radius); background: none; border: 0; text-align: left; width: 100%; cursor: pointer; }
.sheet a:hover, .sheet .linklike:hover { background: var(--ground); }
.sheet form { border-top: 1px solid var(--rule-soft); margin-top: 4px; padding-top: 4px; }

.main { padding: 20px var(--gutter) 32px; max-width: 880px; margin: 0 auto; }
.main-wide { max-width: 1180px; }
.main-flush { padding: 0; max-width: none; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .topbar { padding-left: calc(var(--rail-w) + 24px); }
  .rail {
    top: 52px; bottom: auto; right: auto; width: var(--rail-w); height: calc(100vh - 52px);
    display: flex; flex-direction: column; gap: 2px; padding: 16px 10px;
    border-top: 0; border-right: 1px solid var(--rule); background: var(--ground);
  }
  .rail a { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 10px; font-size: 0.95rem; border-radius: var(--radius); }
  .rail a:hover { background: var(--rule-soft); }
  .rail a[aria-current="page"] { background: var(--sheet-strong); }
  .rail svg { width: 20px; height: 20px; }
  .rail .rail-more { display: flex; }
  .rail .rail-toggle { display: none; }
  .sheet { display: none !important; }
  .main { margin-left: var(--rail-w); padding: 28px 32px 48px; max-width: none; }
  .main > * { max-width: 880px; }
  .main-wide > * { max-width: 1180px; }
  .main-flush { padding: 0; margin-left: var(--rail-w); }
  .main-flush > * { max-width: none; }
}

/* ---- flashes ----------------------------------------------------------- */
.flashes { display: grid; gap: 6px; margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: var(--radius); background: var(--moss-soft); color: #234017; font-weight: 520; }
.flash-info { background: var(--flue-soft); color: #22394c; }
.flash-error { background: var(--ember-soft); color: #6b1d10; }

/* ---- page heads -------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .lede { color: var(--iron); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 0.875rem; color: var(--iron); margin-bottom: 6px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--sheet-strong); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--soot-ink); }
.btn-ember { background: var(--ember); border-color: var(--ember); color: var(--ember-ink); }
.btn-ember:hover { background: #941f0f; border-color: #941f0f; color: #fff; }
.btn-soot { background: var(--soot); border-color: var(--soot); color: var(--soot-ink); }
.btn-quiet { border-color: var(--rule); background: transparent; font-weight: 560; }
.btn-quiet:hover { background: var(--sheet-strong); color: var(--ink); border-color: var(--ink); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--sheet-strong); color: var(--ink); }
.btn-ember:disabled:hover { background: var(--ember); color: #fff; }
.linklike { background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; cursor: pointer; }
.linklike:hover { text-decoration-color: currentColor; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---- status pips & badges --------------------------------------------- */
.pip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; padding: 2px 8px 2px 6px; border-radius: 999px; }
.pip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pip-overdue { background: var(--ember-soft); color: #8a2312; }
.pip-due { background: var(--brass-soft); color: #6b4f12; }
.pip-soon { background: var(--flue-soft); color: #2b4760; }
.pip-ok { background: var(--moss-soft); color: #2f4d22; }
.pip-unknown, .pip-none { background: var(--rule-soft); color: var(--iron); }
.pip-booked { background: var(--flue); color: #fff; }
.pip-booked::before { display: none; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: var(--rule-soft); color: var(--iron); white-space: nowrap; vertical-align: middle; }
.tag-flue { background: var(--flue-soft); color: #2b4760; }
.tag-brass { background: var(--brass-soft); color: #6b4f12; }
.tag-ember { background: var(--ember-soft); color: #8a2312; }
.tag-moss { background: var(--moss-soft); color: #2f4d22; }
.tag-ink { background: var(--soot); color: var(--soot-ink); }

/* ---- stat strip (Today) ----------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--sheet-strong); padding: 14px 16px 12px; text-decoration: none; display: block; }
.stat:hover { background: var(--sheet); }
.stat .n { font-size: 2.1rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-stretch: 90%; }
.stat .l { display: block; font-size: 0.875rem; color: var(--iron); margin-top: 6px; }
.stat-ember .n { color: var(--ember); }
.stat-brass .n { color: var(--brass); }
.stat-flue .n { color: var(--flue); }

/* ---- hero: the season --------------------------------------------------- */
.season { background: var(--soot); color: var(--soot-ink); border-radius: 10px; padding: 20px 20px 16px; margin-bottom: 24px; }
.season-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.season h2 { font-size: 1.05rem; font-weight: 600; }
.season .season-big { font-size: 3.4rem; font-weight: 760; line-height: 0.95; letter-spacing: -0.03em; font-stretch: 85%; }
.season .season-big small { display: block; font-size: 0.95rem; font-weight: 500; letter-spacing: 0; font-stretch: 100%; opacity: 0.75; margin-top: 6px; }
.season-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 84px; margin-top: 18px; }
.season-bars .bar { position: relative; background: rgba(242,239,233,0.28); border-radius: 3px 3px 0 0; min-height: 3px; }
.season-bars .bar.now { background: var(--ember); }
.season-bars .bar.next { background: rgba(242,239,233,0.6); }
.season-bars .bar span { position: absolute; left: 0; right: 0; bottom: 100%; text-align: center; font-size: 0.72rem; padding-bottom: 3px; font-weight: 600; }
.season-labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; font-size: 0.72rem; opacity: 0.7; margin-top: 6px; text-align: center; }
.season-foot { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 0.875rem; opacity: 0.85; }
.season-foot a { color: inherit; }

/* ---- lists ------------------------------------------------------------- */
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head h2 { font-size: 1.05rem; }
.section-head .more { font-size: 0.875rem; color: var(--iron); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list > li { border-bottom: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  min-height: 56px; padding: 10px 0; text-decoration: none;
}
a.row:hover .row-title { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.row-title { font-weight: 600; }
.row-sub { font-size: 0.875rem; color: var(--iron); grid-column: 1; }
.row-side { grid-column: 2; grid-row: 1 / span 2; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-lead { grid-column: 1; grid-row: 1 / span 2; }
.row-check { display: grid; grid-template-columns: auto 1fr auto; }
.row-check .row-title, .row-check .row-sub { grid-column: 2; }
.row-check .row-side { grid-column: 3; }
.row-check input[type="checkbox"] { width: 22px; height: 22px; margin: 0 4px 0 0; grid-column: 1; grid-row: 1 / span 2; accent-color: var(--ember); }
.group-head { font-weight: 700; font-size: 0.95rem; padding: 18px 0 6px; display: flex; justify-content: space-between; align-items: baseline; }
.group-head .count { color: var(--iron); font-weight: 500; font-size: 0.875rem; }
.empty { padding: 28px 16px; text-align: center; color: var(--iron); border: 1px dashed var(--rule); border-radius: 8px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---- filters ----------------------------------------------------------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet-strong); text-decoration: none; font-size: 0.875rem; font-weight: 560; color: var(--iron); }
.chip[aria-current="true"], .chip.on { background: var(--ink); border-color: var(--ink); color: var(--soot-ink); }
.chip .count { margin-left: 6px; opacity: 0.7; }
.filters select, .filters input[type="search"] { min-height: 38px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 10px; background: var(--sheet-strong); }
.filters input[type="search"] { flex: 1; min-width: 160px; }
.batchbar { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 14px; background: var(--sheet-strong); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 8px 24px rgba(28,26,23,0.12); }
@media (min-width: 900px) { .batchbar { bottom: 12px; } }
.batchbar label { display: flex; align-items: center; gap: 8px; font-weight: 560; }
.batchbar input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--ember); }

/* ---- detail pages ------------------------------------------------------- */
.cols { display: grid; gap: 24px; }
@media (min-width: 760px) { .cols { grid-template-columns: 1fr 1fr; align-items: start; } .cols-13 { grid-template-columns: 1.4fr 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 0.95rem; }
.kv dt { color: var(--iron); }
.kv dd { margin: 0; }
.panel { background: var(--sheet-strong); border: 1px solid var(--rule); border-radius: 8px; padding: 16px; }
.panel h2, .panel h3 { margin-bottom: 10px; }
.panel-soot { background: var(--soot); color: var(--soot-ink); border-color: var(--soot); }
.panel-soot a { color: inherit; }
.panel-ember { border-color: var(--ember); border-width: 2px; }
.appliance { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.appliance:first-child { border-top: 1px solid var(--rule); }
.appliance .name { font-weight: 640; font-size: 1.05rem; }
.appliance .meta { font-size: 0.875rem; color: var(--iron); }
.appliance .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.appliance .side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 76px 1fr auto; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); align-items: baseline; }
.timeline .when { color: var(--iron); font-size: 0.875rem; }
.timeline .what a { text-decoration: none; font-weight: 600; }
.timeline .what a:hover { text-decoration: underline; }
.timeline .what .sub { display: block; font-size: 0.875rem; color: var(--iron); }
.timeline .amt { font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.access { background: var(--brass-soft); border-radius: var(--radius); padding: 10px 12px; font-size: 0.95rem; }
.access strong { display: block; font-size: 0.8125rem; color: #6b4f12; margin-bottom: 2px; }

/* ---- forms ------------------------------------------------------------- */
.form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 5px; }
.field label, .field > .lbl { font-weight: 600; font-size: 0.9rem; }
.field .help { font-size: 0.8125rem; color: var(--iron); }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet-strong);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(58,90,118,0.2); }
.field.check { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.field.check input { width: 22px; height: 22px; accent-color: var(--ink); margin: 0; }
.field .errorlist { margin: 0; padding: 0; list-style: none; color: var(--ember); font-size: 0.875rem; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span { grid-column: 1 / -1; } }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
fieldset legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: 10px; }

/* ---- on-site report ------------------------------------------------------ */
.check { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.check-top { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.check .lbl { font-weight: 600; }
.check .hint { font-size: 0.8125rem; color: var(--iron); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--sheet-strong); }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 36px; padding: 0 10px; font-size: 0.8125rem; font-weight: 600; color: var(--iron); cursor: pointer; border-right: 1px solid var(--rule); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--ink); color: var(--soot-ink); }
.seg input[value="advise"]:checked + span { background: var(--brass); color: #fff; }
.seg input[value="fail"]:checked + span { background: var(--ember); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.check-note { margin-top: 8px; }
.check-note input { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--radius); }
.rec-line { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.rec-line input[type="text"], .rec-line input[type="number"] { min-height: 40px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--radius); width: 100%; }
.rec-line label { font-size: 0.8125rem; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); background: var(--ground); padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--rule); margin-top: 16px; z-index: 5; }
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }

/* ---- diary --------------------------------------------------------------- */
.diary-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.day { border-top: 1px solid var(--rule); padding: 10px 0 14px; display: grid; grid-template-columns: 64px 1fr; gap: 12px; }
.day.today { background: linear-gradient(90deg, var(--brass-soft), transparent 60%); margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.day .date { line-height: 1.1; }
.day .date .dow { display: block; font-size: 0.75rem; color: var(--iron); font-weight: 600; }
.day .date .dom { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.day.weekend .date { color: var(--ash); }
.day .load { font-size: 0.75rem; color: var(--iron); margin-top: 4px; }
.day .jobs { display: grid; gap: 6px; }
.job-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--sheet-strong); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; }
.job-card:hover { border-color: var(--ink); }
.job-card .slot { font-size: 0.75rem; font-weight: 700; color: var(--iron); }
.job-card .t { font-weight: 600; }
.job-card .s { font-size: 0.8125rem; color: var(--iron); display: block; }
.job-card.done { opacity: 0.6; }
.job-card.progress { border-color: var(--brass); background: var(--brass-soft); }
.day .none { color: var(--ash); font-size: 0.875rem; padding-top: 6px; }
.day .none a { color: var(--iron); }

/* ---- reminders ---------------------------------------------------------- */
.msg { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.msg-head .to { font-weight: 640; }
.msg-head .to a { text-decoration: none; }
.msg-body { background: var(--sheet-strong); border: 1px solid var(--rule); border-radius: 12px 12px 12px 3px; padding: 10px 14px; font-size: 0.95rem; max-width: 560px; white-space: pre-line; }
.msg-body.letter { border-radius: 4px; font-size: 0.875rem; }
.msg-reply { background: var(--moss-soft); border-radius: 12px 12px 3px 12px; padding: 8px 14px; font-size: 0.95rem; max-width: 420px; justify-self: end; }
.msg-reply.cancel { background: var(--rule-soft); }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msg-head label { display: flex; align-items: center; gap: 8px; }
.msg-head input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ember); }

/* ---- insights --------------------------------------------------------------- */
.chart { margin: 8px 0 4px; }
.chart .bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 140px; border-bottom: 1px solid var(--rule); }
.chart .col { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-items: end; height: 100%; }
.chart .b { border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .b.prev { background: var(--rule); }
.chart .b.cur { background: var(--flue); }
.chart .b.cur.future { background: transparent; }
.chart .labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; font-size: 0.72rem; color: var(--iron); text-align: center; margin-top: 4px; }
.legend { display: flex; gap: 16px; font-size: 0.8125rem; color: var(--iron); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--flue); }
.legend .prev::before { background: var(--rule); }
.hbar { display: grid; grid-template-columns: 140px 1fr 48px; gap: 10px; align-items: center; padding: 6px 0; font-size: 0.95rem; }
.hbar .track { height: 10px; background: var(--rule-soft); border-radius: 3px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--flue); border-radius: 3px; }
.hbar .v { text-align: right; color: var(--iron); font-size: 0.875rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.table th { font-weight: 600; color: var(--iron); font-size: 0.8125rem; }
.table td.r, .table th.r { text-align: right; }

/* ---- map -------------------------------------------------------------------- */
.map-wrap { position: relative; height: calc(100vh - 52px - var(--nav-h)); }
@media (min-width: 900px) { .map-wrap { height: calc(100vh - 52px); } }
#map { position: absolute; inset: 0; }
.map-key { position: absolute; z-index: 500; left: 12px; bottom: 12px; background: var(--sheet-strong); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; font-size: 0.8125rem; display: grid; gap: 4px; }
.map-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.map-list { position: absolute; z-index: 500; right: 12px; top: 12px; width: 168px; max-height: 38%; overflow: auto; background: var(--sheet-strong); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; font-size: 0.875rem; }
.map-list h2 { font-size: 0.85rem; margin-bottom: 4px; }
@media (min-width: 900px) { .map-list { width: 240px; max-height: 50%; } }
.map-list button { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; padding: 6px 0; border-top: 1px solid var(--rule-soft); cursor: pointer; text-align: left; }
.map-list button:hover { color: var(--ember); }
.leaflet-popup-content { font: inherit; font-size: 0.875rem; }
.leaflet-popup-content a { font-weight: 600; }
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,0.3); }
.pin.overdue { background: var(--ember); }
.pin.due { background: var(--brass); }
.pin.soon { background: var(--flue); }
.pin.ok { background: var(--moss); }
.pin.none { background: var(--ash); }
.pin.booked { box-shadow: 0 0 0 2px var(--ink); }

/* ---- login -------------------------------------------------------------- */
.login { min-height: calc(100vh - 52px); display: grid; place-items: center; padding: 24px var(--gutter); }
.login .panel { width: 100%; max-width: 380px; padding: 24px; }
.login h1 { margin-bottom: 4px; }
.demo-note { margin-top: 16px; padding: 10px 12px; background: var(--brass-soft); border-radius: var(--radius); font-size: 0.875rem; }
.demo-note code { font-family: inherit; font-weight: 700; }

/* ---- public passport ---------------------------------------------------- */
.passport { max-width: 640px; margin: 0 auto; padding: 24px var(--gutter) 48px; }
.passport-head { padding: 8px 0 20px; border-bottom: 2px solid var(--ink); margin-bottom: 20px; }
.passport-head .from { font-size: 0.875rem; color: var(--iron); }
.passport-head h1 { margin-top: 8px; }
.passport-head .addr { color: var(--iron); }
.passport .due-now { background: var(--soot); color: var(--soot-ink); border-radius: 10px; padding: 16px 18px; margin-bottom: 20px; display: grid; gap: 10px; }
.passport .due-now .btn { justify-self: start; }
.passport .cert-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .job-card, .seg span { transition: background-color 120ms, color 120ms, border-color 120ms; }
}
@media print {
  .topbar, .rail, .sheet, .batchbar, .sticky-actions { display: none !important; }
  body { background: #fff; padding: 0; }
  .main { margin: 0; padding: 0; }
}
