/* ═══════════════════════════════════════════════════════════════════════════
   Design tokens
   ═══════════════════════════════════════════════════════════════════════════
   Everything below this block consumes these and sets no raw values of its own.
   Three things were wrong before and each has a token answer:

   Type   thirteen sizes between 9.5px and 16px meant nothing had rank, which is
          what made the app read as flat. Six steps, each a clear jump from the
          last, so a heading is obviously a heading.
   Space  every rule picked its own padding, so nothing lined up. One 4px-based
          scale; if a value isn't on it, it's wrong.
   Colour one accent did links, buttons, focus, nav and charts, so nothing could
          be emphasised because everything already was. Now: a neutral ramp for
          structure, one accent for action, three semantic colours reserved for
          state and never used decoratively.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* type — 1.25 ratio, rounded to whole px */
  --fs-xs:   11px;   /* labels, badges, table heads   */
  --fs-sm:   12.5px; /* meta, captions                */
  --fs-base: 14px;   /* body                          */
  --fs-md:   16px;   /* card titles                   */
  --fs-lg:   20px;   /* page titles                   */
  --fs-xl:   28px;   /* stat figures                  */
  --lh-tight: 1.25;
  --lh-base:  1.55;

  /* space — 4px base */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px;

  /* neutral ramp */
  --n-0:  #ffffff;
  --n-25: #fafbfd;
  --n-50: #f4f6fa;
  --n-100:#eaeef5;
  --n-200:#dde3ec;
  --n-300:#c3ccda;
  --n-400:#95a1b3;
  --n-500:#5d6b7e;
  --n-700:#2c3a4d;
  --n-900:#16202e;

  /* roles */
  --bg: var(--n-50);
  --panel: var(--n-0);
  --panel-sunk: var(--n-25);
  --ink: var(--n-900);
  --ink-2: var(--n-700);
  --muted: var(--n-500);
  --line: var(--n-200);
  --line-soft: var(--n-100);

  --accent: #1b4f9c;
  --accent-hover: #15407f;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fc;
  --sky: #4f8fdc;          /* second stop of the accent gradient on bars */

  /* semantic — reserved for state, never decoration */
  --good: #1f7a5a;   --good-soft: #e3f3ed;
  --warn: #8a5a00;   --warn-soft: #fbf0dd;
  --error: #a4262c;  --error-soft: #fbe9ea;

  /* elevation — two levels, no more */
  --e-1: 0 1px 2px rgba(22,32,46,.05), 0 1px 3px rgba(22,32,46,.04);
  --e-2: 0 2px 4px rgba(22,32,46,.06), 0 8px 24px -12px rgba(22,32,46,.22);

  --r-sm: 5px; --r-md: 9px; --r-lg: 13px; --r-pill: 999px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-base);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --n-0:  #1b2028;  --n-25: #191e25;  --n-50: #14181e;
    --n-100:#232932;  --n-200:#2d3540;  --n-300:#3d4756;
    --n-400:#6b7889;  --n-500:#93a0b2;  --n-700:#c6cfdb;  --n-900:#e8edf4;
    --accent: #6ea8f0; --accent-hover: #8bbcf6; --accent-ink: #0f1620;
    --accent-soft: #1d2b40;
    --sky: #9cc7f7;
    --good: #5cc0a0; --good-soft: #172b27;
    --warn: #d9a441; --warn-soft: #2d2617;
    --error: #e8797f; --error-soft: #2e1b1d;
    --e-1: 0 1px 2px rgba(0,0,0,.35);
    --e-2: 0 2px 6px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
/* Links had no colour of their own: browser blue/purple, unreadable on the dark theme. */
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--error); margin: 0; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { margin: 0; font-size: 1.5rem; }
.login-card p { margin: -8px 0 4px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
input {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 9px 10px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  font: inherit; cursor: pointer; border: 0; border-radius: var(--r-md); padding: 10px 14px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
button:disabled { opacity: 0.6; cursor: default; }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; text-decoration: underline; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
/* The wordmark, in the sidebar and on the sign-in card. The supplied logo is white on opaque
   black, which would be a black rectangle on the white sidebar, so scripts/make_logo.py turns its
   luminance into an alpha channel and tints it: logo-ink.png for the light theme, logo-white.png
   for the dark one, swapped by <picture>. The text wordmark stands in until they load, so a
   missing file never shows as a broken image. */
.brand { font-weight: 700; font-size: 1.15rem; padding: 0 8px 14px; margin: 0; color: var(--accent); }
.brand picture { display: none; }
.brand .brand-logo { display: block; width: 100%; height: auto; vertical-align: top; }
.brand.has-logo picture { display: block; }
.brand.has-logo .brand-text { display: none; }
.login-card .brand { padding: 0 0 2px; }
.sidebar a, .sidebar .soon { padding: 7px 8px; border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.sidebar a.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar .soon { color: var(--muted); opacity: 0.6; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
/* 1000px clipped the lease and rent-roll tables (Term cut off) while leaving a third of a wide screen empty. */
main { padding: 28px 32px; max-width: 1320px; min-width: 0; }
main h2 { margin-top: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.card h3 { margin: 0 0 10px; font-size: 1rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }

@media (max-width: 700px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
  .brand { width: 100%; padding-bottom: 6px; }
  .sidebar-foot { margin-top: 0; width: 100%; flex-direction: row; justify-content: space-between; }
  main { padding: 20px 16px; }
  /* On a phone the sidebar is a wrapping row and every area label forces a full-width break, so
     the nav can eat the screen before any content shows. Drop what can't be tapped: the "coming"
     placeholders. */
  .sidebar .soon { display: none; }
  /* The sidebar is a wrapping row on a phone, so the active section's pages flow across it. */
  .nav-group { flex-direction: row; flex-wrap: wrap; width: 100%; }
}

/* ── Phase 1 ─────────────────────────────────────────────────────────────── */
.small { font-size: 0.8rem; }
.nav-label { margin: 16px 8px 2px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
/* The first area sits right under the wordmark; the brand already carries the gap. */
.brand + .nav-label { margin-top: 2px; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { padding: 10px 32px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }

/* ── section tabs ──
   The four areas of the business, across the top. The sidebar below shows only the active
   section's pages, so switching section changes the whole left column instead of scrolling one
   long list of everything. */
.sections { display: flex; gap: 2px; margin: 0 0 10px -10px; overflow-x: auto; scrollbar-width: none; }
.sections::-webkit-scrollbar { display: none; }
.sections a {
  padding: 7px 10px; border-radius: var(--r-md); text-decoration: none; white-space: nowrap;
  color: var(--muted); font-size: 0.9rem; font-weight: 500;
}
.sections a:hover { color: var(--ink); }
.sections a.active { color: var(--accent-ink); font-weight: 650; background: var(--accent); }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group[hidden] { display: none; }
.topbar input { width: 100%; max-width: 560px; }
main { width: 100%; }
main:focus { outline: none; }

button.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
button.danger { background: none; color: var(--error); border: 1px solid var(--line); font-weight: 500; }
button.small, .small-btn { padding: 5px 10px; font-size: 0.85rem; }
select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 10px; }
textarea { width: 100%; min-height: 80px; resize: vertical; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; }
.page-head .sub { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1 1 220px; max-width: 320px; }
.toolbar label.check { flex-direction: row; align-items: center; gap: 6px; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
table { border-collapse: collapse; width: 100%; }
/* Cells used to be nowrap, so one long property or tenant name pushed Term/Rent/Balance off the
   right edge at laptop widths. Text cells wrap now; figures stay on one line (td.num, below). */
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border-bottom-color: var(--accent-soft);
}
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.badge.high, .badge.overdue, .badge.urgent, .badge.past-due { color: var(--error); border-color: currentColor; }
.badge.occupied, .badge.done, .badge.active { color: var(--accent); border-color: currentColor; }
.badge.holdover, .badge.notice, .badge.vacant { color: var(--warn); border-color: currentColor; }
/* draft, expired, terminated, cancelled, new, assigned, in_progress keep the muted default */

/* ── money ──
   Owed and paid have to be told apart at a glance, and a red figure that only means "negative"
   would flag a tenant who paid ahead as a problem. Red is reserved for money actually overdue. */
td.owed, .owed { color: var(--error); font-variant-numeric: tabular-nums; }
td.credit, .credit { color: var(--accent); font-variant-numeric: tabular-nums; }
.voided { text-decoration: line-through; color: var(--muted); }
.ledger-foot td { border-top: 2px solid var(--line); font-weight: 650; }
tr.vacant-row td { color: var(--muted); }

/* ── totals strip above a report ── */
.totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 16px; }
.totals .t .v { font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.totals .t .k { color: var(--muted); font-size: 0.78rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.stat .v { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 0.82rem; }
.stat.alert .v { color: var(--error); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.card + .card, .card + .table-wrap, .table-wrap + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; }
.fields .f .k { color: var(--muted); font-size: 0.78rem; }
.fields .f .v { word-break: break-word; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0 14px; flex-wrap: wrap; }
.tabs button { background: none; color: var(--muted); border-radius: var(--r-md) 6px 0 0; font-weight: 500; }
.tabs button[aria-selected=true] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.note-body { white-space: pre-wrap; word-break: break-word; }
.meta { color: var(--muted); font-size: 0.8rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.meta button.link { font-size: 0.8rem; }
.pinned { border-left: 3px solid var(--accent); padding-left: 10px !important; }
.task-row { display: flex; gap: 10px; align-items: flex-start; }
.task-row input[type=checkbox] { margin-top: 4px; width: 16px; height: 16px; }
.task-row .done-title { text-decoration: line-through; color: var(--muted); }
.task-row .t-who { font-weight: 600; color: var(--ink); }
.task-row input[type=checkbox]:disabled { opacity: .35; cursor: not-allowed; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* The property/unit picker: two selects that should read as one control, and wrap together
   rather than stranding the unit on its own line. */
.attach { display: inline-flex; gap: 6px; flex: 1 1 320px; min-width: 0; }
.attach > select { flex: 1 1 0; min-width: 0; }
.attach > select:disabled { color: var(--muted); }
.form-grid .attach { display: flex; }
.add-row > input, .add-row > textarea { flex: 1 1 240px; }
.add-row .assign-to { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.snippet { color: var(--muted); font-size: 0.88rem; }
.search-group h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 18px 0 6px; }

dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(640px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
#modal-form { padding: 22px; display: flex; flex-direction: column; gap: 12px; max-height: 85vh; overflow-y: auto; }
#modal-form h3 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; margin: 6px 0 -4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.form-grid .invalid input, .form-grid .invalid select { border-color: var(--error); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

#toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-md); z-index: 10; }

@media (max-width: 700px) {
  .topbar { padding: 8px 16px 12px; }
  .nav-label { width: 100%; }
  .sections { margin-left: -8px; }
}

/* ── property map ─────────────────────────────────────────────────────────── */

.map-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.map-head h1 { margin-bottom: 0; }

.map-canvas {
  height: min(68vh, 700px);
  min-height: 340px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  /* Leaflet paints tiles and controls in stacking contexts of its own; without this the
     rounded corners are drawn over by the tile layer. */
  overflow: hidden;
  z-index: 0;
}

.map-legend {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 10px; font-size: var(--fs-sm); color: var(--muted);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot-approx { border: 2px dashed var(--muted); background: transparent; width: 12px; height: 12px; }
.map-legend-approx { color: var(--muted); }

.map-empty { margin-top: 14px; color: var(--muted); }

.map-missing { margin-top: 14px; font-size: var(--fs-base); }
.map-missing summary { cursor: pointer; color: var(--muted); }
.map-missing ul { margin: 10px 0 0; padding-left: 18px; }
.map-missing li { margin-bottom: 4px; }

/* Popup contents. Leaflet supplies the bubble; these style what goes inside it. */
.map-pop { font-size: var(--fs-sm); line-height: 1.5; }
.map-pop-name { font-weight: 600; font-size: var(--fs-base); text-decoration: none; }
.map-pop-addr { color: var(--muted); margin-top: 2px; }
.map-pop-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); }
.map-pop-rows {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 12px;
  margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line);
}
.map-pop-rows dt { color: var(--muted); }
.map-pop-rows dd { margin: 0; }
.map-pop-warn { margin-top: 8px; color: var(--warn); }
.map-pop-open { display: inline-block; margin-top: 10px; font-weight: 500; }

/* ── Phase 3: vendors, sharing, ownership, asset numbers, development ───── */
h4 { margin: 14px 0 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; margin: 8px 0; }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 0.9rem; }
.composer { margin-bottom: 12px; }
.composer .add-row { margin-bottom: 8px; }
details.share summary { cursor: pointer; color: var(--muted); }
.note-title { font-weight: 600; margin-bottom: 2px; }
.list > li.unread { border-left: 3px solid var(--error); padding-left: 10px; }
.impact { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.impact.risk { color: var(--error); }
td.rank { font-weight: 650; font-variant-numeric: tabular-nums; }
tr.entity-row td { background: var(--bg); font-weight: 600; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 10px; overflow-x: auto;
  padding-bottom: 8px; margin-bottom: 16px; }
.board-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; min-height: 90px; }
.board-col h4 { margin: 0 0 8px; }
.dev-card { display: block; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 10px; margin-bottom: 8px;
  color: var(--ink); text-decoration: none; background: var(--bg); }
.dev-card:hover { border-color: var(--accent); }
.dev-name { font-weight: 600; margin-bottom: 2px; }
.progress { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--sky)); }
.stage-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.stage-bar span { font-size: 0.75rem; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.stage-bar span.past { color: var(--accent); border-color: var(--accent); }
.stage-bar span.now { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
details > summary { cursor: pointer; padding: 6px 0; font-weight: 500; }

/* ── Batch B: calendar, capital plan bars, printable reports ─────────────── */
.cal-date { min-width: 96px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; padding-top: 2px; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 48px 1fr 110px; gap: 10px; align-items: center; }
.bar-label { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--sky)); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
@media print {
  .sidebar, .topbar, .no-print, #toast { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card, .totals, .table-wrap { break-inside: avoid; border-color: #ccc; }
  body { background: #fff; color: #000; }
}

/* ── Helpful info ────────────────────────────────────────────────────────── */
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin: 6px 0; white-space: pre-wrap;
  overflow-x: auto; }
.formula.example { color: var(--muted); }
.help-item { border-bottom: 1px solid var(--line); }
.help-item:last-child { border-bottom: 0; }
.help-item > summary { padding: 8px 0; }
.help-body { padding: 0 0 10px 4px; }

/* ── asset management ─────────────────────────────────────────────────────── */

.am-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 18px; }
.am-filter { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.am-filter select { font-size: var(--fs-base); padding: 5px 8px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--panel); color: var(--ink); min-width: 150px; }

.am-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 8px; }
.am-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.am-tile.warn { border-left: 3px solid var(--warn); }
.am-v { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.01em; }
.am-k { font-size: var(--fs-sm); color: var(--ink); margin-top: 2px; }
.am-hint { font-size: var(--fs-sm); color: var(--muted); margin-top: 3px; }
.am-note { font-size: var(--fs-sm); color: var(--warn); margin: 10px 0 0; }
.am-asof { font-size: var(--fs-sm); margin-top: 26px; }

/* Rollover. One series, so one hue — a second colour would imply a distinction
   that isn't there. Expired is set apart by tone AND by its label, never colour alone. */
.am-roll { margin-top: 10px; }
.am-roll-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 110px 58px 86px;
  gap: 10px; align-items: center; padding: 3px 0; font-size: var(--fs-sm); }
.am-roll-lab { color: var(--ink); font-variant-numeric: tabular-nums; }
.am-roll-track { background: var(--line); border-radius: var(--r-sm); height: 16px; overflow: hidden; }
.am-roll-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--sky)); border-radius: var(--r-sm); }
.am-roll-bar.expired { background: var(--warn); }
.am-roll-val, .am-roll-pct { text-align: right; font-variant-numeric: tabular-nums; }
.am-roll-n { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
@media (max-width: 520px) { .am-roll-row { grid-template-columns: 56px minmax(0, 1fr) 82px 64px 56px; gap: 6px; } }

.am-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }  /* minmax: a wide table scrolls in its own box instead of widening the page */
@media (max-width: 900px) { .am-two { grid-template-columns: minmax(0, 1fr); } }

.am-gaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; margin-top: 10px; }
.am-gap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.am-gap.missing { border-left: 3px solid var(--line); }
.am-gap.partial { border-left: 3px solid var(--warn); }
.am-gap-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.am-gap-name { font-weight: 600; font-size: var(--fs-base); }
.am-gap-why { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; line-height: 1.5; }
.am-gap-need { font-size: var(--fs-sm); color: var(--ink); margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line); }

section h3 { margin: 28px 0 2px; font-size: var(--fs-md); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.pos { color: var(--warn); }
.am-flag { display: inline-block; margin-left: 5px; font-weight: 700; color: var(--warn); cursor: help; }
td.weak { color: var(--warn); }

/* ── asset numbers: the property-by-property breakdown ─────────────────────── */

/* A cell whose figure needs an input nobody has entered. Deliberately not a dash: a dash in
   a money column reads as zero, and an empty NOI is not a zero NOI. It links to the property
   so the fix is one click from the cell that is complaining. */
.need {
  font-size: var(--fs-sm); text-decoration: none; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 1px 6px; white-space: nowrap;
}
.need:hover { color: var(--accent); border-color: currentColor; }

/* A figure computed over part of its denominator — trustworthy as far as it goes, and the
   asterisk plus the hover say how far that is. */
.partial { color: var(--warn); }
.partial sup { font-size: var(--fs-xs); }

/* Concentration worth noticing: one tenant carrying half a property, or a quarter of the
   rent rolling inside a year. Colour is a second signal — the number is always shown. */
.conc { color: var(--warn); font-weight: 600; }

.note-line {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); padding: 10px 14px; margin: 0 0 14px; font-size: var(--fs-base); color: var(--muted);
}

/* ── home: banded layout ──────────────────────────────────────────────────── */
.home-band { margin-bottom: 18px; }
.band-head { font-size: var(--fs-sm); letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.card-head-actions { display: inline-flex; align-items: center; gap: 12px; }
.task-group + .task-group { margin-top: 12px; }
.task-group-head { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 4px 0 2px; border-bottom: 1px solid var(--line-soft); }
.task-group-head.owed { color: var(--error); }

/* ═══════════════════════════════════════════════════════════════════════════
   Components — redefined on the token system.
   Appended last so these win over anything above without deleting history.
   ═══════════════════════════════════════════════════════════════════════════ */

body { background: var(--bg); color: var(--ink); line-height: var(--lh-base); }

/* ── surfaces ── */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-4);
  box-shadow: var(--e-1); margin-bottom: var(--s-4);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3); margin-bottom: var(--s-3);
  padding-bottom: var(--s-2); border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; }

/* ── page furniture ── */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5);
}
.page-head h2 { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.02em; margin: 0 0 var(--s-1); }
.page-head .sub { font-size: var(--fs-sm); color: var(--muted); margin: 0; max-width: 78ch; line-height: var(--lh-base); }
.band-head {
  font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; margin: 0 0 var(--s-2);
}
.home-band { margin-bottom: var(--s-5); }

/* ── stats ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: var(--s-3); }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); box-shadow: var(--e-1);
  transition: box-shadow .14s ease, transform .14s ease, border-color .14s ease;
}
a.stat:hover { box-shadow: var(--e-2); transform: translateY(-1px); border-color: var(--accent); }
.stat .v { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.02em; line-height: var(--lh-tight); }
.stat .k { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s-1); }
/* Alert is the one place colour carries meaning on a tile, so it gets a bar as well. */
.stat.alert { border-left: 3px solid var(--error); }
.stat.alert .v { color: var(--error); }

.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }

/* ── type ── */
h1, h2, h3, h4 { line-height: var(--lh-tight); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s-1); }
.owed { color: var(--error); }

/* ── controls ── */
button, .btn {
  font: inherit; font-size: var(--fs-base); font-weight: 550;
  padding: var(--s-2) var(--s-4); border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent;
  cursor: pointer; transition: background .14s ease, box-shadow .14s ease;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button.ghost, button.secondary {
  background: var(--panel); color: var(--ink-2); border-color: var(--line);
}
button.ghost:hover, button.secondary:hover { background: var(--n-100); border-color: var(--n-300); }
button.small { font-size: var(--fs-sm); padding: var(--s-1) var(--s-3); }
button.danger { background: transparent; color: var(--error); border-color: var(--line); }
button.link {
  background: none; border: 0; padding: 0; color: var(--accent);
  font-size: inherit; font-weight: 500; cursor: pointer;
}
button.link:hover { color: var(--accent-hover); text-decoration: underline; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm);
}
input, select, textarea {
  font: inherit; font-size: var(--fs-base); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-2) var(--s-3);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }

/* ── badges & tags ── */
.badge, .tag {
  display: inline-flex; align-items: center; font-size: var(--fs-xs);
  padding: 2px var(--s-2); border-radius: var(--r-pill);
  background: var(--n-100); color: var(--ink-2); white-space: nowrap;
}
.badge.overdue { background: var(--error-soft); color: var(--error); }
.badge.high { background: var(--warn-soft); color: var(--warn); }

/* ── tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
th {
  text-align: left; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: var(--s-3); border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--accent-soft); }
tr[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── lists ── */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: var(--s-3) 0; border-bottom: 1px solid var(--line-soft); }
.list > li:last-child { border-bottom: 0; }
.task-row { display: flex; align-items: flex-start; gap: var(--s-3); }
.task-group + .task-group { margin-top: var(--s-4); }
.task-group-head {
  font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--line);
}
.task-group-head.owed { color: var(--error); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--s-4); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-4); }
.empty { color: var(--muted); padding: var(--s-5); text-align: center; }

/* ── chrome ── */
.sidebar { background: var(--panel); border-right: 1px solid var(--line); }
.sidebar a[data-nav] {
  display: block; padding: var(--s-2) var(--s-3); border-radius: var(--r-md);
  font-size: var(--fs-base); color: var(--ink-2); text-decoration: none;
}
.sidebar a[data-nav]:hover { background: var(--n-100); }
.sidebar a[data-nav].active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-label {
  font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--n-400); font-weight: 650; padding: var(--s-4) var(--s-3) var(--s-1);
}
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }

/* ═══════════════════════════════════════════════════════════════════════════
   Calendar
   Colour is a family signal only — every chip carries its title, the drawer
   spells the kind out in words, and the legend is always on screen.
   ═══════════════════════════════════════════════════════════════════════════ */

.cal-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.cal-nav, .cal-views { display: inline-flex; gap: var(--s-1); }
.cal-nav button, .cal-views button { min-width: 38px; }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4);
  margin-left: auto; font-size: var(--fs-sm); color: var(--muted);
}
.cal-legend span { display: inline-flex; align-items: center; gap: var(--s-1); }
.cal-dot { width: 8px; height: 8px; border-radius: var(--r-pill); }

.cal-dot.task,   .cal-chip.task   i { background: #3b6fb5; }
.cal-dot.lease,  .cal-chip.lease  i { background: #1f7a5a; }
.cal-dot.loan,   .cal-chip.loan   i { background: #9a6410; }
.cal-dot.vendor, .cal-chip.vendor i { background: #6d4b9c; }
.cal-dot.dev,    .cal-chip.dev    i { background: #a8552f; }
.cal-dot.other,  .cal-chip.other  i,
.cal-chip.deadline i               { background: var(--n-400); }

/* ── the overdue rail ── */
.cal-rail {
  background: var(--error-soft); border: 1px solid transparent;
  border-left: 3px solid var(--error);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4);
}
.cal-rail-head {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--s-2);
}
.cal-rail-n { font-size: var(--fs-md); font-weight: 700; color: var(--error); }
.cal-rail-head a { margin-left: auto; }
.cal-rail-items { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.cal-rail-item {
  display: inline-flex; align-items: baseline; gap: var(--s-2);
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--r-pill); padding: var(--s-1) var(--s-3);
  font-size: var(--fs-sm); max-width: 320px;
}
.cal-rail-item:hover { border-color: var(--error); background: var(--panel); }
.cal-rail-when { color: var(--error); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-rail-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-rail-more { font-size: var(--fs-sm); color: var(--muted); }

/* ── the grid ── */
.cal-dow {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-1);
  margin-bottom: var(--s-1);
}
.cal-dow div {
  font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; text-align: center; padding-bottom: var(--s-1);
}

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-1);
  background: var(--line-soft); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-1); box-shadow: var(--e-1);
}
.cal-cell {
  display: flex; flex-direction: column; gap: var(--s-1);
  min-height: 124px; padding: var(--s-2); text-align: left;
  background: var(--panel); border: 1px solid transparent; border-radius: var(--r-md);
  font: inherit; color: inherit; cursor: pointer;
  transition: background .12s ease, box-shadow .12s ease;
}
.cal-grid.week .cal-cell { min-height: 320px; }
.cal-cell:hover { background: var(--accent-soft); }
.cal-cell.outside { background: var(--panel-sunk); }
.cal-cell.outside .cal-num { color: var(--n-400); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

.cal-num {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.cal-cell.today .cal-num { color: var(--accent); }
.cal-count {
  font-size: var(--fs-xs); font-weight: 600; color: var(--muted);
  background: var(--n-100); border-radius: var(--r-pill); padding: 0 var(--s-1);
}
.cal-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-chip {
  display: flex; align-items: center; gap: var(--s-1);
  font-size: var(--fs-xs); line-height: 1.45; color: var(--ink-2);
  background: var(--n-50); border-radius: var(--r-sm); padding: 1px var(--s-1);
  min-width: 0;
}
/* The dot carries the family; the text carries the thing. Neither alone. */
.cal-chip i { width: 5px; height: 5px; border-radius: var(--r-pill); flex: 0 0 auto; }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.cal-chip { overflow: hidden; }
.cal-cell { min-width: 0; overflow: hidden; }
.cal-more { font-size: var(--fs-xs); color: var(--muted); padding-left: var(--s-1); }

/* ── the day drawer ── */
.cal-drawer {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-4); margin-top: var(--s-4); box-shadow: var(--e-2);
}
.cal-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap;
  padding-bottom: var(--s-2); margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--line-soft);
}
.cal-drawer-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 650; }
.cal-date { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 96px; }

@media (max-width: 860px) {
  .cal-cell { min-height: 76px; padding: var(--s-1); }
  .cal-grid.week .cal-cell { min-height: 180px; }
  .cal-chip span { display: none; }          /* dots only once text can't fit */
  .cal-chip { justify-content: center; }
  .cal-legend { margin-left: 0; width: 100%; }
}

/* ── tenant insurance (tenantins.js) ── */
.badge.coi-expired { background: var(--error-soft, #fbe9ea); color: var(--error, #a4262c); border-color: currentColor; }
.badge.coi-review  { background: var(--warn-soft, #fbf0dd);  color: var(--warn, #8a5a00);  border-color: currentColor; }
.badge.coi-soon    { background: var(--accent-soft, #e8f0fc); color: var(--accent, #1b4f9c); border-color: currentColor; }
.badge.coi-good    { background: var(--good-soft, #e3f3ed);  color: var(--good, #1f7a5a);  border-color: currentColor; }
.coi-tiles { margin-bottom: var(--s-4, 16px); }
.stat.coi-tile { text-align: left; font: inherit; color: inherit; cursor: pointer; border-left-width: 4px; }
.stat.coi-tile:hover { box-shadow: var(--e-2, 0 2px 8px rgba(0,0,0,.08)); transform: translateY(-1px); }
.stat.coi-tile.coi-expired { border-left-color: var(--error, #a4262c); } .stat.coi-tile.coi-expired .v { color: var(--error, #a4262c); }
.stat.coi-tile.coi-review  { border-left-color: var(--warn, #8a5a00); }  .stat.coi-tile.coi-review .v  { color: var(--warn, #8a5a00); }
.stat.coi-tile.coi-soon    { border-left-color: var(--accent, #1b4f9c); } .stat.coi-tile.coi-soon .v    { color: var(--accent, #1b4f9c); }
.stat.coi-tile.coi-good    { border-left-color: var(--good, #1f7a5a); }  .stat.coi-tile.coi-good .v    { color: var(--good, #1f7a5a); }
.stat.coi-tile.on { outline: 2px solid currentColor; outline-offset: -2px; background: var(--panel-sunk, #f6f7f9); }
.coi-toolbar select { max-width: 260px; }
.coi-actions { white-space: nowrap; text-align: right; }
.coi-headline { margin: 4px 0 10px; }
.coi-headline.coi-expired strong { color: var(--error, #a4262c); }
.coi-headline.coi-soon strong { color: var(--accent, #1b4f9c); }
.coi-headline.coi-good strong { color: var(--good, #1f7a5a); }
tr.coi-latest td:first-child { font-weight: 650; }
.coi-follow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.coi-follow .small.muted { flex: 1 1 100%; }

/* ── rent schedule card (rentschedule.js) ── */
.rs-headline { margin: 4px 0 10px; }
.rs-table td.num, .rs-table th.num { text-align: right; white-space: nowrap; }
.rs-table tr.rs-now td { background: var(--good-soft, #e3f3ed); }
.rs-table tr.rs-now td:first-child { box-shadow: inset 3px 0 0 var(--good, #1f7a5a); }

/* ═══ Design pass 2026-10-02 ═════════════════════════════════════════════════
   Home "Needs you": one ranked list. Each row = count · what · what's at stake. */
.nqs { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--e-1); }
.nq { display: grid; grid-template-columns: 72px minmax(0, 1fr) 20px; gap: var(--s-4); align-items: center;
  padding: var(--s-3) var(--s-4); color: inherit; text-decoration: none; border-top: 1px solid var(--line-soft); min-height: 44px; }
.nq:first-child { border-top: none; }
.nq:hover { background: var(--panel-sunk); }
.nq-n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink-2); }
.nq.risk .nq-n { color: var(--error); }
.nq.warn .nq-n { color: var(--warn); }
.nq-body { display: flex; flex-direction: column; min-width: 0; }
.nq-label { font-weight: 600; }
.nq-detail { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.nq-go { color: var(--n-400); font-size: 20px; }
.stat .k .la-info { position: relative; }

.v.na { color: var(--n-400); }

/* Filter chips (rent roll; reusable). 44px tall on touch screens. */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-3); }
.chip { min-height: 32px; padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--n-400); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
@media (pointer: coarse) { .chip { min-height: 44px; } }

/* Rent roll grouped by property: sticky header, a subtotal line per property. */
.table-wrap.rr { max-height: calc(100vh - 220px); overflow: auto; }
.table-wrap.rr thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-sunk); }
.rr-group td { background: var(--panel-sunk); font-weight: 700; padding-top: var(--s-4); border-bottom: 1px solid var(--line); }
.rr-group a { color: var(--ink); text-decoration: none; }
.rr-group a:hover { color: var(--accent); }
.rr-meta { margin-left: var(--s-2); font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }
.rr-unit { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--fs-sm); white-space: nowrap; }
.rr-tenant { min-width: 160px; }
td.strong { font-weight: 600; }

/* Asset page lease timeline: one bar per lease on a shared year axis. */
.lt { display: flex; flex-direction: column; gap: 2px; }
.lt-row { display: grid; grid-template-columns: minmax(120px, 240px) minmax(0, 1fr); gap: var(--s-3); align-items: center;
  color: inherit; text-decoration: none; padding: 3px 0; border-radius: var(--r-sm); }
a.lt-row:hover { background: var(--panel-sunk); }
.lt-name { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-track { position: relative; height: 16px; background: var(--line-soft); border-radius: var(--r-sm); }
.lt-track.bare { background: none; height: 18px; }
.lt-tick { position: absolute; transform: translateX(-50%); font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.lt-bar { position: absolute; top: 0; bottom: 0; border-radius: var(--r-sm); }
.lt-bar.orig { background: var(--accent-soft); border: 1px solid var(--n-300); }
.lt-bar.cur { background: var(--accent); }
.lt-bar.hold { background: var(--warn); opacity: .85; }
.lt-today { position: absolute; top: -3px; bottom: -3px; border-left: 2px solid var(--error); }
.lt-key { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lt-sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-left: 8px; }
.lt-sw.orig { background: var(--accent-soft); border: 1px solid var(--n-300); }
.lt-sw.cur { background: var(--accent); }
.lt-sw.hold { background: var(--warn); }
.lt-note { margin: var(--s-3) 0 0; padding: var(--s-2) var(--s-3); background: var(--panel-sunk); border-radius: var(--r-md); font-size: var(--fs-sm); }
@media (max-width: 700px) { .lt-row { grid-template-columns: 1fr; gap: 2px; } .lt-axis > span:first-child { display: none; } }
.t .need { white-space: normal; display: inline-block; margin-top: 4px; }

/* ── Phone shell: drawer sidebar + bottom section bar ─────────────────────────
   Before, the whole first screen on a phone was the sidebar and the section tabs sat cut off at
   the bottom of it. Now: content first; ☰ opens the active section's pages as a drawer; the five
   sections are a fixed bottom bar. */
.menu-toggle { display: none; }
@media (max-width: 700px) {
  .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); overflow-y: auto;
    flex-direction: column; flex-wrap: nowrap; border-right: 1px solid var(--line); border-bottom: 0;
    padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--e-2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(10, 16, 24, .35); }
  .nav-group { flex-direction: column; flex-wrap: nowrap; }
  .sidebar a { padding: 11px 10px; }
  .sidebar-foot { flex-direction: column; margin-top: auto; }
  .topbar { display: flex; gap: 8px; align-items: center; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    position: sticky; top: 0; z-index: 20; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; height: 44px;
    border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 20px; padding: 0; }
  #search-form { flex: 1; min-width: 0; }
  #search-input { font-size: 16px; min-height: 44px; }   /* <16px makes iOS zoom the page on focus */
  .sections { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; margin: 0; gap: 0;
    background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); overflow: visible; }
  .sections a { flex: 1 1 0; min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: center; text-align: center;
    white-space: normal; line-height: 1.15; font-size: 11.5px; padding: 6px 2px; border-radius: 0; }
  .sections a.active { background: none; color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
  main { padding: 16px 16px calc(80px + env(safe-area-inset-bottom, 0px)); }
  .nq { grid-template-columns: 52px minmax(0, 1fr) 14px; gap: var(--s-3); }
  .nq-n { font-size: 20px; }
}
@media (max-width: 700px) { .rr .rr-opt { display: none; } .rr-tenant { min-width: 120px; } }

/* Fit tables to the page: numbers, money and dates never break; headers may wrap onto two lines;
   on narrower screens the cell padding tightens before anything has to scroll. */
td.num, td.date, .badge { white-space: nowrap; }
th { white-space: normal; vertical-align: bottom; }
td { vertical-align: middle; }
@media (max-width: 1280px) { th, td { padding: 8px 9px; } }
@media (min-width: 701px) and (max-width: 1024px) { .shell { grid-template-columns: 190px minmax(0, 1fr); } main { padding: 24px 20px; } }

/* ── vacancies (vacancies.js) ── */
.vac-table td { vertical-align: top; }
select.vac-prio { font-size: var(--fs-sm, 12.5px); padding: 2px 6px; }
select.vac-prio.vac-high { color: var(--error, #a4262c); border-color: currentColor; font-weight: 600; }
tr.vac-high td:first-child { box-shadow: inset 3px 0 0 var(--error, #a4262c); }
/* Laptops and tablets (sidebar still showing): a slightly denser table before anything scrolls. */
@media (min-width: 701px) and (max-width: 1180px) { table { font-size: 13px; } th, td { padding: 7px 7px; } th { font-size: 10.5px; } }
.cal-cell, .cal-chips, .cal-chip { min-width: 0; }  /* a long event title truncates instead of widening the month to 3,000px */
/* Long unbroken strings (file paths, URLs) wrap instead of widening a phone page; selects never exceed their column. */
main { overflow-wrap: break-word; }
main select { max-width: 100%; }

/* Calculators (calculators.js) */
.calc-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s-3, 12px); padding: 0 16px 12px; align-items: end; }
.calc-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.calc-field input, .calc-field select, .calc-form > select { font-size: 16px; }
.calc-out { padding: 4px 16px 12px; }
.calc-result { padding: 8px 16px; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line, #ddd); }
.calc-row.alert strong { color: var(--danger, #b3261e); }
.calc-exp { padding: 0 16px 8px; display: grid; gap: 8px; }
.calc-exp-row { display: grid; grid-template-columns: 2fr 1fr .8fr .9fr auto auto auto auto auto; gap: 8px; align-items: center; }
.calc-exp-row input[type=text], .calc-exp-row input:not([type]), .calc-exp-row .e-amt { font-size: 16px; }
@media (max-width: 900px) { .calc-exp-row { grid-template-columns: 1fr 1fr; } }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.calc-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line, #ddd); border-radius: 10px; text-decoration: none; color: inherit; }
.calc-card:hover { border-color: var(--accent, #2563eb); }
.task-done-by { color: var(--ok, #1a7f4b); }
.me-row td { background: var(--hover, rgba(0,0,0,.03)); }
.toolbar .active-link { font-weight: 600; text-decoration: underline; }

/* ── underwriting (underwriting.js) ── */
.uw-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.uw-name { min-width: 200px; }
.uw-layout { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.uw-inputs { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.uw-results { min-width: 0; position: sticky; top: 8px; max-height: calc(100vh - 24px); overflow-y: auto; }
.uw-section > summary { cursor: pointer; font-weight: 600; }
.uw-section[open] > summary { margin-bottom: 10px; }
.uw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.uw-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.82rem; color: var(--muted); }
.uw-field.wide { grid-column: 1 / -1; }
.uw-field input, .uw-field select { font-size: 16px; }
.uw-list { margin-top: 12px; }
.uw-list h4 { margin: 0 0 6px; font-size: 0.9rem; }
.uw-table-wrap { overflow-x: auto; }
.uw-table { border-collapse: collapse; font-size: 0.82rem; }
.uw-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 2px 6px; white-space: nowrap; }
.uw-table td { padding: 2px 4px; }
.uw-table input, .uw-table select { width: 100%; min-width: 80px; font-size: 16px; }
.uw-stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.uw-stat .v { font-size: 1.35rem; }
.uw-stat.alert { border-color: var(--warn, #b7791f); }
.uw-errors { border-color: var(--error, #a4262c); }
.uw-years { border-collapse: collapse; font-size: 0.8rem; white-space: nowrap; }
.uw-years th, .uw-years td { padding: 3px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.uw-years th:first-child { text-align: left; }
.uw-years td.neg { color: var(--error, #a4262c); }
@media (max-width: 900px) { .uw-layout { grid-template-columns: 1fr; } .uw-results { position: static; max-height: none; } }
.uw-layout.uw-full { grid-template-columns: minmax(0, 1fr); }
.uw-layout.uw-full .uw-inputs { display: none; }
.uw-layout.uw-full .uw-results { position: static; max-height: none; overflow: visible; }
.uw-summary { display: flex; flex-direction: column; gap: 16px; }
.uw-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.uw-step { position: relative; flex: 1 1 150px; border: 1px solid var(--line); border-radius: var(--r-lg, 10px); padding: 10px 12px; background: var(--bg); display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; }
.uw-step:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 1; }
.uw-step-n { color: var(--muted); font-size: 0.72rem; }
.uw-step-l { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.uw-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.uw-su-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.uw-su h4 { margin: 0 0 6px; font-size: 0.85rem; color: var(--muted); }
.uw-su table, .uw-bridge { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.uw-su td, .uw-bridge td { padding: 3px 0; font-variant-numeric: tabular-nums; }
.uw-su td:last-child, .uw-bridge td:last-child { text-align: right; }
.uw-total td, .uw-years tr.uw-total th, .uw-years tr.uw-total td { font-weight: 600; border-top: 1px solid var(--line); }
.uw-bridge td.neg { color: var(--error, #a4262c); }
.uw-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 0.85rem; }
.uw-dl dt { color: var(--muted); }
.uw-dl dd { margin: 0; }
@media print { .uw-layout { display: block; } .uw-step:not(:last-child)::after { display: none; } }
.uw-links { display: flex; flex-wrap: wrap; gap: 12px; margin: -4px 0 12px; }
.uw-link { display: flex; flex-direction: column; gap: 2px; }
.uw-chart { width: 100%; height: auto; display: block; }
.uw-fig { margin: 0 0 14px; }
.uw-fig figcaption { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.uw-grid-line { stroke: var(--line); stroke-width: 1; }
.uw-axis { fill: var(--muted); font-size: 10px; }
.uw-c1 { fill: var(--accent); background: var(--accent); }
.uw-c2 { fill: var(--sky); background: var(--sky); }
.uw-c3 { fill: var(--n-400); background: var(--n-400); }
.uw-line { stroke: var(--warn); stroke-width: 2; }
.uw-hit { fill: transparent; }
.uw-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.uw-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.uw-line-sw { height: 3px; background: var(--warn); }
.uw-sens-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; margin-bottom: 12px; }
.uw-sens, .uw-compare { border-collapse: collapse; font-size: 0.85rem; }
.uw-sens th, .uw-sens td, .uw-compare th, .uw-compare td { padding: 6px 10px; text-align: right; font-variant-numeric: tabular-nums; border: 1px solid var(--line); }
.uw-compare th:first-child, .uw-compare td:first-child { text-align: left; }
.uw-compare thead th { text-align: left; }
.uw-sens th { color: var(--muted); font-weight: 500; }
.uw-sens td.uw-base { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 600; }
.uw-compare td.uw-diff { background: var(--warn-soft); }
@media print {
  .uw-fig, .uw-su, .uw-two > .card, .uw-sens { break-inside: avoid; }
  .uw-summary { gap: 10px; }
  details:not([open]) { display: none; }
}
.uw-inline { display: flex; align-items: center; gap: 6px; }
.uw-solve-hit { border-left: 3px solid var(--good, #1f7a5a); padding: 4px 12px; background: var(--good-soft, #e3f3ed); border-radius: 6px; }
.uw-solve-miss { border-left: 3px solid var(--warn, #8a5a00); padding: 6px 12px; background: var(--warn-soft, #fbf0dd); border-radius: 6px; margin: 0; }
.uw-compare tr.uw-best th, .uw-compare tr.uw-best td { background: var(--good-soft, #e3f3ed); }
.uw-warn { color: var(--warn, #8a5a00); font-weight: 400; text-transform: none; margin-top: 2px; }

/* ── phone layout, round 1 (≤700px): list rows as cards, short tab labels, touch-sized controls ──────
   A list table is 600-900px wide, which on a phone hides the columns people open the list for (email,
   phone). Each row becomes a card instead: the first cell is the heading, the rest are "Label  value"
   lines, and cells with nothing in them drop out. The label comes from data-label, set where the row
   is built, so a new column needs no CSS. */
@media (max-width: 700px) {
  /* The tab keeps its full text for screen readers and tests; on a phone the short label is drawn instead. */
  .sections a[data-short] { font-size: 0; }
  .sections a[data-short]::after { content: attr(data-short); font-size: 12px; }

  .table-wrap.cards { background: none; border: 0; border-radius: 0; overflow: visible; }
  .cards table, .cards tbody, .cards tr, .cards td { display: block; width: 100%; min-width: 0; }
  .cards thead { display: none; }
  .cards tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 10px 14px; margin-bottom: 10px; }
  .cards td { border: 0; padding: 3px 0; display: flex; gap: 12px; align-items: baseline;
    text-align: left; overflow-wrap: anywhere; }
  .cards td.num { text-align: left; }
  .cards td.blank { display: none; }
  .cards td::before { content: attr(data-label); flex: 0 0 82px; color: var(--muted);
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .cards td:first-child { font-weight: 650; font-size: 1.02rem; padding-bottom: 6px; }
  .cards td:first-child::before { display: none; }
  .cards tr.clickable:hover td { background: none; }
  .cards tr.grp { background: none; border: 0; padding: 14px 2px 4px; margin: 0; }
  .cards tr.grp td { font-weight: 650; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: block; }
  .cards tr.grp td::before { display: none; }
  .cards td a { min-height: 32px; display: inline-flex; align-items: center; }
  /* Tenant emails: the tick box sits at the card's corner instead of taking a row of its own. */
  .cards.te tr { position: relative; padding-right: 54px; }
  .cards.te td.pick { position: absolute; top: 4px; right: 4px; width: auto; padding: 0; }
  .cards.te td.pick::before { display: none; }
  .cards.te tr { display: flex; flex-direction: column; }
  .cards.te td:first-child { font-weight: inherit; font-size: inherit; padding-bottom: 3px; }
  .cards.te td.ttl { order: -1; font-weight: 650; font-size: 1.02rem; padding-bottom: 6px; }
  .cards.te td.ttl::before { display: none; }
  .cards.te td.pick input { margin: 0; }

  /* Filters stack full width; 16px text stops iOS zooming the page when a field is tapped. */
  .toolbar > * { flex: 1 1 100%; max-width: none; min-width: 0; }
  .toolbar > select { flex: 1 1 calc(50% - 8px); }              /* dropdowns sit two to a row */
  .toolbar > label.check { flex: 0 1 auto; min-height: 44px; }  /* tick boxes sit side by side */
  .toolbar input[type=search] { max-width: none; flex-basis: 100%; }
  .toolbar select, .toolbar input[type=search], .toolbar input[type=text], .toolbar input[type=date] { font-size: 16px; min-height: 44px; }
  .toolbar button { min-height: 44px; }
}
/* Touch screens: checkboxes and buttons big enough to hit. */
@media (pointer: coarse) {
  input[type=checkbox], input[type=radio] { width: 24px; height: 24px; }
  button, .btn, select { min-height: 44px; }
}

/* Rent roll on a phone: one card per space with the tenant as the heading, and each property as a heading
   above its cards. SF, CAM and $/SF stay hidden here (rr-opt); the desktop table is unchanged. */
@media (max-width: 700px) {
  .table-wrap.rr.cards { max-height: none; overflow: visible; }
  .rr.cards tr { display: flex; flex-direction: column; }
  .rr.cards td:first-child { font-weight: inherit; font-size: inherit; padding-bottom: 3px; }
  .rr.cards td.rr-tenant { order: -1; font-weight: 650; font-size: 1.02rem; padding-bottom: 6px; }
  .rr.cards td.rr-tenant::before { display: none; }
  .rr.cards td.rr-unit { font-family: inherit; font-size: inherit; white-space: normal; }
  .rr.cards td.rr-unit::before { display: flex; }   /* the first-cell rule hides labels; the unit still needs its own */
  .rr.cards td.strong::before { font-weight: 400; }
  .rr.cards tr.rr-group td:first-child a { font-weight: 700; }
  .rr.cards td.rr-opt { display: none; }
  .rr.cards tr.rr-group { background: none; border: 0; padding: 18px 2px 4px; margin: 0; }
  .rr.cards tr.rr-group td { display: none; }
  .rr.cards tr.rr-group td:first-child { display: block; background: none; border: 0; padding: 0; font-size: 1.02rem; }
  .rr.cards tr.rr-group td:first-child::before { display: none; }
  .rr.cards .rr-meta { display: block; margin: 2px 0 0; }
  .rr.cards tr.vacant-row { background: var(--panel-sunk); }
}

/* Tab buttons used to pick up the generic dark button:hover with their muted text on top, unreadable (and on a
   phone the hover sticks after a tap). */
.tabs button:hover { background: var(--panel-sunk, var(--accent-soft)); color: var(--ink); }

/* Forms on a phone: nearly full screen, one column, and Save/Cancel pinned to the bottom of the sheet instead
   of somewhere down a long scroll. */
@media (max-width: 700px) {
  dialog { width: calc(100vw - 16px); max-width: none; max-height: calc(100dvh - 16px); overflow: hidden; }
  #modal-form { max-height: calc(100dvh - 18px); padding: 16px 16px 0; gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { position: sticky; bottom: 0; margin: auto -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--panel); border-top: 1px solid var(--line); }
  .modal-actions button { flex: 1 1 0; }
}

/* ── acquisitions ── */
.acq-score { font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.acq-fired { font-weight: 400; color: var(--muted); }
.acq-on { font-weight: 600; color: var(--good); }

/* ── phone chrome, round 3: app-style bars, sheets, denser cards ─────────────────────────────────────────
   Everything here is hidden above 700px, so desktop keeps its sidebar, section tabs and visible filters. */
.tabbar, .sheet, .sheet-backdrop, .topbar-title, .icon-btn, .search-cancel, .filters-btn, .sheet-grab, .filters-sheet .sheet-head { display: none; }
.filters-sheet, .filters-body { display: contents; }
.m-only { display: none; }   /* phone-only column (see ".cards td.m-only") */
#app-view[hidden] ~ .tabbar, #app-view[hidden] ~ .sheet, #app-view[hidden] ~ .sheet-backdrop { display: none !important; }

@media (max-width: 700px) {
  /* top bar: title and a search icon; the field opens full width on demand */
  .sections, .menu-toggle { display: none; }
  .topbar { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 6px; }
  .topbar-title { display: block; flex: 1; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
  .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    background: none; border: 0; color: var(--ink); border-radius: 50%; }
  .icon-btn:hover { background: var(--panel-sunk); color: var(--ink); }
  #search-form { display: none; flex: 1; align-items: center; gap: 8px; }
  .topbar.searching .topbar-title, .topbar.searching .icon-btn { display: none; }
  .topbar.searching #search-form { display: flex; }
  .search-cancel { display: inline-block; flex: none; padding: 10px 4px; color: var(--accent); text-decoration: none; }

  /* bottom icon tab bar */
  .tabbar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--panel);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 52px; padding: 4px 0; background: none; border: 0; border-radius: var(--r-md);
    color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; text-decoration: none; }
  .tabbar a:hover, .tabbar button:hover { background: none; color: var(--muted); }
  .tabbar .active, .tabbar .active:hover { color: var(--accent); }
  .tabbar .active svg { stroke-width: 2.2; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* slide-up sheets (More, Filters) */
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 16, 24, 0.4); }
  .sheet-backdrop[hidden] { display: none; }
  .sheet, .filters-sheet.open { display: flex; flex-direction: column; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    max-height: 82dvh; background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sheet[hidden] { display: none; }
  .filters-sheet { display: none; }
  .filters-sheet.open .sheet-head, .sheet .sheet-head { display: flex; }
  .sheet-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 2px; flex: none; }
  .sheet-head { align-items: center; justify-content: space-between; padding: 6px 18px 10px; flex: none; }
  .sheet-head h3 { margin: 0; font-size: 1.1rem; }
  .sheet-head .link { color: var(--accent); text-decoration: none; font-size: 1rem; min-height: 44px; padding: 0 4px; }
  .filters-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; overflow-y: auto; }
  .filters-body select { width: 100%; font-size: 16px; min-height: 44px; }
  .sheet-scroll { overflow-y: auto; padding: 0 12px 16px; }
  .sheet-group { border-top: 1px solid var(--line); }
  .sheet-group summary { list-style: none; padding: 16px 8px; font-weight: 650; cursor: pointer; display: flex; justify-content: space-between; }
  .sheet-group summary::after { content: "›"; transform: rotate(90deg); color: var(--muted); }
  .sheet-group[open] summary::after { transform: rotate(-90deg); }
  .sheet-links { display: flex; flex-direction: column; padding: 0 8px 10px; }
  .sheet-links a, .sheet-foot a { padding: 12px 4px; color: var(--ink); text-decoration: none; min-height: 44px; display: flex; align-items: center; }
  .sheet-label { margin: 10px 4px 2px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
  .sheet-foot { border-top: 1px solid var(--line); padding: 10px 8px 0; display: flex; flex-direction: column; }
  .sheet-foot .link { text-align: left; color: var(--error); padding: 12px 4px; min-height: 44px; }
  body.sheet-open { overflow: hidden; }

  /* lists: search + one Filters button; New is a floating action button */
  .toolbar:has(.filters-btn) { flex-wrap: nowrap; }
  .toolbar:has(.filters-btn) > input[type=search] { flex: 1 1 0; }
  .toolbar > .filters-btn { display: inline-flex; align-items: center; flex: 0 0 auto; }
  .filters-btn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
  .page-head > button.fab { position: fixed; z-index: 25; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    min-height: 52px; padding: 0 22px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
  .page-head > button.fab::before { content: "+ "; font-weight: 700; }

  /* denser cards where a column is marked: m-hide drops it, m-sub is an unlabelled grey line, m-act is a tap button */
  .cards tr { display: flex; flex-wrap: wrap; column-gap: 8px; }
  .cards td.m-hide { display: none; }
  .cards td.m-only { display: block; width: 100%; color: var(--muted); font-size: 0.92rem; padding: 0 0 2px; }
  .cards td.m-only.blank { display: none; }
  .cards td.m-only::before { display: none; }
  .cards td.m-act { width: auto; flex: 0 1 auto; max-width: 100%; padding: 8px 0 0; }
  .cards td.m-act::before { display: none; }
  .cards td.m-act a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 40px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--panel-sunk); color: var(--accent);
    text-decoration: none; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cards td.m-act[data-label="Email"] a::before { content: "✉"; }
  .cards td.m-act[data-label="Phone"] a::before { content: "☎"; }
  /* these two already stack their own way */
  .rr.cards tr, .cards.te tr { flex-wrap: nowrap; }
}

/* ── phone, round 4: detail pages ────────────────────────────────────────────────────────────────────────
   Stat tiles inside a card become one swipeable row, tabs become one scrolling row, record fields sit two
   to a line, and taps feel like taps. Desktop is untouched. */
@media (max-width: 700px) {
  .card > .stats { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px 4px; padding: 2px 16px 10px;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .card > .stats::-webkit-scrollbar { display: none; }
  .card > .stats > .stat { flex: 0 0 136px; scroll-snap-align: start; padding: 12px 14px; }
  .card > .stats .stat .v { font-size: 1.35rem; }

  /* record summary figures (.totals): one swipeable row instead of a tall grid */
  .totals { display: flex; gap: 24px; overflow-x: auto; margin: 0 0 16px; padding: 14px 16px; scroll-snap-type: x proximity;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .totals::-webkit-scrollbar { display: none; }
  .totals > .t { flex: 0 0 auto; min-width: 92px; scroll-snap-align: start; }

  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 0; margin: 14px -16px 12px; padding: 0 12px; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 0 16px; scroll-snap-align: center; }

  .fields { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .fields .f .v { font-size: 0.95rem; }

  /* taps: no grey flash, no double-tap delay, and a quick press state */
  a, button, summary, tr.clickable, .stat { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  button:active, .tabbar a:active, .tabbar button:active, .stat:active { opacity: 0.7; }
  .cards tr.clickable:active { background: var(--accent-soft); }
  #view > * { animation: view-in 0.16s ease-out; }
}
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #view > * { animation: none !important; } }

/* sensitivity: grid highlights and tornado bars */
.sens-grid th.sens-base { color: var(--accent); font-weight: 700; }
.sens-grid td.sens-base { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 700; }
.tornado { display: flex; flex-direction: column; gap: 6px; }
.tornado-row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr minmax(120px, 230px); gap: 10px; align-items: center; }
.tornado-track { position: relative; height: 14px; background: var(--line); border-radius: 3px; min-width: 0; }
.tornado-bar { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; min-width: 2px; }
.tornado-base { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
@media (max-width: 640px) { .tornado-row { grid-template-columns: 1fr; gap: 2px; } }

/* Briefing (Outlook) */
.br-list { list-style: none; padding: 0; margin: 0; }
.br-item { padding: var(--s-3) 0; border-top: 1px solid var(--line, rgba(128,128,128,.25)); }
.br-item:first-child { border-top: 0; }
.br-subject { font-weight: 600; }
.br-snippet { margin: 4px 0; color: var(--muted, inherit); overflow-wrap: anywhere; }
.br-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: 6px; }
.br-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: rgba(128,128,128,.14); font-size: .85em; text-decoration: none; }
.br-chip.br-inferred { border: 1px dashed rgba(128,128,128,.6); background: transparent; }
.br-day { list-style: none; margin-top: var(--s-3); }
.br-time { display: inline-block; min-width: 76px; font-variant-numeric: tabular-nums; color: var(--muted, inherit); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font: inherit; }

/* CAM calculator: grouped inputs and warnings */
.calc-group { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px 12px; margin: 10px 0 0; min-width: 0; }
.calc-group legend { padding: 0 6px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.calc-warn { border-color: var(--warn); background: var(--warn-soft); }

/* Overflow guards (audit 2026-10-09): header action rows and notes inside nowrap number cells. */
.page-head > * { min-width: 0; }
.page-head .actions { max-width: 100%; }
td.num .meta { white-space: normal; justify-content: flex-end; text-align: right; max-width: 260px; margin-left: auto; }
@media (max-width: 520px) { td .badge { max-width: 100%; white-space: normal; text-align: left; } }

/* iOS/iPadOS zoom the page on focus when a form control's font-size is under 16px (WP-43). */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  select.vac-prio { font-size: 16px; } /* higher specificity than the element rule, so it needs its own line */
}
/* Taking tasks: the button and the "Michael took this from you" line */
.task-row .task-take { margin-left: 4px; }
.task-row .t-handoff { color: var(--accent, #00205B); font-weight: 600; }
.task-switches { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Approvals */
.appr-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.appr-row .appr-main { flex: 1 1 280px; min-width: 0; }
.appr-row .appr-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.appr-row .meta > * + *::before { content: " · "; color: var(--muted, #6b7280); }
.appr-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.appr-actions:empty { display: none; }
.appr-note { margin-top: 4px; font-size: .92em; color: var(--ink); }
.appr-chip { text-transform: none; }
.appr-pending { background: #fff4d6; color: #7a5200; }
.appr-approved { background: #dff3e6; color: #14663a; }
.appr-declined { background: #fbe0e0; color: #8f1d1d; }
.appr-withdrawn { background: #e8eaee; color: #4a5160; }
:root[data-theme="dark"] .appr-pending { background: #4a3a10; color: #ffd98a; }
:root[data-theme="dark"] .appr-approved { background: #12402a; color: #9be3b8; }
:root[data-theme="dark"] .appr-declined { background: #4a1c1c; color: #ffb4b4; }
:root[data-theme="dark"] .appr-withdrawn { background: #2b2f38; color: #c0c6d2; }
.appr-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: middle; }
.x-pills a .appr-count { margin-left: 8px; }
.appr-detail .appr-kv { display: flex; gap: 10px; padding: 4px 0; }
.appr-detail .appr-kv > span { min-width: 90px; }
.appr-detail .appr-details { white-space: pre-wrap; margin: 12px 0; }
.appr-detail .appr-decision { margin: 10px 0; padding: 8px 10px; border-left: 3px solid var(--accent, #00205B); }
.appr-detail .appr-actions { margin-top: 14px; }
.appr-detail .appr-actions button { min-height: 44px; padding: 0 18px; }

/* Comps > Market rates (#/compset/rates) */
.rates-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.rates-f select, .rates-f input { font-size: 16px; min-height: 40px; max-width: 100%; }
.rates-note { flex: 1 1 220px; }
.rates-note input { width: 100%; }
.rates-override { border: 1px solid var(--warn, #b7791f); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.rates-excl td { opacity: .55; }
.rates-results details { margin: 12px 0; }
@media (max-width: 700px) {
  .rates-filters .rates-f { flex: 1 1 calc(50% - 8px); }
  .rates-override-form .rates-f { flex: 1 1 calc(33% - 8px); }
  .rates-override-form .rates-note, .rates-override-form button { flex: 1 1 100%; }
}

/* Deal log (#/leasing/deals) and market-rate accuracy (#/compset/accuracy) */
.deals-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.deals-chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 14px; min-height: 40px; font-size: 14px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.deals-chip b { font-weight: 600; color: var(--muted); }
.deals-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.deals-chip.on b { color: inherit; }
.deal-list { display: flex; flex-direction: column; gap: 8px; }
.deal-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); text-decoration: none; min-width: 0; }
.deal-row:hover { border-color: var(--accent); }
.deal-main { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.deal-rent { text-align: right; flex: none; white-space: nowrap; }
.deal-kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.deal-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.deal-kv .k { font-size: 12px; color: var(--muted); }
.deal-range svg { width: 100%; max-width: 560px; height: auto; display: block; }
.deal-form .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 12px; }
.deal-form .form-row .wide { grid-column: 1 / -1; }
.deal-form .deal-outside { grid-column: 1 / -1; }
.deal-form .deal-outside[hidden] { display: none; }
.deal-form input, .deal-form select, .deal-form textarea { font-size: 16px; min-height: 40px; max-width: 100%; width: 100%; box-sizing: border-box; }
.deal-form .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.deal-more { margin: 0 0 12px; }
.deal-more summary { cursor: pointer; padding: 8px 0; min-height: 40px; }
.acc-h { margin: 22px 0 6px; }
@media (max-width: 700px) {
  .deal-row { flex-direction: column; gap: 6px; }
  .deal-rent { text-align: left; }
  .deal-form .form-row { grid-template-columns: 1fr 1fr; }
}
.deal-dim { color: var(--muted); }
.rates-clist { display: flex; flex-direction: column; }
.rates-crow { padding: 8px 0; border-top: 1px solid var(--line, #dfe3ea); }
.rates-ct { overflow-wrap: anywhere; }
.rates-cn { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rates-cn span { display: flex; flex-direction: column; font-size: 14px; min-width: 64px; }
.rates-cn i { font-style: normal; font-size: 11px; color: var(--muted); }

/* market rates: one line per source above the contributor rows */
.rates-srcs { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.rates-src { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, #f3f5f9); }
.rates-src-n { margin-left: auto; font-size: 13px; font-weight: 600; }

.uw-fin h3 { margin: 0 0 4px; }
.uw-fin p { margin: 0 0 4px; }
.uw-fin.ok { border-left: 4px solid var(--good, #2e7d32); }
.uw-fin.alert { border-left: 4px solid var(--bad, #b3261e); }

.uw-nested { border: 1px solid var(--line, #ddd); border-radius: 8px; margin: 6px 0; padding: 6px 10px; grid-column: 1 / -1; }
.uw-nested legend { font-size: 12px; color: var(--muted, #666); padding: 0 4px; }

/* Send to Underwriting: label chips, holes, banner */
.uwc-chip { display: inline-block; font-size: 0.68rem; padding: 0 6px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.uwc-sourced { border-color: #2f7d4f; color: #2f7d4f; } .uwc-derived { border-color: #3b6ea5; color: #3b6ea5; } .uwc-proxy { border-color: #8a6d1d; color: #8a6d1d; }
.uwc-assumption { border-color: #b7791f; color: #b7791f; } .uwc-manual { border-color: #6b4fa0; color: #6b4fa0; } .uwc-engine_default { border-color: #6b7280; color: #6b7280; }
.uwc-needs_input { border-color: var(--error, #a4262c); color: var(--error, #a4262c); font-weight: 600; }
.uwc-unverified { border-color: var(--error, #a4262c); color: #fff; background: var(--error, #a4262c); }
.uwc-stale { border-color: #b7791f; background: #fff4de; color: #7a4d00; }
.uwc-verdict-ok { border-color: #2f7d4f; color: #2f7d4f; } .uwc-verdict-alert { border-color: #b7791f; background: #fff4de; color: #7a4d00; } .uwc-verdict-muted { color: var(--muted); }
input.uwc-hole, select.uwc-hole { border: 1.5px solid var(--error, #a4262c) !important; background: #fff1f0; }
input.uwc-hole-soft { border: 1.5px dashed #b7791f !important; }
.uwc-need { color: var(--error, #a4262c); font-size: 0.72rem; line-height: 1.25; }
.uwc-cell { display: flex; flex-direction: column; gap: 2px; min-width: 90px; } .uwc-cellmeta { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.uwc-reset { font-size: 0.7rem; }
.uwc-banner { border: 1.5px solid var(--error, #a4262c); background: #fff1f0; color: #7a1d1d; border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; font-size: 0.88rem; }
.uwc-banner-cleared { border-color: #b7791f; background: #fff4de; color: #5c3b00; }
.uwc-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; }
.uwc-holes { border-color: var(--error, #a4262c); } .uwc-holes li { margin: 2px 0; }
.uwc-terms, .uwc-copy { border-color: var(--accent, #3b6ea5); }
@media (prefers-color-scheme: dark) { .uwc-banner { background: #3a1616; color: #ffd6d6; } input.uwc-hole { background: #3a1616; } .uwc-stale, .uwc-verdict-alert, .uwc-banner-cleared { background: #3d2f12; color: #ffe2a8; } }

/* Redesign layer: chart tokens, the KPI/card/chart frame, and the new shell (section rail, sub-tabs, lenses).
   Loaded after styles.css. New classes are x-prefixed so nothing here fights the older pages. */

:root {
  /* categorical series, in fixed order; sequential blues for magnitude */
  --x-c1: #2a78d6; --x-c2: #eb6834; --x-c3: #1baf7a; --x-c4: #eda100; --x-c5: #e87ba4;
  --x-s1: #cde2fb; --x-s2: #9ec5f4; --x-s3: #5598e7; --x-s4: #256abf; --x-s5: #184f95;
  --x-grid: #e6eaf1;
  --x-good: #0a7a0a; --x-good-soft: #e3f3e3; --x-warn: #8a5a00; --x-warn-soft: #fbf0dd; --x-bad: #b32d2d; --x-bad-soft: #fbe9ea;
  --x-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --x-c1: #3987e5; --x-c2: #d95926; --x-c3: #199e70; --x-c4: #c98500; --x-c5: #d55181;
    --x-s1: #184f95; --x-s2: #1c5cab; --x-s3: #256abf; --x-s4: #5598e7; --x-s5: #9ec5f4;
    --x-grid: #26303d;
    --x-good: #5fd35f; --x-good-soft: #18301b; --x-warn: #f0b64a; --x-warn-soft: #352a12; --x-bad: #f08080; --x-bad-soft: #3a1c1e;
  }
}

/* ── KPI tiles ─────────────────────────────────────────────────────────────── */
.x-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.x-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
  min-width: 0; text-decoration: none; color: var(--ink); box-shadow: var(--e-1); }
a.x-kpi:hover { border-color: var(--accent); color: var(--ink); }
.x-kpi .l { font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 6px; align-items: center; }
.x-kpi .v { font: 500 26px/1.15 var(--x-mono); letter-spacing: -0.02em; }
.x-kpi .d { font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 8px; align-items: center; min-height: 30px; }
.x-kpi.bad .v { color: var(--x-bad); } .x-kpi.warn .v { color: var(--x-warn); } .x-kpi.good .v { color: var(--x-good); }
.x-fx { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted);
  font: 600 10px/1 var(--x-mono); cursor: help; flex: none; }

/* ── grid + card ───────────────────────────────────────────────────────────── */
.x-grid { display: grid; gap: 12px; margin: 0 0 12px; }
.x-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.x-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.x-grid.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.x-grid.g12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.x-grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.x-grid > .card, .x-grid + .card { margin-top: 0; }
.x-card { min-width: 0; padding: 16px; }
.x-card > header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.x-card > header h3 { margin: 0; font-size: var(--fs-md); }
.x-card > header .m { font-size: var(--fs-sm); color: var(--muted); }
.x-pill { display: inline-flex; align-items: center; font-size: var(--fs-sm); border-radius: 999px; padding: 2px 9px; background: var(--n-100); color: var(--ink-2); white-space: nowrap; }
.x-pill.good { background: var(--x-good-soft); color: var(--x-good); } .x-pill.warn { background: var(--x-warn-soft); color: var(--x-warn); } .x-pill.bad { background: var(--x-bad-soft); color: var(--x-bad); }
.x-eyebrow { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; font-weight: 500; }

/* ── charts ────────────────────────────────────────────────────────────────── */
.x-chart text, .x-donut text, .x-spark text { fill: var(--muted); font: 11px var(--x-mono); }
.x-chart .x-ax { stroke: var(--x-grid); stroke-width: 1; }
.x-chart .x-hit { cursor: pointer; }
.x-donut { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.x-donut text.c { fill: var(--ink); font: 500 15px var(--x-mono); }
.x-donut ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; flex: 1; min-width: 150px; font-size: var(--fs-base); }
.x-donut li { display: flex; gap: 8px; align-items: center; }
.x-donut li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.x-donut .pc { margin-left: auto; font: 12px var(--x-mono); }
.x-hbars { display: flex; flex-direction: column; }
.x-hb { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 78px; gap: 10px; align-items: center; padding: 5px 0; color: var(--ink); text-decoration: none; }
a.x-hb:hover .hl { color: var(--accent); }
.x-hb .hl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-base); }
.x-hb .tr { height: 10px; background: var(--n-100); border-radius: 5px; overflow: hidden; display: block; }
.x-hb .fl { display: block; height: 100%; border-radius: 0 5px 5px 0; }
.x-hb .hv { font: 12.5px var(--x-mono); text-align: right; }
.x-meter { position: relative; height: 8px; background: var(--n-100); border-radius: 4px; overflow: hidden; min-width: 60px; }
.x-meter .fl { position: absolute; left: 0; top: 0; bottom: 0; }
.x-meter .mk { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.x-tl .axis { position: relative; height: 18px; margin-left: var(--lw); font: 11px var(--x-mono); color: var(--muted); }
.x-tl .axis span { position: absolute; transform: translateX(-50%); }
.x-tl .rows { position: relative; }
.x-tl .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--x-c2); pointer-events: none; z-index: 1; }
.x-tl .tlrow { grid-template-columns: var(--lw) minmax(0, 1fr); padding: 3px 0; }
.x-tl .tlrow .tr { background: transparent; border-radius: 0; }
.x-tl .tlrow .fl { border-radius: 5px; }
.x-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); margin-top: 8px; }
.x-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.x-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--n-900); color: var(--n-0); font-size: 12.5px; padding: 7px 10px; border-radius: 7px;
  max-width: 280px; line-height: 1.4; white-space: pre-line; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ── attention list ────────────────────────────────────────────────────────── */
.x-att { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.x-att .row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
a.row:hover { background: var(--n-25); }
.x-att b { font-weight: 500; display: block; } .x-att .s { color: var(--muted); font-size: var(--fs-sm); display: block; }
.x-att .sev { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; flex: none; margin-top: 2px; background: var(--n-100); color: var(--ink-2); }
.x-att .sev.bad { background: var(--x-bad-soft); color: var(--x-bad); } .x-att .sev.warn { background: var(--x-warn-soft); color: var(--x-warn); }

/* ── shell: section rail + sub-tabs + lenses ───────────────────────────────── */
.x-sub { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.x-sub::-webkit-scrollbar { display: none; }
.x-sub a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; text-decoration: none; }
.x-sub a:hover { color: var(--ink); } .x-sub a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.x-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.x-pills a { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: var(--fs-sm); color: var(--ink); text-decoration: none; }
.x-pills a:hover { border-color: var(--accent); } .x-pills a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.x-lens { display: flex; gap: 4px; background: var(--n-100); padding: 4px; border-radius: 12px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.x-lens a { display: flex; gap: 7px; align-items: center; padding: 8px 14px; border-radius: 9px; white-space: nowrap; color: var(--ink-2); text-decoration: none; }
.x-lens a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.x-lens a.on { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: var(--e-1); }
.x-lens a:hover:not(.on) { color: var(--ink); }
.x-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin: 0 0 16px; }
.x-head h1, .x-head h2 { margin: 0; }
.x-head .sub { color: var(--muted); margin: 4px 0 0; }
.x-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.x-secbtn { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; color: var(--ink); text-decoration: none; box-shadow: var(--e-1); }
.x-secbtn:hover { border-color: var(--accent); color: var(--ink); }
.x-secbtn svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.x-secbtn .n { font: 12px var(--x-mono); } .x-secbtn .t { color: var(--muted); font-size: var(--fs-sm); }

/* desktop: the six sections become the left rail; the old per-section link list steps aside */
@media (min-width: 701px) { .sidebar .nav-group { display: none !important; } }
.x-rail { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.x-rail a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.x-rail a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.x-rail a:hover { background: var(--n-100); } .x-rail a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (min-width: 701px) { .topbar .sections { display: none; } }

@media (max-width: 1100px) {
  .x-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-grid.g3, .x-grid.g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-grid.g21, .x-grid.g12 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .x-grid.g2, .x-grid.g3, .x-grid.g5 { grid-template-columns: minmax(0, 1fr); }
  .x-hb { grid-template-columns: 100px minmax(0, 1fr) 70px; }
  .x-rail { display: none; }
}
@media (prefers-reduced-motion: no-preference) { .x-kpi, .x-secbtn { transition: border-color .12s; } }

#subnav:not(:empty) { padding: 20px 32px 0; max-width: 1320px; width: 100%; }
#subnav:not(:empty) + main { padding-top: 16px; }
@media (max-width: 700px) { #subnav:not(:empty) { padding: 12px 16px 0; } }

.x-gap { padding: 10px 0; border-bottom: 1px solid var(--line); }
.x-gap:last-child { border-bottom: 0; }
.x-gap .x-gaphead { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.x-gap p { margin: 4px 0 8px; }
.x-pillbtn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 12px; color: var(--ink); text-decoration: none; font-size: var(--fs-base); }
.x-pillbtn:hover { border-color: var(--accent); color: var(--accent); }
.x-termline { display: flex; justify-content: space-between; font: 12px var(--x-mono); color: var(--muted); margin-top: 6px; }
.x-embed .page-head, .x-embed > p.small:first-child { display: none; }

/* restyled pages: the band sits under the old header; the old stat strips it replaces step aside */
.x-band { margin: 4px 0 18px; }
.x-wrap.rr-wrap .totals, .x-wrap.vac-wrap .stats, .x-wrap.opex-wrap .totals { display: none; }
.x-wrap.debt-wrap .page-head + .totals { display: none; }
.x-colbar { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.x-wrap.x-slim .rr .rr-opt, .x-wrap.x-slim table .rr-opt { display: none; }
.x-wrap.retention-wrap .totals { display: none; }
@media (max-width: 700px) { .x-wrap.rr-wrap .x-colbar { display: none; } }
@media print { #subnav, .x-rail, .x-sub, .x-pills, .x-lens { display: none !important; } }
.x-wrap.comps-wrap .totals { display: none; }
.x-wrap.rr-wrap td .x-meter { margin-top: 5px; max-width: 110px; height: 5px; }

/* ═══ phone ═══ one-handed use: charts fold, targets are 44px, lists come before decoration ═══ */
.x-back { display: none; }
.x-skeleton { display: grid; gap: 12px; }
.x-skel { background: linear-gradient(90deg, var(--n-100), var(--n-50), var(--n-100)); background-size: 200% 100%; border-radius: 10px; }
.x-skel.title { height: 28px; width: 40%; } .x-skel.kpi { height: 84px; } .x-skel.card { height: 180px; } .x-skel.card.short { height: 110px; }
.x-skel-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.x-skel-say { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.x-skel-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--n-100); border-top-color: var(--accent, #00205B); animation: x-spin .8s linear infinite; }
.x-skel-slow { font-weight: 400; opacity: 0; animation: x-fadein .3s 2.5s forwards; }
@keyframes x-spin { to { transform: rotate(360deg); } }
@keyframes x-fadein { to { opacity: 1; } }
@keyframes x-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: no-preference) { .x-skel { animation: x-shimmer 1.4s linear infinite; } }

@media (max-width: 700px) {
  .x-skel-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .x-skel.kpi { height: 66px; }

  /* four numbers that fit in two short rows */
  .x-kpis { gap: 8px; margin-bottom: 12px; }
  .x-kpi { padding: 10px 12px; border-radius: 10px; }
  .x-kpi .v { font-size: 20px; }
  .x-kpi .d { min-height: 0; font-size: 11.5px; }

  /* charts fold under one tappable row */
  .x-charts { margin: 0 0 12px; }
  .x-charts > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; }
  .x-charts > summary::-webkit-details-marker { display: none; }
  .x-charts > summary::after { content: "▾"; color: var(--muted); }
  .x-charts[open] > summary::after { content: "▴"; }
  .x-charts[open] > summary { margin-bottom: 10px; }

  /* 44px targets */
  .x-pills { gap: 8px; }
  .x-pills a, .x-pills button, .x-pillbtn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; font-size: var(--fs-base); }
  .x-sub a, .x-lens a { min-height: 44px; display: flex; align-items: center; padding: 0 14px; }
  .x-wrap button.small, .x-card button.small, .x-colbar button { min-height: 44px; padding: 0 14px; }
  .x-wrap .chips .chip, .x-wrap .chip { min-height: 40px; }

  /* a row that scrolls sideways fades out on the right so it looks like it does */
  .x-sub, .x-lens { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }

  /* top bar: page name, and a back button on detail pages */
  .x-back:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px;
    font-size: 32px; line-height: 1; text-decoration: none; color: var(--accent); }

  /* bar charts: the name sits above its bar, so long names are not cut to four letters */
  .x-hb { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; row-gap: 4px; padding: 7px 0; }
  .x-hb .hl { grid-area: l; white-space: normal; }
  .x-hb .hv { grid-area: v; }
  .x-hb .tr { grid-area: t; }
  .x-tl .tlrow { grid-template-columns: var(--lw) minmax(0, 1fr); grid-template-areas: none; row-gap: 0; padding: 3px 0; }
  .x-tl .tlrow .hl, .x-tl .tlrow .tr { grid-area: auto; white-space: nowrap; }

  /* the certificate-request list as cards instead of four squeezed columns */
  .x-reqtable, .x-reqtable tbody { display: block; }
  .x-reqtable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .x-reqtable td { padding: 0; border: 0; }
  .x-reqtable td:nth-child(1) { grid-column: 1 / -1; font-weight: 600; }
  .x-reqtable td:nth-child(2), .x-reqtable td:nth-child(3) { grid-column: 1; }
  .x-reqtable td:nth-child(4) { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
}

/* ═══ field tools ═══ */
.x-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.x-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.x-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); border-radius: 999px; font: inherit; font-size: var(--fs-base); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.x-chip:hover { border-color: var(--accent); color: var(--accent); }
.x-chip.tel, .x-chip.sms, .x-chip.mail { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.x-actionbar { margin: 0 0 14px; }
.x-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.x-photos .ph { position: relative; padding: 0; border: 0; background: var(--n-100); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.x-photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-photos .ph .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.x-lightbox { border: 0; padding: 0; background: #0b0f14; color: #fff; width: min(96vw, 900px); max-height: 94vh; border-radius: 14px; overflow: hidden; }
.x-lightbox::backdrop { background: rgba(0,0,0,.7); }
.x-lightbox img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
.x-lightbox .cap { padding: 10px 14px 0; display: flex; flex-direction: column; gap: 2px; }
.x-lightbox .cap .muted { color: #9aa7b8; }
.x-lightbox .bar { display: flex; gap: 8px; padding: 12px 14px 14px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .x-actionbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; }
  .x-actionbar::-webkit-scrollbar { display: none; }
  .x-chip { min-height: 44px; }
  .x-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .x-lightbox { width: 100vw; max-height: 100vh; border-radius: 0; }
}

/* calendar agenda (phones) */
.x-agenda h4 { margin: 14px 0 6px; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.x-agenda section:first-child h4 { margin-top: 0; }
.x-agrow { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 0; min-height: 44px; font: inherit; font-weight: 400; }
.x-agrow .cal-dot { flex: none; margin-top: 6px; }
.x-agrow .t b { display: block; font-weight: 500; } .x-agrow .t .s { display: block; color: var(--muted); font-size: var(--fs-sm); }
.x-wrap.calendar-wrap.x-agendamode .cal-bar, .x-wrap.calendar-wrap.x-agendamode .cal-rail, .x-wrap.calendar-wrap.x-agendamode .cal-dow,
.x-wrap.calendar-wrap.x-agendamode .cal-grid, .x-wrap.calendar-wrap.x-agendamode .cal-drawer { display: none; }
@media (max-width: 700px) { .x-fx { position: relative; } .x-fx::after { content: ""; position: absolute; inset: -14px; } }
/* every real button is a 44px target on a phone; text-style link buttons keep their line height */
@media (max-width: 700px) { #view button:not(.link):not(.x-chip):not(.ph), #view select { min-height: 44px; } }

/* ⓘ tap targets (E-58): the 15px circle was also the hit box. On a touch screen the box is 32px, the drawn ring stays 15px, and the
   extra space is pulled back with negative margins so rows don't grow. (A tap already opens the tip; see charts.js tipInit.) */
@media (pointer: coarse), (max-width: 700px) {
  .x-fx:not(.ae-n) { width: 32px; height: 32px; margin: -9px -8px; border: 0;
    background: radial-gradient(circle at center, transparent 6.5px, currentColor 6.5px, currentColor 7.5px, transparent 8px); }
  .x-fx:not(.ae-n)::after { display: none; }
  .la-info { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; margin: -8px -8px -8px -5px; }
  .la-info::after { display: none; }
  .la-info > .la-pop { top: calc(100% - 4px); }
}

/* hides the old strip only where every figure on it is a KPI or detail line in the band */
.x-wrap.leasing-wrap > .totals { display: none; }

/* styles for restyle_b.js only */
/* Tenant health and Co-tenancy: every figure in the old strip is a KPI or its detail line, so the strip steps aside. */
.x-wrap.th-wrap .totals, .x-wrap.cot-wrap .totals { display: none; }

/* styles for restyle_c.js only */
/* Acquisitions: its five-tile strip is replaced by the band's KPIs (active + asking, signals, due, quiet), so it steps aside once the band shows. */
.x-wrap.acq-wrap.x-banded .totals { display: none; }

/* iPhone-style skin. Everything here applies only when phone.js has put `pn` on <body> (a phone-width screen), so
   desktop is untouched. It re-skins the existing pages by overriding colour tokens and a few component rules rather
   than rebuilding them: large titles, a translucent top bar with a back button, inset grouped lists, a translucent
   tab bar, bottom sheets for forms, action sheets, swipe actions, pull to refresh. */

body.pn {
  --bg: #f2f2f7; --panel: #ffffff; --panel-sunk: #f7f7fa; --ink: #000000; --ink-2: #1c1c1e; --muted: rgba(60, 60, 67, .62);
  --line: rgba(60, 60, 67, .18); --line-soft: rgba(60, 60, 67, .1);
  --n-0: #ffffff; --n-25: #f9f9fb; --n-50: #f2f2f7; --n-100: #ececf1; --n-200: #d8d8de; --n-300: #c1c1c8; --n-400: #8e8e93; --n-500: rgba(60, 60, 67, .62); --n-700: #3a3a3c; --n-900: #000000;
  --e-1: none; --e-2: 0 8px 30px rgba(0, 0, 0, .18); --r-md: 10px; --r-lg: 12px;
  --pn-bar: rgba(249, 249, 249, .95); --pn-fill: rgba(120, 120, 128, .12); --pn-sep: rgba(60, 60, 67, .22);
  font-size: 17px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  body.pn {
    --bg: #000000; --panel: #1c1c1e; --panel-sunk: #161618; --ink: #ffffff; --ink-2: #e5e5ea; --muted: rgba(235, 235, 245, .6);
    --line: rgba(84, 84, 88, .55); --line-soft: rgba(84, 84, 88, .35);
    --n-0: #1c1c1e; --n-25: #161618; --n-50: #000000; --n-100: #2c2c2e; --n-200: #3a3a3c; --n-300: #48484a; --n-400: #8e8e93; --n-500: rgba(235, 235, 245, .6); --n-700: #d1d1d6; --n-900: #ffffff;
    --pn-bar: rgba(22, 22, 24, .95); --pn-fill: rgba(120, 120, 128, .24); --pn-sep: rgba(84, 84, 88, .6);
  }
}
body.pn { background: var(--bg); }
body.pn .sidebar, body.pn #tabbar, body.pn .sections { display: none !important; }

/* ── top bar: back button, collapsing title, search ───────────────────────────────────────────────────────── */
body.pn .topbar { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0;
  min-height: calc(44px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 6px 0; border: 0; background: transparent;
  transition: background .15s, box-shadow .15s; }
body.pn .topbar.pn-scrolled { background: var(--pn-bar); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); box-shadow: 0 .5px 0 var(--pn-sep); }
body.pn .topbar-title { grid-column: 2; text-align: center; font-weight: 600; font-size: 17px; letter-spacing: 0; opacity: 0; transition: opacity .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; flex: none; }
body.pn .topbar.pn-scrolled .topbar-title { opacity: 1; }
/* back label room: while the centre title is faded out it takes no width, so the left column gets all the free space (the label was cut mid-word at half the bar); scrolled, the symmetric 3 columns come back and the title centres */
body.pn .topbar:not(.pn-scrolled):not(.searching) { grid-template-columns: minmax(0, 1fr) 0 auto; }
body.pn .topbar:not(.pn-scrolled) .topbar-title { max-width: 0; overflow: hidden; }
body.pn #topbar-back { grid-column: 1; justify-self: start; display: none; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 4px; color: var(--accent);
  font-size: 17px; font-weight: 400; text-decoration: none; max-width: 100%; }
body.pn #topbar-back:not([hidden]) { display: inline-flex; }
body.pn #topbar-back { width: auto; height: auto; margin-left: 0; line-height: 1.2; }
body.pn #topbar-back .pn-chev { width: 12px; height: 20px; flex: none; }
body.pn #topbar-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.pn #search-toggle { grid-column: 3; justify-self: end; color: var(--accent); }
body.pn .topbar.searching { display: flex; background: var(--pn-bar); }
body.pn .topbar.searching #topbar-back { display: none; }
body.pn #search-form input { font-size: 17px; background: var(--pn-fill); border: 0; border-radius: 10px; min-height: 36px; padding: 0 10px; }
body.pn .search-cancel { color: var(--accent); font-size: 17px; }

/* large titles */
body.pn main { padding: 0 16px calc(76px + env(safe-area-inset-bottom, 0px)); max-width: none; }
body.pn #subnav:not(:empty) { padding: 4px 16px 0; }
body.pn #view .page-head h2, body.pn #view .x-head h2, body.pn #view > h2 { font-size: 34px; font-weight: 700; line-height: 1.12; letter-spacing: .2px; margin: 2px 0 6px; }
body.pn #view .page-head, body.pn #view .x-head { margin-bottom: 10px; }
body.pn #view .sub, body.pn #view .x-head .sub { font-size: 15px; color: var(--muted); }
body.pn .x-eyebrow { font-size: 13px; letter-spacing: .02em; text-transform: none; color: var(--accent); font-weight: 400; }
body.pn .x-eyebrow a { color: var(--accent); text-decoration: none; }

/* ── segmented controls: section tabs, page-level pills, lens bar ──────────────────────────────────────────── */
body.pn .x-sub, body.pn .x-lens, body.pn #subnav .x-pills, body.pn #view > .x-pills { background: var(--pn-fill); border: 0; border-radius: 9px; padding: 2px; gap: 2px; margin: 4px 0 12px;
  -webkit-mask-image: none; mask-image: none; }
body.pn #subnav .x-pills, body.pn #view > .x-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body.pn .x-sub::-webkit-scrollbar, body.pn #subnav .x-pills::-webkit-scrollbar, body.pn #view > .x-pills::-webkit-scrollbar { display: none; }
body.pn .x-sub a, body.pn #subnav .x-pills a, body.pn #view > .x-pills a, body.pn .x-lens a { flex: none; min-height: 34px; padding: 0 14px; margin: 0; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
body.pn .x-sub a.on, body.pn #subnav .x-pills a.on, body.pn #view > .x-pills a.on, body.pn .x-lens a.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 .5px 1px rgba(0, 0, 0, .2); }
body.pn .x-lens a svg { display: none; }
/* pills inside a card are plain chips that wrap */
body.pn .x-card .x-pills { flex-wrap: wrap; }
body.pn .x-card .x-pills a { min-height: 40px; }

/* ── cards and lists as inset grouped lists ─────────────────────────────────────────────────────────────── */
body.pn .card, body.pn .x-card, body.pn .table-wrap { border: 0; border-radius: 12px; box-shadow: none; background: var(--panel); }
body.pn .x-card { padding: 14px 16px; }
body.pn .x-kpi { border: 0; border-radius: 14px; background: var(--panel); box-shadow: none; }
body.pn .x-kpi .v { font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-weight: 600; letter-spacing: -.3px; }
body.pn .card h3, body.pn .x-card > header h3 { font-size: 20px; font-weight: 700; }
body.pn .list li { padding: 12px 0; border-color: var(--line-soft); }
body.pn tbody tr, body.pn .cards tr { border-color: var(--line-soft); }
body.pn .badge { border-radius: 8px; font-weight: 600; }
body.pn .totals, body.pn .stats { gap: 10px; }
body.pn .totals .t, body.pn .stats .stat, body.pn .stat { border: 0; border-radius: 14px; background: var(--panel); box-shadow: none; }
body.pn .table-wrap.cards tr { border: 0; border-radius: 12px; background: var(--panel); }

/* controls */
body.pn button { border-radius: 10px; font-weight: 600; min-height: 44px; }
body.pn button.secondary { background: var(--accent-soft); color: var(--accent); border: 0; }
body.pn button.link { background: none; color: var(--accent); font-weight: 400; min-height: 0; }
body.pn button.danger { background: rgba(255, 59, 48, .12); color: #e5383b; border: 0; }
body.pn input, body.pn select, body.pn textarea { font-size: 17px; min-height: 44px; border: 0; border-radius: 10px; background: var(--panel); color: var(--ink); }
body.pn .toolbar input, body.pn .toolbar select { background: var(--panel); }
body.pn input[type="checkbox"], body.pn input[type="radio"] { min-height: 0; width: 22px; height: 22px; }
body.pn .fab { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }

/* ── tab bar ─────────────────────────────────────────────────────────────────────────────────────────────── */
.pn-tabs { display: none; }
body.pn #app-view:not([hidden]) ~ .pn-tabs { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  background: var(--pn-bar); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); box-shadow: 0 -.5px 0 var(--pn-sep);
  padding: 6px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
.pn-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 49px; padding-top: 2px; color: var(--muted);
  font-size: 10.5px; font-weight: 500; text-decoration: none; position: relative; }
.pn-tabs a svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pn-tabs a.on { color: var(--accent); }
.pn-tabs .pn-badge { position: absolute; top: -1px; left: calc(50% + 6px); background: #ff3b30; color: #fff; border-radius: 10px; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }

/* ── page transitions ────────────────────────────────────────────────────────────────────────────────────── */
body.pn #view.pn-push { animation: pnPush .34s cubic-bezier(.2, .8, .2, 1); }
body.pn #view.pn-pop { animation: pnPop .3s cubic-bezier(.2, .8, .2, 1); }
body.pn #view.pn-fade { animation: pnFade .18s ease; }
@keyframes pnPush { from { transform: translateX(100%); } to { transform: none; } }
@keyframes pnPop { from { transform: translateX(-28%); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pnFade { from { opacity: 0; } to { opacity: 1; } }

/* pull to refresh */
.pn-ptr { position: fixed; top: calc(52px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -60px); z-index: 45; width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel); box-shadow: 0 2px 10px rgba(0, 0, 0, .2); display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.pn-ptr svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2.4; stroke-linecap: round; }
.pn-ptr.spin svg { animation: pnSpin .8s linear infinite; }
@keyframes pnSpin { to { transform: rotate(360deg); } }

/* ── forms as bottom sheets ──────────────────────────────────────────────────────────────────────────────── */
body.pn dialog#modal { width: 100vw; max-width: none; margin: auto 0 0; max-height: 92dvh; border: 0; border-radius: 14px 14px 0 0; background: var(--bg); overflow: hidden; animation: pnSheet .32s cubic-bezier(.2, .8, .2, 1); }
body.pn dialog#modal::backdrop { background: rgba(0, 0, 0, .4); }
@keyframes pnSheet { from { transform: translateY(100%); } to { transform: none; } }
body.pn #modal-form { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "cancel title save" "body body body" "err err err"; max-height: 92dvh; padding: 0; gap: 0; align-items: center; }
body.pn #modal-form::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--line); }
body.pn #modal-title { grid-area: title; text-align: center; margin: 0; padding: 18px 0 8px; font-size: 17px; font-weight: 600; }
body.pn .modal-actions { display: contents; }
body.pn #modal-cancel { grid-area: cancel; justify-self: start; background: none; color: var(--accent); font-weight: 400; font-size: 17px; padding: 14px 16px 6px; min-height: 44px; }
body.pn #modal-save { grid-area: save; justify-self: end; background: none; color: var(--accent); font-weight: 600; font-size: 17px; padding: 14px 16px 6px; min-height: 44px; }
body.pn #modal-body { grid-area: body; overflow-y: auto; padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px)); max-height: calc(92dvh - 70px); }
body.pn #modal-error { grid-area: err; padding: 0 16px 12px; }
body.pn .modal-actions { position: static; border: 0; background: none; padding: 0; margin: 0; }

/* ── action sheets ───────────────────────────────────────────────────────────────────────────────────────── */
.pn-dim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .25s; pointer-events: none; }
.pn-dim.on { opacity: 1; pointer-events: auto; }
.pn-actions { position: fixed; z-index: 91; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; transform: translateY(120%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.pn-actions.on { transform: none; }
.pn-actions .g { background: var(--pn-bar); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); border-radius: 14px; overflow: hidden; }
.pn-actions .g .cap { padding: 12px; text-align: center; font-size: 13px; color: var(--muted); border-bottom: .5px solid var(--pn-sep); }
.pn-actions .g > a, .pn-actions .g > button { display: block; width: 100%; text-align: center; padding: 17px; font-size: 20px; font-weight: 400; color: var(--accent); background: none; border: 0; border-radius: 0; text-decoration: none; min-height: 56px; }
.pn-actions .g > a + a, .pn-actions .g > a + button, .pn-actions .g > button + a, .pn-actions .g > button + button { border-top: .5px solid var(--pn-sep); }
.pn-actions .g .red { color: #e5383b; }
.pn-actions .cancel > button { font-weight: 600; }

/* ── field tools as iOS round action buttons ─────────────────────────────────────────────────────────────── */
body.pn .x-actionbar.pn-actionbar { display: flex; gap: 8px; margin: 4px -16px 14px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
body.pn .x-actionbar.pn-actionbar::-webkit-scrollbar { display: none; }
body.pn .pn-act { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 0 8px; background: var(--panel); border: 0; border-radius: 12px;
  color: var(--accent); font-size: 11.5px; font-weight: 500; text-decoration: none; min-height: 0; }
body.pn .pn-act svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.pn .pn-act:active { background: var(--pn-fill); }

/* ── the More page: grouped settings-style list ──────────────────────────────────────────────────────────── */
.pn-group { background: var(--panel); border-radius: 12px; overflow: hidden; margin: 0 0 18px; }
.pn-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 16px; position: relative; width: 100%; text-align: left; color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: 0; font-size: 17px; font-weight: 400; }
.pn-row + .pn-row::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: .5px; background: var(--pn-sep); }
.pn-row:active { background: var(--pn-fill); }
.pn-row .ic { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; }
.pn-row .ic svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pn-row .tx { flex: 1; min-width: 0; } .pn-row .tx small { display: block; color: var(--muted); font-size: 13.5px; }
.pn-row .chev { width: 8px; height: 14px; stroke: var(--line); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pn-row.red { color: #e5383b; }
.pn-foot { color: var(--muted); font-size: 13px; padding: 0 16px; margin: -10px 0 18px; }

/* ── swipe actions on task rows ──────────────────────────────────────────────────────────────────────────── */
body.pn li.pn-swipe { position: relative; overflow: hidden; padding: 0; }
body.pn li.pn-swipe .pn-under { position: absolute; right: 0; top: 0; bottom: 0; display: flex; }
body.pn li.pn-swipe .pn-under button { width: 78px; min-height: 0; border-radius: 0; color: #fff; font-size: 14px; font-weight: 500; }
body.pn li.pn-swipe .task-row { position: relative; z-index: 1; background: var(--panel); transition: transform .22s cubic-bezier(.2, .8, .2, 1); padding: 12px 0; touch-action: pan-y; }
body.pn li.pn-swipe.pn-drag .task-row { transition: none; }
body.pn li.pn-swipe.pn-gone { height: 0 !important; opacity: 0; transition: all .26s; padding: 0; }

/* ═══ round 2: iPhone conventions for the chrome that came from the desktop page ═══ */
body.pn #subnav { display: none !important; }
.pn-subnav { margin: 0 0 6px; }
body.pn .pn-subnav .x-sub, body.pn .pn-subnav .x-pills { background: var(--pn-fill); border-radius: 9px; padding: 2px; gap: 2px; margin: 4px 0 10px; display: flex; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
body.pn .pn-subnav .x-sub::-webkit-scrollbar, body.pn .pn-subnav .x-pills::-webkit-scrollbar { display: none; }
body.pn .pn-subnav .x-sub a, body.pn .pn-subnav .x-pills a { flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: 13.5px; font-weight: 500;
  display: inline-flex; align-items: center; margin: 0; text-decoration: none; }
body.pn .pn-subnav .x-sub a.on, body.pn .pn-subnav .x-pills a.on { background: var(--panel); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 .5px 1px rgba(0, 0, 0, .2); }
body.pn .pn-moved { display: none !important; }
body.pn .x-head .actions:not(:has(*:not(.pn-moved))) { display: none; }

/* bar buttons on the right: + , Edit, ⋯, search */
body.pn #pn-barright { grid-column: 3; justify-self: end; display: flex; align-items: center; }
body.pn #pn-actions { display: flex; align-items: center; }
body.pn .pn-barbtn { min-width: 44px; min-height: 44px; padding: 0 6px; background: none; color: var(--accent); border: 0; border-radius: 0; font-size: 17px; font-weight: 400; display: inline-grid; place-items: center; }
body.pn .pn-barbtn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
body.pn .pn-barbtn.edit { font-weight: 400; padding: 0 8px; }
body.pn #search-toggle { grid-column: auto; }
/* the admin TV link, moved into the bar group by phone.js: same 44px target as its neighbours, not the 42px round chip */
body.pn #pn-barright .stream-btn { width: auto; height: auto; border-radius: 0; background: none; }
body.pn #pn-barright .stream-btn svg { width: 24px; height: 24px; }
body.pn #pn-barright .stream-btn .stream-dot { top: 9px; right: 9px; box-shadow: 0 0 0 2px var(--bg); }
body.pn .topbar.searching #pn-barright { display: none; }

/* filters live in a sheet behind one button */
body.pn .toolbar { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
body.pn .toolbar > input[type="search"], body.pn .toolbar > input[type="text"] { flex: 1 1 auto; max-width: none; }
body.pn .pn-filterbtn { flex: none; min-height: 44px; padding: 0 14px; }
.pn-fsheet { display: none; }
body.pn .pn-fsheet.open { display: flex; flex-direction: column; position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; max-height: 80dvh; background: var(--bg); border-radius: 14px 14px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -8px 30px rgba(0, 0, 0, .25); animation: pnSheet .3s cubic-bezier(.2, .8, .2, 1); }
body.pn .pn-fs-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; position: relative; }
body.pn .pn-fs-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--line); }
body.pn .pn-fs-head b { font-size: 17px; font-weight: 600; }
body.pn .pn-fs-head .link { color: var(--accent); font-size: 17px; font-weight: 600; text-decoration: none; min-height: 44px; }
body.pn .pn-fs-body { display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 20px; overflow-y: auto; }
body.pn .pn-fs-body > *, body.pn .pn-fs-body select, body.pn .pn-fs-body input { width: 100%; max-width: none; flex: none; }
body.pn .pn-fs-body label { color: var(--ink); font-size: 17px; }
body.pn .pn-fs-body input[type="checkbox"] { width: 22px; }
body.pn .add-row.pn-moved { display: block !important; position: static; }
body.pn .add-row.pn-moved > .pn-fsheet:not(.open) { display: none; }

/* leaner chrome */
body.pn #view > .page-head > p.sub, body.pn #view > .page-head .sub { margin-top: 0; }
body.pn .home-band .nqs, body.pn .nqs { border: 0; border-radius: 12px; overflow: hidden; }
body.pn .nq { border-color: var(--line-soft); }
body.pn .home-band .band-head { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 400; margin: 18px 0 6px 16px; }
body.pn .x-charts > summary { border: 0; border-radius: 12px; }
body.pn .x-charts > summary::after { content: "›"; font-size: 22px; transform: rotate(90deg); display: inline-block; }
body.pn .x-charts[open] > summary::after { content: "›"; transform: rotate(-90deg); }

/* list rows (the tables-as-cards): a title, then a two-column grid of labelled values */
body.pn .table-wrap.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px 16px; }
body.pn .cards td { display: block; padding: 0; min-width: 0; font-size: 15px; }
body.pn .cards td::before { display: block; flex: none; font-size: 12px; margin-bottom: 1px; }
body.pn .cards td:first-child { grid-column: 1 / -1; font-size: 17px; padding-bottom: 2px; }
body.pn .cards td.blank { display: none; }

.cards td:first-child::before { display: none !important; }
body.pn .cards td:first-child::before { display: none !important; }

/* the property list */
.pn-sechead { font: 400 13px/1.2 var(--font, inherit); text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin: 16px 0 6px 16px; }
.pn-row .val { color: var(--muted); font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.pn-row .val small { display: block; font-size: 12px; }
.pn-empty { padding: 24px 16px; text-align: center; }
body.pn label.pn-search { display: flex; flex-direction: row; align-items: center; gap: 6px; background: var(--pn-fill); border-radius: 10px; height: 36px; padding: 0 8px; color: var(--muted); margin: 4px 0 10px; font-size: 17px; }
body.pn .pn-search svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; flex: none; }
body.pn .pn-search input { flex: 1; min-width: 0; border: 0; background: none; font-size: 17px; color: var(--ink); outline: none; min-height: 0; padding: 0; border-radius: 0; }
body.pn .pn-seg { display: flex; background: var(--pn-fill); border-radius: 9px; padding: 2px; gap: 2px; margin: 0 0 4px; }
body.pn .pn-seg button { flex: 1; min-height: 32px; padding: 0 4px; border-radius: 7px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; }
body.pn .pn-seg button.on { background: var(--panel); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 .5px 1px rgba(0, 0, 0, .2); }
body.pn .chip, body.pn .chips .chip { border: 0; background: var(--panel); color: var(--ink); border-radius: 999px; font-weight: 500; min-height: 36px; }
body.pn .chip.on, body.pn .chips .chip.on { background: var(--accent); color: var(--accent-ink); }
body.pn .pn-subnav, body.pn .pn-fsheet, body.pn .pn-seg, body.pn .pn-search { animation: none !important; }

/* ═══ round 3: from the October 9 phone review ═══ */

/* tap targets: a finger needs about 44px; grow the hit area without moving anything */
body.pn .la-info { position: relative; }
body.pn .la-info::after { content: ""; position: absolute; inset: -14px; }
body.pn a.small, body.pn #view .page-head p.sub > a:only-child { display: inline-block; padding-block: 12px; margin-block: -12px; }

/* section tabs that scroll sideways: fade the edge that has more past it */
body.pn .pn-subnav .x-sub.pn-more-r, body.pn .pn-subnav .x-pills.pn-more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
body.pn .pn-subnav .x-sub.pn-more-l, body.pn .pn-subnav .x-pills.pn-more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
body.pn .pn-subnav .x-sub.pn-more-l.pn-more-r, body.pn .pn-subnav .x-pills.pn-more-l.pn-more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }

/* the four numbers on list pages: a 2 x 2 grid, every tile fully on screen (a swipe strip clipped the labels and cut the last tile off). Home keeps its own 2 x 2. */
body.pn:not([data-pn-route="home"]) #view .x-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; padding: 0; }
body.pn:not([data-pn-route="home"]) #view .x-kpis > .x-kpi { min-width: 0; padding: 9px 12px; }
body.pn:not([data-pn-route="home"]) #view .x-kpis > .x-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
body.pn:not([data-pn-route="home"]) #view .x-kpis > .x-kpi .l, body.pn:not([data-pn-route="home"]) #view .x-kpis > .x-kpi .d { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-width: 0; min-height: 0; }
body.pn:not([data-pn-route="home"]) #view .x-kpis > .x-kpi .l .x-fx { margin-left: 6px; vertical-align: -2px; }
body.pn:not([data-pn-route="home"]) #view .x-kpis > .x-kpi .v { font-size: 20px; white-space: nowrap; }

/* the agenda's one row for expired certificates is a link, but should look like the rows around it */
body.pn a.x-agrow { color: inherit; text-decoration: none; }

/* page descriptions: two lines at most on a phone */
body.pn #view .page-head p.sub, body.pn #view .x-head p.sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* "a new version is ready" bar, above the tab bar */
.pn-update { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: var(--panel); font-size: 15px; box-shadow: var(--e-2); }
.pn-update button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }

/* ═══ round 4: the simple look (October 9 redesign) ═══
   White page, one blue for actions, rounded heavy type for titles and big numbers, pills for every button and chip,
   soft borderless cards, and plain tints for state: blush = late, butter = needs a look, sky = info. */
body.pn {
  --bg: #ffffff; --panel: #f4f5f7; --panel-sunk: #eef0f3; --ink: #0e1116; --ink-2: #1c2129; --muted: #5f6672;
  --line: #e3e6eb; --line-soft: #eef0f3; --accent: #1e5eff; --accent-hover: #1446c7; --accent-soft: #eaf0ff; --accent-ink: #ffffff;
  --pn-bar: rgba(255, 255, 255, .97); --pn-fill: #f2f4f7; --pn-sep: #eef0f3;
  --pn-round: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, system-ui, sans-serif;
  --pn-blush: #fdecec; --pn-blush-ink: #b42318; --pn-butter: #fff4d6; --pn-butter-ink: #8a5a00; --pn-sky: #eaf0ff; --pn-sky-ink: #1446c7;
}
@media (prefers-color-scheme: dark) {
  body.pn {
    --bg: #0b0d10; --panel: #171a1f; --panel-sunk: #121418; --ink: #f4f5f7; --ink-2: #e3e6eb; --muted: #a3a9b3;
    --line: #2a2f37; --line-soft: #20242a; --accent: #6e9bff; --accent-hover: #8fb2ff; --accent-soft: #1a2540; --accent-ink: #0b0d10;
    --pn-bar: rgba(11, 13, 16, .97); --pn-fill: #1d2127; --pn-sep: #20242a;
    --pn-blush: #3a1d1f; --pn-blush-ink: #ff9b93; --pn-butter: #3a2f12; --pn-butter-ink: #ffd27a; --pn-sky: #1a2540; --pn-sky-ink: #a9c3ff;
  }
}

/* type: titles and the numbers that matter in the rounded face */
body.pn #view .page-head h2, body.pn #view .x-head h2, body.pn #view > h2 { font-family: var(--pn-round); font-weight: 800; letter-spacing: -.5px; }
body.pn .x-kpi .v, body.pn .stat .v, body.pn .totals .t .v { font-family: var(--pn-round); font-weight: 800; }
body.pn .card h3, body.pn .x-card > header h3, body.pn .pn-sechead { font-family: var(--pn-round); }

/* buttons and chips are pills; the main one is blue, the quiet one grey with dark text */
/* :where keeps this at low specificity, so special buttons (swipe actions, action sheets, the bar) keep their shapes */
body.pn :where(button:not(.link, .pn-barbtn, .pn-row, .icon-btn)) { border-radius: 999px; }
body.pn button.secondary { background: var(--pn-fill); color: var(--ink); }
body.pn .badge { border-radius: 999px; padding-inline: 10px; }
body.pn .pn-filterbtn { background: var(--pn-fill); color: var(--ink); }

/* cards: softer and rounder, no borders or shadows */
body.pn .card, body.pn .x-card, body.pn .table-wrap { border-radius: 24px; }
body.pn .x-kpi { border-radius: 20px; }
body.pn .pn-group, body.pn .home-band .nqs, body.pn .nqs { border-radius: 20px; }
body.pn input, body.pn select, body.pn textarea { border-radius: 14px; }

/* section tabs: separate pills, the current one dark */
body.pn .pn-subnav .x-sub, body.pn .pn-subnav .x-pills { background: transparent; padding: 0; gap: 6px; }
body.pn .pn-subnav .x-sub a, body.pn .pn-subnav .x-pills a { min-height: 38px; border-radius: 999px; background: var(--pn-fill); font-weight: 600; }
body.pn .pn-subnav .x-sub a.on, body.pn .pn-subnav .x-pills a.on { background: var(--ink); color: var(--bg); box-shadow: none; }

/* tab bar: solid, the current tab dark rather than blue */
body.pn #app-view:not([hidden]) ~ .pn-tabs { box-shadow: 0 -1px 0 var(--pn-sep); }
.pn-tabs a { font-weight: 600; font-size: 11px; }
body.pn .pn-tabs a.on { color: var(--ink); }
body.pn .pn-tabs .pn-badge { background: #e5484d; }

/* task checkboxes: big round targets that fill blue */
body.pn .task-row input[type="checkbox"], body.pn .list input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; min-height: 0; flex: none; margin: 0;
  border-radius: 50%; border: 2.5px solid #c4c9d1; background: var(--bg); display: inline-grid; place-items: center; cursor: pointer; }
body.pn .task-row input[type="checkbox"]:checked, body.pn .list input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
body.pn .task-row input[type="checkbox"]:checked::after, body.pn .list input[type="checkbox"]:checked::after { content: ""; width: 12px; height: 7px; margin-top: -3px;
  border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg); }

/* Home on a phone */
body.pn .pn-home-head { margin-bottom: 4px; }
body.pn .pn-hi { margin: 0; font-size: 17px; font-weight: 600; color: var(--muted); }
body.pn #view .x-head h2.pn-big { font-family: var(--pn-round); font-weight: 900; font-size: 50px; letter-spacing: -1.5px; line-height: 1.05; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
body.pn .pn-big-sub { margin: 0; font-size: 17px; color: var(--muted); }
body.pn .pn-occ { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 0; text-decoration: none; color: var(--ink); }
body.pn .pn-occ-top { display: flex; justify-content: space-between; align-items: baseline; }
body.pn .pn-occ-top b { font-family: var(--pn-round); font-weight: 800; font-size: 20px; }
body.pn .pn-occ-top span, body.pn .pn-occ-sub { font-size: 15px; color: var(--muted); }
body.pn .pn-bar { display: block; height: 14px; border-radius: 7px; background: var(--accent-soft); overflow: hidden; }
body.pn .pn-bar b { display: block; height: 100%; border-radius: 7px; background: var(--accent); }
body.pn .pn-today { font-family: var(--pn-round); font-weight: 800; font-size: 22px; margin: 26px 0 10px; }
body.pn .pn-cards { display: flex; flex-direction: column; gap: 10px; }
body.pn .pn-card { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 24px; text-decoration: none; color: var(--ink); background: var(--pn-sky); }
body.pn .pn-card.late { background: var(--pn-blush); } body.pn .pn-card.look { background: var(--pn-butter); }
body.pn .pn-card-n { flex: none; width: 48px; height: 48px; border-radius: 24px; background: var(--bg); display: grid; place-items: center; font-family: var(--pn-round); font-weight: 900; font-size: 19px; color: var(--pn-sky-ink); }
body.pn .pn-card.late .pn-card-n { color: var(--pn-blush-ink); } body.pn .pn-card.look .pn-card-n { color: var(--pn-butter-ink); }
body.pn .pn-card-n svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
body.pn .pn-card-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
body.pn .pn-card-tx b { font-size: 17px; line-height: 1.25; }
body.pn .pn-card-tx small { font-size: 14px; color: var(--muted); }
body.pn .pn-card-go { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 14px; }
body.pn .pn-clear { padding: 24px; border-radius: 24px; background: var(--pn-sky); text-align: center; font-weight: 600; }
body.pn .pn-more-link { margin: 18px 0 0; text-align: center; }
body.pn .pn-more-link a { display: inline-block; padding: 12px 18px; font-weight: 700; color: var(--accent); text-decoration: none; }

/* Properties: a coloured initial and a small "how full" bar on each row */
body.pn .pn-row.pn-prop { min-height: 64px; }
body.pn .pn-ini { flex: none; width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; font-family: var(--pn-round); font-weight: 900; font-size: 18px; }
body.pn .pn-ini.t0 { background: var(--pn-sky); color: var(--pn-sky-ink); } body.pn .pn-ini.t1 { background: var(--pn-butter); color: var(--pn-butter-ink); }
body.pn .pn-ini.t2 { background: #e6f7f4; color: #0b6b5c; } body.pn .pn-ini.t3 { background: #f3edff; color: #5b33c2; }
body.pn .pn-row .tx small { display: flex; align-items: center; gap: 8px; }
body.pn .pn-fill { flex: none; width: 48px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
body.pn .pn-fill b { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
body.pn .pn-fill.part b { background: #f5a623; }
body.pn .pn-row .val { color: var(--ink); font-family: var(--pn-round); font-weight: 800; }

/* Home: the big number sits right on top of how full you are; the section pills are in the tab bar already */
body.pn[data-pn-route="home"] .pn-subnav { display: none; }

/* Properties: city and "how full" on one line; the filter as pills like the section tabs */
body.pn .pn-row.pn-prop .tx small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; }
body.pn .pn-row.pn-prop .tx small { min-width: 0; }
body.pn .pn-seg { background: transparent; padding: 0; gap: 6px; }
body.pn .pn-seg button { flex: none; min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--pn-fill); font-size: 15px; font-weight: 600; }
body.pn .pn-seg button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
body.pn .pn-row.pn-prop .pn-sm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ round 5: the old pieces brought into the simple look ═══ */

/* links: no underlines; plain links read as bold blue text */
body.pn #view a:not([class]), body.pn #view a.small { text-decoration: none; color: var(--accent); font-weight: 600; }
/* links in a page header ("Team: who has what…", "Export .ics") are quiet grey pills */
body.pn #view .page-head a.small, body.pn #view .x-head a.small, body.pn #view .actions a.small {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; margin-block: 0; border-radius: 999px;
  background: var(--pn-fill); color: var(--ink); font-size: 14px; font-weight: 700; }

/* status badges: soft tinted pills, no outlines. red = late or leaving, yellow = needs a look, blue = fine */
body.pn .badge { border: 0; padding: 3px 10px; font-size: 13px; font-weight: 700; background: var(--pn-fill); color: var(--ink-2); }
body.pn .badge.high, body.pn .badge.overdue, body.pn .badge.urgent, body.pn .badge.past-due, body.pn .badge.coi-expired { background: var(--pn-blush); color: var(--pn-blush-ink); }
body.pn .badge.holdover, body.pn .badge.notice, body.pn .badge.vacant, body.pn .badge.pending, body.pn .badge.coi-review { background: var(--pn-butter); color: var(--pn-butter-ink); }
body.pn .badge.occupied, body.pn .badge.done, body.pn .badge.active, body.pn .badge.coi-soon, body.pn .badge.coi-good { background: var(--pn-sky); color: var(--pn-sky-ink); }

/* the number cards: red when late, yellow when it needs a look, otherwise plain black (no green "0") */
body.pn .x-kpi.bad .v { color: var(--pn-blush-ink); }
body.pn .x-kpi.warn .v { color: var(--pn-butter-ink); }
body.pn .x-kpi.good .v { color: var(--ink); }

/* Charts: a small "Show charts" link instead of a grey bar */
body.pn .x-charts > summary { background: transparent; border: 0; padding: 0 2px; min-height: 44px; justify-content: flex-start; gap: 6px;
  font-size: 0; color: var(--accent); }
body.pn .x-charts > summary::before { content: "Show charts"; font-size: 15px; font-weight: 700; }
body.pn .x-charts[open] > summary::before { content: "Hide charts"; }
body.pn .x-charts > summary::after { font-size: 20px; color: var(--accent); }
/* the section tabs are links without a class too: keep them dark, not link-blue */
body.pn #view .pn-subnav a:not(.on) { color: var(--ink); }
/* text buttons ("Follow up", "Edit" in rows) read like the links: bold blue, no underline */
body.pn button.link { text-decoration: none; font-weight: 600; color: var(--accent); }

/* ═══ round 6: less before the content ═══ */
body.pn .pn-desc { display: none; }
/* the page row under the section pills, folded into one button */
body.pn .pn-subpick { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; margin: 0 0 10px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 700; }
body.pn .pn-subpick::after { content: ""; width: 7px; height: 7px; margin: -4px 0 0 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* group headers on lists: quiet, normal case */
body.pn .pn-sechead { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 700; color: var(--muted); }
/* loading: grey blocks shaped like a page instead of the word "Loading…" */
body.pn #view > p.muted:only-child { color: transparent; user-select: none; min-height: 420px; margin: 8px 0 0; border-radius: 0;
  background:
    linear-gradient(var(--pn-fill), var(--pn-fill)) 0 0 / 55% 40px no-repeat,
    linear-gradient(var(--pn-fill), var(--pn-fill)) 0 64px / 100% 84px no-repeat,
    linear-gradient(var(--pn-fill), var(--pn-fill)) 0 164px / 100% 64px no-repeat,
    linear-gradient(var(--pn-fill), var(--pn-fill)) 0 244px / 100% 64px no-repeat,
    linear-gradient(var(--pn-fill), var(--pn-fill)) 0 324px / 100% 64px no-repeat;
  animation: pnPulse 1.2s ease-in-out infinite alternate; }
@keyframes pnPulse { from { opacity: 1; } to { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { body.pn #view > p.muted:only-child { animation: none; } }
/* the coloured initials on Properties in dark mode */
@media (prefers-color-scheme: dark) {
  body.pn .pn-ini.t2 { background: #12312b; color: #7fd8c6; }
  body.pn .pn-ini.t3 { background: #2a2140; color: #c9b5ff; }
}
body.pn #view .page-head p.sub.pn-desc, body.pn #view .x-head p.sub.pn-desc { display: none; }

/* ═══ round 7: forms, records, rent roll ═══ */

/* edit pop-ups: fields stay inside the sheet (they ran off the right edge) */
body.pn #modal-body input, body.pn #modal-body select, body.pn #modal-body textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
body.pn #modal-body label { font-size: 14px; color: var(--muted); }
body.pn #modal-body .row, body.pn #modal-body .grid { grid-template-columns: 1fr; }

/* New task sheet: a big title box, labels on the left, the property picker stacked so nothing is cut off */
body.pn .pn-fsheet input[aria-label="Task title"] { font-family: var(--pn-round); font-size: 22px; font-weight: 700; min-height: 56px; }
body.pn .pn-fs-body .assign-to { display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left; font-size: 14px; color: var(--muted); }
body.pn .pn-fs-body .attach { display: flex; flex-direction: column; gap: 10px; width: 100%; }
body.pn .pn-fs-body .attach select { width: 100%; }
body.pn .pn-fs-body button:not(.link) { min-height: 56px; font-size: 18px; }

/* list cards (Leases, Vendors, Bids…): labels small and in normal case instead of capitals */
body.pn .cards td::before { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); }

/* a page whose data lives on the Mac Mini */
body.pn .mini-only, .mini-only { padding: 24px; border-radius: 24px; background: var(--pn-sky, var(--accent-soft)); }

/* one lease / one contact: the header block */
body.pn .pn-hero { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 16px; }
body.pn .pn-hero > .pn-chip { align-self: flex-start; margin-bottom: 4px; }
body.pn .pn-hero-big { font-family: var(--pn-round); font-weight: 900; font-size: 48px; line-height: 1.05; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
body.pn .pn-hero-sub { margin: 0 0 8px; font-size: 17px; color: var(--muted); }
body.pn .pn-hero .pn-card { margin: 6px 0 4px; }
body.pn .pn-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; margin-top: 10px; }
body.pn .pn-fact { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
body.pn .pn-fact span, body.pn .pn-fact small { font-size: 13px; color: var(--muted); }
body.pn .pn-fact b { font-family: var(--pn-round); font-weight: 800; font-size: 21px; }
body.pn .pn-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 8px 12px; }
body.pn .pn-act2 { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; }
body.pn .pn-act2 > span { width: 58px; height: 58px; border-radius: 29px; display: grid; place-items: center; background: var(--accent); color: #fff; }
body.pn .pn-act2 svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.pn .pn-act2.off { color: var(--muted); } body.pn .pn-act2.off > span { background: var(--pn-fill); color: var(--muted); }

/* chips used on the hero and the rent roll */
body.pn .pn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
body.pn .pn-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 800; background: var(--pn-fill); color: var(--ink); border: 0; }
body.pn .pn-chip.late { background: var(--pn-blush); color: var(--pn-blush-ink); }
body.pn .pn-chip.look { background: var(--pn-butter); color: var(--pn-butter-ink); }
body.pn .pn-chip.fine { background: var(--pn-sky); color: var(--pn-sky-ink); }
body.pn .pn-chip-btn { min-height: 32px; }

/* Rent roll on a phone */
body.pn .pn-big-num { margin: 6px 0 0; font-family: var(--pn-round); font-weight: 900; font-size: 46px; letter-spacing: -1.5px; line-height: 1.05; font-variant-numeric: tabular-nums; }
body.pn .pn-rr-pick { width: 100%; margin: 0 0 6px; }
body.pn .pn-rr-group { margin: 14px 0 0; }
body.pn .pn-rr-group .pn-sechead { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 4px 6px; }
body.pn .pn-rr-group .pn-sechead a { color: var(--ink); }
body.pn .pn-rr-group .pn-sechead span { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
body.pn .pn-rr { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 18px; color: var(--ink); text-decoration: none; }
body.pn .pn-rr.empty { background: var(--pn-butter); } body.pn .pn-rr.late { background: var(--pn-blush); } body.pn .pn-rr.soon { background: var(--pn-sky); }
body.pn .pn-rr-unit { flex: none; width: 64px; min-height: 38px; padding: 4px 6px; box-sizing: border-box; border-radius: 12px; background: var(--pn-fill); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--ink-2); text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
body.pn .pn-rr.empty .pn-rr-unit, body.pn .pn-rr.late .pn-rr-unit, body.pn .pn-rr.soon .pn-rr-unit { background: var(--bg); }
body.pn .pn-rr-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
body.pn .pn-rr-tx b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.pn .pn-rr-tx small { font-size: 13px; color: var(--muted); }
body.pn .pn-rr.empty .pn-rr-tx small { color: var(--pn-butter-ink); font-weight: 700; } body.pn .pn-rr.late .pn-rr-tx small { color: var(--pn-blush-ink); font-weight: 700; }
body.pn .pn-rr-amt { flex: none; white-space: nowrap; font-family: var(--pn-round); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
/* edit pop-ups: the property picker ("About") is two dropdowns; stack them at normal height */
body.pn #modal-body .attach { display: flex; flex-direction: column; gap: 10px; width: 100%; }
body.pn #modal-body select { height: auto; min-height: 48px; align-self: stretch; }
body.pn #modal-body label.wide { align-items: stretch; }
body.pn #modal-body .attach { height: auto !important; min-height: 0; flex: none; }
body.pn #modal-body .attach select { flex: none; height: auto; }

/* ═══ round 8: list cards without the label grid ═══
   Name on top, then one wrapped line of "label value · label value" instead of a two-column grid of capitals. */
body.pn .table-wrap.cards tr:not(.grp) { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0; row-gap: 4px; padding: 12px 16px; }
body.pn .table-wrap.cards tr:not(.grp) td { display: inline-flex; align-items: baseline; gap: 5px; width: auto; padding: 0; font-size: 15px; color: var(--ink-2); }
body.pn .table-wrap.cards tr:not(.grp) td:first-child, body.pn .table-wrap.cards tr:not(.grp) td.rr-tenant { flex: 1 1 100%; display: block; font-size: 17px; font-weight: 700; color: var(--ink); padding-bottom: 2px; }
body.pn .table-wrap.cards tr:not(.grp) td::before { display: inline; flex: none; margin: 0; font-size: 13px; font-weight: 400; color: var(--muted); }
body.pn .table-wrap.cards tr:not(.grp) td:not(:first-child):not(.rr-tenant) ~ td:not(.blank)::before { content: "· " attr(data-label); padding-left: 8px; }
body.pn .table-wrap.cards tr:not(.grp) td:empty, body.pn .table-wrap.cards tr:not(.grp) td.blank { display: none; }
body.pn .table-wrap.cards td a { min-height: 0; }
body.pn .table-wrap.cards tr.grp td { text-transform: none; letter-spacing: 0; font-size: 15px; }
/* detail cells flow as text, so a long tenant name wraps like a sentence */
body.pn .table-wrap.cards tr:not(.grp) { display: block; }
body.pn .table-wrap.cards tr:not(.grp) td:not(:first-child):not(.rr-tenant) { display: inline; line-height: 1.6; }
body.pn .table-wrap.cards tr:not(.grp) td:not(:first-child):not(.rr-tenant)::before { margin-right: 4px; }
body.pn .table-wrap.cards tr:not(.grp) td:first-child, body.pn .table-wrap.cards tr:not(.grp) td.rr-tenant { margin-bottom: 4px; }
body.pn .table-wrap.cards tr:not(.grp) td.blank, body.pn .table-wrap.cards tr:not(.grp) td:empty { display: none !important; }

/* ═══ round 9: polish and iPhone accessibility ═══ */
/* list cards: each "label value" wraps as one piece with space between, so no "·" is left at the end of a line */
body.pn .table-wrap.cards tr:not(.grp) { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; row-gap: 2px; }
body.pn .table-wrap.cards tr:not(.grp) td:not(:first-child):not(.rr-tenant) { display: block; max-width: 100%; line-height: 1.5; }
body.pn .table-wrap.cards tr:not(.grp) td:not(:first-child):not(.rr-tenant) ~ td:not(.blank)::before { content: attr(data-label); padding-left: 0; }

/* New task: When chips and people as faces (they set the original date box and dropdown) */
body.pn .pn-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
body.pn :is(#view, #modal-body) .pn-pick button:not(.link) { min-height: 44px; height: auto; padding: 0 16px; border: 0; border-radius: 22px; background: var(--pn-fill); color: var(--ink); font-size: 15px; font-weight: 700; box-shadow: none; }
body.pn :is(#view, #modal-body) .pn-pick button.on { background: var(--ink); color: var(--bg); }
body.pn .pn-faces { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 4px; }
body.pn :is(#view, #modal-body) .pn-faces button:not(.link) { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; height: auto; padding: 0; border: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 700; box-shadow: none; }
body.pn .pn-faces button > span { width: 52px; height: 52px; border-radius: 26px; display: grid; place-items: center; font-family: var(--pn-round); font-weight: 900; font-size: 21px; background: var(--pn-fill); color: var(--ink-2); }
body.pn .pn-faces button.t1 > span { background: var(--pn-sky); color: var(--pn-sky-ink); }
body.pn .pn-faces button.t2 > span { background: var(--pn-butter); color: var(--pn-butter-ink); }
body.pn .pn-faces button.t3 > span { background: var(--pn-blush); color: var(--pn-blush-ink); }
body.pn .pn-faces button.on > span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
body.pn select.pn-hidden-sel { display: none !important; }
body.pn .pn-fs-body input[type=date] + .pn-pick { margin-top: -2px; }

/* empty pages: a picture and a sentence instead of a grey line */
body.pn .pn-emptystate { display: flex !important; flex-direction: column; align-items: center; gap: 12px; margin: 24px 0; padding: 28px 24px !important; text-align: center; font-size: 17px; line-height: 1.4; color: var(--muted); background: none; border: 0; }
body.pn .pn-emptystate::before { content: attr(data-emoji); width: 84px; height: 84px; border-radius: 42px; display: grid; place-items: center; font-size: 40px; background: var(--pn-sky); }

/* task rows: when and where; the rest is one tap (or swipe) away */
body.pn .task-row .meta .pn-trim { display: none !important; }

/* iPhone basics: no zoom when a box gets focus (iOS zooms under 16px), a visible focus ring, 44pt targets, calmer motion */
body.pn :where(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) { font-size: 16px; }
body.pn :where(button:not(.link), select, input[type=date], input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number]) { min-height: 44px; }
body.pn .pn-search { min-height: 44px; }
body.pn .pn-search input { min-height: 40px; }
body.pn :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
body.pn { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  body.pn *, body.pn *::before, body.pn *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ═══ round 10: the rest of the design canvas ═══ */
body.pn { --pn-mint: #e6f7f4; --pn-mint-ink: #0b6b5c; --pn-lilac: #f3edff; --pn-lilac-ink: #5b33c2; }
@media (prefers-color-scheme: dark) { body.pn { --pn-mint: #12302b; --pn-mint-ink: #7fe0cd; --pn-lilac: #261d3d; --pn-lilac-ink: #c6b3ff; } }

/* quick actions (Directions, Call, Note, Task, Photo): round icons with the word under them */
body.pn .x-actionbar.pn-actionbar { gap: 4px; margin: 8px -16px 18px; }
body.pn .x-actionbar.pn-actionbar .pn-act { width: 74px; gap: 8px; padding: 0; background: none; border-radius: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
body.pn .x-actionbar.pn-actionbar .pn-act svg { width: 60px; height: 60px; padding: 17px; box-sizing: border-box; border-radius: 30px; background: var(--pn-fill); color: var(--accent); stroke-width: 2.2; }
body.pn .x-actionbar.pn-actionbar .pn-act:active svg { background: var(--pn-sky); }

/* one property: the name small, the rent big, how full it is in a card */
body.pn[data-pn-route="properties"][data-pn-depth="2"] #view .x-head h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.3px; }
body.pn[data-pn-route="properties"][data-pn-depth="2"] #view .x-kpis { display: none; }
body.pn .pn-prop-hero { margin-top: 2px; }
body.pn .pn-card.fine { background: var(--pn-sky); } body.pn .pn-card.look { background: var(--pn-butter); }
body.pn .pn-card.fine .pn-card-n { color: var(--pn-sky-ink); }

/* Tasks: "54 to do" in place of the number tiles */
body.pn[data-pn-route="tasks"][data-pn-depth="1"] #view .x-kpis { display: none; }
body.pn .pn-tasks-hero .pn-hero-sub { margin: 0; }
body.pn .pn-tasks-hero .pn-chips { align-items: center; margin: 12px 0 6px; }
body.pn .pn-chips a.pn-chip { text-decoration: none; }
body.pn .pn-hint { font-size: 14px; color: var(--muted); }

/* Home: the Add button, then the Add sheet with four tiles and a box to just type it */
body.pn .pn-fab { position: fixed; z-index: 40; right: 20px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 28px; background: var(--accent); color: #fff; font-family: var(--pn-round); font-weight: 800; font-size: 18px;
  box-shadow: 0 8px 24px rgba(30, 94, 255, .35); }
body.pn .pn-fab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; }
body.pn .pn-dim.on ~ .pn-fab, body.pn.sheet-open .pn-fab { display: none; }
body.pn #view:has(.pn-fab) { padding-bottom: 96px; }
body.pn .pn-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.pn #pn-add .pn-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; min-height: 128px; padding: 16px;
  border: 0; border-radius: 26px; text-align: left; color: var(--ink); background: var(--pn-sky); font-size: 15px; box-shadow: none; }
body.pn #pn-add .pn-tile.butter { background: var(--pn-butter); } body.pn #pn-add .pn-tile.mint { background: var(--pn-mint); } body.pn #pn-add .pn-tile.lilac { background: var(--pn-lilac); }
body.pn .pn-tile-ic { width: 46px; height: 46px; border-radius: 23px; background: var(--bg); display: grid; place-items: center; color: var(--pn-sky-ink); }
body.pn .pn-tile.butter .pn-tile-ic { color: var(--pn-butter-ink); } body.pn .pn-tile.mint .pn-tile-ic { color: var(--pn-mint-ink); } body.pn .pn-tile.lilac .pn-tile-ic { color: var(--pn-lilac-ink); }
body.pn .pn-tile-ic svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
body.pn .pn-tile-tx { display: flex; flex-direction: column; gap: 2px; }
body.pn .pn-tile-tx b { font-family: var(--pn-round); font-weight: 800; font-size: 19px; }
body.pn .pn-tile-tx small { font-size: 14px; color: var(--ink-2); opacity: .8; }
body.pn .pn-quick { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; font-size: 15px; font-weight: 700; color: var(--muted); }
body.pn .pn-quick-row { display: flex; gap: 8px; }
body.pn .pn-quick-row input { flex: 1; min-width: 0; min-height: 52px; padding: 0 18px; border-radius: 26px; font-size: 17px; }
body.pn #pn-add .pn-quick-row button { flex: none; min-height: 52px; padding: 0 20px; font-size: 17px; }

/* "Added!" */
body.pn .pn-yay { position: fixed; z-index: 300; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(300px, calc(100vw - 48px)); padding: 28px 22px; box-sizing: border-box; border-radius: 32px;
  background: var(--bg); box-shadow: 0 24px 60px rgba(0, 0, 0, .22); text-align: center; transition: opacity .18s, transform .22s cubic-bezier(.3, 1.4, .6, 1); }
body.pn .pn-yay.on { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
body.pn .pn-yay-ic { width: 88px; height: 88px; border-radius: 44px; background: var(--accent); color: #fff; display: grid; place-items: center; }
body.pn .pn-yay b { font-family: var(--pn-round); font-weight: 900; font-size: 30px; letter-spacing: -.5px; }
body.pn .pn-yay span:not(.pn-yay-ic) { font-size: 16px; color: var(--muted); line-height: 1.35; }

/* A file picker is as wide as its chosen filename text; on the Import page it pushed the page 16px past a 390px screen (found by the release gate, PRG-0.7). */
body.pn #view input[type="file"] { max-width: 100%; min-width: 0; }

/* WP-43: stacked backdrop blur makes phones lag. Blur stays only on the top-most overlay (the action sheet, .pn-actions .g);
   the top bar and tab bar go opaque so their text stays readable without it. */
@media (max-width: 700px) {
  body.pn .topbar.pn-scrolled, body.pn #app-view:not([hidden]) ~ .pn-tabs { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}

/* "X is on Y →" pointer cards: one quiet 13px line, no dashed box (a 44px dashed card per moved chart ate the screen); the link is still a full-width tap row */
body.pn .x-elsewhere { min-height: 32px; padding: 6px 2px; margin: 0 0 4px; border: 0; border-radius: 0; background: none; font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.pn .x-grid > .x-elsewhere, body.pn .x-elsewhere-stack > .x-elsewhere { margin: 0; }
/* bar rows (rent roll, tenants...): the figure never clips; the name ellipsizes instead */
body.pn .v2-brows .v2-orow { grid-template-columns: minmax(0, 1.2fr) minmax(24px, .6fr) auto; gap: 10px; }
body.pn .v2-brows .v2-vdays { white-space: nowrap; flex: none; min-width: 0; }
body.pn .v2-brows .v2-vname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ PHONE-P1: the approved phone design (navy masthead, one-line pills, white cards, 5 tabs) ═══
   Tokens are the design's: page #f4f6fa, card white with a #dde3ec line, navy #00205b. Dark mode keeps the same roles. */
body.pn {
  --p1-page: #f4f6fa; --p1-card: #ffffff; --p1-line: #dde3ec; --p1-soft: #eef1f6; --p1-strong: #00205b; --p1-pill: #dbe7fb; --p1-link: #1b4f9c; --p1-muted: #5d6b7e;
  --p1-chip-line: #c3ccda; --p1-tab: #4a5a70; --p1-red: #b42318; --p1-green: #237a46; --p1-orange: #8a4b08; --p1-redbg: #fde8e8; --p1-redink: #9b1c1c; --p1-greenbg: #e3f3ea; --p1-greenink: #1d6b3e;
  --p1-amberbg: #fdf0d5; --p1-amberink: #8a4b08; --p1-bluebg: #e8f0fc; --p1-blueink: #1e3a8a; --p1-ontrack: #4f8fdc; --p1-late: #e5484d; --p1-warn: #d9822b;
}
@media (prefers-color-scheme: dark) {
  body.pn {
    --p1-page: #0b0d10; --p1-card: #171a1f; --p1-line: #2a2f37; --p1-soft: #20242a; --p1-strong: #cfe0ff; --p1-pill: #1f3358; --p1-link: #8fb2ff; --p1-muted: #a3a9b3;
    --p1-chip-line: #3a4150; --p1-tab: #a3a9b3; --p1-red: #ff8a84; --p1-green: #5fd08a; --p1-orange: #f3c86b; --p1-redbg: #3a1d1f; --p1-redink: #ff9b93; --p1-greenbg: #12301f; --p1-greenink: #7fe0a5;
    --p1-amberbg: #3a2f12; --p1-amberink: #ffd27a; --p1-bluebg: #1a2540; --p1-blueink: #a9c3ff;
  }
}

/* top bar: one 52px row, white, a line under it. Section roots name themselves on the left; inner pages show "‹ previous page". */
body.pn .topbar, body.pn .topbar.pn-scrolled { min-height: calc(52px + env(safe-area-inset-top, 0px)); background: var(--p1-card); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 1px 0 var(--p1-line); padding: env(safe-area-inset-top, 0px) 8px 0 4px; }
body.pn.pn-root .topbar:not(.searching) { grid-template-columns: minmax(0, 1fr) auto; padding-left: 16px; }
body.pn.pn-root .topbar:not(.searching) .topbar-title { grid-column: 1; justify-self: start; text-align: left; opacity: 1; max-width: none; font-weight: 800; font-size: 17px; color: var(--p1-strong); }
body.pn.pn-root #pn-barright { grid-column: 2; }
body.pn #topbar-back { color: var(--p1-link); font-weight: 600; }
body.pn .pn-barbtn, body.pn #search-toggle { color: var(--p1-strong); }

/* tab bar: five tabs, the current one is a pale-blue pill behind its icon */
body.pn #app-view:not([hidden]) ~ .pn-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--p1-card); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 -1px 0 var(--p1-line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px)); }
body.pn .pn-tabs a { color: var(--p1-tab); font-size: 11px; font-weight: 700; gap: 2px; }
body.pn .pn-tabs a .pn-tab-ic { width: 52px; height: 30px; }
body.pn .pn-tabs a svg { width: 24px; height: 24px; stroke-width: 1.8; }
/* the active icon follows the label colour (redesign.css forced navy, which vanished on the dark pill) */
body.pn .pn-tabs a.on svg { stroke: currentColor; }
body.pn .pn-tabs a.on { color: var(--p1-strong); font-weight: 800; }
body.pn .pn-tabs a.on .pn-tab-ic { background: var(--p1-pill); }

/* the Data screen's second group */
body.pn .pn-calc-head { font-family: var(--font-display, inherit); font-weight: 600; font-size: 18px; margin: 22px 0 8px; }

/* masthead pages: the page is the design's grey, the band runs edge to edge */
body.pn main#view:has(> .v2-page) { padding: 0 0 calc(88px + env(safe-area-inset-bottom, 0px)); background: var(--p1-page); }
body.pn .v2-page { background: var(--p1-page); min-height: 0; }
body.pn .v2-masthead .v2-wrap { box-sizing: border-box; max-width: none; padding: 18px 16px 16px; gap: 14px; }
body.pn .v2-kicker { font-size: 11px; letter-spacing: .12em; }
body.pn .v2-headline { font-size: 23px; line-height: 1.2; letter-spacing: 0; }
body.pn .v2-tiles { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; border-radius: 14px; }
body.pn .v2-tiles-none { height: 0; }
body.pn .v2-tile { padding: 12px 14px; gap: 4px; }
body.pn .v2-tile-v { font-size: 26px; }
body.pn .v2-tile-u { font-size: 13px; }
body.pn .v2-segbar { height: 6px; border-radius: 3px; }
body.pn .v2-body { box-sizing: border-box; max-width: none; padding: 16px; gap: 14px; }

/* one line of page pills under the band */
body.pn .pn-pillrow { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; background: var(--p1-card); border-bottom: 1px solid var(--p1-line); }
body.pn .pn-pillrow::-webkit-scrollbar { display: none; }
body.pn .pn-pillrow a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; border: 1px solid var(--p1-chip-line);
  color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
body.pn .pn-pillrow a.on { background: var(--p1-strong); border-color: var(--p1-strong); color: var(--p1-card); font-weight: 800; }
body.pn .pn-pillrow.pn-more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }

/* cards */
body.pn .v2-card, body.pn .v2-decide, body.pn .v2-big { background: var(--p1-card); border: 1px solid var(--p1-line); border-radius: 16px; padding: 14px 16px; gap: 10px; }
body.pn .v2-card-head h2, body.pn .v2-sec-head h2 { font-size: 18px; }
body.pn .v2-sec-head h2 { font-size: 20px; }
body.pn .v2-link, body.pn .v2-linkbtn { color: var(--p1-link); }
body.pn .v2-row { padding: 8px 0; }
body.pn .v2-row-lead { min-width: 48px; }
body.pn .v2-row-sub, body.pn .v2-meta { color: var(--p1-muted); }

/* the page folded under "All …" */
body.pn details.pn-all { padding: 0; }
body.pn details.pn-all > summary { list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px; min-height: 44px; cursor: pointer;
  font-family: var(--font-display, inherit); font-weight: 600; font-size: 18px; }
body.pn details.pn-all > summary::-webkit-details-marker { display: none; }
body.pn details.pn-all > summary > span:first-child { white-space: nowrap; }
body.pn details.pn-all > summary .v2-meta { font-family: var(--font); font-weight: 400; font-size: 12px; text-align: right; }
body.pn details.pn-all > summary::after { content: "›"; margin-left: auto; font-size: 22px; color: var(--p1-muted); transform: rotate(90deg); }
body.pn details.pn-all[open] > summary::after { transform: rotate(-90deg); }
body.pn details.pn-all > .v2-legacy { padding: 0 12px 12px; border: 0; border-radius: 0; background: none; }
body.pn details.pn-all .v2-all-head { display: none; }
body.pn details.pn-all > .v2-card { border: 0; border-radius: 0; background: none; padding: 0 16px 14px; }

/* shared list pieces */
body.pn .pn-more { display: block; font-size: 13px; padding-top: 4px; }
body.pn .pn-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
body.pn .pn-legend span { display: inline-flex; align-items: center; gap: 6px; }
body.pn .pn-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
body.pn .pn-legend .pn-zero, body.pn .pn-legend.text { color: var(--p1-muted); font-size: 12px; }
body.pn .pn-late { flex: none; text-align: right; font-size: 13px; font-weight: 800; color: var(--p1-red); }
body.pn .pn-linkline { font-size: 13px; font-weight: 700; color: var(--p1-link); text-decoration: none; padding: 4px 2px; }
body.pn .pn-bars { display: flex; flex-direction: column; gap: 10px; }
body.pn .pn-prow { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: var(--ink); }
body.pn .pn-prow-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
body.pn .pn-prow-track { display: block; height: 8px; border-radius: 4px; background: var(--p1-soft); overflow: hidden; }
body.pn .pn-prow-track > span { display: block; height: 100%; background: var(--p1-ontrack); }
body.pn .pn-prow-track > .warn { background: var(--p1-warn); }
body.pn .pn-prow-track > .hot { background: var(--p1-late); }
body.pn .pn-insrow { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--p1-soft); }
body.pn .pn-insrow b { display: block; }
body.pn .v2-pipebar .v2-segbar { height: 10px; border-radius: 5px; background: var(--p1-soft); }
body.pn .v2-insbar { height: 30px; gap: 2px; }
body.pn .v2-insbar .v2-inseg { font-size: 13px; }

/* renewal rows with one-tap status */
body.pn .pn-renrow { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--p1-soft); }
body.pn .pn-renline { display: flex; gap: 12px; align-items: center; }
body.pn .pn-renline .v2-datetile { flex: 0 0 44px; padding: 5px 0; }
body.pn .pn-renmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
body.pn #view .pn-renmain a, body.pn #view .pn-needmain a, body.pn #view .pn-decide-who { color: var(--ink); text-decoration: none; }
body.pn .pn-renamt { flex: none; white-space: nowrap; }
body.pn .pn-renst { font-size: 12px; font-weight: 800; }
body.pn .pn-renst.bad { color: var(--p1-red); } body.pn .pn-renst.ok { color: var(--p1-green); } body.pn .pn-renst.info { color: var(--p1-link); }
body.pn .pn-ones { display: flex; gap: 6px; padding-left: 56px; }
body.pn .pn-one { flex: 1 1 0; min-height: 40px; border-radius: 999px; border: 1px solid var(--p1-chip-line); background: var(--p1-card); font-size: 12px; font-weight: 800; padding: 0 4px; }
body.pn .pn-one.offered { color: var(--p1-link); } body.pn .pn-one.renewing { color: var(--p1-green); } body.pn .pn-one.leaving { color: var(--p1-red); }
body.pn .pn-one[aria-pressed="true"] { background: var(--p1-soft); }

/* Undo bar, above the tab bar */
body.pn .pn-undobar { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 6px 6px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 15px; box-shadow: var(--e-2); }
body.pn .pn-undobar.on { display: flex; }
body.pn .pn-undobar button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--p1-pill); color: var(--p1-strong); font-weight: 800; }
/* Home: Decide first */
body.pn .pn-decide-sec { display: flex; flex-direction: column; gap: 10px; }
body.pn .pn-decide-sec .v2-sec-head { margin: 0; }
body.pn .pn-decide { gap: 8px; text-decoration: none; color: var(--ink); }
body.pn .pn-decide-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
body.pn .pn-chip2 { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; }
body.pn .pn-chip2.amber { background: var(--p1-amberbg); color: var(--p1-amberink); } body.pn .pn-chip2.red { background: var(--p1-redbg); color: var(--p1-redink); }
body.pn .pn-amt { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 600; white-space: nowrap; }
body.pn .pn-amt small { font-family: inherit; font-size: 12px; color: var(--p1-muted); font-weight: 700; }
body.pn .pn-q { font-size: 15px; }
body.pn .pn-decide-body { display: flex; flex-direction: column; gap: 8px; }
body.pn .pn-decide-inner { background: var(--p1-page); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
body.pn .pn-decide-count { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--p1-muted); align-items: center; }
body.pn .pn-skip { all: unset; cursor: pointer; font-weight: 800; color: var(--p1-link); padding: 8px 0 8px 12px; }
body.pn .pn-decide-who { display: block; font-weight: 700; color: var(--ink); text-decoration: none; }
body.pn .pn-ones3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
body.pn .pn-dec { min-height: 40px; border-radius: 999px; border: 0; font-size: 13px; font-weight: 800; padding: 0 4px; }
body.pn .pn-dec.ex { background: #237a46; color: #fff; } body.pn .pn-dec.lap { background: #c4373c; color: #fff; }
body.pn .pn-dec.ns { background: var(--p1-card); color: var(--ink); border: 1px solid var(--p1-chip-line); }
body.pn .pn-foot2 { font-size: 12px; color: var(--p1-muted); }
body.pn .pn-foot2 a { color: var(--p1-link); font-weight: 800; text-decoration: none; }
body.pn .pn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.pn .pn-small { display: flex; flex-direction: column; gap: 4px; min-width: 0; background: var(--p1-card); border: 1px solid var(--p1-line); border-radius: 16px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
body.pn .pn-small-k { font-size: 12px; font-weight: 800; } body.pn .pn-small-k.blue { color: var(--p1-blueink); } body.pn .pn-small-k.amber { color: var(--p1-amberink); }
body.pn .pn-amt2 { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 600; }
/* Home: dates and tasks */
body.pn .v2-dates { gap: 0; }
body.pn .v2-date { padding: 8px 0; border-top: 1px solid var(--p1-soft); align-items: center; }
body.pn .v2-date:first-child { border-top: 0; }
body.pn .v2-datetile { flex: 0 0 44px; padding: 5px 0; }
body.pn .v2-dt-d { font-size: 19px; }
body.pn .pn-late-count { font-size: 12px; font-weight: 800; color: var(--p1-red); }
body.pn .pn-taskrow { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--p1-soft); }
body.pn .pn-taskdate { flex: 0 0 48px; font-size: 12px; font-weight: 800; color: var(--p1-muted); } body.pn .pn-taskdate.late { color: var(--p1-red); }
body.pn .pn-taskmain { min-width: 0; display: flex; flex-direction: column; }
body.pn .pn-tasklink { all: unset; cursor: pointer; font-weight: 700; font-size: 15px; line-height: 1.35; }
body.pn .v2-tile-u { display: none; }
/* Rent roll */
body.pn .pn-find2 { display: flex; flex-direction: row; align-items: center; gap: 8px; background: var(--p1-card); border: 1px solid var(--p1-line); border-radius: 12px; padding: 0 12px; min-height: 44px; color: var(--p1-muted); }
body.pn .pn-find2 svg { flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
body.pn .pn-find2 input { border: 0; outline: 0; font-size: 16px; flex: 1 1 auto; min-width: 0; background: none; color: var(--ink); padding: 0; min-height: 0; border-radius: 0; }
body.pn .v2-legend { display: flex; gap: 14px; font-size: 12px; color: var(--p1-muted); padding: 0 2px; }
body.pn .v2-legend span { display: inline-flex; align-items: center; gap: 5px; }
body.pn .v2-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
body.pn .pn-rrp { display: flex; flex-direction: column; gap: 12px; }
body.pn .pn-rrcard { padding: 0; }
body.pn .pn-rrcard > summary { list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; cursor: pointer; }
body.pn .pn-rrcard > summary::-webkit-details-marker { display: none; }
body.pn .pn-rrhead { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-display, inherit); }
body.pn .pn-rrhead b { font-weight: 600; font-size: 17px; } body.pn .pn-rrhead b + b { font-family: inherit; font-size: 15px; font-weight: 800; white-space: nowrap; }
body.pn .pn-rrmix { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
body.pn .pn-rrfoot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--p1-muted); }
body.pn .pn-rrrows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 8px 16px 14px; border-top: 1px solid var(--p1-soft); }
body.pn .pn-rrrow { display: grid; grid-template-columns: minmax(0, 1fr) 56px auto; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); text-decoration: none; }
body.pn .pn-rrname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.pn .pn-rramt { text-align: right; white-space: nowrap; }
body.pn .pn-more.link { all: unset; cursor: pointer; font-size: 13px; font-weight: 800; color: var(--p1-link); padding: 6px 2px; display: block; }
/* Vacancies */
body.pn .pn-h2 { margin: 0; font-family: var(--font-display, inherit); font-weight: 600; font-size: 20px; }
body.pn .pn-kick { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--p1-muted); }
body.pn .pn-first { border: 2px solid var(--p1-late); gap: 6px; }
body.pn .pn-fill-sf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
body.pn .pn-fill-sf a, body.pn .pn-fill-sf > b { font-family: var(--font-display, inherit); font-weight: 600; font-size: 22px; color: var(--ink); text-decoration: none; }
body.pn .pn-fill-sf .v2-row-sub { font-size: 13px; }
body.pn .pn-note { font-size: 13px; color: var(--ink-2); } body.pn .pn-note.amber { color: var(--p1-amberink); font-weight: 700; }
body.pn .pn-two { display: flex; gap: 8px; padding-top: 4px; }
body.pn .pn-solid, body.pn .pn-outline { flex: 1 1 0; min-height: 40px; border-radius: 999px; font-size: 14px; font-weight: 800; }
body.pn .pn-solid { background: var(--p1-strong); color: var(--p1-card); border: 0; }
body.pn .pn-outline { background: var(--p1-card); color: var(--ink); border: 1px solid var(--p1-chip-line); }
body.pn .pn-mid, body.pn .pn-cell { text-decoration: none; color: var(--ink); gap: 4px; }
body.pn .pn-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.pn .pn-cell { padding: 12px 14px; gap: 2px; min-width: 0; } body.pn .pn-cell.wide { grid-column: 1 / -1; }
body.pn .pn-cell b { font-family: var(--font-display, inherit); font-weight: 600; font-size: 19px; }
body.pn .pn-cell .pn-kick { letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Asset Management overview */
body.pn .pn-opps { display: flex; flex-direction: column; }
body.pn .pn-opp { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--p1-soft); text-decoration: none; color: var(--ink); }
body.pn .pn-opp:first-child { border-top: 0; padding-top: 0; }
body.pn .pn-tag { flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
body.pn .pn-tag.risk { background: var(--p1-redbg); color: var(--p1-redink); } body.pn .pn-tag.upside { background: var(--p1-greenbg); color: var(--p1-greenink); } body.pn .pn-tag.gap { background: var(--p1-soft); color: var(--p1-muted); }
body.pn .pn-opp-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
body.pn .pn-opp-amt { flex: none; white-space: nowrap; }
body.pn .pn-prow-track > .navy { background: var(--p1-link); }
body.pn .pn-roll { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; height: 110px; padding-top: 8px; }
body.pn .pn-roll-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; min-width: 0; }
body.pn .pn-roll-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--p1-ontrack); }
body.pn .pn-roll-bar.late { background: var(--p1-late); } body.pn .pn-roll-bar.grey { background: #95a1b3; }
body.pn .pn-roll-x { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; font-size: 11px; color: var(--p1-muted); text-align: center; }
/* Property hub */
body.pn .pn-addr { font-size: 13px; color: var(--v2-band-ink); }
body.pn .v2-hub .v2-hubhead { display: none; }
body.pn .v2-hub > .x-actionbar.pn-actionbar { margin: 0; padding: 14px 12px 12px; background: var(--p1-card); border-bottom: 1px solid var(--p1-line); display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 4px; overflow: visible; }
body.pn .v2-hub > .pn-actionbar .pn-act { width: auto; background: none; color: var(--ink); font-size: 12px; font-weight: 700; padding: 0; gap: 4px; }
body.pn .v2-hub > .pn-actionbar .pn-act svg { box-sizing: content-box; width: 22px; height: 22px; padding: 14px; border-radius: 50%; background: var(--p1-soft); color: var(--p1-strong); }
body.pn .v2-hub > .pn-actionbar .pn-act:first-child { }
body.pn .x-lens.pn-pillrow { border-radius: 0; margin: 0; background: var(--p1-card); padding: 10px 16px; gap: 8px; }
body.pn .x-lens.pn-pillrow a { min-height: 40px; padding: 0 14px; border-radius: 999px; background: transparent; box-shadow: none; font-size: 14px; font-weight: 700; }
body.pn .x-lens.pn-pillrow a.on { background: var(--p1-strong); color: var(--p1-card); font-weight: 800; }
body.pn .pn-pillrow.pn-subpills { border-top: 0; padding-top: 0; }
body.pn .pn-needs { display: flex; flex-direction: column; }
body.pn .pn-need { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--p1-soft); }
body.pn .pn-needdate { flex: 0 0 56px; font-size: 12px; font-weight: 800; color: var(--p1-muted); } body.pn .pn-needdate.late { color: var(--p1-red); }
body.pn .pn-needmain { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
body.pn .pn-needmain a { color: var(--ink); text-decoration: none; }
body.pn .pn-kindchip { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--p1-soft); color: var(--ink-2); }
body.pn .pn-kindchip.blue { background: var(--p1-bluebg); color: var(--p1-blueink); }
body.pn .pn-spaces { display: grid; grid-template-columns: minmax(0, 1fr) 56px auto; gap: 4px 10px; align-items: center; font-size: 14px; }
body.pn .pn-space { display: contents; }
body.pn .pn-spname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
body.pn .pn-spsub { grid-column: 1 / -1; font-size: 12px; color: var(--p1-muted); margin-top: -2px; padding-bottom: 6px; }
body.pn .pn-space.vac > * { padding-top: 6px; }
body.pn .pn-spname .v2-row-sub, body.pn .pn-rrname .v2-row-sub { display: inline; }
/* END PHONE-P1 */

/* ═══ PHONE-FIXES (2026-10-27 audit): nothing bleeds sideways, nothing hides under the tab bar, scrollers say there is more ═══ */
/* last content clears the 72px tab bar plus the home-indicator inset. !important because v2.css zeroes the padding with
   "#subnav:not(:empty) + main#view:has(> .v2-page)" (two ids), which beat every earlier bottom padding on phone */
body.pn main#view { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; }
body.pn main#view:has(.pn-fab) { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
/* long links, badges and selects wrap or shrink instead of widening the page */
body.pn .v2-link, body.pn .v2-linkbtn { white-space: normal; }
body.pn .v2-card-aside { flex-wrap: wrap; min-width: 0; gap: 4px 14px; }
body.pn #view .badge { white-space: normal; max-width: 100%; }
body.pn .grid-2 { grid-template-columns: minmax(0, 1fr); }   /* minmax(340px, 1fr) was wider than a phone card (vendor ledger, 3px bleed) */
body.pn .grid-2 > * { min-width: 0; }
body.pn .am-filters { gap: 10px; }
body.pn .am-filter { flex: 1 1 100%; min-width: 0; max-width: 100%; }
body.pn .am-filter select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
/* rent roll: names wrap, the unit label stays whole */
body.pn .pn-rrname { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
body.pn .pn-rrname .v2-row-sub { white-space: nowrap; overflow-wrap: normal; }
/* properties card city and vacancy kicker wrap rather than cut */
body.pn .pn-row.pn-prop .pn-sm { white-space: normal; overflow: visible; text-overflow: clip; }
body.pn .pn-cell .pn-kick { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
/* edge fades on scrolling rows (a mask fades the content itself, so it reads in light and dark alike) */
body.pn .pn-pillrow.pn-more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
body.pn .pn-pillrow.pn-more-l.pn-more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
body.pn #view .totals.pn-more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
body.pn #view .totals.pn-more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
body.pn #view .totals.pn-more-l.pn-more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
/* the property map page's own heading row */
body.pn .map-head { padding-top: 8px; }
/* sheets: the body scrolls inside the sheet; use the small viewport so the sheet never outgrows the screen */
body.pn dialog#modal, body.pn #modal-form { max-height: min(92dvh, 100svh - 12px); }
body.pn #modal-body { max-height: calc(min(92dvh, 100svh - 12px) - 70px); overscroll-behavior: contain; }

/* ── DevelopmentOS on the phone (M0 of the DevOS phone plan) ──────────────────────────────────────────────────
   devos.js puts pn-devos on <body> while #/developmentos is open on a phone. The CRM top bar, page head and section
   links go away; the DevOS frame fills the screen from the top (below the notch) down to the tab bar, which stays.
   The tab bar is 6px + 49px + 4px tall plus the home-indicator inset (see .pn-tabs above). */
body.pn.pn-devos { overflow: hidden; }
body.pn.pn-devos .topbar, body.pn.pn-devos #subnav, body.pn.pn-devos #view > .page-head,
body.pn.pn-devos .pn-subnav, body.pn.pn-devos .pn-seclink, body.pn.pn-devos .pn-pillrow { display: none !important; }
body.pn.pn-devos iframe.devos-frame { position: fixed; z-index: 30; left: 0; right: 0; top: env(safe-area-inset-top, 0px);
  bottom: var(--pn-tabs-h, calc(59px + env(safe-area-inset-bottom, 0px))); width: 100%; min-height: 0 !important;
  /* --pn-tabs-h = the tab bar's measured height incl. the home-indicator inset (devos.js); an iframe is a replaced element: top + bottom alone leave it at its 150px intrinsic height, so give it the height outright */
  height: calc(100vh - env(safe-area-inset-top, 0px) - var(--pn-tabs-h, calc(59px + env(safe-area-inset-bottom, 0px)))) !important;
  height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--pn-tabs-h, calc(59px + env(safe-area-inset-bottom, 0px)))) !important;
  border: 0 !important; border-radius: 0 !important; background: #fff; }

/* Account button: phone header only (the desktop header has its own person button in v2.js). */
#pn-acct { display: none; }
body.pn #pn-acct { display: inline-grid; }
body.pn .task-row .task-take { min-height: 40px; padding: 0 14px; }
body.pn .appr-actions button { min-height: 44px; padding: 0 18px; font-size: 16px; }
body.pn .appr-row .meta { display: flex; flex-wrap: wrap; gap: 2px 0; }

/* Lease analyzer. Consumes the design tokens in styles.css only, so dark mode follows them. */

.la-tabs { display: flex; gap: var(--s-1); flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 var(--s-4); }
.la-tabs a { padding: var(--s-2) var(--s-3); color: var(--muted); text-decoration: none; border-radius: var(--r-md) var(--r-md) 0 0; }
.la-tabs a[aria-current=page] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* ⓘ formula tooltips: hover on a desktop, tap on a phone (the popover is toggled in JS). */
.la-info { display: inline-block; margin-left: 3px; color: var(--muted); cursor: help; font-size: var(--fs-xs);
  position: relative; user-select: none; }
.la-info:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 50%; }
.la-pop { position: absolute; z-index: 30; left: 50%; top: 1.6em; transform: translateX(-50%); width: max-content;
  max-width: min(320px, 80vw); background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--e-2); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); font-size: var(--fs-sm);
  line-height: var(--lh-base); white-space: normal; font-weight: 400; text-align: left; }

.la-quote { margin: var(--s-1) 0 0; padding: var(--s-1) var(--s-3); border-left: 3px solid var(--line);
  color: var(--ink-2); font-size: var(--fs-sm); font-style: italic; white-space: pre-wrap; word-break: break-word; }
.la-cite { font-size: var(--fs-sm); color: var(--muted); }
.la-cite a { word-break: break-all; }
.la-term { padding: var(--s-3) 0; border-top: 1px solid var(--line-soft); display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto; gap: var(--s-2) var(--s-4); align-items: start; }
.la-term:first-of-type { border-top: 0; }
.la-term .k { color: var(--muted); font-size: var(--fs-sm); }
.la-term .v { white-space: pre-wrap; word-break: break-word; }
.la-term.missing .v { color: var(--muted); }
.la-actions { display: flex; gap: var(--s-1); flex-wrap: wrap; justify-content: flex-end; }
.la-actions button { padding: 2px 8px; font-size: var(--fs-xs); }

.badge.la-extracted { color: var(--muted); }
.badge.la-verified { background: var(--good-soft); color: var(--good); border-color: currentColor; }
.badge.la-disputed { background: var(--error-soft); color: var(--error); border-color: currentColor; }
.badge.la-sev-high { background: var(--error-soft); color: var(--error); border-color: currentColor; }
.badge.la-sev-medium { background: var(--warn-soft); color: var(--warn); border-color: currentColor; }
.badge.la-sev-low, .badge.la-sev-info { color: var(--muted); }
.badge.la-open { color: var(--warn); border-color: currentColor; }
.badge.la-accepted, .badge.la-fixed { color: var(--good); border-color: currentColor; }
.badge.la-dismissed { color: var(--muted); }
.badge.la-gov { background: var(--accent-soft); color: var(--accent); border-color: currentColor; }

/* Responsibility parties: one hue family each, soft fill so text stays readable in both themes. */
.la-p { display: inline-block; min-width: 2.2em; padding: 2px 6px; border-radius: var(--r-sm); font-size: var(--fs-xs);
  text-align: center; border: 1px solid transparent; }
.la-p-landlord { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.la-p-tenant { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.la-p-shared { background: var(--n-100); color: var(--ink-2); border-color: var(--n-400); }
.la-p-landlord_recoverable { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.la-p-not_addressed { background: transparent; color: var(--muted); border: 1px dashed var(--n-400); }
/* Expense rules (spec 3): same chip as the responsibility parties */
.la-x-recoverable { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.la-x-not_recoverable { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.la-x-capped { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.la-x-amortized { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.la-x-tenant_direct { background: var(--n-100); color: var(--ink-2); border-color: var(--n-400); }
.la-x-fixed_charge { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.la-x-not_addressed { background: transparent; color: var(--muted); border: 1px dashed var(--n-400); }
.la-heat td.la-cell { text-align: center; }
.la-legend { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0; font-size: var(--fs-sm); }

.la-table { width: 100%; border-collapse: collapse; }
.la-table th, .la-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; text-align: left; }
.la-table th { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.la-table td.num, .la-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.la-compare th:first-child, .la-compare td:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 150px; }
.la-compare td { min-width: 180px; font-size: var(--fs-sm); white-space: pre-wrap; }
.la-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.la-pick { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin: var(--s-2) 0; }
.la-pick label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-size: var(--fs-sm); }
.la-issues li { margin: var(--s-1) 0; }
.la-stale { opacity: .6; }

@media (max-width: 700px) {
  .la-term { grid-template-columns: 1fr; gap: var(--s-1); }
  .la-actions { justify-content: flex-start; }
  .la-compare td { min-width: 150px; }
}

/* spec 2: section reference, quote check, hand-abstract results */
.la-sec { color: var(--muted); }
.la-qc { display: inline-block; min-width: 1.3em; text-align: center; border-radius: 999px; padding: 0 .35em; font-size: var(--fs-sm); line-height: 1.4; cursor: help; }
.la-qc-ok { color: var(--ok, #1a7f4b); background: color-mix(in srgb, var(--ok, #1a7f4b) 14%, transparent); }
.la-qc-warn { color: var(--warn, #9a6700); background: color-mix(in srgb, var(--warn, #9a6700) 16%, transparent); }
.la-qc-bad { color: var(--bad, #b42318); background: color-mix(in srgb, var(--bad, #b42318) 14%, transparent); }
.la-qc-none { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.la-hc-differs { background: color-mix(in srgb, var(--bad, #b42318) 16%, transparent); }
.la-hc-hand_only { background: color-mix(in srgb, var(--warn, #9a6700) 18%, transparent); }
.la-hc-analyzer_only { background: color-mix(in srgb, var(--muted) 14%, transparent); }

/* Sell-vs-hold page: missing information and open questions are amber, assumptions are dashed. */
.dsp-need { border: 1px solid var(--warn); border-left-width: 5px; background: var(--warn-soft); }
.dsp-need h3 { color: var(--warn); margin-top: 0; }
.dsp-need h4 { margin: 14px 0 4px; font-size: 0.9rem; }
.dsp-need ul { margin: 4px 0 0; padding-left: 18px; }
.dsp-need li { margin: 3px 0; }
.dsp-need .ask { font-weight: 600; }
.dsp-assume { border: 1px dashed var(--warn); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--panel, transparent); }
.dsp-assume .row { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-top: 6px; }
.dsp-assume label { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--muted); }
.dsp-assume input { width: 90px; border-color: var(--warn); }
.dsp-flag { box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-soft); }
.dsp-chip { display: inline-block; font-size: 0.72rem; padding: 1px 7px; border-radius: 10px; color: var(--warn); border: 1px solid var(--warn); background: var(--warn-soft); }
.dsp-missing { color: var(--warn); font-weight: 600; }

/* The answer first (mockup): a big Hold or Sell, the difference, and two bars. */
.dsp-verdict { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 24px 36px; align-items: center; background: var(--accent-soft); border-radius: 36px; padding: 30px 36px; margin: 0 0 16px; }
.dsp-verdict.sell { background: var(--warn-soft, #fff1bf); }
.dsp-vcap { font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.dsp-vword { font-family: var(--font-display, inherit); font-size: 76px; line-height: 1; font-weight: 600; color: var(--accent); margin: 4px 0 8px; }
.dsp-verdict p { margin: 0; font-weight: 600; font-size: 17px; color: var(--ink-2, var(--ink)); }
.dsp-vbars { display: flex; flex-direction: column; gap: 14px; }
.dsp-vbar { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; font-weight: 700; }
.dsp-vtrack { height: 22px; border-radius: 999px; background: rgba(255,255,255,.65); overflow: hidden; }
.dsp-vfill { display: block; height: 100%; border-radius: 999px; background: var(--sky, var(--accent)); }
.dsp-vfill.hold { background: var(--accent); }
.dsp-vplus { font-family: var(--font-display, inherit); font-size: 44px; font-weight: 600; color: var(--accent); white-space: nowrap; }
@media (max-width: 900px) { .dsp-verdict { grid-template-columns: 1fr; padding: 24px 22px; border-radius: 28px; } .dsp-vword { font-size: 60px; } .dsp-vplus { font-size: 36px; } }
/* the Assumptions buttons and the lease-structure note: spaced and wrapping, not run together on a phone */
.dsp-inputs .row-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; }

/* Agent desk (agentdesk.js). Uses the tokens in styles.css only, so dark mode follows them. */

.agd-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); border: 1px solid currentColor; background: transparent; white-space: nowrap; }
.agd-running { color: var(--accent); }
.agd-ok, .agd-f-resolved, .agd-f-approved, .agd-f-applied, .agd-f-staged, .agd-f-live { color: var(--good, #1f7a5a); }
.agd-failed, .agd-out_of_lane, .agd-f-rejected { color: var(--error, #a4262c); }
.agd-usage_limited, .agd-timeout { color: var(--warn, #8a5a00); }
.agd-deferred, .agd-f-proposed, .agd-f-verified { color: var(--muted); }
.agd-table tr.agd-bad td:first-child { box-shadow: inset 3px 0 0 var(--error, #a4262c); }
.agd-table tr.clickable { cursor: pointer; }
.agd-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.agd-two > .card { margin: 0; }
.agd-list { margin: var(--s-2) 0; padding-left: 18px; }
.agd-list li { margin: 4px 0; }
.agd-counts { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin: var(--s-2) 0; }
.agd-counts > strong { min-width: 90px; }
.agd-filters { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.agd-filter { display: inline-flex; gap: var(--s-2); align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.agd-bar { margin: 0 0 var(--s-3); }
.agd-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.agd-empty { text-align: center; padding: var(--s-5); }

.agd-fhead { display: flex; justify-content: space-between; gap: var(--s-3); align-items: flex-start; }
.agd-fhead h3 { margin: 0; overflow-wrap: anywhere; }
.agd-meta { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin: var(--s-2) 0; }
.agd-tag { border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: var(--fs-sm); background: var(--panel); }
.agd-conf-low { color: var(--warn, #8a5a00); }
.agd-conf-high { color: var(--good, #1f7a5a); }
.agd-actions { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.agd-confirm { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.agd-confirm:empty { display: none; }
.agd-confirm p { flex-basis: 100%; margin: var(--s-2) 0 0; }
.agd-confirm input { flex: 1 1 200px; min-width: 0; }

/* Run detail drawer */
#agd-drawer[hidden] { display: none; }
.agd-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 60; }
.agd-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); color: var(--ink); z-index: 61;
  overflow-y: auto; padding: var(--s-4); box-shadow: -8px 0 24px rgba(0, 0, 0, .2); box-sizing: border-box; }
.agd-drawer h3 { margin: 0 var(--s-5) var(--s-2) 0; }
.agd-drawer h4 { margin: var(--s-4) 0 var(--s-1); font-size: var(--fs-base); }
.agd-close { position: absolute; top: var(--s-3); right: var(--s-3); }
.agd-summary { white-space: pre-wrap; overflow-wrap: anywhere; }
.agd-log { max-height: 320px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: var(--s-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

@media (max-width: 700px) {
  .agd-two { grid-template-columns: 1fr; }
  .agd-table tbody tr.clickable { min-height: 44px; }
  .agd-table td, .agd-table th { padding-top: 10px; padding-bottom: 10px; }
  .agd-actions button, .agd-confirm button, .agd-close, .agd-filter select, .agd-confirm input { min-height: 44px; }
  .agd-actions button { flex: 1; }
  .agd-counts > strong { min-width: 100%; }
  .agd-drawer { width: 100vw; }
}

/* TV button in the top bar (admins): opens the live agent stream, agentstream.html */
.stream-btn { position: relative; display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; color: inherit; text-decoration: none; }
.stream-btn[hidden] { display: none !important; }
.stream-btn .stream-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #e0245e; box-shadow: 0 0 0 2px var(--bg, #fff); display: none; }
.stream-btn.onair .stream-dot { display: block; }
@media (min-width: 701px) {
  .stream-btn { width: 46px; height: 46px; background: var(--panel); color: var(--ink); }
  .stream-btn:hover { background: var(--panel-sunk); }
}

/* Acquisition leads (acqleads.js). Uses the tokens in styles.css only, so dark mode follows them. */

.aql-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.aql-theme-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink); font-size: var(--fs-sm); cursor: pointer; }
.aql-theme-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.aql-theme-chip.pending, .aql-theme-chip:disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
.aql-count { font-size: var(--fs-xs); opacity: .85; }
.aql-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); border: 1px solid currentColor; white-space: nowrap; }
.aql-proxy { color: var(--warn, #8a5a00); }
.aql-s-new, .aql-s-reviewing { color: var(--accent); }
.aql-s-pursuing, .aql-s-promoted { color: var(--good, #1f7a5a); }
.aql-s-passed, .aql-s-closed { color: var(--muted); }
.aql-score { font-variant-numeric: tabular-nums; white-space: nowrap; }
.aql-filters input[type="number"] { max-width: 110px; }
.aql-pager { display: flex; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-3); }

#aql-drawer[hidden] { display: none; }
.aql-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 60; }
.aql-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--panel); color: var(--ink); z-index: 61;
  overflow-y: auto; padding: var(--s-4); box-shadow: -8px 0 24px rgba(0, 0, 0, .2); box-sizing: border-box; }
.aql-drawer h3 { margin: 0 var(--s-6, 56px) var(--s-2) 0; overflow-wrap: anywhere; }
.aql-drawer h4 { margin: var(--s-4) 0 var(--s-1); font-size: var(--fs-base); }
.aql-close { position: absolute; top: var(--s-3); right: var(--s-3); min-height: 44px; }
.aql-theme { border: 1px solid var(--line); border-radius: 8px; padding: var(--s-2) var(--s-3); margin: var(--s-2) 0; }
.aql-theme-head { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.aql-theme-score { margin-left: auto; font-size: var(--fs-lg, 18px); font-weight: 600; }
.aql-evidence { margin: var(--s-2) 0; padding-left: 18px; }
.aql-evidence li { margin: 3px 0; overflow-wrap: anywhere; }
.aql-ev-label { font-weight: 600; }
.aql-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--s-3); margin: 0; }
.aql-facts dt { color: var(--muted); }
.aql-facts dd { margin: 0; overflow-wrap: anywhere; }
.aql-actions { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-2) 0 var(--s-4); }
.aql-actions input[type="text"] { width: 100%; box-sizing: border-box; font-size: 16px; }
.aql-buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.aql-buttons select { font-size: 16px; min-height: 44px; }
.aql-buttons button { min-height: 44px; }

@media (max-width: 700px) {
  .aql-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--s-2); -webkit-overflow-scrolling: touch; }
  .aql-theme-chip { flex: 0 0 auto; min-height: 44px; }
  .aql-filters input, .aql-filters select { font-size: 16px; }
  .aql-drawer { width: 100vw; padding: var(--s-3); }
  .aql-facts { grid-template-columns: 1fr; }
  .aql-facts dd { margin-bottom: var(--s-1); }
}

/* Market Intelligence (marketintel.js). Colours come from the redesign tokens (redesign.css); the --mi-* tokens below are the few this page adds.
   Each is defined for light, explicit dark, dark that follows the OS, and the graphite accent (light and dark), the way redesign.css does it. */

/* ── tokens ──────────────────────────────────────────────────────────────── */
:root, html[data-theme="light"] {
  --mi-band: var(--accent);                                     /* the masthead band: navy in light, graphite in graphite */
  --mi-band-ink: #fff;  --mi-band-muted: hsl(217 75% 82%);
  --mi-band-tile: color-mix(in srgb, #fff 9%, var(--mi-band));  --mi-band-line: color-mix(in srgb, #fff 17%, var(--mi-band));
  --mi-band-ok: #5fd08a;  --mi-band-bad: #ff9a94;
  --mi-st-proposed: hsl(215 14% 58%);  --mi-st-filed: hsl(214 66% 52%);  --mi-st-hearing_scheduled: hsl(30 76% 48%);  --mi-st-approved: hsl(147 52% 36%);
  --mi-st-under_construction: hsl(219 80% 22%);  --mi-st-denied: hsl(4 62% 46%);  --mi-st-announced: hsl(190 58% 40%);  --mi-st-complete: hsl(215 10% 40%);  --mi-st-none: hsl(215 10% 70%);
  --mi-flag: hsl(32 82% 56%);
  --mi-spark: var(--x-c1);
}
html[data-theme="dark"] {
  --mi-band: hsl(219 55% 22%);                                  /* not --accent: in dark mode the accent is a light blue */
  --mi-band-ink: hsl(219 40% 96%);  --mi-band-muted: hsl(217 55% 78%);
  --mi-band-tile: color-mix(in srgb, #fff 7%, var(--mi-band));  --mi-band-line: color-mix(in srgb, #fff 14%, var(--mi-band));
  --mi-band-ok: #5fd99b;  --mi-band-bad: #ff8a84;
  --mi-st-proposed: hsl(215 14% 66%);  --mi-st-filed: hsl(214 80% 68%);  --mi-st-hearing_scheduled: hsl(30 85% 62%);  --mi-st-approved: hsl(147 50% 55%);
  --mi-st-under_construction: hsl(217 90% 78%);  --mi-st-denied: hsl(4 85% 70%);  --mi-st-announced: hsl(190 60% 58%);  --mi-st-complete: hsl(215 10% 70%);  --mi-st-none: hsl(215 10% 42%);
  --mi-flag: hsl(32 85% 60%);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --mi-band: hsl(219 55% 22%);
    --mi-band-ink: hsl(219 40% 96%);  --mi-band-muted: hsl(217 55% 78%);
    --mi-band-tile: color-mix(in srgb, #fff 7%, var(--mi-band));  --mi-band-line: color-mix(in srgb, #fff 14%, var(--mi-band));
    --mi-band-ok: #5fd99b;  --mi-band-bad: #ff8a84;
    --mi-st-proposed: hsl(215 14% 66%);  --mi-st-filed: hsl(214 80% 68%);  --mi-st-hearing_scheduled: hsl(30 85% 62%);  --mi-st-approved: hsl(147 50% 55%);
    --mi-st-under_construction: hsl(217 90% 78%);  --mi-st-denied: hsl(4 85% 70%);  --mi-st-announced: hsl(190 60% 58%);  --mi-st-complete: hsl(215 10% 70%);  --mi-st-none: hsl(215 10% 42%);
    --mi-flag: hsl(32 85% 60%);
  }
}
html[data-accent="graphite"]:not([data-theme="dark"]) { --mi-band: hsl(215 18% 14%);  --mi-band-muted: hsl(215 8% 78%); --mi-st-under_construction: hsl(215 18% 14%); --mi-st-filed: hsl(214 30% 48%); }
html[data-accent="graphite"][data-theme="dark"] { --mi-band: hsl(215 8% 20%);  --mi-band-muted: hsl(215 8% 76%); --mi-st-filed: hsl(214 35% 66%); }
@media (prefers-color-scheme: dark) {
  html[data-accent="graphite"]:not([data-theme]) { --mi-band: hsl(215 8% 20%);  --mi-band-muted: hsl(215 8% 76%); --mi-st-filed: hsl(214 35% 66%); }
}
/* topic colour bars, stage dots and pins read their colour from one custom property set by the class */
.mi-st-proposed, .mi-st-rumored { --mi-c: var(--mi-st-proposed); }  .mi-st-filed { --mi-c: var(--mi-st-filed); }  .mi-st-hearing_scheduled { --mi-c: var(--mi-st-hearing_scheduled); }
.mi-st-approved, .mi-st-permitted { --mi-c: var(--mi-st-approved); }  .mi-st-under_construction { --mi-c: var(--mi-st-under_construction); }
.mi-st-denied { --mi-c: var(--mi-st-denied); }  .mi-st-announced { --mi-c: var(--mi-st-announced); }  .mi-st-complete { --mi-c: var(--mi-st-complete); }  .mi-st-none { --mi-c: var(--mi-st-none); }
.mi-tp-dev { --mi-tpc: var(--accent); }  .mi-tp-road { --mi-tpc: var(--mi-st-filed); }  .mi-tp-jobs { --mi-tpc: var(--mi-st-hearing_scheduled); }
.mi-tp-util { --mi-tpc: var(--mi-st-proposed); }  .mi-tp-wx { --mi-tpc: var(--mi-st-announced); }  .mi-tp-other { --mi-tpc: var(--line); }

/* what shows on which size: .mi-d desktop only, .mi-p phone only (body.pn) */
.mi-p, .mi-p-only { display: none !important; }
body.pn .mi-d, body.pn .mi-d-only { display: none !important; }
body.pn .mi-p { display: inline !important; }  body.pn button.mi-p { display: inline-flex !important; }
body.pn .mi-p-only { display: block !important; }

/* ── masthead band ───────────────────────────────────────────────────────── */
.mi-band { background: var(--mi-band); color: var(--mi-band-ink); border-radius: var(--r-lg); padding: 28px 28px 0; margin: 0 0 var(--s-4); overflow: hidden; --mi-spark: var(--mi-band-muted); }
.mi-band-sm { padding-bottom: 22px; }
.mi-band-in { display: flex; flex-direction: column; gap: 20px; }
.mi-band-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.mi-eyebrow { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .12em; color: var(--mi-band-muted); }
.mi-band-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mi-band h1.mi-band-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xl); line-height: 1.12; max-width: 820px; color: var(--mi-band-ink); letter-spacing: -.01em; }
.mi-band-sm h1.mi-band-title { font-size: var(--fs-lg); }
.mi-band-note { color: var(--mi-band-muted); font-size: var(--fs-sm); margin-top: -8px; }
.mi-band-note strong { color: var(--mi-band-ink); }
.mi-band select.mi-datepick, .mi-band-btn { font-family: inherit; font-size: 16px; font-weight: 700; min-height: 44px; padding: 0 16px; border: 1px solid var(--mi-band-line); border-radius: 12px;
  background: var(--mi-band-tile); color: var(--mi-band-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.mi-band button.mi-band-btn { background: transparent; }
.mi-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--mi-band-line); border-radius: 14px 14px 0 0; overflow: hidden; }
.mi-tile { background: var(--mi-band-tile); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; color: var(--mi-band-ink); text-decoration: none; min-width: 0; }
a.mi-tile:hover { background: var(--mi-band-line); }
.mi-tile-l { font-size: var(--fs-xs); font-weight: 700; color: var(--mi-band-muted); }
.mi-tile-v { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.05; display: flex; align-items: flex-end; gap: 10px; }
.mi-tile-unit { font-size: 16px; color: var(--mi-band-muted); font-family: var(--font-body); font-weight: 700; }
.mi-tile-s { font-size: var(--fs-xs); color: var(--mi-band-muted); }
.mi-band .x-spark circle { stroke: var(--mi-band-tile); }
.mi-sdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--good); flex: none; align-self: center; margin-right: 8px; }
.mi-sdot.bad { background: var(--error); } .mi-sdot.warn { background: var(--warn); } .mi-sdot.none { background: var(--mi-st-none); } .mi-sdot.good { background: var(--good); }
.mi-band .mi-sdot { background: var(--mi-band-ok); } .mi-band .mi-sdot.bad { background: var(--mi-band-bad); }
.mi-seg { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--bg); }
.mi-seg button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 800; font-size: var(--fs-sm); cursor: pointer; }
.mi-seg button.on { background: var(--accent); color: var(--accent-ink); }
.mi-seg-band { border-color: var(--mi-band-line); background: var(--mi-band-tile); }
.mi-seg-band button { color: var(--mi-band-ink); }
.mi-seg-band button.on { background: var(--mi-band-ink); color: var(--mi-band); }

/* ── briefing page ───────────────────────────────────────────────────────── */
.mi-main { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; margin-bottom: var(--s-5); }
.mi-cards { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.mi-rail { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.mi-section { margin: 0 0 var(--s-5); }
.mi-section > h2, .mi-sec-head h2, .mi-rail-card h2, .mi-sgroup h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.mi-sec-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.mi-eyebrow-h { font-size: var(--fs-xs) !important; font-weight: 800 !important; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px !important; font-family: var(--font-body) !important; }

.card.mi-bitem { padding: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: var(--r-lg); }
.mi-bhead { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: var(--fs-xs); font-weight: 700; padding: 20px 24px 0; }
.mi-rank { display: inline-flex; width: auto; height: auto; background: none; color: var(--accent); font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1; }
.mi-bsrc { color: var(--muted); }
.mi-more-props { color: var(--muted); }
.mi-pillchip, .mi-bhead .mi-chip { background: var(--accent-soft); color: var(--strong); border: 0; padding: 3px 10px; font-weight: 800; font-size: var(--fs-xs); }
.mi-btitle { margin: 10px 0 0; padding: 0 24px; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.2; }
.mi-fact { margin: 10px 0 0; padding: 0 24px 16px; font-size: var(--fs-base); line-height: 1.55; overflow-wrap: anywhere; }
.mi-forecast { margin: -6px 0 0; padding: 0 24px 16px; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.mi-stand { padding: 14px 24px; background: var(--panel-sunk); border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.mi-stand-note { font-size: var(--fs-sm); color: var(--ink-2); }
.mi-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mi-step { display: flex; flex-direction: column; gap: 6px; }
.mi-step-bar { height: 6px; border-radius: 3px; background: var(--line); }
.mi-step.done .mi-step-bar { background: var(--accent); } .mi-step.now .mi-step-bar { background: var(--sky); }
.mi-step-label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); } .mi-step.done .mi-step-label { color: var(--ink); } .mi-step.now .mi-step-label { color: var(--ink); font-weight: 900; }
.mi-two { padding: 16px 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; border-top: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.mi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; margin-bottom: 4px; color: var(--muted); }
.mi-label-fact { color: var(--ink-2); }
.mi-ai3 { padding: 0 24px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: var(--fs-sm); }
.mi-ai3 > div { border-top: 3px solid var(--mi-st-proposed); padding-top: 8px; } .mi-ai3 p { margin: 2px 0 0; }
.mi-ai3-up { border-top-color: var(--mi-st-filed) !important; } .mi-ai3-down { border-top-color: var(--mi-st-hearing_scheduled) !important; }
.mi-ai3[hidden], .mi-sources[hidden] { display: none; }
.card.mi-bitem .mi-sources { margin: 0; padding: 0 24px 14px 44px; }
.mi-actions { padding: 0 24px 18px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.mi-actions button { min-height: 44px; padding: 0 16px; font-size: var(--fs-sm); color: var(--strong); border: 1px solid var(--line); }
.mi-report { margin: var(--s-3) 0; font-size: var(--fs-sm); }
.mi-report summary { cursor: pointer; color: var(--muted); min-height: 32px; }
.mi-report p { margin: 6px 0; }

.mi-rail-card { background: var(--panel); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.mi-rail-card h2 { font-size: 20px; }
.mi-rail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mi-cal-list { display: flex; flex-direction: column; gap: 12px; }
.mi-cal { display: flex; gap: 14px; align-items: flex-start; }
.mi-datebox { flex: 0 0 52px; border-radius: 10px; background: var(--mi-band); color: var(--mi-band-ink); text-align: center; padding: 6px 0; display: flex; flex-direction: column; }
.mi-datebox.wait { background: var(--accent-soft); color: var(--strong); }
.mi-mon { font-size: 11px; font-weight: 800; letter-spacing: .08em; opacity: .8; } .mi-day { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1; }
.mi-cal-text { font-size: var(--fs-sm); min-width: 0; overflow-wrap: anywhere; }
.mi-calgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.mi-calgrid .mi-cal { background: var(--panel); border-radius: var(--r-md); padding: 14px 16px; }
.mi-ring-wrap { display: flex; justify-content: center; }
.mi-ring { width: 300px; height: 300px; max-width: 100%; }
.mi-ring-outer { fill: var(--panel-sunk); stroke: var(--line); stroke-dasharray: 4 3; }
.mi-ring-inner { fill: var(--bg); stroke: var(--n-400, var(--muted)); stroke-dasharray: 4 3; }
.mi-ring-lbl { font-size: 10px; fill: var(--muted); }
.mi-ring-prop { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.mi-ring-dot { cursor: pointer; outline: none; }
.mi-ring-pt { fill: var(--mi-c, var(--mi-st-none)); stroke: var(--bg); stroke-width: 2; }
.mi-ring-hit { fill: transparent; }
.mi-ring-dot.on .mi-ring-pt, .mi-ring-dot:focus-visible .mi-ring-pt { stroke: var(--ink); stroke-width: 3; }
.mi-ring-detail { min-height: 44px; font-size: var(--fs-sm); background: var(--panel-sunk); border-radius: 10px; padding: 8px 12px; }
.mi-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.mi-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.mi-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mi-c, var(--mi-st-none)); margin-right: 6px; flex: none; }
.mi-legend .mi-dot { margin-right: 0; }

.mi-pulse { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mi-pcard { background: var(--panel); border: 2px solid var(--panel); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; }
.mi-pcard:hover { border-color: var(--line); } .mi-pcard.flag { border-color: var(--mi-flag); }
.mi-pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .mi-pc-head strong { font-weight: 900; }
.mi-pc-ur { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.mi-pc-big { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1; }
.mi-pc-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.mi-pc-n { font-weight: 900; font-size: 15px; } .mi-pc-n.warn { color: var(--warn); } .mi-pc-n.up { color: var(--accent); } .mi-pc-n.nl { color: var(--muted); font-weight: 600; }

.mi-matrix-wrap { background: var(--panel); border-radius: var(--r-lg); overflow-x: auto; }
.mi-matrix { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 760px; }
.mi-matrix th, .mi-matrix thead th, .mi-matrix tbody th { background: transparent; }
.mi-matrix th { text-align: left; color: var(--muted); font-size: var(--fs-xs); font-weight: 800; padding: 12px 8px; } .mi-matrix th.c, .mi-matrix td.c { text-align: center; }
.mi-matrix th:first-child { padding-left: 18px; } .mi-matrix tbody th { color: var(--ink); font-size: var(--fs-sm); padding: 8px 8px 8px 18px; }
.mi-matrix tbody tr { border-top: 1px solid var(--line-soft); cursor: pointer; } .mi-matrix tbody tr:hover { background: var(--panel-sunk); }
.mi-matrix td { padding: 6px 8px; } .mi-latest { color: var(--ink-2); font-size: var(--fs-xs); padding-right: 18px !important; }
.mi-alink { background: none; border: 0; padding: 0; min-height: 32px; color: var(--ink); font-weight: 800; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.mi-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--accent-soft); color: var(--strong); font-weight: 900; }
.mi-cell.strong { background: var(--accent); color: var(--accent-ink); } .mi-cell.warn { background: var(--warn-soft); color: var(--warn); } .mi-cell.nil { background: transparent; color: var(--n-300, var(--line)); }
.mi-alist { list-style: none; margin: 0; padding: 0; background: var(--panel); border-radius: var(--r-lg); }
.mi-alist li + li { border-top: 1px solid var(--line-soft); }
.mi-arow { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: transparent; border: 0; border-radius: 0; text-align: left; color: var(--ink); cursor: pointer; font-weight: 400; }
.mi-abadge { flex: none; min-width: 30px; height: 30px; padding: 0 6px; box-sizing: border-box; border-radius: 8px; background: var(--accent-soft); color: var(--strong); font-weight: 900; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.mi-abadge.warn { background: var(--warn-soft); color: var(--warn); }
.mi-atext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; } .mi-atext b { font-weight: 800; font-size: 14px; }
.mi-chev { color: var(--muted); font-size: 18px; }

/* alert drawer */
.mi-bulk { display: flex; gap: 8px; flex-wrap: wrap; margin: var(--s-3) 0; }
.mi-rulegroup { margin-top: var(--s-4); } .mi-rulegroup h4 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 4px !important; }
.mi-rulegroup > p { margin: 2px 0 6px; }

/* ── the legacy blocks the drawers still use ─────────────────────────────── */
.mi-rel { display: inline-block; min-width: 1.5em; text-align: center; padding: 0 5px; border-radius: 4px; font-size: var(--fs-xs); font-weight: 700; border: 1px solid currentColor; cursor: help; }
.mi-rel-A { color: var(--good); } .mi-rel-B { color: var(--accent); } .mi-rel-C { color: var(--warn); } .mi-rel-D { color: var(--error); }
.mi-banner { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--r-md, 8px); padding: var(--s-2) var(--s-3); margin: 0 0 var(--s-3); }
.mi-banner summary { cursor: pointer; font-weight: 600; }
.mi-banner ul { margin: var(--s-2) 0; padding-left: 18px; }
.mi-props { margin: var(--s-2) 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mi-chip { display: inline-block; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: var(--fs-sm); text-decoration: none; }
.mi-label-ai { color: var(--accent); }
.mi-cite { font-size: .8em; vertical-align: super; line-height: 0; text-decoration: none; font-weight: 700; padding: 0 1px; }
.mi-sources { margin: var(--s-2) 0 var(--s-3); padding-left: 22px; font-size: var(--fs-sm); }
.mi-sources li { margin: 3px 0; overflow-wrap: anywhere; }
.mi-empty-line { font-size: var(--fs-lg); margin: 4px 0; }
.mi-failed, .mi-error { border-color: var(--error); }
.mi-print-title { display: none; }
.mi-coverage { margin: 0 0 var(--s-3); }

/* ── feed ────────────────────────────────────────────────────────────────── */
.mi-feedgrid { display: flex; gap: 28px; align-items: flex-start; }
.mi-filtercol { flex: 0 0 280px; position: sticky; top: var(--s-3); display: flex; flex-direction: column; gap: 18px; }
.mi-feedgrid #mi-region { flex: 1 1 auto; min-width: 0; }
.mi-fgroup { display: flex; flex-direction: column; gap: 8px; }
.mi-flabel { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; }
.mi-fgroup input[type="search"], .mi-sheet-body input[type="search"] { width: 100%; max-width: none; min-height: 44px; font-size: 16px; }
.mi-markets { display: flex; flex-wrap: wrap; gap: 6px; }
.mi-mkt { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; }
.mi-mkt span { color: var(--muted); font-weight: 800; margin-left: 2px; } .mi-mkt.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .mi-mkt.on span { color: inherit; }
.mi-checks { display: flex; flex-direction: column; gap: 4px; }
.mi-check { display: flex; flex-direction: row; gap: 8px; align-items: center; font-size: var(--fs-sm); min-height: 36px; width: auto; margin: 0; }
.mi-check input { width: 18px; min-height: 0; margin: 0; flex: none; accent-color: var(--accent); }
.mi-more-filters { border-top: 1px solid var(--line-soft); padding-top: 10px; } .mi-more-filters summary { cursor: pointer; font-weight: 700; min-height: 36px; }
.mi-more-filters select, .mi-more-filters input { width: 100%; max-width: none; margin-top: 8px; font-size: 16px; min-height: 44px; }
.mi-clear { min-height: 36px; text-align: left; }
.mi-fday { margin-bottom: 20px; } .mi-fday > h2 { margin: 0 0 10px; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.mi-fcard { display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: 14px; padding: 14px 16px 14px 12px; background: var(--panel); border-radius: var(--r-md); margin-bottom: 10px; }
.mi-fbar { border-radius: 3px; background: var(--mi-tpc, var(--line)); }
.mi-fmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; } .mi-ftopic { color: var(--mi-tpc, var(--muted)); font-weight: 900; }
.mi-fcard h3 { margin: 4px 0 6px; font-family: var(--font-body); font-size: var(--fs-base); font-weight: 800; line-height: 1.3; }
.mi-fpills { display: flex; flex-wrap: wrap; gap: 6px; }
.mi-fpill { background: var(--accent-soft); color: var(--strong); padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 800; } .mi-fpill.weak { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.mi-related { min-height: 32px; padding: 0; font-size: var(--fs-xs); }
.mi-fside { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mi-spill { padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 800; background: var(--accent-soft); color: var(--strong); white-space: nowrap; }
.mi-spill.approved { background: var(--good-soft); color: var(--good); } .mi-spill.denied { background: var(--error-soft); color: var(--error); } .mi-spill.hearing { background: var(--warn-soft); color: var(--warn); }
.mi-save { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mi-save.on { color: var(--accent); } .mi-save.on svg { fill: currentColor; }
.mi-more-row { text-align: center; } .mi-filteredout { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--panel-sunk); border-radius: var(--r-md); padding: 12px 16px; font-size: var(--fs-sm); }
.mi-feedtop { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; flex: 1 1 100%; min-width: 0; max-width: 100%; } .mi-feedtop .mi-markets { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
.mi-feedtop .mi-mkt { flex: none; } .mi-filterbtn { min-height: 44px; margin-left: auto; }
.mi-sheet-dim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .4); }
.mi-sheet { position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; max-height: 82dvh; background: var(--bg); color: var(--ink); border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -8px 30px rgba(0, 0, 0, .25); animation: pnSheet .3s cubic-bezier(.2, .8, .2, 1); }
.mi-sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; } .mi-sheet-head h2 { margin: 0; font-size: 20px; }
.mi-sheet-head .link { min-height: 44px; font-size: 17px; font-weight: 700; }
.mi-sheet-body { display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 24px; overflow-y: auto; }

/* ── radar ───────────────────────────────────────────────────────────────── */
.mi-pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start; }
.mi-pcol { background: var(--panel); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mi-pcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: var(--fs-sm); } .mi-pcol-n { color: var(--muted); font-family: var(--font-display); font-size: 18px; }
.mi-kcard { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.mi-kcard:hover { box-shadow: 0 0 0 2px var(--line); } .mi-kname { font-weight: 800; font-size: var(--fs-sm); overflow-wrap: anywhere; } .mi-kwhere { font-size: var(--fs-xs); color: var(--muted); } .mi-knear { font-size: var(--fs-xs); font-weight: 800; color: var(--strong); }
.mi-kmore { font-size: var(--fs-sm); font-weight: 800; padding: 8px 4px; min-height: 36px; display: inline-flex; align-items: center; }
.mi-ptabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.mi-ptabs button { flex: none; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 800; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.mi-ptabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mi-radarpage .mi-kcard { margin-bottom: 8px; }

/* ── sources ─────────────────────────────────────────────────────────────── */
.mi-srchead h1 { margin: 4px 0 6px; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xl); }
.mi-stiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: var(--s-4) 0; }
.mi-stile { background: var(--panel); border-radius: var(--r-lg); padding: 16px 20px; } .mi-stile .mi-tile-l { color: var(--muted); }
.mi-stile-v { font-family: var(--font-display); font-size: 34px; font-weight: 600; display: flex; align-items: center; }
.mi-sgroup { margin-bottom: var(--s-4); } .mi-sgroup h2 { font-size: 22px; }
.mi-stable-wrap { overflow-x: auto; } .mi-stable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.mi-stable tr { border-top: 1px solid var(--line-soft); } .mi-stable tr:first-child { border-top: 0; } .mi-stable td, .mi-stable th { padding: 10px 8px; text-align: left; vertical-align: top; }
.mi-stable th { font-weight: 800; background: transparent; text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); color: var(--ink); }
.mi-stable th a { text-decoration: none; color: var(--ink); } .mi-stable th a:hover { text-decoration: underline; } .mi-sdot-cell { width: 28px; } .mi-sdot-cell .mi-sdot { margin: 4px 0 0; } .mi-sstat { white-space: nowrap; color: var(--muted); }
.mi-hcounts { display: flex; gap: 20px; flex-wrap: wrap; padding: 4px 0; } .mi-hcount { display: flex; align-items: center; gap: 6px; } .mi-hcount .mi-sdot { margin-right: 0; } .mi-hcount b { font-size: 22px; font-family: var(--font-display); }

/* ── the feed row, the drawers and the list view (unchanged shapes) ──────── */
.mi-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.mi-filters select, .mi-filters input { min-height: 36px; max-width: 220px; }
.mi-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--line-soft); }
.mi-row:first-of-type { border-top: 0; }
.mi-row h4 { margin: 0 0 3px; font-size: var(--fs-base); }
.mi-title { color: var(--ink); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.mi-title:hover { text-decoration: underline; }
.mi-meta { font-size: var(--fs-sm); color: var(--muted); }
.mi-snippet { margin: 4px 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.mi-links { font-size: var(--fs-sm); margin-top: 4px; }
.mi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mi-score { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mi-states { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.mi-states button.on { background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent); }
.mi-s-dismissed { opacity: .6; }
.mi-badge-saved { color: var(--accent); } .mi-badge-reviewed { color: var(--good); }
.mi-none { padding: var(--s-4) 0; }
.mi-status-good { color: var(--good); } .mi-status-warn { color: var(--warn); } .mi-status-bad { color: var(--error); }
.mi-county > summary { cursor: pointer; font-weight: 600; padding: var(--s-2) 0; }
.mi-linktype { font-size: var(--fs-xs); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; color: var(--muted); }
.mi-linklist { margin: 0; padding-left: 18px; }
.mi-linklist li { margin: 4px 0; overflow-wrap: anywhere; }
.mi-linklist.pad, .mi-list .pad { padding-left: 18px; }
.mi-srcerr { color: var(--error); margin-top: 2px; overflow-wrap: anywhere; }
.mi-status-none { color: var(--muted); }

#mi-drawer[hidden] { display: none; }
.mi-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 60; }
.mi-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: var(--panel); color: var(--ink); z-index: 61; overflow-y: auto;
  padding: var(--s-4); box-shadow: -8px 0 24px rgba(0, 0, 0, .2); box-sizing: border-box; }
.mi-drawer h3 { margin: 0 84px var(--s-2) 0; overflow-wrap: anywhere; }
.mi-drawer h4 { margin: var(--s-4) 0 var(--s-1); font-size: var(--fs-base); }
.mi-close { position: absolute; top: var(--s-3); right: var(--s-3); min-height: 44px; }
.mi-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--s-3); margin: 0; font-size: var(--fs-sm); }
.mi-facts dt { color: var(--muted); } .mi-facts dd { margin: 0; overflow-wrap: anywhere; }
.mi-note { display: flex; gap: var(--s-2); margin: var(--s-2) 0; }
.mi-note input { flex: 1; min-width: 0; font-size: 16px; }
.mi-orig { font-weight: 600; }

/* alerts */
.mi-alert { border-top: 1px solid var(--line-soft); padding: var(--s-3) 0; }
.mi-alert:first-of-type { border-top: 0; }
.mi-alert h4 { margin: 4px 0; font-size: var(--fs-base); overflow-wrap: anywhere; }
.mi-alert-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mi-rule { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--muted); }
.mi-why, .mi-next { margin: 4px 0; overflow-wrap: anywhere; }
.mi-alert-foot { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: space-between; overflow-wrap: anywhere; }
.mi-alert-dismissed, .mi-alert-acknowledged { opacity: .75; }
.mi-ev { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; border: 1px solid currentColor; cursor: help; }
.mi-ev-public_record { color: var(--good); } .mi-ev-reported { color: var(--accent); } .mi-ev-model_indicator { color: var(--warn); }
.mi-states button.on, .mi-stagechips button.on, .mi-viewtoggle button.on { background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent); }

/* development radar: the filtered list */
.mi-stagechips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-2); }
.mi-stagechip { min-height: 32px; }
.mi-check-line { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-size: var(--fs-sm); min-height: 36px; }
.mi-radar-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; margin-top: var(--s-3); }
.mi-map { height: 520px; width: 100%; border-radius: var(--r-md, 8px); }
.mi-mapcard { position: sticky; top: var(--s-3); }
.mi-radarpage .mi-mapcard { position: static; margin-top: var(--s-4); } .mi-mapcard[hidden] { display: none; }
.mi-proj .mi-links { margin: 4px 0; }
.mi-figs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mi-stage { border: 1px solid currentColor; background: transparent; }
.mi-stage-proposed, .mi-stage-rumored, .mi-stage-none { color: var(--muted); } .mi-stage-filed, .mi-stage-announced { color: var(--accent); }
.mi-stage-hearing_scheduled { color: var(--warn); } .mi-stage-approved, .mi-stage-permitted { color: var(--good); }
.mi-stage-denied { color: var(--error); } .mi-stage-under_construction, .mi-stage-complete { color: var(--ink-2, var(--ink)); }
.mi-pin-wrap { background: none; border: 0; }
.mi-pin { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.mi-pin-mine { border-radius: 2px; background: var(--accent); }
.mi-warn { border-left: 3px solid var(--warn); padding-left: var(--s-2); }
.mi-phone-only { display: none; }
.mi-pin-proposed, .mi-pin-rumored, .mi-pin-none { background: var(--mi-st-proposed); } .mi-pin-filed { background: var(--mi-st-filed); } .mi-pin-announced { background: var(--mi-st-announced); }
.mi-pin-hearing_scheduled { background: var(--mi-st-hearing_scheduled); } .mi-pin-approved, .mi-pin-permitted { background: var(--mi-st-approved); } .mi-pin-denied { background: var(--mi-st-denied); }
.mi-pin-under_construction { background: var(--mi-st-under_construction); } .mi-pin-complete { background: var(--mi-st-complete); }

/* ── phone (body.pn) ─────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .mi-filters select, .mi-filters input { max-width: none; flex: 1 1 calc(50% - 8px); font-size: 16px; min-height: 44px; }
  .mi-filters input[type="search"] { flex-basis: 100%; }
  .mi-row { grid-template-columns: 1fr; }
  .mi-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .mi-states button, .mi-side button { min-height: 40px; }
  .mi-drawer { width: 100vw; padding: var(--s-3); }
  .mi-facts { grid-template-columns: 1fr; }
  .mi-facts dd { margin-bottom: var(--s-1); }
  .mi-radar-grid { grid-template-columns: 1fr; }
  .mi-radar-grid.mi-view-list #mi-radar-map, .mi-radar-grid.mi-view-map #mi-radar-list { display: none; }
  .mi-phone-only { display: flex; gap: 6px; margin-top: var(--s-2); }
  .mi-phone-only button { flex: 1; min-height: 40px; }
  .mi-map { height: 60vh; }
  .mi-mapcard { position: static; }
  .mi-stagechip { min-height: 40px; }
  .mi-states button { min-height: 40px; }
  .mi-check-line { min-height: 44px; }
}
body.pn .mi-band { padding: 12px 16px 0; border-radius: var(--r-md); }
body.pn .mi-band-sm { padding-bottom: 16px; }
body.pn .mi-band-in { gap: 12px; }
body.pn .mi-band h1.mi-band-title { font-size: 26px; }
body.pn .mi-band-sm h1.mi-band-title { font-size: 24px; }
body.pn .mi-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 12px; margin: 0 0 16px; }
body.pn .mi-tile { padding: 10px 12px; } body.pn .mi-tile-v { font-size: 22px; } body.pn .mi-tile-s, body.pn .mi-tile .x-spark { display: none; }
body.pn .mi-main { gap: 14px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
body.pn .mi-cards, body.pn .mi-rail { flex: none; width: 100%; gap: 14px; }
body.pn .mi-bhead { padding: 16px 16px 0; } body.pn .mi-btitle { padding: 0 16px; font-size: 20px; } body.pn .mi-fact, body.pn .mi-forecast { padding: 0 16px 12px; font-size: 15px; }
body.pn .mi-stand { padding: 12px 16px; gap: 6px; } body.pn .mi-step-label { display: none; } body.pn .mi-step-bar { height: 6px; }
body.pn .mi-two { grid-template-columns: 1fr; gap: 8px; padding: 12px 16px; } body.pn .mi-ai3 { grid-template-columns: 1fr; padding: 0 16px 12px; }
body.pn .card.mi-bitem .mi-sources { padding: 0 16px 12px 36px; }
body.pn .mi-actions { padding: 0 16px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } body.pn .mi-actions button { min-height: 44px; font-size: 14px; padding: 0 8px; }
body.pn .mi-section > h2, body.pn .mi-sec-head h2 { font-size: 22px; }
body.pn .mi-rail-card { padding: 16px; } body.pn .mi-datebox { flex-basis: 48px; }
body.pn .mi-pulse { display: flex; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; } body.pn .mi-pcard { flex: 0 0 220px; }
body.pn .mi-feedgrid { flex-direction: column; gap: 0; } body.pn .mi-feedgrid #mi-region { width: 100%; }
body.pn .mi-fcard { grid-template-columns: 4px minmax(0, 1fr) auto; padding: 12px; gap: 10px; } body.pn .mi-fcard h3 { font-size: 15px; }
body.pn .mi-pipe { display: none; }
/* the five stage chips wrap onto a second line instead of running off the right edge */
body.pn .mi-ptabs { flex-wrap: wrap; overflow: visible; }
body.pn .mi-stiles { grid-template-columns: 1fr; }
body.pn .mi-drawer { width: 100vw; padding: var(--s-3); }
body.pn .mi-drawer.mi-drawer-alerts { top: auto; bottom: 0; height: 88dvh; border-radius: 18px 18px 0 0; animation: pnSheet .3s cubic-bezier(.2, .8, .2, 1); }
body.pn .mi-matrix-wrap { display: none; }
body.pn .mi-calgrid { grid-template-columns: 1fr; }
body.pn .mi-filtercol { display: none; }

/* print / save as PDF: only the briefing, in black on white */
@media print {
  .mi-noprint, #rail, #sidenav, #subnav, .topbar, .x-head .actions, #toptabs, .mi-banner, #mi-drawer, .tabbar, #tabbar, .sidebar { display: none !important; }
  .mi-main { display: block; }
  .mi-print-title { display: block; font-size: 20px; font-weight: 700; margin: 0 0 8px; }
  .mi-band { background: #fff; color: #000; border: 1px solid #999; padding: 12px; } .mi-band h1.mi-band-title, .mi-eyebrow, .mi-tile, .mi-tile-l, .mi-tile-s { color: #000; background: #fff; }
  .mi-tiles { display: none; }
  .mi-bitem { break-inside: avoid; box-shadow: none; border: 1px solid #999; background: #fff; color: #000; }
  .mi-cite, .mi-title, .mi-orig, .mi-sources a { color: #000; }
  .mi-orig::after { content: " (" attr(href) ")"; font-size: 9px; word-break: break-all; }
  .mi-actions, .mi-section { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ring map: property switcher (same pill shape as the other MI pill rows; scrolls sideways on a phone) */
.mi-ring-props { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.mi-ring-prop-btn { flex: none; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 800; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mi-ring-prop-btn span { color: var(--muted); font-weight: 800; }
.mi-ring-prop-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mi-ring-prop-btn.on span { color: inherit; }
.mi-ring-prop-more { flex: none; min-height: 36px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 700; font-size: var(--fs-sm); }
.mi-ring-count { margin: 0 0 4px; }
.mi-ring-center { cursor: pointer; outline: none; } .mi-ring-center:hover .mi-ring-prop, .mi-ring-center:focus-visible .mi-ring-prop { stroke: var(--ink); stroke-width: 3; }
@media (max-width: 700px) { .mi-ring-props { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; } .mi-ring-prop-btn { min-height: 44px; } }
body.pn .mi-ring-props { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; } body.pn .mi-ring-prop-btn { min-height: 44px; }

/* News (news.js): Home → News feed, and the property hub "In the news" card. Tokens come from redesign.css. */
.news-head .news-mi { font-size: 14px; }
.news-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.news-chip-btn { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.news-chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.news-list { max-width: 760px; }
.news-row { padding: 14px 0; border-top: 1px solid var(--line-soft); min-width: 0; }
.news-row:first-child { border-top: 0; }
.news-title { display: block; font-weight: 650; font-size: 17px; line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.news-title:hover { text-decoration: underline; }
.news-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #1D6FE0; margin-right: 8px; vertical-align: 1px; }
.news-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.news-blurb { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.news-props { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.news-chip { display: inline-block; max-width: 100%; padding: 2px 10px; border-radius: 999px; background: var(--line-soft); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-more { margin: 12px 0 24px; min-height: 44px; }
body.pn .news-more { width: 100%; }
body.pn .news-chip-btn { flex: 1 1 auto; }

/* Construction costs (devcosts.js). Tokens only: light, dark and the phone layout follow the rest of the app. */
.dc-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 16px; }
.dc-controls label, .dc-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--muted); min-width: 0; }
.dc-controls select, .dc-form select, .dc-form input { font-size: 16px; min-height: 40px; max-width: 100%; }
.dc-kpis { margin: 0; }
.dc-kpis .x-kpi .v { font-size: 22px; }
.dc-kpis .x-kpi .d { flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.dc-sub { font-size: var(--fs-sm); color: var(--muted); }
.dc-redtext { color: var(--x-bad); }
.dc-warntext { color: var(--x-warn); }
.x-pill.dc-thin { background: transparent; color: var(--ink-2); border: 1px dashed var(--muted); }
.dc-thinnote { color: var(--muted); }
.dc-quality { margin: 4px 0 0; color: var(--ink-2); }
.x-pill.dc-user { background: var(--accent); color: var(--accent-ink); }
.dc-down { border-left: 4px solid var(--x-bad); }
.dc-pub { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dc-dim td { color: var(--muted); }
.dc-why { cursor: help; }
.dc-aside { margin-top: 10px; }
.dc-chart { max-width: 100%; height: auto; }
.dc-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; }
.dc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--x-c1); background: var(--panel); vertical-align: -1px; }
.dc-dot.on { background: var(--x-c1); } .dc-dot.ring { width: 8px; height: 8px; border-width: 1.5px; }
.dc-dash { display: inline-block; width: 18px; border-top: 2px dashed var(--x-c3); vertical-align: 3px; }
.dc-open > summary, .dc-proj > summary, .dc-cat > summary { cursor: pointer; padding: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.dc-proj { border-top: 1px solid var(--line); }
.dc-cats { padding-left: 14px; }
.dc-cat > summary { font-size: var(--fs-sm); }
.dc-amt { margin-left: auto; font-variant-numeric: tabular-nums; }
.dc-items { padding: 2px 0 8px 14px; }
.dc-item { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr) auto; gap: 8px; padding: 4px 0; border-top: 1px dotted var(--line); font-size: var(--fs-sm); }
.dc-item .dc-amt { margin: 0; text-align: right; }
.dc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; align-items: start; margin: 0 0 16px; }
.dc-go { display: flex; align-items: end; align-self: end; }
.dc-estimate > header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.dc-lines { display: flex; flex-direction: column; }
.dc-line { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 2fr); gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.dc-line.dc-red { background: var(--x-bad-soft); margin: 0 -10px; padding: 10px; border-radius: 8px; border-top-color: transparent; }
.dc-line.dc-off { opacity: .65; }
.dc-line.dc-total { border-top: 2px solid var(--ink); font-size: 1.05em; }
.dc-amount { text-align: right; font-variant-numeric: tabular-nums; }
.dc-range { text-align: right; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.dc-notes { grid-column: 1 / -1; }
.dc-notes p { margin: 2px 0; }
.dc-ovbox { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.dc-ov { width: 8.5em; font-size: 16px; min-height: 36px; text-align: right; }
.dc-reset { padding: 2px 8px; min-height: 28px; font-size: var(--fs-sm); }
.dc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dc-handoff { margin-top: 12px; }
.dc-handoff pre { white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.dc-copybuf { position: fixed; left: -9999px; top: 0; }
@media (max-width: 700px) {
  .dc-line { grid-template-columns: minmax(0, 1fr) auto; }
  .dc-line .dc-range { grid-column: 1 / -1; text-align: left; }
  .dc-line .dc-override { grid-column: 1 / -1; }
  .dc-ovbox { justify-content: flex-start; }
  .dc-item { grid-template-columns: minmax(0, 1fr) auto; }
  .dc-item .dc-vendor, .dc-item .dc-q { grid-column: 1 / -1; }
  .dc-controls label { flex: 1 1 100%; }
  .dc-controls select { width: 100%; }
  .dc-ov { width: 100%; max-width: 12em; }
  .dc-actions button { min-height: 44px; }
}
/* a status pill sits against the text beside it on a phone (the flex gap does not apply there) */
.dc-kpis .x-kpi .d .x-pill, .dc-kpis .x-kpi .d .badge { margin-right: 8px; }

/* Market Intelligence: Economy and Employers & infrastructure (mieconomy.js). Tokens only, so dark mode follows them. */

.eco-pick { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; }
.eco-picklabel { display: flex; flex-direction: row; gap: var(--s-2); align-items: center; margin: 0; width: auto; font-weight: 600; }
.eco-picklabel select { min-height: 40px; max-width: 100%; }
.eco-pick .mi-props { margin: 0; }

.eco-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.eco-grid > .card { min-width: 0; }
.eco-body { min-width: 0; }
.eco-big { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.eco-big .muted { font-weight: 400; }
.eco-sub { margin-top: var(--s-4); }
.eco-note { margin: var(--s-2) 0 0; overflow-wrap: anywhere; }
.eco-h { margin: var(--s-4) 0 var(--s-1); font-size: var(--fs-base); }
.eco-p { display: inline-block; min-width: 1.4em; text-align: center; padding: 0 5px; border-radius: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--warn); border: 1px solid currentColor; cursor: help; vertical-align: middle; }
.eco-lag { font-size: var(--fs-xs); font-weight: 600; color: var(--warn); border: 1px solid currentColor; border-radius: 999px; padding: 0 7px; cursor: help; white-space: nowrap; }
.eco-more > summary, .eco-others > summary, .eco-group > summary { cursor: pointer; padding: var(--s-2) 0; min-height: 36px; }
.eco-more > summary { font-size: var(--fs-sm); color: var(--accent); }
.eco-chart-wrap { overflow: hidden; }

/* ACS comparison rows */
.eco-cmps { display: flex; flex-direction: column; gap: 0; margin: var(--s-2) 0; }
.eco-cmp { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr); gap: 4px var(--s-3); align-items: baseline; padding: var(--s-2) 0; border-top: 1px solid var(--line-soft); }
.eco-cmp:first-child { border-top: 0; }
.eco-cl { font-weight: 600; overflow-wrap: anywhere; }
.eco-cv { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.eco-win { font-size: var(--fs-xs); color: var(--muted); }
.eco-cd { font-variant-numeric: tabular-nums; }
.eco-verdict { grid-column: 1 / -1; font-size: var(--fs-sm); }
.eco-v-sig { color: var(--good); font-weight: 600; } .eco-v-flat { color: var(--muted); } .eco-v-none { color: var(--muted); font-style: italic; }
.eco-whisk { grid-column: 1 / -1; max-width: 360px; height: 32px; }
.eco-w { stroke-width: 2; stroke-linecap: round; fill: none; }
.eco-wa { stroke: var(--x-s2); fill: var(--x-s2); } .eco-wb { stroke: var(--x-c1); fill: var(--x-c1); }
.eco-wd { stroke: var(--panel); stroke-width: 1; }

/* hub card */
.eco-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--s-3); margin: 0 0 var(--s-2); }
.eco-dl dt { color: var(--muted); font-size: var(--fs-sm); display: flex; gap: 4px; align-items: center; }
.eco-dl dd { margin: 0; overflow-wrap: anywhere; }

/* employers */
.eco-group { margin-bottom: var(--s-3); }
.eco-group > summary { font-size: var(--fs-base); }
.eco-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); align-items: start; margin-top: var(--s-2); }
.eco-cols section { min-width: 0; }
.eco-cols h4 { margin: 0 0 var(--s-2); font-size: var(--fs-base); }
.eco-item { padding: var(--s-2) 0; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.eco-item:first-child { border-top: 0; }
.eco-it { margin-bottom: 2px; }
.eco-fig { font-variant-numeric: tabular-nums; }
.eco-lk { margin-top: 3px; }
.eco-links { display: inline; }
.eco-link { margin-right: 6px; display: inline-block; }
.eco-others { margin: var(--s-3) 0; }

@media (max-width: 1100px) {
  .eco-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .eco-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .eco-pick { flex-direction: column; align-items: stretch; }
  .eco-picklabel { flex-direction: column; align-items: stretch; }
  .eco-picklabel select { width: 100%; font-size: 16px; min-height: 44px; }
  .eco-cmp { grid-template-columns: 1fr 1fr; }
  .eco-cl { grid-column: 1 / -1; }
  .eco-cd { grid-column: 1 / -1; }
  .eco-big { font-size: var(--fs-md); }
  .eco-more > summary, .eco-others > summary, .eco-group > summary { min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .eco-dl { grid-template-columns: 1fr; gap: 0; }
  .eco-dl dd { margin-bottom: var(--s-2); }
}
@media print { .eco-pick select { display: none; } }
.eco-products { list-style: none; margin: var(--s-2) 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.eco-sw { display: inline-block; width: 14px; height: 3px; vertical-align: middle; border-radius: 2px; background: var(--x-c1); }
.eco-sw-1 { background: var(--x-c4); } .eco-sw-2 { background: var(--x-c3); } .eco-sw-3 { background: var(--x-c2); } .eco-sw-4 { background: var(--x-c1); }
.eco-seams { padding: var(--s-2) var(--s-3); border-left: 3px solid var(--x-c4); background: var(--panel); border-radius: 6px; }

/* Data > Economy (areaecon.js), laid out from the approved mockups in docs/design/ae-economy. Colours come from the CRM tokens in styles.css and the
   --x-* chart tokens in design.css, so dark mode follows. Class prefix ae-. */
.ae-page { --ae-gold: #d9a441; --ae-bar-soft: color-mix(in srgb, var(--accent) 28%, var(--panel));
  max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ae-page > * { min-width: 0; }

/* header */
.ae-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.ae-head-l { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ae-head-r { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ae-crumb { font-size: var(--fs-sm); color: var(--muted); }
.ae-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.ae-lede { margin: 0; color: var(--muted); max-width: 640px; }
.ae-toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.ae-settings-btn { min-height: 42px; }

/* segmented controls */
.ae-seg { display: inline-flex; background: var(--line-soft); border-radius: var(--r-md); padding: 3px; gap: 2px; border: 0; overflow: visible; }
.ae-seg button { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 8px 14px; font: inherit; font-weight: 400; min-height: 36px; }
.ae-seg button.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--e-1); }
.ae-seg button:not(.on):hover { color: var(--ink); background: transparent; }
.ae-scope { margin-bottom: 14px; }
.ae-seg-sm { border-radius: 8px; padding: 2px; font-size: var(--fs-sm); }
.ae-seg-sm button { padding: 5px 10px; border-radius: 6px; min-height: 30px; font-size: var(--fs-sm); }

/* quiet formula tips: the number itself is the target, dotted underline, no circled i */
.x-fx.ae-n { display: inline; width: auto; height: auto; border: 0; border-radius: 0; color: inherit; font: inherit; place-items: unset;
  text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: help; }
.x-fx.ae-n::after { display: none !important; }
.x-fx.ae-n:hover { text-decoration-color: var(--accent); }
.x-fx.ae-n:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.ae-c-a { color: var(--accent); } .ae-c-m { color: var(--warn); } .ae-c-g { color: var(--good); }

/* cards */
.ae-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.ae-cardh { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ae-card h2, .ae-people h2 { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.ae-legend { display: flex; gap: 18px; font-size: var(--fs-sm); color: var(--muted); align-items: center; flex-wrap: wrap; }
.ae-legend > span { display: flex; align-items: center; gap: 6px; }
.ae-grow { flex: 1; }
.ae-scroll { overflow-x: auto; }
.ae-note { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

/* dumbbell */
.ae-db { position: relative; height: 40px; }
.ae-db-track { position: absolute; left: 0; right: 0; top: 13px; height: 2px; background: var(--line-soft); }
.ae-db-bar { position: absolute; top: 12px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--ae-gold)); }
.ae-db-dot { position: absolute; top: 7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; box-sizing: border-box; }
.ae-db-dot.a { background: var(--accent); }
.ae-db-dot.m { background: var(--panel); border: 2px solid var(--warn); }
.ae-db-lab { position: absolute; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ae-db-lab.a { top: 24px; color: var(--accent); } .ae-db-lab.m { top: -8px; color: var(--warn); }
.ae-lg-a, .ae-lg-m { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; }
.ae-lg-a { background: var(--accent); } .ae-lg-m { background: var(--panel); border: 2px solid var(--warn); }
.ae-db-big { height: 92px; margin: 0 8px; }
.ae-db-big .ae-db-track { top: 38px; height: 4px; border-radius: 2px; }
.ae-db-big .ae-db-bar { top: 37px; height: 6px; border-radius: 3px; }
.ae-db-big .ae-db-dot { top: 30px; width: 20px; height: 20px; margin-left: -10px; }
.ae-db-big .ae-db-dot.m { border-width: 3px; }
.ae-db-big .ae-db-lab { font-size: var(--fs-sm); }
.ae-db-big .ae-db-lab.a { top: 56px; } .ae-db-big .ae-db-lab.m { top: 6px; }
.ae-db-ax { position: absolute; top: 76px; font-size: var(--fs-xs); color: var(--muted); }
.ae-db-ax.l { left: 0; } .ae-db-ax.r { right: 0; }

/* overview table */
.ae-rank-in { min-width: 920px; }
.ae-row { display: grid; grid-template-columns: 200px 90px minmax(0, 1fr) 110px 120px; gap: 0 20px; padding: 14px 24px; align-items: center; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
a.ae-row:hover { background: var(--panel-sunk); color: var(--ink); }
.ae-row-h { padding: 10px 24px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.ae-rank .ae-cardh { padding: 18px 24px; border-bottom: 1px solid var(--line-soft); }
.ae-r-pl { display: none; }
.ae-r-name { display: flex; flex-direction: column; }
.ae-r-n { font-weight: 600; } .ae-r-sub { font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.ae-r-props, .ae-r-gap, .ae-r-share { text-align: right; font-variant-numeric: tabular-nums; }
.ae-r-props { color: var(--ink-2); } .ae-r-gap { font-weight: 600; color: var(--warn); } .ae-r-share { font-weight: 600; }
.ae-row .ae-r-db { margin-top: 12px; }
.ae-row-h .ae-r-db { margin-top: 0; text-align: left; }
.ae-foot { padding: 14px 24px; font-size: var(--fs-sm); color: var(--muted); background: var(--panel-sunk); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* county: the answer */
.ae-answer { padding: 28px; display: flex; flex-direction: column; gap: 28px; }
.ae-answer-top { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.ae-sentence { margin: 0; font-size: var(--fs-lg); line-height: 1.45; flex: 999 1 460px; color: var(--ink-2); }
.ae-sentence strong { color: var(--ink); }
.ae-sentence strong.ae-c-a { color: var(--accent); } .ae-sentence strong.ae-c-m { color: var(--warn); }
.ae-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1 1 420px; border-left: 1px solid var(--line-soft); }
.ae-stat { padding: 0 20px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line-soft); }
.ae-stat:first-child { border-left: 0; }
.ae-stat-l, .ae-stat-s { font-size: var(--fs-sm); color: var(--muted); }
.ae-stat-v { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.15; }
/* never split "Leftover" mid-word, and keep a gap like "−$1,642" on one line */
.ae-stat-v, .ae-stat-v .x-fx { overflow-wrap: normal; }
.ae-stat-v.ae-c-m .x-fx { white-space: nowrap; }
.ae-stat-v.ae-c-m { color: var(--warn); } .ae-stat-v.ae-c-g { color: var(--good); }

/* history + outlook */
.ae-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ae-two > * { min-width: 0; }
.ae-hist, .ae-fc-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.ae-hist .x-chart, .ae-hist svg { width: 100%; height: auto; }
.ae-hist-foot { margin-top: auto; }
.ae-band { fill: var(--accent-soft); opacity: 1; }
.ae-band.ae-shock { fill: var(--warn-soft); stroke: none; }
.ae-sw { display: inline-block; width: 12px; height: 12px; }
.ae-sw-rec { background: var(--accent-soft); } .ae-sw-shock { background: var(--warn-soft); }
.ae-fc { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ae-fc th, .ae-fc tbody th { background: transparent; }
.ae-fc th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; padding: 8px 0 8px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.ae-fc th.num, .ae-fc td.num { text-align: right; }
.ae-fc tbody th { text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--ink-2); font-weight: 400; padding: 12px 8px 12px 0; border-bottom: 0; }
.ae-fc td { padding: 12px 0 12px 8px; border-top: 1px solid var(--line-soft); }
.ae-fc tbody tr:first-child td { border-top: 0; }
.ae-fc td.first { font-weight: 600; }

/* properties */
.ae-propsc { overflow: hidden; }
.ae-cardh-b { padding: 20px 24px 12px; align-items: baseline; }
.ae-sub { font-size: var(--fs-sm); color: var(--muted); }
.ae-props { width: 100%; min-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ae-props th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; background: var(--panel-sunk); padding: 10px 16px; text-align: left; border: 0; }
.ae-props th:first-child, .ae-props td:first-child { padding-left: 24px; } .ae-props th:last-child, .ae-props td:last-child { padding-right: 24px; }
.ae-props th.num, .ae-props td.num { text-align: right; }
.ae-props td { padding: 14px 16px; border: 0; border-top: 1px solid var(--line-soft); }
.ae-props td:first-child { font-weight: 600; }
.ae-pad { padding: 0 24px 16px; margin: 0; }
.ae-foot-p { margin: 0; padding: 12px 24px 18px; font-size: var(--fs-sm); color: var(--muted); }

/* people and jobs */
.ae-people { display: flex; flex-direction: column; gap: 16px; }
.ae-people-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ae-people-r { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ae-emp-link { font-size: var(--fs-base); font-weight: 500; }
.ae-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ae-kpis .x-kpi { border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.ae-kpis .x-kpi .v { font-family: inherit; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.ae-kpis .x-kpi .d { min-height: 0; }
.ae-chartcard { padding: 20px 24px; border-radius: var(--r-lg); }
.ae-chartcard > header h3 { font-size: var(--fs-base); font-weight: 600; }
.ae-chartcard .eco-body { padding: 0; }

/* About this data */
.ae-about { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 20px; }
.ae-about > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); min-height: 32px; display: flex; align-items: center; }
.ae-about-b { margin-top: 10px; color: var(--muted); font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 16px; }
.ae-about-s h3 { margin: 0 0 6px; font-size: var(--fs-base); color: var(--ink-2); }
.ae-about-s h4 { margin: 12px 0 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.ae-about-s p { margin: 0 0 6px; }
.ae-howlist { margin: var(--s-2) 0; padding-left: 1.2em; }
.ae-nofc { color: var(--warn); display: inline; }
.ae-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ae-table th, .ae-table td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.ae-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ae-table input { width: 6em; min-height: 36px; font-size: 16px; }
.ae-src { max-width: 28em; }
.ae-fresh { margin: 0; }
.ae-employers { min-width: 0; }

/* settings drawer */
.ae-drawer-wrap { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.ae-drawer-wrap[hidden] { display: none; }
.ae-drawer-bd { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.ae-drawer { position: relative; width: min(720px, 100vw); height: 100%; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--e-2); display: flex; flex-direction: column; }
.ae-drawer-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ae-drawer-h h2 { margin: 0; font-size: var(--fs-md); }
.ae-drawer-b { padding: 16px 20px 28px; overflow-y: auto; flex: 1; }
.ae-actions { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-top: var(--s-3); }
.ae-msg { margin: 0; }
.ae-eng { margin: var(--s-3) 0; } .ae-eng summary { cursor: pointer; min-height: 32px; }
body.ae-noscroll { overflow: hidden; }
.x-kpi .v .ae-n { font: inherit; }

/* tablet and phone */
@media (max-width: 900px) { .ae-two { grid-template-columns: 1fr; } .ae-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ae-stats { border-left: 0; flex-basis: 100%; } .ae-stat:first-child { padding-left: 0; } }
@media (max-width: 700px) {
  .ae-page { gap: 16px; }
  .ae-head { align-items: stretch; } .ae-head-r, .ae-toggles { width: 100%; } .ae-toggles { flex-direction: column; } .ae-seg { width: 100%; } .ae-seg button { flex: 1; min-height: 40px; }
  .ae-seg-sm { width: auto; } .ae-seg-sm button { flex: none; min-height: 36px; }
  /* the ranked table: each county a block, dumbbell full width under its name */
  .ae-rank-in { min-width: 0; }
  .ae-row-h { display: none; }
  .ae-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name props props" "db db db" "gap share share"; gap: 6px 16px; padding: 14px 16px; }
  .ae-r-name { grid-area: name; } .ae-r-props { grid-area: props; } .ae-r-pl { display: inline; color: var(--muted); font-size: var(--fs-sm); }
  .ae-r-db { grid-area: db; margin: 22px 8px 28px; } .ae-r-gap { grid-area: gap; text-align: left; } .ae-r-share { grid-area: share; }
  .ae-r-gap::before { content: "Gap "; color: var(--muted); font-weight: 400; font-size: var(--fs-sm); } .ae-r-share::before { content: "Can afford market "; color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
  .ae-rank .ae-cardh, .ae-foot { padding-left: 16px; padding-right: 16px; }
  .ae-answer { padding: 18px 16px; gap: 20px; } .ae-sentence { font-size: 17px; flex-basis: 100%; }
  .ae-stats { grid-template-columns: 1fr; border-top: 1px solid var(--line-soft); } .ae-stat { border-left: 0; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .ae-hist, .ae-fc-card { padding: 16px; } .ae-cardh-b, .ae-foot-p { padding-left: 16px; padding-right: 16px; }
  .ae-kpis { grid-template-columns: 1fr 1fr; } .ae-chartcard { padding: 16px; }
  .ae-fc { min-width: 360px; }
}

/* ── county tabs and the Households tab (AE-HH-6). Colours from the CRM tokens, so dark mode follows. ── */
.ae-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.ae-tabs a { padding: 10px 16px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; display: inline-flex; align-items: center; }
.ae-tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.ae-tabs a:hover { color: var(--ink); }
.ae-hh-page { gap: 20px; }
.ae-chip-warn { display: inline-block; font-size: var(--fs-sm); font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); }
.x-fx.ae-n.ae-chip-warn { text-decoration: none; }
.ae-hh-banner { display: flex; gap: 14px; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border-radius: var(--r-lg); padding: 14px 18px; line-height: 1.5; }
.ae-hh-banner > svg { flex: none; margin-top: 2px; } .ae-hh-banner b { font-weight: 700; }
.ae-hh-mute { color: var(--muted); } .ae-hh-sm { font-size: var(--fs-sm); }
.ae-hh-strong { font-weight: 700; } .ae-hh-bad { color: var(--error); }
.ae-hh-r { text-align: right; font-variant-numeric: tabular-nums; }
.ae-hh-sec { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.ae-hh-sec h2 { margin: 0; font-size: var(--fs-md); }
.ae-hh-sech { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ae-hh-dash { border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 24px; text-align: center; color: var(--muted); }
/* 1. the answer */
.ae-hh-answer { background: var(--panel-sunk, var(--line-soft)); padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.ae-hh-kickrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ae-hh-kick { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ae-hh-pill { font-size: var(--fs-xs); font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); }
.ae-hh-pill-n { background: var(--line-soft); color: var(--ink-2); }
.ae-hh-lead { margin: 0; font-size: 24px; line-height: 1.35; font-weight: 500; max-width: 900px; color: var(--ink); overflow-wrap: anywhere; }
.ae-hh-lead .ae-hh-strong { font-weight: 700; } .ae-hh-mkt { color: var(--warn); font-weight: 700; }
.ae-hh-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ae-hh-tile { background: var(--panel); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ae-hh-tl { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.ae-hh-big { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.ae-hh-rng { font-size: 15px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.ae-hh-sub { font-size: var(--fs-sm); color: var(--muted); }
.ae-hh-sub .ae-hh-sub-n { color: var(--warn); }
.ae-hh-few { font-size: 20px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; } .ae-hh-few-s { font-size: var(--fs-sm); font-weight: 400; }
/* 2. the rent picker */
.ae-hh-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px; align-items: start; }
.ae-hh-pickl { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ae-hh-lab { font-weight: 700; }
.ae-hh-rentbig { font-size: 40px; font-weight: 700; line-height: 1; color: var(--ink); }
.ae-hh-pickl input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.ae-hh-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ae-hh-chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--r-pill); padding: 7px 12px; font-size: var(--fs-sm); font-weight: 700; min-height: 36px; cursor: pointer; }
.ae-hh-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ae-hh-readout { display: flex; flex-direction: column; gap: 14px; }
.ae-hh-movers { background: var(--accent); color: var(--accent-ink); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ae-hh-movers-t { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.ae-hh-movers-n { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; font-size: 34px; font-weight: 700; }
.ae-hh-movers .x-fx.ae-n { text-decoration-color: currentColor; }
.ae-hh-mvs { font-size: 14px; font-weight: 400; opacity: .9; } .ae-hh-mvs b { color: inherit; }
.ae-hh-movers-f { font-size: var(--fs-sm); opacity: .85; }
.ae-hh-movers .ae-hh-few { color: inherit; }
.ae-hh-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ae-hh-mini { background: var(--panel-sunk, var(--line-soft)); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ae-hh-mini .ae-hh-big { font-size: 26px; }
.ae-hh-pickr { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ae-hh-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--fs-sm); align-items: center; }
.ae-hh-legend > span { display: flex; gap: 6px; align-items: center; }
.ae-lg-pick { display: inline-block; width: 3px; height: 14px; background: var(--ink); } .ae-lg-mkt { display: inline-block; width: 0; height: 14px; border-left: 2px dashed var(--ae-gold); } .ae-lg-on { display: inline-block; width: 12px; height: 10px; border-radius: 2px; background: var(--accent); }
.ae-hh-pickbox { position: relative; }
.ae-hh-svg { display: block; width: 100%; height: auto; }
.ae-hb { fill: var(--ae-bar-soft); } .ae-hb.on { fill: var(--accent); }
.ae-hmk { stroke: var(--ae-gold); stroke-width: 2; stroke-dasharray: 4 4; } .ae-hpk { stroke: var(--ink); stroke-width: 2.5; }
.ae-hh-ticks { position: relative; height: 16px; font-size: 12px; color: var(--muted); }
.ae-hh-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
/* 3. then, now and next */
.ae-hh-sent { margin: 0; font-size: 16px; line-height: 1.5; max-width: 820px; }
.ae-hh-chartbox { overflow-x: auto; } .ae-hh-chartin { position: relative; min-width: 640px; }
.ae-hh-swipe { display: none; font-size: var(--fs-sm); color: var(--muted); }
.ae-hh-axl { color: var(--muted); } .ae-hh-norm { color: var(--accent); } .ae-hh-today { color: var(--error); } .ae-hh-projt { color: var(--ink-2); }
.ae-hline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; } .ae-hjoin { stroke-dasharray: 5 4; }
.ae-hband { fill: var(--accent); opacity: .12; }
.ae-hdot { fill: var(--accent); } .ae-htoday { fill: var(--panel); stroke: var(--error); stroke-width: 3; }
.ae-norm { stroke: var(--accent); stroke-dasharray: 3 4; opacity: .55; }
.ae-hhatch { fill: var(--line-soft); stroke: var(--line); stroke-dasharray: 4 4; }
.ae-hwhisk { stroke: var(--ink-2); stroke-width: 2; } .ae-hproj { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; } .ae-hscen { fill: var(--warn); }
.ae-hh-notes { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.ae-hh-proj { display: flex; flex-direction: column; gap: 8px; } .ae-hh-projh { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* 4. if things change */
.ae-hh-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ae-hh-two > * { min-width: 0; }
.ae-hh-sth { padding-bottom: 6px; }
.ae-hh-strow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 84px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.ae-hh-ch { font-weight: 800; } .ae-hh-ch.bad { color: var(--error); } .ae-hh-ch.good { color: var(--good); }
.ae-hh-bul { display: flex; flex-direction: column; gap: 10px; }
.ae-hh-rate { display: grid; grid-template-columns: 118px repeat(3, minmax(0, 1fr)); gap: 0 8px; align-items: center; }
.ae-hh-rh { font-size: var(--fs-xs); font-weight: 800; color: var(--muted); padding: 4px 6px; } .ae-hh-rh.r { text-align: right; }
.ae-hh-rc, .ae-hh-rate .ae-hh-r { padding: 8px 6px; } .ae-hh-rc.now, .ae-hh-rate .ae-hh-r.now { background: var(--accent-soft); font-weight: 800; }
/* 5. details */
.ae-hh-details { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); padding: 0 22px; }
.ae-hh-details[open] { padding-bottom: 22px; }
.ae-hh-details > summary { list-style: none; cursor: pointer; padding: 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; }
.ae-hh-details > summary::-webkit-details-marker { display: none; }
.ae-hh-dt { font-weight: 600; font-size: var(--fs-md); } .ae-hh-ds { display: flex; gap: 10px; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.ae-hh-chev { transition: transform .15s; } .ae-hh-details[open] .ae-hh-chev { transform: rotate(180deg); }
.ae-hh-flow { display: flex; flex-direction: column; gap: 9px; max-width: 640px; }
.ae-hh-frow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 76px; gap: 10px; align-items: center; }
.ae-hh-ftrack, .ae-hh-ttrack, .ae-hh-dtrack { position: relative; height: 12px; background: var(--line-soft); border-radius: 3px; }
.ae-hf-bar { position: absolute; top: 0; height: 12px; border-radius: 3px; background: var(--sky); }
.ae-hf-bar.k-income { background: var(--accent); } .ae-hf-bar.k-tax { background: var(--n-400); } .ae-hf-bar.k-debt { background: var(--warn); } .ae-hf-bar.k-left { background: var(--good); }
.ae-hh-fa { text-align: right; font-weight: 800; white-space: nowrap; } .ae-hh-fa.good { color: var(--good); }
.ae-hh-trow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) 86px; gap: 10px; align-items: center; font-size: var(--fs-sm); margin-top: 8px; }
.ae-hh-ttrack { height: 14px; } .ae-hh-tbar { position: absolute; top: 0; height: 14px; border-radius: 3px; background: var(--sky); } .ae-hh-tbase { position: absolute; top: -3px; height: 20px; width: 2px; background: var(--ink); }
.ae-hh-tbl { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-items: center; }
.ae-hh-col { display: flex; flex-direction: column; gap: 9px; }
.ae-hh-drow { display: grid; grid-template-columns: 110px minmax(0, 1fr) 92px; gap: 10px; align-items: center; }
.ae-hh-dtrack { height: 10px; } .ae-hh-dbar { position: absolute; top: 0; height: 10px; border-radius: 3px; background: var(--warn); left: 0; }
.ae-hh-nrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) 56px; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.ae-hh-nbars { display: flex; flex-direction: column; gap: 3px; } .ae-hh-nbar { display: block; height: 8px; border-radius: 2px; } .ae-hh-nbar.own { background: var(--accent); } .ae-hh-nbar.rent { background: var(--warn); }
.ae-hh-rentc { color: var(--warn); }
.ae-hh-about { background: var(--panel-sunk, var(--line-soft)); border-radius: var(--r-lg); padding: 18px 22px; font-size: var(--fs-sm); line-height: 1.55; color: var(--muted); }
.ae-hh-about b { color: var(--ink); }

@media (max-width: 900px) {
  .ae-hh-two, .ae-hh-pick { grid-template-columns: minmax(0, 1fr); }
  .ae-hh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ae-hh-three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .ae-hh-page { gap: 16px; }
  .ae-tabs a { flex: 1; justify-content: center; }
  .ae-hh-answer, .ae-hh-sec { padding: 16px; }
  .ae-hh-lead { font-size: 20px; }
  .ae-hh-details { padding: 0 16px; } .ae-hh-details[open] { padding-bottom: 16px; }
  .ae-hh-rate { grid-template-columns: 88px repeat(3, minmax(0, 1fr)); font-size: 13px; }
  .ae-hh-strow { font-size: 13px; }
  .ae-hh-swipe { display: block; }
  .ae-hh-banner { padding: 12px 14px; font-size: 14px; }
  .ae-hh-seg-wrap, .ae-hh-page .ae-seg { flex-wrap: wrap; }
  .ae-hh-page .ae-seg button { flex: 1 1 30%; min-width: 0; padding: 8px 6px; }
}
.x-fx.ae-n.ae-hh-pill, .ae-hh-pill { white-space: normal; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.ae-hh-proj .ae-fc { min-width: 0; }

/* ── Households around a property (AE-RH-2). Colours from the CRM tokens, so dark mode follows. Reuses the .ae-hh-* answer, tile, picker and banner styles. ── */
.ae-rg-link { display: block; font-size: var(--fs-sm); color: var(--muted); }
.ae-rg-segs { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ae-seg button.off { color: var(--muted); opacity: .6; }
.ae-rg-fits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ae-rg-fit { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; background: var(--panel); min-width: 0; }
.ae-rg-fl { font-size: var(--fs-sm); font-weight: 800; }
.ae-rg-fq { font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1.15; }
.ae-rg-band { background: var(--accent); color: var(--accent-ink); border-radius: var(--r-lg); padding: 16px 18px; display: flex; gap: 8px 22px; align-items: baseline; flex-wrap: wrap; }
.ae-rg-bandk { color: inherit; opacity: .85; }
.ae-rg-bandn { font-size: 28px; font-weight: 700; }
.ae-rg-bandt { font-size: var(--fs-sm); opacity: .9; flex: 1 1 260px; }
.ae-rg-band .x-fx.ae-n { text-decoration-color: currentColor; }
.ae-rg-band .ae-hh-few { color: inherit; }
.ae-rg-cmp { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(4, minmax(0, 1fr)); gap: 10px 12px; align-items: center; font-variant-numeric: tabular-nums; }
.ae-rg-rl { font-weight: 700; }
.ae-rg-dash { color: var(--muted); } .ae-rg-dash .x-fx.ae-n { text-decoration: none; }
@media (max-width: 900px) {
  .ae-rg-fits { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .ae-rg-cmp { grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr)); font-size: 12px; gap: 8px 6px; }
  .ae-rg-page .ae-hh-lead { font-size: 19px; }
  .ae-rg-segs { flex-direction: column; align-items: stretch; }
  .ae-rg-bandn { font-size: 24px; }
  .ae-rg-cmp .ae-hh-kick { letter-spacing: 0; font-size: 10px; }
}

/* Draftable forms page. */
.frm-card { margin: 0; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.frm-card:hover { background: var(--panel-sunk); }
.frm-card h3, .frm-card p { margin: 0; }
.frm-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.frm-mod { display: block; margin: 6px 0; }
.frm-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.frm-row select { min-width: 260px; flex: 1 1 260px; }
tr.frm-decide td { background: var(--accent-soft); }

/* Redesign layer: Villanova Blue, big and round. Loaded after every other stylesheet, so it only has to override tokens
   and a few component shapes. Visual only: no page logic lives here.

   Theme controls (see appearance.js):  <html data-theme="light|dark">  <html data-accent="graphite">
   With neither set, the OS light/dark setting decides and the accent is Villanova Blue (#00205B). */

@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito";  src: url("/fonts/nunito.woff2")  format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }

/* ── Tokens: Villanova Blue, light ─────────────────────────────────────────── */
html:not([data-theme]), html[data-theme="light"],
html:not([data-theme]) body.pn, html[data-theme="light"] body.pn {
  color-scheme: light;
  --n-0: #ffffff;  --n-25: hsl(219 40% 98%);  --n-50: hsl(219 40% 97%);  --n-100: hsl(219 36% 94%);
  --n-200: hsl(219 30% 90%);  --n-300: hsl(219 22% 80%);  --n-400: hsl(219 14% 56%);  --n-500: hsl(219 16% 36%);
  --n-700: hsl(219 40% 22%);  --n-900: #00205b;
  --bg: #ffffff;  --panel: hsl(219 40% 97%);  --panel-sunk: hsl(219 40% 95%);
  --ink: #00205b;  --ink-2: hsl(219 40% 22%);  --muted: hsl(219 16% 36%);  --line: hsl(219 30% 90%);  --line-soft: hsl(219 30% 93%);
  --accent: #00205b;  --accent-hover: #0a3a8c;  --accent-ink: #ffffff;  --accent-soft: hsl(217 80% 95%);  --sky: hsl(217 80% 76%);
  --good: #07714a;  --good-soft: #e3f3ed;  --warn: #7a5200;  --warn-soft: #fff1bf;  --error: #b3261e;  --error-soft: #ffe0de;
  --e-1: none;  --e-2: 0 10px 30px -12px rgba(0, 32, 91, .25);
  --x-s1: hsl(217 80% 90%); --x-s2: hsl(217 70% 78%); --x-s3: hsl(217 65% 62%); --x-s4: hsl(219 80% 38%); --x-s5: #00205b;
  --x-c1: #1f4fa3; --x-c2: #e0731f; --x-c3: #1f8a63; --x-c4: #d19a00; --x-c5: #c25b8a; --x-grid: hsl(219 30% 92%);
  --x-good: #07714a; --x-good-soft: #e3f3ed; --x-warn: #7a5200; --x-warn-soft: #fff1bf; --x-bad: #b3261e; --x-bad-soft: #ffe0de;
  --tint: hsl(217 80% 95%);  --strong: #00205b;
}
html[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) { color-scheme: dark; }
}
/* One dark definition, applied for an explicit choice or (when nothing is chosen) the OS setting. */
html[data-theme="dark"], html[data-theme="dark"] body.pn {
  --n-0: hsl(219 34% 13%);  --n-25: hsl(219 36% 11%);  --n-50: hsl(219 42% 8%);  --n-100: hsl(219 32% 17%);
  --n-200: hsl(219 28% 25%);  --n-300: hsl(219 22% 33%);  --n-400: hsl(219 14% 56%);  --n-500: hsl(219 18% 72%);
  --n-700: hsl(219 30% 86%);  --n-900: hsl(219 40% 96%);
  --bg: hsl(219 42% 8%);  --panel: hsl(219 34% 13%);  --panel-sunk: hsl(219 36% 11%);
  --ink: hsl(219 40% 96%);  --ink-2: hsl(219 30% 86%);  --muted: hsl(219 18% 72%);  --line: hsl(219 28% 25%);  --line-soft: hsl(219 28% 18%);
  --accent: hsl(217 90% 74%);  --accent-hover: hsl(217 90% 82%);  --accent-ink: hsl(219 60% 10%);  --accent-soft: hsl(219 50% 17%);  --sky: hsl(217 60% 44%);
  --good: #5fd99b;  --good-soft: #123023;  --warn: #f3c86b;  --warn-soft: hsl(40 45% 17%);  --error: #ff8a84;  --error-soft: hsl(2 40% 20%);
  --e-2: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --x-s1: hsl(219 50% 22%); --x-s2: hsl(217 55% 34%); --x-s3: hsl(217 65% 50%); --x-s4: hsl(217 85% 68%); --x-s5: hsl(217 95% 82%);
  --x-c1: #6ea8f0; --x-c2: #f0883e; --x-c3: #4fc79b; --x-c4: #e8b93a; --x-c5: #e07fa6; --x-grid: hsl(219 28% 20%);
  --x-good: #5fd99b; --x-good-soft: #123023; --x-warn: #f3c86b; --x-warn-soft: hsl(40 45% 17%); --x-bad: #ff8a84; --x-bad-soft: hsl(2 40% 20%);
  --tint: hsl(219 50% 17%);  --strong: hsl(217 90% 82%);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]), html:not([data-theme]) body.pn {
    --n-0: hsl(219 34% 13%);  --n-25: hsl(219 36% 11%);  --n-50: hsl(219 42% 8%);  --n-100: hsl(219 32% 17%);
    --n-200: hsl(219 28% 25%);  --n-300: hsl(219 22% 33%);  --n-400: hsl(219 14% 56%);  --n-500: hsl(219 18% 72%);
    --n-700: hsl(219 30% 86%);  --n-900: hsl(219 40% 96%);
    --bg: hsl(219 42% 8%);  --panel: hsl(219 34% 13%);  --panel-sunk: hsl(219 36% 11%);
    --ink: hsl(219 40% 96%);  --ink-2: hsl(219 30% 86%);  --muted: hsl(219 18% 72%);  --line: hsl(219 28% 25%);  --line-soft: hsl(219 28% 18%);
    --accent: hsl(217 90% 74%);  --accent-hover: hsl(217 90% 82%);  --accent-ink: hsl(219 60% 10%);  --accent-soft: hsl(219 50% 17%);  --sky: hsl(217 60% 44%);
    --good: #5fd99b;  --good-soft: #123023;  --warn: #f3c86b;  --warn-soft: hsl(40 45% 17%);  --error: #ff8a84;  --error-soft: hsl(2 40% 20%);
    --e-2: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --x-s1: hsl(219 50% 22%); --x-s2: hsl(217 55% 34%); --x-s3: hsl(217 65% 50%); --x-s4: hsl(217 85% 68%); --x-s5: hsl(217 95% 82%);
    --x-c1: #6ea8f0; --x-c2: #f0883e; --x-c3: #4fc79b; --x-c4: #e8b93a; --x-c5: #e07fa6; --x-grid: hsl(219 28% 20%);
    --x-good: #5fd99b; --x-good-soft: #123023; --x-warn: #f3c86b; --x-warn-soft: hsl(40 45% 17%); --x-bad: #ff8a84; --x-bad-soft: hsl(2 40% 20%);
    --tint: hsl(219 50% 17%);  --strong: hsl(217 90% 82%);
  }
}

/* Graphite: the same shapes with no color. Light and dark both. */
html[data-accent="graphite"]:not([data-theme="dark"]),
html[data-accent="graphite"]:not([data-theme="dark"]) body.pn {
  --n-25: hsl(215 8% 98%);  --n-50: hsl(215 8% 97%);  --n-100: hsl(215 7% 94%);  --n-200: hsl(215 7% 90%);  --n-300: hsl(215 6% 80%);
  --n-400: hsl(215 5% 56%);  --n-500: hsl(215 6% 34%);  --n-700: hsl(215 12% 20%);  --n-900: hsl(215 18% 11%);
  --panel: hsl(215 8% 97%);  --panel-sunk: hsl(215 8% 95%);  --ink: hsl(215 18% 11%);  --ink-2: hsl(215 12% 20%);  --muted: hsl(215 6% 34%);
  --line: hsl(215 7% 90%);  --line-soft: hsl(215 7% 93%);  --accent: hsl(215 18% 14%);  --accent-hover: hsl(215 14% 26%);  --accent-soft: hsl(215 8% 94%);
  --sky: hsl(215 8% 76%);  --tint: hsl(215 8% 94%);  --strong: hsl(215 18% 11%);
  --x-s1: hsl(215 8% 88%); --x-s2: hsl(215 8% 74%); --x-s3: hsl(215 8% 58%); --x-s4: hsl(215 10% 38%); --x-s5: hsl(215 18% 14%); --x-c1: hsl(215 14% 34%);
}
html[data-accent="graphite"][data-theme="dark"],
html[data-accent="graphite"][data-theme="dark"] body.pn {
  --n-0: hsl(215 8% 13%);  --n-25: hsl(215 8% 11%);  --n-50: hsl(215 10% 8%);  --n-100: hsl(215 8% 17%);  --n-200: hsl(215 7% 25%);  --n-300: hsl(215 6% 33%);
  --n-500: hsl(215 6% 72%);  --n-700: hsl(215 8% 86%);  --n-900: hsl(215 12% 96%);
  --bg: hsl(215 10% 8%);  --panel: hsl(215 8% 13%);  --panel-sunk: hsl(215 8% 11%);  --ink: hsl(215 12% 96%);  --ink-2: hsl(215 8% 86%);  --muted: hsl(215 6% 72%);
  --line: hsl(215 7% 25%);  --line-soft: hsl(215 7% 18%);  --accent: hsl(215 10% 80%);  --accent-hover: hsl(215 10% 90%);  --accent-ink: hsl(215 14% 8%);
  --accent-soft: hsl(215 8% 18%);  --sky: hsl(215 8% 44%);  --tint: hsl(215 8% 17%);  --strong: hsl(215 10% 86%);
  --x-s1: hsl(215 8% 22%); --x-s2: hsl(215 8% 34%); --x-s3: hsl(215 8% 50%); --x-s4: hsl(215 8% 68%); --x-s5: hsl(215 10% 84%); --x-c1: hsl(215 10% 72%);
}
@media (prefers-color-scheme: dark) {
  html[data-accent="graphite"]:not([data-theme]), html[data-accent="graphite"]:not([data-theme]) body.pn {
    --n-0: hsl(215 8% 13%);  --n-25: hsl(215 8% 11%);  --n-50: hsl(215 10% 8%);  --n-100: hsl(215 8% 17%);  --n-200: hsl(215 7% 25%);  --n-300: hsl(215 6% 33%);
    --n-500: hsl(215 6% 72%);  --n-700: hsl(215 8% 86%);  --n-900: hsl(215 12% 96%);
    --bg: hsl(215 10% 8%);  --panel: hsl(215 8% 13%);  --panel-sunk: hsl(215 8% 11%);  --ink: hsl(215 12% 96%);  --ink-2: hsl(215 8% 86%);  --muted: hsl(215 6% 72%);
    --line: hsl(215 7% 25%);  --line-soft: hsl(215 7% 18%);  --accent: hsl(215 10% 80%);  --accent-hover: hsl(215 10% 90%);  --accent-ink: hsl(215 14% 8%);
    --accent-soft: hsl(215 8% 18%);  --sky: hsl(215 8% 44%);  --tint: hsl(215 8% 17%);  --strong: hsl(215 10% 86%);
  }
}

/* ── Type: Nunito for reading, Fredoka for headings and big numbers ───────── */
:root {
  --fs-xs: 12.5px;  --fs-sm: 14px;  --fs-base: 16px;  --fs-md: 18px;  --fs-lg: 26px;  --fs-xl: 34px;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r-sm: 12px;  --r-md: 18px;  --r-lg: 24px;  --r-pill: 999px;
  --x-mono: var(--font-display);
  font-family: var(--font-body);
}
body, input, select, textarea, button { font-family: var(--font-body); }
h1, h2, h3, .x-head h2, .x-kpi .v, .brand-text { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.x-kpi .v { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.01em; }
strong, b { font-weight: 800; }

/* ── Buttons, fields, cards: round and large ───────────────────────────────── */
button, .x-pillbtn { border-radius: var(--r-pill); min-height: 44px; padding: 0 22px; font-weight: 800; }
button { background: var(--accent); color: var(--accent-ink); }
button.secondary, button.ghost, .x-pillbtn { background: var(--bg); color: var(--ink); border: 2px solid var(--ink); }
button.link { background: none; color: var(--muted); border: 0; min-height: 0; padding: 0; border-radius: 0; font-weight: 600; }
input, select, textarea { border: 2px solid var(--line); border-radius: var(--r-md); background: var(--bg); min-height: 46px; padding: 8px 14px; font-size: var(--fs-base); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.card, .x-card, .x-kpi, .login-card { border: 0; border-radius: var(--r-lg); background: var(--panel); box-shadow: none; }
.x-kpi { padding: 18px 20px; }
.x-kpi .l { font-size: var(--fs-sm); font-weight: 700; }
.x-kpi .v { font-size: 32px; line-height: 1.1; }
a.x-kpi:hover { background: var(--panel-sunk); }
.x-pill { padding: 4px 12px; font-weight: 800; font-size: var(--fs-sm); }
.x-pills a, .x-sub a { border-radius: var(--r-pill); font-weight: 800; }
.x-pills a { border: 2px solid var(--line); min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; font-size: var(--fs-base); }
.x-pills a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ── Page header: a soft blue card with a big title ────────────────────────── */
.x-head { background: var(--tint); border-radius: 32px; padding: 26px 32px; margin-bottom: 20px; }
.x-head h2 { font-size: 40px; line-height: 1.08; margin: 0; color: var(--ink); }
.x-head .sub { font-size: 18px; font-weight: 600; color: var(--ink-2); margin: 8px 0 0; }
.x-eyebrow { font-weight: 800; font-size: var(--fs-sm); letter-spacing: .04em; color: var(--strong); text-transform: none; }

main { padding: 24px 40px; }

/* ── Desktop shell: one top bar of sections, the section's pages down the left ─────────────────────── */
.top-brand, .toptabs, .appearance-btn, .sidenav { display: none; }
@media (min-width: 701px) {
  .shell { grid-template-columns: 272px minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .main-col { display: contents; }
  .topbar { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 22px; padding: 0 28px; min-height: 72px;
    background: var(--bg); border-bottom: 2px solid var(--line-soft); position: sticky; top: 0; z-index: 20; }
  .top-brand { display: flex; align-items: center; flex: none; }
  .top-brand img { height: 36px; width: auto; display: block; }
  .toptabs { display: flex; gap: 2px; align-self: stretch; flex: 1; min-width: 0; overflow: hidden; }
  .toptabs a { display: inline-flex; align-items: center; padding: 0 16px; font-weight: 800; font-size: 16.5px; color: var(--muted);
    text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
  .toptabs a:hover { color: var(--ink); }
  .toptabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
  .topbar #search-form { flex: 0 1 340px; margin: 0; }
  .topbar #search-input { width: 100%; border-radius: var(--r-pill); background: var(--panel); border-color: transparent; min-height: 46px; padding: 0 20px; }
  .appearance-btn { display: grid; place-items: center; flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; background: var(--panel); color: var(--ink); border: 0; }
  .appearance-btn:hover { background: var(--panel-sunk); }
  .topbar .sections, .topbar #menu-toggle, .topbar #search-toggle, .topbar .topbar-title, .topbar .x-back { display: none !important; }

  .sidebar { grid-column: 1; grid-row: 2 / span 2; border: 0; background: var(--bg); padding: 22px 16px 28px; position: sticky; top: 72px;
    align-self: start; height: calc(100vh - 72px); overflow-y: auto; }
  .sidebar .brand, .sidebar #rail { display: none; }
  .sidenav { display: flex; flex-direction: column; gap: 4px; }
  .sidenav a { display: flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: var(--r-md); font-weight: 700; font-size: 17px;
    color: var(--ink-2); text-decoration: none; }
  .sidenav a:hover { background: var(--panel); }
  .sidenav a.on { background: var(--tint); color: var(--strong); font-weight: 800; }
  .sidebar-foot { border-top: 2px solid var(--line-soft); }
  /* the pills row sits above the page in the right column; without a placement it fell under the sidebar */
  main#view { grid-column: 2; grid-row: 3; }
  #subnav .x-sub { display: none; }
  #subnav { grid-column: 2; grid-row: 2; padding: 24px 40px 0; }
  #subnav:not(:has(.x-pills)) { display: none; }
  #subnav .x-pills { margin: 0; }
}

/* ── Appearance panel ─────────────────────────────────────────────────────────────────────────── */
.px-panel { position: fixed; top: 80px; right: 24px; z-index: 3000; width: min(340px, calc(100vw - 24px)); background: var(--bg); color: var(--ink);
  border-radius: 28px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 16, 48, .3); display: flex; flex-direction: column; gap: 12px; }
.px-title { font: 600 24px/1.1 var(--font-display); }
.px-label { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.px-group { display: flex; flex-direction: column; gap: 8px; }
.px-group.row { flex-direction: row; }
.px-choice { all: unset; box-sizing: border-box; cursor: pointer; min-height: 52px; padding: 0 18px; display: flex; align-items: center; gap: 12px; flex: 1;
  border-radius: 20px; border: 3px solid var(--line); background: var(--panel); font-weight: 800; font-size: 16px; color: var(--ink); }
.px-group.row .px-choice { justify-content: center; border-radius: 999px; padding: 0 10px; }
.px-choice.on { border-color: var(--ink); }
.px-choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.px-swatch { width: 26px; height: 26px; border-radius: 50%; flex: none; }

/* Every page title row becomes the same soft header card. */
.page-head { background: var(--tint); border-radius: 32px; padding: 26px 32px; margin: 0 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; }
.page-head h2 { font-size: 40px; line-height: 1.08; margin: 0; color: var(--ink); }
.page-head .sub, .page-head p { font-size: 18px; font-weight: 600; color: var(--ink-2); margin: 8px 0 0; max-width: 70ch; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (min-width: 701px) {
  .toptabs a { padding: 0 12px; }
  .topbar #search-form { flex-basis: 260px; }
}
@media (min-width: 701px) and (max-width: 1400px) { .topbar #search-form { flex-basis: 200px; } }
@media (min-width: 701px) and (max-width: 1180px) { .top-brand { display: none; } .topbar { gap: 14px; padding: 0 20px; } }
@media (min-width: 701px) and (max-width: 940px) { .topbar #search-form { display: none; } }

/* ── Phone: the section screen (tiles) and the one-tap way back ─────────────────────────────────────────── */
body.pn .pn-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 24px; }
body.pn .pn-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 112px; padding: 12px 6px;
  border-radius: 24px; background: var(--panel); color: var(--ink); text-decoration: none; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
body.pn .pn-tile:active { transform: scale(.98); background: var(--panel-sunk); }
body.pn .pn-tile[hidden] { display: none; }
body.pn .pn-tile-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--sky); display: grid; place-items: center; }
body.pn .pn-tile-ic svg { width: 23px; height: 23px; fill: none; stroke: var(--accent-ink, #00205b); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
html:not([data-theme="dark"]) body.pn .pn-tile-ic svg { stroke: #00205b; }
body.pn .pn-tile-tx { font-weight: 800; font-size: 14.5px; line-height: 1.2; }
body.pn .pn-find { width: 100%; margin: 0 0 14px; border-radius: var(--r-pill); background: var(--panel); border-color: transparent; padding: 0 20px; min-height: 52px; }
body.pn .pn-recents { margin: 0 0 16px; }
body.pn .pn-cap { display: block; font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
body.pn .pn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
body.pn .pn-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); background: var(--tint); color: var(--strong); font-weight: 800; text-decoration: none; }
body.pn .pn-none { color: var(--muted); font-weight: 700; padding: 8px 4px; }
body.pn .pn-seclink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 6px; margin: 0 0 8px -6px; color: var(--strong); font-weight: 800; text-decoration: none; }
body.pn .pn-seclink svg { width: 18px; height: 18px; fill: currentColor; }
/* The pages inside one tab wrap onto a second line instead of scrolling sideways. */
body.pn .pn-subnav .x-pills, body.pn #view > .x-pills { flex-wrap: wrap !important; overflow: visible !important; -webkit-mask-image: none !important; mask-image: none !important; background: transparent; padding: 0; gap: 8px; }
body.pn .pn-subnav .x-pills a { min-height: 44px; padding: 0 18px; border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--bg); color: var(--ink); font-weight: 800; }
body.pn .pn-subnav .x-pills a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* The phone skin keeps its own few tokens; point them at the same palette. */
html body.pn { --pn-round: var(--font-display); --pn-fill: color-mix(in srgb, var(--ink) 7%, transparent); --pn-sep: var(--line);
  --pn-bar: color-mix(in srgb, var(--bg) 96%, transparent); font-family: var(--font-body); }

/* ── Lists as cards, on every screen size (the phone rules in styles.css already do the stacked version) ───── */
@media (min-width: 701px) {
  .table-wrap.cards { background: none; border: 0; border-radius: 0; overflow: visible; }
  .cards table, .cards tbody { display: block; width: 100%; }
  .cards thead { display: none; }
  .cards tr { display: grid; grid-template-columns: minmax(190px, 1.4fr) repeat(auto-fit, minmax(112px, 1fr)); align-items: start; gap: 8px 20px;
    background: var(--panel); border-radius: var(--r-lg); padding: 16px 22px; margin: 0 0 10px; }
  .cards td { display: flex; flex-direction: column; gap: 2px; border: 0; padding: 0; min-width: 0; overflow-wrap: break-word; text-align: left; background: none; }
  .cards td.num { text-align: left; }
  .cards.px-wide tr { grid-template-columns: minmax(200px, 1.3fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 22px; }
  .cards td::before { overflow-wrap: break-word; }
  .cards.px-wide td:first-child { grid-column: 1; grid-row: span 2; }
  .cards td::before { content: attr(data-label); font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .cards td:first-child { font-weight: 800; font-size: 18px; }
  .cards td:first-child::before { display: none; }
  .cards td.blank { visibility: hidden; }
  .cards .badge, .cards .x-pill { white-space: normal; }
  .cards tr.clickable:hover { background: var(--panel-sunk); }
  .cards tr.clickable:hover td { background: none; }
  .cards tr.grp { display: block; background: none; padding: 16px 4px 4px; margin: 0; }
  .cards tr.grp td { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .cards tr.grp td::before { display: none; }
}
body.pn .cards tr { background: var(--panel); border: 0; border-radius: var(--r-lg); }

/* The wordmark follows the chosen theme, not only the device setting. */
html[data-theme="dark"] .top-brand img { content: url("/logo-white.png"); }
html[data-theme="light"] .top-brand img { content: url("/logo-ink.png"); }

/* More: one color for the little icons, not a rainbow. */
body.pn .pn-row .ic { background: var(--sky) !important; }
body.pn .pn-row .ic svg { stroke: #00205b; color: #00205b; }
/* A page whose title is a plain heading (no header card) gets the same soft card. */
#view > h2:first-child, #view > .x-wrap > h2:first-child { background: var(--tint); border-radius: 32px; padding: 24px 32px; font-size: 38px; line-height: 1.1; margin: 0 0 20px; }
body.pn #view > h2:first-child { padding: 20px 22px; font-size: 30px; border-radius: 28px; }

/* iPad and small laptops: a narrower list on the left and tighter padding, so wide pages still fit. */
@media (min-width: 701px) and (max-width: 1100px) {
  .shell { grid-template-columns: 196px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px 24px; }
  .sidenav a { padding: 0 14px; font-size: 16px; min-height: 46px; }
  main { padding: 18px 22px; }
  #subnav { padding: 18px 22px 0; }
  .page-head, .x-head { padding: 20px 24px; border-radius: 28px; }
  .page-head h2, .x-head h2 { font-size: 34px; }
}

/* ── Row cards, the mockup way: bubble + name, status pill, three numbers, chevron; the rest opens on tap ── */
@media all {
  .cards tr[data-px-row] { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 16px 20px; border-radius: 26px; }
  .cards tr[data-px-row] td { display: none; }
  .cards tr[data-px-row] td.px-title, .cards tr[data-px-row] td.px-pill, .cards tr[data-px-row] td.px-key, .cards tr[data-px-row] td.px-morecell { display: flex; }
  .cards tr[data-px-row] td.px-title { flex: 1 1 200px; min-width: 0; font-size: 18px; font-weight: 800; flex-direction: row; align-items: center; gap: 12px; }
  .cards tr[data-px-row] td.px-title::before { content: attr(data-initial); display: grid !important; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-strong, var(--accent)); font-family: var(--font-display, inherit); font-size: 20px; text-transform: none; letter-spacing: 0; }
  .cards tr[data-px-row] td.px-pill { flex: none; }
  .cards tr[data-px-row] td.px-pill::before, .cards tr[data-px-row] td.px-morecell::before { display: none; }
  .cards tr[data-px-row] td.px-pill { align-items: flex-start; }
  /* the pill keeps its own status color (expired red, good green); only its size changes */
  .cards tr[data-px-row] td.px-pill .badge { font-size: 14px; font-weight: 800; padding: 7px 14px; border-radius: 999px; }
  .cards tr[data-px-row] td.px-pill .badge[class="badge"] { border: 0; background: var(--accent-soft); color: var(--accent-strong, var(--accent)); }
  .cards tr[data-px-row] td.px-key { flex: none; min-width: 78px; font-family: var(--font-display, inherit); font-size: 21px; font-weight: 600; }
  .cards tr[data-px-row] td.px-key::before { font-family: inherit; font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; white-space: nowrap; }
  .cards tr[data-px-row] td.px-morecell { flex: none; margin-left: auto; }
  .px-more { all: unset; box-sizing: border-box; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; font-size: 28px; color: var(--faint, var(--muted)); border-radius: 50%; transition: transform .15s; }
  .px-more:hover { background: var(--panel-sunk); }
  tr.px-open .px-more { transform: rotate(90deg); }
  .cards tr[data-px-row].px-open td { display: flex; }
  .cards tr[data-px-row].px-open td.px-title { flex-basis: 100%; }
  .cards tr[data-px-row].px-open td:not(.px-title):not(.px-pill):not(.px-key):not(.px-morecell) { flex: 1 1 150px; font-size: 16px; }
  .cards tr[data-px-row].px-open td.blank { display: none; }
}
/* Every card in a list uses the same widths for the pill and key facts (cards.js measures them), so labels line up. */
@media (min-width: 701px) {
  .cards table.px-aligned tr[data-px-row] td.px-pill { flex: 0 0 var(--pxp, auto); }
  .cards table.px-aligned tr[data-px-row] td.px-k0 { flex: 0 0 var(--pxk0, auto); }
  .cards table.px-aligned tr[data-px-row] td.px-k1 { flex: 0 0 var(--pxk1, auto); }
  .cards table.px-aligned tr[data-px-row] td.px-k2 { flex: 0 0 var(--pxk2, auto); }
  .cards tr[data-px-row] td.px-title { order: 0; }
  .cards tr[data-px-row] td.px-pill { order: 1; }
  .cards tr[data-px-row] td.px-k0 { order: 2; } .cards tr[data-px-row] td.px-k1 { order: 3; } .cards tr[data-px-row] td.px-k2 { order: 4; }
  .cards tr[data-px-row] td.px-morecell { order: 9; }
  .cards tr[data-px-row].px-open td:not(.px-title):not(.px-pill):not(.px-key):not(.px-morecell) { order: 10; }
}
@media (max-width: 700px) {
  .cards tr[data-px-row] td.px-key { min-width: 0; flex: 1 1 80px; font-size: 19px; }
  .cards tr[data-px-row] td.px-title { flex-basis: calc(100% - 140px); }
}

/* Phone: the older phone list rules are specific, so the mockup row card repeats the selectors with more weight. */
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 14px 14px 16px; border-radius: 22px; background: var(--panel); }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td { display: none !important; }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-title { display: flex !important; flex: 1 1 calc(100% - 150px); width: auto; min-width: 0; overflow-wrap: anywhere; margin: 0; padding: 0; font-size: 17px; font-weight: 800; align-items: center; gap: 10px; color: var(--ink); }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-title::before { display: grid !important; content: attr(data-initial); margin: 0; width: 42px; height: 42px; font-size: 18px; font-weight: 700; color: var(--accent); }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-pill { display: flex !important; flex: none; width: auto; padding: 0; }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-pill::before, body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-morecell::before { display: none !important; }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-morecell { display: flex !important; flex: none; width: auto; padding: 0; margin-left: 0; }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-key { display: flex !important; width: auto; flex: 1 1 28%; flex-direction: column; gap: 1px; padding: 8px 0 0; font-size: 19px; font-weight: 600; font-family: var(--font-display, inherit); color: var(--ink); line-height: 1.2; order: 5; }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-key::before { display: block !important; content: attr(data-label) !important; padding: 0 !important; margin: 0; font: 700 13px var(--font-body, inherit); color: var(--muted); }
body.pn .table-wrap.cards tr[data-px-row].px-open:not(.grp) td:not(.px-title):not(.px-pill):not(.px-key):not(.px-morecell):not(.blank) { display: flex !important; flex: 1 1 100%; order: 9; font-size: 15px; gap: 8px; }
body.pn .table-wrap.cards tr[data-px-row].px-open:not(.grp) td:not(.px-title):not(.px-pill):not(.px-key):not(.px-morecell)::before { display: inline !important; content: attr(data-label) !important; flex: 0 0 96px; padding: 0 !important; font-size: 13px; }
.cards tr[data-px-row] td.px-key.px-txt, body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-key.px-txt { font-family: var(--font-body, inherit); font-size: 16px; font-weight: 700; }

/* ── Home "needs you": ranked, big, one card per item (mockup) ── */
.home-band .band-head { text-transform: none; letter-spacing: 0; color: var(--ink); font-family: var(--font-display, inherit); font-size: 28px; font-weight: 600; margin: 8px 4px 12px; }
.home-band .nqs, body.pn .home-band .nqs, body.pn .nqs { display: flex; flex-direction: column; gap: 10px; background: none; border: 0; box-shadow: none; overflow: visible; border-radius: 0; }
.home-band .nq, body.pn .home-band .nq { grid-template-columns: 64px minmax(0, 1fr) 24px; gap: 16px; align-items: center; padding: 14px 22px 14px 14px; border: 0; background: var(--panel); border-radius: 26px; min-height: 84px; }
.home-band .nq:hover { background: var(--panel-sunk); }
.home-band .nq-n { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display, inherit); font-size: 22px; font-weight: 600; }
.home-band .nq.risk .nq-n { background: var(--error-soft, #fbe9ea); color: var(--error); }
.home-band .nq.warn .nq-n { background: var(--warn-soft, #fff1bf); color: var(--warn); }
.home-band .nq-label { font-weight: 800; font-size: 19px; line-height: 1.3; }
.home-band .nq-detail { font-weight: 600; font-size: 15.5px; }
.home-band .nq-go { font-size: 26px; color: var(--faint, var(--muted)); }
@media (min-width: 701px) { .home-band .nqs { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); } }
.cards td.px-title a { text-decoration: none; color: inherit; }

/* page jump under the search box */
#search-form { position: relative; }
#jump { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60; background: var(--panel); border-radius: 22px; padding: 8px; box-shadow: 0 18px 48px rgba(0, 32, 91, .18); min-width: 300px; }
#jump .jump-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 16px; color: var(--ink); text-decoration: none; }
#jump .jump-row b { font-weight: 800; font-size: 16px; }
#jump .jump-row span { font-weight: 700; font-size: 13px; color: var(--muted); }
#jump .jump-row:hover, #jump .jump-row.on { background: var(--accent-soft); }

/* the swipe strip must clip its own (i) tooltips or they widen the page */
@media (max-width: 700px) { .totals { position: relative; } }

body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-key { min-width: 0; }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-key::before { white-space: normal !important; overflow-wrap: anywhere; font-size: 12.5px !important; }

/* ── Phone bottom bar, the mockup way: six sections, the current one sits on a blue pill ── */
body.pn #app-view:not([hidden]) ~ .pn-tabs { padding: 8px 2px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg); box-shadow: 0 -2px 0 var(--line); }
.pn-tabs a { gap: 4px; min-height: 54px; font-size: 11.5px; font-weight: 800; color: var(--muted); justify-content: center; }
.pn-tabs a .pn-tab-ic { position: relative; display: grid; place-items: center; width: 46px; height: 30px; border-radius: 999px; background: transparent; }
.pn-tabs a svg { width: 22px; height: 22px; stroke-width: 2.4; }
body.pn .pn-tabs a.on { color: var(--ink); }
.pn-tabs a.on .pn-tab-ic { background: var(--sky); }
.pn-tabs a.on svg { stroke: #00205b; }
html[data-theme="dark"] .pn-tabs a.on svg { stroke: var(--ink); }
.pn-tabs .pn-badge { top: -6px; left: auto; right: -4px; }

/* Section screen: plain big title, page count, tiles (mockup) */
body.pn .pn-sechead { margin: 4px 2px 14px; }
body.pn .pn-sechead h2 { margin: 0; font-family: var(--font-display, inherit); font-size: 32px; line-height: 1.08; font-weight: 600; color: var(--ink); }
body.pn .pn-sechead .sub { margin: 6px 0 0; font-weight: 700; font-size: 15px; color: var(--muted); }
body.pn .pn-tile { border-radius: 24px; background: var(--panel); border: 3px solid transparent; }
body.pn .pn-tile-ic { background: var(--sky); }
body.pn .pn-you { margin: 8px 0 24px; display: flex; flex-direction: column; gap: 8px; }
body.pn .pn-you .pn-chip { all: unset; box-sizing: border-box; cursor: pointer; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 15.5px; }

/* One home per chart: where a chart is not at home, a one-line dashed link card sits in its grid slot. */
.x-elsewhere { display: flex; align-items: center; box-sizing: border-box; min-height: 44px; padding: 10px 16px; margin: 0 0 12px; align-self: start; min-width: 0;
  border: 1px dashed var(--n-300); border-radius: var(--r-lg); background: transparent; color: var(--accent); font-size: var(--fs-base); font-weight: 700; text-decoration: none; }
.x-elsewhere:hover { background: var(--accent-soft); color: var(--accent-hover); }
.x-elsewhere:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.x-grid > .x-elsewhere, .x-elsewhere-stack > .x-elsewhere { margin: 0; }
.x-elsewhere-stack { display: grid; gap: 12px; align-content: start; min-width: 0; }

/* RR-X: export links (anchors) look like the pill buttons beside them. */
a.x-pillbtn { display: inline-flex; align-items: center; text-decoration: none; }
.rrx-export { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }

/* Row cards: a title cell holding a name plus a sub-line stays one stacked block, and numbers in a key cell may wrap instead of running over the next one (phone). */
.cards tr[data-px-row] td.px-titletx, .cards tr[data-px-row] .px-titletx { display: block; flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
body.pn .table-wrap.cards tr[data-px-row]:not(.grp) td.px-key { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.cards tr[data-px-row] .px-titletx .muted, .cards tr[data-px-row] .px-titletx .small { font-size: 14px; font-weight: 500; }

/* Redesign V2 (phase 1): the shared masthead and card look, the desktop header, and Home.
   Loaded last, so it only adds to redesign.css. Colours come from the --n-* / --x-* tokens (light, dark and Graphite
   follow Appearance); the masthead is navy in every mode, so its few colours are fixed values on that navy.
   Nothing here touches the phone layout (max-width 700px). */

/* ── Tokens ───────────────────────────────────────────────────────────────── */
html {
  --v2-band: #0f2a52; --v2-tile: #15386b; --v2-band-line: #26487a; --v2-band-ink: #b9d3f3; --v2-kick: #9cc7f7;
  --v2-page: var(--panel); --v2-card: var(--n-0);
  --v2-red: #e5484d; --v2-orange: var(--x-c2); --v2-blue: var(--x-c1);
  --v2-kick-orange: #b45309; --v2-kick-red: #b42318; --v2-late: #b42318; --v2-soon: #8a4b08;
}
/* Graphite: the band turns grey with the accent. */
html[data-accent="graphite"] { --v2-band: hsl(215 18% 14%); --v2-tile: hsl(215 12% 21%); --v2-band-line: hsl(215 8% 32%); --v2-band-ink: hsl(215 10% 80%); --v2-kick: hsl(215 12% 76%); }
html[data-theme="dark"] {
  --v2-page: var(--bg); --v2-kick-orange: #f0a35c; --v2-kick-red: #ff8a84; --v2-late: #ff8a84; --v2-soon: #f3c86b;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) { --v2-page: var(--bg); --v2-kick-orange: #f0a35c; --v2-kick-red: #ff8a84; --v2-late: #ff8a84; --v2-soon: #f3c86b; }
}

/* ── Segment and bar tones ────────────────────────────────────────────────── */
.v2-tone-sky { background: #9cc7f7; } .v2-tone-blue { background: #4f8fdc; } .v2-tone-green { background: #5fd08a; }
.v2-tone-purple { background: #c7b8f5; } .v2-tone-grey { background: #95a1b3; }
.v2-tone-orange { background: var(--v2-orange); } .v2-tone-red { background: var(--v2-red); }
.v2-segbar .v2-tone-orange { background: #f0a35c; } .v2-segbar .v2-tone-red { background: #f87171; }

/* ── Masthead ─────────────────────────────────────────────────────────────── */
.v2-wrap { box-sizing: content-box; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.v2-masthead { background: var(--v2-band); color: #fff; }
.v2-masthead .v2-wrap { padding-top: 30px; display: flex; flex-direction: column; gap: 22px; }
.v2-kicker { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--v2-kick); }
.v2-headline { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.12; max-width: 1040px; text-wrap: pretty; color: #fff; letter-spacing: -.01em; }
.v2-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; background: var(--v2-band-line); border-radius: 16px 16px 0 0; overflow: hidden; }
.v2-tiles-none { height: 18px; }
.v2-tile { background: var(--v2-tile); padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; color: #fff; text-decoration: none; }
a.v2-tile:hover { background: color-mix(in srgb, var(--v2-tile) 88%, #fff); color: #fff; }
.v2-tile-l { font-size: 12px; font-weight: 700; color: var(--v2-band-ink); display: flex; align-items: center; gap: 6px; }
.v2-tile-l .x-fx { border-color: var(--v2-band-ink); color: var(--v2-band-ink); }
.v2-tile-v { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.v2-tile-u { font-size: 15px; color: var(--v2-band-ink); }
.v2-tile-s { font-size: 12px; color: var(--v2-band-ink); }
.v2-segbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--v2-band-line); }
.v2-seg { display: block; height: 100%; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.v2-card, .v2-home .card { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; box-shadow: none; }
.v2-home .card { display: block; margin: 0; }
.v2-home .card .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.v2-home .card h3 { font-size: 20px; margin: 0; }
.v2-card[hidden] { display: none; }
.v2-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.v2-card-head h2, .v2-sec-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); background: none; padding: 0; }
.v2-card-aside { display: flex; gap: 14px; align-items: baseline; }
.v2-meta { font-size: 12px; color: var(--muted); }
.v2-link, .v2-linkbtn { font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; color: var(--v2-blue); }
.v2-linkbtn { all: unset; cursor: pointer; font-size: 13px; font-weight: 800; color: var(--v2-blue); }
.v2-linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.v2-foot { font-size: 13px; color: var(--ink-2); }
.v2-foot a { color: var(--muted); text-decoration: none; }

.v2-rows { display: flex; flex-direction: column; }
.v2-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.v2-row:first-child { border-top: 0; padding-top: 0; }
.v2-row-lead { flex: none; min-width: 34px; font-size: 12px; font-weight: 800; color: var(--muted); }
.v2-row-lead.bad { color: var(--v2-late); } .v2-row-lead.warn { color: var(--v2-soon); }
.v2-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.v2-row-main a { color: var(--ink); text-decoration: none; }
.v2-row-main a:hover { text-decoration: underline; }
.v2-row-sub { display: block; font-size: 12px; color: var(--muted); }
.v2-row-right { flex: none; text-align: right; display: flex; flex-direction: column; }

.v2-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--n-100); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.v2-chip.bad { background: var(--x-bad-soft); color: var(--x-bad); }
a.v2-chip:hover { background: var(--n-200); }

/* Calendar date tiles */
.v2-dates { display: flex; flex-direction: column; gap: 12px; }
.v2-date { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); text-decoration: none; font-size: 14px; }
.v2-datetile { flex: 0 0 50px; border-radius: 10px; background: var(--accent-soft); color: var(--v2-blue); text-align: center; padding: 6px 0; display: flex; flex-direction: column; }
.v2-datetile.soon { background: var(--v2-band); color: #fff; }
.v2-dt-m { font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.v2-datetile.soon .v2-dt-m { color: var(--v2-kick); }
.v2-dt-d { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1; }
.v2-date-t { min-width: 0; display: flex; flex-direction: column; }

/* ── Home ─────────────────────────────────────────────────────────────────── */
main#view:has(> .v2-home) { padding: 0; max-width: none; }
.v2-home { background: var(--v2-page); min-height: 70vh; }
.v2-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding-top: 28px; padding-bottom: 64px; align-items: start; }
.v2-main, .v2-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.v2-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.v2-sec-head h2 { font-size: 24px; }
.v2-decide-sec { display: flex; flex-direction: column; }
.v2-decide-big, .v2-decide-pair { display: flex; flex-direction: column; gap: 14px; }
.v2-decide-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.v2-decide { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v2-decide-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.v2-decide-top > div:first-child { min-width: 0; }
.v2-kick { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.v2-kick.orange { color: var(--v2-kick-orange); } .v2-kick.red { color: var(--v2-kick-red); }
.v2-decide h3 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.25; }
.v2-decide h3 a { color: var(--ink); text-decoration: none; }
.v2-decide h3 a:hover { text-decoration: underline; }
.v2-amt { text-align: right; flex: none; display: flex; flex-direction: column; }
.v2-amt b { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.v2-decide:not(.big) .v2-amt { text-align: left; flex-direction: row; align-items: baseline; gap: 6px; order: 0; }
.v2-decide:not(.big) .v2-decide-top { flex-direction: column; gap: 4px; }
.v2-decide:not(.big) .v2-amt b { font-size: 24px; }
.v2-amt span { font-size: 12px; color: var(--muted); }
.v2-bar { height: 10px; border-radius: 5px; background: var(--n-100); overflow: hidden; }
.v2-bar span { display: block; height: 100%; border-radius: 5px; }
.v2-btn { align-self: flex-start; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; text-decoration: none; }
.v2-btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.v2-decide:not(.big) .v2-btn { display: none; }   /* the small cards are one link: the kicker row opens the page via the foot text below */

.v2-task { display: grid; grid-template-columns: 22px 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.v2-task:first-of-type { border-top: 1px solid var(--line-soft); }
.v2-task input { margin: 0; }
.v2-task-title { all: unset; cursor: pointer; font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.35; }
button.v2-task-title:hover { text-decoration: underline; }
.v2-task > a { font-size: 12px; color: var(--muted); text-decoration: none; text-align: right; }
.v2-tasks .v2-foot { padding-top: 4px; }

.v2-around { padding: 18px 22px 16px; }
.v2-around .mi-rail-card { background: none; border: 0; padding: 0; box-shadow: none; }
.v2-extras:empty { display: none; }
.v2-extras { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1000px) { .v2-cols { grid-template-columns: minmax(0, 1fr); } .v2-side { order: -1; } }
@media (min-width: 701px) and (max-width: 940px) {
  .v2-headline { font-size: 32px; }
  .v2-tiles { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-decide-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ── Desktop and iPad header: white bar with the logo and section tabs, then the sub-tab row, then pills ──── */
.v2-acct { display: none; }
@media (min-width: 701px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .topbar { min-height: 60px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .topbar .toptabs a { font-size: 15px; font-weight: 700; color: var(--ink-2); }
  .topbar .toptabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
  .top-brand img { height: 34px; }
  .topbar #search-input { min-height: 40px; }
  .appearance-btn, .v2-acct { width: 40px; height: 40px; }
  .v2-acct { display: grid; place-items: center; flex: none; padding: 0; border-radius: 50%; background: var(--panel); color: var(--ink); border: 0; cursor: pointer; }
  .v2-acct:hover { background: var(--panel-sunk); }

  /* The section's pages move from a list down the left to a row under the header. */
  .sidenav { display: none; }
  #subnav, #subnav:not(:empty), #subnav:not(:has(.x-pills)) { display: block; grid-column: 1; grid-row: 2; padding: 0; max-width: none; width: 100%; background: var(--bg); }
  #subnav:empty { display: none; }
  #subnav .x-sub { display: flex; gap: 4px; box-sizing: content-box; max-width: 1240px; margin: 0 auto; padding: 0 28px; overflow-x: auto; scrollbar-width: none;
    border-bottom: 0; }
  #subnav:not(:empty) { border-bottom: 1px solid var(--line); }
  #subnav:not(:empty) + main { padding-top: 24px; }
  #subnav .x-sub a { padding: 12px 14px; font-size: 14px; font-weight: 700; color: var(--muted); border-radius: 0; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
    white-space: nowrap; text-decoration: none; background: none; min-height: 0; }
  #subnav .x-sub a:hover { color: var(--ink); }
  #subnav .x-sub a.on { color: var(--v2-blue); font-weight: 800; border-bottom-color: var(--v2-blue); }
  #subnav .x-pills { box-sizing: content-box; max-width: 1240px; margin: 0 auto; padding: 12px 28px; gap: 8px; background: var(--bg); }
  #subnav .x-pills a { min-height: 34px; padding: 0 14px; font-size: 13px; border-width: 1px; border-color: var(--n-300); }
  #subnav .x-pills a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

  main#view { grid-column: 1; grid-row: 3; max-width: 1296px; margin: 0 auto; padding: 24px 28px; box-sizing: border-box; }

  /* The sidebar's foot (who you are, account, team, sign out) becomes a menu opened from the header. */
  .sidebar { display: none; position: fixed; top: 64px; right: 20px; left: auto; width: 250px; height: auto; max-height: calc(100vh - 80px); z-index: 60; padding: 16px 18px;
    background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--e-2); overflow-y: auto; }
  .shell.v2-acct-open .sidebar { display: block; }
  .sidebar > *:not(.sidebar-foot) { display: none !important; }
  .sidebar .sidebar-foot { border-top: 0; display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; position: static; }
}
@media (min-width: 701px) and (max-width: 1100px) { .shell { grid-template-columns: minmax(0, 1fr); } main#view { padding: 18px 22px; } }
/* iPad: six section tabs, the search box and three buttons share one bar, so the search narrows and the tabs tighten. */
@media (min-width: 701px) and (max-width: 1100px) {
  .topbar { gap: 8px; padding: 0 14px; }
  .topbar .toptabs a { padding: 0 9px; font-size: 14px; }
  .topbar #search-form { flex: 0 1 130px; }
  .topbar #search-input { padding: 0 14px; }
}

/* Recent notes on Home: two lines per note, line breaks folded so a long note cannot take over the page. */
.v2-notes .note-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.v2-notes .note-body br { display: none; }

/* ═══ Phase 2: Property Management pages ═══════════════════════════════════════ */
/* A V2 page fills the content area edge to edge; the masthead and body inside it set their own width. */
#subnav:not(:empty) + main#view:has(> .v2-page), main#view:has(> .v2-page) { padding: 0; max-width: none; }
.v2-page { background: var(--v2-page); min-height: 70vh; }
.v2-body { padding-top: 28px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.v2-g2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.v2-g12 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.v2-band { display: flex; flex-direction: column; gap: 24px; }
.v2-band:empty { display: none; }
.v2-band .x-grid { margin: 0; gap: 24px; }

/* Old renderers inside a V2 page: the big tinted title steps aside (the masthead says it), the action buttons stay. */
.v2-legacy > .page-head, .v2-legacy > .x-head { background: none; border-radius: 0; padding: 0; margin: 0 0 14px; justify-content: flex-end; min-height: 0; }
.v2-legacy > .page-head > div:first-child:not(.actions), .v2-legacy > .x-head > div:first-child:not(.actions) { display: none; }
.v2-legacy > .page-head:not(:has(button, a, .actions > *)), .v2-legacy > .x-head:not(:has(button, a, .actions > *)) { display: none; }
.v2-legacy > h2:first-child, .v2-legacy > .page-head > h2, .v2-legacy > .page-head > .sub { display: none; }
.v2-legacy .x-band { display: none; }
.v2-body > .v2-legacy { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; min-width: 0; }
.v2-legacy .card { background: none; border: 0; box-shadow: none; padding: 0; margin: 0 0 18px; }
.v2-legacy .card > h3, .v2-legacy .card-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.v2-page .x-card { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; box-shadow: none; }
.v2-page .x-card > header h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; }

/* Card text used by the PM pages */
.v2-subhead { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.v2-foot { margin: 0; line-height: 1.5; }
.v2-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.v2-key span { display: inline-flex; align-items: center; gap: 6px; }
.v2-key i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.v2-key b { color: var(--ink); }
.v2-pipebar .v2-segbar { height: 10px; background: var(--n-100); }
.v2-tone-amber { background: #e9b520; }

/* Renewal pipeline rows */
.v2-rens { display: flex; flex-direction: column; }
.v2-ren { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto auto; gap: 12px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.v2-ren-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-ren-name { font-weight: 800; font-size: 15px; color: var(--ink); text-decoration: none; }
.v2-ren-name:hover { text-decoration: underline; }
.v2-ren-note { font-size: 12px; font-weight: 800; color: var(--v2-late); }
.v2-ren-money { text-align: right; display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.v2-ren-money b { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.v2-ren-money .x-fx { vertical-align: middle; }
.v2-status { min-height: 34px; border-radius: 8px; font-size: 12px; font-weight: 800; padding: 0 26px 0 10px; border: 1px solid var(--n-300); background-color: var(--n-100); color: var(--ink); width: auto; margin: 0; }
.v2-status.red { background-color: var(--x-bad-soft); color: var(--x-bad); border-color: transparent; }
.v2-pill { display: inline-block; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; background: var(--n-100); color: var(--ink); }
.v2-pill.red { background: var(--x-bad-soft); color: var(--x-bad); }

/* Rows with a bar: occupancy, vacant space */
.v2-orows, .v2-vrows { display: flex; flex-direction: column; }
.v2-orow, .v2-vrow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 44px; gap: 14px; align-items: center; padding: 9px 0; color: var(--ink); text-decoration: none; }
.v2-orow:hover .v2-vname b, .v2-vrow:hover .v2-vname b { text-decoration: underline; }
.v2-vname { display: flex; flex-direction: column; min-width: 0; }
.v2-vname b { font-size: 14px; }
.v2-vbar { height: 9px; border-radius: 5px; background: var(--n-100); overflow: hidden; display: block; }
.v2-vbar span { display: block; height: 100%; border-radius: 5px; background: var(--v2-blue); }
.v2-vbar span.hot { background: #e0872e; } .v2-vbar span.ok { background: var(--v2-blue); }
.v2-vdays { text-align: right; font-weight: 800; font-size: 14px; }

/* Tenant insurance bar: four links, each filters the certificates page */
.v2-insbar { display: flex; gap: 2px; height: 34px; border-radius: 8px; overflow: hidden; }
.v2-inseg { display: flex; align-items: center; justify-content: center; min-width: 26px; font-size: 13px; font-weight: 800; color: #fff; text-decoration: none; }
.v2-inseg.red { background: #d9363e; } .v2-inseg.orange { background: #d97a1c; } .v2-inseg.amber { background: #c99a0a; } .v2-inseg.green { background: #2e9d5b; }
.v2-inseg:hover { filter: brightness(1.1); }

@media (max-width: 1100px) { .v2-g2, .v2-g12 { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 701px) and (max-width: 940px) { .v2-ren { grid-template-columns: 50px minmax(0, 1fr) auto; } .v2-ren-status { grid-column: 2 / -1; } }
.v2-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.v2-facts > div { display: flex; flex-direction: column; gap: 4px; }
.v2-facts b { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.v2-vname b, .v2-ren-name { font-weight: 700; }
@media (max-width: 700px) { .v2-facts { grid-template-columns: 1fr; } }
.v2-legacy .map-head h1 { display: none; }
.v2-legacy .map-head { margin: 0 0 8px; }

/* ═══ Phase 2b: the property hub ═══════════════════════════════════════════════ */
.v2-hubhead { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.v2-hubline { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; }
.v2-hubline a { color: var(--ink-2); }
.v2-hubline .v2-back { font-weight: 800; color: var(--v2-blue); text-decoration: none; }
.v2-hubhead .actions { display: flex; gap: 8px; margin-left: auto; }
.v2-hub .x-lens { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0; padding: 0; background: none; scrollbar-width: none; }
.v2-hub .x-lens a { padding: 10px 14px; font-size: 14px; font-weight: 700; color: var(--muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; margin-bottom: -1px; background: none; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; min-height: 0; }
.v2-hub .x-lens a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.v2-hub .x-lens a.on { color: var(--v2-blue); font-weight: 800; border-bottom-color: var(--v2-blue); }
.v2-hub .x-lens a:hover { color: var(--ink); }
.v2-hubpills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.v2-hubpills a { min-height: 34px; padding: 0 14px; font-size: 13px; border-width: 1px; border-color: var(--n-300); }
.v2-hubbody { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.v2-gside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.v2-hubmain, .v2-hubside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.v2-lensbody { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.v2-lensbody > .card, .v2-lensbody > div > .card { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; box-shadow: none; }
.v2-lensbody .x-grid { margin: 0; gap: 18px; }
.v2-tag { align-self: flex-start; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--n-100); color: var(--ink-2); margin-bottom: 3px; }
.v2-need { align-items: flex-start; }
.v2-need .v2-row-lead { min-width: 86px; padding-top: 18px; }
.v2-need .v2-task-title { font-size: 14px; text-align: left; }
.v2-row-main b { font-size: 14px; }
.v2-space .v2-vdays { min-width: 70px; }
.v2-spaces .v2-orow { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; }
.v2-bar-blue { background: #4f8fdc !important; } .v2-bar-orange { background: #e0872e !important; } .v2-bar-red { background: var(--v2-red) !important; }
.v2-market .mi-ring-wrap { margin: 0 auto; max-width: 300px; }
.v2-market .mi-ring-detail:empty { display: none; }
.v2-market .v2-row-lead { min-width: 48px; }
@media (max-width: 1100px) { .v2-gside { grid-template-columns: minmax(0, 1fr); } }
/* Needs you here: context items under the list, not counted as open */
.v2-fyi { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.v2-fyi > b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.v2-fyi p { margin: 2px 0; }

/* ── Redesign V2 phase 3: Asset Management ─────────────────────────────────── */
.v2-headline .x-fx { border-color: var(--v2-band-ink); color: var(--v2-band-ink); vertical-align: middle; }
.v2-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.v2-opps { display: flex; flex-direction: column; }
.v2-opp { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.v2-opp:first-child { border-top: 0; }
.v2-opp-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.v2-opp-title { font-size: 15px; }
.v2-opp-title a { color: var(--ink); text-decoration: none; } .v2-opp-title a:hover { text-decoration: underline; }
.v2-opp-right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.v2-opp-right b { font-size: 15px; }
.v2-tag.upside { background: var(--x-good-soft, #e3f6ea); color: var(--x-good, #1b7a43); }
.v2-tag.risk { background: var(--x-bad-soft); color: var(--x-bad); }
.v2-tag.gap { background: var(--n-100); color: var(--ink-2); }
.v2-linkcard { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px dashed var(--n-300); border-radius: 12px; text-decoration: none; color: var(--v2-blue); font-weight: 800; background: var(--v2-card); }
.v2-linkcard:hover { border-color: var(--v2-blue); }
.v2-incomes .v2-orow { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 64px; }
.v2-pairs { display: flex; flex-direction: column; }
.v2-pair { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) 150px; gap: 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.v2-pair:hover .v2-vname b { text-decoration: underline; }
.v2-pairbars { display: flex; flex-direction: column; gap: 5px; }
.v2-pairend { display: flex; flex-direction: column; text-align: right; }
.v2-vbar span.good { background: #34a661; }
@media (max-width: 1100px) { .v2-pair { grid-template-columns: minmax(0, 1fr); gap: 6px; } .v2-pairend { text-align: left; } }
@media print { .v2-page:has(.owner-wrap) .v2-masthead { display: none; } .v2-page:has(.owner-wrap) { background: none; } .v2-page .v2-body > .owner-wrap.v2-legacy { border: 0; padding: 0; background: none; } .v2-page:has(.owner-wrap) .v2-body { padding: 0; } }
.v2-nowrap { white-space: nowrap; }

/* match-spec: bodies built from mockup cards; the old page sits in an "All ..." card */
.v2-cgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .v2-cgrid { grid-template-columns: minmax(0, 1fr); } }
.v2-brows .v2-orow { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(48px, auto); padding: 6px 0; }
.v2-brows .v2-vname b { font-size: 13px; font-weight: 600; }
.v2-vbar span.bad { background: #f87171; }
.v2-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.v2-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.v2-all-head { margin-bottom: 14px; }

.v2-rtag { align-self: flex-start; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--n-100); color: var(--ink-2); margin: 2px 0; }
.v2-rtag.warn { background: #fdf0d9; color: #8a5a00; } .v2-rtag.risk { background: #fde8e8; color: #9b1c1c; } .v2-rtag.ok { background: #def5e6; color: #1b6b3a; }
html[data-theme="dark"] .v2-rtag.warn { background: #4a3a14; color: #f3d28a; } html[data-theme="dark"] .v2-rtag.risk { background: #4a1f1f; color: #f5b5b5; } html[data-theme="dark"] .v2-rtag.ok { background: #14402a; color: #a7e6c0; }

.v2-big { gap: 10px; }
.v2-big-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.v2-big-l { min-width: 0; } .v2-big-l h3 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; } .v2-big-l h3 a { color: var(--ink); text-decoration: none; } .v2-big-l h3 a:hover { text-decoration: underline; }
.v2-big-k { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); } .v2-big-k.risk { color: var(--v2-late, #b42318); } .v2-big-k.warn { color: var(--v2-soon, #b45309); } .v2-big-k.info { color: var(--v2-blue); }
.v2-big-r { text-align: right; flex: none; } .v2-big-amt { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--v2-blue); }
.v2-bigbar { height: 10px; border-radius: 5px; background: var(--n-100); overflow: hidden; } .v2-bigbar span { display: block; height: 100%; min-width: 4px; }
.v2-big-foot { font-size: 13px; color: var(--ink-2); }
.v2-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--v2-band); color: #fff; font-weight: 800; font-size: 13px; text-decoration: none; }
.v2-g21 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; } .v2-stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 1100px) { .v2-g21 { grid-template-columns: minmax(0, 1fr); } }
.v2-facts-1 { grid-template-columns: 1fr; }

.v2-ptiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .v2-ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.v2-ptile { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); text-decoration: none; min-width: 0; }
.v2-ptile:hover { border-color: var(--v2-blue); }
.v2-ptile-top, .v2-ptile-mid { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.v2-ptile-n { display: flex; flex-direction: column; min-width: 0; } .v2-ptile-n b { font-family: var(--font-display); font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-ptile-occ { font-size: 12px; font-weight: 800; } .v2-ptile-occ.green { color: #1b8a4a; } .v2-ptile-occ.orange { color: #c2701b; } .v2-ptile-occ.red { color: #b42318; } .v2-ptile-occ.grey { color: var(--muted); }
.v2-bigbar.thin { height: 6px; border-radius: 3px; } .v2-bigbar .v2-tone-green { background: #34a661; } .v2-bigbar .v2-tone-orange { background: #e0872e; } .v2-bigbar .v2-tone-red { background: #e5484d; }
.v2-chipbtn { font: inherit; font-weight: 800; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--v2-card); color: var(--ink); cursor: pointer; } .v2-chipbtn.on { background: var(--v2-band); color: #fff; border-color: var(--v2-band); }

.v2-agrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .v2-agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.v2-aname { font-family: var(--font-display); font-weight: 600; font-size: 17px; min-width: 0; }
.v2-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 13px; }
.v2-stat-k { font-size: 11px; font-weight: 700; color: var(--muted); } .v2-stat-v { font-weight: 800; } .v2-stat-v.bad { color: #b42318; }
.v2-aname, .v2-ptile-n b { color: var(--ink); }

.v2-ranges { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) 70px; gap: 10px 12px; align-items: center; }
.v2-range { position: relative; height: 12px; border-radius: 6px; background: var(--n-100); } .v2-range-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: #9cc7f7; } .v2-range-mark { position: absolute; top: -3px; width: 4px; height: 18px; border-radius: 2px; background: var(--v2-band); }

.v2-divkey { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.v2-divs { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) 90px; gap: 8px 12px; align-items: center; }
.v2-div { position: relative; height: 12px; background: var(--n-100); border-radius: 6px; } .v2-div::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--n-300); }
.v2-divbar { position: absolute; top: 0; bottom: 0; } .v2-divbar.neg { right: 50%; background: #e0872e; border-radius: 6px 0 0 6px; } .v2-divbar.pos { left: 50%; background: #34a661; border-radius: 0 6px 6px 0; }
a.v2-vname { text-decoration: none; color: var(--ink); } a.v2-vname:hover b { text-decoration: underline; }
@media print { .v2-noprint { display: none !important; } }
.v2-pillrow { padding-top: 22px; } .v2-pillrow .x-pills { margin: 0; }
.x-chart .x-val { font-weight: 700; fill: var(--ink); }
/* pills under the masthead: the same size as in the mockup (they lost the #subnav sizing when they moved) */
@media (min-width: 701px) {
  .v2-pillrow .x-pills { gap: 8px; }
  .v2-pillrow .x-pills a { min-height: 34px; padding: 0 14px; font-size: 13px; border-width: 1px; border-color: var(--n-300); }
  .v2-pillrow .x-pills a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
}

/* ═══ Phase 4: Development, Data, Calculations ═══════════════════════════════ */
.v2-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .v2-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.v2-bcol { background: var(--n-100); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v2-bcol-h { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.v2-bcol-h span { font-size: 12px; font-weight: 800; color: var(--muted); }
.v2-bcol.info .v2-bcol-h b { color: var(--v2-blue); } .v2-bcol.warn .v2-bcol-h b { color: var(--v2-soon, #b45309); } .v2-bcol.ok .v2-bcol-h b { color: #1b6b3a; }
html[data-theme="dark"] .v2-bcol.ok .v2-bcol-h b { color: #a7e6c0; }
.v2-mini { background: var(--v2-card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none; min-width: 0; }
.v2-mini:hover { border-color: var(--v2-blue); }
.v2-mini b { font-size: 14px; } .v2-row-sub.late { color: var(--v2-late, #b42318); font-weight: 700; }
.v2-bare.v2-legacy, .v2-body > .v2-bare.v2-legacy { background: none; border: 0; padding: 0; }
.v2-bare .card { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; margin: 0 0 18px; box-shadow: none; }
.v2-bare .card.frm-card { margin: 0; }
.v2-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .v2-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
button.v2-kind { text-align: left; font: inherit; cursor: pointer; gap: 6px; padding: 14px 16px; color: var(--ink); }
button.v2-kind:hover { background: var(--v2-card); border-color: var(--v2-blue); }
.v2-kind-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.v2-bare .calc-card { background: var(--n-100); border-color: transparent; }
.v2-bare .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.v2-bcol.info { background: #eaf2fc; } .v2-bcol.warn { background: #fdf3e2; } .v2-bcol.ok { background: #e6f5ec; }
html[data-theme="dark"] .v2-bcol.info { background: #1c2a3d; } html[data-theme="dark"] .v2-bcol.warn { background: #3a2f18; } html[data-theme="dark"] .v2-bcol.ok { background: #17352a; }
.v2-pillrow.v2-pillrow-in { max-width: none; padding: 16px 0 0; }

/* COSTBOOK-1: pay applications card and budget-line source lines on the development project page */
.dev-payapps tr.dev-unpaid td { background: #fdf3e2; }
html[data-theme="dark"] .dev-payapps tr.dev-unpaid td { background: #3a2f18; }
.dev-payapps .dev-note { max-width: 46ch; white-space: normal; line-height: 1.35; }
.dev-source, .dev-payapps td.small { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 640px) { .dev-payapps .dev-note { max-width: none; } .dev-payapps .table-wrap { overflow-x: auto; } }

/* COSTBOOK-1b: readable development project page */
.cb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; font-size: 13px; }
.cb-top .actions { margin: 0; }
.cb-page .v2-body { padding-top: 18px; }
.cb-meta { display: inline-flex; gap: 8px; }
.cb-scroll { overflow-x: auto; }
.cb-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.cb-table th, .cb-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.cb-table th { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.cb-table .num, .cb-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-table tr.cb-section th { padding-top: 16px; color: var(--ink); border-bottom: 2px solid var(--ink); }
.cb-table tr.cb-group td { font-weight: 800; font-size: 13px; color: var(--muted); background: var(--n-100); border-bottom: 0; }
.cb-table tr.cb-sub td { font-weight: 700; border-top: 1px solid var(--muted); }
.cb-table tr.cb-total td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
.cb-table tr.cb-grand td { font-size: 15px; }
.cb-table tr.cb-line:hover td { background: var(--n-100); cursor: pointer; }
.cb-table td.cb-i { width: 28px; padding-left: 0; padding-right: 4px; }
.cb-table td.cb-src { max-width: 340px; overflow-wrap: anywhere; word-break: break-word; }
.cb-warn { color: var(--v2-soon); font-weight: 700; }
.cb-bad, td.cb-bad { color: var(--v2-late); font-weight: 800; }
.cb-unpaid td { background: #fdf3e2; }
html[data-theme="dark"] .cb-unpaid td { background: #3a2f18; }
.cb-questions { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.cb-details > summary { cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; list-style: none; }
.cb-details > summary::-webkit-details-marker { display: none; }
.cb-details > summary h2 { margin: 0; }
.cb-details[open] > summary { margin-bottom: 14px; }
.cb-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) { .cb-table td.cb-src { max-width: 220px; } .cb-details > summary .v2-meta { display: none; } }

/* COSTBOOK-1c: Construction costs page, cost breakdown and capital stack cards */
.cc-page .v2-body { display: flex; flex-direction: column; gap: 20px; }
.cc-filters { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 14px 26px; align-items: flex-end; padding: 16px 20px; }
.cc-ctl { display: flex; flex-direction: column; gap: 6px; }
.cc-lbl { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.cc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-pill { font: inherit; font-size: 13px; font-weight: 800; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--card, transparent); color: var(--ink); cursor: pointer; }
.cc-pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cc-pill:hover:not(:disabled):not(.on) { background: var(--panel-sunk, var(--accent-soft)); color: var(--ink); }
.cc-pill:disabled { opacity: .45; cursor: not-allowed; }
.cc-ppi { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; align-items: center; min-height: 40px; font-size: 14px; font-weight: 700; opacity: .7; }
.cc-stack { display: flex; flex-direction: column; gap: 12px; }
.cc-bar-row { display: grid; grid-template-columns: 210px 1fr 80px; gap: 12px; align-items: center; }
.cc-bar-total { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-bar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; }
.cc-bar-sm { height: 30px; }
.cc-seg { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; }
.cc-seg-t { padding: 0 6px; }
.cc-seg-land, .cc-src-land { background: hsl(215 10% 46%); }
.cc-seg-site { background: #1f8a63; }
.cc-seg-building, .cc-src-loan { background: #1f4fa3; }
.cc-seg-gc { background: #4a82cf; }
.cc-seg-softfin, .cc-src-cash { background: #b97d12; }
.cc-seg-soft, .cc-seg-financing { background: #b97d12; }
.cc-seg-unmapped { background: hsl(215 10% 60%); }
html[data-theme="dark"] .cc-seg-land, html[data-theme="dark"] .cc-src-land { background: hsl(215 12% 58%); color: #0b1220; }
html[data-theme="dark"] .cc-seg-site { background: #4fc79b; color: #0b1220; }
html[data-theme="dark"] .cc-seg-building, html[data-theme="dark"] .cc-src-loan { background: #6ea8f0; color: #0b1220; }
html[data-theme="dark"] .cc-seg-gc { background: #9ec5f4; color: #0b1220; }
html[data-theme="dark"] .cc-seg-softfin, html[data-theme="dark"] .cc-src-cash, html[data-theme="dark"] .cc-seg-soft, html[data-theme="dark"] .cc-seg-financing { background: #e8b93a; color: #0b1220; }
.cc-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.cc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.cc-table td.m, .cc-table .m { color: var(--muted); }
.cc-table td.cc-strong, .cc-table td.num.cc-strong { font-weight: 800; }
.cc-barcell { width: 150px; min-width: 110px; }
.cc-rbar { height: 10px; border-radius: 5px; min-width: 2px; }
.cc-detail { font-size: 12px; color: var(--muted); font-weight: 600; }
.cc-tag { font-size: 12px; font-weight: 800; color: #8a4b08; background: #fdf1e3; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
html[data-theme="dark"] .cc-tag { color: #f0c27a; background: #3a2f18; }
.cc-foot { line-height: 1.5; margin: 10px 0 0; }
.cc-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cc-fact { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cc-fact-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cc-alt { font-size: 15px; color: var(--muted); font-weight: 600; }
.cc-src { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.cc-cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 16px; }
.cc-recon { display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; }
.cc-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.cc-big { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.cc-big-row { display: grid; grid-template-columns: 170px 1fr 64px; gap: 10px; align-items: center; }
.cc-big-row b { text-align: right; font-variant-numeric: tabular-nums; }
.cc-market { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.cc-ov { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cc-ov-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-decoration: none; color: var(--ink); }
.cc-ov-card:hover { background: var(--n-100); }
.cc-ov-fig { display: flex; gap: 22px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cc-ov-fig small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.cc-flags { margin: 0; padding-left: 18px; font-size: 13px; color: var(--v2-late); font-weight: 700; }
@media (max-width: 760px) {
  .cc-facts { grid-template-columns: 1fr 1fr; }
  .cc-bar-row { grid-template-columns: 1fr; gap: 6px; }
  .cc-bar-total { text-align: left; }
  .cc-big-row { grid-template-columns: 110px 1fr 56px; }
  .cc-filters { padding: 14px; }
}


/* Account menu rows: icon + label (index.html .sidebar-foot). */
.acct-item { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.acct-item .acct-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.acct-item[hidden] { display: none !important; }
@media (min-width: 701px) {
  .sidebar .sidebar-foot { gap: 2px; }
  .sidebar .sidebar-foot #user-role { margin-bottom: 8px; }
  .sidebar .sidebar-foot a.acct-item, .sidebar .sidebar-foot button.acct-item { display: flex; gap: 10px; text-decoration: none; color: var(--ink); width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; text-align: left; }
  .sidebar .sidebar-foot .acct-item:hover, .sidebar .sidebar-foot .acct-item.active { background: var(--panel); }
  .sidebar .sidebar-foot .acct-item:hover .acct-ico { color: var(--ink); }
  .sidebar .sidebar-foot #logout { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 12px; }
}

/* occupancy colors on a dark page: the light-page hex values are too dim there, so dark uses the theme tokens */
html[data-theme="dark"] .v2-ptile-occ.green { color: var(--good); } html[data-theme="dark"] .v2-ptile-occ.orange { color: var(--warn); } html[data-theme="dark"] .v2-ptile-occ.red { color: var(--error); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .v2-ptile-occ.green { color: var(--good); } html:not([data-theme]) .v2-ptile-occ.orange { color: var(--warn); } html:not([data-theme]) .v2-ptile-occ.red { color: var(--error); } }
/* the same dark colors when dark comes from the OS setting (no data-theme attribute set) */
@media (prefers-color-scheme: dark) { html:not([data-theme]) .v2-bcol.ok .v2-bcol-h b { color: #a7e6c0; } html:not([data-theme]) .v2-bcol.info { background: #1c2a3d; } html:not([data-theme]) .v2-bcol.warn { background: #3a2f18; } html:not([data-theme]) .v2-bcol.ok { background: #17352a; } }

/* Loan sizing (#/calculators/loan-sizing). Uses the CRM's own tokens only (--panel, --line, --x-* ...), so both themes follow.
   Class prefix ls-. */
.ls { min-width: 0; }
.ls .card + .card, .ls .card + .table-wrap { margin-top: 0; }
.ls > * { margin-bottom: 14px; }
.ls-start { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; }
.ls-start .calc-field { flex: 1 1 280px; min-width: 0; }
.ls-start select { width: 100%; min-height: 40px; }
.ls-seg { display: inline-flex; background: var(--panel-sunk); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.ls-seg button { border: 0; background: none; color: var(--ink-2); padding: 8px 14px; min-height: 36px; border-radius: var(--r-sm); }
.ls-seg button:hover { background: var(--n-100); }
.ls-seg button.on, .ls-seg button.on:hover { background: var(--accent); color: var(--accent-ink); }
.ls-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-acts button { min-height: 40px; }

.ls-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ls-inputs { padding: 6px 16px 16px; min-width: 0; }
.ls-group h4 { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
.ls-f { display: grid; grid-template-columns: minmax(0, 1fr) 148px; gap: 8px; align-items: center; padding: 3px 0; font-size: var(--fs-base); }
.ls-f input, .ls-f select { width: 100%; min-height: 38px; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.ls-f input[type=text], .ls-f input[name=name] { text-align: left; }
.ls-res { display: grid; gap: 14px; min-width: 0; }
.ls-res > .card { margin: 0; }
.ls-kpis { margin: 0; grid-template-columns: repeat(auto-fit, minmax(10.5em, 1fr)); }
.ls-kpis .x-kpi .v { font-size: 20px; white-space: nowrap; }

.ls-hero { padding: 18px 20px; }
.ls-hl { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; justify-content: space-between; }
.ls-lbl { font-size: var(--fs-sm); color: var(--muted); }
.ls-big { font: 500 clamp(32px, 5vw, 48px)/1.05 var(--x-mono); letter-spacing: -.03em; white-space: nowrap; color: var(--ink); }
.ls-mini { display: none; }
.ls-bars { margin-top: 26px; display: grid; gap: 10px; }
.ls-bar-row { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; }
.ls-bn { font-size: var(--fs-base); }
.ls-bn b { font-weight: 600; }
.ls-bv { font: 500 var(--fs-base)/1 var(--x-mono); text-align: right; white-space: nowrap; }
.ls-track { position: relative; height: 26px; background: var(--panel-sunk); border: 1px solid var(--line-soft); border-radius: 6px; }
.ls-bar { position: absolute; inset: 0 auto 0 0; background: var(--x-s2); border-radius: 5px; transition: width .35s ease; }
.ls-bar.bind { background: var(--x-c1); }
.ls-mark { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px dashed var(--ink); }
.ls-mark.tag::after { content: attr(data-t); position: absolute; bottom: 100%; left: -1px; transform: translateX(-50%); font-size: var(--fs-sm); font-weight: 600;
  white-space: nowrap; background: var(--panel); color: var(--ink); padding: 0 4px; margin-bottom: 2px; }

.ls-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ls-flags li { border-radius: var(--r-md); padding: 10px 14px; font-size: var(--fs-base); display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; background: var(--panel-sunk); }
.ls-flags li.bad { background: var(--x-bad-soft); } .ls-flags li.warn { background: var(--x-warn-soft); }
.ls-flags .s { font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; color: var(--muted); }
.ls-flags li.bad .s { color: var(--x-bad); } .ls-flags li.warn .s { color: var(--x-warn); }

.ls-t, .ls-rr { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.ls-t th, .ls-t td, .ls-rr th, .ls-rr td { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: var(--fs-base); text-align: left; white-space: nowrap; vertical-align: middle; }
.ls-t th, .ls-rr th { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; background: var(--panel-sunk); }
.ls-t td.r, .ls-t th.r, .ls-rr td.r, .ls-rr th.r { text-align: right; }
.ls-t tr.sub td { font-weight: 600; }
.ls-t tr.tot td, .ls-rr tr.tot td { font-weight: 700; background: var(--panel-sunk); }
.ls-rr td input { min-height: 34px; padding: 5px 7px; font-size: 14px; width: 100%; }
.ls-rr td input.num { text-align: right; width: 110px; }
.ls-rr td input.dt { width: 140px; }
.ls-rr td input.tx { width: 150px; }
.ls-rr td input.nt { width: 230px; }
.ls-t td input.num { width: 110px; min-height: 34px; padding: 5px 7px; font-size: 14px; text-align: right; }
.ls-add { padding: 10px 16px 4px; }
.ls-sens td.ok { background: var(--x-good-soft); } .ls-sens td.no { background: var(--x-bad-soft); }
.ls-sens td.cur { outline: 2px solid var(--x-c1); outline-offset: -2px; font-weight: 700; }

.ls-two { align-items: start; }
.ls-exp { display: flex; gap: 6px; align-items: end; height: 200px; padding: 28px 12px 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.ls-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; gap: 4px; min-width: 0; }
.ls-col .b { width: 100%; max-width: 46px; background: var(--x-s2); border-radius: 4px 4px 0 0; min-height: 1px; }
.ls-col .b.pre { background: var(--x-c1); }
.ls-col .t { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.ls-col .p { font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.ls-col.mat .t { color: var(--ink); font-weight: 700; }
.ls .la-info { position: relative; }

@media (max-width: 980px) {
  .ls-grid { grid-template-columns: minmax(0, 1fr); }
  .ls-res { order: -1; }
  .ls-two.x-grid.g2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .ls-bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ls-bn { grid-column: 1 / -1; margin-bottom: -4px; }
  .ls-hero { padding: 14px; }
  .ls-mini { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 5; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: 8px 4px; font-size: var(--fs-md); }
  body.pn .ls-mini { top: calc(52px + env(safe-area-inset-top, 0px)); }
  .ls-mini strong { font: 500 18px var(--x-mono); }
  .ls-f { grid-template-columns: minmax(0, 1fr) 140px; }
  .ls-flags li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ls-start { align-items: stretch; }
  .ls-seg { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .ls-bar { transition: none; } }
.ls .la-pop { white-space: pre-line; }
@media (max-width: 600px) { .ls-acts { display: grid; grid-template-columns: 1fr 1fr; } .ls-acts button { padding-left: 8px; padding-right: 8px; } }

/* ── phase 2 ── */
.ls-pills { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.ls-chk { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-base); cursor: pointer; }
.ls-chk input { width: auto; min-height: 0; }
.ls-mtm { padding: 4px 16px 8px; display: grid; gap: 4px; }
.ls-mtm-note { margin: 0; }
.ls-bill[hidden] { display: none; }
.ls-det { margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.ls-det summary { cursor: pointer; font-weight: 600; font-size: var(--fs-base); min-height: 32px; display: flex; align-items: center; }
.ls-det .ls-t td { white-space: normal; }
.ls-det input[type=checkbox], .ls-t input[type=checkbox] { width: 18px; height: 18px; min-height: 0; }
.ls-roll .ls-f, .ls-lender .ls-f { padding-left: 0; }
.ls-ro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 24px; padding: 0 16px; }
.ls-roll > p { padding: 6px 16px; margin: 0; }
.ls-roll .card-head, .ls-lender .card-head { flex-wrap: wrap; gap: 8px; }
.ls-prof-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 16px 8px; }
.ls-prof-row select, .ls-prof-row input { min-height: 38px; font-size: 16px; }
.ls-prof-row input[name=profile_name] { flex: 1 1 180px; min-width: 0; }
.ls-prof-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 16px 8px; }
.ls-cmp td input.num { width: 120px; }
.ls-lender .table-wrap, .ls-roll .table-wrap, .ls-bill .table-wrap { margin: 0; }

@media print {
  /* One page of summary (headline, key numbers, flags, sources & uses), then the rent roll. */
  .ls-noprint, .scen-bar, .ls-start, .ls-inputs, .ls-bill, .ls-det, .la-info, .ls-add, .ls-mtm { display: none !important; }
  .ls-grid { display: block; }
  .ls-res { display: block; }
  .ls-res > .card, .ls .card { break-inside: avoid; box-shadow: none; }
  .ls-rrcard { break-before: page; }
  .ls-rr td input { border: 0; background: none; padding: 0; min-height: 0; font-size: 11px; width: auto; }
  .ls-rr th:last-child, .ls-rr td:last-child, .ls-rr th:nth-child(13), .ls-rr td:nth-child(13) { display: none; }
  .ls-rr th, .ls-rr td { padding: 3px 6px; font-size: 11px; }
  .ls-big { font-size: 34px; }
}
@media (max-width: 600px) {
  .ls-ro-grid { grid-template-columns: minmax(0, 1fr); padding: 0 12px; }
  .ls-prof-row { padding: 4px 12px 8px; }
  .ls-prof-pick { padding: 4px 12px 8px; }
}

/* Events calendar (EV-1): the List page and the event page. Built on the V2 tokens (v2.css); loaded after it.
   Kind colours: hearing blue, networking orange, deadline grey. A dot never stands alone, the kind is always also in text. */
:root { --ev-hearing: #1b4f9c; --ev-networking: #d4651f; --ev-deadline: #8592a6; }
html[data-theme="dark"] { --ev-hearing: #6aa5ee; --ev-networking: #f08a4b; --ev-deadline: #9aa7ba; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) { --ev-hearing: #6aa5ee; --ev-networking: #f08a4b; --ev-deadline: #9aa7ba; } }

.ev-dot { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--ev-deadline); }
.ev-dot.hearing { background: var(--ev-hearing); } .ev-dot.networking { background: var(--ev-networking); } .ev-dot.deadline, .ev-dot.other { background: var(--ev-deadline); }
/* the original month grid: hearing / networking chips and legend dots */
.cal-dot.hearing, .cal-chip.hearing i { background: var(--ev-hearing); }
.cal-dot.networking, .cal-chip.networking i { background: var(--ev-networking); }

/* filter bar */
.ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; }
.ev-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; min-width: 0; }
.ev-pills, .ev-switch, .ev-rsvp { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); min-height: 40px; cursor: pointer; }
.ev-check input { width: 18px; height: 18px; margin: 0; }
.ev-add { min-height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--v2-band); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.ev-add:hover { filter: brightness(1.15); }
.ev-page .v2-chipbtn { min-height: 36px; }
.ev-grid { margin-top: 0; }
.ev-main { display: block; }

/* worth-attending cards */
.ev-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ev-card { border: 1px solid var(--line); border-left: 4px solid var(--ev-deadline); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; background: var(--v2-card); }
.ev-card.hearing { border-left-color: var(--ev-hearing); } .ev-card.networking { border-left-color: var(--ev-networking); }
.ev-card.is-going { background: var(--accent-soft); }
.ev-card h3 { margin: 0; font-size: 16px; line-height: 1.25; } .ev-card h3 a { color: var(--ink); text-decoration: none; } .ev-card h3 a:hover { text-decoration: underline; }
.ev-k { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--ink-2); }
.ev-reason { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.ev-sub { font-size: 12px; color: var(--ink-2); display: block; }
.ev-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 6px; }
.ev-who { font-size: 12px; color: var(--ink-2); flex: 1 1 auto; min-width: 0; }
.ev-go { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--v2-band); background: transparent; color: var(--v2-blue); font-weight: 800; font-size: 13px; cursor: pointer; }
.ev-go.on { background: var(--v2-band); color: #fff; }
.ev-ics { font-size: 12px; font-weight: 800; color: var(--v2-blue); text-decoration: none; white-space: nowrap; }
.ev-ics:hover { text-decoration: underline; }

/* day list */
.ev-days { display: flex; flex-direction: column; gap: 14px; }
.ev-day h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.ev-row { display: grid; grid-template-columns: 64px 12px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 6px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 44px; }
.ev-row:hover { background: var(--n-100); }
.ev-row.cancelled b { text-decoration: line-through; color: var(--ink-2); }
.ev-time { font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.ev-rtext { display: flex; flex-direction: column; min-width: 0; } .ev-rtext b { overflow-wrap: anywhere; }
.ev-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ev-row .ev-who { flex: none; text-align: right; white-space: nowrap; }
.ev-empty { margin: 4px 0; }

/* mini month */
.ev-mdow, .ev-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ev-mdow { font-size: 11px; font-weight: 800; color: var(--ink-2); text-align: center; }
.ev-mgrid { gap: 2px; margin-top: 4px; }
.ev-mc { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 40px; padding-top: 4px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--ink); }
.ev-mc:hover { background: var(--n-100); } .ev-mc:focus-visible { outline: 2px solid var(--v2-blue); }
.ev-mc.out { color: var(--ink-2); opacity: .55; } .ev-mc.today span:first-child { background: var(--v2-band); color: #fff; border-radius: 50%; min-width: 22px; text-align: center; }
.ev-mc.pick { background: var(--accent-soft); }
.ev-mdots { display: flex; gap: 2px; min-height: 6px; } .ev-mdots .ev-dot { width: 6px; height: 6px; }
.ev-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 6px; } .ev-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ev-mnav { display: inline-flex; gap: 10px; } .ev-mnav .v2-linkbtn { font-size: 20px; min-width: 28px; min-height: 28px; text-align: center; }

.ev-people { display: flex; flex-direction: column; gap: 10px; } .ev-person { display: flex; flex-direction: column; }
.ev-cov { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ev-cov:first-child { border-top: 0; } .ev-cov span { color: var(--ink-2); } .ev-cov b { text-align: right; overflow-wrap: anywhere; }
.ev-legacy { background: var(--v2-card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; min-width: 0; }

/* the event page */
.ev-mtags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.ev-mtag { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--v2-tile); color: var(--v2-band-ink); }
.ev-mtag.hearing { background: var(--ev-hearing); color: #fff; } .ev-mtag.networking { background: var(--ev-networking); color: #fff; }
.ev-mtag.worth { background: #1b6b3a; color: #fff; } .ev-mtag.bad { background: #b42318; color: #fff; }
.ev-back { margin: 0; font-size: 13px; font-weight: 700; }
.ev-att { margin-top: 4px; } .ev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 6px; }
.ev-actions .ev-ics { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--v2-band); color: #fff; font-size: 13px; }
.ev-reasonbig { margin: 0; font-size: 15px; line-height: 1.4; } .ev-notes { margin: 0; white-space: pre-wrap; }
.ev-after { display: flex; flex-direction: column; gap: 12px; }
.ev-after label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.ev-after input[type="text"], .ev-after input[type="date"], .ev-after textarea { font-size: 16px; font-weight: 500; color: var(--ink); }
.ev-after .ev-fu-check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); min-height: 40px; }
.ev-after .ev-fu-check input { width: 18px; height: 18px; margin: 0; }
.ev-fu-fields { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 10px; } .ev-fu-fields[hidden] { display: none; }
.ev-mynote { margin: 0; white-space: pre-wrap; font-size: 13px; background: var(--n-100); padding: 10px 12px; border-radius: 10px; }

.ev-acc { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 4px 0 0; font-size: 12px; }
.ev-acc-page { margin: 8px 0 0; }
.ev-conf { color: var(--n-500); } .ev-conf a { color: inherit; text-decoration: underline; }
.ev-conf.confirmed { color: var(--ok, #1f7a45); } .ev-conf.expected { color: var(--warn, #9a6a00); }
.ev-warn { font-weight: 600; color: var(--bad, #b3261e); } .ev-warn.go { color: var(--warn, #9a6a00); } .ev-warn a { color: inherit; }

@media (max-width: 700px) {
  .ev-head { padding: 10px 12px; }
  .ev-row { grid-template-columns: 54px 10px minmax(0, 1fr); }
  .ev-row .ev-tags, .ev-row .ev-who { grid-column: 3; justify-content: flex-start; text-align: left; }
  .ev-cards { grid-template-columns: minmax(0, 1fr); }
  .ev-fu-fields { grid-template-columns: minmax(0, 1fr); }
  .ev-add { width: 100%; }
}

/* EV-2: schedule flag, out-of-town tag, coverage extras */
.ev-warn.sched { color: var(--warn, #9a6a00); cursor: help; }
.ev-away { white-space: nowrap; }
.ev-needs { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line, #e3e3e3); }
.ev-needs p { margin: 4px 0 0; }
.ev-towns { margin-top: 8px; }
.ev-towns summary { cursor: pointer; font-size: 13px; }
.ev-towns p { margin: 6px 0 0; }

/* Phone alerts screen (PHONE-P2): switches, the summary preview bubble, "Sent recently". Built on the V2 cards (v2.css);
   colours are the app's tokens so light and dark follow Appearance. Same layout on desktop and phone. */
.pa-hour[hidden], .pa-bubble[hidden] { display: none; }
.pa-lead { margin: 0; font-size: 13px; color: var(--muted); }
.v2-card label.pa-row, .v2-card label.pa-hour { flex-direction: row; color: var(--ink); font-size: 14px; }
.pa-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.pa-row:first-of-type { border-top: 0; }
.pa-row-top { border-top: 0; padding-top: 0; cursor: default; }
.pa-row b { display: block; font-size: 15px; color: var(--ink); }
.pa-sub { display: block; font-size: 12px; color: var(--muted); }
body .v2-card input.pa-switch[type="checkbox"] { flex: none; appearance: none; -webkit-appearance: none; position: relative; width: 46px; height: 28px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 14px; background: var(--line); cursor: pointer; transition: background .15s; }
body .v2-card input.pa-switch[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
body .v2-card input.pa-switch[type="checkbox"]:checked { background: var(--good); }
body .v2-card input.pa-switch[type="checkbox"]:checked::after { transform: translateX(18px); }
body .v2-card input.pa-switch[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body .v2-card input.pa-switch[type="checkbox"]:disabled { opacity: .6; }
.pa-hour { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; color: var(--ink); }
.pa-hour select { font-size: 16px; min-height: 40px; padding: 6px 10px; border-radius: 10px; }
.pa-bubble { display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; }
.pa-app { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--v2-band); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.pa-msg { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pa-msg-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.pa-msg-head b { color: var(--ink); display: inline; font-size: 12px; }
.pa-msg-title { display: block; font-size: 13px; color: var(--ink); }
.pa-msg-body { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--ink-2); }
.pa-empty { font-style: italic; }
.pa-note { margin: 0; font-size: 12px; color: var(--muted); }
.pa-row + .pa-note { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pa-recent { display: flex; flex-direction: column; }
.pa-sent { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.pa-sent:first-child { border-top: 0; padding-top: 0; }
.pa-sent b { display: block; font-size: 14px; }
.pa-when { flex: none; font-size: 12px; color: var(--muted); }
.pa-test { align-self: flex-start; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--v2-card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }

/* Not allowed by an admin (OA-3): greyed, switch off and locked */
.pa-row.pa-off { cursor: default; }
.pa-row.pa-off b { color: var(--muted); }
.pa-setby { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 8px; }
.oa3-hour { font-size: 14px; min-height: 32px; margin-top: 6px; padding: 2px 6px; display: block; }
.pa-off-note { display: block; font-size: 12px; font-weight: 700; color: var(--warn); }
/* Settings > Team > Phone alerts (OA-3) */
.oa3-body { display: flex; flex-direction: column; gap: 20px; }
.oa3-wrap { overflow-x: auto; background: var(--v2-card); border: 1px solid var(--line-soft); border-radius: 16px; }
.oa3-matrix { width: 100%; min-width: 1080px; border-collapse: collapse; font-size: 14px; }
.oa3-matrix th { text-align: left; padding: 12px 10px; font-size: 12px; text-transform: uppercase; color: var(--muted); background: var(--panel); }
.oa3-matrix td { padding: 12px 10px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.oa3-matrix td:first-child, .oa3-matrix th:first-child { padding-left: 16px; }
.oa3-sub { display: block; font-size: 12px; color: var(--muted); }
.oa3-pill { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--v2-card); color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.oa3-pill.on { background: var(--v2-band); border-color: var(--v2-band); color: #fff; }
.oa3-scope { min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--v2-card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.oa3-scope.on { border-color: var(--v2-band); font-weight: 700; }
.oa3-health { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.oa3-health i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.oa3-health.green { color: var(--good); } .oa3-health.green i { background: var(--good); }
.oa3-health.amber { color: var(--warn); } .oa3-health.amber i { background: var(--warn); }
.oa3-health.grey { color: var(--muted); }
.oa3-scope-row td { background: var(--panel); }
.oa3-picker { display: flex; flex-direction: column; gap: 8px; }
.oa3-props { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.oa3-prop { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; flex-direction: row; }
.oa3-prop input { width: 18px; height: 18px; min-height: 0; }
.oa3-all { align-self: flex-start; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--v2-card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.oa3-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.oa3-explain { background: var(--v2-card); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.oa3-explain b { font-size: 15px; color: var(--ink); }
.oa3-explain span { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
/* Act from the alert (#/act/ID): one card per item, big one-tap buttons, phone first */
.oa3-actpage { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.oa3-item { background: var(--v2-card); border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.oa3-item.resolved { opacity: .8; }
.oa3-item h3 { margin: 0; font-size: 17px; color: var(--ink); }
.oa3-kick { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--muted); }
.oa3-sub2 { margin: 0; font-size: 14px; color: var(--ink-2); }
.oa3-line { display: block; }
.oa3-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.oa3-facts dt { color: var(--muted); }
.oa3-facts dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; }
.oa3-banner { margin: 0; font-size: 13px; line-height: 1.45; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; }
.oa3-confirmed, .oa3-done, .oa3-allset { margin: 0; font-size: 13px; color: var(--good); background: var(--good-soft); border-radius: 10px; padding: 8px 10px; }
.oa3-resolved { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.oa3-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.oa3-act { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--v2-card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.oa3-act.primary { background: var(--panel); }
.oa3-act:focus-visible, .oa3-pill:focus-visible, .oa3-scope:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.oa3-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-direction: row; }
.oa3-pick input { font-size: 16px; min-height: 40px; }
.oa3-pick button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--v2-card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.oa3-record { text-align: center; font-size: 14px; font-weight: 700; padding: 6px; }
.oa3-if b { font-size: 13px; }
.oa3-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--v2-card); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.oa3-undo[hidden] { display: none; }
.oa3-undo-btn { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--v2-card); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.oa3-recent { min-width: 760px; }
.oa3-out.wait { color: var(--warn); } .oa3-out.ok { color: var(--good); } .oa3-out.bad { color: var(--bad, #b3261e); }
.oa3-warn { margin: 0; font-size: 13px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; }

/* Quick email (#/quick-email). Desktop: five tiles + one panel with a table. Phone (<= 700px): the tiles become a
   horizontal chip row, rows become two-line cards with a big checkbox, buttons stack full width. */
.qe { display: flex; flex-direction: column; gap: 16px; }
.qe-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.qe-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-weight: 600; cursor: pointer; }
.qe-tile .qe-n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qe-tile .qe-k { font-size: 13px; font-weight: 700; color: var(--muted); }
.qe-tile.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.qe-tile.on .qe-k { color: var(--accent-ink); }
.qe-short { display: none; }
.qe-panel { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.qe-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.qe-head h3 { margin: 0; font-size: 18px; }
.qe-count { margin: 2px 0 0; }
.qe-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qe-draft { background: var(--panel-sunk); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.qe-msg { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; font: inherit; font-size: 14px; line-height: 1.45; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
.qe-table { display: flex; flex-direction: column; }
.qe-row { display: grid; grid-template-columns: 40px minmax(0, 2fr) minmax(0, 1.6fr) minmax(0, .6fr) minmax(0, .9fr) minmax(0, 2fr) minmax(0, 1fr); align-items: center;
  gap: 0 8px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.qe-row > span { min-width: 0; overflow-wrap: anywhere; }
.qe-th { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 0; border-bottom: 1px solid var(--line); }
.qe-tenant { font-weight: 700; }
.qe-sub { display: none; }
.qe-asked { color: var(--muted); }
.qe-call { padding: 16px 22px; }
.qe-call h3 { margin: 0 0 6px; font-size: 16px; }
.qe-callrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; align-items: center; }
.qe-phones { display: flex; flex-direction: column; gap: 2px; }

@media (max-width: 700px) {
  .qe { gap: 12px; }
  .qe-tiles { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .qe-tiles::-webkit-scrollbar { display: none; }
  .qe-tile { flex: none; flex-direction: row; border-radius: 999px; padding: 8px 14px; min-height: 40px; align-items: center; scroll-snap-align: start; }
  .qe-tile .qe-n, .qe-long { display: none; }
  .qe-short { display: inline; }
  .qe-hint { display: none; }
  .qe-tile .qe-k { font-size: 13px; color: inherit; }
  .qe-panel { padding: 14px; border-radius: 18px; }
  .qe-head { display: block; }
  .qe-actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; }
  .qe-actions .qe-copy { grid-column: 1 / -1; padding: 15px; font-size: 16px; font-weight: 800; border-radius: 14px; }
  .qe-actions button { min-height: 46px; border-radius: 14px; }
  .qe-draft { font-size: 15px; }
  .qe-msg { font-size: 16px; }                      /* 16px keeps iOS from zooming into the field */
  .qe-th { display: none; }
  .qe-row { grid-template-columns: minmax(0, 1fr) 44px; grid-template-areas: "who pick" "detail pick" "asked asked"; gap: 2px 8px; padding: 12px 0; }
  .qe-pick { grid-area: pick; justify-self: end; }
  .qe-pick input { width: 24px; height: 24px; }
  .qe-who { grid-area: who; display: flex; flex-direction: column; }
  .qe-sub { display: block; font-size: 13px; color: var(--muted); }
  .qe-prop, .qe-unit, .qe-emails { display: none; }
  .qe-detail { grid-area: detail; font-size: 13px; }
  .qe-asked { grid-area: asked; font-size: 12px; }
  .qe-asked::before { content: "Last asked: "; }
  .qe-callrow { grid-template-columns: 1fr; gap: 2px; }
  .qe-callrow > span { grid-area: auto; }                 /* the row layout's named areas (who/asked) must not apply here */
  .qe-callrow .qe-asked:empty, .qe-callrow .qe-asked::before { display: none; content: none; }
  .qe-actions .qe-mark { grid-column: 1 / -1; }
  .qe-callrow .qe-phones a { padding: 6px 0; }
}

/* Leasing desk (#/leasing/desk) */
.ld-list { display: flex; flex-direction: column; gap: 8px; }
.ld-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); text-decoration: none; min-width: 0; }
.ld-row:hover { border-color: var(--accent); }
.ld-row-main { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.ld-row-rent { text-align: right; flex: none; max-width: 45%; }
.ld-crumb { margin-bottom: 4px; }
.ld-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.ld-title h2 { margin: 0 0 4px; }
.ld-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ld-save { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.ld-save[hidden] { display: none; }
.ld-save input { font-size: 16px; min-height: 40px; width: 110px; }
.ld-use { display: block; margin: 0 0 12px; }
.ld-use select { font-size: 16px; min-height: 40px; }
.ld-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.ld-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.ld-tile.ld-navy { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ld-tile-k { font-size: 13px; font-weight: 600; opacity: .8; }
.ld-tile-v { font-size: 28px; font-weight: 800; line-height: 1.15; }
.ld-tile-v small { font-size: 14px; font-weight: 500; opacity: .8; }
.ld-tile-s { font-size: 13px; opacity: .85; }
.ld-cols { display: flex; gap: 16px; align-items: flex-start; }
.ld-main { flex: 3 1 0; min-width: 0; }
.ld-side { flex: 2 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ld-card h3 { margin: 0 0 10px; }
.ld-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ld-kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.ld-comp { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.ld-comp-l { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ld-restr { margin: 0 0 8px; overflow-wrap: anywhere; }
.ld-lead { display: grid; grid-template-columns: 34px minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 2fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.ld-lead-head { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.ld-lead.blocked { opacity: .75; }
.ld-lead > span { min-width: 0; overflow-wrap: anywhere; }
.ld-lead-main, .ld-size { display: flex; flex-direction: column; gap: 2px; }
.ld-rank { font-weight: 800; }
.ld-s.clear { color: #1b6b3a; font-weight: 700; }
.ld-s.check { color: #9a5b00; }
.ld-s.blocked { color: #9b1c1c; }
.ld-clause { font-size: 12px; }
@media (max-width: 900px) {
  .ld-tiles { grid-template-columns: 1fr; }
  .ld-cols { flex-direction: column; }
  .ld-main, .ld-side { width: 100%; flex: none; }
}
@media (max-width: 700px) {
  .ld-row { flex-direction: column; gap: 6px; }
  .ld-row-rent { text-align: left; max-width: none; }
  .ld-lead-head { display: none; }
  .ld-lead { grid-template-columns: 28px minmax(0, 1fr); gap: 4px 10px; }
  .ld-lead > span:nth-child(n+3) { grid-column: 2; }
  .ld-title { align-items: flex-start; }
  .ld-actions .btn { min-height: 44px; }
}
.ld-note summary { cursor: pointer; min-height: 24px; }
.ld-asking { margin: 0 0 8px; }
@media (max-width: 700px) { .ld-poi.none { display: none; } .ld-lead > span:nth-child(5) { font-size: 14px; } }

/* AppFolio to-do (appfoliotodo.js). Only layout for the page, and the lease-page strip; every colour is the app's own token. */
.aft-lead { margin: 0 0 14px; max-width: 70ch; }
.aft-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.aft-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.aft-win { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.aft-win select { min-height: 40px; }
.aft-card + .aft-card { margin-top: 14px; }
.aft-chiprow { margin: 0 0 10px; }
.aft-flag { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--error-soft); color: var(--error); border: 1px solid var(--error); }
.aft-wrap { border: 1px solid var(--line); }
.aft-table { width: 100%; min-width: 560px; }
.aft-table th, .aft-table td { vertical-align: top; }
.aft-field { white-space: nowrap; }
.aft-from { color: var(--muted); }
.aft-to { font-weight: 700; white-space: pre-line; }
.aft-from { white-space: pre-line; }
.aft-copy { margin-left: 6px; min-height: 32px; padding: 0 12px; }
.cards td .aft-copy { align-self: flex-start; margin: 4px 0 0; width: auto; }
.aft-when { white-space: nowrap; }
.aft-done { text-align: center; width: 64px; }
.aft-hit { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
.aft-check { width: 22px; height: 22px; min-height: 0; cursor: pointer; }
.aft-note { margin: 10px 0 0; font-size: 13px; }
.aft-strip-host:empty { display: none; }
.aft-strip { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); }
.aft-strip.bad { background: var(--error-soft); border-color: var(--error); }
.aft-strip-t { min-width: 0; }
.aft-strip .v2-btn { align-self: center; }

/* LARRY-MODE phase 1: the Simple view. Phone first, centered at 480px on a desktop. Everything is scoped to #simple-view. */
/* Colors. Light values are the Simple look as designed. In dark every surface and ink comes from the app's theme tokens (redesign.css),
   so nothing is white-on-white or dark-on-dark. --s-navy is the brand header only; --s-fill/--s-accent are what buttons and links use. */
body.simple-mode, #simple-view {
  --s-navy: #00205B; --s-bg: #F4F5F7; --s-ink: #14213D; --s-mute: #5B6577; --s-warn: #B54708; --s-warn-bg: #FEF0E6; --s-good: #067647;
  --s-card: #fff; --s-line: #EDEFF3; --s-line3: #EDF0F5; --s-line2: #D5DAE5; --s-soft: #EEF2FA; --s-soft2: #E6EDFA; --s-soft3: #DBE7FB; --s-soft4: #E6EEFC; --s-track: #E5E8EE; --s-chev: #9AA3B2; --s-chev2: #8A93A8;
  --s-tabink: #4A5A70; --s-tabline: #DDE3EC; --s-blurb: #3B4558; --s-gray-bg: #EDEFF3; --s-gray-ink: #444C5C; --s-bad: #B3261E; --s-bad-bg: #FBE0E0;
  --s-amber-bg: #FEF3C7; --s-amber-ink: #92400E; --s-good-bg: #DFF3E6; --s-ok-bg: #FFFBF3; --s-ok-edge: #F3C98B; --s-ok-fill: #067647; --s-toast: #14213D;
  --s-fill: #00205B; --s-fill-ink: #fff; --s-accent: #00205B;
}
html[data-theme="dark"] body.simple-mode, html[data-theme="dark"] #simple-view {
  --s-bg: var(--bg); --s-ink: var(--ink); --s-mute: var(--muted); --s-warn: var(--warn); --s-warn-bg: var(--warn-soft); --s-good: var(--good);
  --s-card: var(--panel); --s-line: var(--line-soft); --s-line3: var(--line-soft); --s-line2: var(--line); --s-soft: var(--accent-soft); --s-soft2: var(--accent-soft); --s-soft3: var(--n-200); --s-soft4: var(--accent-soft);
  --s-track: var(--n-200); --s-chev: var(--n-400); --s-chev2: var(--n-400); --s-tabink: var(--muted); --s-tabline: var(--line); --s-blurb: var(--ink-2); --s-gray-bg: var(--n-100);
  --s-gray-ink: var(--muted); --s-bad: var(--error); --s-bad-bg: var(--error-soft); --s-amber-bg: var(--warn-soft); --s-amber-ink: var(--warn); --s-good-bg: var(--good-soft);
  --s-ok-bg: var(--warn-soft); --s-ok-edge: var(--warn); --s-ok-fill: var(--good); --s-toast: var(--n-200);
  --s-fill: var(--accent); --s-fill-ink: var(--accent-ink); --s-accent: var(--accent);
}
body.simple-mode { background: var(--s-bg); }
#simple-view {
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--s-bg); color: var(--s-ink); font-size: 17px; line-height: 1.35;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; position: relative; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
#simple-view[hidden] { display: none; }
#simple-view *, #simple-view *::before, #simple-view *::after { box-sizing: border-box; }
#simple-view a { color: inherit; text-decoration: none; }
#simple-view .s-head { background: var(--s-navy); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 20px 22px; border-radius: 0 0 24px 24px; }
#simple-view .s-head-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
#simple-view .s-kicker { color: #C9D3EA; font-size: 16px; }
#simple-view .s-back, #simple-view .s-gear { color: #fff; font-size: 17px; min-height: 44px; display: inline-flex; align-items: center; }
#simple-view .s-gear { color: #C9D3EA; }
#simple-view .s-title { margin: 2px 0 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
#simple-view .s-headsub { color: #C9D3EA; margin-top: 6px; font-size: 16px; overflow-wrap: anywhere; }
#simple-view .s-headsub a { text-decoration: underline; }
#simple-view .s-main { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
#simple-view .s-card { background: var(--s-card); border-radius: 20px; padding: 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
#simple-view h3 { margin: 0 0 10px; font-size: 18px; font-weight: 650; }
#simple-view .s-label { color: var(--s-mute); font-size: 16px; }
#simple-view .s-huge { font-size: 42px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0 2px; }
#simple-view .good { color: var(--s-good); }
#simple-view .warn { color: var(--s-warn); }
#simple-view .s-sub { color: var(--s-mute); font-size: 16px; }
#simple-view .s-bar { height: 12px; border-radius: 6px; background: var(--s-track); overflow: hidden; margin: 12px 0 8px; }
#simple-view .s-bar-fill { height: 100%; background: var(--s-good); border-radius: 6px; }
#simple-view .s-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#simple-view .s-tile { display: block; background: var(--s-card); border-radius: 20px; padding: 16px; min-height: 112px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
#simple-view .s-tile-label { color: var(--s-mute); font-size: 16px; }
#simple-view .s-tile-big { font-size: 28px; font-weight: 750; margin: 4px 0; overflow-wrap: anywhere; }
#simple-view .s-tile-sub { color: var(--s-mute); font-size: 16px; }
#simple-view .s-tile.is-off { opacity: .75; }
#simple-view .s-list { display: flex; flex-direction: column; }
#simple-view .s-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 0; border-top: 1px solid var(--s-line); }
#simple-view .s-list > .s-row:first-child, #simple-view .s-list > .s-up:first-child { border-top: 0; }
#simple-view .s-row-main { flex: 1; min-width: 0; }
#simple-view .s-row-title { font-weight: 600; overflow-wrap: anywhere; }
#simple-view .s-row-sub { color: var(--s-mute); font-size: 16px; overflow-wrap: anywhere; }
#simple-view .s-row-right { text-align: right; }
#simple-view .s-chev { color: var(--s-chev); font-size: 24px; }
#simple-view .s-amt { font-weight: 700; }
#simple-view .s-pct { font-weight: 650; }
#simple-view .s-why { color: var(--s-warn); }
#simple-view .s-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; margin-top: 4px; }
#simple-view .s-pill.hot { background: var(--s-warn-bg); color: var(--s-warn); }
#simple-view .s-pill.amber { background: var(--s-amber-bg); color: var(--s-amber-ink); }
#simple-view .s-pill.gray { background: var(--s-gray-bg); color: var(--s-gray-ink); }
#simple-view .s-up { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--s-line); }
#simple-view .s-badge { width: 52px; flex: none; text-align: center; background: var(--s-soft); border-radius: 12px; padding: 6px 0; }
#simple-view .s-badge-m { font-size: 13px; text-transform: uppercase; color: var(--s-accent); font-weight: 650; }
#simple-view .s-badge-d { font-size: 22px; font-weight: 750; color: var(--s-accent); line-height: 1.1; }
#simple-view .s-a { text-decoration: underline; }
#simple-view .s-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
#simple-view .s-btn { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 14px; font-size: 17px; font-weight: 650;
  background: var(--s-card); color: var(--s-accent); border: 1.5px solid var(--s-line2); width: 100%; font-family: inherit; cursor: pointer; }
#simple-view .s-btn.primary { background: var(--s-fill); color: var(--s-fill-ink); border-color: var(--s-fill); }
#simple-view .s-kv { display: flex; justify-content: space-between; gap: 12px; min-height: 36px; align-items: center; }
#simple-view .s-kv span { color: var(--s-mute); }
#simple-view .s-kv strong { text-align: right; overflow-wrap: anywhere; }
#simple-view .s-loan + .s-loan { border-top: 1px solid var(--s-line); margin-top: 8px; padding-top: 8px; }
#simple-view .s-note { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
#simple-view .s-meta { margin: 0; color: var(--s-mute); font-size: 16px; }
#simple-view .s-empty { color: var(--s-mute); text-align: center; padding: 18px 0; margin: 0; }
#simple-view .s-search { color: var(--ink); width: 100%; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--s-line2); padding: 0 14px; font-size: 17px; font-family: inherit; background: var(--s-card); }
#simple-view .s-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
#simple-view .s-pillbtn { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--s-line2); background: var(--s-card); color: var(--s-ink); font-size: 16px; font-family: inherit; cursor: pointer; }
#simple-view .s-pillbtn.on { background: var(--s-fill); color: var(--s-fill-ink); border-color: var(--s-fill); }
#simple-view .s-call { flex: none; min-height: 44px; min-width: 64px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--s-soft); color: var(--s-accent); font-weight: 650; }
#simple-view .s-tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 50; box-sizing: border-box; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--s-card); box-shadow: 0 -1px 0 var(--s-tabline), 0 -6px 18px rgba(0, 32, 91, .06); padding: 6px 2px calc(8px + env(safe-area-inset-bottom)); }
#simple-view .s-tab { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 0; text-decoration: none; text-align: center;
  font-size: 11px; font-weight: 700; line-height: 1.2; color: var(--s-tabink); white-space: nowrap; -webkit-tap-highlight-color: transparent; }
#simple-view .s-tab-ic { width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background-color .15s; }
#simple-view .s-tab-ic svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#simple-view .s-tab.on { color: var(--s-accent); font-weight: 800; }
#simple-view .s-tab.on .s-tab-ic { background: var(--s-soft3); }
#simple-view .s-tab:active .s-tab-ic { background: var(--s-soft); }
#simple-view .s-card.s-muted { background: transparent; box-shadow: none; padding: 4px 8px; }
#simple-view .s-headbig { font-size: 36px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; }
#simple-view .s-bar.on-navy { background: rgba(255, 255, 255, .22); margin: 10px 0 0; }
#simple-view .s-bar.on-navy .s-bar-fill { background: #5BD4A0; }
#simple-view .s-check { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 0; border-top: 1px solid var(--s-line); }
#simple-view .s-list > .s-check:first-child { border-top: 0; }
#simple-view .s-check .s-row-main { display: block; }
#simple-view .s-check.paid { min-height: 52px; }
#simple-view .s-check.paid .s-row-title { font-weight: 500; }
#simple-view .s-mark { flex: none; min-height: 48px; min-width: 112px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--s-accent); background: var(--s-card);
  color: var(--s-accent); font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; }
#simple-view .s-mark::before { content: ""; display: inline-block; width: 18px; height: 18px; border: 2px solid var(--s-accent); border-radius: 5px; margin-right: 8px; vertical-align: -3px; }
#simple-view .s-unmark { flex: none; min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--s-mute); font-size: 15px; text-decoration: underline; font-family: inherit; cursor: pointer; }
#simple-view .s-actions { margin-top: 12px; }
#simple-view .s-actions .s-mark { width: 100%; min-height: 56px; font-size: 18px; }
#simple-view .s-undo { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(72px + env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 448px;
  background: var(--s-toast); color: #fff; border-radius: 14px; padding: 6px 8px 6px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 5; }
#simple-view .s-undo[hidden] { display: none; }
#simple-view .s-undo-btn { min-height: 44px; min-width: 64px; border: 0; background: transparent; color: #8FD0FF; font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer; }
#simple-view .s-seggroup { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1.5px solid var(--s-accent); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
#simple-view .s-seg { min-height: 48px; border: 0; background: var(--s-card); color: var(--s-accent); font-size: 17px; font-weight: 650; font-family: inherit; cursor: pointer; }
#simple-view .s-seg[aria-pressed="true"] { background: var(--s-fill); color: var(--s-fill-ink); }
#simple-view .s-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
#simple-view .s-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--s-line2); background: var(--s-card); color: var(--s-ink); font-size: 16px; font-family: inherit; cursor: pointer; }
#simple-view .s-chip[aria-pressed="true"] { background: var(--s-fill); color: var(--s-fill-ink); border-color: var(--s-fill); }
#simple-view .s-text { color: var(--ink); width: 100%; border-radius: 14px; border: 1.5px solid var(--s-line2); padding: 12px 14px; font-size: 17px; font-family: inherit; margin: 6px 0 14px; resize: vertical; }
#simple-view .s-give .s-label { margin-top: 4px; }
#simple-view .s-about { margin: 0 0 14px; color: var(--s-mute); }
#simple-view .s-err { color: var(--s-warn); background: var(--s-warn-bg); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
#simple-view .s-give-btn { border-style: dashed; }
#simple-view .s-btn[disabled] { opacity: .45; cursor: default; }
/* Big give controls (Larry): two large buttons on Home/Property/Tenant, and a roomy give form */
#simple-view .s-give-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#simple-view .s-give-big { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 72px; padding: 8px 10px; border-radius: 18px;
  font-size: 20px; font-weight: 750; line-height: 1.15; border: 2.5px solid var(--s-accent); background: var(--s-card); color: var(--s-accent); }
#simple-view .s-give-big.task { background: var(--s-fill); color: var(--s-fill-ink); }
#simple-view .s-give-stack { display: grid; gap: 12px; }
#simple-view .s-give-big.ask { background: var(--s-card); border-style: dashed; }
#simple-view .s-req { padding: 12px 0; border-top: 1px solid var(--s-line); display: grid; gap: 8px; }
#simple-view .s-list > .s-req:first-child { border-top: 0; }
#simple-view .s-req .s-row-main { display: block; min-width: 0; }
#simple-view .s-req-status { justify-self: start; margin-bottom: 0; }
#simple-view .s-req-note { margin: 0; }
#simple-view .s-req-act { display: flex; gap: 10px; }
#simple-view .s-req-act .s-btn { min-height: 52px; flex: 1; font-size: 18px; font-weight: 700; }
@media (max-width: 340px) { #simple-view .s-give-pair { grid-template-columns: 1fr; } }
#simple-view .s-label-big { display: block; font-size: 18px; font-weight: 700; color: var(--s-ink); margin-top: 6px; }
#simple-view .s-seg-big .s-seg { min-height: 60px; font-size: 20px; font-weight: 700; }
#simple-view .s-chips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 18px; }
#simple-view .s-chip-big { min-height: 60px; padding: 8px 12px; border-radius: 16px; font-size: 18px; font-weight: 600; width: 100%; overflow-wrap: anywhere; }
#simple-view .s-give .s-text { font-size: 18px; min-height: 140px; }
#simple-view .s-give .s-search { min-height: 56px; font-size: 18px; }
#simple-view .s-send-big { min-height: 64px; font-size: 20px; font-weight: 750; border-radius: 16px; margin-top: 4px; }
#simple-view .s-select { width: 100%; min-height: 56px; border-radius: 14px; border: 1.5px solid var(--s-line2); padding: 0 12px; font-size: 18px; font-family: inherit; background: var(--s-card); color: var(--s-ink); }
#simple-view .s-row-props { margin-top: 2px; }
#simple-view .s-row-props a { text-decoration: underline; }

/* People list paging (E-14) */
#simple-view .s-more { display: grid; gap: 10px; margin: 12px 0 4px; text-align: center; }
#simple-view .s-more .s-btn { width: 100%; }

/* Tasks tab: a done-circle, the title, who it is from and for, and a big switch between Mine, Everyone and Done */
#simple-view .s-seg3 { grid-template-columns: 1fr 1fr 1fr; margin-top: 14px; }
#simple-view .s-give-wide { width: 100%; box-sizing: border-box; }
#simple-view .s-task { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 8px 0; border-top: 1px solid var(--s-line); }
#simple-view .s-list > .s-task:first-child { border-top: 0; }
#simple-view .s-task .s-row-main { flex: 1; min-width: 0; display: block; }
#simple-view .s-task.late .s-row-sub { color: var(--s-bad); font-weight: 600; }
#simple-view .s-done, #simple-view .s-done-off { flex: none; width: 44px; height: 44px; border-radius: 50%; box-sizing: border-box; border: 2.5px solid var(--s-accent); background: var(--s-card); color: var(--s-card); font-size: 24px; font-weight: 800; font-family: inherit; cursor: pointer; padding: 0; line-height: 1; }
#simple-view .s-done.on { background: var(--s-fill); border-color: var(--s-fill); color: var(--s-fill-ink); }
#simple-view .s-done-off { border-color: var(--s-line2); cursor: default; display: inline-block; }
#simple-view .s-danger { border-color: var(--s-bad); color: var(--s-bad); }

/* Approvals: Waiting for your OK. Big targets, 16px+ text. */
#simple-view .s-ok-card { border: 2px solid var(--s-ok-edge); background: var(--s-ok-bg); }
#simple-view .s-ok-card .s-btn { margin-top: 10px; }
#simple-view .s-appr-status { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 16px; font-weight: 700; margin-bottom: 10px; background: var(--s-amber-bg); color: var(--s-amber-ink); }
#simple-view .s-appr-status.approved { background: var(--s-good-bg); color: var(--s-good); }
#simple-view .s-appr-status.declined { background: var(--s-bad-bg); color: var(--s-bad); }
#simple-view .s-appr-status.withdrawn { background: var(--s-gray-bg); color: var(--s-gray-ink); }
#simple-view .s-appr-btns { display: flex; flex-direction: column; gap: 12px; }
#simple-view .s-appr-confirm { margin: 0; font-size: 19px; font-weight: 650; text-align: center; overflow-wrap: anywhere; }
#simple-view .s-approve { background: var(--s-ok-fill); color: var(--s-fill-ink); border-color: var(--s-ok-fill); }
#simple-view .s-decline { background: var(--s-card); color: var(--s-bad); border-color: var(--s-bad); }
#simple-view .s-approve[disabled], #simple-view .s-decline[disabled] { opacity: .5; }
#simple-view #s-appr-note { min-height: 110px; font-size: 18px; margin-bottom: 14px; }

/* NEWS: Home card, #/s/news feed, story screen, property "In the news" */
#simple-view .s-news { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid var(--s-line); min-height: 64px; }
#simple-view .s-list > .s-news:first-child { border-top: 0; padding-top: 4px; }
#simple-view .s-news-main { flex: 1; min-width: 0; }
#simple-view .s-news-title { font-weight: 650; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#simple-view .s-new { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #1D6FE0; margin-right: 8px; vertical-align: 1px; flex: none; }
#simple-view .s-news-meta { color: var(--s-mute); font-size: 16px; margin-top: 2px; overflow-wrap: anywhere; }
#simple-view .s-news-blurb { color: var(--s-blurb); font-size: 16px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
#simple-view .s-news-props { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#simple-view .s-news-chip { display: inline-block; max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--s-soft2); color: var(--s-accent); font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#simple-view .s-news-chip.more { background: var(--s-gray-bg); color: var(--s-gray-ink); }
#simple-view .s-news-all { margin-top: 8px; }
#simple-view .s-story { margin: 0; font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
#simple-view .s-read { min-height: 60px; font-size: 19px; }
#simple-view #s-news-more { min-height: 56px; }
#simple-view .s-seg-news .s-seg { font-size: 17px; padding: 0 4px; min-height: 56px; }
#simple-view .s-seg-news .s-seg { font-size: 17px; padding: 0 4px; min-height: 56px; }
#simple-view .s-seg3.s-seg-news { grid-template-columns: .8fr 1.9fr .8fr; }

/* HOME, Design A "Needs you first": header rent line, one Needs you card, three quick actions, compact News */
#simple-view .s-rentline { display: block; margin-top: 12px; min-height: 44px; }
#simple-view .s-rentline-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; font-size: 14px; }
#simple-view .s-rentline-label { font-weight: 600; }
#simple-view .s-rentline-val { color: #C9D3EA; }
#simple-view .s-rentbar { display: block; height: 8px; margin: 8px 0 0; }
#simple-view .s-rentbar .s-bar-fill { display: block; height: 8px; }
#simple-view .s-needs { padding: 16px; display: flex; flex-direction: column; gap: 0; border-radius: 18px; }
#simple-view .s-needs-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; min-height: 28px; }
#simple-view .s-needs-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
#simple-view .s-needs-count { font-size: 13px; color: var(--s-mute); }
#simple-view .s-caught { margin: 0; padding: 10px 0; font-size: 15px; font-weight: 700; color: var(--s-good); border-bottom: 1px solid var(--s-line); }
#simple-view .s-need { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--s-line3); color: var(--s-ink); }
#simple-view .s-need:last-child { border-bottom: 0; padding-bottom: 2px; }
#simple-view .s-need-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--s-soft2); color: var(--s-accent); }
#simple-view .s-need-ic svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#simple-view .s-need.amber .s-need-ic { background: var(--s-warn-bg); color: var(--s-warn); }
#simple-view .s-need.red .s-need-ic { background: var(--s-bad-bg); color: var(--s-bad); }
#simple-view .s-need-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#simple-view .s-need-title { font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
#simple-view .s-need-sub { font-size: 13px; color: var(--s-mute); overflow-wrap: anywhere; }
#simple-view .s-need-pill { flex: none; font-size: 13px; font-weight: 700; color: var(--s-warn); background: var(--s-warn-bg); padding: 4px 10px; border-radius: 999px; }
#simple-view .s-need-chev { flex: none; stroke: var(--s-chev2); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#simple-view .s-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#simple-view .s-qa { background: var(--s-card); border-radius: 16px; padding: 12px 6px; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--s-ink); text-align: center; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
#simple-view .s-qa svg { stroke: var(--s-accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#simple-view .s-news-card { padding: 16px; border-radius: 18px; }
#simple-view .s-news-card .s-needs-head { margin-bottom: 4px; }
#simple-view .s-news-card .s-news-all { font-size: 14px; font-weight: 700; color: var(--s-accent); min-height: 44px; display: inline-flex; align-items: center; margin: -8px 0; }
#simple-view .s-news-compact { padding: 10px 0; min-height: 56px; }
#simple-view .s-list > .s-news-compact:first-child { padding-top: 10px; }
#simple-view .s-news-compact .s-news-title { font-size: 15px; font-weight: 700; -webkit-line-clamp: 2; }
#simple-view .s-news-compact .s-news-meta { font-size: 13px; }
#simple-view .s-up .s-a { display: inline-block; padding: 12px 0; margin: -12px 0; }

/* RESPONSIVE (2026-11): phone (<700px) is unchanged above. Tablet 700-1099px: a 760px column, home in two columns, tab bar stays at the bottom.
   Desktop >=1100px: a top navigation bar, content up to 1180px, home in three columns, list pages in two. Layout only: same screens, data and routes.
   JS sets #simple-view[data-layout] = home | wide (list pages) | narrow (detail pages and forms). */
@media (min-width: 700px) {
  #simple-view { --s-w: 760px; --s-gut: max(20px, calc((100% - var(--s-w)) / 2)); max-width: none; width: 100%; display: flex; flex-direction: column; }
  #simple-view .s-head { padding-left: var(--s-gut); padding-right: var(--s-gut); padding-top: calc(18px + env(safe-area-inset-top)); }
  #simple-view .s-main { padding-left: var(--s-gut); padding-right: var(--s-gut); padding-top: 22px; width: 100%; max-width: none; box-sizing: border-box; }
  #simple-view .s-tabs { max-width: none; padding-left: var(--s-gut); padding-right: var(--s-gut); }
  #simple-view .s-undo { max-width: 560px; }
  #simple-view[data-layout="home"] .s-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  #simple-view[data-layout="home"] .s-main > .s-needs { grid-column: 1; grid-row: 1; }
  #simple-view[data-layout="home"] .s-main > .s-quick { grid-column: 1; grid-row: 2; }
  #simple-view[data-layout="home"] .s-main > .s-news-card { grid-column: 2; grid-row: 1; }
  #simple-view[data-layout="home"] .s-main > .s-upcard { grid-column: 2; grid-row: 2; }
  #simple-view[data-layout="home"] .s-main > .s-empty { grid-column: 1 / -1; }
  #simple-view .s-seggroup, #simple-view .s-more { max-width: 560px; }
  #simple-view .s-more { margin-left: auto; margin-right: auto; width: 100%; }
}
@media (min-width: 1100px) {
  #simple-view { --s-w: 760px; }
  #simple-view[data-layout="home"], #simple-view[data-layout="wide"] { --s-w: 1180px; }
  #simple-view { padding-bottom: 40px; }
  /* top bar instead of the bottom tab bar */
  #simple-view .s-tabs { position: sticky; top: 0; bottom: auto; left: auto; transform: none; order: -1; width: 100%; max-width: none; z-index: 50;
    display: flex; align-items: center; gap: 6px; padding: 6px max(20px, calc((100% - 1180px) / 2)); box-shadow: 0 1px 0 var(--s-tabline), 0 4px 14px rgba(0, 32, 91, .05); }
  #simple-view .s-tab { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 52px; padding: 0 18px 0 8px; border-radius: 26px; font-size: 16px; }
  #simple-view .s-tab-ic { width: 36px; height: 36px; border-radius: 18px; }
  #simple-view .s-tab:hover .s-tab-ic { background: var(--s-soft); }
  #simple-view .s-tab.on { background: var(--s-soft4); }
  #simple-view .s-tab.on .s-tab-ic { background: transparent; }
  #simple-view .s-head { border-radius: 0 0 28px 28px; }
  #simple-view .s-undo { bottom: 28px; }
  #simple-view[data-layout="home"] .s-main { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  #simple-view[data-layout="home"] .s-main > .s-news-card { grid-column: 2; grid-row: 1 / span 2; }
  #simple-view[data-layout="home"] .s-main > .s-upcard { grid-column: 3; grid-row: 1 / span 2; }
  /* list pages (tasks, rent, properties, people, approvals, news): two columns inside each card */
  #simple-view[data-layout="wide"] .s-card > .s-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
  #simple-view[data-layout="wide"] .s-card > .s-list > :nth-child(2) { border-top: 0; }
  #simple-view[data-layout="wide"] .s-card > .s-list > :nth-child(-n+2) { padding-top: 4px; }
  #simple-view[data-layout="wide"] .s-main > .s-search, #simple-view[data-layout="wide"] .s-main > .s-pills { max-width: 720px; }
  #simple-view .s-card { padding: 22px; }
  #simple-view .s-needs, #simple-view .s-news-card { padding: 20px; }
}

/* OS-dark: same tokens as html[data-theme="dark"] above. Kept at the end so the base rules stay ahead of the first @media (simple_responsive.js reads that). */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body.simple-mode, html:not([data-theme]) #simple-view {
  --s-bg: var(--bg); --s-ink: var(--ink); --s-mute: var(--muted); --s-warn: var(--warn); --s-warn-bg: var(--warn-soft); --s-good: var(--good);
  --s-card: var(--panel); --s-line: var(--line-soft); --s-line3: var(--line-soft); --s-line2: var(--line); --s-soft: var(--accent-soft); --s-soft2: var(--accent-soft); --s-soft3: var(--n-200); --s-soft4: var(--accent-soft);
  --s-track: var(--n-200); --s-chev: var(--n-400); --s-chev2: var(--n-400); --s-tabink: var(--muted); --s-tabline: var(--line); --s-blurb: var(--ink-2); --s-gray-bg: var(--n-100);
  --s-gray-ink: var(--muted); --s-bad: var(--error); --s-bad-bg: var(--error-soft); --s-amber-bg: var(--warn-soft); --s-amber-ink: var(--warn); --s-good-bg: var(--good-soft);
  --s-ok-bg: var(--warn-soft); --s-ok-edge: var(--warn); --s-ok-fill: var(--good); --s-toast: var(--n-200);
  --s-fill: var(--accent); --s-fill-ink: var(--accent-ink); --s-accent: var(--accent);
  }
}
