/* LTCPulse app stylesheet. Hand-written, no framework (REQUIREMENTS §2 / UI).
   Every colour, size and radius comes from static/tokens.css, the same token set the
   report card inlines, so the app and the card read as one product. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
code { font-size: 12px; background: var(--panel); padding: 2px 6px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- brand ------------------------------------------------------------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 750; font-size: 19px; letter-spacing: -.02em; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .mark { flex: 0 0 auto; display: block; }

/* --- top bar ------------------------------------------------------------ */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 30;
}
.topbar-in {
  max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 28px;
}
.tabs { display: flex; align-self: stretch; gap: 4px; }
.tabs a {
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  color: var(--soft); font-weight: 600; border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
}
.tabs a:hover { color: var(--ink); text-decoration: none; background: var(--panel); }
.tabs a.active { color: var(--plum); border-bottom-color: var(--plum); }
.navlinks { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--grey); }
.navlinks form { margin: 0; }
.navtoggle { display: none; }
.tabs .short { display: none; }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--plum-50); color: var(--plum); font-weight: 700;
}

/* --- context bar: which home, which window ------------------------------ */
.contextbar { max-width: 1240px; margin: 0 auto; padding: 20px 24px 0; }
.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.controls label { color: var(--grey); font-weight: 600; margin-right: 8px; }
.switcher select {
  font-size: var(--fs-md); font-weight: 650; color: var(--ink);
  min-width: 240px; min-height: 42px; padding: 8px 36px 8px 12px;
}
.window { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-md); padding: 3px;
}
.seg a {
  padding: 7px 14px; border-radius: 7px; color: var(--soft); font-weight: 600;
  min-height: 36px; display: inline-flex; align-items: center;
}
.seg a:hover { background: var(--panel); text-decoration: none; }
.seg a.on { background: var(--plum); color: #fff; }

/* --- forms + buttons ----------------------------------------------------- */
select, input[type=date], input[type=text], input[type=password], input[type=email],
input[type=number], textarea {
  background: var(--surface); color: var(--ink);
  border: 1px solid #c9ccd1; border-radius: var(--r-sm); padding: 8px 10px; font: inherit;
  min-height: 40px;
}
select:hover, input:hover, textarea:hover { border-color: var(--grey); }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--plum); color: #fff; border: 1px solid var(--plum); border-radius: var(--r-md);
  padding: 8px 16px; min-height: 40px; font: inherit; font-weight: 600; cursor: pointer;
}
button:hover, .btn:hover { background: var(--plum-700); text-decoration: none; }
button.secondary, .btn.secondary {
  background: var(--surface); color: var(--ink); border: 1px solid #c9ccd1;
}
button.secondary:hover, .btn.secondary:hover { background: var(--panel); }
button.wide { width: 100%; }
.btn-continue { margin-top: 8px; }
label { font-weight: 600; }
.gap-top { margin-top: 16px; }

/* --- page ---------------------------------------------------------------- */
.content { max-width: 1240px; margin: 0 auto; padding: 20px 24px 64px; }
h1 { font-size: var(--fs-2xl); line-height: 1.15; margin: 0 0 6px; font-weight: 750; letter-spacing: -.025em; }
h2 { font-size: var(--fs-lg); line-height: 1.3; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: var(--fs-md); margin: 18px 0 8px; font-weight: 650; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 4px 0 20px; }
.pagehead .lead { color: var(--grey); margin: 0; font-size: var(--fs-md); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { font-size: var(--fs-sm); color: var(--grey); margin: 0 0 4px; }
.crumbs a { font-weight: 600; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 12px; }

/* --- surfaces ------------------------------------------------------------ */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.grid.wide { grid-template-columns: 1fr; }
.panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.panel > header {
  padding: 14px 18px; border-bottom: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: baseline;
}
.panel > .body { padding: 16px 18px; }
.note { color: var(--grey); font-size: var(--fs-sm); font-weight: 400; }
.panel.wide { grid-column: 1 / -1; }

/* --- KPI tiles: the same tinted-tile language as the card's glance row --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow); border-top: 4px solid var(--plum);
}
.stat.t-er { border-top-color: var(--ed); background: linear-gradient(var(--ed-tint), var(--ed-tint)), var(--surface); }
.stat.t-falls { border-top-color: var(--falls); }
.stat.t-quiet { border-top-color: var(--rule); }
.stat .n { font-size: 30px; line-height: 1.1; font-weight: 750; letter-spacing: -.02em; color: var(--plum); font-variant-numeric: tabular-nums; }
.stat.t-falls .n { color: var(--falls); }
.stat.t-quiet .n { color: var(--ink); }
.stat .k { color: var(--soft); font-size: var(--fs-sm); margin-top: 4px; }
.stat .delta { color: var(--grey); font-size: var(--fs-xs); margin-top: 4px; }
.stat .delta.up { color: var(--warn-ink); }
.stat .delta.down { color: var(--green-ink); }

/* A neutral chip for a plain count: a count is a fact, never an alarm. */
.fact {
  background: var(--panel); color: var(--ink); font-weight: 650;
  padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
}

/* --- tables -------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); }
th { color: var(--grey); font-weight: 600; font-size: var(--fs-xs); background: var(--panel); }
tbody tr:hover { background: #faf8fb; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll, .panel > .body { overflow-x: auto; }  /* a wide table scrolls in its card, not the page */
.panel > .body.flush, .panel > .body:has(> table.roster), .panel > .body:has(> table.month-list) { padding: 0; }

/* Homes table: the whole row opens the home. */
table.roster tr.go { position: relative; cursor: pointer; }
table.roster a.rowlink { font-weight: 650; color: var(--ink); }
table.roster a.rowlink::after { content: ""; position: absolute; inset: 0; }
table.roster tr.go:hover a.rowlink { color: var(--plum); text-decoration: none; }
table.roster td.chev { width: 32px; color: var(--grey); text-align: right; font-size: 18px; }
table.roster tr.go:hover td.chev { color: var(--plum); }

/* --- badges -------------------------------------------------------------- */
.sev { padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em; }
.sev-high { background: #fde8ea; color: var(--danger); }
.sev-warning { background: #fbefd9; color: var(--warn-ink); }
.sev-watch { background: #f6f0d4; color: #6a5600; }
.sev-info { background: var(--panel); color: var(--grey); }
.status { color: var(--grey); font-size: var(--fs-xs); }
.status-open { color: var(--danger); }
.status-acknowledged { color: var(--warn-ink); }
.status-resolved { color: var(--green-ink); }

/* --- collapsible sections ------------------------------------------------ */
details.panel { margin: 16px 0; }
details.panel > summary {
  list-style: none; cursor: pointer; padding: 16px 18px; min-height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: var(--r-lg);
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after {
  content: ""; flex: 0 0 auto; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--grey); border-bottom: 2px solid var(--grey);
  transform: rotate(45deg) translateY(-3px); transition: transform .15s;
}
details.panel[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
details.panel[open] > summary { border-bottom: 1px solid var(--rule); border-radius: var(--r-lg) var(--r-lg) 0 0; }
details.panel > summary:hover { background: var(--panel); }
details.panel > summary h2 { display: inline; }
details.panel > summary .note { display: block; margin-top: 2px; }
details > summary { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { details.panel > summary::after { transition: none; } }

/* --- home page: report card + section rail -------------------------------- */
.homelayout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.homemain { min-width: 0; grid-column: 1; grid-row: 1; }
.rail { grid-column: 2; grid-row: 1; position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }
.secnav { display: flex; flex-direction: column; gap: 2px; }
.secnav .secnav-t { font-size: var(--fs-xs); font-weight: 650; color: var(--grey); margin: 0 0 6px 12px; }
.secnav a {
  display: block; padding: 7px 12px; border-radius: var(--r-sm); color: var(--soft);
  font-weight: 550; border-left: 3px solid transparent;
}
.secnav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.secnav a.sub { color: var(--grey); }
.secnav hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 12px; }
.homecard .rc {
  max-width: none; border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.homecard .rc .strip { border-radius: 0; }
.rc h2, details.panel, .ask-home { scroll-margin-top: 84px; }

/* --- misc ---------------------------------------------------------------- */
.muted { color: var(--grey); }
.empty { color: var(--grey); padding: 20px; text-align: center; }
.chart-wrap { position: relative; height: 260px; }
.scroll-body { max-height: 320px; overflow-y: auto; }
.hint { border-bottom: 1px dotted var(--grey); cursor: help; }
.messages { margin: 0 0 16px; padding: 0; list-style: none; }
.messages li {
  padding: 10px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--teal);
  background: var(--surface); border-radius: var(--r-sm);
}
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 4px 0; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.card-controls { display: flex; gap: 4px; align-items: center; }
.card-controls button { padding: 2px 8px; min-height: 28px; font-size: var(--fs-xs); }
.card-controls .on { background: var(--plum); color: #fff; }
.card-controls .off { background: var(--surface); color: var(--grey); border: 1px solid var(--rule); }
tr.no-data td { color: var(--grey); }
tr.group-head td { color: var(--grey); font-size: var(--fs-xs); font-weight: 650; background: var(--panel); }
tr.group-toggle td { border-bottom: 0; }
h3.sub { font-size: var(--fs-sm); margin: 16px 0 6px; font-weight: 650; color: var(--grey); }
h3.sub:first-child { margin-top: 0; }
.grid.home { grid-template-columns: repeat(3, 1fr); }
.grid.home > .panel { grid-column: 1 / -1; }
.grid.home > .panel.trend { grid-column: span 2; }
.grid.home > .panel.aside { grid-column: span 1; }
.panel.trend .chart-wrap, .panel.aside .chart-wrap { height: 340px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 0; font-weight: 600; }

/* The authenticator QR is black modules on transparency: keep a white backing. */
.qr-backing { background: #fff; padding: 12px; border-radius: var(--r-sm); display: inline-block; border: 1px solid var(--rule); }

/* --- account pages: sign in, MFA, password -------------------------------- */
.auth { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; min-height: 100vh; }
.auth-brand {
  /* The heartbeat sits in the empty middle of the panel, clear of the tagline below. */
  background: var(--plum) url("pulse-line.745fde56a22d.svg") no-repeat left 0 top 45%;
  background-size: 140% auto; color: #fff; padding: 48px 56px;
  display: flex; flex-direction: column;
}
.brand-lg { font-size: 30px; color: #fff; gap: 14px; }
.brand-lg .mark { width: 44px; height: 44px; }
.auth-brand .mark rect { fill: #fff; }
.auth-brand .mark path { stroke: var(--plum); }
.auth-tag { font-size: 22px; line-height: 1.35; font-weight: 550; max-width: 22ch; margin: auto 0 0; letter-spacing: -.01em; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; margin-bottom: 20px; }
.auth-card form p { margin: 0 0 16px; }
.auth-card label { display: block; margin-bottom: 6px; font-size: var(--fs-sm); }
.auth-card input:not([type=checkbox]):not([type=hidden]), .auth-card textarea { width: 100%; min-height: 44px; font-size: 16px; }
.auth-card input[type=checkbox] { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.auth-card .helptext, .auth-card .note { display: block; color: var(--grey); font-size: var(--fs-sm); font-weight: 400; margin-top: 6px; }
.auth-card button:not(.secondary) { width: 100%; min-height: 46px; }
.auth-foot { color: var(--grey); margin: 24px 0 8px; font-size: var(--fs-sm); }
.allauth h1 { font-size: 26px; }

/* --- insights: reviewed findings ----------------------------------------- */
.finding { border-top: 1px solid var(--rule); padding: 14px 0; }
.finding:first-child { border-top: 0; padding-top: 2px; }
.finding-head { display: flex; gap: 16px; align-items: flex-start; }
.finding-n { flex: 0 0 128px; text-align: right; }
.finding-n .n { font-size: 24px; font-weight: 750; line-height: 1.15; color: var(--plum); }
.finding-n .k { color: var(--grey); font-size: var(--fs-xs); }
.finding-t { min-width: 0; }
.finding-t h3 { margin: 0 0 4px; font-size: var(--fs-md); }
.finding-t p { margin: 0; color: var(--soft); max-width: 72ch; }
.finding-tbl { margin: 8px 0 0 144px; border-collapse: collapse; font-size: var(--fs-sm); width: auto; }
.finding-tbl th {
  text-align: left; color: var(--grey); font-weight: 400; background: none;
  padding: 2px 10px 2px 0; vertical-align: top; white-space: nowrap; border: 0;
}
.finding-tbl td { padding: 2px 0; vertical-align: top; border: 0; }
.finding-tbl .amended { color: var(--warn-ink); }

/* --- AI Intelligence: a conversation --------------------------------------
   Classes, not style="" attributes: the CSP drops inline style attributes. */
.ai-panel { margin-bottom: 16px; }
.ai-full { width: 100%; }
.ai-sql { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: var(--fs-xs); }
.ai-experimental { margin-bottom: 16px; color: var(--grey); }
.ai-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ai-msg { max-width: 75%; padding: 10px 14px; border-radius: var(--r-lg); border: 1px solid var(--rule); }
.ai-you { align-self: flex-end; background: var(--plum); color: #fff; border-color: var(--plum); border-bottom-right-radius: 4px; }
.ai-you a { color: #fff; text-decoration: underline; }
.ai-bot { align-self: flex-start; background: var(--surface); color: var(--ink); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.ai-compose { position: sticky; bottom: 12px; margin-top: 16px; }
.ai-compose-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
.ai-options { flex: 1; }
.ai-options summary { color: var(--grey); }
.ai-hidden-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* "No names" notice: top of the AI tab and beside every ask box. */
.ai-privacy { margin: 0 0 var(--s3); padding: var(--s2) var(--s3); border-left: 3px solid var(--plum);
              background: var(--plum-50); color: var(--soft); font-size: var(--fs-sm);
              border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ask-home .ai-privacy { margin: 0; }

/* Ask about this home (decision 12). */
.ask-home { margin: 16px 0; }
.ask-home .body { display: flex; flex-direction: column; gap: 8px; }
.ask-home button { align-self: flex-start; }

/* --- tablet: the section rail becomes a sticky chip row ------------------- */
@media (max-width: 1100px) {
  .homelayout { grid-template-columns: 1fr; gap: 0; }
  .homemain, .rail { grid-column: 1; grid-row: auto; }
  .rail { order: -1; top: 60px; z-index: 20; margin: 0 -24px 12px; padding: 8px 24px;
          background: rgba(244,243,247,.94); border-bottom: 1px solid var(--rule); }
  .secnav { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .secnav .secnav-t, .secnav hr { display: none; }
  .secnav a { white-space: nowrap; border: 1px solid var(--rule); background: var(--surface);
              border-radius: 999px; padding: 6px 14px; font-size: var(--fs-sm); }
  .rail .actions { display: none; }
}

/* --- phone (<=900px) ------------------------------------------------------ */
@media (max-width: 900px) {
  .topbar-in { padding: 0 8px 0 16px; gap: 8px; height: 56px; }
  .brand { font-size: 17px; }
  .brand .mark { width: 26px; height: 26px; }
  .tabs { margin-left: auto; gap: 0; }
  .tabs a { padding: 0 10px; min-width: 44px; justify-content: center; }
  .tabs .long, .tabs .sev { display: none; }
  .tabs .short { display: inline; }
  .navtoggle {
    display: inline-flex; background: none; border: 0; padding: 0;
    min-height: 44px; min-width: 44px;
  }
  .navtoggle:hover { background: var(--panel); }
  .navlinks {
    display: none; position: absolute; right: 8px; top: 56px; min-width: 220px;
    flex-direction: column; align-items: stretch; gap: 8px; padding: 14px;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md);
    box-shadow: 0 8px 24px rgba(22,24,28,.12);
  }
  .topbar.open .navlinks { display: flex; }
  .navlinks button { width: 100%; }
  .rail { top: 56px; margin: 0 -16px 12px; padding: 8px 16px; }
  .secnav a { min-height: 40px; display: inline-flex; align-items: center; }

  .contextbar { padding: 14px 16px 0; }
  .controls { gap: 10px; }
  .controls > span { flex: 1 1 100%; }
  .switcher { display: flex; align-items: center; }
  .switcher select { flex: 1; min-width: 0; }
  .window .seg { flex: 0 0 auto; }
  .seg a { min-height: 40px; }
  select, input[type=date], input[type=text], input[type=password], input[type=email], textarea, button, .btn {
    min-height: 44px; font-size: 16px;  /* 16px stops iOS zooming on focus */
  }

  .content { padding: 14px 16px 48px; }
  h1 { font-size: 26px; }
  .grid, .grid.wide, .grid.home { grid-template-columns: 1fr; }
  .grid.home > .panel.trend, .grid.home > .panel.aside { grid-column: 1 / -1; }
  .panel.trend .chart-wrap, .panel.aside .chart-wrap { height: 220px; }
  .panel > header, .panel > .body, details.panel > summary { padding-left: 14px; padding-right: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .n { font-size: 24px; }
  .chart-wrap { height: 210px; }
  .filters > span { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; }
  .filters select { flex: 1; min-width: 0; }
  td.muted { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ai-msg { max-width: 90%; }
  .ai-compose-row { flex-direction: column; align-items: stretch; }

  .auth { grid-template-columns: 1fr; min-height: 0; }
  /* Phone: the logo and tagline sit centred at the top of the page. */
  /* No heartbeat line on phones: the header is short and it would run behind the text. */
  .auth-brand { padding: 24px 20px 28px; background-image: none;
                align-items: center; text-align: center; }
  .brand-lg { font-size: 24px; justify-content: center; }
  .brand-lg .mark { width: 36px; height: 36px; }
  .auth-tag { font-size: 16px; margin: 18px auto 0; max-width: 30ch; }
  .auth-main { padding: 28px 20px 40px; align-items: flex-start; }

  /* Problems queue (retired tab, code kept): columns 3/4/7 by position — the order is
     fixed in problems/list.html and guarded by tests/test_responsive.py. */
  .problems-queue th:nth-child(3), .problems-queue td:nth-child(3),
  .problems-queue th:nth-child(4), .problems-queue td:nth-child(4),
  .problems-queue th:nth-child(7), .problems-queue td:nth-child(7) { display: none; }
  .problems-queue td:nth-child(5) { max-width: 42vw; }
  .hide-sm { display: none; }
}

@media (max-width: 700px) {
  .finding-head { display: block; }
  .finding-n { text-align: left; margin-bottom: 4px; }
  .finding-tbl { margin-left: 0; }
}

@media (max-width: 420px) {
  .stat .n { font-size: 22px; }
  .chart-wrap { height: 180px; }
}

/* Printing an app page (not the printable card route, which has its own sheet):
   drop the chrome and the screen-only sections. */
@media print {
  body { background: #fff; }
  .topbar, .contextbar, .rail, .skip, details.panel, .ask-home, .actions, .noprint { display: none !important; }
  .content { padding: 0; max-width: none; }
  .homelayout { display: block; }
  .homecard .rc { border: 0; box-shadow: none; }
}
#secnav-card { display: contents; }
.panel.stack { margin-bottom: 16px; }
.filters.flush-bottom { margin: 12px 0 0; }
/* Grid children may shrink below their content (a chart canvas, a chip row): the
   content scrolls inside them instead of pushing the page sideways. */
.grid > *, .homelayout > * { min-width: 0; }
/* Month drill-down chips under a trend (decision 9). */
.month-links { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px;
  border: 1px solid var(--rule); border-radius: 999px; color: var(--soft); background: var(--surface);
  font-size: var(--fs-sm);
}
.chips a b { color: var(--plum); font-variant-numeric: tabular-nums; }
.chips a:hover { border-color: var(--plum); text-decoration: none; background: var(--plum-50); }
@media (max-width: 900px) { .chips a { min-height: 44px; } }

/* Names the retired pages' sheets (register.css, rounding.css) still use. Light only. */
:root { --line: var(--rule); --muted: var(--grey); --accent: var(--teal-ink); --panel-2: var(--panel);
        --text: var(--ink); --warn: #b7791f; --high: var(--danger); }
@media (max-width: 560px) {
  .homecard .rc { padding: 0 14px 16px; }
  .homecard .rc .strip { margin: 0 -14px 12px; padding: 8px 14px; }
}
/* A table wider than its card shows a soft edge shadow on the side that scrolls. */
.table-scroll {
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(255,255,255,0)) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(22,24,28,.16), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(22,24,28,.16), transparent) right center / 12px 100% no-repeat scroll;
}
.month-list td:first-child { white-space: nowrap; }
