/* Resolyn UI (the 2026-11-19 look): soft white tiles on a light gray page, one rounded font (Manrope), indigo for the one thing to do, gold only for the next step.
   Mobile first: the base styles are the phone layout, wider screens add to them. */
:root {
  --brand: #2c349c;
  --brand-dk: #1f2577;
  --brand-mid: #8088d8;
  --tint: #e9ebfb;
  --tint2: #e7e8f2;
  --gold: #be8a2e;
  --gold-soft: #fcf0db;
  --gold-ink: #8a5600;
  --ink: #1a1b1f;
  --muted: #63656e;
  --line: #e6e6eb;
  --bg: #f4f4f6;
  --card: #ffffff;
  --danger: #b32b21;
  --ok: #1a7448;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .04), 0 6px 20px rgba(20, 22, 40, .05);
  --head-font: Manrope, -apple-system, "Segoe UI", system-ui, sans-serif;
  --body-font: Manrope, -apple-system, "Segoe UI", system-ui, sans-serif;
  --nav-h: 56px;
  --side-w: 96px;
  --side-w-collapsed: 68px;
  --head: #1a1b1f;            /* headings and secondary button text */
  --top-bg: #1a1b1f;          /* tooltips */
  --side-bg: #ffffff;         /* the sidebar and the phone's top bar */
  --side-ink: #45474f; --side-hi: #1a1b1f; --side-ink2: #63656e; --side-hover: #f0f0f4; --side-on: #e9ebfb; --side-on-ink: #2c349c; --side-field: #f4f4f6;
  --btn: #2c349c;             /* primary button background */
  --field-line: #d6d7df;
  --field-bg: #ffffff;
  --hover2: #d8daec;
  --code-bg: #f4f4f6;
  --chip-red-bg: #fce9e6;   --chip-red: #9c241b;
  --chip-gold-bg: #fcf0db;  --chip-gold: #7a4c00;
  --chip-yellow-bg: #fbf3cf; --chip-yellow: #6b5800;
  --chip-blue-bg: #e3eefb;  --chip-blue: #1d4a7a;
  --chip-purple-bg: #efe6f7; --chip-purple: #53307a;
  --chip-green-bg: #e3f4ea; --chip-green: #17663f;
  --chip-teal-bg: #dcf1f1;  --chip-teal: #135b5b;
  --chip-gray-bg: #ededf1;
  --pill-k-bg: #2c349c; --pill-k-ink: #ffffff; --pill-edge: #d6d7df;
  --view-bg: #8a1c14;         /* "you are inside a firm as support" banner */
  --view-ink: #ffffff;
  color-scheme: light;
}
/* Dark mode: follows the device unless the person picked Light or Dark (the Theme button). A dark gray page with lighter gray tiles and off-white text, never near-black with pure white: that much contrast makes text glow and read as blurry (Aaron, 2026-11-19). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --brand: #a9afff; --brand-dk: #c9cdf5; --brand-mid: #8088d8;
  --tint: #23265a; --tint2: #2a2c35;
  --gold: #d9a441; --gold-soft: #2b1f0b; --gold-ink: #edb65c;
  --ink: #e9eaee; --muted: #adb0bb; --line: #2e3039; --bg: #14151a; --card: #1d1e25;
  --danger: #ff8e82; --ok: #63d495;
  --shadow: 0 0 0 1px #2e3039;
  --head: #f1f2f5; --top-bg: #33353f; --btn: #535cd6;
  --side-bg: #17181d; --side-ink: #c9cad2; --side-hi: #f1f2f5; --side-ink2: #adb0bb; --side-hover: #22242b; --side-on: #23265a; --side-on-ink: #c3c7ff; --side-field: #1d1e25;
  --field-line: #3d3f4a; --field-bg: #15161b; --hover2: #363844; --code-bg: #15161b;
  --chip-red-bg: #2e1513; --chip-red: #ffb4ab;
  --chip-gold-bg: #2b1f0b; --chip-gold: #f3cf80;
  --chip-yellow-bg: #2c2709; --chip-yellow: #f0e08a;
  --chip-blue-bg: #14263a; --chip-blue: #9cc8f5;
  --chip-purple-bg: #271c3a; --chip-purple: #d3b8f5;
  --chip-green-bg: #10271b; --chip-green: #8fdcae;
  --chip-teal-bg: #0f2b2a;  --chip-teal: #8fdcd8;
  --chip-gray-bg: #2a2c35;
  --view-bg: #b3302a; --view-ink: #ffffff;
  --pill-k-bg: #3a41a8; --pill-k-ink: #ffffff; --pill-edge: #3d3f4a;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --brand: #a9afff; --brand-dk: #c9cdf5; --brand-mid: #8088d8;
  --tint: #23265a; --tint2: #2a2c35;
  --gold: #d9a441; --gold-soft: #2b1f0b; --gold-ink: #edb65c;
  --ink: #e9eaee; --muted: #adb0bb; --line: #2e3039; --bg: #14151a; --card: #1d1e25;
  --danger: #ff8e82; --ok: #63d495;
  --shadow: 0 0 0 1px #2e3039;
  --head: #f1f2f5; --top-bg: #33353f; --btn: #535cd6;
  --side-bg: #17181d; --side-ink: #c9cad2; --side-hi: #f1f2f5; --side-ink2: #adb0bb; --side-hover: #22242b; --side-on: #23265a; --side-on-ink: #c3c7ff; --side-field: #1d1e25;
  --field-line: #3d3f4a; --field-bg: #15161b; --hover2: #363844; --code-bg: #15161b;
  --chip-red-bg: #2e1513; --chip-red: #ffb4ab;
  --chip-gold-bg: #2b1f0b; --chip-gold: #f3cf80;
  --chip-yellow-bg: #2c2709; --chip-yellow: #f0e08a;
  --chip-blue-bg: #14263a; --chip-blue: #9cc8f5;
  --chip-purple-bg: #271c3a; --chip-purple: #d3b8f5;
  --chip-green-bg: #10271b; --chip-green: #8fdcae;
  --chip-teal-bg: #0f2b2a;  --chip-teal: #8fdcd8;
  --chip-gray-bg: #2a2c35;
  --view-bg: #b3302a; --view-ink: #ffffff;
  --pill-k-bg: #3a41a8; --pill-k-ink: #ffffff; --pill-edge: #3d3f4a;
  color-scheme: dark;
}
/* Manrope (SIL Open Font License, static/fonts/LICENSE-Manrope-OFL.txt): one variable file, served by us (the page policy allows no outside fonts). */
@font-face { font-family: Manrope; src: url("fonts/Manrope-Variable.c9ecede79fde.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Crisp text on a Mac (Aaron, 2026-11-19: "blurry in Chrome"): macOS thickens every letter by default, which makes this font look soft on a sharp display. Grayscale smoothing
   draws the letters as designed. Body text keeps its natural spacing (tightening small text adds to the smudge); only headings are tightened. Font sizes are whole pixels. */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { margin: 0; font: 500 15px/1.5 var(--body-font); color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; font-synthesis-weight: none; }
strong, b { font-weight: 700; }
a { color: var(--brand); font-weight: 600; text-decoration: none; text-underline-offset: 2px; }
a:hover, a:focus-visible { text-decoration: underline; }
p a, li a, .help a, .muted a, .notice a, .small a { text-decoration: underline; text-decoration-color: var(--brand-mid); }  /* a link inside a sentence keeps its underline: color is never the only signal */
h1, h2, h3 { font-family: var(--head-font); color: var(--head); font-weight: 800; letter-spacing: -.03em; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 18px; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 700; margin: 20px 0 6px; color: var(--muted); letter-spacing: 0; }
:focus-visible { outline: 3px solid var(--brand-mid); outline-offset: 2px; }

/* Top bar */
header.top { display: flex; align-items: center; gap: 12px; min-height: var(--nav-h); padding: 8px 16px; background: var(--side-bg); color: var(--side-hi); border-bottom: 1px solid var(--line); }
header.top .brand { font: 800 20px var(--head-font); letter-spacing: -.03em; color: var(--side-hi); text-decoration: none; margin-right: 8px; }
header.top .brand::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--gold); }
header.top .spacer { flex: 1; }
header.top form { margin: 0; }
header.top .muted { color: var(--side-ink2); font-size: 14px; }
header.top select { width: auto; max-width: 180px; padding: 6px 8px; font-size: 14px; }
header.top button.link { color: var(--side-ink); font-size: 14px; padding: 8px 4px; }

/* Phone: main links live in a bar at the bottom, in easy reach of a thumb */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottombar a { flex: 1; text-align: center; padding: 12px 4px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; border-top: 3px solid transparent; }
.bottombar a.on { color: var(--brand); border-top-color: var(--brand); }
body.has-nav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }  /* the bar's own height, its safe area, and a gap so the last line is not against it */

main { max-width: 1040px; margin: 16px auto; padding: 0 16px; }
main.wide { max-width: 1240px; }
/* A page that is mostly a wide table of figures (the collection report, the compliance dashboard, a tax record, Cases, Clients, the activity log) uses the whole width of a
   big screen instead of scrolling sideways inside a narrow column (Aaron, 2026-11-23). Capped so a line on a very wide monitor stays readable. */
main.full { max-width: 1880px; }
.card { background: var(--card); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 32px auto; }

/* Page header: title, subtitle, actions */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pagehead h1 { margin-bottom: 4px; }
.crumb { font-size: 14px; margin-bottom: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
button, .button { display: inline-block; padding: 10px 16px; min-height: 44px; border: 0; border-radius: 999px; background: var(--btn); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .button:hover { filter: brightness(1.15); }
button.secondary, .button.secondary { background: var(--tint2); color: var(--head); }
button.secondary:hover, .button.secondary:hover { background: var(--hover2); filter: none; }
button.link { background: none; color: var(--muted); padding: 0; min-height: 0; font-weight: 500; border-radius: 6px; }
button.small, .button.small { padding: 6px 14px; min-height: 36px; font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* Form controls */
label { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 4px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=url], textarea, select {
  width: 100%; padding: 10px; min-height: 44px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); font: inherit; background: var(--field-bg); color: var(--ink);
}
textarea { min-height: 88px; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: 3px solid var(--tint); }
.errorlist { color: var(--danger); margin: 4px 0; padding-left: 18px; font-size: 14px; }
.help { font-size: 13px; color: var(--muted); margin-top: 2px; }
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 12px; min-height: 44px; }
.field.check input { width: 20px; height: 20px; }

.tin-row { display: flex; gap: 8px; }
.tin-row input { flex: 1; min-width: 0; }

/* Form sections */
.fields { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.field.wide { grid-column: 1 / -1; }
fieldset.section { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.section > legend { float: left; width: 100%; margin-top: 20px; padding: 16px 0 4px; border-top: 1px solid var(--line); font: 800 16px var(--head-font); letter-spacing: -.02em; color: var(--head); }
fieldset.section:first-of-type > legend { margin-top: 0; padding-top: 4px; border-top: 0; }
fieldset.section > .fields { clear: both; }
details.section { border: 0; border-radius: 14px; margin-top: 20px; padding: 0 14px; background: var(--tint); }
details.section > summary { padding: 12px 0; }
details.section[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
details.section .fields { padding-bottom: 12px; }
.section-hint { font-size: 14px; color: var(--muted); margin: 2px 0 0; }

/* Labeled facts: replaces paragraphs of run-together text */
dl.kv { display: grid; grid-template-columns: 1fr; margin: 0; }
dl.kv > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
dl.kv > div:last-child { border-bottom: 0; }
dl.kv dt { font-size: 13px; color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 600; }
.pending { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; font-weight: 600; }

/* Tabs. Without JavaScript every panel simply shows, one after another. */
.tabs { display: flex; gap: 2px; overflow-x: auto; max-width: 100%; width: fit-content; margin: 0 0 16px; padding: 4px; border-radius: 999px; background: var(--chip-gray-bg); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs-select { display: none; width: 100%; margin: 0 0 16px; font-weight: 700; }
@media (max-width: 640px) { .tabs-select { display: block; } nav.tabs[data-tabs] { display: none; } }
.tabs a { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 15px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a.on { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.js .panel { display: none; }
.js .panel.active { display: block; }
html:not(.js) .tabs { display: none; }

/* Lists, badges, misc */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
ul.iarange li { padding: 2px 0; border-bottom: 0; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.late { color: var(--danger); font-weight: 600; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--tint2); color: var(--head); white-space: nowrap; }
.monthlydraft form + form { margin-top: 10px; }
.verifyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }  /* the Estimate or Verified chip and its button: a gap when the button wraps under the chip */
.badge.ghost, .badge.deadline_no_task { background: var(--chip-red-bg); color: var(--chip-red); }
.badge.slow_roll { background: var(--gold-soft); color: var(--gold-ink); }
.badge.yes_client, .badge.consult_quiet { background: var(--chip-yellow-bg); color: var(--chip-yellow); }
.badge.waiting_room { background: var(--chip-blue-bg); color: var(--chip-blue); }
.badge.update_due, .badge.step_late { background: var(--chip-purple-bg); color: var(--chip-purple); }
.badge.sev-info { background: var(--chip-blue-bg); color: var(--chip-blue); }
.badge.sev-money { background: var(--chip-green-bg); color: var(--chip-green); }
.badge.sev-warning { background: var(--chip-gold-bg); color: var(--chip-gold); }
.badge.sev-critical { background: var(--chip-red-bg); color: var(--chip-red); }
.badge.sev-warning::before, .badge.sev-critical::before { content: "! "; font-weight: 800; }
.badge.on_track { background: var(--chip-green-bg); color: var(--chip-green); }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { background: var(--tint); color: var(--ink); padding: 12px 16px; border-radius: 14px; font-weight: 600; }
/* Each message says what kind it is, by color AND a symbol (Aaron, 2026-11-23: an IRS error looked exactly like a success and went unnoticed). */
.messages li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; border: 1px solid transparent; }
.messages .msgsym { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--chip-gray-bg); }
.messages li.msg-error { background: var(--chip-red-bg); color: var(--chip-red); border-color: var(--chip-red); }
.messages li.msg-error .msgsym { background: var(--chip-red); color: var(--chip-red-bg); }
.messages li.msg-warning { background: var(--chip-yellow-bg); color: var(--chip-yellow); border-color: var(--chip-yellow); }
.messages li.msg-warning .msgsym { background: transparent; }
.messages li.msg-success { background: var(--chip-green-bg); color: var(--chip-green); }
.messages li.msg-success .msgsym { background: var(--chip-green); color: var(--chip-green-bg); }
.codes { font-family: ui-monospace, monospace; columns: 2; font-size: 16px; }

/* The one next step: always the first thing on a case */
.nextstep { padding: 16px 20px; background: var(--btn); color: #fff; border-radius: 16px; margin: 12px 0 0; }
.nextstep a { color: #fff; }
.nextstep .label { font-size: 13px; font-weight: 700; color: #d5d8f7; }
.nextstep .what { font-size: 20px; font-weight: 800; letter-spacing: -.025em; line-height: 1.25; color: #fff; }
.nextstep .when { color: #d5d8f7; font-weight: 600; }
.nextstep .when.late { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; }
.factline { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.factline strong { color: var(--ink); }

details { margin-top: 12px; }

/* "Add ..." and "Change ..." forms open in a popup (static/app.js); a full-screen sheet on phones */
.addbtn { margin-top: 12px; margin-right: 6px; }  /* a popup button next to another one on the same line: the line gap alone is only 4px */
.row .addbtn, .actions .addbtn, .picktools .addbtn, .sortbtns .addbtn, .contactbtns .addbtn, .stageactions .addbtn, .actions-quiet .addbtn { margin-right: 0; }  /* these rows set their own gap */
.actions-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }  /* every plain row of buttons gets a gap, never just the space between inline boxes */
.actions-quiet > form { margin: 0; }  /* a form's own bottom margin lifted its button above the links beside it */
.emailok { margin-top: 12px; }
.contactadd { margin-top: 16px; }  /* the contact card's Add buttons: one row, one size */
.contactadd .addbtn { margin-top: 0; }
.emailperm { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }  /* the Contact tab's two email consents, as aligned rows */
.emailperm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.emailperm-head h3 { margin: 0; }
.permrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.permrow + .permrow { border-top: 1px solid var(--line); }
.permtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.permcontrol { flex: none; }
.permcontrol form { margin: 0; }
.permcontrol select { width: 15em; margin: 0; }
@media (max-width: 640px) { .permrow { flex-direction: column; align-items: stretch; gap: 8px; } .permcontrol select { width: 100%; } .contactadd .addbtn { width: 100%; } }
.row .addbtn, .row form, .contactbtns .addbtn { margin-top: 0; }  /* buttons in a row line up with the others */
.contactrow { display: flex; gap: 8px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.contactrow .contactinfo { flex: 1 1 260px; min-width: 0; }
.contactrow .contactbtns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.contactrow .contactbtns form { margin: 0; }
.contactrow .contactbtns button, .contactrow .contactbtns .button { display: inline-flex; align-items: center; justify-content: center; height: 36px; min-width: 76px; box-sizing: border-box; }  /* the same height, width and centered text, so Edit and Remove line up from row to row */  /* the same height and centered text, whether it is a link or a button */
.actions .addbtn { margin-top: 0; }
.add-chooser fieldset { border: 0; margin: 8px 0 4px; padding: 0; }
.add-chooser legend { font-weight: 700; margin-bottom: 6px; }
.add-chooser label { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 6px 0; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.add-chooser label:has(input:checked) { border-color: var(--brand); background: var(--tint); }
.add-chooser input { width: auto; margin: 0; }
.add-panel { margin-top: 12px; }
.add-panel h3 { margin: 0 0 4px; }
.add-panel[hidden], .field[hidden] { display: none; }
dialog.form-dialog { padding: 0; border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); width: min(94vw, 640px); max-height: 90vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
dialog.form-dialog::backdrop { background: rgba(10, 12, 30, .6); }
.form-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.form-dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-x { min-width: 44px; min-height: 44px; font-size: 24px; line-height: 1; padding: 0; }
.form-dialog-body { padding: 8px 20px 20px; }
.form-dialog .form-actions { position: sticky; bottom: 0; z-index: 1; background: var(--card); margin-top: 16px; padding: 12px 0 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  dialog.form-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .form-dialog .form-actions { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
summary { cursor: pointer; color: var(--brand); font-weight: 600; min-height: 32px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 4px 0; }
.checklist label { font-weight: 400; margin: 0; display: flex; gap: 8px; align-items: flex-start; }
.checklist input { width: 20px; height: 20px; margin-top: 2px; }
pre.update { white-space: pre-wrap; font: inherit; background: var(--bg); padding: 10px; border-radius: 6px; margin: 6px 0 0; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.searchbar { margin: 12px 0; }

/* Activity feed */
.feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--muted); }
.feed-text { margin-top: 2px; }
.feed li.system .feed-text { color: var(--muted); font-size: 15px; }
.badge.case { background: var(--tint); color: var(--brand); text-decoration: none; }
.badge.general { background: var(--chip-gray-bg); color: var(--muted); }
.badge.private { background: var(--chip-red-bg); color: var(--chip-red); }
.badge.shared { background: var(--chip-green-bg); color: var(--chip-green); }

/* Tables: on a phone every row becomes a small card, labelled by data-label */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; }
table.stack thead { display: none; }
table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
table.stack td { border: 0; padding: 2px 0; }
table.stack td[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; font-size: 13px; color: var(--muted); }
table.stack td.primary { font-size: 17px; font-weight: 600; }
table.stack td.primary::before, table.stack td.primary[data-label]:not([data-label=""])::before, table.stack td.nolabel[data-label]:not([data-label=""])::before { content: none; }
table.stack td:empty { display: none; }

/* Tablet and up */
@media (min-width: 720px) {
  main { margin: 28px auto; }
  .card { padding: 24px; }
  h1 { font-size: 28px; }
  .fields { grid-template-columns: repeat(2, 1fr); }
  dl.kv { grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  table.stack thead { display: table-header-group; }
  table.stack { display: table; }
  table.stack tbody { display: table-row-group; }
  table.stack tr { display: table-row; padding: 0; }
  table.stack td { display: table-cell; width: auto; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  table.stack td[data-label]::before, table.stack td[data-label]:not([data-label=""])::before { content: none; }  /* a real table shows its header row: no repeated labels (the phone rule above is as specific, so this must repeat it) */
  table.stack td.primary { font-size: inherit; }
  table.stack td:empty { display: table-cell; }
}
@media (min-width: 1000px) {
  .fields.three { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.notice { background: var(--gold-soft); padding: 12px 16px; margin: 12px 0; border-radius: 14px; }
pre.sharedtext { max-height: 420px; overflow: auto; background: var(--code-bg); padding: 12px; font-size: 13px; white-space: pre-wrap; }
.supportbanner { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--chip-gold-bg); color: var(--chip-gold); font-size: 14px; }
.supportbanner.viewing { background: var(--view-bg); color: var(--view-ink); font-weight: 600; border-bottom: 3px solid var(--gold); }
.supportbanner form { margin: 0; }
.filters { display: flex; gap: 14px; margin: 8px 0 12px; }
.filters a.on { font-weight: 800; text-decoration: none; color: var(--ink); }

.themebtn { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--side-ink); min-height: 0; width: 40px; height: 40px; padding: 0; border-radius: 8px; }
.themebtn:hover { background: var(--side-hover); filter: none; }
.actions .badge { align-self: center; }
.refpill { display: inline-flex; align-items: stretch; min-height: 0; padding: 0; border: 1px solid var(--pill-edge); border-radius: 999px; overflow: hidden; background: var(--code-bg); font: inherit; cursor: copy; vertical-align: middle; }
.refpill .k { padding: 2px 9px 2px 11px; background: var(--pill-k-bg); color: var(--pill-k-ink); font: 700 11px var(--body-font); letter-spacing: .6px; text-transform: uppercase; display: inline-flex; align-items: center; }
.refpill .v { padding: 2px 11px 2px 9px; color: var(--ink); font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .4px; display: inline-flex; align-items: center; }
.refpill:hover { border-color: var(--brand); filter: none; }
.refpill.copied .k { background: var(--chip-green); color: var(--card); }
.findbox { display: flex; gap: 8px; }
.findbox input { min-width: 0; }
.findbox button { min-height: 0; padding: 6px 12px; }
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font: italic 700 11px Georgia, serif; text-transform: none; letter-spacing: 0; cursor: help; vertical-align: middle; }
.tip:hover, .tip:focus { color: var(--brand); border-color: var(--brand); outline: none; }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 150%; transform: translateX(-30%); width: 240px; max-width: 70vw; padding: 8px 10px; border-radius: 8px; background: var(--top-bg); color: #fff; font: 400 13px/1.4 var(--body-font); font-style: normal; text-transform: none; letter-spacing: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; z-index: 30; transition: opacity .12s; }
.tip:hover::after, .tip:focus::after { opacity: 1; }
.tip.wide::after { width: 320px; }
/* On a phone a hidden tooltip still counts toward the page width, so one beside a heading near the right edge made the page scroll sideways: it only exists while shown. */
@media (max-width: 699px) { .tip:not(:hover):not(:focus)::after { display: none; } }

/* Status chips: green = good, yellow = not asked yet, red = needs attention, gray = a plain fact.
   Each also has its own symbol and words, so color is never the only signal. */
.statechip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px 1px 6px; border-radius: 999px; font-size: 14px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.statechip .sym { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; font-size: 12px; font-weight: 800; background: var(--card); color: inherit; }
.statechip.state-good { background: var(--chip-green-bg); color: var(--chip-green); border-color: var(--chip-green); }
.statechip.state-ask { background: var(--chip-yellow-bg); color: var(--chip-yellow); border-style: dashed; border-color: var(--chip-yellow); }
.statechip.state-bad { background: var(--chip-red-bg); color: var(--chip-red); border-color: var(--chip-red); }
.statechip.state-bad .sym { border-radius: 4px; }
.statechip.state-soon { background: var(--chip-yellow-bg); color: var(--chip-yellow); border-color: var(--chip-yellow); }
.statechip.state-soon .sym { border-radius: 3px; font-size: 10px; }
.statechip.state-open { background: var(--chip-blue-bg); color: var(--chip-blue); border-color: var(--chip-blue); }
.statechip.kind-person { background: var(--chip-blue-bg); color: var(--chip-blue); border-color: var(--chip-blue); }
.statechip.kind-org { background: var(--chip-purple-bg); color: var(--chip-purple); border-color: var(--chip-purple); }
.statechip.state-monitor { background: var(--chip-teal-bg); color: var(--chip-teal); border-color: var(--chip-teal); }  /* a monitoring plan: teal, so it never reads as the green Client pill */
.statechip.state-gold { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold); }
.statechip.rule-standard { background: var(--chip-blue-bg); color: var(--chip-blue); border-color: var(--chip-blue); }
.statechip.rule-lower { background: var(--chip-purple-bg); color: var(--chip-purple); border-color: var(--chip-purple); }
.statechip.rule-novehicle { background: var(--chip-blue-bg); color: var(--chip-blue); border-color: var(--chip-blue); border-style: dashed; }
.statechip.rule-actual { background: var(--chip-green-bg); color: var(--chip-green); border-color: var(--chip-green); }
.statechip.rule-yours { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold); }
.yesno { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.yesno button.on { background: var(--gold-soft); color: var(--gold-ink); border: 2px solid var(--gold); font-weight: 700; }
.statechip.state-neutral { background: var(--chip-gray-bg); color: var(--ink); border-color: var(--line); }
.alertcard { box-shadow: var(--shadow), inset 0 4px 0 var(--gold); }
.alertcard.level-bad { box-shadow: var(--shadow), inset 0 4px 0 var(--chip-red); }
.alertcard.level-warn { box-shadow: var(--shadow), inset 0 4px 0 var(--gold); }
.alertcard h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.alertcard ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.irsflag { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.alertcard h2 .statechip { font-family: var(--body-font); font-size: 15px; }
h1 .statechip { vertical-align: middle; position: relative; top: -2px; margin-left: 6px; font-family: var(--body-font); }  /* a status pill beside a page title sits on the title's middle, not its baseline (portal/_contact_card.html, scheduling/settings.html) */
#portal .actions-quiet { margin-top: 20px; }  /* room between the status line and the buttons */
.viewerframe { width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.viewer > summary { font-weight: 600; cursor: pointer; }

/* ---- Navigation: a left sidebar on wide screens (collapsible to icons), a drawer on phones and tablets ---- */
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
header.top .menubtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 0; padding: 0; background: transparent; color: var(--side-hi); border-radius: 8px; }
header.top .headfirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 62vw; }
.idlewarn { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: min(92vw, 520px); padding: 12px 16px; background: var(--card); color: var(--ink); border: 2px solid var(--gold); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
@media (min-width: 900px) { .idlewarn { bottom: 24px; } }
.firmnudge .sym { margin-right: 6px; flex: none; }
/* One line at every width (Aaron, 2026-11-30: it wrapped on a phone): the count and firm, cut with an ellipsis if they must be, then Switch. The full sentence is in the title and for screen readers. */
.firmnudge button { display: inline-flex; align-items: center; max-width: 100%; white-space: nowrap; }
.firmnudge .nudgetext { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.firmnudge .nudgego { flex: none; margin-left: 8px; font-weight: 700; }
header.top .firmnudge { max-width: 100%; }
header.top .firmnudge button { color: var(--ink); }
.sidefirm .firmswitch select { width: 100%; }
.sidefirm .firmnudge { margin-top: 6px; }
.sidefirm .firmnudge button { width: 100%; justify-content: flex-start; }
.sidefirm .firmnudge .nudgego { margin-left: auto; padding-left: 8px; }
/* The sidebar already shows the firm menu on wide screens; the header copy is for phones and narrow windows. */
@media (min-width: 900px) { header.top .headfirm { display: none; } }
header.top .firmname { font-size: 14px; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrim { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .5); }
html.nav-open .scrim { display: block; }
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(300px, 86vw); display: flex; flex-direction: column; gap: 6px; padding: calc(12px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom)); background: var(--side-bg); color: var(--side-ink); overflow-y: auto; transform: translateX(-102%); transition: transform .18s ease; visibility: hidden; }
html.nav-open .sidebar { transform: none; visibility: visible; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 8px; }
.side-head .brand { font: 800 21px var(--head-font); letter-spacing: -.03em; color: var(--side-hi); text-decoration: none; }
.side-head .brand::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--gold); }
.side-head button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; min-height: 0; padding: 0; background: transparent; color: var(--side-ink); border-radius: 8px; }
.side-head button:hover, .sidebar .navitem:hover, .sidebar .linkbtn:hover { background: var(--side-hover); filter: none; }
.side-head .collapse { display: none; }
.side-head .sidebell { margin-left: auto; padding: 6px 8px; border-radius: 8px; color: var(--side-ink); }
.side-head .sidebell:hover { background: var(--side-hover); }
.side-head .sidebell.on { background: var(--side-on); color: var(--side-on-ink); }
.side-head .sidebell .bellcount { top: 0; right: 0; }
.sidebar .findbox { padding: 4px 6px 10px; }
.sidebar .findbox input { background: var(--side-field); color: var(--side-hi); border-color: var(--field-line); min-height: 38px; padding: 6px 10px; font-size: 14px; }
.sidebar .findbox input::placeholder { color: var(--side-ink2); }
.sidebar .findbox button { background: var(--side-hover); color: var(--side-hi); min-height: 38px; }
.side-title { display: block; padding: 14px 12px 4px; font: 700 12px var(--body-font); color: var(--side-ink2); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar .navitem, .sidebar .linkbtn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; min-height: 44px; border-radius: 14px; color: var(--side-ink); text-decoration: none; font-weight: 700; font-size: 15px; background: transparent; text-align: left; }
.sidebar .navitem.on { background: var(--side-on); color: var(--side-on-ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-foot form { margin: 0; }
.side-foot select { background: var(--side-field); color: var(--side-hi); border-color: var(--field-line); min-height: 38px; font-size: 14px; margin: 4px 0 6px; }
.side-foot select option { color: #26262e; }
.side-foot .firmline { padding: 6px 12px; font-size: 13px; color: var(--side-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .themebtn { width: 100%; height: auto; justify-content: flex-start; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--side-ink); }
.shell { min-width: 0; }

@media (min-width: 900px) {
  header.top, .scrim, .bottombar { display: none !important; }
  body.has-nav { padding-bottom: 0; }
  .sidebar { width: var(--side-w); transform: none; visibility: visible; transition: width .15s ease; }
  body.has-nav .shell { margin-left: var(--side-w); transition: margin-left .15s ease; }
  .side-head .collapse { display: inline-flex; }
  .side-head .closebtn { display: none; }
}
}
@media (max-width: 899px) {
  header.top .menubtn { display: inline-flex; }
}
@media (min-width: 900px) { header.top .menubtn { display: none; } }
.bottombar .bar-more { flex: 1; min-height: 0; padding: 12px 4px; background: transparent; color: var(--muted); border-radius: 0; font-size: 13px; font-weight: 600; border-top: 3px solid transparent; }
.sidebar .themebtn .lbl { font-weight: 600; }
.sidebar .linkbtn.findicon { display: none; }
.findbox { flex-wrap: wrap; }
.findbox input { flex: 1; }
.suggest { flex-basis: 100%; list-style: none; margin: 4px 0 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.suggest[hidden] { display: none; }
.suggest a { display: block; padding: 8px 10px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px; }
.suggest li:last-child a { border-bottom: 0; }
.suggest a:hover, .suggest a:focus { background: var(--tint); }
.suggest .sub { display: block; font-size: 12px; color: var(--muted); }

.transcript { padding-left: 0; list-style: none; }
.transcript li { margin: 8px 0; line-height: 1.5; }
.transcript strong.me { color: var(--brand); }

/* Activity entries: each kind has a color, a symbol (call, text, note) and its words, so color is never the only signal. */
.badge.k-call { background: var(--chip-blue-bg); color: var(--chip-blue); }
.badge.k-text { background: var(--chip-teal-bg); color: var(--chip-teal); }
.badge.k-note { background: var(--chip-gray-bg); color: var(--ink); }
.badge.k-email { background: var(--chip-purple-bg); color: var(--chip-purple); }
.badge.k-irs { background: var(--chip-gold-bg); color: var(--chip-gold); }
.badge.k-call::before { content: "\260E  "; }
.badge.k-text::before { content: "\2709  "; }
.badge.k-note::before { content: "\270E  "; }
.feed li[class*="k-"] { border-left: 4px solid var(--line); padding-left: 10px; }
.feed li.k-call { border-left-color: var(--chip-blue); }
.feed li.k-text { border-left-color: var(--chip-teal); }
.feed li.k-email { border-left-color: var(--chip-purple); }
.feed li.k-irs { border-left-color: var(--chip-gold); }
.feed li.k-system { border-left-style: dotted; }
.feedfilter { margin: 8px 0; }
.feedfilter .matrix { overflow-x: auto; max-width: 100%; }
.matrix table { border-collapse: collapse; min-width: 100%; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: center; }
.matrix th[scope=row], .matrix thead th:first-child { text-align: left; min-width: 240px; font-weight: 600; }
@media (max-width: 640px) { .matrix th[scope=row], .matrix thead th:first-child { min-width: 150px; } .matrix th, .matrix td { padding: 8px 6px; } }
.matrix td input[type=checkbox] { width: 22px; height: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.chips .chip.on { border-color: transparent; background: var(--tint); color: var(--brand); font-weight: 800; }
.filterchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; background: var(--card); }
.filterchip .count { color: var(--muted); font-size: 13px; }
.filterchip.k-call { border-color: var(--chip-blue); } .filterchip.k-text { border-color: var(--chip-teal); }
.filterchip.k-email { border-color: var(--chip-purple); } .filterchip.k-irs { border-color: var(--chip-gold); }
.feedfilter .row { gap: 8px; flex-wrap: wrap; align-items: center; }
.feedfilter input[type=search] { max-width: 220px; }

.statechip.state-quiet { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 500; }
.statechip.state-quiet .sym { background: transparent; }
.deadlines td, .deadlines th { vertical-align: top; }
.deadlines .workings > td { padding-top: 0; }

/* Six-year quick check: one cell per year with a symbol, color and words. */
.sixyear { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; padding: 0; margin: 8px 0; }
@media (min-width: 720px) { .sixyear { grid-template-columns: repeat(6, 1fr); } }
.sixyear a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); text-align: center; height: 100%; }
.sixyear .yr { font-weight: 700; font-size: 15px; }
.sixyear .mark { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
.sixyear .words { font-size: 12px; line-height: 1.25; color: var(--muted); }
.sixyear .y-good a { border-color: var(--chip-green); background: var(--chip-green-bg); } .sixyear .y-good .mark { background: var(--chip-green); color: var(--chip-green-bg); }
.sixyear .y-warn a { border-color: var(--chip-yellow); background: var(--chip-yellow-bg); } .sixyear .y-warn .mark { background: var(--chip-yellow); color: var(--chip-yellow-bg); border-radius: 6px; font-size: 14px; }
.sixyear .y-bad a { border-color: var(--chip-red); background: var(--chip-red-bg); } .sixyear .y-bad .mark { background: var(--chip-red); color: var(--chip-red-bg); border-radius: 6px; }
.sixyear .y-unknown a { border: 1px dashed var(--muted); } .sixyear .y-unknown .mark { border: 1px dashed var(--muted); color: var(--muted); }
.sixyear .y-good .words, .sixyear .y-warn .words, .sixyear .y-bad .words { color: var(--ink); }
/* Who is on this client or case: one card per role, each with its own color, initials and the role name. */
.team { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 8px 0 0; }
.team .member { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); min-width: 0; }
.team .avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.team .who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.team .role { font-size: 12px; font-weight: 600; color: var(--muted); }
.team strong { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .src { font-size: 11px; color: var(--muted); font-style: italic; }
.team .r-sales .avatar { background: var(--chip-gold-bg); color: var(--chip-gold); }
.team .r-csm .avatar { background: var(--chip-blue-bg); color: var(--chip-blue); }
.team .r-specialist .avatar { background: var(--chip-teal-bg); color: var(--chip-teal); }
.team .r-practitioner .avatar { background: var(--chip-purple-bg); color: var(--chip-purple); }
.team .r-sales { border-color: var(--chip-gold); } .team .r-csm { border-color: var(--chip-blue); }
.team .r-specialist { border-color: var(--chip-teal); } .team .r-practitioner { border-color: var(--chip-purple); }
.team .empty { border-style: dashed; border-color: var(--line); }
.team .empty .avatar { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.team .empty strong { color: var(--muted); font-weight: 500; }
.team .teamedit { display: flex; align-items: center; }

/* Bell and pop-ups */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; color: inherit; margin-left: 4px; }
.bellcount { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--chip-red); color: var(--chip-red-bg); font-size: 12px; font-weight: 700; text-align: center; }
.bell .bellcount { position: absolute; top: 0; right: 0; margin: 0; }
.toasts { position: fixed; right: 12px; bottom: 76px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 24px)); }
@media (min-width: 720px) { .toasts { bottom: 16px; } }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--ink); border: 1px solid var(--chip-blue); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast span { flex: 1; }
.toast-bad { border-color: var(--chip-red, #b3261e); }
.toast a { flex: 1; font-weight: 600; text-decoration: none; color: var(--ink); }
.notices li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.notices li a { text-decoration: none; color: var(--ink); }
.notices li.unread { background: var(--chip-blue-bg); padding-left: 8px; border-radius: 8px; }
.team .avatar { overflow: hidden; }
.team .avatar img, .avatar.big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; background: var(--tint2); color: var(--head); overflow: hidden; flex: none; }
/* more room around the cards, so a short role like CSM or a long one like Resolution specialist is not cramped */
.team { gap: 10px; }
.team .member { padding: 6px 18px 6px 6px; gap: 10px; }
.team .who { padding-right: 2px; }
.team .role { margin-bottom: 1px; }

/* Tasks */
.tasklist { margin: 8px 0; }
.task { padding: 8px 0; border-bottom: 1px solid var(--line); }
.task.finished .tasktitle { text-decoration: line-through; color: var(--muted); }
.taskmain { display: flex; gap: 10px; align-items: flex-start; }
.taskcheck { margin: 0; }
button.check { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border-radius: 8px; border: 2px solid var(--muted); background: transparent; color: var(--chip-green); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
button.check:hover { border-color: var(--chip-green); background: var(--chip-green-bg); }
button.check.on { border-color: var(--chip-green); background: var(--chip-green-bg); }
.tasktext { min-width: 0; }
.tasktitle { font-weight: 600; color: var(--ink); text-decoration: none; }
.taskmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 14px; margin-top: 2px; }

/* Team cards: each role fills its pill with its own tint and a solid avatar, so they read in light mode as well as dark. */
.team .r-sales { background: var(--chip-gold-bg); border-color: color-mix(in srgb, var(--chip-gold) 40%, transparent); }
.team .r-csm { background: var(--chip-blue-bg); border-color: color-mix(in srgb, var(--chip-blue) 40%, transparent); }
.team .r-specialist { background: var(--chip-teal-bg); border-color: color-mix(in srgb, var(--chip-teal) 40%, transparent); }
.team .r-practitioner { background: var(--chip-purple-bg); border-color: color-mix(in srgb, var(--chip-purple) 40%, transparent); }
.team .r-sales .avatar { background: var(--chip-gold); color: var(--chip-gold-bg); }
.team .r-csm .avatar { background: var(--chip-blue); color: var(--chip-blue-bg); }
.team .r-specialist .avatar { background: var(--chip-teal); color: var(--chip-teal-bg); }
.team .r-practitioner .avatar { background: var(--chip-purple); color: var(--chip-purple-bg); }
.team .member.empty { background: transparent; border-color: var(--line); }
.team .member.empty .avatar { background: transparent; color: var(--muted); }
.team .r-sales .role { color: var(--chip-gold); } .team .r-csm .role { color: var(--chip-blue); }
.team .r-specialist .role { color: var(--chip-teal); } .team .r-practitioner .role { color: var(--chip-purple); }
.team .member.empty .role { color: var(--muted); }

/* Ask for the authenticator code again before a sensitive reveal (apps/core/stepup.py): a native modal dialog */
.code-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 20px 22px; width: min(92vw, 380px); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.code-dialog::backdrop { background: rgba(10, 12, 30, .6); }
.code-dialog h2 { margin: 0 0 8px; font-family: var(--head-font); color: var(--head); font-size: 20px; }
.code-dialog input { width: 100%; box-sizing: border-box; margin-top: 4px; }
.code-dialog .error { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 8px 0 0; }
.code-dialog-actions { display: flex; gap: 8px; margin: 12px 0 0; }

/* Page links under a long list (clients) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }

/* Client picker: a search box with a short list of matches (static/app.js) */
.client-picker { position: relative; min-width: min(100%, 17rem); flex: 1 1 17rem; }
.client-picker-input { width: 100%; }
.client-picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto; background: var(--card); color: var(--ink); border: 1px solid var(--field-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.client-picker-list[hidden] { display: none; }
.client-picker-list [role=option] { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-height: 44px; border-radius: 6px; cursor: pointer; }
.client-picker-list [role=option][aria-selected=true], .client-picker-list [role=option]:hover { background: var(--tint2); }
.client-picker-list [role=option][aria-selected=true] { outline: 2px solid var(--brand-mid); outline-offset: -2px; }
.client-picker-opt-name { font-weight: 600; }
.client-picker-opt-sub { font-size: 13px; color: var(--muted); }
.client-picker-empty { padding: 10px 12px; color: var(--muted); }
.client-picker-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; }
.client-picker-chosen[hidden] { display: none; }
.client-picker-name { font-weight: 600; }
.client-picker-error { margin: 4px 0 0; color: var(--danger); font-size: 14px; min-height: 0; }
.client-picker-error:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Error pages (404, 403, 500...): standalone, so they work even when the app itself is what failed. */
body.errorpage header.top { display: flex !important; justify-content: flex-start; }  /* wide screens hide it behind the sidebar; there is no sidebar here */
.errorcard { text-align: center; margin-top: 32px; padding: 32px 24px; }
.errorcard .errorcode { font: 700 64px/1 var(--head-font); color: var(--gold); margin: 0 0 8px; }
.errorcard h1 { margin: 0 0 12px; }
.errorcard .actions { justify-content: center; margin: 20px 0 12px; }

/* Tick lists with one Add / Edit / Remove bar (filing status by year, tax classification). */
.picktools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; }
.picktools .addbtn { margin-top: 0; }
.picklist { margin: 0; }
.picklist.plain li, ul.picklist li { padding: 2px 0; border-bottom: 0; }
.picklist label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; margin: 0; font-weight: 400; cursor: pointer; }
.picklist input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.picklist dialog { text-align: left; }

/* Page head: the main action (Add) sits alone on the right, the other buttons are quieter and sit just left of it. */
.pagehead .actions { align-items: center; margin-left: auto; }
.pagehead .actions .actions-quiet { display: flex; flex-wrap: wrap; gap: 8px; margin-right: 16px; }
.pagehead .actions .addbtn { margin: 0; background: var(--btn); color: #fff; padding: 10px 24px; min-height: 44px; font-size: inherit; }
.pagehead .actions .addbtn:hover { filter: brightness(1.15); }
@media (min-width: 641px) and (max-width: 1200px) { .pagehead .actions { flex-direction: column-reverse; align-items: flex-start; margin-left: 0; } .pagehead .actions .actions-quiet { margin-right: 0; } }  /* the sidebar leaves too little room for one row, so Add goes on top instead of dropping below as an orphan */
@media (max-width: 640px) { .pagehead .actions { width: 100%; flex-direction: column-reverse; align-items: stretch; } .pagehead .actions .actions-quiet { margin-right: 0; } }

/* Change team reads as a small text link at the end of the team chips, not as another person. */
.team .teamedit a { background: none; border: 0; padding: 4px 6px; min-height: 32px; color: var(--link, var(--head)); font-size: 14px; text-decoration: underline; display: inline-flex; align-items: center; gap: 4px; }

/* Cases: the By person dropdown is compact and sits on the same line as its label. */
.filterrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.filterrow .chips { margin: 0; }
.filterrow label { margin: 0; }
.filterrow select { width: auto; min-width: 180px; max-width: 100%; }

.picktools button:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* The status dropdown inside a task row. */
.taskmeta .statuspick { display: inline-flex; margin: 0; }
.taskmeta .statuspick select { width: auto; min-height: 32px; padding: 2px 28px 2px 8px; font-size: 14px; }

/* An option in the Add chooser that is not available yet: dimmed, with the reason beside it. */
.add-chooser label.disabled { opacity: .6; cursor: not-allowed; }
.add-chooser label.disabled input { cursor: not-allowed; }

/* The small + beside a case on the Cases table: opens that case with the Add popup on a task. */
a.rowadd { display: inline-block; margin-top: 2px; white-space: nowrap; font-weight: 700; text-decoration: none; }  /* "+ Add a Task" under a case's next step on Cases (it was a bare + beside the client's name, which read as nothing: Aaron, 2026-11-19) */
a.rowadd:hover { text-decoration: underline; }

/* The permission grid on the Roles page scrolls inside its own box on a phone instead of widening the whole page. */
.matrix { overflow-x: auto; max-width: 100%; }

/* Call the IRS */
.irslines li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.irsmain { flex: 1 1 320px; min-width: 0; }
.irsbtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.callbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 8px 0 12px; }
.callbar .timer { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--head); }

/* Weekly review: the Skip and Open buttons sit clear of the Add task form above them. */
.reviewnav { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
form.abandon { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }

/* "On file, ends in 1234" shown as plain text above a secret's box, so a hidden value never looks like a blank one. */
.onfile { font-weight: 600; margin: 2px 0 6px; }
.filterrow input[type=date], .filterrow input[type=text] { width: auto; min-width: 150px; max-width: 100%; }

/* The enQ PIN box at the top of Call the IRS. */
.pinbox { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.pinbox input[type=text] { width: auto; min-width: 220px; max-width: 100%; }
.pinhelp { margin: 4px 0 16px; }
.pinshown { font-size: 18px; letter-spacing: .06em; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; }

/* Tasks page filters: every control sits in the same labelled column, bottom aligned, so the buttons line up with the boxes. */
.taskfilter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 8px 0; }
.taskfilter label { margin: 0; font-size: 14px; }
.taskfilter select, .taskfilter input[type=search] { width: auto; min-width: 150px; margin-top: 4px; }
.taskfilter input[type=search] { min-width: 220px; }
.taskfilter .taskfilter-actions { display: flex; gap: 12px; align-items: center; min-height: 44px; }
.taskfilter .taskfilter-actions button { margin: 0; }
.sortform .field { margin-bottom: 8px; }
.sortform .field input[type=text], .sortform .field input:not([type]) { width: 100%; box-sizing: border-box; }
.emailpreview { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; max-height: 14em; overflow: auto; }
.sortbtns { margin: 8px 0 0; }
.sortbtns .addbtn, .sortbtns form { margin-top: 0; }

.clientline .addbtn { margin: 0 0 0 6px; min-height: 28px; padding: 2px 10px; vertical-align: middle; }  /* a small button inside a line of text */
#expenses-form input[type=number] { width: 100%; min-width: 110px; }
.legend li { padding: 5px 0; border-bottom: 0; }
.legend .statechip { min-width: 190px; margin-right: 8px; }
@media (max-width: 640px) { .legend .statechip { min-width: 0; } .legend li .statechip { display: flex; width: fit-content; margin-bottom: 2px; } }
.card code { overflow-wrap: anywhere; }

/* The numbered yes/no questions (a statement's Questions tab): three small buttons per question, real radios underneath so the keyboard and screen readers work. */
.questions { list-style: none; margin: 0; padding: 0; }
.questions > li { padding: 12px 0; border-top: 1px solid var(--line); }
.questions > li:first-child { border-top: 0; }
.qtext { margin-bottom: 6px; }
.qnum { font-weight: 700; color: var(--head); margin-right: 4px; }
.yn { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.yn label { position: relative; display: inline-block; }
.yn input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.yn span { display: inline-block; padding: 6px 16px; min-height: 36px; line-height: 24px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field-bg); color: var(--head); font-weight: 600; }
.yn input:hover + span { background: var(--tint2); }
.yn input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.yn input:checked + span { background: var(--btn); border-color: var(--btn); color: #fff; }
.followups { margin: 8px 0 0 12px; padding: 4px 0 4px 12px; border-left: 3px solid var(--tint2); }

/* The open and estimate counts on a statement's tabs: a symbol and the number in a small pill (yellow dashed with ? is still open, blue with ~ is an estimate), so neither
   leans on color alone. The words are there for screen readers and the phone dropdown. */
.tabpill { position: relative; display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px; vertical-align: 1px; }
.tabpill .sym { font-weight: 800; }
.tp-open { background: var(--chip-yellow-bg); color: var(--chip-yellow); border: 1px dashed var(--chip-yellow); }
.tp-est { background: var(--chip-blue-bg); color: var(--chip-blue); border: 1px solid var(--chip-blue); }
.yn input[value=""]:checked + span { background: var(--chip-yellow-bg); border: 1px dashed var(--chip-yellow); color: var(--chip-yellow); }

/* Ways to resolve it (templates/financials/_analysis.html) */
.options { list-style: none; margin: 0; padding: 0; }
.options > li { padding: 12px 0; border-top: 1px solid var(--line); }
.optionhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.optionhead h3 { margin: 0; }
.options dl { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0; }
.options dl > div { display: flex; gap: 6px; }
.options dt { color: var(--muted); }
.options dd { margin: 0; font-weight: 600; }

.negative { color: var(--chip-red); }
form.inline { display: inline; margin-left: 8px; }

/* Transcripts on file: a grid of checks and Xs (templates/transcripts/_library.html). Symbol AND words, never colour alone. */
.tgrid .gridcell { text-align: center; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; text-decoration: none; border: 1px solid transparent; }
.mark.yes { background: var(--chip-green-bg); color: var(--chip-green); border-color: var(--chip-green); }
.mark.no { background: var(--card); color: var(--muted); border: 1px dashed var(--line); }
.mark.no.noauth { background: var(--chip-red-bg); color: var(--chip-red); border: 1px solid var(--chip-red); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gridform { border-top: 1px solid var(--line); padding: 8px 0; }
.gridform > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.gridform .chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.card.slim { padding-top: 10px; padding-bottom: 10px; }
button.danger { background: var(--chip-red); color: var(--chip-red-bg); }

/* The More menu in a client's header (templates/crm/client_detail.html): Merge a duplicate, Delete this client. */
.menu { position: relative; display: inline-block; margin-top: 0; }  /* the global details margin would push it below its neighbours */
.menu > summary { list-style: none; cursor: pointer; box-sizing: border-box; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " \25BE"; }
.menulist { position: absolute; right: 0; z-index: 20; margin: 4px 0 0; padding: 6px; list-style: none; min-width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
/* On a phone the quiet buttons sit in a tidy two-column grid and the list spans it, so nothing spills down in a ragged stack or runs off the screen. */
@media (max-width: 640px) {
  .pagehead .actions .actions-quiet { display: grid; grid-template-columns: 1fr 1fr; position: relative; }
  .pagehead .actions .actions-quiet > :last-child:nth-child(odd) { grid-column: 1 / -1; }  /* an odd one out (the case page's More) takes the whole row, not half of it */
  .actions-quiet > form { width: 100%; }  /* a button that posts sits in its own form: stretch the form too, or it stays a narrow pill beside full-width links */
  .actions-quiet .button, .actions-quiet > form > button, .actions-quiet .menu > summary { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; box-sizing: border-box; padding: 10px 8px; font-size: .9rem; white-space: nowrap; }
  .menu { position: static; display: block; }
  .menulist { left: 0; right: 0; min-width: 0; }
}
.menulist a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.menulist a:hover, .menulist a:focus { background: var(--chip-blue-bg); }
.deleteform label.check { display: block; margin: 12px 0; }

/* The rows of what a Form 2848 or 8821 covers: form and two years side by side, wrapping to two columns on a phone. */
.periodrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; margin: 8px 0; }
.periodrow label { display: block; font-size: 14px; }
.periodrow select, .periodrow input[type="number"] { width: 100%; box-sizing: border-box; }
.periodrow .periodwide { grid-column: 1 / -1; }
.periodrow .periodremove { padding-bottom: 8px; }
.periodrow .periodremove input { width: auto; }
@media (max-width: 640px) { .periodrow { grid-template-columns: 1fr 1fr; } .periodrow > div:first-of-type { grid-column: 1 / -1; } .periodrow .periodremove { grid-column: 1 / -1; } }
.periodrows { margin-top: 24px; }

/* Possible duplicates: one block per pair, the two records stacked, the reasons, then the buttons. */
.duppair { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.duppeople { display: grid; gap: 6px; }
.duppeople .small { display: inline-block; min-width: 56px; }
.dupreasons { margin: 8px 0; padding-left: 20px; }
.duppair .actions { align-items: center; }
.duppair .actions form { margin: 0; }

/* A year heading row inside the transcript grids: the year once, then a row per form (and quarter) under it. */
tr.yearrow th { text-align: left; font-size: 15px; padding: 10px 8px 4px; background: transparent; border-bottom: 1px solid var(--line); color: var(--muted); }

/* A day ticked Closed hides its opening and closing times (firm_settings.html, static/app.js); without scripts the times stay. */
[data-times][hidden] { display: none !important; }

/* Phone layout of the client header (client_detail.html): the ID chip takes its own line, then the kind, stage and Change stage share the next one. */
.clientline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; margin-top: 8px; }  /* a wrapped pill line keeps room under the name and between lines */
.clientline .addbtn { margin-left: 0; }
@media (max-width: 640px) { .clientline .lbreak { flex-basis: 100%; height: 0; } }
/* The team (partials/team_chips.html) folds to one line on a phone: "Team: Aaron Siegel", opened with a tap. Wide screens always show it (static/app.js closes it on phones only). */
.teamfold > summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 6px 0; }
/* (2026-11-19) the team is one line at every width; it opens with a click */

/* Activity log filters on a phone: each label sits above its own full-width control (core/activity_log.html). */
@media (max-width: 640px) {
  .logfilter { display: grid; grid-template-columns: 1fr; gap: 4px; align-items: start; }
  .logfilter label.small { margin-top: 8px; }
  .logfilter select, .logfilter input[type=date], .logfilter input[type=text] { width: 100%; }
  .logfilter button { justify-self: start; margin-top: 8px; }
}

/* Refresh button for the home screen app, which has no address bar or pull to refresh (templates/base.html, static/app.js). Shown only when the site runs as an installed app. */
.refreshbtn { display: none; margin: 0 0 0 10px; padding: 4px; min-height: 0; background: transparent; border: 0; color: inherit; }
@media (display-mode: standalone) { .refreshbtn { display: inline-flex; align-items: center; } }
html[data-standalone] .refreshbtn { display: inline-flex; align-items: center; }  /* older iPhones report a home screen app only through navigator.standalone */

/* Compact year lists (Tax years, Transcripts on file in client_detail.html): real tables that stay tables on a phone, left aligned, a year heading row and one row per form. Older
   years fold under "Show N older years" so a long history does not make a long page. */
table.compact { width: 100%; border-collapse: collapse; }
table.compact th, table.compact td { text-align: left; padding: 8px 6px; vertical-align: top; }
table.compact thead th { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
table.compact tbody td { border-bottom: 1px solid var(--line); }
table.compact tr.yearrow th { padding: 12px 6px 4px; border-bottom: 1px solid var(--line); }
table.compact tr.yearrow + tr td { border-top: 0; }
table.compact .gridcell { text-align: center; padding: 6px 2px; }
table.compact .mark { width: 30px; height: 30px; }
table.tgrid td.primary { white-space: nowrap; }
@media (max-width: 640px) { table.tgrid thead th { font-size: 11px; line-height: 1.2; padding: 6px 2px; } table.tgrid th:first-child, table.tgrid td:first-child { width: 26%; } }
details.olderyears { margin-top: 10px; }
details.olderyears > summary { cursor: pointer; color: var(--link, inherit); font-weight: 600; padding: 6px 0; }
@media (max-width: 640px) { .clientline .addbtn { font-size: 12px; padding: 2px 6px; min-height: 28px; } .clientline { gap: 8px 4px; } }
.quarters { display: flex; gap: 6px; margin-top: 4px; }
.quarters a { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }

/* Transcripts on file on a wide screen: the form column and each transcript column are a fixed, close width, left to right, instead of the table stretching the columns apart. */
@media (min-width: 641px) {
  table.tgrid { width: auto; min-width: 0; }
  table.tgrid th:first-child, table.tgrid td:first-child { width: 150px; }
  table.tgrid th.gridcell, table.tgrid td.gridcell { width: 120px; vertical-align: middle; }
  table.tgrid thead th { vertical-align: bottom; }
}
@media (min-width: 641px) {
  table.taxyears { width: auto; min-width: 0; }
  table.taxyears th:nth-child(1), table.taxyears td:nth-child(1) { width: 220px; }
  table.taxyears th:nth-child(2), table.taxyears td:nth-child(2) { width: 170px; }
  table.taxyears th:nth-child(3), table.taxyears td:nth-child(3) { width: 100px; }
}

/* Stage rail on the case page: four steps, the current one lit, and the "This stage" checklist under it. */
.stagerail { margin-top: 14px; }
.stagerail .steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stagerail .step { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--bg); }
.stagerail .step .what { display: flex; flex-direction: column; min-width: 0; }
.stagerail .step.current { background: var(--tint); }
.stagerail .step.later { opacity: .7; }
.stagerail .thisstage { margin-top: 12px; }
.stagerail .thisstage > summary { cursor: pointer; font-weight: 600; }
.stagerail .checks li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
@media (min-width: 641px) { .stagerail .steps { grid-template-columns: repeat(4, 1fr); } }
.stagerail .checks label { display: flex; gap: 8px; align-items: center; font-weight: normal; margin: 0; }
.stagerail .checks .manualtag { margin-left: auto; }
/* A popup button (a details summary) next to a plain button in one row: the global details margin pushed it lower (the stage card's Move to... beside Change Stage, the billing buttons) */
.stageactions details, .row details, .actions-quiet details, .stageactions .addbtn, .row .addbtn, .actions-quiet .addbtn { margin-top: 0; }  /* static/app.js turns a popup summary into a .addbtn button, which has its own top margin */
.ledger td.num, .ledger th.num, table th.num, table td.num { text-align: right; white-space: nowrap; }
.stagerail .stageactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.stagerail .stageactions form { margin: 0; }
.stagerail .thisstage label { font-weight: normal !important; }

/* The client page's tabs: the daily work first, then the client's file under a small label. */
.tabs .tabgroup { align-self: center; padding: 0 6px 0 12px; margin-left: 6px; border-left: 2px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.badge.stagepill { background: var(--tint); }

/* The consultation interview: steps across the top, the step beside a scratchpad that is always in reach. */
.interviewsteps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 0; }
.interviewsteps li a { display: inline-flex; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); }
.interviewsteps li.current a { border-color: var(--brand); background: var(--tint); font-weight: 700; }
.interviewsteps li.done a { color: var(--ok); }
.interviewgrid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.scratchpad textarea { width: 100%; }
.autosavestatus.bad { color: var(--danger); font-weight: 700; }
@media (min-width: 900px) { .interviewgrid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .scratchpad { position: sticky; top: 12px; align-self: start; } }
/* Pick lists in the interview (years, forms, quarters, state taxes) are rows of small chips, not a long column of bold labels. */
.interviewform .field > div[id] { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.interviewform .field > div[id] > div label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 400; margin: 0; cursor: pointer; }
.interviewform .field > div[id] > div label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); font-weight: 700; }
tr.voided td { opacity: .6; }

/* The signing page (public): the document, then the consent and the signature. */
.signdoc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 12px 0; }
.signdoc h1 { font-size: 22px; } .signdoc p { margin: 0 0 12px; }
.drawbox canvas { width: 100%; height: 160px; border: 1px dashed var(--field-line); border-radius: 8px; background: #fff; touch-action: none; display: block; }
.drawbox.off { display: none; }
/* The monitoring plan card: the details, then the buttons on their own row, every button the same height and centered */
#plan .actions-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
#plan .actions-quiet form { margin: 0; }
#plan .actions-quiet button { margin: 0; }
/* The tax lines on the Prepare Form page: a header row, then one row per line with the form, the start year and the end year across */
.coverrows { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; align-items: start; }
.coverrows input, .coverrows select { width: 100%; margin: 0; }
.coverrows .errorlist { margin: 4px 0 0; }
/* The client's name in the header of a page that belongs to the client (Files): a link back to the client page that reads as a heading */
h1 a.plainlink { color: inherit; text-decoration: none; }
h1 a.plainlink:hover { text-decoration: underline; }

/* An installed phone app draws under the status bar and the Dynamic Island: the top bar reaches behind them with a solid background and keeps its own content below (the bottom bar already allows for the home indicator) */
header.top { padding-top: calc(8px + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 30; }
html { background: var(--side-bg); }
/* On a computer the page starts with a gap above the first tile, and that gap shows this outer background: it must be the page's gray, not the top bar's white (Aaron, 2026-11-19: a white band across the top). The phone keeps the bar's color, which is what shows behind the status bar. */
@media (min-width: 900px) { html { background: var(--bg); } }
/* A signed-out page (sign in, the code step) has no top bar, so the strip above its content must be the page's gray too, or a white band shows under the status bar */
html:has(> body:not(.has-nav)) { background: var(--bg); }
.sidebar { scrollbar-width: thin; }
body { min-height: 100vh; }
/* The merge screen: an ID chip always sits on its own line under the name */
.idline { margin: 4px 0 10px; }
/* The transcript page: the status badge sits by the title, and the action buttons are all one size (the Make the PDF Again form was a smaller inline button) */
.titlebadge { vertical-align: middle; font-size: 13px; margin-left: 6px; }
.pagehead .actions form.inline { display: block; margin: 0; }
.pagehead .actions form.inline button { width: 100%; }
@media (min-width: 641px) { .pagehead .actions form.inline { display: inline-block; } .pagehead .actions form.inline button { width: auto; } }
/* The receipt page */
.receipt { max-width: 640px; }
.receipt .amount { font: 700 34px var(--head-font); margin: 8px 0 4px; }
.receipt dl.kv { margin: 12px 0; }
.receipt .totals { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.receipt .actions-quiet { margin-top: 18px; }

/* Billing on a phone: room between the button row and the pills, and between the receipt's buttons (Aaron, 2026-11-03). */
#tab-billing .row.spread { margin-bottom: 16px; }
#tab-billing .stats { margin-top: 16px; margin-bottom: 16px; row-gap: 10px; }
.receipt .actions-quiet { display: flex; flex-wrap: wrap; gap: 12px; }
.receipt .actions-quiet .button { margin: 0; text-align: center; }
@media (max-width: 640px) { .receipt .actions-quiet { flex-direction: column; } .receipt .actions-quiet .button { width: 100%; box-sizing: border-box; } }

/* The card billing block on a monitoring plan: room above it and between its parts (Aaron, 2026-11-03). */
#plan .cardbilling { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
#plan .cardbilling form { margin: 0; }
#plan .cardbilling .field { margin: 0 0 10px; }
#plan .cardbilling p { margin: 8px 0 0; }
#plan .cardcancel { margin: 14px 0 0; }

/* A stacked table row on a phone: a button under a status pill keeps room (found by tools/button_spacing_audit.js). */
table.stack td:has(> form), table.stack td:has(> .row), table.stack td:has(> a.button) { padding-top: 8px; }

/* The Authorizations tab's action column: room for a button's words, stacked (a narrow cell wrapped "Check With the IRS Now" into four lines). */
@media (min-width: 641px) { #tab-authorizations table.stack td:last-child { min-width: 170px; } #tab-authorizations td:last-child .row { flex-direction: column; align-items: stretch; } }
#tab-authorizations td:last-child .row .button, #tab-authorizations td:last-child .row button { width: 100%; box-sizing: border-box; text-align: center; }

/* The mark above the signed-out pages (sign in, password reset, the authenticator step, an invitation). */
.loginbrand { text-align: center; margin: 0 auto; padding-top: calc(12px + env(safe-area-inset-top)); }  /* clears the iPhone clock and Dynamic Island (viewport-fit=cover) */
.loginbrand img { border-radius: 16px; display: block; margin: 0 auto 10px; }
.loginbrand .word { font: 700 32px var(--head-font); color: var(--head); }
.loginbrand .word::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 5px; border-radius: 50%; background: var(--gold); }
.loginbrand p { margin: 4px 0 0; }
.loginbrand + .narrow { margin-top: 20px; }

/* The import page's column guide: a column name or an example never breaks in the middle. */
table.guide td:first-child code { white-space: nowrap; }
@media (min-width: 720px) { table.guide { table-layout: fixed; } table.guide th:nth-child(1), table.guide td:nth-child(1) { width: 18%; } table.guide th:nth-child(2), table.guide td:nth-child(2) { width: 27%; } table.guide th:nth-child(4), table.guide td:nth-child(4) { width: 18%; } table.guide td:last-child code { overflow-wrap: anywhere; } }

/* Hard deadlines: the banner under a case's header and the card's rows. */
.deadlinebar { margin: 12px 0 0; }
.deadlinerow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.deadlinerow:first-of-type { border-top: 0; }

/* A file list: a long name wraps, and the buttons and the date keep their one line. */
.filename { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
@media (min-width: 641px) { .fileacts { width: 1%; } .fileacts .row { flex-wrap: nowrap; } }

/* iPhone Safari gives a date field its own wider size and ignores width: 100%, so it ran past the card. */
input[type=date] { display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }

/* A slim card is one line: its heading and its button sit level. */
.card.slim .pagehead { align-items: center; }
.card.slim .pagehead h2 { margin: 0; }
.card.slim .pagehead > .addbtn { margin-top: 0; }

/* New Call: one tap from anywhere while the phone rings. */
header.top .callbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; margin-right: 8px; border-radius: 8px; background: var(--btn); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
header.top .callbtn .ico { width: 16px; height: 16px; }
/* On a phone the header has no room for it (it wrapped and was cut off on a 430 point iPhone): New Call is on My work and at the top of the menu instead. */
@media (max-width: 640px) { header.top .callbtn { display: none; } }
header.top .callbtn span { white-space: nowrap; }
/* My work's buttons: side by side on a computer, one full-width column of equal buttons on a phone. */
@media (max-width: 640px) {
  .headactions { flex-direction: column; align-items: stretch; width: 100%; gap: 10px; }
  .headactions > .button { width: 100%; justify-content: center; text-align: center; margin: 0; }
}
.sidebar .navitem.newcall { background: var(--btn); color: #fff; margin: 4px 0 8px; }
.sidebar .navitem.newcall:hover { filter: brightness(1.15); }
header.top .brand { white-space: nowrap; flex-shrink: 0; }  /* the New Call button must never push the brand's dot onto a second line; the firm name shortens instead */
header.top .firmname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The phone bar must fit the screen (Aaron, 2026-11-24: the bell ran off the right edge on an iPhone). The buttons keep their size and the firm picker shrinks. */
header.top .menubtn, header.top .bell, header.top .refreshbtn, header.top .brand { flex: none; }
header.top .headfirm { min-width: 0; flex: 0 1 auto; }
header.top .headfirm select, header.top .headfirm form { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 480px) {
  header.top { gap: 6px; padding-left: 8px; padding-right: 8px; }
  header.top .brand { margin-right: 0; }
  header.top .refreshbtn { margin-left: 0; }
}

/* Files page: links sent to a client asking for files (file requests) */
.filereqs { margin: 4px 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; }
.filereqs h3 { margin: 0 0 4px; font-size: 15px; }
.filereqs li { gap: 12px; }
.filereqs li > span { min-width: 0; }
.filereqs .statechip { margin-left: 4px; }
.form-actions button:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* Firm settings, Brand: a small sample of what clients see (the colors come from the firm, as CSS variables on the element) */
.brandpreview { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 16px; border-radius: 14px; background: #F5F5F7; color: #1D1D1F; }
.brandmark { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 15px; }
.brandmark img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.brandname { font-weight: 600; margin-right: auto; }
.brandbutton { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
input[type="color"] { width: 72px; height: 44px; padding: 4px; cursor: pointer; }
.brandmark-large { width: 72px; height: 72px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.brandpreview-dark { background: #161618; color: #F5F5F7; }
pre.snippet { white-space: pre-wrap; word-break: break-all; background: var(--code-bg); padding: 12px; border-radius: 8px; font-size: 13px; }
/* The Bookings list's Move, Refund and Cancel: small buttons side by side at every width (templates/scheduling/_booking_rows.html). */
.bookactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bookactions form { margin: 0; }
table.stack td:has(> .bookactions) { padding-top: 8px; }
.feed-share { display: inline; margin-right: 8px; }  /* Show to Client on a timeline entry (partials/activity_feed.html) */
.feed-share button { margin-top: 6px; }
.planactions { margin-top: 12px; }  /* the payment plan's buttons under its schedule (cases/engagement_detail.html, Billing tab) */
.linkcancel { display: inline-block; margin-top: 6px; }  /* Cancel Link beside a payment link's copy box: room when it wraps under it */
.planlink { width: 100%; margin-top: 6px; }  /* a waiting payment plan's setup link to copy (Billing tab) */
.plantable input { width: 100%; max-width: 12rem; }  /* the payment plan schedule's date and amount boxes (payments/plan_preview.html) */
.plansum { font-weight: 600; margin: 12px 0; }
.plansum.ok { color: var(--ok); }
.plansum.off { color: var(--danger); }
.irsglance .pagehead { flex-wrap: wrap; gap: 8px; }  /* the IRS summary card on the client's Overview and Transcripts tabs (crm/_irs_glance.html) */
dl.kv.glancekv { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { dl.kv.glancekv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.irsglance .statechip { white-space: normal; }  /* a pill that lists years must wrap on a phone, not push the card wider */
.glanceflags { margin-top: 12px; }
.glanceflags li { margin-top: 6px; }

/* A form on its way (static/app.js): the pressed button says so, and a thin bar moves along the top of the page. */
button.is-busy, input.is-busy, a.button.is-busy { cursor: progress; opacity: 0.85; }
button.is-busy::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.45em; vertical-align: -0.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin 0.8s linear infinite; }
.busybar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; overflow: hidden; background: transparent; pointer-events: none; }
.busybar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--brand-mid); animation: busy-slide 1.1s ease-in-out infinite; }
.busybar[hidden] { display: none; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-slide { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { button.is-busy::before { animation: none; border-right-color: currentColor; } .busybar::after { animation: none; left: 0; width: 100%; opacity: 0.6; } }

/* The case page's Overview: a card left alone on the last row of the two-column grid takes the whole row (Aaron, 2026-11-18: "What we need from the client" sat half-width). */
@media (min-width: 720px) { .grid2 > .card:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* A wide table of dates and dollar amounts (the collection report, 2026-11-18): on a wide screen dates and amounts never wrap, and the table scrolls
   sideways inside its card when the screen is too narrow; the first column and the small notes under a value still wrap. */
@media (min-width: 720px) {
  .widetable { overflow-x: auto; max-width: 100%; }
  table.collect td { white-space: nowrap; }
  table.collect th { vertical-align: bottom; }
  table.collect td.primary, table.collect td .small { white-space: normal; }
  table.collect td.primary { min-width: 160px; }
}

/* Jump links at the top of a long tab (IRS Records, 2026-11-18): one quiet line that wraps on a phone. */
.jumplinks { margin: 0 0 12px; line-height: 1.9; color: var(--muted); }

/* A multi-select DROPDOWN (the order form's tax years, Aaron 2026-11-19): closed it is one line like a select ("2025", "2019 to 2025 (7 years)"); open it is a
   short scrolling list of tick boxes with Select All and Select None. static/app.js builds it from a CheckboxSelectMultiple marked data-multiselect. */
.multiselect { position: relative; }
.multiselect > summary { list-style: none; cursor: pointer; color: var(--ink); font-weight: 400; padding: 10px 36px 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); position: relative; }
.multiselect > summary::-webkit-details-marker { display: none; }
.multiselect > summary::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.multiselect[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.multiselect .ms-panel { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 8px; }
.multiselect .ms-actions { display: flex; gap: 8px; margin-bottom: 6px; }
.multiselect .ms-options { max-height: 220px; overflow-y: auto; }
.multiselect .ms-options label { display: flex; align-items: center; gap: 8px; padding: 6px 4px; margin: 0; font-weight: 500; cursor: pointer; }

/* ---- The 2026-11-19 look: the last word on a few shared pieces ---- */
.sidebar { border-right: 1px solid var(--line); }
.side-foot select option { color: var(--ink); }
/* A chip is a soft filled pill with its symbol and words; only the "not asked yet" kinds keep a dashed edge, because the dashes are part of what they say. */
.statechip { font-size: 13px; font-weight: 700; }
.statechip:not(.state-ask):not(.rule-novehicle) { border-color: transparent; }
/* A button that is a popup's summary, a small button and a secondary one all share the pill shape. */
summary { border-radius: 8px; }
table.stack tr:last-child, table tr:last-child > td { border-bottom-color: transparent; }
.toast { border: 0; border-radius: 16px; box-shadow: 0 8px 28px rgba(20, 22, 40, .18); }
.refpill .k { letter-spacing: 0; text-transform: none; font-size: 12px; }
.tip::after { border-radius: 12px; }
@media (min-width: 720px) { .card { padding: 22px 24px; } }
/* IRS changes to review (templates/transcripts/_findings.html): the change on the left, its two small buttons on the right, stacked under it on a phone. */
.findhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 4px; }
.findhead h2 { margin: 0; }
.findhead form { margin: 0 0 0 auto; }
.findrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.findrow .findtext { flex: 1 1 280px; min-width: 0; }
.findrow .findtext .statechip { margin-right: 6px; }
.findrow .findbtns { display: flex; gap: 8px; align-items: center; }
.findrow .findbtns form { margin: 0; }
.findings details { margin-top: 12px; }

/* This year's estimated payments on the IRS summary card (crm/_irs_glance.html): the total, then one chip for each quarter. */
ul.quarters { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 0; padding: 0; font-weight: 500; }

/* A grid of tiles that each open a page (Integrations): one across on a phone, two on a tablet, three on a computer. The whole tile is the link. */
.pagetitle { margin: 0 0 16px; }
.pagetitle h1 { margin: 0; }
.tilegrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .tilegrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tilegrid { grid-template-columns: repeat(3, 1fr); } }
a.tile { display: flex; flex-direction: column; gap: 6px; margin: 0; min-height: 92px; color: var(--ink); font-weight: 500; text-decoration: none; }
a.tile:hover, a.tile:focus-visible { text-decoration: none; box-shadow: var(--shadow), 0 0 0 2px var(--brand-mid); }
.tilehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.tilehead strong { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

/* Every activity filter has an outline you can see: Notes and System events had only the page's faint line (Aaron, 2026-11-19). */
.filterchip { border-color: var(--muted); font-weight: 600; }
.filterchip.k-call { border-color: var(--chip-blue); } .filterchip.k-text { border-color: var(--chip-teal); }
.filterchip.k-email { border-color: var(--chip-purple); } .filterchip.k-irs { border-color: var(--chip-gold); }
/* My work's Later group is folded shut: one line until it is opened. */
.laterfold details { margin-top: 0; }
.laterfold summary { font: 800 18px var(--head-font); letter-spacing: -.02em; color: var(--head); }
/* The Files page (Aaron, 2026-11-19): room between the client's pills and the tab strip, and each row's buttons end flush with the Request Files, New Folder and Upload Files row above them. */
.pagehead + .tabs { margin-top: 14px; }
td.rowacts button, td.rowacts .button { white-space: nowrap; }
@media (min-width: 720px) { table.stack td.rowacts { padding-right: 0; } td.rowacts .row { justify-content: flex-end; gap: 8px; } }
@media (min-width: 1100px) { table.stack td.rowacts { width: 1%; } td.rowacts .row { flex-wrap: nowrap; } }
/* Labeled facts in two columns (dl.kv): each cell drew its own underline, so the line broke at the gap between the columns (Aaron, 2026-11-19, the IRS summary card). On a wide screen the facts are set apart by space alone. */
@media (min-width: 720px) { dl.kv > div { border-bottom: 0; padding: 9px 0; } }

/* A form field's label with its info bubble beside it (partials/field.html): help text is in the bubble, not under the box. */
.labelrow { display: flex; align-items: center; gap: 2px; margin: 12px 0 4px; }
.labelrow label { margin: 0; }
.field .tip::after { transform: translateX(-20%); }

/* The call screen (cases/client_call.html): the notes take two thirds on a computer, the client's cases and links the rest; one column on a phone. */
.callgrid { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
@media (min-width: 900px) { .callgrid { grid-template-columns: 2fr 1fr; } }
.callcase { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.callcase:last-of-type { border-bottom: 0; }
dl.callfacts { grid-template-columns: 1fr; }
/* The call screen's heading with its running timer on the right. */
.pagetitle .callbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0; }
.pagetitle .callbar h1 { margin: 0; }

/* The client page's Overview (crm/client_detail.html, the 2026-11-19 redesign): the numbers on the left, what to do and who to call on the right. On a phone it is one column
   in the order a person needs it: what to do next, the IRS picture, the phone card, then the rest. */
.ovgrid { display: flex; flex-direction: column; }
.ovmain, .ovside { display: contents; }
.ov-next { order: 1; } .ov-glance { order: 2; } .ov-call { order: 3; } .ov-tasks { order: 4; } .ov-case { order: 5; } .ov-years { order: 6; } .ov-recent { order: 7; }
@media (min-width: 1000px) {
  .ovgrid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  .ovmain, .ovside { display: block; min-width: 0; }
  .ovside dl.kv { grid-template-columns: 1fr; }
}
a.nextstep.ov-next { display: block; margin: 0 0 16px; text-decoration: none; }
a.nextstep.ov-next:hover { text-decoration: none; filter: brightness(1.08); }
.ov-next .label, .ov-next .what, .ov-next .when { display: block; }
.ovnext-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 4px; }
.ovnext-big { text-align: right; white-space: nowrap; }
.ovnext-big strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: #fff; }
/* The four stages as a row of dots: done and now filled, the current one ringed and named in bold. */
ol.stagedots { list-style: none; display: flex; margin: 14px 0 12px; padding: 0; }
ol.stagedots li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
ol.stagedots li::before { content: ""; position: absolute; top: 4px; left: -50%; width: 100%; height: 2px; background: var(--line); }
ol.stagedots li:first-child::before { display: none; }
ol.stagedots li.done::before, ol.stagedots li.now::before { background: var(--brand); }
ol.stagedots .dot { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
ol.stagedots li.done .dot, ol.stagedots li.now .dot { background: var(--brand); }
ol.stagedots li.now .dot { box-shadow: 0 0 0 4px var(--tint); }
ol.stagedots li.now { color: var(--ink); font-weight: 800; }
table.yearlist td, table.yearlist th { padding: 9px 4px; }
/* Three figures side by side at the top of a card (the client's Billing tab). */
.figrow { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 4px 0 14px; }
.figrow > div { display: flex; flex-direction: column; }
.figrow strong { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }

/* New Call: people on file with the number being typed, right under the box. */
.callmatches { margin-top: 6px; border-radius: 14px; background: var(--tint); padding: 2px 14px; }
.callmatches li { padding: 10px 0; font-weight: 700; }
.callmatches button { min-width: 108px; }  /* the filled button is the thing to press (Aaron, 2026-11-19: it was hard to tell apart as a quiet button) */
.callmatches form { margin: 0; }

/* ---- The menu on a computer is a slim rail (the 2026-11-19 redesign): an icon with its name under it, New Call and Call the IRS together at the top, and the search across
   the top of the page instead of inside the menu. On a phone and a tablet the same menu is still the full drawer with every name beside its icon. ---- */
.topstrip { display: none; }
@media (min-width: 900px) {
  .topstrip { display: flex; align-items: center; gap: 16px; max-width: 1240px; margin: 14px auto 0; padding: 0 16px; }
  .topstrip .findbox { flex: 0 1 420px; flex-wrap: nowrap; position: relative; }
  .topstrip .findbox input { border-radius: 999px; padding-left: 18px; border-color: transparent; box-shadow: var(--shadow); }
  .topstrip .findbox .suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; box-shadow: var(--shadow); }
  .topstrip .topfirm { margin-left: auto; font-size: 14px; }
  .topstrip .topfirm select { width: auto; min-height: 36px; padding: 4px 10px; font-size: 14px; }
  main { margin-top: 14px; }
  .sidebar { padding: 14px 8px; gap: 4px; overflow-x: hidden; }
  .sidebar .findbox, .sidebar .side-title, .side-foot .sidefirm, .side-foot .firmline { display: none; }
  .side-head { flex-direction: column; gap: 6px; padding: 0 0 10px; }
  .side-head .brand { font-size: 0; }
  .side-head .brand::before { content: ""; display: block; width: 44px; height: 44px; border-radius: 12px; background: url("icon-192.dbec78896686.png") center / cover no-repeat; }  /* Resolyn's own app icon (Aaron, 2026-11-19: he prefers it to a plain letter) */
  .side-head .brand::after { display: none; }
  .side-head .sidebell { margin: 0; }
  .sidebar .navitem, .sidebar .linkbtn, .sidebar .themebtn { position: relative; flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 7px 2px; border-radius: 16px; font-size: 11px; font-weight: 700; line-height: 1.15; text-align: center; }
  .sidebar .navitem .lbl, .sidebar .linkbtn .lbl, .sidebar .themebtn .lbl { display: block; font-weight: 700; }
  .sidebar .navitem .bellcount { position: absolute; top: 3px; right: 10px; margin: 0; }
  .sidebar .navitem.newcall { margin: 0 0 4px; }
  /* An outline, never the fill of the current page (Aaron, 2026-11-19: it read as the active tab). */
  .sidebar .navitem.callirs { background: transparent; color: var(--side-on-ink); box-shadow: inset 0 0 0 1.5px var(--btn); margin: 0 0 22px;  /* a clear gap: the two call buttons are their own group (Aaron, 2026-11-19) */ }
  .sidebar .navitem.callirs.on { background: var(--side-on); }
  .sidebar .themebtn { width: 100%; height: auto; }
  .side-foot { border-top: 0; padding-top: 4px; }
}
@media (max-width: 899px) { .sidebar .navitem.callirs { margin-bottom: 8px; } }

/* The case page's Overview in two columns (cases/engagement_detail.html, the 2026-11-19 redesign). The numbered classes give the one-column order on a phone:
   the next step, hard deadlines and decisions first, then the stage's own work, the resolutions, what the client owes us, billing and files. */
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; } .o9 { order: 9; }
.casegrid .nextstep { margin: 0 0 16px; }
.rescard { padding: 12px 0; border-top: 1px solid var(--line); }
.rescard:first-of-type { border-top: 0; padding-top: 4px; }
.figrow.terms { margin: 8px 0 6px; gap: 6px 24px; }
.figrow.terms strong { font-size: 17px; }
.ckbar { height: 6px; border-radius: 3px; background: var(--chip-gray-bg); margin: 8px 0 4px; overflow: hidden; }
.ckbar > div { height: 100%; border-radius: 3px; background: var(--brand); }

/* Firm settings: the links to its other pages, in three named groups instead of one long row (Aaron, 2026-11-19). */
.setgroups { display: grid; grid-template-columns: 1fr; gap: 14px 28px; margin-top: 12px; }
@media (min-width: 900px) { .setgroups { grid-template-columns: repeat(3, auto); justify-content: start; } }
.setgroup { display: flex; flex-direction: column; gap: 6px; }

/* The top of the client page (Aaron, 2026-11-19): what a person needs on a call with the IRS is on screen without scrolling. The team is one line, the phone card's
   facts sit two across, and the open case comes before the task list. */
.teamfold { margin-top: 6px; }
.ovside .callcard dl.kv { grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ovside .callcard dl.kv > div { padding: 6px 0; }
.ov-case { order: 4; } .ov-tasks { order: 6; }
.ov-alerts { order: 5; }
/* A page header's title block gives way so its buttons stay on the title's row on a computer (the client page: one row instead of two). */
@media (min-width: 1000px) { .pagehead > div:first-child:not(:only-child) { flex: 1 1 320px; min-width: 0; } .pagehead > .actions { flex: none; } }

/* A form cell that takes the whole row (New Call's business name, so Email and OK to email stay together on the next line). */
.fields > .fullrow { grid-column: 1 / -1; }

/* My work (templates/core/home.html): the list on the left, what cannot wait on the right. On a phone the right column comes first. */
.workgrid .ovside > * { order: -1; }
.workgrid .ovside ul.plain li { padding: 8px 0; border-top: 1px solid var(--line); gap: 10px; align-items: flex-start; }
.workgrid .ovside ul.plain li:first-child { border-top: 0; }

/* The firm's logo at the top right of staff pages (base.html .topstrip), when the firm turned it on. */
.topfirm { display: inline-flex; align-items: center; gap: 10px; }
.toplogo { height: 36px; width: auto; max-width: 180px; object-fit: contain; display: block; }

/* My work's folded filter (other people's tasks, finished ones, search), templates/core/home.html. */
.workfilter { margin-top: 12px; }
.workfilter > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.workfilter .taskfilter { margin-top: 12px; }

/* The person's own menu at the foot of the menu (partials/sidebar.html .usermenu): My account, Support, Firm settings, Platform, the theme and Sign out. */
.usermenu { margin: 0; }
.usermenu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 12px; color: var(--side-ink); font-weight: 600; font-size: 15px; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--side-hover); }
.usermenu > summary.on, .usermenu[open] > summary { background: var(--side-on); color: var(--side-on-ink); }
.usermenu .avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--tint2); color: var(--ink); font-size: 12px; font-weight: 700; }
.usermenu .avatar img { width: 100%; height: 100%; object-fit: cover; }
.usermenu-panel { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 0 8px; }
.usermenu-panel form { margin: 0; }
@media (min-width: 900px) {
  .usermenu > summary { flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 7px 2px; border-radius: 16px; font-size: 11px; font-weight: 700; text-align: center; }
  .usermenu > summary .lbl { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .usermenu-panel { position: fixed; left: 100px; bottom: 12px; z-index: 60; width: 240px; padding: 8px; border-radius: 16px; background: var(--card); box-shadow: 0 12px 36px rgba(20, 20, 40, .22); }
  .sidebar .usermenu-panel .navitem, .sidebar .usermenu-panel .linkbtn, .sidebar .usermenu-panel .themebtn { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; text-align: left; width: 100%; color: var(--ink); }
  .sidebar .usermenu-panel .navitem .lbl, .sidebar .usermenu-panel .linkbtn .lbl, .sidebar .usermenu-panel .themebtn .lbl { display: inline; font-weight: 600; }
}
.recordshead { margin-top: 28px; }

/* The client Overview's Recent list (crm/client_detail.html): the words wrap, the date stays on the first line at the right (Aaron, 2026-11-19). */
.recentrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.recentrow > span:first-child { min-width: 0; }
.recentrow .nowrap { flex: none; white-space: nowrap; }
/* A long Recent entry on the client Overview opens in place (templates/crm/client_detail.html). */
.recentmore { margin: 0; }
.recentmore > summary { list-style: none; cursor: pointer; overflow-wrap: anywhere; }
.recentmore > summary::-webkit-details-marker { display: none; }
.recentmore .full, .recentmore .when-open, .recentmore[open] .clip, .recentmore[open] .when-closed { display: none; }
.recentmore[open] .full { display: inline; white-space: pre-line; }
.recentmore[open] .when-open { display: inline; }
.recentmore .more { color: var(--brand); font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }

/* The case page's stage list as links (cases/engagement_detail.html): each step opens what that stage asks for; the one being looked at is outlined. */
.stagerail .step { padding: 0; }
.stagerail .steplink { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; color: inherit; text-decoration: none; width: 100%; }
.stagerail .steplink:hover { background: var(--side-hover); }
.stagerail .step.viewing { box-shadow: inset 0 0 0 1.5px var(--btn); }
.stagerail .otherstage p { margin: 0 0 6px; }
.restabs { margin: 4px 0 12px; }
.stagerail .otherstage > p:last-child { margin: 12px 0 0; }

/* Where things stand with the IRS, as tiles (crm/_irs_glance.html): one figure each, the number large. */
.irstiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0 0 12px; }
.irstiles .figtile { margin: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.figtile .figlabel { font-size: 13px; font-weight: 700; color: var(--muted); }
.figtile .fignum { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.figtile.lead .fignum { font-size: 34px; }
.figtile .fignum.muted { color: var(--muted); font-size: 20px; }
.figtile .figunit { font-size: 15px; font-weight: 600; color: var(--muted); }
.figtile .figsub { font-size: 13px; color: var(--muted); }
.figtile .quarters { margin-top: 6px; }
.irstiles .figtile > a { margin-top: 8px; align-self: flex-start; }
@media (min-width: 700px) { .irstiles .figtile.lead { grid-column: span 2; } }
.irsflags { margin: 0 0 12px; padding-top: 14px; padding-bottom: 14px; }
.irsflags .glanceflags { margin: 0; }
.irslinks { margin: 0 0 16px; }
.figtile .figsplit { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.figtile .figsplit strong { color: var(--ink); font-weight: 700; }

/* The IRS tab in two columns (crm/_irs_tab.html): the numbers and the work on the left, monitoring, the authorization and transcripts on the right. */
.irsgrid .ovside dl.kv > div { padding: 6px 0; }
table tfoot td { border-top: 2px solid var(--line); padding-top: 10px; }
.figtile .figsub .statechip { white-space: normal; height: auto; text-align: left; max-width: 100%; }
/* The case header's facts line: the team is its own line under Stage and How hard, flush left (Aaron, 2026-11-19: it floated off the baseline beside them). */
.factline .teamfold { flex: 1 1 100%; margin: 0; }
.factline .teamfold > summary { padding: 0; font-size: inherit; }

/* The case page's stage summary tiles (cases/_stage_investigation.html). */
.stagetiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stagetiles .figtile { margin: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stagetiles .figtile .fignum { font-size: 22px; }
.stagetiles .figtile > a { margin-top: 6px; }
.phases { margin-top: 10px; }
.phases .phase { margin: 0; padding: 8px 0; border-top: 1px solid var(--line); }
.phases .phase > summary { cursor: pointer; }
.phases .phase ul li { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 5px 0; }

/* Buttons in a narrow side card: one under the other, each the card's full width, so nothing wraps raggedly (Aaron, 2026-11-19). */
.sidebuttons { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sidebuttons .button { width: 100%; text-align: center; justify-content: center; margin: 0; }
.sidebuttons form, .sidebuttons form button { width: 100%; margin: 0; }
/* the case page's Team card (canvas artboard "App: case, Investigation"): one line per role, name at the right */
.teamlist li { padding: 6px 0; gap: 8px; border-top: 1px solid var(--line); }
.teamlist li:first-child { border-top: 0; }
.reportrec { white-space: pre-wrap; margin: 4px 0 0; }
div.irslinks { margin: 0 0 16px; }

/* The figure tiles on a phone: two across and tighter, so the IRS picture is one screen, not six (Aaron, 2026-11-19). The lead tile and any tile with a row of pills take the full width. */
@media (max-width: 699px) {
  .irstiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .irstiles .figtile { padding: 14px 14px; }
  .irstiles .figtile.lead, .irstiles .figtile.span2 { grid-column: 1 / -1; }
  .figtile .fignum { font-size: 20px; }
  .figtile.lead .fignum { font-size: 30px; }
  .figtile .figlabel, .figtile .figsub { font-size: 12px; }
  .stagetiles { grid-template-columns: 1fr; gap: 8px; }
}
@media (min-width: 720px) { table.stack tr.totalrow td { border-top: 2px solid var(--line); } }
@media (max-width: 640px) { .billactions { flex-direction: column; align-items: stretch; } .billactions > * { width: 100%; margin: 0; } .billactions .addbtn, .billactions button { width: 100%; } }

/* Close on this call, at the end of the consultation interview (cases/_close_call.html). */
.closecall .closesteps { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: closestep; }
.closecall .closesteps > li { counter-increment: closestep; padding: 14px 0; border-top: 1px solid var(--line); }
.closecall .closesteps > li > .row > strong::before { content: counter(closestep) ". "; color: var(--muted); }
.closecall .closesteps form, .closecall .closeactions { margin-top: 10px; }
.closecall .closeactions form { margin: 0; }
.closecall .closesteps .row.spread { gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .closecall .closeactions { flex-direction: column; align-items: stretch; } .closecall .closeactions .button, .closecall .closeactions button, .closecall .closesteps form button { width: 100%; } }

/* The stage tiles (Aaron, 2026-11-19): the status pill stays on the label's line in every tile, and each tile's link sits on its bottom edge so the three line up. */
.stagetiles .figtile > .row.spread { flex-wrap: nowrap; align-items: center; gap: 8px; min-height: 30px; }
.stagetiles .figtile > .row.spread .statechip { flex: none; white-space: nowrap; }
.stagetiles .figtile > a { margin-top: auto; padding-top: 8px; }
.pillrow { gap: 6px; flex-wrap: wrap; }

/* The IRS tiles in three rows (crm/_irs_glance.html): owed; the payments and the next CSED; filing and estimated payments. Each row shares its width evenly. */
.irstiles { display: block; }
.irstiles .irsrow { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.irstiles .irsrow > .figtile { flex: 1 1 200px; }
@media (max-width: 699px) {
  .irstiles .irsrow { gap: 8px; margin-bottom: 8px; }
  .irstiles .irsrow > .figtile { flex: 1 1 calc(50% - 4px); }
  .irstiles .irsrow > .figtile.lead, .irstiles .irsrow > .figtile.span2 { flex-basis: 100%; }
}
/* The Owed tile is a full-width row on a computer: the number, then its notes, with the tax, penalty and interest split at the right, so the row is not mostly empty. */
@media (min-width: 900px) {
  .irstiles .figtile.lead { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 24px; row-gap: 2px; }
  .irstiles .figtile.lead .figlabel { flex-basis: 100%; }
  .irstiles .figtile.lead .figsplit { margin: 0 0 0 auto; font-size: 15px; gap: 4px 28px; }
}
/* The tab strip never widens the page: with ten tabs it scrolls inside itself on a tablet (found by the width check, 2026-11-19). */
@media (max-width: 899px) { nav.tabs { max-width: calc(100vw - 32px); } }
/* An info bubble in the last tile of a row opens to the left, so it never reaches past the page's right edge (it widened the page on a tablet). */
.irsrow > .figtile:last-child:not(:first-child) .tip::after, .stagetiles > .figtile:last-child .tip::after { left: auto; right: -8px; transform: none; }

/* The financial statement's summaries (financials/tabs/_overview.html and the two other tabs; apps/financials/glance.py). */
.sumrow { align-items: stretch; }
.sumop { flex: none; align-self: center; font-size: 26px; font-weight: 800; color: var(--muted); width: 16px; text-align: center; }
.irstiles .irsrow > .figtile.sumlead { flex: 1.3 1 220px; background: var(--btn); color: #fff; flex-direction: column; }
.irstiles .irsrow > .figtile.sumlead .figlabel, .irstiles .irsrow > .figtile.sumlead .figsub { color: rgba(255, 255, 255, .82); flex-basis: auto; }
.irstiles .irsrow > .figtile.sumlead a { color: #fff; text-decoration: underline; font-weight: 700; }
.irstiles .irsrow > .figtile.sumlead.short { background: var(--chip-bad-fg, #b32b21); }
.openlist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.openlist li:first-child { border-top: 0; }
.openlist li .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.openlist li .statechip { flex: none; }
.openlist li > a { flex: none; white-space: nowrap; }
.splitbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; }
.splitbar > span { min-width: 3px; }
.splitlegend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px 28px; margin: 14px 0 0; }
.splitlegend li { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.splitlegend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.splitlegend .what { flex: 1; color: var(--muted); font-weight: 600; font-size: 13px; }
.stackforms > div + div, .stackforms > form + form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.stmtgrid .ovside h3 { margin-top: 0; }
@media (max-width: 699px) {
  .sumop { display: none; }
  .irstiles .irsrow > .figtile.sumlead { flex-basis: 100%; }
}
.factstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; padding-top: 14px; padding-bottom: 14px; margin-bottom: 12px; font-weight: 600; }
.factstrip > a { margin-left: auto; }
.factstrip span { color: var(--muted); }
.estnote { margin: 0 0 12px; }
.offereq { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 16px 18px; border-radius: 16px; background: var(--tint); }
.offereq > div { display: flex; flex-direction: column; }
.offereq > div strong { font-size: 22px; font-weight: 800; }
.offereq strong.accent { color: var(--btn); }
.offereq > p { margin: 0 0 0 auto; max-width: 260px; }
table.ways td { vertical-align: top; }
.waysmore { margin-top: 4px; }
.waysmore > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
@media (max-width: 699px) { .offereq > p { margin-left: 0; max-width: none; flex-basis: 100%; } }

/* People on this case (cases/engagement_detail.html): a name and its role, with Take Off at the right */
.peoplerow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.peoplerow form { margin: 0; }
#people ul.plain { margin-bottom: 12px; }

/* The conflict waiver bar (partials/waiver_bar.html): red, under the client or case header, with its button */
.waiverbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 12px 0; }
.waiverbar p { margin: 0; flex: 1 1 320px; }
a.statechip { text-decoration: none; }

/* A ringing call (static/app.js ringDialog): a dialog in the middle of the screen, not a corner notice. */
dialog.ringpop { max-width: 440px; width: calc(100% - 32px); padding: 28px; border: 0; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: center; }
dialog.ringpop::backdrop { background: rgba(10, 12, 30, .45); }
dialog.ringpop h2 { margin: 0 0 20px; font-size: 22px; }
dialog.ringpop .ringnumber { margin: -12px 0 20px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
dialog.ringpop .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
dialog.ringpop .ringkicker { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
dialog.ringpop::backdrop { background: rgba(0, 0, 0, .55); }
.callerid { margin: 6px 0 0; gap: 12px; }
.notice .callerid p, .notice > p { margin: 0; }
.notice .callerid { margin-top: 8px; }

/* The theme and Sign out as two small icons side by side at the foot of the menu (partials/sidebar.html .sideicons; Aaron, 2026-11-24, from Plumbline).
   In the phone's drawer they keep their words; in the computer's rail only the icons show and the names are in the tooltip. */
.sidebar .sideicons { display: flex; flex-direction: row; gap: 4px; padding-top: 6px; }
.sidebar .sideicons form { margin: 0; }
.sidebar .sideicons .themebtn, .sidebar .sideicons .signout { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; width: auto; height: 40px;
  min-height: 0; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--side-ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.sidebar .sideicons .themebtn:hover, .sidebar .sideicons .signout:hover { background: var(--side-hover); filter: none; }
.sidebar .sideicons .ico, .sidebar .sideicons svg { width: 20px; height: 20px; }
@media (min-width: 900px) {
  .sidebar .sideicons { justify-content: center; }
  .sidebar .sideicons .themebtn, .sidebar .sideicons .signout { width: 38px; height: 38px; padding: 0; }
  .sidebar .sideicons .lbl { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}
/* The pop-out phone (templates/comms/phone.html): the RingCentral frame fills the window, one line under it. */
body.phonepage { margin: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.phonepage .phoneframe { flex: 1; width: 100%; border: 0; }
.phonepage .phonenote { margin: 0; padding: 8px 12px; }
.phonepage .phonesetup { margin: 16px; }
.topstrip .openphone { margin-left: 12px; }
.topstrip .openphone[hidden] { display: none; }
.phonepage .phoneanswered { margin: 0; padding: 8px 12px; text-align: center; }

/* The phone's drawer is as tall as the part of the screen you can SEE (Aaron, 2026-11-24: on his iPhone its last row, Theme and Sign out, ran past the bottom
   edge; top 0 / bottom 0 is measured against the whole screen behind Safari's bars). Browsers without dvh keep top 0 / bottom 0. */
@supports (height: 100dvh) {
  @media (max-width: 899px) { .sidebar { bottom: auto; height: 100dvh; } }
}

/* The phone drawer's Theme and Sign out row is pinned to the bottom of the SCREEN exactly the way the bottom tab bar is (position fixed, bottom 0, padded by the
   phone's own home-bar inset), so the two share one line on any iPhone whatever the drawer's own height (Aaron, 2026-11-24, after three fixes that predicted
   where the drawer ends). The tab bar's label sits 22px above the inset; this row's 40px buttons are centered there. The foot keeps room for it. */
@media (max-width: 899px) {
  .sidebar .sideicons { position: fixed; left: 0; bottom: 0; width: min(300px, 86vw); padding: 0 10px calc(2px + env(safe-area-inset-bottom)); background: var(--side-bg); }
  .sidebar { padding-bottom: 0; }
  .sidebar .side-foot { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
}

/* My work's heading line (the 2026-11-19 mockup): the date and who is signed in, under the title. */
h1 + .pagesub { margin: 2px 0 0; }
/* The quiet line under IRS changes to review: how many routine changes the week filed without an alert. */
.findings .routineweek summary { list-style: none; cursor: pointer; }
.findings .routineweek summary::-webkit-details-marker { display: none; }
.linkish { color: var(--brand); font-weight: 600; text-decoration: underline; text-decoration-color: var(--brand-mid); }
.teamlist abbr { text-decoration: none; }
.teamlist li { flex-wrap: nowrap; }
.teammark { margin-left: 2px; font-weight: 600; color: var(--muted); }
.teamnotes { margin: 8px 0 0; }

/* The Claude connector page: the address and its Copy button on one row that wraps on a phone. */
.connectaddr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.connectaddr code { font-size: 15px; padding: 6px 10px; background: var(--code-bg); border-radius: 8px; min-width: 0; }
ol.steps li { margin: 4px 0; }

/* iPhone and iPad Safari zoom the page into any focused field whose text is under 16px, and the page
   stays zoomed afterwards. Every field inherits the 15px body text (and a few are 14px), so on a touch
   screen fields are 16px. The page can still be pinch-zoomed: user zoom is never turned off. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

/* The placing screen for a PDF sent for signature (templates/signing/place.html, static/placer.js). */
.placer-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.placer-bar .field { margin: 0; }
.placer-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.placer-kinds button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent); }
.placer-pages { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 16px 0; }
.placer-page { position: relative; width: 100%; max-width: 900px; margin: 0; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); touch-action: none; user-select: none; }
.placer-page img { display: block; width: 100%; height: 100%; cursor: crosshair; }
.placer-page figcaption { position: absolute; bottom: -20px; left: 0; }
.placer-box { position: absolute; box-sizing: border-box; border: 2px dashed #b07800; background: rgba(255, 214, 0, .32); color: #3d2a00; font: 600 11px/1.1 var(--body-font); padding: 2px 4px; overflow: hidden; white-space: nowrap; cursor: move; border-radius: 3px; }
.placer-box.placer-s2 { border-color: #2c6ab0; background: rgba(90, 160, 255, .28); color: #0e2a4d; }
.placer-box.is-selected, .placer-box:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.placer-grip { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; background: currentColor; cursor: nwse-resize; border-top-left-radius: 3px; opacity: .7; }

/* An email template's fields, each with its info bubble (templates/comms/_field_help.html). */
.fieldlist { list-style: none; margin: 6px 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fieldlist li { display: inline-flex; align-items: center; white-space: nowrap; }
