/* ArcAngel CRM — navy / gold, carried over from the ArcAngel brand sheet.
   Token names are shared with ArcAngel School Manager (docs/INTERFACE.md §3)
   so a component can be lifted between the two products without rework. */
:root {
  --navy: #0b1f3a;
  --navy-dark: #071627;
  --navy-2: #16345c;
  --navy-3: #22497c;
  --gold: #c9a227;
  --gold-light: #e2c766;
  --gold-2: var(--gold-light);   /* older name, kept so existing rules still resolve */

  /* White-label accent. Decorative edges and rules only — never behind text,
     so any colour a customer picks stays readable. */
  --brand-accent: var(--gold);

  /* White-label header. These default to the ArcAngel palette, so an
     organization that sets nothing is pixel-identical to the platform. When
     one sets a header colour, _brand_style.html overrides them with
     server-computed, contrast-checked shades — see apps/orgs/branding.py. */
  --header-bg: var(--navy);
  --header-ink: #ffffff;
  --header-ink-dim: #dfe6f0;
  --header-muted: #b9c3d4;
  --header-active: var(--gold-light);
  --header-hover: var(--navy-2);

  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #17202b;
  --muted: #5c6470;
  --line: #dde1e8;
  --line-2: #eef1f5;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --ok: #1e6b3c;
  --ok-bg: #e8f4ec;
  --warn: #8a5a00;
  --warn-bg: #fdf3e0;
  --info-bg: #eaf1fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 27, 43, .08), 0 2px 12px rgba(16, 27, 43, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  /* Column layout so the footer sits at the bottom of a short page rather
     than floating halfway up it. */
  min-height: 100vh; display: flex; flex-direction: column;
}

a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
/* A top bar, not a left sidebar (docs/INTERFACE.md §2). */
main.container { padding: 1.25rem; max-width: 1180px; width: 100%; margin: 0 auto; flex: 1; }
main { padding: 1.25rem; max-width: 1180px; width: 100%; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--header-bg); color: var(--header-ink);
  display: flex; align-items: center; gap: 1.25rem;
  padding: .65rem 1.25rem;
  border-bottom: 3px solid var(--brand-accent);
  position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.topbar-collapse { display: flex; align-items: center; gap: 1.25rem; flex: 1; }
.nav-toggle { display: none; }

.brand {
  font-size: 1.1rem; color: var(--header-ink); text-decoration: none;
  letter-spacing: .02em; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .55rem;
}
.brand:hover { text-decoration: none; }
.brand .accent { color: var(--gold); }
/* No colour filter: the crest assets are already the right colour for the
   header they sit on, and a filter would flatten the mark's interior detail
   to a silhouette — and would recolour a tenant's own logo. */
.brand-logo { height: 28px; width: auto; max-width: 180px; display: block; border-radius: 3px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }

.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.topbar nav a {
  color: var(--header-ink-dim); text-decoration: none; padding: .35rem .7rem;
  border-radius: 6px; font-size: .95rem;
}
.topbar nav a:hover { background: var(--header-hover); color: var(--header-ink); text-decoration: none; }
.topbar nav a.active { background: var(--header-hover); color: var(--header-active); }
.topbar nav a.nav-cta {
  background: var(--gold); color: var(--navy); font-weight: 600;
}
.topbar nav a.nav-cta:hover { background: var(--gold-light); color: var(--navy); }
.topbar .whoami { color: var(--header-muted); font-size: .85rem; }

/* Grouped navigation. <details> opens without JavaScript and is
   keyboard-navigable by default, which a custom dropdown would have to
   re-earn. */
.menu { position: relative; display: inline-block; }
.menu summary {
  list-style: none; cursor: pointer; color: var(--header-ink-dim);
  padding: .35rem .7rem; border-radius: 6px; font-size: .95rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--header-hover); color: var(--header-ink); }
.menu[open] summary { background: var(--header-hover); color: var(--header-active); }
.menu .menu-items {
  position: absolute; top: 100%; left: 0; margin-top: .25rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); min-width: 190px; padding: .3rem; z-index: 40;
}
.menu .menu-items a {
  display: block; color: var(--ink); padding: .45rem .6rem;
  border-radius: 6px; text-decoration: none; font-size: .92rem;
}
.menu .menu-items a:hover { background: var(--navy); color: #fff; text-decoration: none; }

.profile-menu { margin-left: auto; }
.profile-trigger { display: inline-flex; align-items: center; gap: .5rem; }
.profile-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--header-hover); color: var(--header-ink);
  font-size: .8rem; font-weight: 700; overflow: hidden;
}
.profile-menu .menu-items { left: auto; right: 0; min-width: 240px; }
.profile-items .profile-head { padding: .5rem .6rem .4rem; }
.profile-items .profile-head strong { color: var(--navy); }
.profile-items .profile-head .muted { font-size: .82rem; }
.profile-items hr { border: 0; border-top: 1px solid var(--line); margin: .35rem 0; }
.profile-switch { padding: .2rem .6rem .4rem; }
.profile-switch label { display: block; color: var(--muted); font-size: .78rem;
                        text-transform: uppercase; letter-spacing: .03em; }
.profile-switch select { width: 100%; margin-top: .2rem; padding: .35rem .4rem;
                         border: 1px solid var(--line); border-radius: 6px; }
.profile-signout { padding: .1rem; }
.profile-signout button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--ink); padding: .45rem .6rem; border-radius: 6px; cursor: pointer;
  font-size: .92rem; font-family: inherit;
}
.profile-signout button:hover { background: var(--navy); color: #fff; }

/* ---------- components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > header {
  padding: .7rem 1rem; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: .6rem;
}
.card > header h2, .card > header h3 { margin: 0; font-size: .98rem; }
.card > header .spacer { flex: 1; }
.card .body { padding: 1rem; }
.card .body.tight { padding: .5rem 1rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.dash { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 980px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- tablet and phone ---------- */
@media (max-width: 760px) {
  /* The top bar collapses behind a hamburger. */
  .topbar { flex-wrap: wrap; gap: .4rem .6rem; padding: .55rem .9rem; }
  .brand { margin-right: auto; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    background: none; border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 7px; padding: 8px 9px; cursor: pointer;
  }
  .nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--header-ink); border-radius: 2px; }
  .topbar-collapse {
    display: none; flex-basis: 100%; flex-direction: column;
    align-items: stretch; gap: .15rem; padding-top: .3rem;
  }
  .topbar-collapse.open { display: flex; }
  .topbar-collapse .spacer { display: none; }
  .topbar-collapse nav { flex-direction: column; align-items: stretch; width: 100%; gap: .1rem; }
  .topbar-collapse nav a { padding: .6rem .7rem; border-radius: 6px; }
  .topbar-collapse form { width: 100%; margin: .2rem 0 0; }

  /* Grouped items become an inline accordion rather than an overlay: a
     dropdown that opens off the side of a phone is unreachable. */
  .menu, .profile-menu { width: 100%; margin-left: 0; }
  .menu summary { padding: .6rem .7rem; }
  .menu .menu-items {
    position: static; box-shadow: none; border: 0; min-width: 0;
    background: rgba(255, 255, 255, .08); margin: .1rem 0 .2rem;
  }
  .menu .menu-items a, .profile-signout button { color: var(--header-ink-dim); }
  .menu .menu-items a:hover, .profile-signout button:hover { background: var(--navy-dark); color: #fff; }
  .profile-items .profile-head strong { color: var(--header-ink); }
  .profile-name { max-width: none; }

  main.container { padding: 1rem .9rem 2.5rem; }
  h1 { font-size: 1.35rem; }
  table.data { display: block; overflow-x: auto; white-space: nowrap; }
}

.page-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.page-head p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: .88rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f7f9fc; text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2b2000; font-weight: 600; }
.btn.gold:hover { background: var(--gold-2); }
.btn.danger { color: var(--danger); border-color: #e7bdb9; background: #fff; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.small { padding: .25rem .55rem; font-size: .8rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: var(--line-2); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--navy-3); }
.badge.gold { background: #fbf1d4; color: #7a6111; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
tbody tr:hover { background: #fafbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a {
  padding: .3rem .7rem; border-radius: 999px; font-size: .85rem; color: var(--muted); border: 1px solid transparent;
}
.tabs a:hover { background: #fff; text-decoration: none; }
.tabs a.active { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .75rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; box-shadow: var(--shadow); }
.tile .label { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile .value { font-size: 1.65rem; font-weight: 660; line-height: 1.15; margin-top: .15rem; }
.tile .sub { font-size: .8rem; color: var(--muted); }
.tile a { color: inherit; }

.messages { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.msg { padding: .6rem .85rem; border-radius: 8px; border: 1px solid; font-size: .9rem; }
.msg.success { background: var(--ok-bg); border-color: #bfe0cc; color: var(--ok); }
.msg.error { background: var(--danger-bg); border-color: #eec3bf; color: var(--danger); }
.msg.warning { background: var(--warn-bg); border-color: #efd9a8; color: var(--warn); }
.msg.info { background: var(--info-bg); border-color: #c6d8f3; color: var(--navy-3); }

.banner { padding: .55rem 1.25rem; font-size: .88rem; display: flex; gap: .75rem; align-items: center; }
.banner.viewas { background: var(--gold); color: #2b2000; }
.banner.support { background: var(--danger-bg); color: var(--danger); border-bottom: 1px solid #e7bdb9; }
.banner.beta { background: var(--navy-3); color: #fff; }
.banner.readonly { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #efd9a8; }
.banner form { margin: 0; }

/* ---------- forms ---------- */
form .helptext { display: block; font-size: .8rem; color: var(--muted); margin-top: .15rem; }
label { font-weight: 600; font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px; font: inherit;
  font-size: .9rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-3); outline-offset: 1px; border-color: var(--navy-3); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .85rem; }
.form-grid > div, .field { min-width: 0; }
.field { margin-bottom: .85rem; }
.field > label { display: block; margin-bottom: .2rem; }
.errorlist { list-style: none; margin: .2rem 0 0; padding: 0; color: var(--danger); font-size: .82rem; }
form ul.errorlist li { margin: 0; }
.checkbox-row { display: flex; align-items: center; gap: .45rem; }
.checkbox-row input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin: 0 0 1rem; background: #fff; }
legend { font-weight: 650; font-size: .92rem; padding: 0 .35rem; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=search], .filters input[type=text] { width: 220px; }

/* Django's div-based form rendering */
form .field-wrap > div { margin-bottom: .85rem; }
form div > label { display: block; margin-bottom: .2rem; font-weight: 600; font-size: .85rem; }
form div.checkbox label { display: inline; }

.empty { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .9rem; }
.definition { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: .35rem .9rem; font-size: .9rem; }
.definition dt { color: var(--muted); }
.definition dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .87rem; }
.timeline li { padding: .4rem 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }

.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .6rem; }
.unit {
  border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .7rem; background: #fff;
  display: block; color: inherit; border-left: 4px solid var(--line);
}
.unit:hover { text-decoration: none; box-shadow: var(--shadow); }
.unit b { display: block; }
.unit.occupied { border-left-color: var(--ok); }
.unit.available { border-left-color: var(--navy-3); }
.unit.to_be_cleaned { border-left-color: var(--gold); }
.unit.under_maintenance { border-left-color: var(--warn); }
.unit.unavailable { border-left-color: var(--muted); opacity: .7; }

.bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--navy-3); }
.bar.gold > span { background: var(--gold); }

.spark { display: block; }
.spark .line { fill: none; stroke: var(--navy-3); stroke-width: 2; }
.spark .area { fill: rgba(34, 73, 124, .1); }
.spark .line.debt { stroke: var(--danger); }
.spark .area.debt { fill: rgba(179, 38, 30, .08); }

details.drill { border-top: 1px solid var(--line-2); }
details.drill > summary { cursor: pointer; padding: .4rem 0; font-size: .85rem; color: var(--navy-3); }

/* ---------- public pages ---------- */
.public { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.public-head { background: var(--header-bg); color: var(--header-ink); padding: 1.1rem 0;
               border-bottom: 3px solid var(--brand-accent); }
.public-head .subtitle { color: var(--header-muted); }
.public-head .inner { max-width: 760px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; gap: .75rem; }
.public-head img { width: 34px; }
.hero { background: var(--navy); color: #fff; padding: 3.5rem 1rem; }
.hero .inner { max-width: 1000px; margin: 0 auto; }
.hero h1 { font-size: 2.3rem; max-width: 20ch; }
.hero p { font-size: 1.05rem; color: #c9d5e6; max-width: 60ch; }
.hero .rule { width: 64px; height: 3px; background: var(--gold); margin: 1.2rem 0; }
.marketing { max-width: 1000px; margin: 0 auto; padding: 2.5rem 1rem; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.feature h3 { margin-bottom: .3rem; }
.feature p { font-size: .9rem; color: var(--muted); margin: 0; }
footer.site { border-top: 1px solid var(--line); padding: 1.5rem 1rem; color: var(--muted); font-size: .85rem; text-align: center; }

/* ---------- legal documents ---------- */
/* Longer measure and looser leading than the app: these are read, not scanned. */
.legal { max-width: 780px; margin: 0 auto; }
.legal h1 { margin-bottom: .25rem; }
.legal h2 { font-size: 1.05rem; margin: 1.6rem 0 .5rem; }
.legal h3 { font-size: .95rem; margin: 1.1rem 0 .35rem; color: var(--navy-2); }
.legal p, .legal li { line-height: 1.65; }
.legal ul { margin: .4rem 0 .8rem; padding-left: 1.25rem; }
.legal li { margin: .3rem 0; }
.legal ul ul { margin: .35rem 0 .5rem; }
.legal-meta { color: var(--muted); font-size: .9rem; margin-top: 0; }
.legal-draft {
  background: var(--warn-bg); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: .75rem .9rem; font-size: .92rem;
}
.legal-nav {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 0 0 1.5rem;
  padding-bottom: .75rem; border-bottom: 1px solid var(--line);
}
.legal-nav a { font-size: .88rem; color: var(--navy-3); }
.legal-contact { color: var(--muted); font-size: .9rem; }
.legal hr { border: none; border-top: 1px solid var(--line); margin: 1.75rem 0 1rem; }
footer.site a { color: var(--muted); text-decoration: underline; }

/* --- Public pricing page (ADR-0005) ------------------------------------- */
.estimator-card { margin-bottom: 1.5rem; }
.est-label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: .5rem; }
#revenue { width: 100%; accent-color: var(--navy-3); margin: 0; }
.est-scale {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: var(--muted); margin: .2rem 0 1rem;
}
.est-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .9rem; margin: 0; }
.est-revenue { font-size: 1.35rem; font-weight: 600; color: var(--navy); }
.est-price { font-size: 1.35rem; color: var(--navy-3); }
.est-price strong { font-size: 1.7rem; }
.est-detail { flex-basis: 100%; font-size: .88rem; color: var(--muted); }
.est-caveat { font-size: .82rem; margin: 1rem 0 0; }

table.bands { width: 100%; border-collapse: collapse; background: #fff;
              border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.bands caption { caption-side: bottom; padding: .7rem .2rem 0; font-size: .85rem; text-align: left; }
table.bands th, table.bands td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
table.bands thead th { background: var(--navy); color: #fff; font-size: .82rem;
                       font-weight: 600; text-align: left; border-bottom: none; }
table.bands tbody tr:last-child td { border-bottom: none; }
table.bands .num { text-align: right; }
table.bands thead th.num { text-align: right; }
/* The highlight is a left rule plus a tint: a tint alone would be the only
   signal, and it disappears in high-contrast mode and on a bad projector. */
table.bands tbody tr.is-current { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--gold); }
table.bands tbody tr.is-current td { font-weight: 600; }

/* The table scrolls inside its own box rather than pushing the page sideways.
   A pricing table that makes the whole document scroll horizontally reads as
   broken, and on a phone it hides the column a reader came for. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* The struck-out list price sits beside the payable one. Muted and lighter, so
   the number a reader takes away is the one they would actually be charged. */
.was { color: var(--muted); font-weight: 400; margin-right: .35rem; }

@media (max-width: 560px) {
  .est-revenue, .est-price { font-size: 1.1rem; }
  .est-price strong { font-size: 1.35rem; }
  table.bands th, table.bands td { padding: .45rem .5rem; font-size: .85rem; }
  /* Included storage is the least-asked column and is already spelled out in
     the estimator readout above, so it is the one to drop on a narrow screen
     rather than squeezing five columns into 375px. */
  table.bands .storage-col { display: none; }
}

/* --- Social Security number (apps/common/ssn.py) ------------------------- */
.ssn-line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; margin: 0 0 .5rem; }
/* The revealed state looks different on purpose: somebody glancing at a shared
   screen should be able to tell at once that a real number is showing. */
.ssn-line.revealed { background: var(--warn-bg); border-left: 3px solid var(--gold);
                     padding: .4rem .6rem; font-weight: 600; }

/* --- Two-factor (ARC-033) ----------------------------------------------- */
.mfa-qr { background: #fff; padding: .75rem; border: 1px solid var(--line);
          border-radius: var(--radius); max-width: 15rem; }
.mfa-qr svg { width: 100%; height: auto; display: block; }
.mfa-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem;
              letter-spacing: .08em; word-break: break-all; background: var(--warn-bg);
              padding: .5rem .7rem; border-radius: var(--radius); }
.mfa-codes { list-style: none; padding: 0; margin: 1rem 0; display: grid;
             grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .4rem; }
.mfa-codes li { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem;
                background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
                padding: .4rem .6rem; text-align: center; }

/* --- Utilities (ARC-041) ------------------------------------------------ */
/* These were inline style attributes. The Content-Security-Policy does not allow
   those — a nonce covers a <style> element, never an attribute — so each became
   a class here. `!important` is deliberate and confined to this block: an
   inline style beat every stylesheet rule, and these must keep doing so or a
   page quietly changes shape wherever a component rule happens to be more
   specific. Do not add a style attribute to a template; add a class here. */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .35rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: .75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.5rem !important; }
.mt-6 { margin-top: 2rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: .75rem !important; }
.pt-3 { padding-top: .75rem !important; }
.pad-head { padding: .5rem 1rem 0 !important; }
.pad-head-tight { padding: .5rem .65rem 0 !important; }
.measure-34 { max-width: 34rem !important; }
.measure-38 { max-width: 38rem !important; }
.measure-480 { max-width: 480px !important; }
.measure-560 { max-width: 560px !important; }
.measure-640 { max-width: 640px !important; }
.measure-760 { max-width: 760px !important; }
.measure-820 { max-width: 820px !important; }
.w-44 { width: 44px !important; }
.w-70 { width: 70px !important; }
.w-130 { width: 130px !important; }
.w-140 { width: 140px !important; }
.grow { flex: 1 !important; }
.inline { display: inline !important; }
.gap-tight { gap: .4rem !important; }
.justify-end { justify-content: flex-end !important; }
.text-lg { font-size: 1.1rem !important; }
.text-xl { font-size: 1.4rem !important; }
.text-danger { color: var(--danger) !important; }
.border-gold { border-color: var(--gold) !important; }
.figure { font-size: 1.3rem !important; font-weight: 650 !important; }
.auth-panel { max-width: 420px !important; margin: 2rem auto !important; }
.auth-panel.wide { max-width: 480px !important; margin: 1.5rem auto !important; }
.btn-block { width: 100% !important; justify-content: center !important; margin-top: .5rem !important; }
.tile-flat { flex: 1 !important; box-shadow: none !important; border: 0 !important; }
.brand-link { gap: .6rem !important; color: inherit !important; text-decoration: none !important; }
.landing-link { color: #c9d5e6 !important; margin-right: 1rem !important; }
.logo-preview { max-width: 100% !important; max-height: 90px !important; }
.divider { border: 0 !important; border-top: 1px solid var(--line-2) !important; margin: 1rem 0 !important; }
/* The honeypot field on the public inquiry form: present for a bot that fills
   in every input, absent for a person. */
.offscreen { position: absolute !important; left: -9999px !important; }
/* Progress bars, in steps of 5%. A width computed per page cannot be a style
   attribute any more, and nobody reads a savings bar to the nearest percent. */
.bar > .pct-0 { width: 0%; }
.bar > .pct-5 { width: 5%; }
.bar > .pct-10 { width: 10%; }
.bar > .pct-15 { width: 15%; }
.bar > .pct-20 { width: 20%; }
.bar > .pct-25 { width: 25%; }
.bar > .pct-30 { width: 30%; }
.bar > .pct-35 { width: 35%; }
.bar > .pct-40 { width: 40%; }
.bar > .pct-45 { width: 45%; }
.bar > .pct-50 { width: 50%; }
.bar > .pct-55 { width: 55%; }
.bar > .pct-60 { width: 60%; }
.bar > .pct-65 { width: 65%; }
.bar > .pct-70 { width: 70%; }
.bar > .pct-75 { width: 75%; }
.bar > .pct-80 { width: 80%; }
.bar > .pct-85 { width: 85%; }
.bar > .pct-90 { width: 90%; }
.bar > .pct-95 { width: 95%; }
.bar > .pct-100 { width: 100%; }

@media print {
  .topbar, .btn, .tabs, .filters { display: none !important; }
  body { background: #fff; }
  .legal-nav, .public-head { display: none !important; }
}

/* A checkbox column in a settings table: narrow, so the label does the work
   of being clickable (ARC-030). A class rather than a style attribute,
   because the policy forbids inline styles (ARC-041). */
.tickbox { width: 2.5rem; }

/* Forms (ARC-046): a filled-in form reads as one column on a phone. */
.form-section legend { font-size: 1rem; }
.form-entry + .form-entry { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .75rem; }
.form-entry h4 { margin: 0 0 .5rem; font-size: .92rem; }
.form-total { margin: .75rem 0 0; }
.form-prompt { margin: .75rem 1rem 0; }
.add-question select { width: auto; }
.filled-form input[type=number], .filled-form input[type=date], .filled-form input[type=time] { max-width: 14rem; }
/* The save buttons stay reachable at the bottom of a long form on a phone. */
.sticky-actions { position: sticky; bottom: 0; background: var(--bg, #fff); padding: .6rem 0; margin-top: 1rem; }
.totals meter { display: block; width: 100%; min-width: 4rem; height: .5rem; margin-top: .2rem; }

/* ---------- accessibility (ARC-135, WCAG 2.2 AA) ---------- */
/* First thing a keyboard reaches: past the navigation, straight to the page. */
.skip-link {
  position: absolute; left: .75rem; top: -3rem; z-index: 100;
  background: var(--navy); color: #fff; padding: .5rem .8rem; border-radius: 8px;
}
.skip-link:focus { top: .5rem; }
main:focus { outline: none; }

/* Where the keyboard is, always visible — on every control, not only inputs. */
a:focus-visible, button:focus-visible, summary:focus-visible, .btn:focus-visible,
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px;
}

/* 2.5.8: nothing to tap is smaller than 24 × 24. */
.btn.small { min-height: 1.75rem; }
input[type=checkbox], input[type=radio] { min-width: 1.1rem; min-height: 1.1rem; }

/* On a touch screen, buttons are thumb-sized. */
@media (pointer: coarse) {
  .btn { min-height: 2.75rem; }
  .btn.small { min-height: 2.25rem; }
}

/* 16 px on a phone: anything smaller and iOS zooms the page when a field is
   tapped, and a night manager loses their place in the form. */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 1.4.10 reflow: nothing scrolls sideways at 320 px except a table, inside its
   own box. A grid column sized `1fr` will not shrink below its widest child, so
   one wide table used to stretch the whole page (ARC-135). */
.dash > *, .grid > *, .stack > *, .card { min-width: 0; }
.card .body { overflow-x: auto; }
/* Shown once, so it has to be readable and selectable at a glance (ARC-083). */
.passphrase code { display: block; font-size: 1.25rem; letter-spacing: .06em; word-break: break-all;
  background: var(--line-2); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; }
