/* ---------------------------------------------------------------------------
   Old Lyme CRS Application Builder
   Palette: chart-paper cool gray-green, sound-water navy ink, tidal teal,
   marsh amber for attention, signal red for blockers only.
   Type: Archivo (display) · Public Sans (body) · IBM Plex Mono (codes/figures)
   Signature: staff-gauge point meters.
--------------------------------------------------------------------------- */

:root {
  --paper: #eff3f1;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --ink: #14313b;
  --ink-soft: #2c4a54;
  --muted: #5b7078;
  --line: #cbd8d3;
  --line-soft: #dfe8e4;
  --tide: #16756a;
  --tide-deep: #0e5a51;
  --tide-bright: #3fa394;
  --tide-wash: #e2efec;
  --gold: #b9861f;
  --gold-wash: #f6eeda;
  --flag: #a4432c;
  --flag-wash: #f6e6e0;
  --slate: #7d8f96;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 49, 59, 0.06), 0 8px 24px rgba(20, 49, 59, 0.07);
  --display: "Archivo", sans-serif;
  --body: "Public Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

a { color: var(--tide-deep); }

/* ---- masthead ---- */

.masthead {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='140' viewBox='0 0 420 140'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1'%3E%3Cpath d='M-10 28 C 60 12, 130 44, 210 30 S 360 10, 430 26'/%3E%3Cpath d='M-10 58 C 70 40, 150 74, 230 58 S 370 40, 430 56'/%3E%3Cpath d='M-10 88 C 60 72, 140 104, 220 88 S 360 70, 430 86'/%3E%3Cpath d='M-10 118 C 80 100, 160 132, 240 116 S 370 100, 430 116'/%3E%3C/g%3E%3C/svg%3E") repeat,
    linear-gradient(180deg, #0f2831 0%, var(--ink) 78%, #122d37 100%);
  color: #e9f1ee;
  border-bottom: 3px solid var(--tide);
  box-shadow: inset 0 -18px 30px -22px rgba(0, 0, 0, 0.55);
}

.mast-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.mast-brand .crest {
  flex: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 0;
}

.mast-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.wordmark .thin { font-weight: 400; opacity: 0.75; }

.mast-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: #a9c2bc;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mast-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #cfe0db;
}

.mast-user .role-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid #3f5c66;
  border-radius: 999px;
  padding: 2px 9px;
  color: #a9c2bc;
}

/* ---- nav tabs ---- */

.tabs {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tab {
  appearance: none;
  background: transparent;
  border: none;
  color: #a9c2bc;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 16px 12px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}

.tab:hover { color: #ffffff; }
.tab.active { color: #ffffff; border-bottom-color: var(--gold); }

/* ---- layout ---- */

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }

h2.page-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.01em;
  margin: 0 0 4px;
}

.page-sub { color: var(--muted); margin: 0 0 24px; max-width: 74ch; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.panel + .panel { margin-top: 18px; }

.panel h3 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

/* ---- buttons & inputs ---- */

.btn {
  appearance: none;
  border: 1px solid var(--tide-deep);
  background: var(--tide);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

.btn:hover { background: var(--tide-deep); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn.ghost {
  background: transparent;
  color: var(--tide-deep);
  border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--tide); background: var(--tide-wash); }

.btn.danger { background: transparent; border-color: var(--line); color: var(--flag); }
.btn.danger:hover { background: var(--flag-wash); border-color: var(--flag); }

.btn.small { font-size: 12.5px; padding: 5px 11px; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 8px 10px;
  color: var(--ink);
}

input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 1px;
}

textarea { resize: vertical; min-height: 64px; }

label.field {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > div { flex: 1 1 180px; }

/* ---- login ---- */

.login-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='190' viewBox='0 0 1200 190' preserveAspectRatio='none'%3E%3Cpath d='M0 88 C 180 58, 340 118, 540 92 S 900 52, 1200 86 L 1200 190 L 0 190 Z' fill='%2316756a' fill-opacity='0.10'/%3E%3Cpath d='M0 120 C 200 92, 380 150, 600 124 S 960 88, 1200 118 L 1200 190 L 0 190 Z' fill='%2316756a' fill-opacity='0.14'/%3E%3Cpath d='M0 152 C 220 128, 420 176, 640 154 S 980 124, 1200 148 L 1200 190 L 0 190 Z' fill='%2314313b' fill-opacity='0.16'/%3E%3C/svg%3E") bottom / 100% 190px no-repeat,
    linear-gradient(180deg, #f6f9f7 0%, var(--paper) 60%, #e6eeea 100%);
  padding: 40px 24px 60px;
}

.login-hero {
  text-align: center;
}

.login-hero .crest {
  filter: drop-shadow(0 3px 8px rgba(20, 49, 59, 0.25));
}

.login-town {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 12px;
}

.login-board {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--tide);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 30px 26px;
}

.login-card .wordmark { color: var(--ink); font-size: 19px; }
.login-card .login-sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin: 4px 0 22px;
}

.login-card .field-stack > div { margin-bottom: 14px; }

.error-note {
  background: var(--flag-wash);
  border: 1px solid #dcb4a7;
  color: var(--flag);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

/* ---- status pills ---- */

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill.not_started  { background: #edf1f0; color: var(--slate); border-color: var(--line); }
.pill.investigating{ background: var(--gold-wash); color: #8a6212; border-color: #e3cf9d; }
.pill.in_progress  { background: var(--gold-wash); color: #8a6212; border-color: #e3cf9d; }
.pill.docs_ready   { background: var(--tide-wash); color: var(--tide-deep); border-color: #b7d8d1; }
.pill.submitted    { background: var(--ink); color: #ffffff; }
.pill.not_pursuing { background: #f0f0ee; color: #9aa39f; border-color: var(--line); text-decoration: line-through; }

.pill.todo    { background: #edf1f0; color: var(--slate); border-color: var(--line); }
.pill.doing   { background: var(--gold-wash); color: #8a6212; border-color: #e3cf9d; }
.pill.done    { background: var(--tide-wash); color: var(--tide-deep); border-color: #b7d8d1; }
.pill.blocked { background: var(--flag-wash); color: var(--flag); border-color: #dcb4a7; }

/* ---- staff gauge (signature element) ---- */

.gauge {
  position: relative;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    repeating-linear-gradient(90deg,
      transparent 0, transparent calc(5% - 1px),
      var(--line-soft) calc(5% - 1px), var(--line-soft) 5%),
    linear-gradient(180deg, #ffffff 0%, #f4f8f6 100%);
  overflow: hidden;
}

.gauge .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background:
    repeating-linear-gradient(-55deg,
      rgba(255, 255, 255, 0.10) 0, rgba(255, 255, 255, 0.10) 6px,
      transparent 6px, transparent 14px),
    linear-gradient(180deg, var(--tide-bright) 0%, var(--tide) 45%, var(--tide-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 1px 0 0 rgba(14, 90, 81, 0.6);
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge .mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink);
}

.gauge .mark.gold { background: var(--gold); }

.gauge-labels {
  position: relative;
  height: 18px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.gauge-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.mini-gauge {
  height: 8px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg,
      transparent 0, transparent calc(25% - 1px),
      var(--line) calc(25% - 1px), var(--line) 25%),
    var(--line-soft);
  overflow: hidden;
  position: relative;
}

.mini-gauge .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--tide);
  transition: width 500ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .gauge .fill, .mini-gauge .fill { transition: none; }
}

/* ---- dashboard ---- */

.hero-figures {
  display: flex;
  align-items: flex-end;
  gap: 34px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hero-figures .big {
  font-family: var(--mono);
  font-size: 52px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.hero-figures .big .of { font-size: 20px; color: var(--muted); font-weight: 400; }

.hero-figures .fig-label {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-top: 6px;
}

.hero-figures .stat { min-width: 130px; }
.hero-figures .stat .val { font-family: var(--mono); font-size: 26px; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

table.plain { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.plain th {
  text-align: left;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
}
table.plain td { border-bottom: 1px solid var(--line-soft); padding: 8px; vertical-align: top; }
table.plain tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); }

.log-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.log-list li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 10px; }
.log-list li:last-child { border-bottom: none; }
.log-list .when { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 86px; padding-top: 2px; }

.blocker-list { list-style: none; margin: 0; padding: 0; }
.blocker-list li {
  border-left: 3px solid var(--flag);
  background: var(--flag-wash);
  border-radius: 0 7px 7px 0;
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
}

/* ---- activities grid ---- */

.series-head {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
  margin: 30px 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  position: relative;
}

.series-head::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 46px;
  height: 2px;
  background: var(--gold);
}

.series-head .series-pts { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.act-card {
  background: linear-gradient(180deg, #ffffff 0%, #fdfefd 100%);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: box-shadow 140ms ease, border-color 140ms ease, transform 140ms ease;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.act-card:hover { border-color: var(--tide); border-top-color: var(--tide); box-shadow: var(--shadow); transform: translateY(-1px); }

.act-card .code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--tide-deep);
  letter-spacing: 0.04em;
}

.act-card .name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

.act-card .card-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.act-card .points {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.act-card .points b { color: var(--ink); font-weight: 600; }

.act-card .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

/* ---- activity detail ---- */

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head .titles .code { font-family: var(--mono); color: var(--tide-deep); font-weight: 600; font-size: 13px; }
.detail-head h2 { font-family: var(--display); font-weight: 800; font-size: 27px; margin: 2px 0 0; }

.crumb {
  appearance: none; background: none; border: none; padding: 0;
  color: var(--tide-deep); font-weight: 600; cursor: pointer; font-size: 13.5px; margin-bottom: 12px;
}
.crumb:hover { text-decoration: underline; }

.elements-table td:first-child { font-family: var(--mono); font-size: 12px; white-space: nowrap; color: var(--tide-deep); }
.elements-table .q { max-width: 420px; }
.elements-table .doc-need { font-size: 12px; color: var(--muted); }
.elements-table select { width: auto; min-width: 128px; font-size: 13px; padding: 5px 8px; }
.elements-table input.pts { width: 76px; text-align: right; font-family: var(--mono); }
.elements-table input.owner { min-width: 120px; font-size: 13px; }
.elements-table textarea.el-notes { min-height: 44px; font-size: 13px; }

.docs-list { list-style: none; margin: 0; padding: 0; }
.docs-list li {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 8px;
  background: var(--panel-2);
}
.docs-list .fname { font-weight: 600; overflow-wrap: anywhere; }
.docs-list .fmeta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.docs-list .spacer { flex: 1; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 9px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--panel-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--tide); color: var(--tide-deep); background: var(--tide-wash); }

.savebar {
  position: sticky;
  bottom: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  margin-left: auto;
  width: fit-content;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
}
.savebar .unsaved {
  align-self: center;
  font-size: 12.5px;
  font-family: var(--mono);
  color: var(--gold);
}

/* ---- readiness ---- */

.ready-group { margin-bottom: 26px; }
.ready-group-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 5px; margin-bottom: 10px;
}
.ready-group-head h3 { margin: 0; font-family: var(--display); font-size: 13.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.ready-group-head .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.ready-item {
  display: grid;
  grid-template-columns: 118px 1fr 190px;
  gap: 14px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
}
.ready-item:last-child { border-bottom: none; }
.ready-item .label { font-weight: 600; }
.ready-item .note { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ready-item .owner { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.ready-item button.pill { cursor: pointer; }
@media (max-width: 720px) { .ready-item { grid-template-columns: 100px 1fr; } .ready-item .owner { grid-column: 2; } }

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

.user-table td { vertical-align: middle; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 60;
}
.toast.err { background: var(--flag); }

.footnote { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---- point tiers ---- */

.t-earned  { color: var(--tide-deep); }
.t-pending { color: var(--tide); }
.t-likely  { color: #8f6a19; }

/* These paint the tier segments inside the gauges, so they have to out-rank
   the base `.gauge .fill` and `.mini-gauge .fill` backgrounds above — a bare
   `.seg-*` selector loses to those on specificity, which renders all three
   segments in the same teal and makes a mixed bar read as all Earned. The
   plain selectors stay for the legend dots. */
.seg-earned,
.gauge .fill.seg-earned,
.mini-gauge .fill.seg-earned {
  background: linear-gradient(180deg, #0f6d61 0%, var(--tide-deep) 100%);
}
.seg-pending,
.gauge .fill.seg-pending,
.mini-gauge .fill.seg-pending {
  background:
    repeating-linear-gradient(-55deg, rgba(255,255,255,0.14) 0, rgba(255,255,255,0.14) 6px, transparent 6px, transparent 14px),
    linear-gradient(180deg, var(--tide-bright) 0%, var(--tide) 100%);
}
.seg-likely,
.gauge .fill.seg-likely,
.mini-gauge .fill.seg-likely {
  background:
    repeating-linear-gradient(-55deg, rgba(255,255,255,0.35) 0, rgba(255,255,255,0.35) 5px, transparent 5px, transparent 11px),
    linear-gradient(180deg, #d7a63c 0%, var(--gold) 100%);
}

.gauge .fill { position: absolute; top: 0; bottom: 0; transition: width 700ms cubic-bezier(0.22,1,0.36,1), left 700ms cubic-bezier(0.22,1,0.36,1); }
.mini-gauge .fill { position: absolute; top: 0; bottom: 0; }
.mini-gauge { position: relative; overflow: hidden; }

.tier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.tier-legend .dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
}

.hero-figures .stat.tier-earned .val  { color: var(--tide-deep); }
.hero-figures .stat.tier-pending .val { color: var(--tide); }
.hero-figures .stat.tier-likely .val  { color: #8f6a19; }

.tier-line {
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.tier-line b, .tier-line span { font-weight: 600; }

.tier-inputs .field.t-earned  { color: var(--tide-deep); }
.tier-inputs .field.t-pending { color: var(--tide); }
.tier-inputs .field.t-likely  { color: #8f6a19; }

.tier-sel { min-width: 96px; font-size: 12.5px; }
.tier-sel.t-earned  { color: var(--tide-deep); font-weight: 600; }
.tier-sel.t-pending { color: var(--tide); font-weight: 600; }
.tier-sel.t-likely  { color: #8f6a19; font-weight: 600; }

/* ---- application packet ---- */

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.page-actions .page-title { margin-bottom: 0; }

.app-print-head { display: none; }

.binder-table .doc-need { margin-bottom: 4px; }
.binder-gap td { background: #fdf2ee; }
.warn-text { color: var(--flag); font-weight: 700; }

/* ---- program maintenance ---- */

.maint-table td { vertical-align: top; }
.maint-table .cadence { font-family: var(--mono); font-size: 11.5px; color: var(--muted); max-width: 210px; }

.pill-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.pill-btn:disabled { cursor: default; }
.pill-btn.m-todo    { color: var(--muted); }
.pill-btn.m-doing   { color: #8f6a19; border-color: #e3cfa0; background: #fbf4e4; }
.pill-btn.m-done    { color: var(--tide-deep); border-color: #bcd9d3; background: var(--tide-wash); }
.pill-btn.m-blocked { color: var(--flag); border-color: #e5bdb1; background: #fdf0eb; }

.prose-note { font-size: 14px; line-height: 1.65; color: var(--ink-soft); margin: 0; max-width: 75ch; }

/* ---- print: the Application tab becomes the packet ---- */

@media print {
  body { background: #fff; }
  .masthead, .tabs, .no-print, .savebar, .toast { display: none !important; }
  .wrap, main { max-width: none; margin: 0; padding: 0; }
  .panel { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; margin-top: 12px; }
  .app-print-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--ink);
    margin-bottom: 6px;
  }
  .aph-title { font-family: var(--display); font-weight: 700; font-size: 19px; }
  .aph-sub { font-family: var(--mono); font-size: 11px; color: #444; margin-top: 3px; }
  .binder-gap td { background: #f6e4de !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- credit calculator & scoring reference ---- */

.calc-panel .calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}
.calc-val {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.ia-box {
  margin: 14px 0 10px;
  padding: 12px 14px;
  background: var(--tide-wash);
  border-left: 3px solid var(--tide);
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.mono-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  background: #fff;
  border: 1px solid #bcd9d3;
  border-radius: 4px;
  padding: 1px 7px;
  margin: 0 3px;
}

.pts-cell .of-max {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.calc-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tide);
  margin-top: 3px;
  white-space: nowrap;
}
.calc-hint.match { color: var(--muted); }
.link-btn {
  border: none;
  background: none;
  padding: 0 0 0 5px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}

.rule-box { margin-bottom: 7px; }
.rule-box summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tide);
  letter-spacing: 0.02em;
}
.rule-box summary::marker { color: var(--gold); }
.rule-box .cite { color: var(--muted); }
.rule-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: #f7faf9;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 8px 10px;
  margin-top: 6px;
}
.rule-calc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tide-deep);
  margin-top: 5px;
}

/* keep the sticky savebar from covering the last lines of a panel */
main { padding-bottom: 76px; }

/* ---- Manual reference modal ---- */

.el-label { white-space: nowrap; }
.ref-btn {
  display: block;
  margin-top: 5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--tide);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  border-radius: 4px;
  padding: 2px 7px;
  cursor: pointer;
}
.ref-btn:hover { border-color: var(--tide); background: var(--tide-wash); }

.ref-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 40, 49, 0.55);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
}
.ref-modal {
  background: var(--paper);
  border-radius: var(--radius);
  border-top: 4px solid var(--gold);
  box-shadow: 0 24px 70px rgba(10, 30, 38, 0.45);
  width: min(860px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.ref-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.ref-head h3 { margin: 4px 0 0; font-family: var(--display); font-size: 17px; }
.ref-kicker {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ref-body { padding: 16px 22px 20px; overflow-y: auto; }
.ref-fact {
  background: var(--tide-wash);
  border-left: 3px solid var(--tide);
  border-radius: 0 6px 6px 0;
  padding: 10px 13px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.ref-sec { border: 1px solid var(--line); border-radius: 7px; margin-bottom: 9px; background: #fff; }
.ref-sec summary {
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.ref-sec[open] summary { border-bottom: 1px solid var(--line-soft); }
.ref-sec summary::marker { color: var(--gold); }
.ref-text {
  padding: 12px 16px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-height: 46vh;
  overflow-y: auto;
}
.ref-text p { margin: 0 0 0.7em; }
.ref-text p:last-child { margin-bottom: 0; }
.ref-prov { border-left: 3px solid var(--line); padding-left: 10px; margin-top: 12px; }
.ref-prov.ok { border-left-color: var(--tide, #2b7a78); }
.ref-prov.warn { border-left-color: var(--gold, #b8860b); }
@media print { .ref-overlay { display: none !important; } }

/* ---- admin: export the record ---- */

.export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--tide-wash);
  border-left: 3px solid var(--tide);
  border-radius: 0 6px 6px 0;
}
.export-row .check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 62ch;
  cursor: pointer;
}
.export-row .check input { margin-top: 2px; flex: none; }

/* ---- reports ---- */

.report-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 860px) { .report-list { grid-template-columns: 1fr; } }

.report-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-card h3 { margin-bottom: 0; }

.report-card .footnote { max-width: none; }

.report-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-scope .field { margin: 0; white-space: nowrap; }

.report-scope select {
  flex: 1;
  min-width: 200px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.report-card .check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}

.report-card .check input { margin-top: 3px; flex: none; }

.report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.report-actions .btn[disabled] { opacity: 0.6; cursor: progress; }

/* ===========================================================================
   Version 2: sign-in and portal, support desk, assignments, program calendar,
   registers, points history. Same palette and type as everything above.
=========================================================================== */

input[type="email"], input[type="date"], input[type="tel"], input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 8px 10px;
  color: var(--ink);
}
input[type="date"] { font-family: var(--mono); font-size: 13px; }
input[type="file"] { font-size: 13px; max-width: 100%; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- masthead additions ---- */

.mast-name {
  appearance: none;
  background: transparent;
  border: none;
  color: #e9f1ee;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
  border-bottom: 1px dotted #6f8b93;
}
.mast-name:hover { color: #ffffff; border-bottom-color: #ffffff; }

.tab-badge {
  display: inline-block;
  min-width: 18px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 999px;
  background: #2f4c56;
  color: #e9f1ee;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
}
.tab-badge.flag { background: var(--flag); color: #ffffff; }

.site-foot {
  max-width: 1180px;
  margin: -40px auto 0;
  padding: 0 24px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- due dates ---- */

.due {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  border-radius: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: #f3f6f5;
  color: var(--ink-soft);
  white-space: nowrap;
}
.due.overdue { background: var(--flag-wash); border-color: #dcb4a7; color: var(--flag); font-weight: 600; }
.due.soon { background: var(--gold-wash); border-color: #e3cf9d; color: #8a6212; }
.due.none { background: transparent; border-style: dashed; color: var(--slate); }
.due.done { background: transparent; color: var(--slate); text-decoration: line-through; }

/* ---- chips ---- */

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { border-color: var(--tide); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.chip:focus-visible { outline: 2px solid var(--tide); outline-offset: 1px; }
.chip-search { flex: 1 1 220px; max-width: 320px; border-radius: 999px !important; padding: 6px 14px !important; font-size: 13px; }
.chip-select { width: auto; border-radius: 999px; padding: 6px 30px 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ---- dialogs and forms ---- */

.ref-modal.narrow { max-width: 560px; }
.ref-modal.wide { max-width: 860px; }
.form-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.form-grid > .full { flex: 1 1 100%; }
.form-grid > .half { flex: 1 1 calc(50% - 7px); min-width: 210px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.form-actions .spacer, .spacer { flex: 1 1 auto; }
.form-modal .error-note { margin: 14px 0 0; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { margin-top: 3px; flex: none; width: auto; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.radio input { width: auto; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; padding: 6px 0; }
.field-aside { text-transform: none; letter-spacing: 0; font-weight: 400; }

.ok-note {
  background: var(--tide-wash);
  border: 1px solid #b7d8d1;
  color: var(--tide-deep);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.hint-note {
  background: var(--gold-wash);
  border: 1px solid #e3cf9d;
  color: #6f4f0e;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.panel.notice { border-left: 4px solid var(--gold); background: #fffdf7; }
.panel.notice + .grid-2, .panel.notice + .panel { margin-top: 18px; }

/* ---- the front door ---- */

.login-stage.landing { justify-content: center; }
.landing-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 48px;
  align-items: center;
  width: 100%;
  max-width: 980px;
}
.landing-left .login-hero { text-align: left; }
.landing-blurb { margin-top: 26px; max-width: 46ch; }
.landing-blurb h2 { font-family: var(--display); font-weight: 800; font-size: 25px; line-height: 1.2; margin: 0 0 10px; }
.landing-blurb p { color: var(--ink-soft); margin: 0 0 12px; }
.landing-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.landing-foot { font-size: 12.5px; color: var(--muted); margin: 0; text-align: center; }
@media (max-width: 860px) {
  .landing-cols { grid-template-columns: 1fr; gap: 28px; justify-items: center; }
  .landing-left .login-hero { text-align: center; }
  .landing-blurb { text-align: center; }
  .landing-links { justify-content: center; }
}
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 0; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--slate); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.terms-check { margin: 4px 0 16px; font-size: 13px; color: var(--ink-soft); }

.login-card.wide { max-width: 780px; }
.terms-scroll {
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--panel-2);
  margin-bottom: 16px;
}
.terms-text h4 { font-family: var(--display); font-size: 14.5px; font-weight: 700; margin: 20px 0 6px; }
.terms-text h4:first-of-type { margin-top: 16px; }
.terms-text p, .terms-text li { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
.terms-text p { margin: 0 0 10px; }
.terms-text ul { margin: 0 0 10px; padding-left: 20px; }
.terms-summary {
  background: var(--tide-wash);
  border: 1px solid #b7d8d1;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13.5px;
}
.terms-summary ul { margin: 6px 0 8px; padding-left: 20px; }
.terms-summary li { color: var(--ink); }
.terms-summary span { font-size: 12px; color: var(--muted); }

.contact-card {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 13.5px;
  line-height: 1.6;
}
.topic-list, .how-list { margin: 0; padding-left: 20px; }
.topic-list li, .how-list li { margin-bottom: 9px; line-height: 1.5; }
.service-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.service-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 20px; margin-top: 6px; }

/* ---- small shared pieces ---- */

.hero-figures.compact { gap: 20px 30px; margin-bottom: 10px; }
.hero-figures.compact .stat .val { font-size: 24px; }
.hero-figures .stat.flagged .val { color: var(--flag); }
.mini-list { list-style: none; margin: 4px 0 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.mini-list li:last-child { border-bottom: none; }
.role-key { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 22px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.role-key b { display: block; color: var(--ink-soft); font-size: 12.5px; }
table.rowlink tbody tr { cursor: pointer; }
table.rowlink tbody tr:hover td { background: var(--panel-2); }
table.rowlink tbody tr:focus-visible { outline: 2px solid var(--tide); outline-offset: -2px; }
.el-docs { margin-top: 5px; font-family: var(--mono); font-size: 10.5px; color: var(--tide-deep); }
.elements-table .owner-cell { min-width: 150px; }
.elements-table input.el-due { margin-top: 5px; padding: 5px 7px; font-size: 12px; }
.upload-opts { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; }
.upload-opts > div { flex: 1 1 260px; }
.docs-list.compact li { padding: 6px 0; }
details.history { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
details.history summary { cursor: pointer; }
details.history ul { margin: 6px 0 0; padding-left: 18px; }

/* ---- the move from the old system ---- */

.move-step { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line-soft); }
.move-step:first-of-type { margin-top: 12px; }
.move-num {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--mono);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.move-step.done .move-num { background: var(--tide); }
.move-body { flex: 1; min-width: 0; }
.move-body h4 { font-family: var(--display); font-size: 15.5px; margin: 3px 0 4px; }

.check-report {
  margin: 10px 0 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--tide);
  border-radius: var(--radius);
  background: var(--tide-wash);
}
.check-report.bad { border-left-color: var(--flag); background: var(--flag-wash); }
.check-report .check-head { margin: 0 0 4px; font-weight: 600; color: var(--tide-deep); }
.check-report.bad .check-head { color: var(--flag); }
.check-report .check-sub { margin: 12px 0 2px; font-weight: 600; font-size: 13px; }
.check-report .check-list { margin: 4px 0 6px; padding-left: 18px; font-size: 13px; }
.check-report .check-list li { margin: 3px 0; }
.check-report .check-table { margin: 8px 0; background: var(--panel); font-size: 12.5px; }
.check-report .check-table td { vertical-align: top; }

/* ---- support desk ---- */

.pill.tk-new { background: var(--flag-wash); color: var(--flag); border-color: #dcb4a7; }
.pill.tk-assigned { background: var(--gold-wash); color: #8a6212; border-color: #e3cf9d; }
.pill.tk-in_progress { background: var(--gold-wash); color: #8a6212; border-color: #e3cf9d; }
.pill.tk-closed { background: var(--tide-wash); color: var(--tide-deep); border-color: #b7d8d1; }
.pill.tk-cancelled { background: #f0f0ee; color: #9aa39f; border-color: var(--line); }

.ticket-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ticket-cols > div > .panel + .panel { margin-top: 18px; }
@media (max-width: 960px) { .ticket-cols { grid-template-columns: 1fr; } }

.record-table td:first-child { width: 34%; color: var(--muted); font-size: 13px; }
.answer-text {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--tide);
  border-radius: 7px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 12px;
}
.disclaimer-box {
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--gold-wash);
  border: 1px solid #e3cf9d;
  border-radius: 7px;
  font-size: 13px;
  color: #5d430c;
}
.closeout .advisory { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.closeout .advisory.needed { border-color: var(--gold); background: var(--gold-wash); }
.mi-table td { padding-top: 7px; padding-bottom: 7px; }
.mi-table td:last-child { white-space: nowrap; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 16px; border-left: 2px solid var(--line); margin-left: 4px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); }
.timeline li.tl-message::before { border-color: var(--tide); background: var(--tide); }
.timeline li.tl-closed::before { border-color: var(--tide-deep); background: var(--tide-deep); }
.timeline li.internal { background: #fbf6ea; margin-left: 4px; padding-right: 10px; border-radius: 0 7px 7px 0; }
.timeline li.internal::before { border-color: var(--gold); background: var(--gold); }
.tl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.tl-head b { color: var(--ink); font-size: 13px; }
.tl-body { font-size: 13.5px; margin-top: 3px; overflow-wrap: anywhere; }
.reply-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.reply-box .form-actions { margin-top: 8px; }

/* ---- assignments ---- */

.assign-table td { vertical-align: top; }
.assign-table .a-type { width: 132px; }
.assign-table .a-due { width: 160px; text-align: right; }
.assign-table .a-owner { width: 170px; color: var(--ink-soft); font-size: 13px; }
.assign-table .a-act { width: 96px; text-align: right; }
.assign-table tr.is-done a { color: var(--slate); text-decoration: line-through; }
.type-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}
.type-tag.t-support { color: var(--flag); border-color: #dcb4a7; }
.type-tag.t-task { color: var(--tide-deep); border-color: #b7d8d1; }
input.due-input { width: 148px; padding: 4px 6px; font-size: 12px; }
input.due-input.overdue { border-color: var(--flag); background: var(--flag-wash); color: var(--flag); }
input.due-input.soon { border-color: var(--gold); background: var(--gold-wash); }
input.due-input.none { border-style: dashed; color: var(--slate); }

details.bucket { margin-top: 6px; }
details.bucket + details.bucket { margin-top: 16px; }
details.bucket > summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid var(--line);
}
details.bucket.overdue > summary { color: var(--flag); border-bottom-color: #dcb4a7; }
details.bucket.soon > summary { color: #8a6212; border-bottom-color: #e3cf9d; }
details.bucket > summary .count, .ready-group-head .count { font-family: var(--mono); font-weight: 500; }
details.bucket > summary .count { margin-left: 6px; font-size: 12px; color: var(--muted); }

details.person-card { padding: 0; }
details.person-card + details.person-card { margin-top: 12px; }
details.person-card > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
}
details.person-card > summary::-webkit-details-marker { display: none; }
details.person-card[open] > summary { border-bottom: 1px solid var(--line-soft); }
details.person-card > :not(summary) { margin: 14px 20px; }
details.person-card > p.footnote:last-child { margin-bottom: 16px; }
.p-name { font-family: var(--display); font-weight: 700; font-size: 16px; }
.p-name .footnote { font-family: var(--body); font-weight: 400; margin-left: 8px; }
.p-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.topic-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 18px; }

/* ---- points history chart ---- */

.trend-wrap { position: relative; }
svg.trend { display: block; width: 100%; height: auto; overflow: visible; }
svg.trend .grid { stroke: var(--line-soft); stroke-width: 1; }
svg.trend .tick { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
svg.trend .target { stroke: var(--ink); stroke-width: 1; opacity: 0.55; }
svg.trend .target-label { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-soft); }
svg.trend .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.trend .end-label { font-family: var(--body); font-size: 12px; fill: var(--ink-soft); }
svg.trend .end-val { font-family: var(--mono); font-weight: 600; fill: var(--ink); }
svg.trend .cross { stroke: var(--ink); stroke-width: 1; opacity: 0.45; pointer-events: none; }
svg.trend .hit:focus-visible { outline: 2px solid var(--tide); outline-offset: 2px; }
.trend-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-soft); }
.trend-legend i, .trend-tip i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.trend-tip {
  position: absolute;
  top: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 9px 12px;
  font-size: 12.5px;
  pointer-events: none;
  min-width: 170px;
  z-index: 3;
}
.trend-tip .tip-date { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.trend-tip .tip-row { display: flex; align-items: center; gap: 2px; line-height: 1.7; }
.trend-tip .tip-row b { font-family: var(--mono); min-width: 44px; margin-right: 6px; }
.trend-tip .tip-row span { color: var(--ink-soft); }
.trend-tip .tip-why { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }

@media print {
  .no-print, .site-foot, .chip-row { display: none !important; }
}

/* ---- layout corrections ---- */

.tab { padding: 10px 11px 12px; font-size: 13px; letter-spacing: 0.04em; }
.grid-2 > .panel + .panel { margin-top: 0; }
.grid-2 + .panel, .grid-2 + .grid-2 { margin-top: 18px; }
.prose-note + .hero-figures { margin-top: 16px; }
.co-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.co-grid .span-2 { grid-column: span 2; }
@media (max-width: 620px) { .co-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
details.person-card > summary .p-name::before {
  content: "▸";
  display: inline-block;
  width: 18px;
  color: var(--slate);
  font-family: var(--body);
  font-weight: 400;
  transition: transform 120ms ease;
}
details.person-card[open] > summary .p-name::before { transform: rotate(90deg); }
.prose-note + .prose-note { margin-top: 10px; }

/* ===========================================================================
   Public home page (v2.1)
   =========================================================================== */

.btn.gold { background: var(--gold); border-color: var(--gold); color: #1c1606; }
.btn.gold:hover { background: #cf9a2c; border-color: #cf9a2c; }
.btn.ghost-light { background: transparent; border: 1px solid rgba(255, 255, 255, 0.45); color: #ffffff; }
.btn.ghost-light:hover { background: rgba(255, 255, 255, 0.1); border-color: #ffffff; }
.btn.big { font-size: 15px; padding: 11px 22px; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }

.mast-top { align-items: center; }
.mast-actions { display: flex; gap: 8px; align-items: center; }
.masthead.joined { border-bottom: none; box-shadow: none; }

/* ---- sign-in page ---- */
.auth-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 8px 0 20px; }
.auth-hero { text-align: center; }
.auth-hero .crest { filter: drop-shadow(0 3px 6px rgba(20, 49, 59, 0.25)); }

/* ---- hero ---- */
.home-hero {
  position: relative;
  color: #e9f1ee;
  background:
    radial-gradient(ellipse 60% 70% at 85% 10%, rgba(63, 163, 148, 0.22), transparent 70%),
    linear-gradient(180deg, var(--ink) 0%, #12303a 100%);
  overflow: hidden;
}
.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
}
.home-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e8c46c;
  margin-bottom: 14px;
}
.home-hero h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.12;
  margin: 0 0 16px;
  color: #ffffff;
  max-width: 20ch;
}
.home-hero p { font-size: 16.5px; line-height: 1.6; color: #cfe0db; max-width: 56ch; margin: 0 0 22px; }
.home-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.home-hero .home-hero-note { font-size: 13.5px; margin: 18px 0 0; color: #a9c2bc; }
.home-hero .home-hero-note a { color: #e8c46c; }
.home-hero-waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; display: block; }

/* the discount ladder */
.ladder-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 20px 22px 18px;
  backdrop-filter: blur(2px);
}
.ladder-title { font-family: var(--display); font-weight: 700; font-size: 17px; color: #ffffff; }
.ladder-sub { font-size: 12.5px; color: #a9c2bc; margin: 2px 0 14px; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ladder li { display: grid; grid-template-columns: 64px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.ladder-class { font-family: var(--mono); font-size: 12px; color: #cfe0db; }
.ladder-track { height: 12px; background: rgba(255, 255, 255, 0.07); border-radius: 0 4px 4px 0; }
.ladder-bar { display: block; height: 100%; background: var(--tide-bright); border-radius: 0 4px 4px 0; }
.ladder-pct { font-family: var(--mono); font-size: 12.5px; text-align: right; color: #ffffff; }
.ladder li.goal .ladder-bar { background: var(--gold); }
.ladder li.goal .ladder-class, .ladder li.goal .ladder-pct { color: #e8c46c; font-weight: 600; }
.ladder-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: #cfe0db; }
.goal-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--gold); flex: none; }

/* ---- sections ---- */
.home-news {
  display: flex;
  gap: 18px;
  align-items: baseline;
  background: var(--gold-wash);
  border: 1px solid #ead9ae;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 34px;
}
.home-news-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #7a5710; flex: none; }
.home-news p { margin: 0; }

.home-section { margin: 0 0 56px; }
.home-section-head { max-width: 72ch; margin-bottom: 22px; }
.home-eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tide); margin-bottom: 6px; }
.home-section h3 { font-family: var(--display); font-weight: 800; font-size: 27px; line-height: 1.2; margin: 0 0 10px; text-transform: none; letter-spacing: 0; }
.home-section-head p { color: var(--ink-soft); font-size: 15.5px; margin: 0; }

.home-tiles { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-tiles.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 20px 18px;
  box-shadow: 0 1px 2px rgba(20, 49, 59, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.home-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.home-tile h4 { font-family: var(--display); font-size: 16.5px; margin: 12px 0 6px; }
.home-tile p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.home-tile-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--tide-wash); color: var(--tide-deep);
  flex: none;
}
.home-icon { width: 24px; height: 24px; }

.home-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.home-facts > div { padding: 14px 18px; border-left: 1px solid var(--line-soft); }
.home-facts > div:first-child { border-left: none; }
.home-facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.home-facts dd { margin: 0; font-size: 13.5px; line-height: 1.45; }

/* the path to joining */
.home-path { margin-top: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px 22px; }
.home-path-title { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 16px; }
.home-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; position: relative; }
.home-steps::before { content: ""; position: absolute; top: 15px; left: 16px; right: 16px; height: 2px; background: linear-gradient(90deg, var(--tide), var(--tide-bright), var(--gold)); opacity: 0.55; }
.home-steps li { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.home-steps b { color: var(--ink); font-size: 14px; margin-top: 6px; }
.home-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #ffffff;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  box-shadow: 0 0 0 4px var(--panel);
}
.home-steps li:last-child .home-step-num { background: var(--gold); color: #1c1606; }

/* account call to action */
.home-account .home-tile-icon { background: var(--gold-wash); color: #7a5710; }
.home-cta-band {
  margin-top: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(100deg, var(--ink), #1d4450);
  color: #e9f1ee;
  border-radius: 14px;
  padding: 22px 26px;
}
.home-cta-band b { display: block; font-family: var(--display); font-size: 19px; color: #ffffff; margin-bottom: 4px; }
.home-cta-band span { font-size: 14px; color: #cfe0db; }
.home-cta-band .btn.ghost { background: transparent; color: #ffffff; border-color: rgba(255, 255, 255, 0.45); }
.home-cta-band .btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* contact */
.home-contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 320px);
  gap: 20px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}
.home-contact h3 { font-size: 21px; margin-bottom: 6px; }
.home-contact p { margin: 0; color: var(--ink-soft); }
.home-contact .contact-card { margin-top: 0; }

@media (max-width: 980px) {
  .home-hero-inner { grid-template-columns: 1fr; gap: 30px; padding-top: 32px; }
  .home-tiles, .home-tiles.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-facts > div:nth-child(3) { border-left: none; }
  .home-facts > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .home-steps { grid-template-columns: 1fr; gap: 16px; }
  .home-steps::before { top: 16px; bottom: 16px; left: 15px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--tide), var(--gold)); }
  .home-steps li { padding-left: 46px; }
  .home-step-num { position: absolute; left: 0; top: 0; }
  .home-steps b { margin-top: 5px; }
  .home-contact { grid-template-columns: auto minmax(0, 1fr); }
  .home-contact .contact-card { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .home-tiles, .home-tiles.n4, .home-facts { grid-template-columns: 1fr; }
  .home-facts > div { border-left: none; border-top: 1px solid var(--line-soft); }
  .home-facts > div:first-child { border-top: none; }
  /* Sign in stays in reach on a phone; the account button waits on the page itself. */
  .mast-actions [data-pub="signup"] { display: none; }
  .home-news { flex-direction: column; gap: 4px; }
  .home-cta .btn.big { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .home-tile, .home-tile:hover { transition: none; transform: none; } }
.dropzone .privacy-note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .field-pair { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .masthead .wordmark { font-size: 17px; }
  .masthead .wordmark .thin, .masthead .mast-meta { display: none; }
  .masthead .tab { padding: 8px 9px 10px; font-size: 12px; }
}

/* ===========================================================================
   Flood maps and My properties (v2.2)
   =========================================================================== */

/* flood risk tones: words always accompany the colour */
.tone-high     { --tone: var(--flag);  --tone-wash: var(--flag-wash); }
.tone-moderate { --tone: var(--gold);  --tone-wash: var(--gold-wash); }
.tone-low      { --tone: var(--tide);  --tone-wash: var(--tide-wash); }
.tone-unknown  { --tone: var(--slate); --tone-wash: #eef2f1; }

.zone-badge {
  display: inline-grid; place-items: center; flex: none;
  min-width: 46px; height: 46px; padding: 0 6px; border-radius: 12px;
  background: var(--tone); color: #ffffff;
  font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 0.02em;
}
.zone-badge.small { min-width: 30px; height: 26px; border-radius: 7px; font-size: 12.5px; }
.zone-badge.tone-moderate { color: #1c1606; }

.flood-card {
  background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--tone);
  border-radius: 12px; padding: 16px 18px 14px;
}
.flood-card-head { display: flex; gap: 14px; align-items: center; }
.flood-card-address { font-size: 12.5px; color: var(--muted); }
.flood-card-title { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.25; }
.flood-card-tone { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tone); margin-top: 2px; }
.flood-card-text { margin: 12px 0 10px; font-size: 14px; color: var(--ink-soft); }
.flood-card-rows { margin: 0 0 10px; display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.flood-card-rows > div { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.flood-card-rows dt { color: var(--muted); }
.flood-card-rows dd { margin: 0; }
.flood-card-note { background: var(--tone-wash); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0 0 10px; }
.flood-card-source { margin: 0; }
.flood-card-actions { margin-top: 12px; }

/* the map frame */
.map-panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.map-panel-head .prose-note { margin: 0; }
.map-search { display: flex; gap: 8px; flex: 0 1 460px; }
.map-search input { flex: 1; min-width: 0; }
.map-search.wide { flex: 1 1 auto; max-width: none; flex-wrap: wrap; }
.map-search.wide input { flex: 1 1 280px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.map-frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #dfe8e4; }
.map-canvas { height: 470px; position: relative; }
.map-canvas.tall { height: 520px; }
.map-loading { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
.flood-map.pickable.picking { cursor: crosshair; }
.flood-map.picking .leaflet-container, .flood-map.picking { cursor: crosshair !important; }
.map-side { display: grid; gap: 14px; }
.map-side-empty { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 22px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.map-side-empty .home-icon { width: 30px; height: 30px; color: var(--tide); }
.map-side-empty p { margin: 0; }
.map-choices { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 8px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--tide); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.map-legend { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.map-legend-title { font-family: var(--display); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.map-legend ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.map-legend li { display: flex; align-items: center; gap: 8px; }
.map-legend-fema img { width: 22px; height: 16px; object-fit: contain; border: 1px solid var(--line-soft); background: #ffffff; }
.map-legend .footnote { margin: 4px 0 0; }

/* controls drawn on the map */
.map-switch { background: rgba(255, 255, 255, 0.96); border-radius: 10px; box-shadow: 0 1px 4px rgba(20, 49, 59, 0.3); padding: 6px; display: grid; gap: 6px; font-family: var(--body); }
.map-switch .seg { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.map-switch .seg button { appearance: none; border: 0; background: #ffffff; padding: 5px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.map-switch .seg button + button { border-left: 1px solid var(--line); }
.map-switch .seg button.on { background: var(--ink); color: #ffffff; }
.zones-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 0 3px; cursor: pointer; }
.leaflet-container { font-family: var(--body); }
.leaflet-container .leaflet-control-attribution { font-size: 10.5px; }

.map-pin-wrap { background: transparent; border: 0; }
.map-pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--tone); border: 2px solid #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  display: grid; place-items: center;
}
.map-pin span { transform: rotate(45deg); color: #ffffff; font-family: var(--display); font-weight: 800; font-size: 11px; }
.map-pin.tone-moderate span { color: #1c1606; }

/* My properties */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.add-property { padding: 14px 16px; }
.add-property .error-note, .add-property .hint-note { margin: 10px 0 0; }
.props-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.props-list { display: grid; gap: 8px; }
.prop-item {
  appearance: none; text-align: left; display: flex; gap: 12px; align-items: center; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  font: inherit; color: inherit;
}
.prop-item:hover { border-color: var(--tide); }
.prop-item.on { border-color: var(--tide); box-shadow: 0 0 0 2px var(--tide-wash); }
.prop-text { display: grid; gap: 1px; min-width: 0; }
.prop-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.props-main { display: grid; gap: 14px; }

.mini-props { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-props li { display: grid; gap: 1px; }
.mini-props a { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.mini-props .footnote { padding-left: 38px; }

/* friendly empty states, used across the app */
.empty-state { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); background: var(--panel-2); }
.empty-state b { color: var(--ink); font-family: var(--display); font-size: 15px; }
.empty-state p { margin: 0; font-size: 13.5px; max-width: 42ch; }
.empty-art { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--tide-wash); color: var(--tide-deep); margin-bottom: 4px; }
.empty-art .home-icon { width: 28px; height: 28px; }

@media (max-width: 900px) {
  .map-layout, .props-layout { grid-template-columns: 1fr; }
  .map-canvas, .map-canvas.tall { height: 380px; }
  .flood-card-rows > div { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.add-property { margin-bottom: 16px; }

/* ===== v2.2 visual refresh: staff pages ===================================== */

/* Series identity colours (validated for colour-blind separation; always shown
   beside the series name, never alone). */
.sc-300 { --series: #2a78d6; }
.sc-400 { --series: #eb6834; }
.sc-500 { --series: #6250d6; }
.sc-600 { --series: #e87ba4; }
.sc-app { --series: var(--slate); }
.series-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--series, var(--slate)); margin-right: 8px; vertical-align: 0; flex: none; }
.series-dot.sc-300, .series-dot.sc-400, .series-dot.sc-500, .series-dot.sc-600, .series-dot.sc-app { background: var(--series); }
.series-head[class*="sc-"] { border-bottom-color: var(--series); }
.series-head[class*="sc-"]::before { display: none; }
.series-head > span:first-child { display: inline-flex; align-items: center; }
.act-card[class*="sc-"] { border-top: 4px solid var(--series); }
.act-card[class*="sc-"]:hover { border-color: var(--tide); border-top-color: var(--series); }

/* About this page fold */
details.about-page { margin: -4px 0 18px; }
details.about-page > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 600; color: var(--tide-deep); padding: 3px 10px 3px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
}
details.about-page > summary::-webkit-details-marker { display: none; }
details.about-page > summary::before { content: "i"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--tide-wash); font-family: var(--mono); font-size: 11px; font-weight: 700; }
details.about-page[open] > summary { background: var(--tide-wash); }
details.about-page .page-sub { margin: 10px 0 0; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--tide); border-radius: 8px; }

/* Dashboard stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ink); }
.stat-card.tier-earned::before { background: var(--tide-deep); }
.stat-card.tier-pending::before { background: var(--tide-bright); }
.stat-card.tier-likely::before { background: var(--gold); }
.stat-card .sc-label { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.stat-card .sc-val { font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1.15; margin: 4px 0 2px; }
.stat-card .sc-of { font-size: 16px; color: var(--muted); font-weight: 400; }
.stat-card .sc-note { font-size: 12.5px; color: var(--muted); }
.stat-card.basis { background: linear-gradient(135deg, var(--ink) 0%, #1d4552 100%); border-color: var(--ink); }
.stat-card.basis::before { background: var(--gold); }
.stat-card.basis .sc-label, .stat-card.basis .sc-note { color: #c9d9dc; }
.stat-card.basis .sc-val { color: #fff; }
.stat-card.basis .sc-of { color: #c9d9dc; }

/* Class ladder */
.class-ladder { display: grid; grid-template-columns: minmax(200px, 1fr) 2.2fr; gap: 18px; align-items: center; margin-bottom: 18px; }
.cl-now .cl-big { font-family: var(--display); font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1; }
.cl-now .cl-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.cl-now .cl-next { font-size: 13px; color: var(--ink-soft); margin-top: 10px; padding: 8px 10px; background: var(--gold-wash); border-radius: 8px; }
.cl-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; align-items: end; }
.cl-step { display: grid; gap: 2px; padding: 10px 10px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); text-align: center; }
.cl-step:nth-child(1) { min-height: 78px; } .cl-step:nth-child(2) { min-height: 90px; } .cl-step:nth-child(3) { min-height: 102px; }
.cl-step:nth-child(4) { min-height: 114px; } .cl-step:nth-child(5) { min-height: 126px; }
.cl-step { align-content: end; }
.cl-class { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink); }
.cl-pts, .cl-disc { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.cl-state { font-size: 11.5px; font-weight: 600; color: var(--slate); margin-top: 3px; }
.cl-step.reached { background: var(--tide-wash); border-color: #b7d8d1; }
.cl-step.reached .cl-state { color: var(--tide-deep); }
.cl-step.reached .cl-state::before { content: "✓ "; }
.cl-step.likely { background: var(--gold-wash); border-color: #e3cf9d; border-style: dashed; }
.cl-step.likely .cl-state { color: #8a6212; }

/* Series bars in the Credit by series table, and the activity status bar */
.series-bar { display: flex; gap: 2px; height: 6px; margin-top: 6px; max-width: 220px; }
.series-bar > span { display: block; height: 100%; border-radius: 2px; min-width: 0; }
.series-bar > span[style*="width:0%"] { display: none; }
.status-bar { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; margin: 2px 0 12px; }
.status-bar > span { display: block; height: 100%; }
.st-not_started { background: #c4cfcc; }
.st-investigating { background: #e3cf9d; }
.st-in_progress { background: var(--gold); }
.st-docs_ready { background: var(--tide); }
.st-submitted { background: var(--ink); }
.st-not_pursuing { background: #e6e8e6; }

/* Readiness stage strip */
.stage-strip { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.stage a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px; row-gap: 2px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); text-decoration: none; height: 100%; box-sizing: border-box; }
.stage a:hover { border-color: var(--tide); }
.stage-num { grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; background: #edf1f0; color: var(--slate); }
.stage-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.stage-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.stage-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line-soft); margin-top: 6px; overflow: hidden; }
.stage-bar > span { display: block; height: 100%; background: var(--tide); border-radius: 2px; }
.stage.complete .stage-num { background: var(--tide); color: #fff; }
.stage.complete a { background: var(--tide-wash); border-color: #b7d8d1; }
.stage.underway .stage-num { background: var(--gold-wash); color: #8a6212; }
.stage.blocked .stage-num { background: var(--flag-wash); color: var(--flag); }
.stage.blocked .stage-count { color: var(--flag); }
.stage.blocked .stage-bar > span { background: var(--flag); }
.stage-total { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 6px 0 20px; }
.stage-total b { color: var(--ink); }
.ready-group { scroll-margin-top: 80px; }
details.done-fold { border-top: 1px dashed var(--line); margin-top: 4px; }
details.done-fold > summary { cursor: pointer; padding: 10px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--tide-deep); }
details.done-fold > summary::before { content: "✓ "; }
.ready-item.is-done .label { color: var(--muted); font-weight: 500; }
.all-done { color: var(--tide-deep); margin: 8px 0; }

/* Program calendar strip */
.cal-strip { display: grid; grid-template-columns: repeat(var(--cols), minmax(78px, 1fr)); gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.cal-col { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; min-height: 120px; display: flex; flex-direction: column; }
.cal-col.this-month { border-color: var(--tide); background: #fff; }
.cal-col.overdue-col { background: var(--flag-wash); border-color: #dcb4a7; }
.cal-head { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); padding: 7px 8px 5px; border-bottom: 1px solid var(--line-soft); }
.overdue-col .cal-head { color: var(--flag); }
.cal-year { font-family: var(--mono); font-weight: 400; letter-spacing: 0; color: var(--muted); }
.cal-body { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.cal-chip { display: block; width: 100%; box-sizing: border-box; text-align: left; font: inherit; font-size: 11.5px; line-height: 1.25; padding: 4px 6px 4px 8px; border-radius: 5px; border: 1px solid var(--line); border-left: 4px solid var(--tide); background: #fff; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
button.cal-chip { cursor: pointer; }
button.cal-chip:hover { border-color: var(--tide); }
.cal-chip.soon { border-left-color: var(--gold); }
.cal-chip.overdue { border-left-color: var(--flag); }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--muted); align-items: center; }
.cal-key > span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--tide); }
.cal-dot.soon { background: var(--gold); }
.cal-dot.overdue { background: var(--flag); }
.cal-dot.undated { background: #c4cfcc; }

/* Assignments: initials and workload */
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 700; margin-right: 10px; flex: none; vertical-align: middle; }
.avatar.none { background: transparent; color: var(--slate); border: 1.5px dashed var(--slate); }
details.person-card > summary .p-name { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
details.person-card.no-account { background: var(--panel-2); }
details.person-card.no-account .p-name { color: var(--ink-soft); }
.workload { display: grid; gap: 6px; }
.wl-row { display: grid; grid-template-columns: auto minmax(120px, 220px) 1fr 36px; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 8px; border: 1px solid transparent; background: none; font: inherit; color: inherit; text-align: left; width: 100%; }
button.wl-row { cursor: pointer; }
button.wl-row:hover { border-color: var(--line); background: var(--panel-2); }
.wl-row.no-account .wl-name { color: var(--muted); }
.wl-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-bar { display: flex; gap: 2px; height: 12px; }
.wl-bar > span { display: block; height: 100%; border-radius: 3px; }
.wl-overdue { background: var(--flag); }
.wl-soon { background: var(--gold); }
.wl-later { background: var(--tide); }
.wl-undated { background: #c4cfcc; }
.wl-row.no-account .wl-bar > span { opacity: 0.55; }
.wl-n { font-family: var(--mono); font-size: 12.5px; text-align: right; color: var(--ink-soft); }

/* Records: register tiles */
.reg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.reg-tile { display: grid; gap: 3px; text-align: left; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--series, var(--slate)); border-radius: var(--radius); padding: 13px 15px; cursor: pointer; transition: box-shadow 140ms ease, transform 140ms ease; }
.reg-tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.reg-tile.on { border-color: var(--ink); border-top-color: var(--series, var(--slate)); box-shadow: 0 0 0 1px var(--ink); }
.rt-label { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.rt-count { font-family: var(--mono); font-size: 28px; font-weight: 600; line-height: 1.1; }
.rt-last { font-size: 12.5px; color: var(--muted); }
.rt-credit { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; margin-top: 4px; }

@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-ladder { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cl-steps { grid-template-columns: repeat(5, minmax(56px, 1fr)); gap: 4px; }
  .cl-step { padding: 8px 4px; }
  .cl-disc { display: none; }
  .wl-row { grid-template-columns: auto 1fr 32px; }
  .wl-row .wl-bar { grid-column: 2 / -1; grid-row: 2; }
  .stat-card .sc-val { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .reg-tile, .reg-tile:hover { transition: none; transform: none; } }

/* Program: empty calendar message and obligation cards */
.cal-wrap { position: relative; }
.cal-empty { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); margin: 0; max-width: min(560px, 86%); text-align: center; font-size: 13px; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); }
.ob-list { display: grid; gap: 10px; }
.ob-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--tide); border-radius: 10px; background: var(--panel); }
.ob-card.soon { border-left-color: var(--gold); }
.ob-card.overdue { border-left-color: var(--flag); }
.ob-card.undated { border-left-color: #c4cfcc; }
.ob-title { font-size: 14.5px; }
.ob-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); max-width: 72ch; }
.ob-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; font-size: 13px; }
.ob-k { display: block; font-family: var(--display); font-weight: 700; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); margin-bottom: 1px; }
.ob-cadence { margin: 8px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ob-card details.history { margin-top: 8px; }
.ob-side { display: grid; justify-items: end; align-content: start; gap: 8px; min-width: 150px; }
.ob-due { text-align: right; }
.ob-actions { display: flex; gap: 6px; }
@media (max-width: 620px) {
  .ob-card { grid-template-columns: 1fr; }
  .ob-side { justify-items: start; grid-template-columns: auto auto; align-items: center; }
  .ob-due { text-align: left; grid-column: 1 / -1; }
  .cal-empty { position: static; transform: none; max-width: none; margin-top: 10px; box-shadow: none; }
}
details.wl-fold { margin-top: 10px; border-top: 1px dashed var(--line); }
details.wl-fold > summary { cursor: pointer; padding: 10px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wl-row { grid-template-columns: auto minmax(140px, 260px) 1fr 36px; }
section.panel + .chip-row { margin-top: 16px; }
@media (max-width: 560px) {
  .wl-row { grid-template-columns: auto 1fr 32px; }
  .wl-row .wl-bar { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .cl-steps { grid-template-columns: 1fr; gap: 5px; }
  .cl-step, .cl-step:nth-child(n) { min-height: 0; grid-template-columns: 70px 1fr 1fr auto; align-items: baseline; text-align: left; padding: 8px 10px; }
  .cl-disc { display: inline; }
  .cl-state { margin-top: 0; text-align: right; }
  .class-ladder + .gauge + .gauge-labels, .class-ladder ~ .gauge-labels { display: none; }
  .stat-card .sc-val { font-size: 22px; white-space: nowrap; }
  .stat-card .sc-of { font-size: 13px; }
}
.table-scroll { overflow-x: auto; }
@media (max-width: 560px) {
  .series-table th, .series-table td { padding-left: 6px; padding-right: 6px; }
  .series-table th { font-size: 10.5px; }
}
.grid-2 > *, .ob-main, .cl-now { min-width: 0; }
@media (max-width: 560px) {
  .ready-item { grid-template-columns: 1fr; gap: 6px; }
  .ready-item > div:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .ready-item > div:last-child > * { margin-top: 0 !important; }
}

/* ===== v2.2: traced outlines on My properties ================================ */
.flood-map.tracing, .flood-map.tracing .leaflet-interactive { cursor: crosshair !important; }
.trace-bar { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--tide); border-radius: 10px; padding: 9px 11px; box-shadow: var(--shadow); max-width: 340px; font-family: var(--body); }
.trace-text { font-size: 12.5px; color: var(--ink); line-height: 1.4; }
.trace-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.leaflet-tooltip.outline-label { background: transparent; border: 0; box-shadow: none; padding: 0; font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.leaflet-tooltip.outline-label::before { display: none; }
.leaflet-tooltip.outline-label.hover { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; text-shadow: none; }
.outlines-panel { margin-top: 16px; }
.outlines-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.outlines-head h3 { margin: 0; }
.outlines-intro { margin: 8px 0 12px; max-width: 78ch; }
.outline-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.outline-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: var(--panel); display: grid; gap: 6px; }
.outline-item.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.outline-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.outline-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.outline-verdict { font-size: 13px; font-weight: 600; }
.outline-verdict.tone-high { color: var(--flag); }
.outline-verdict.tone-moderate { color: #8a6212; }
.outline-verdict.tone-low { color: var(--tide-deep); }
.cov-bar { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; background: var(--line-soft); }
.cov-bar > span { display: block; height: 100%; }
.cov-bar .tone-high { background: var(--flag); }
.cov-bar .tone-moderate { background: var(--gold); }
.cov-bar .tone-low { background: var(--tide); }
.cov-bar .tone-unknown { background: #c4cfcc; }
.cov-words { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }
.outline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.danger-text { color: var(--flag); }
/* Leaflet gives its panes and controls z-indexes up to 1000; keep them inside the map
   so dialogs and menus always sit above it. */
.leaflet-container { isolation: isolate; z-index: 0; }

/* ===== the masthead stays at the top, and slims down once the page scrolls ===== */
.masthead { position: sticky; top: 0; z-index: 50; }
html { scroll-padding-top: 104px; }
.masthead-inner { transition: padding 180ms ease; }
.mast-brand .crest { transition: width 180ms ease, height 180ms ease; }
.masthead .wordmark { transition: font-size 180ms ease; }
.masthead .mast-meta { max-height: 40px; overflow: hidden; transition: max-height 180ms ease, opacity 180ms ease, margin 180ms ease; }
.masthead .tabs { transition: margin 180ms ease; }
.masthead .tab { transition: padding 180ms ease, color 120ms ease; }
.masthead.compact { box-shadow: 0 4px 14px rgba(16, 40, 49, 0.28); }
.masthead.compact .masthead-inner { padding-top: 8px; }
.masthead.compact .mast-brand { gap: 10px; }
.masthead.compact .mast-brand .crest { width: 30px; height: 30px; }
.masthead.compact .wordmark { font-size: 16px; }
.masthead.compact .mast-meta { max-height: 0; opacity: 0; }
.masthead.compact .mast-actions .btn { padding-top: 4px; padding-bottom: 4px; }
.masthead.compact .tabs { margin-top: 4px; }
.masthead.compact .tab { padding-top: 7px; padding-bottom: 9px; }
.ready-group { scroll-margin-top: 104px; }
@media (max-width: 620px) {
  /* One row of tabs that scrolls sideways, so the bar never fills the screen. */
  .masthead .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .masthead .tabs::-webkit-scrollbar { display: none; }
  .masthead .tab { flex: none; }
  .masthead.compact .wordmark { font-size: 14px; }
  .masthead.compact .mast-user .role-chip { display: none; }
  html { scroll-padding-top: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .masthead-inner, .mast-brand .crest, .masthead .wordmark, .masthead .mast-meta, .masthead .tabs, .masthead .tab { transition: none; }
}
@media (max-width: 620px) {
  .masthead.compact .mast-user { display: none; }
  .masthead.compact .mast-top { flex-wrap: nowrap; }
  /* The tab row scrolls sideways; fade its right edge so the rest is clearly there. */
  .masthead .tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 24px; }
}
/* The bar is fixed to the window; .mast-spacer (sized by the script) holds its place. */
.masthead { position: fixed; top: 0; left: 0; right: 0; }
.mast-spacer { flex: none; }
.masthead.mast-measuring, .masthead.mast-measuring * { transition: none !important; }

/* ===== The CRS page: plain words and pictures ================================= */
.crs-page { max-width: 1060px; margin: 0 auto; }
.crs-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px 30px; box-shadow: var(--shadow); }
.crs-title { font-family: var(--display); font-size: 30px; line-height: 1.15; margin: 6px 0 12px; color: var(--ink); }
.crs-lede { font-size: 16px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 16px; }
.crs-analogy { display: flex; gap: 12px; align-items: flex-start; background: var(--gold-wash); border-radius: 12px; padding: 12px 14px; }
.crs-analogy p { margin: 0; font-size: 15px; line-height: 1.5; }
.crs-analogy-mark { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.crs-hero-art { width: 100%; height: auto; display: block; }
.crs-rain path { animation: crsRain 1.6s linear infinite; }
@keyframes crsRain { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }

.crs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 8px; }
.crs-stats > div { background: var(--ink); color: #dce9e5; border-radius: 14px; padding: 16px 18px; display: grid; gap: 4px; }
.crs-stat { font-family: var(--display); font-weight: 800; font-size: 26px; color: #fff; }
.crs-stats > div:nth-child(1) .crs-stat { color: #f0cd7d; }
.crs-stats > div span:last-child { font-size: 13.5px; line-height: 1.4; }

.crs-section { margin-top: 40px; }
.crs-small { margin-top: 10px; }
.crs-more-link { font-weight: 700; color: var(--tide-deep); }

/* how it works */
.crs-flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: flow; }
.crs-flow li { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px 16px; display: grid; gap: 6px; align-content: start; }
.crs-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 30px; width: 14px; text-align: center; color: var(--tide); font-weight: 800; font-size: 18px; }
.crs-flow b { font-size: 15px; }
.crs-flow span:last-child { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.crs-flow-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--tide-wash); color: var(--tide-deep); display: grid; place-items: center; }
.crs-icon { width: 26px; height: 26px; }

/* the class staircase */
.crs-ladder { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: end; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.crs-stairs { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; align-items: end; min-height: 270px; padding-top: 36px; }
.crs-step { position: relative; height: calc(56px + var(--rise) * 20px); border: 1px solid #b7d8d1; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #e6f3f0, #cfe7e1); color: var(--ink); font: inherit; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; padding: 8px 2px; gap: 2px; transition: transform 140ms ease, box-shadow 140ms ease; }
.crs-step:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.crs-step.on { background: linear-gradient(180deg, var(--tide), var(--tide-deep)); color: #fff; border-color: var(--tide-deep); }
.crs-step.now { background: #eceeed; border-color: #cfd6d4; }
.crs-step.now.on { background: var(--slate); border-color: var(--slate); }
.crs-step-class { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1; }
.crs-step-pct { font-family: var(--mono); font-size: 10.5px; line-height: 1.2; text-align: center; }
.crs-flag { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.crs-flag.now { background: #eceeed; color: var(--ink-soft); }
.crs-flag.goal { background: var(--gold); color: #fff; }
.crs-flag::after { content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: inherit; }
.crs-flag.goal::after { border-top-color: var(--gold); }
.crs-flag.now::after { border-top-color: #eceeed; }
.crs-step-detail { background: var(--paper); border-radius: 12px; padding: 16px 18px; align-self: stretch; }
.crs-detail-class { font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--ink); margin-bottom: 8px; }
.crs-detail-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.crs-detail-row span { color: var(--muted); }
.crs-step-detail p { font-size: 14px; line-height: 1.55; margin: 10px 0 0; }

/* savings calculator */
.crs-calc { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.crs-calc-input { display: grid; gap: 8px; align-content: start; }
.crs-calc-input > span:first-child { font-weight: 700; }
.crs-dollar { display: flex; align-items: center; border: 2px solid var(--tide); border-radius: 12px; padding: 4px 12px; background: #fff; font-family: var(--mono); font-size: 26px; color: var(--ink); }
.crs-dollar input { border: 0; outline: 0; font: inherit; width: 100%; padding: 4px 6px; background: transparent; }
.crs-calc-headline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.crs-calc-headline > div { background: var(--gold-wash); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; font-size: 13px; color: var(--ink-soft); }
.crs-big { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--ink); }
.crs-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.crs-bar-row { display: grid; grid-template-columns: 62px 1fr 70px; align-items: center; gap: 8px; width: 100%; font: inherit; font-size: 13px; color: inherit; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.crs-bar-row:hover { background: var(--paper); }
.crs-bar-row.on { background: var(--gold-wash); border-color: #e3cf9d; }
.crs-bar-row.on .crs-bar { background: var(--gold); }
.crs-bar-row.on .crs-bar-label, .crs-bar-row.on .crs-bar-val { color: var(--ink); font-weight: 700; }
.crs-bar-row:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.crs-calc-hint { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.crs-bar-label { font-weight: 600; color: var(--ink-soft); }
.crs-bar-track { height: 12px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.crs-bar { display: block; height: 100%; background: var(--tide); border-radius: 0 4px 4px 0; transition: width 200ms ease; }
.crs-bars { gap: 2px; }
.crs-bar-val { font-family: var(--mono); text-align: right; }

/* the four families */
.crs-series { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
details.crs-family { background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--series); border-radius: 14px; padding: 0; }
details.crs-family > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px 18px; }
details.crs-family > summary::-webkit-details-marker { display: none; }
.crs-family-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--series); }
.crs-family-text { display: grid; gap: 3px; }
.crs-family-code { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.crs-family-text b { font-size: 17px; }
.crs-family-text span:last-child { font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.crs-family-more { grid-column: 2; font-size: 12.5px; font-weight: 700; color: var(--tide-deep); }
.crs-family-more::after { content: " ▾"; }
details.crs-family[open] .crs-family-more::after { content: " ▴"; }
.crs-acts { list-style: none; margin: 0; padding: 0 18px; display: grid; gap: 8px; }
.crs-acts li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; font-size: 13.5px; }
.crs-acts li > span:last-child { display: grid; gap: 1px; }
.crs-acts li > span:last-child span { color: var(--muted); }
.crs-act-code { font-family: var(--mono); font-size: 12px; font-weight: 700; color: #fff; background: var(--series); border-radius: 6px; text-align: center; padding: 3px 0; }
.crs-example { margin: 12px 18px 16px; padding: 10px 12px; background: var(--paper); border-radius: 10px; font-size: 13.5px; }

/* the road */
.crs-road { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; position: relative; }
.crs-road::before { content: ""; position: absolute; left: 8%; right: 8%; top: 20px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--tide) 0 22px, transparent 22px 30px); opacity: 0.5; }
.crs-road li { position: relative; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 0 8px; }
.crs-road-dot { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; border: 4px solid var(--paper); position: relative; z-index: 1; }
.crs-road li.repeat .crs-road-dot { background: var(--tide); }
.crs-road b { font-size: 14.5px; }
.crs-road li > span:last-child { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* myth or fact */
.crs-myths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.crs-myth { position: relative; min-height: 190px; border: 0; padding: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; perspective: 900px; }
.crs-myth-front, .crs-myth-back { position: absolute; inset: 0; border-radius: 14px; padding: 18px; display: grid; gap: 8px; align-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 420ms ease; }
.crs-myth-front { background: var(--ink); color: #eaf2ef; }
.crs-myth-front b { font-family: var(--display); font-size: 17px; line-height: 1.35; color: #fff; }
.crs-myth-q { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #f0cd7d; }
.crs-myth-hint { font-size: 12px; color: #a9c2bc; }
.crs-myth-back { background: var(--panel); border: 1px solid var(--line); transform: rotateY(180deg); font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.crs-myth.turned .crs-myth-front { transform: rotateY(-180deg); }
.crs-myth.turned .crs-myth-back { transform: rotateY(0); }
.crs-myth:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 14px; }
.crs-verdict { justify-self: start; font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.crs-verdict.myth { background: var(--flag-wash); color: var(--flag); }
.crs-verdict.fact { background: var(--tide-wash); color: var(--tide-deep); }

/* what you can do */
.crs-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.crs-action { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; display: grid; gap: 8px; align-content: start; }
.crs-action > span:nth-child(3) { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.crs-action .btn { justify-self: start; margin-top: 4px; }
.crs-action-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--gold-wash); color: #8a6212; display: grid; place-items: center; }

/* glossary */
.crs-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
details.crs-word { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
details.crs-word > summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
details.crs-word p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.crs-sources { margin-top: 36px; line-height: 1.6; }

@media (max-width: 900px) {
  .crs-hero, .crs-ladder, .crs-calc { grid-template-columns: 1fr; }
  .crs-hero-art { max-width: 420px; justify-self: center; }
  .crs-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crs-flow li:nth-child(2)::after { display: none; }
  .crs-myths, .crs-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crs-road { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
  .crs-road::before { display: none; }
}
@media (max-width: 620px) {
  .crs-hero { padding: 20px 18px; }
  .crs-title { font-size: 24px; }
  .crs-stats, .crs-flow, .crs-series, .crs-myths, .crs-actions, .crs-words { grid-template-columns: 1fr; }
  .crs-flow li::after { display: none !important; }
  .crs-stairs { gap: 2px; min-height: 230px; }
  .crs-step { height: calc(44px + var(--rise) * 16px); padding: 6px 0; }
  .crs-step-class { font-size: 15px; }
  .crs-step-pct { font-size: 9px; }
  .crs-flag { font-size: 10px; padding: 1px 6px; }
  .crs-road { grid-template-columns: 1fr; }
  .crs-road li { grid-template-columns: 46px 1fr; justify-items: start; text-align: left; column-gap: 12px; }
  .crs-road li .crs-road-dot { grid-row: 1 / span 2; }
  .crs-calc-headline { grid-template-columns: 1fr; }
  .crs-myth { min-height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .crs-rain path { animation: none; }
  .crs-myth-front, .crs-myth-back, .crs-step, .crs-bar { transition: none; }
}
.crs-series { align-items: start; }
.crs-stairs-key { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--ink-soft); }
.crs-stairs-key > span { display: inline-flex; align-items: center; gap: 6px; }
.crs-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.crs-key.now { background: #cfd6d4; }
.crs-key.goal { background: var(--gold); }
@media (max-width: 620px) { .crs-off { display: none; } .crs-step-pct { font-size: 10px; } }

/* ===== My properties: setting the pin exactly, and property lines ============== */
.add-alt { margin-top: 8px; font-size: 13px; }
.place-panel { border: 2px solid var(--gold); background: #fffdf7; margin-bottom: 16px; }
.place-head { display: flex; gap: 12px; align-items: flex-start; }
.place-head h3 { margin: 0 0 4px; }
.place-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--gold-wash); color: #8a6212; display: grid; place-items: center; }
.place-icon svg { width: 22px; height: 22px; }
.place-note { margin: 0; font-size: 14px; color: var(--ink-soft); }
.place-note.warn { color: #8a5b0e; }
.place-tips { margin: 12px 0 10px; padding-left: 20px; font-size: 13.5px; color: var(--ink-soft); display: grid; gap: 3px; }
.place-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding: 9px 12px; background: var(--paper); border-radius: 8px; font-size: 13.5px; margin-bottom: 12px; }
.place-panel .field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.place-panel .field input { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.place-panel .button-row { margin-top: 12px; }
.place-pin-wrap { background: none; border: 0; }
.place-pin { width: 34px; height: 46px; position: relative; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45)); cursor: grab; }
.place-pin::before { content: ""; position: absolute; left: 3px; top: 1px; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--gold); border: 3px solid #fff; box-sizing: border-box; }
.place-pin span { position: absolute; left: 12px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.place-pin::after { content: ""; position: absolute; left: 14px; bottom: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.leaflet-dragging .place-pin { cursor: grabbing; }
.flood-map.placing { cursor: crosshair; }
.flood-map.placing .leaflet-grab { cursor: crosshair; }
.parcel-line { pointer-events: none; }
.map-switch .parcel-hint { font-size: 11px; color: var(--muted); padding: 2px 4px 0; max-width: 130px; }
.pin-source { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); margin: 10px 0 2px; }
.pin-source .link-btn { font-weight: 700; color: var(--tide-deep); }

/* ===== Walk-through (residents) ============================================== */
.mast-tour {
  appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700;
  color: #14313b; background: #f2d58a; border: none; border-radius: 999px; padding: 4px 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.mast-tour::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b9861f; }
.mast-tour:hover { background: #f7e2ad; }
.mast-tour:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.masthead.compact .mast-tour { padding: 2px 10px; }

body.touring { overflow-anchor: none; }
.tour-layer { position: fixed; inset: 0; z-index: 2000; }
.tour-layer.dim { background: rgba(10, 30, 36, 0.58); }
.tour-spot {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(10, 30, 36, 0.58), 0 0 0 3px #f2d58a, 0 0 22px 4px rgba(242, 213, 138, 0.55);
  transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease;
}
.tour-card {
  position: fixed; width: min(380px, calc(100vw - 16px)); background: var(--panel); color: var(--ink);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(10, 30, 36, 0.35); padding: 16px 18px 14px;
  border-top: 5px solid var(--gold); outline: none;
}
.tour-card.demo { width: min(560px, calc(100vw - 16px)); }
.tour-card h3 { margin: 6px 0 8px; font-family: var(--display); font-size: 19px; line-height: 1.25; }
.tour-kicker { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tour-trail { display: flex; gap: 4px; flex-wrap: wrap; }
.tour-trail span { padding: 2px 7px; border-radius: 999px; background: var(--line-soft); }
.tour-trail span.past { background: var(--tide-wash); color: var(--tide-deep); }
.tour-trail span.on { background: var(--ink); color: #ffffff; }
.tour-count { margin-left: auto; white-space: nowrap; }
.tour-body { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.tour-body p { margin: 0 0 8px; }
.tour-steps { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 3px; }
.tour-small { font-size: 13px; color: var(--muted); }
.tour-demo-frame { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin: 4px 0 10px; background: #eef1ea; }
.tour-demo { display: block; width: 100%; height: auto; }
.tour-progress { height: 4px; background: var(--line-soft); border-radius: 4px; margin: 10px 0 12px; overflow: hidden; }
.tour-progress span { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width 220ms ease; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions .link-btn { font-size: 13px; }
/* the drawings inside the animations */
.tour-demo text { font-family: "Public Sans", Arial, sans-serif; }
.td-lot { fill: none; stroke: #e8c547; stroke-width: 1.6; }
.td-house { fill: #d6d0c3; stroke: #b3ab9b; stroke-width: 1; }
.td-road { font-size: 9px; letter-spacing: 0.18em; fill: #8b968f; font-weight: 700; }
.td-zone { font-size: 13px; font-weight: 800; fill: #2f6fa6; }
.td-zone-x { fill: #7d8a84; }
.td-type { font-size: 12px; fill: #14313b; }
.td-btn { font-size: 10.5px; font-weight: 700; fill: #ffffff; }
.td-link { font-size: 10.5px; font-weight: 700; fill: #16756a; }
.td-card { font-size: 11px; fill: #14313b; }
.td-card-sub { font-size: 9.5px; fill: #5b7078; }
.td-ok { font-size: 10.5px; font-weight: 700; fill: #0e5a51; }
.td-bar { font-size: 10.5px; fill: #e9f1ee; }
.td-street { font-size: 9.5px; fill: #7a7067; font-style: italic; }
@media (prefers-reduced-motion: reduce) {
  .tour-demo *, .tour-spot, .tour-progress span { animation: none !important; transition: none !important; }
}
@media (max-width: 620px) {
  .tour-card { padding: 12px 14px 12px; }
  .tour-card h3 { font-size: 17px; }
  .tour-body { font-size: 14px; }
  .tour-trail { display: none; }
  .tour-count { margin-left: 0; }
  .mast-tour { font-size: 12px; padding: 3px 10px; }
}

/* ===== Report a problem ======================================================= */
/* The button sits in a slim strip of its own along the bottom of the window. The strip
   is solid and the page ends with a spacer of the same height, so the button never
   covers anything: content scrolls up past it, as it does past the header. */
.report-tray-space { height: 52px; }
.report-tray {
  position: fixed; left: 0; right: 0; bottom: 0; height: 52px; z-index: 45;
  background: rgba(239, 243, 241, 0.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(4px);
}
.report-tray-inner { max-width: 1180px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: flex-end; }
.report-pill {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--flag); background: #ffffff; border: 1.5px solid #dcb8ad; border-radius: 999px; padding: 7px 15px;
  box-shadow: 0 1px 2px rgba(20, 49, 59, 0.08);
}
.report-pill:hover { background: var(--flag-wash); border-color: var(--flag); }
.report-pill:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }
body:has(.report-tray) .toast { bottom: 66px; }
@media (max-width: 620px) {
  .report-tray-space, .report-tray { height: 46px; }
  .report-tray-inner { padding: 0 12px; }
  .report-pill { padding: 6px 13px; font-size: 12.5px; }
  body:has(.report-tray) .toast { bottom: 58px; }
}
@media print { .report-tray, .report-tray-space { display: none !important; } }

/* Admin → Problem reports */
.problem-list { display: grid; gap: 10px; }
.problem-card { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
.problem-card.resolved { border-left-color: var(--tide); background: var(--panel-2); }
.problem-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.problem-what { margin: 8px 0 6px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; }
.problem-tech { margin: 4px 0 8px; font-size: 12.5px; }
.problem-tech .mono { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); word-break: break-word; margin-top: 4px; }
.problem-admin textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 8px; }
.problem-admin .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 620px) {
  /* With the Walk-through button, the account row needs the room: the role label goes,
     and nothing in the row wraps. */
  .mast-user { gap: 8px; flex-wrap: nowrap; }
  .mast-user .role-chip { display: none; }
  .mast-user .mast-tour, .mast-user .mast-name, .mast-user #logout-btn { white-space: nowrap; }
}
@media (max-width: 380px) {
  .mast-user .mast-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
}

/* ===== View public site (staff) ============================================== */
.mast-preview {
  font-size: 12.5px; font-weight: 700; color: #e9f1ee; text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(233, 241, 238, 0.45); border-radius: 999px; padding: 3px 11px;
  display: inline-flex; align-items: center; gap: 6px;
}
.mast-preview::before {
  content: ""; width: 12px; height: 8px; border: 1.6px solid currentColor; border-radius: 50% / 60%;
  box-sizing: border-box; background: radial-gradient(circle, currentColor 0 1.6px, transparent 2px);
}
.mast-preview:hover { background: rgba(233, 241, 238, 0.12); border-color: #e9f1ee; }
.mast-preview:focus-visible { outline: 3px solid #f2d58a; outline-offset: 2px; }
.preview-bar { background: #f2d58a; color: #14313b; border-bottom: 1px solid #d9b65e; }
.preview-bar-inner { max-width: 1180px; margin: 0 auto; padding: 7px 24px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.preview-bar-inner .btn { margin-left: auto; background: #14313b; color: #ffffff; border-color: #14313b; white-space: nowrap; }
.preview-bar-inner .btn:hover { background: #0b2028; }
.preview-dot { width: 9px; height: 9px; border-radius: 50%; background: #a4432c; box-shadow: 0 0 0 3px rgba(164, 67, 44, 0.2); flex: none; }
@media (max-width: 620px) {
  .preview-bar-inner { padding: 6px 12px; font-size: 12.5px; }
  .preview-more { display: none; }
  .mast-user .mast-preview { padding: 2px 9px; font-size: 12px; }
}
@media print { .preview-bar { display: none; } }

/* ===== Workspace · My account · Public site (staff) ============================ */
.view-switch { display: inline-flex; align-items: stretch; border: 1px solid rgba(233, 241, 238, 0.4); border-radius: 999px; padding: 2px; gap: 2px; }
.view-switch button, .view-switch a {
  appearance: none; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  color: #cfe0db; background: transparent; border: none; border-radius: 999px; padding: 3px 11px; display: inline-flex; align-items: center;
}
.view-switch button:hover, .view-switch a:hover { background: rgba(233, 241, 238, 0.12); color: #ffffff; }
.view-switch .on, .view-switch .on:hover { background: #f2d58a; color: #14313b; }
.view-switch :focus-visible { outline: 3px solid #f2d58a; outline-offset: 1px; }
.view-switch .vs-short { display: none; }
.staff-own { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: #6b4e12; background: #f7ebc8; border-radius: 999px; padding: 1px 8px; }
.own-ticket { border-left: 4px solid var(--gold); }
@media (max-width: 620px) {
  .mast-user { flex-wrap: wrap; row-gap: 6px; }
  .mast-user .view-switch { order: -1; flex-basis: 100%; justify-content: space-between; }
  .view-switch button, .view-switch a { flex: 1; justify-content: center; }
  .view-switch .vs-long { display: none; }
  .view-switch .vs-short { display: inline; }
}
.own-ticket .button-row { margin-top: 10px; }

/* Walk-through narration: the Sound button on the card */
.tour-sound {
  appearance: none; cursor: pointer; font: inherit; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px; color: var(--tide-deep); background: var(--tide-wash);
  border: none; border-radius: 999px; padding: 3px 9px 3px 7px; white-space: nowrap;
}
.tour-sound.off { color: var(--muted); background: var(--line-soft); }
.tour-sound.waiting { color: #14313b; background: #f2d58a; animation: tourSoundPulse 1.6s ease-in-out infinite; }
.tour-sound:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@keyframes tourSoundPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 213, 138, 0.9); } 50% { box-shadow: 0 0 0 6px rgba(242, 213, 138, 0); } }
@media (prefers-reduced-motion: reduce) { .tour-sound.waiting { animation: none; } }
.tour-kicker .tour-sound { margin-left: 4px; }
@media (max-width: 620px) { .tour-kicker .tour-sound { margin-left: auto; } }

/* Setting a pin: the parcel under it, which becomes the property line */
.parcel-preview { stroke: #16756a; stroke-width: 3; stroke-dasharray: 9 6; fill: #16756a; fill-opacity: 0.08; }
.place-fate { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-soft); }

/* While a pin is being set, the panel takes the list's place beside the map, so the map
   sits right under the page title and both are in view together. On a narrow screen the
   map comes first, the panel under it, and the flood map key last. */
.props-layout.placing { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
.place-head { align-items: center; }
.props-layout.placing .place-panel { margin-bottom: 0; padding: 14px 16px; }
.props-layout.placing .place-head h3 { font-size: 16px; margin: 0; }
.props-layout.placing .place-icon { width: 32px; height: 32px; }
.props-layout.placing .place-icon svg { width: 18px; height: 18px; }
.place-panel .place-note { margin: 8px 0 0; }
.props-layout.placing .place-note { font-size: 13.5px; line-height: 1.45; }
.place-panel p.place-tips { display: block; margin: 6px 0 10px; padding: 0; font-size: 12.5px; line-height: 1.45; }
.place-tips .link-btn { font-size: inherit; }
.props-layout.placing .place-status { display: grid; gap: 2px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.props-layout.placing .place-status #place-coords { font-size: 11px; }
.props-layout.placing .field-pair { grid-template-columns: 1fr; gap: 6px; }
.props-layout.placing .field { font-size: 12px; gap: 2px; }
.props-layout.placing .field input { padding: 6px 9px; }
.props-layout.placing .button-row { margin-top: 10px; gap: 8px; flex-wrap: nowrap; }
.props-layout.placing #place-confirm { flex: 1 1 auto; }
.props-layout.placing .map-canvas.tall { height: clamp(440px, calc(100vh - 250px), 760px); }
@media (max-width: 900px) {
  .props-layout.placing { grid-template-columns: 1fr; }
  .props-layout.placing .props-main { display: contents; }
  .props-layout.placing .map-frame { order: 0; }
  .props-layout.placing .place-panel { order: 1; }
  .props-layout.placing .map-legend { order: 2; }
  .props-layout.placing .map-canvas.tall { height: clamp(280px, 50vh, 420px); }
  .place-panel p.place-tips { display: block; }
}

/* My properties: the flood card speaks for the whole property; tracing gives each building its own */
.flood-card-scope { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--tide); background: var(--tide-wash); border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--ink); }

/* ===== Elevation: the optional add-on on each traced building ===================== */
.ec-add { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel-2); }
.ec-add p { margin: 0 0 6px; }
.ec-add-actions, .ec-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ec-block { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.ec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.ec-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); }
.ec-badge.cert { background: var(--tide-wash); border-color: #b9d8d2; color: var(--tide-deep); }
.ec-badge.owner { background: #fff6e0; border-color: #ecd59a; color: #7a5410; }
.ec-badge.town { background: #e8f1fb; border-color: #bcd3ee; color: #1f4f86; }
.ec-result { margin: 4px 0 6px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; border-left: 3px solid var(--line); background: var(--paper); }
.ec-result.meets { border-left-color: var(--tide); }
.ec-result.below { border-left-color: #b4532a; background: #fdf3ee; }
.ec-result.pending { color: var(--ink-soft); }
.ec-block .footnote, .ec-panel .footnote { margin: 4px 0; }
.ec-details { margin: 6px 0; font-size: 13px; }
.ec-details summary { cursor: pointer; font-weight: 600; color: var(--tide-deep); }
.ec-figures { display: grid; gap: 2px; margin: 6px 0; font-size: 13px; }
.ec-figures > div { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.ec-figures dt { color: var(--muted); }
.ec-figures dd { margin: 0; font-variant-numeric: tabular-nums; }
.ec-actions { margin-top: 6px; }
.ec-checked { margin: 8px 0; font-size: 13.5px; font-weight: 600; color: #1f4f86; }
.ec-panel .button-row { margin: 8px 0; }
.ec-file-pick { display: grid; gap: 4px; }
.ec-file-pick input[type=file] { font: inherit; font-size: 13px; }
