/* Carevetta 0.8.0. Calm and dense: white surfaces on a neutral grey, one deep teal, 1px borders, system font.
   0.8.0: a quieter, more formal look (neutral greys, sentence-case section titles, status chips with a dot and no icon),
   the Overview page (key numbers, panels, small charts), the To do views, the search box and the top bar on desktop.
   Phone first (bottom tab bar); from 900px a left sidebar. Light and dark follow the system setting.
   Sheets, dialogs, forms, the tour and the toast are in sheets.css. */
:root {
  color-scheme: light dark;
  --bg: #f5f6f8; --surface: #ffffff; --text: #111c24; --muted: #5a6872; --line: #e1e5e9; --line-strong: #b9c2c9;
  --brand: #0e5a66; --brand-ink: #ffffff; --brand-soft: #e6f1f3; --link: #0e5a66; --focus: #1a6fc4; --hover: #f3f5f7;
  --expired: #9f1c12; --expired-bg: #fde7e4; --missing: #9a3412; --missing-bg: #ffedd5;
  --due: #7a5200; --due-bg: #fdf0c4; --ok: #166534; --ok-bg: #dcf5e3;
  --review: #1e4fa3; --review-bg: #e3edfb; --check: #5b3fb5; --check-bg: #ece7fb; --off: #4b5758; --off-bg: #e9eded;
  --danger: #b42318; --danger-ink: #ffffff;
  --ok-fill: #2e9a5a; --due-fill: #d39100; --expired-fill: #cf3a2b; --missing-fill: #e2702f; --review-fill: #3c6fd1; --check-fill: #7657d0; --bar: #0e5a66;
  --shadow: 0 1px 2px rgb(16 24 40 / .05);
  --radius: 10px; --tabs-h: 58px; --side-w: 232px;
  accent-color: var(--brand);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1316; --surface: #161e22; --text: #e6edef; --muted: #9eadb3; --line: #2a363d; --line-strong: #4b5c66;
    --brand: #5cc4d1; --brand-ink: #062b31; --brand-soft: #15343a; --link: #7fd3de; --focus: #8ab8ff; --hover: #1e2a30;
    --expired: #ffb4ab; --expired-bg: #45191a; --missing: #ffc38f; --missing-bg: #45260f;
    --due: #f5d47a; --due-bg: #3a2f0c; --ok: #86e0a4; --ok-bg: #123222;
    --review: #a9c8ff; --review-bg: #172d4f; --check: #cbbcff; --check-bg: #2a2250; --off: #b7c2c3; --off-bg: #283233;
    --danger: #ff8a7d; --danger-ink: #3a0a06;
    --ok-fill: #49b874; --due-fill: #e2aa2b; --expired-fill: #ef6a5a; --missing-fill: #f08d52; --review-fill: #6d97ea; --check-fill: #9a80ea; --bar: #5cc4d1;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); }
a { color: var(--link); }
h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 15px; margin: 14px 0 4px; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 20; background: var(--surface); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 14px 16px; }
.mt { margin-top: 14px; } .mt6 { margin-top: 6px; } .m0 { margin: 0; } .flex1 { flex: 1; min-width: 0; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- frame: top bar + bottom tabs on a phone, sidebar from 900px ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 17px; min-height: 32px; }
.agency { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nav { position: fixed; inset: auto 0 0 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); }
.nav-head { display: none; }
.nav > a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; min-width: 0;
  font-size: 11px; color: var(--muted); text-decoration: none; border-top: 2px solid transparent; }
.nav > a .i { width: 22px; height: 22px; }
.nav > a[aria-current="page"] { color: var(--brand); font-weight: 650; border-top-color: var(--brand); }
.nav .ic { position: relative; display: flex; }
.badge { position: absolute; top: -6px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: var(--danger-ink);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.demo-bar { background: var(--brand-soft); border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; padding: 6px 12px; }
.demo-bar.preview { background: var(--due-bg); color: var(--due); }
.demo-bar.plan-bar.locked { background: var(--missing-bg); color: var(--missing); }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px; outline: none; }
main:focus, main:focus-visible { outline: none; }
body.emp .nav { display: none; }
body.emp { padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
.loading { color: var(--muted); padding: 24px 4px; }
.desk-only { display: none; }

@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  body:not(.emp) .top { display: none; }
  .nav { inset: 0 auto 0 0; width: var(--side-w); height: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 10px;
    border-top: 0; border-right: 1px solid var(--line); }
  .nav-head { display: block; padding: 2px 8px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
  .nav-head .agency { margin-top: 4px; white-space: normal; }
  .nav > a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 10px; min-height: 40px; font-size: 15px; border: 0; border-radius: 6px; color: var(--text); }
  .nav > a:hover { background: var(--hover); }
  .nav > a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
  body:not(.emp) .page { margin-left: var(--side-w); }
  main { max-width: 1120px; padding: 22px 32px; }
  body.emp main { max-width: 760px; }
  .desk-only { display: block; }
  .phone-only { display: none; }
}

/* ---------- page pieces ---------- */
.head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead { font-size: 16px; margin: 4px 0 2px; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; text-decoration: none; font-size: 14px; margin: -8px 0 0 -6px; padding-right: 8px; }
.sec { font-size: 15px; color: var(--text); font-weight: 650; margin: 24px 2px 10px; }
.sec .count, .row .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--off-bg); color: var(--off);
  font-size: 12px; font-weight: 650; line-height: 20px; text-align: center; letter-spacing: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; min-height: 52px; width: 100%; color: inherit; text-decoration: none;
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
a.row:hover, button.row:hover { background: var(--hover); }
.list > li:first-child > .row { border-radius: var(--radius) var(--radius) 0 0; }
.list > li:last-child > .row { border-radius: 0 0 var(--radius) var(--radius); }
.row.plain { cursor: default; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .title.normal { font-weight: 500; }
.row .sub { color: var(--muted); font-size: 13px; margin-top: 1px; overflow-wrap: anywhere; }
.row .chev { color: var(--muted); width: 18px; height: 18px; }
.row.all { justify-content: center; color: var(--link); font-weight: 600; min-height: 44px; }
.empty { padding: 20px 16px; color: var(--muted); text-align: center; }
.foot { color: var(--muted); font-size: 13px; margin: 22px 2px 0; }
.fail h2 { margin-bottom: 6px; }

.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px;
  white-space: nowrap; background: var(--off-bg); color: var(--off); border: 1px solid transparent; }
.chip .i { display: none; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.expired { background: var(--expired-bg); color: var(--expired); }
.chip.missing { background: var(--missing-bg); color: var(--missing); }
.chip.due { background: var(--due-bg); color: var(--due); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.review { background: var(--review-bg); color: var(--review); }
.chip.check { background: var(--check-bg); color: var(--check); }
@media (prefers-color-scheme: dark) { .chip { border-color: color-mix(in srgb, currentColor 35%, transparent); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: var(--danger-ink); }
.btn.small { min-height: 36px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .i { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 24px; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
@media (min-width: 900px) { .btn { min-height: 38px; } .btn.small { min-height: 32px; } }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { flex: 1; min-width: 180px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
@media (min-width: 900px) { .search, .seg button { min-height: 38px; } }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0 4px; }
.tile { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-height: 64px; padding: 10px 12px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); }
.tile:hover { background: var(--hover); }
.tile .n { font-size: 24px; font-weight: 650; line-height: 1.1; }
.tile .l { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.tile .l .i { width: 15px; height: 15px; }
.tile.expired { border-left-color: var(--expired); } .tile.missing { border-left-color: var(--missing); }
.tile.due { border-left-color: var(--due); } .tile.review { border-left-color: var(--review); }
.tile[aria-pressed="true"] { border-color: var(--brand); border-left-color: var(--brand); background: var(--brand-soft); }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.filter-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 2px 0; font-size: 14px; }
.quiet .row .title { font-weight: 500; }

.steps .tick { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); color: transparent; }
.steps .done .tick { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.steps .tick .i { width: 15px; height: 15px; stroke-width: 2.4; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; padding: 12px 16px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.hero { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.ring { width: 72px; height: 72px; flex: none; }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--line); }
.ring .val { stroke: var(--brand); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-size: 26px; font-weight: 700; fill: var(--text); text-anchor: middle; dominant-baseline: central; }

/* The staff table (from 900px). Headers are sort buttons; the arrow shows from th[aria-sort]. */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-inline-size: 640px; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; white-space: nowrap; }
.table th:has(> button) { padding: 0; }
.table th button { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 40px; padding: 0 14px; border: 0; background: none; font: inherit; color: inherit;
  text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.table th button:hover { color: var(--text); }
.table th .i { width: 16px; height: 16px; }
.table th .i path { opacity: .45; }
.table th[aria-sort] { color: var(--text); }
.table th[aria-sort="ascending"] .up, .table th[aria-sort="descending"] .dn { opacity: 1; }
.table th[aria-sort="ascending"] .dn, .table th[aria-sort="descending"] .up { opacity: .12; }
.table td a { font-weight: 600; text-decoration: none; }
.table td a:hover { text-decoration: underline; }

/* A small menu: a details element, closed by a click outside or Escape (main.js). */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; min-width: 220px; padding: 4px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 4px 12px rgb(0 0 0 / .12); }
.menu-list button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; }
.menu-list button:hover { background: var(--hover); }
.menu-list button.danger { color: var(--danger); }

.checklist { list-style: none; margin: 0; padding: 4px 0; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 16px; min-height: 44px; cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; }
.pick select { flex: 1; min-width: 180px; }
/* 0.7.0: frozen former staff file, checklists in a sheet, the import check table */
.frozen { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; background: var(--off-bg); }
.frozen > .i { margin-top: 2px; }
.sheet-body .checklist label { padding: 8px 2px; }
.sheet-body .checklist li + li { border-top: 1px solid var(--line); }
.checklist .when { display: block; color: var(--muted); font-size: 13px; }
.import-table { min-inline-size: 560px; font-size: 14px; }
.import-table td { padding: 8px 10px; vertical-align: top; }
.import-table .bad { color: var(--expired); }
.import-table .soft { color: var(--due); }
textarea.paste { width: 100%; min-height: 140px; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.mb { margin-bottom: 12px; }


/* ---------- 0.8.0 ---------- */
.m0b { margin: 0 0 10px; }
.eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.head { margin-bottom: 16px; }
.head .lead { color: var(--text); }
@media (min-width: 900px) { h1 { font-size: 28px; } }

/* top bar: brand + search + settings on a phone; only the search box from 900px (the sidebar has the rest) */
.top { justify-content: flex-start; }
.top-agency { flex: 1; }
.findbox { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; }
.findbox .ph, .findbox kbd { display: none; }
.findbox:hover { background: var(--hover); }
.top-settings { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.top-settings[aria-current="page"] { color: var(--brand); border-color: var(--brand); }
.nav-settings { display: none !important; }
@media (min-width: 900px) {
  body:not(.emp) .top { display: flex; margin-left: var(--side-w); padding: 12px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom-color: var(--line); }
  .top .brand, .top-agency, .top-settings { display: none; }
  .findbox { width: min(480px, 100%); justify-content: flex-start; padding: 0 12px; height: 40px; }
  .findbox .ph { display: inline; flex: 1; text-align: left; font-size: 14px; }
  .findbox kbd { display: inline-block; font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
  .nav-settings { display: flex !important; margin-top: auto; }
  .nav > a { font-weight: 500; }
  .nav > a[aria-current="page"] { font-weight: 650; }
}
body.emp .findbox, body.emp .top-settings { display: none; }

/* the search box */
dialog.finder { position: fixed; inset: 0 0 auto 0; margin: 0; width: 100%; max-width: none; max-height: 100dvh; border: 0; border-radius: 0 0 14px 14px; padding: 0;
  display: none; flex-direction: column; box-shadow: 0 12px 40px rgb(0 0 0 / .25); }
dialog.finder[open] { display: flex; }
dialog.finder::backdrop { background: rgb(10 20 25 / .45); }
.finder-head { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.finder-head input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; color: var(--text); font: inherit; font-size: 17px; outline: none; }
.finder-body { overflow: auto; padding: 4px 14px 16px; max-height: calc(100dvh - 80px); }
.fgroup { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 2px 6px; }
.fhint { margin: 14px 2px; }
.finder-body .card { box-shadow: none; }
@media (min-width: 900px) {
  dialog.finder { inset: 10vh 0 auto 0; margin: 0 auto; width: 640px; border-radius: 14px; border: 1px solid var(--line-strong); }
  .finder-head { padding: 8px 16px; }
  .finder-body { max-height: 60vh; }
}

/* status dot (the label always sits next to it) */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok-fill); }
.dot-due, .dot-soon { background: var(--due-fill); } .dot-expired { background: var(--expired-fill); } .dot-missing { background: var(--missing-fill); }
.dot-review { background: var(--review-fill); } .dot-check { background: var(--check-fill); }

/* Overview: key numbers */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.kpi, .survey-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none; min-width: 0; }
a.kpi:hover, a.survey-card:hover { border-color: var(--line-strong); }
.kl { font-size: 13px; font-weight: 500; color: var(--muted); }
.kn { font-size: 30px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.kn small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.ks { font-size: 13px; color: var(--muted); }
.kpi.bad .kn { color: var(--expired); }
.meter { display: block; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--bar); }
.survey-card { margin-bottom: 4px; }
.survey-card .kn { font-size: 34px; }
.survey-card .btn { align-self: flex-start; margin-top: 6px; }
@media (min-width: 620px) { .survey-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "kl kl btn" "kn meter btn" "kn ks btn"; column-gap: 20px; align-items: center; }
  .survey-card .kl { grid-area: kl; } .survey-card .kn { grid-area: kn; } .survey-card .meter { grid-area: meter; } .survey-card .ks { grid-area: ks; }
  .survey-card .btn { grid-area: btn; margin: 0; } }

/* Overview: panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 14px; min-width: 0; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.panel-h h2 { font-size: 15px; font-weight: 650; }
.panel-b { padding: 12px 16px 16px; }
.panel > .list { margin-top: 6px; border-top: 1px solid var(--line); }
.panel .row .dot { margin: 0 4px 0 2px; }
.grid-2 { display: grid; gap: 0 14px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* stacked status bar + legend */
.stack { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--line); }
.stack > span { min-width: 4px; border-radius: 3px; }
.seg-ok { background: var(--ok-fill); } .seg-due { background: var(--due-fill); } .seg-review { background: var(--review-fill); }
.seg-missing { background: var(--missing-fill); } .seg-expired { background: var(--expired-fill); }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legend a { display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; font-size: 14px; min-height: 32px; }
.legend a:hover .l { text-decoration: underline; }
.legend .n { font-weight: 650; }

/* meters: one per kind of record or team */
.meters { list-style: none; margin: 0; display: grid; gap: 14px; }
.mrow { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.ml { font-weight: 500; } .mv { font-weight: 650; }
.mnote { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* columns: records that end, by month */
.cols { display: flex; align-items: stretch; gap: 10px; height: 170px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 0; min-width: 0; }
.cbw { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-height: 0; }
.cb { width: 70%; max-width: 44px; background: var(--bar); border-radius: 4px 4px 0 0; }
.cv { font-size: 12.5px; font-weight: 650; }
.cl { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 4px; }

/* To do: three views */
.segtabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.segtabs button { display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 56px; padding: 6px 4px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.segtabs button:hover { background: var(--hover); }
.segtabs .n { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.segtabs .l { font-size: 13px; font-weight: 600; }
.segtabs button[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }
.segtabs button[aria-selected="true"] .n { color: var(--brand-ink); }
@media (min-width: 900px) { .segtabs { display: inline-grid; grid-template-columns: repeat(3, 170px); }
  .segtabs button { flex-direction: row; justify-content: center; gap: 8px; min-height: 40px; } .segtabs .n { font-size: 15px; } .segtabs .l { font-size: 14px; } }
.row .what { color: var(--text); font-weight: 500; }
.more-n { flex: none; font-size: 12px; font-weight: 650; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; line-height: 20px; }
.head .actions.desk-only { display: none; }
@media (min-width: 900px) { .head .actions.desk-only { display: flex; } }

/* 0.9.0 sign-in screen */
body.signed-out .nav, body.signed-out .top, body.signed-out .demo-bar { display: none !important; }
body.signed-out { padding-bottom: 0; }
body.signed-out .page { margin-left: 0 !important; }
.login { max-width: 400px; margin: 10vh auto 0; padding: 28px 24px; }
.login h1 { margin: 14px 0 4px; font-size: 24px; }
.login .muted { margin-bottom: 18px; }
.btn.wide { width: 100%; }

/* 0.9.0 agency files */
.flist { list-style: none; margin: 0; padding: 0; }
.flist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.flist li:first-child { border-top: 0; }
.flist .i { width: 16px; height: 16px; color: var(--muted); }
.flist a { font-weight: 600; overflow-wrap: anywhere; }
.panel-h .chip { align-self: center; }

/* 0.9.0 survey guidance */
.guide { margin-bottom: 10px; }
.guide > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary strong { display: block; }
.guide > summary .chev { transition: transform .15s; color: var(--muted); }
.guide[open] > summary .chev { transform: rotate(90deg); }
.guide-b { padding: 0 16px 14px; border-top: 1px solid var(--line); }
.glist { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.glist li { padding-left: 2px; }
.src { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dd { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dd li { display: flex; gap: 8px; align-items: flex-start; }
.dd .i { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.dd.do .i { color: var(--ok); } .dd.dont .i { color: var(--expired); }
.dd-grid h3 { margin: 12px 0 8px; }

/* 0.10.0 Phase B: Upload files + Inbox */
.up-btn { margin: 8px 4px 12px; justify-content: center; }
.top-upload { color: var(--brand); }
.drop { display: block; border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 22px 14px; text-align: center; cursor: pointer; background: var(--surface); }
.drop.over, .drop:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-in { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.up-list { list-style: none; padding: 0; margin: 12px 0; }
.up-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
a.seg-a, .seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--line-strong); }
.seg a.on, .seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.seg .n { font-variant-numeric: tabular-nums; color: var(--muted); }
.seg[role=tablist] { flex-wrap: wrap; max-width: 100%; }
.flags { margin: 0 0 12px; padding: 8px 10px 8px 28px; background: var(--due-bg); color: var(--due); border-radius: 6px; font-size: 14px; }
.att-list { list-style: none; margin: 0 0 12px; padding: 0; }
.att { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.att .chk { display: flex; gap: 8px; align-items: center; }
.att select { width: 100%; min-height: 40px; font-size: 16px; }
.src { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.src q { color: var(--text); }
.warn-t { color: var(--due); }
.danger-t { color: var(--danger); }
.break { overflow-wrap: anywhere; }
.intake { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 12px; }
.intake .doc { display: block; width: 100%; height: 70vh; min-height: 360px; border: 0; border-radius: var(--radius) var(--radius) 0 0; background: #fff; object-fit: contain; }
.pane-doc { overflow: hidden; } .pane-doc details, .pane-doc p { margin: 8px 12px; }
.lines { font-size: 13px; padding-left: 22px; overflow-wrap: anywhere; }
.mobile-only { display: inline-flex; margin-top: 8px; }
@media (max-width: 899px) {
  .intake[data-pane="fields"] .pane-doc, .intake[data-pane="doc"] .pane-fields { display: none; }
}
@media (min-width: 900px) {
  .mobile-only { display: none; }
  main:has(.intake) { max-width: 1240px; }
  .intake { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .pane-doc { position: sticky; top: 12px; }
}
@media print { .nav, .top, .actions, .back { display: none !important; } }
body.emp .office-only { display: none !important; }
@media (min-width: 900px) { .top-upload { display: none; } }
.page-text { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.page-text h3 { margin: 0 0 4px; }
.page-pic { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.page-pic img { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.page-text mark { background: var(--due-bg); color: inherit; border-radius: 3px; padding: 0 2px; }
.page-text .tag { font-size: 11px; color: var(--brand); font-weight: 650; }
.pane-doc { max-height: 80vh; overflow: auto; }

/* 0.12.1 Home (office) and Home (staff): one sentence, the top jobs, big buttons. */
.home-hero { border-radius: 14px; padding: 16px 18px; margin: 4px 0 14px; background: var(--ok-bg); color: var(--ok); }
.home-hero.hh-expired { background: var(--expired-bg); color: var(--expired); }
.home-hero.hh-missing { background: var(--missing-bg); color: var(--missing); }
.home-hero.hh-due { background: var(--due-bg); color: var(--due); }
.home-hero.hh-review { background: var(--review-bg); color: var(--review); }
.home-hero.hh-check { background: var(--check-bg); color: var(--check); }
.hh-big { font-size: 22px; font-weight: 700; line-height: 1.2; }
.hh-sub { margin-top: 4px; font-size: 15px; color: var(--text); }
.home-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 4px; }
@media (min-width: 620px) { .home-tiles { grid-template-columns: repeat(3, 1fr); } }
.home-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 96px; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.home-tile:hover { background: var(--hover); }
.home-tile.pri { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.home-tile.pri:hover { filter: brightness(1.08); }
.home-tile .ht-i { width: 24px; height: 24px; margin-bottom: auto; color: var(--brand); }
.home-tile.pri .ht-i { color: var(--brand-ink); }
.ht-t { font-weight: 650; font-size: 16px; margin-top: 10px; }
.ht-s { font-size: 13px; color: var(--muted); }
.home-tile.pri .ht-s { color: var(--brand-ink); opacity: .85; }
.bigacts { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; }
.bigact { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.bigact:hover { background: var(--hover); }
.bigact .bigact-i { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: none; }
.bigact .title { display: block; font-weight: 650; font-size: 16px; }
.bigact .sub { display: block; font-size: 13px; color: var(--muted); }
.bigact .count { min-width: 26px; padding: 2px 8px; border-radius: 12px; background: var(--expired); color: var(--surface); font-weight: 700; font-size: 13px; text-align: center; }
.bigact.pri { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bigact.pri .sub { color: var(--brand-ink); opacity: .85; }
.bigact.pri .bigact-i { background: color-mix(in srgb, var(--brand-ink) 18%, transparent); color: var(--brand-ink); }
.bigact .chev { color: var(--muted); width: 18px; height: 18px; }
.bigact .grow { flex: 1; min-width: 0; }
.bigacts + .sec, .home-tiles + .list, .list.card + .list.card { margin-top: 14px; }
