/* ------------------------------------------NOTES------------------------------------------
   The portal's styles, lifted from the mockup's inline values (docs/mockup-screens/*.html and the
   design tokens in squares-migration/mockup/README.md). Values are the mockup's; class names are
   ours. Colours are oklch where the mockup used oklch. The canvas is 1280 x 800, desktop only.
   Date: 2026-10-06   AUTHOR: Dan
   ----------------------------------------------------------------------------------------- */


/* ------------------------------------------TOKENS------------------------------------------ */
:root {
  --card: #fff;
  --ink: #1b1e24;
  --ink-2: #4b5160;
  --muted: #6b7280;
  --faint: #9aa0ab;
  --faint-2: #b9bec7;
  --line: #e2e4e8;
  --row-line: #eceef1;
  --control: #cfd3da;
  --head-bg: #fafbfc;
  --ground: #f6f7f9;
  --band: #eef0f3;
  --sel: #f0f1f3;
  --slim: #e4e6ea;
  --canvas: #eceef1;
  --rail: #1b1e24;
  --rail-fg: #d6d9df;
  --rail-sub: #8b919c;
  --rail-line: #2c3039;
  --rail-tt: oklch(0.3 0.08 255);
  --link: #1f5fbf;
  --green: oklch(0.72 0.15 150);
  --green-text: oklch(0.45 0.14 150);
  --green-tint: #f0f7f2;
  --red: oklch(0.62 0.19 25);
  --red-text: oklch(0.5 0.17 25);
  --red-tint: #fff5f4;
  --red-tint-2: #fdf1ef;
  --yellow: oklch(0.82 0.16 90);
  --yellow-tint: #fff3c4;
  --yellow-tint-2: #fff8e1;
  --orange: oklch(0.72 0.17 55);
  --blue: oklch(0.6 0.17 255);
  --blue-2: oklch(0.68 0.13 250);
  --blue-tint: #dbe7fb;
  --req-bg: #fffdf5;
  --req-border: #d6c47a;
  --req-border-2: #e6d9a8;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}



/* ------------------------------------------THEMES (per browser, chosen under System > Settings > Display)------------------------------------------ */
:root[data-theme="dark"] {
  --card: #1b1e24; --ink: #e6e8ec; --ink-2: #c3c7cf; --muted: #9aa0ab; --faint: #6b7280; --faint-2: #565c68;
  --line: #2c3039; --row-line: #262a33; --control: #3a3f4a; --head-bg: #20242b; --ground: #15171c; --band: #23262d; --sel: #2a2e37; --slim: #22252c; --canvas: #0f1114;
  --rail: #0b0d10; --rail-fg: #d6d9df; --rail-sub: #8b919c; --rail-line: #2c3039; --link: #7fb2ff;
  --green-text: oklch(0.78 0.14 150); --red-text: oklch(0.75 0.16 25); --green-tint: #15261b; --red-tint: #2a1a19; --red-tint-2: #2a1a19;
  --yellow-tint: #2c2710; --yellow-tint-2: #27230f; --blue-tint: #16233a; --req-bg: #26231a; --req-border: #8a7a3a; --req-border-2: #5c5330;
}
:root[data-theme="dark"] .rail-item.active { background: #e6e8ec; color: #0b0d10; }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .sheets-btn { background: #e6e8ec; color: #0b0d10; }
:root[data-theme="dark"] .seg-chip.on, :root[data-theme="dark"] .chip.on, :root[data-theme="dark"] .chip.dark { background: #e6e8ec; color: #0b0d10; }
:root[data-theme="teal"] {
  --card: #f6fbfa; --ground: #e4f1ef; --head-bg: #edf6f4; --band: #e0edeb; --sel: #d8ebe8; --slim: #dfeae8; --canvas: #d3e6e3; --line: #c5dbd8; --row-line: #d6e6e3; --control: #a9c7c3;
  --rail: #0f3d3a; --rail-fg: #d6ebe8; --rail-sub: #8fb8b3; --rail-line: #1c5955; --rail-tt: oklch(0.35 0.08 190); --link: #0f766e; --ink: #10302d; --ink-2: #2f5451; --muted: #5b7a76;
}
:root[data-theme="teal"] .rail-item.active { background: #f6fbfa; color: #10302d; }
:root[data-theme="teal"] .btn-primary, :root[data-theme="teal"] .sheets-btn { background: #0f766e; color: #fff; }
:root[data-theme="teal"] .seg-chip.on, :root[data-theme="teal"] .chip.on, :root[data-theme="teal"] .chip.dark { background: #0f766e; color: #fff; }
:root[data-theme="gold"] {
  --card: #fbfaf4; --ground: #eef1e6; --head-bg: #f4f6ec; --band: #e9eddf; --sel: #e3ead6; --slim: #e6ead9; --canvas: #dfe5d3; --line: #cfd8bf; --row-line: #dde3d1; --control: #b4c19a;
  --rail: #11331c; --rail-fg: #e6ecd8; --rail-sub: #a3b88f; --rail-line: #1f4d2c; --rail-tt: oklch(0.35 0.08 150); --link: #8a6d0b; --ink: #15261a; --ink-2: #33483a; --muted: #5f7261;
  --green: oklch(0.62 0.15 150); --green-text: oklch(0.42 0.14 150); --yellow: #c9a227;
}
:root[data-theme="gold"] .rail-item.active { background: #c9a227; color: #11331c; }
:root[data-theme="gold"] .btn-primary, :root[data-theme="gold"] .sheets-btn { background: #c9a227; color: #11331c; }
:root[data-theme="gold"] .seg-chip.on, :root[data-theme="gold"] .chip.on, :root[data-theme="gold"] .chip.dark { background: #11331c; color: #e6ecd8; }
:root[data-theme="gold"] .badge { background: #c9a227; color: #11331c; }
/* purple (for Mairi, 2026-10-15) */
:root[data-theme="purple"] {
  --card: #fbf9fe; --ground: #f1ecf9; --head-bg: #f6f2fc; --band: #ece5f7; --sel: #e6ddf5; --slim: #e9e2f4; --canvas: #e3daf2; --line: #d8cdea; --row-line: #e6def2; --control: #bfaedd;
  --rail: #2e1a4d; --rail-fg: #e6dcf5; --rail-sub: #b3a0d3; --rail-line: #43296b; --rail-tt: oklch(0.35 0.1 300); --link: #6b3fb5; --ink: #22163a; --ink-2: #463868; --muted: #6e6189;
}
:root[data-theme="purple"] .rail-item.active { background: #fbf9fe; color: #22163a; }
:root[data-theme="purple"] .btn-primary, :root[data-theme="purple"] .sheets-btn { background: #6b3fb5; color: #fff; }
:root[data-theme="purple"] .seg-chip.on, :root[data-theme="purple"] .chip.on, :root[data-theme="purple"] .chip.dark { background: #6b3fb5; color: #fff; }

/* ------------------------------------------BASE------------------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--canvas); font-family: var(--sans); color: var(--ink); font-size: 12px; line-height: 1.35; }
a { color: var(--link); text-decoration: none; }
a:hover { color: #163f80; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--green-text); }
.neg { color: var(--red-text); }
[hidden] { display: none !important; }

/* the site fills the window (Caden, 2026-10-06); the mockup's 1280 x 800 card is only the design reference now */
.canvas { height: 100vh; overflow: hidden; }
.frame { margin: 0 auto; background: var(--ground); display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.grid { flex: 1 1 0%; min-height: 0; display: grid; grid-template-columns: 160px 1fr; height: 100%; }
.content { min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.pad { padding: 4px; display: flex; flex-direction: column; gap: 4px; min-height: 0; flex: 1; }


/* ------------------------------------------RAIL------------------------------------------ */
.rail { background: var(--rail); color: var(--rail-fg); display: flex; flex-direction: column; padding: 14px 0; position: sticky; top: 0; overflow-y: auto; align-self: start; height: 100%; }
.rail-tt { background: var(--rail-tt); }
.rail-head { padding: 0 16px 14px; border-bottom: 1px solid var(--rail-line); }
.rail-week { font-size: 15px; font-weight: 600; color: #fff; }
.rail-sub { font-size: 11px; color: var(--rail-sub); margin-top: 2px; }
.rail-out { color: var(--rail-sub); text-decoration: underline; }
.rail-foot .rail-out-m { display: none; }   /* the phone's sign out, under System in the drawer (Dan, 2026-11-04); the desktop rail has it under the name */
.rail-out:hover { color: #fff; }
.rail-nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; }
.rail-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 5px; font-size: 13px; color: var(--rail-fg); cursor: pointer; }
.rail-item:hover { color: #fff; }
.rail-item.active { background: var(--card); color: var(--ink); }
.rail-foot { margin-top: auto; padding: 10px 8px; border-top: 1px solid var(--rail-line); }
.rail-system { justify-content: flex-start; gap: 8px; border: 1px solid #3a3f4a; }
.rail-system .ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.rail-system .chev { margin-left: auto; font-size: 11px; opacity: .7; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px var(--mono); }


/* ------------------------------------------TIME TRAVEL------------------------------------------ */
.tt-banner { flex: none; background: repeating-linear-gradient(45deg, #dbe7fb 0 8px, #e9f0fc 8px 16px); border-bottom: 1px solid var(--blue); padding: 6px 18px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: #0e2a5c; }
.tt-title { font-weight: 700; letter-spacing: .04em; }
.tt-back { margin-left: auto; cursor: pointer; padding: 4px 12px; border-radius: 5px; background: var(--blue); color: #fff; font-weight: 600; font-size: 11px; }
.tt-back:hover { color: #fff; }
body.read-only .write { opacity: .45; pointer-events: none; }


/* ------------------------------------------PAGE HEAD AND TABS------------------------------------------ */
.page-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 18px 0; display: flex; align-items: flex-end; gap: 22px; flex: none; }
.page-title { font-size: 16px; font-weight: 600; padding-bottom: 10px; }
.page-tabs { display: flex; gap: 18px; font-size: 12.5px; }
.tab { cursor: pointer; padding-bottom: 9px; font-weight: 600; border-bottom: 2px solid transparent; color: var(--muted); }
.tab.active { border-bottom-color: var(--ink); color: var(--ink); }
.tab:hover { color: var(--ink); }
.tab .count { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--row-line); color: var(--ink-2); }
.page-right { margin-left: auto; padding-bottom: 8px; }


/* ------------------------------------------CARDS------------------------------------------ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.card-head { padding: 7px 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: var(--head-bg); font-size: 13px; font-weight: 600; flex: none; }
.card-head-lg { padding: 12px 16px; font-size: 16px; }
.card-body { padding: 10px 12px; overflow: auto; min-height: 0; }
.card-foot { padding: 6px 12px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); flex: none; }
.band { display: flex; align-items: center; gap: 12px; padding: 6px 18px; background: var(--band); border-bottom: 1px solid var(--line); font-size: 12px; }
.fold { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1px solid var(--control); border-radius: 3px; background: var(--card); font: 600 13px var(--mono); color: var(--ink-2); line-height: 1; cursor: pointer; }


/* ------------------------------------------STATES------------------------------------------ */
.state-empty { font-size: 11px; color: var(--muted); padding: 10px 12px; }
.state-loading { font-size: 11px; color: var(--faint); padding: 10px 12px; }
.state-error { font-size: 11px; color: var(--red-text); padding: 8px 12px; }
.state-error a { margin-left: 6px; }
.warn-box { margin: 10px 12px; padding: 10px 12px; border: 2px solid var(--red); border-radius: 8px; background: var(--red-tint); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: oklch(0.45 0.17 25); }
.warn-box .bang { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; margin-right: 8px; }
.note-box { padding: 6px 8px; border: 1px solid var(--red); border-radius: 5px; background: var(--red-tint); font-size: 11px; color: oklch(0.45 0.17 25); }


/* ------------------------------------------BUTTONS AND CHIPS------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border-radius: 5px; font: 600 11px var(--sans); padding: 5px 12px; border: 1px solid var(--control); background: var(--card); color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #3a3f4a; color: #fff; }
.btn-lg { padding: 9px 14px; font-size: 13px; }
.btn-sm { padding: 1px 8px; font-size: 10.5px; }
.btn-xs { padding: 3px 9px; font-size: 11px; border-radius: 3px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn.busy { color: var(--faint); border-color: var(--control); background: var(--card); pointer-events: none; }
.chip { height: 22px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; padding: 0 10px; border-radius: 5px; font-size: 11px; font-weight: 600; border: 1px solid var(--control); background: var(--card); color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.locked { color: var(--faint-2); cursor: default; }
.seg { display: flex; border: 1px solid var(--control); border-radius: 5px; overflow: hidden; }
.seg > * { cursor: pointer; padding: 5px 14px; font-weight: 600; font-size: 12px; border-left: 1px solid var(--control); color: var(--ink-2); background: var(--card); }
.seg > :first-child { border-left: 0; }
.seg > .on { background: var(--ink); color: #fff; }
.toggle { position: relative; z-index: 0; display: inline-block; width: 28px; height: 14px; border-radius: 8px; background: var(--control); cursor: pointer; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 14px; }
.link { color: var(--link); cursor: pointer; font-size: 11px; }
.link.neg { color: var(--red-text); font-weight: 700; }   /* a link that takes something away (Remove on the bet sheet, Dan 2026-11-17) */


/* ------------------------------------------INPUTS------------------------------------------ */
.input, select.input { padding: 6px 8px; border: 1px solid var(--control); border-radius: 5px; background: var(--card); font: 12px var(--sans); color: var(--ink); }
.input.mono { font-family: var(--mono); }
.input.sm { padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.input.req { background: var(--req-bg); border-color: var(--req-border); }
.input.num { text-align: right; font-family: var(--mono); }
.input:focus { outline: none; border-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 11px; color: var(--muted); font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row > * { min-width: 0; }
.field > .input { width: 100%; box-sizing: border-box; min-width: 0; }
.tick { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--faint-2); border-radius: 3px; background: var(--card); cursor: pointer; }
.tick.on { background: var(--ink); }


/* ------------------------------------------TABLES------------------------------------------ */
.tbl { border-collapse: collapse; width: 100%; font-size: 12px; }
.tbl th { text-align: left; font-weight: 600; font-size: 11px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--head-bg); position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th.c, .tbl td.c { text-align: center; }
.tbl th.sort { cursor: pointer; }
.tbl td { padding: 5px 10px; border-bottom: 1px solid var(--row-line); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); }
.tbl tr.total td { background: var(--head-bg); border-top: 2px solid var(--line); font-weight: 600; }
.tbl tr.sel td { background: var(--sel); }
.tbl tbody tr:hover > td { background: var(--sel); }
.gtile:hover { border-color: var(--control); }
.cmd-row:hover, .feed-row:hover, .req-row:hover, .hgame:hover, .topg:hover, .wrow:hover { background: var(--sel); }
.tbl .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-wrap { overflow: auto; min-height: 0; }


/* ------------------------------------------BADGES AND SQUARES------------------------------------------ */
.res { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 1px 6px; border-radius: 3px; height: 16px; font: 600 9.5px var(--mono); color: #fff; }
.res-won { background: var(--green); }
.res-lost { background: var(--red); }
.res-push, .res-void { background: var(--faint); }
.res-open { background: var(--blue); }
.sq { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 16px; border-radius: 3px; font: 600 9.5px var(--mono); color: #fff; border: 1px solid transparent; }
.sq-sm { width: 22px; height: 13px; font-size: 8.5px; }
.sq-done { background: var(--green); }
.sq-sched { background: var(--blue); }
.sq-missed { background: var(--red); }
.sq-empty { background: var(--yellow); color: #4a3800; }   /* scraped, but the book returned no lines (2026-10-15) */
.sq-idle { background: #e3e5e9; color: var(--muted); }
.sq-nolink { background: var(--card); color: var(--ink); border: 1px dashed var(--control); }
/* a split pill: the top-left half is the hand-started lines scrape, the bottom-right the CLV scrape (Caden, 2026-10-06) */
.sq.split { background: linear-gradient(135deg, var(--tl) 0 50%, var(--br) 50% 100%); color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.35); }
.sq.split.dim { color: var(--muted); text-shadow: none; }
a.sq { text-decoration: none; cursor: pointer; }   /* a square with the book's link opens the game's page in a new tab (2026-11-02) */
a.sq:hover { color: #fff; filter: brightness(1.12); }
a.sq.sq-nolink:hover, a.sq.split.dim:hover { color: var(--ink); }
.stripe-final { border-left: 3px solid var(--green); }
.stripe-live { border-left: 3px solid var(--yellow); }
.stripe-upcoming { border-left: 3px solid var(--blue); }
.stripe-nofeed { border-left: 3px solid var(--red); }
.live-sq { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--yellow); }


/* ------------------------------------------MODALS------------------------------------------ */
.scrim { position: absolute; inset: 0; background: rgba(27,30,36,.35); display: flex; align-items: center; justify-content: center; z-index: 5; }
.modal { width: 360px; background: var(--card); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; font-size: 12px; }
.modal-lg { width: 380px; }
.modal-title { font-size: 15px; font-weight: 600; }
.check-sheet { padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--head-bg); }   /* the before-you-run and before-you-start reminders (2026-10-21) */
.check-sheet ol { margin: 4px 0 0; padding-left: 18px; } .check-sheet li { margin: 2px 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal-foot .btn { padding: 7px 14px; font-size: 12px; }
.content { position: relative; }


/* ------------------------------------------MANAGE: SETUP------------------------------------------ */
.setup { display: flex; flex-direction: column; gap: 10px; padding: 12px 18px; min-height: 0; overflow: hidden; flex: 1; background: var(--ground); }
.setup-card { flex: 1 1 auto; max-height: none; }
.setup #slates-card { flex: 0 0 auto; max-height: 46%; }
.setup.collapse-slates #slates-card, .setup.collapse-accts #accts-card { flex: 0 0 auto; max-height: none; }
.setup.collapse-accts #slates-card { flex: 1 1 auto; max-height: none; }
.setup-card.collapsed .tbl-wrap, .setup-card.collapsed .card-foot { display: none; }
.fold-head { cursor: pointer; font-size: 12px; padding: 8px 12px; }
.fold-head .norm { font-weight: 400; }
.head-actions { display: flex; gap: 6px; align-items: center; }
.head-actions .search { width: 160px; font-size: 11px; padding: 4px 8px; }
.tbl-slates td.name { font-weight: 500; }
.tbl-slates td.sm, .tbl-accts td.sm, .mono.sm { font-size: 11px; white-space: nowrap; }
.tbl td.acts { white-space: nowrap; }
.tbl td.acts .btn { margin-left: 4px; }
.band-row td { background: var(--band); border-bottom: 1px solid var(--line); cursor: pointer; padding: 5px 10px; }
.band-row .chev { color: var(--faint); font-size: 10px; margin-right: 6px; }
.band-row td.b { font-weight: 600; }
.tbl-accts td.indent { padding-left: 30px; color: var(--ink-2); }
.acct-row.paused td { background: var(--red-tint); }
/* entries (deposit, withdraw, adjust) and the history: Manage's People & accounts and the client's Accounts tab (2026-10-13, redesigned 2026-10-15) */
.tbl-accts .total-row td { background: var(--band); border-bottom: 2px solid var(--line); font-weight: 500; }   /* pinned first since Dan's design of 2026-10-21 */
.tbl-accts .total-row .btn, .tbl-accts .band-row .btn { margin-left: 8px; font-size: 10.5px; padding: 1px 7px; }
.tbl-accts .acct-row { cursor: pointer; }
.tbl-accts .acct-row td.indent .chev { color: var(--faint); font-size: 10px; margin-right: 6px; }
.tbl-accts .acct-row.drawer-open td { border-bottom: none; background: var(--yellow-tint, rgba(255, 214, 0, 0.10)); }
.tbl-accts .drawer-row td { padding: 8px 12px 10px 30px; background: var(--head-bg); border-left: 3px solid var(--ink); }
.tbl-accts .hist-panel td { padding: 10px 12px 12px 30px; background: var(--head-bg); }
.tbl-accts .pr-row { cursor: pointer; }
.tbl-accts .pr-row td { background: var(--head-bg); }
.tbl-accts .pr-row.drawer-open td { border-bottom: none; background: var(--yellow-tint, rgba(255, 214, 0, 0.10)); }
.tbl-accts td.indent2 { padding-left: 54px; color: var(--ink-2); }
.tbl-accts td.indent2 .chev { color: var(--faint); font-size: 10px; margin-right: 6px; }
.tbl-accts .drawer-prof td { padding-left: 54px; }
.tbl-accts .prof-new-row td, .tbl-accts .prof-set-row td { padding: 6px 12px 6px 54px; background: var(--head-bg); }
.tbl-accts .x.disabled { opacity: 0.35; cursor: default; }
.prof-set-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.prof-set-inputs .input { width: 90px; margin-left: 4px; }
.entry-np { width: 150px; }
.drawer-wrap, .hist-wrap { display: flex; flex-direction: column; gap: 8px; }
.entry-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.entry-form .input { width: 110px; }
.entry-form .input.num { width: 86px; }
.entry-form .entry-note { flex: 1 1 200px; min-width: 160px; width: auto; }
.entry-form .amt-wrap { display: inline-flex; align-items: center; gap: 3px; }
.entry-hint { margin-top: -4px; }
.hist-sum { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12px; }
.hist-sum b { font-weight: 600; }
.hist-sum .ml { margin-left: auto; }
.hist-box { border: 1px solid var(--line); border-radius: 4px; background: var(--card); overflow: hidden; }
.hist-list { max-height: 260px; overflow: auto; }
.hist-row { display: grid; gap: 10px; align-items: center; padding: 0 10px; height: 28px; font-size: 11.5px; border-top: 1px solid var(--row-line); }
.hist-row-7 { grid-template-columns: 150px minmax(110px, 1fr) 110px 100px minmax(160px, 1.4fr) 90px; }
.hist-row-6 { grid-template-columns: 150px 110px 100px minmax(160px, 1.6fr) 90px; }
.hist-row-acct { grid-template-columns: minmax(140px, 1.4fr) repeat(5, minmax(90px, 1fr)); }
.hist-head { background: var(--band); font-size: 11px; font-weight: 500; color: var(--muted); border-top: 0; height: 26px; }
.hist-list .hist-row:first-child { border-top: 0; }
.amber { color: var(--amber, #8a6a00); }
.tbl-accts td.acts .btn.on { background: var(--ink); color: #fff; }
.tbl-accts td.acts .link { margin-left: 6px; }
.tag-faint { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }
.hist-check { margin: 8px 0 10px; }
.hist-check .tbl-check td, .hist-check .tbl-check th { font-size: 11.5px; padding: 3px 8px; }
.prof-grid .r.nowrap { white-space: nowrap; }
.cash-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.cash-form .input { width: 110px; }
.cash-form .input.num { width: 90px; }
.cash-tot { display: flex; align-items: center; gap: 14px; font-size: 12px; padding: 6px 0; border-top: 1px solid var(--row-line); }
.cash-tot .ml { margin-left: auto; }
.cash-grid { display: grid; grid-template-columns: 72px 36px minmax(0, 1fr) 72px 84px minmax(0, 1fr) 80px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--row-line); font-size: 11.5px; }
.cash-head { font-size: 11px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.cash-list { max-height: 300px; overflow: auto; }
.accts-page { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.accts-page .ecard { max-width: 860px; }
.accts-page .setup-card { max-width: 1100px; }
.tbl-client .band-row td { cursor: default; }
.tbl-client .acct-row.paused td { background: var(--ground); }   /* a client's paused account: the whole row light grey with grey words, no red row (Dan, 2026-11-19) */
.cash-figs { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; }
.cash-figs > span { display: flex; flex-direction: column; gap: 1px; }
.tbl-accts input.input { box-sizing: border-box; }
.limit-in { width: 56px; }
.pause-ctl { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.x { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--control); color: var(--faint); font-size: 11px; cursor: pointer; }
.x:hover { color: var(--red-text); border-color: var(--red-text); }
.warn-title { display: flex; align-items: center; font-size: 12px; font-weight: 700; }
.outside-list { display: flex; flex-direction: column; gap: 3px; }
.outside-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 4px 8px; background: var(--card); border: 1px solid #f1c7c2; border-radius: 5px; color: var(--ink); }
.outside-row .g { font-weight: 600; flex: 1; }
.link-sel { font-size: 11px; color: var(--link); border-color: transparent; padding: 2px 4px; }
.modal-split { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.sm { font-size: 11px; }
.run-box { margin: 10px 12px; padding: 8px 12px; border: 1px solid var(--green); border-radius: 8px; background: var(--green-tint); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.run-box.has-problems { border-color: var(--red); background: var(--red-tint); }
.run-line { display: flex; align-items: center; gap: 6px; }
.run-line .ml { margin-left: auto; }
.run-box details summary { cursor: pointer; }
.start-box { display: inline-flex; align-items: center; gap: 8px; max-width: 560px; }
.page-right .state-error { padding: 4px 0 0; }


/* ------------------------------------------SCRAPING------------------------------------------ */
.board { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--ground); flex: 1; }   /* a column, so a status line above the tiles never pushes the command column out of view */
.tiles { padding: 4px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; flex: none; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--head-bg); border-top: 3px solid var(--faint-2); min-width: 0; }   /* min-width 0 so a long failure text truncates instead of widening the grid (Dan, 2026-10-21) */
.tile-blue { border-top-color: var(--blue-2); } .tile-red { border-top-color: var(--red); }
.tile-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; }
.tile-state { display: inline-flex; align-items: center; justify-content: center; height: 16px; padding: 1px 6px; border-radius: 3px; font: 600 9.5px var(--mono); background: var(--faint); color: #fff; }
.tile-state.st-scraping, .tile-state.st-queued { background: var(--blue-2); } .tile-state.st-failed { background: var(--red); }
.tile-sub { font-size: 11px; color: #5b6270; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 4px; padding: 0 4px 4px; min-height: 0; overflow: hidden; flex: 1; }   /* the games column may shrink, so a wide table never pushes the command column off the screen (Dan, 2026-10-27) */
.games-card { min-height: 0; }
.games-head { display: flex; align-items: center; gap: 14px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: #5b6270; flex: none; flex-wrap: wrap; row-gap: 4px; }
.games-head > span { white-space: nowrap; }
.games-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.clv-key { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; font-size: 10.5px; white-space: nowrap; }
.clv-key span { display: inline-flex; align-items: center; gap: 3px; }
.sq.k { width: 10px; height: 10px; }
.slate-band { padding: 6px 18px; cursor: default; }
.slate-band .b { font-weight: 600; } .slate-band .ink2 { color: var(--ink-2); } .slate-band .ml { margin-left: auto; }
.slate-band.neg .b { color: var(--red-text); }
.band-date { white-space: nowrap; }
.tbl-games td { padding: 5px 8px; }
.tbl-games td.tickcell { padding-left: 18px; width: 14px; }
.tbl-games td.when { width: 84px; white-space: nowrap; }   /* the kickoff time alone; the slate band carries the date (Dan, 2026-11-02) */
.tbl-games td.when-long { width: 120px; }   /* games outside slates keep their date */
.tbl-games td.match { font-weight: 500; white-space: nowrap; }
.tbl-games td.cells { width: 200px; }
.cells-wrap { display: flex; gap: 3px; justify-content: center; }
.game-row { cursor: pointer; }
.game-row.started { cursor: default; } .game-row.started .when, .game-row.started .match { opacity: 0.55; }   /* kicked off: no tick, dimmed (2026-10-21) */
.tick-gap { display: inline-block; width: 12px; height: 12px; }
.cmd-col { background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow: hidden auto; min-height: 0; min-width: 0; }   /* nothing inside may widen it: every card and line wraps or clips (Dan, 2026-10-27) */
.cmd-card { flex: none; min-width: 0; max-width: 100%; }
.cmd-card .card-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-card .card-head .head-actions { flex: none; }
.cmd-body { padding: 7px 12px; font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }   /* the Pinnacle card's "next" time wraps instead of clipping (Dan, 2026-10-23) */
.cmd-body > span { min-width: 0; overflow-wrap: anywhere; }
.cmd-body.col { flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.cmd-body.col > * { min-width: 0; max-width: 100%; }
.cmd-list { padding: 6px 12px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.cmd-foot { padding: 0 12px 10px; display: flex; }   /* Run all at the foot of Book schedules (Dan, 2026-11-02) */
.cmd-foot .btn { flex: 1; }
.cmd-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; min-width: 0; }
.cmd-row .head-actions { flex: none; }
.dots { display: inline-flex; gap: 2px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 2px; border: 1px solid var(--control); background: var(--card); display: inline-block; }
.dot.on { background: var(--ink); border-color: var(--ink); }
.book-toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.book-toggles .chip { padding: 0 4px; }
.book-toggles .chip.dark { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.spread { display: flex; justify-content: space-between; }
.scrape-btn { padding: 12px; letter-spacing: .02em; white-space: normal; text-align: center; line-height: 1.3; }   /* wraps rather than widening the column (Dan, 2026-10-27) */
.sched-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.sched-row .input { flex: 1; min-width: 0; }
.req-list { display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--row-line); padding-top: 6px; }
.req-row { display: flex; align-items: center; gap: 6px; }
.req-row .ellip { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x.sm { width: 16px; height: 16px; font-size: 10px; }
.feed-card { flex: 1; min-height: 120px; }
.feed-head { padding: 6px 12px; display: flex; align-items: center; font-size: 11px; background: var(--head-bg); border-bottom: 1px solid var(--line); flex: none; }
.feed-head .ml { margin-left: auto; }
.sm-seg > * { padding: 4px 12px; font-size: 11px; }
.feed-body { overflow: auto; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.feed-row { display: flex; gap: 8px; font-size: 11px; min-width: 0; }
.feed-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.lvl-ok { color: var(--green-text); } .lvl-warn, .lvl-error { color: var(--red-text); } .lvl-info { color: var(--ink-2); }
.feedlog { display: flex; flex: 1; min-height: 0; }
.modal-wide { width: 760px; }
.match-wrap { max-height: 420px; border: 1px solid var(--line); border-radius: 5px; }
.card-head .norm { font-weight: 400; }


/* ------------------------------------------ALGORITHM------------------------------------------ */
.algo { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 4px; padding: 4px; min-height: 0; overflow: hidden; background: var(--ground); flex: 1; }
.algo-left, .algo-right { min-height: 0; }
.algo.gww { grid-template-columns: 56px minmax(0, 1fr); }   /* the games panel folded to a rail (Dan's mockup, 2026-11-03) */
.algo-rail { align-items: center; padding: 8px 0; }
.rail-open { flex: 1; width: 40px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; border: 1px solid var(--control); border-radius: 8px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 13px; }
.rail-open:hover { background: var(--head-bg); }
.rail-open .vtxt { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .02em; }
.rail-open .chev, .algo-left [data-act=gww] { font-size: 18px; font-weight: 700; line-height: 1; }   /* the fold arrows large enough to read (Dan, 2026-11-04) */
.algo-left [data-act=gww] { padding: 0 8px; }
.slate-row { padding: 8px 12px; border-bottom: 1px solid var(--line); flex: none; }
.seg-row { display: flex; border: 1px solid var(--control); border-radius: 5px; overflow: hidden; }
.seg-chip { flex: 1; height: 22px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; font-size: 11px; font-weight: 600; border-left: 1px solid var(--control); margin-left: -1px; cursor: pointer; background: var(--card); color: var(--ink-2); }
.seg-chip.on { background: var(--ink); color: #fff; }
.gtiles { overflow: auto; min-height: 0; flex: 1; padding: 6px; background: #f3f4f6; display: flex; flex-direction: column; gap: 6px; }
.gtile { padding: 8px 12px 8px 10px; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 5px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; flex: none; }
.gtile.sel { background: var(--sel); border-color: var(--ink); }
.gtile .tick { width: 13px; height: 13px; margin-top: 2px; }
.gtile-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 500; }
.gtile-top .mono { flex: none; margin-left: 8px; font-weight: 400; }
.gtile-sub { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.lines { display: grid; grid-template-columns: auto 1fr 1fr auto; column-gap: 10px; row-gap: 1px; margin-top: 5px; padding: 4px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 5px; font-size: 10.5px; }
.lines .b { font-weight: 700; }
.ages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px 2px; margin-top: 6px; }   /* five books a row, then the next row (Dan, 2026-10-23) */
.age { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.age-bar { height: 4px; border-radius: 1px; display: block; }
.age-txt { font: 9px var(--mono); color: var(--muted); text-align: center; white-space: nowrap; }
.age-txt b { color: var(--ink); }
.age-fresh { background: var(--green); } .age-mid { background: var(--yellow); } .age-old { background: var(--orange); } .age-none { background: var(--red); }
.eval-bar { padding: 10px 12px; border-top: 1px solid var(--line); background: var(--head-bg); display: flex; flex-direction: column; gap: 6px; flex: none; }
.eval-bar .btn-lg { padding: 9px; font-size: 12px; }
.mkt-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--row-line); font-size: 11px; }
.book-pick { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.book-pick .chip { font: 600 9.5px var(--mono); padding: 2px 6px; }
.warn-tri { color: var(--yellow); font-size: 10px; }
.algo-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; column-gap: 16px; row-gap: 8px; align-items: center; flex: none; }
.algo-title { font-size: 15px; font-weight: 600; }
.min0 { min-width: 0; }
.stat-strip { display: flex; gap: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.stat { padding: 4px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--head-bg); text-align: center; }
.stat .b { font-size: 14px; font-weight: 600; color: var(--ink); }
.scraped { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 11.5px; border-top: 1px solid var(--row-line); padding-top: 8px; }
.scraped .caps { font-size: 10px; letter-spacing: .05em; font-weight: 600; }
.scraped .sc { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tbl-bets { table-layout: fixed; font-size: 11.5px; }
.tbl-bets th:nth-child(1) { width: 84px; } .tbl-bets th.r { width: 50px; } .tbl-bets th.c { width: 70px; } .tbl-bets th:last-child { width: 104px; }
.tbl-bets td.acts { white-space: nowrap; }
.tbl-bets tr.excluded td { opacity: .45; }
.tbl-bets tr.gone td { opacity: .55; background: var(--red-tint); }
.b500 { font-weight: 500; }
.ink2 { color: var(--ink-2); }
.conf-in { width: 40px; }
.dealt { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 16px; border-radius: 3px; font: 700 10px var(--mono); }
.d-yes { background: var(--green); color: #fff; } .d-no { background: var(--red); color: #fff; } .d-maybe { background: #e3e5e9; color: var(--muted); }
.chip.ex-on { background: var(--red); border-color: var(--red); color: #fff; }
.undo { margin: 8px 12px; }


/* ------------------------------------------BET SHEETS------------------------------------------ */
.sheet { display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; background: var(--ground); flex: 1; }
.sheet-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 18px; display: flex; flex-direction: column; gap: 8px; flex: none; }
.sheet-title-row { display: flex; align-items: center; gap: 14px; }
.sheet-title { font-size: 16px; font-weight: 600; }
.sheet-title .norm { font-weight: 400; font-size: 13px; }
.sheet-stats { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.ml { margin-left: auto; }
.filters { display: flex; align-items: center; gap: 12px; font-size: 11px; flex-wrap: wrap; row-gap: 6px; }   /* wraps only when the chips would run off the edge (Dan, 2026-11-02) */
.chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chips-label { color: var(--muted); font-weight: 600; margin-right: 3px; }
.divider { width: 1px; height: 18px; background: var(--line); }
.still { display: flex; align-items: center; gap: 12px; padding: 9px 18px; background: var(--yellow-tint); border-bottom: 1px solid var(--req-border-2); font-size: 12.5px; color: #4a3800; flex: none; }
.still.redeal { background: var(--blue-tint, #eef3fb); border-bottom-color: var(--blue, #2f5fb3); color: var(--ink); }   /* a re-deal touched the viewer's rows (2026-10-23) */
.bang-dark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }
.sheet-table { margin: 4px; min-height: 0; flex: 1; }
.tbl-sheet td.nowrap, .nowrap { white-space: nowrap; }
.tbl-sheet { table-layout: fixed; }
.tbl-sheet th.rec { width: 250px; }
.tbl-sheet th.w-person { width: 70px; } .tbl-sheet th.w-kick { width: 92px; } .tbl-sheet th.w-kick12 { width: 116px; }   /* room for "Sat 12:30 PM" on the 12-hour clock (2026-11-19) */ .tbl-sheet th.w-book { width: 84px; } .tbl-sheet th.w-num { width: 86px; }
.tbl-sheet td.nowrap, .tbl-sheet td.nowrap > div { overflow: hidden; text-overflow: ellipsis; }
.tbl-sheet td.wrap { white-space: normal; }   /* the game and the bet read in full (2026-10-09) */
.sort-n { font-size: 8px; color: var(--muted); margin-left: 1px; }
.short-name { display: none; }   /* the abbreviated bet, for the phone's Grading table */
.tbl-sheet th.w-adv { width: 46px; } .tbl-sheet th.w-fd { width: 56px; }   /* the five Advanced columns, as narrow as their numbers (Dan, 2026-11-04) */
.tbl-sheet.sheet-adv { font-size: 11px; }
.tbl-sheet.sheet-adv th.rec { width: 215px; }
.tbl-sheet.sheet-adv th.w-num { width: 74px; }
.tbl-sheet td.rec { padding-right: 18px; }
.tbl-sheet td.rec > * { vertical-align: middle; }
.tbl-sheet .rec .ml { margin-left: 8px; }
.row-slim td { background: var(--slim); color: var(--muted); font-size: 11.5px; padding: 3px 10px; border-bottom-color: #d6d9df; }
.row-custom td { background: var(--green-tint); }
.row-draft td { background: var(--req-bg); }
.row-prompt td { background: var(--yellow-tint-2); }
.row-edit td { background: var(--sel); }
.note-in { width: 110px; } .name-in { width: 150px; text-align: left; }
.odds-in { width: 62px; } .amt-in { width: 70px; } .pick-in { width: 180px; text-align: left; } .lim-in { width: 48px; }
.prompt { display: flex; align-items: center; gap: 4px; font-size: 11px; flex-wrap: wrap; }
.b600 { font-weight: 600; }
.sheet-foot { background: var(--card); border-top: 1px solid var(--line); padding: 8px 18px; font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex: none; }
.sheet-foot b { color: var(--ink); }
.sheet-modal-head { display: flex; justify-content: space-between; align-items: baseline; }


/* ------------------------------------------GRADING------------------------------------------ */
.grading { display: flex; flex-direction: row; min-height: 0; overflow: hidden; background: var(--ground); padding: 10px 18px 12px; gap: 10px; flex: 1; }
.gcard { flex: 0 0 300px; min-width: 0; }
.bcard { flex: 1 1 auto; min-width: 0; }
.gkey { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; border-bottom: 1px solid var(--line); background: var(--head-bg); font-size: 10px; color: var(--muted); font-weight: 600; flex: none; }
.gkey .keys { display: inline-flex; gap: 8px; font-weight: 400; font-size: 10.5px; color: #5b6270; }
.gkey .keys span { display: inline-flex; align-items: center; gap: 3px; }
.glist { overflow-y: auto; overflow-x: hidden; min-height: 0; display: flex; flex-direction: column; }
.gband { padding: 5px 10px; font-size: 11.5px; position: sticky; top: 0; z-index: 1; cursor: pointer; }
.gband .fold { width: 16px; height: 16px; font-size: 12px; }
.gband .ellip { min-width: 0; }
.grow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-bottom: 1px solid var(--row-line); background: var(--card); }
.grow[data-score] { cursor: pointer; }
.grow.nofeed { background: var(--red-tint-2); }
.grow.editing { background: var(--sel); }
.grow .g1 { flex: 1; }
.grow .score { text-align: right; white-space: nowrap; min-width: 64px; }
.score-edit { flex-basis: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 8px; row-gap: 4px; align-items: center; padding: 4px 0 5px 3px; font-size: 11px; }
.sc-in { width: 34px; text-align: center; }
.tbl-grade { table-layout: fixed; }
.tbl-grade th.chev, .tbl-grade td.chev { width: 22px; padding-left: 8px; font-size: 10px; }
.tbl-grade th:nth-child(2) { width: 84px; } .tbl-grade th:nth-child(3) { width: 44px; } .tbl-grade th:nth-child(4) { width: 150px; } .tbl-grade th.r { width: 66px; } .tbl-grade th:nth-child(9) { width: 90px; }   /* the 9th is Result since Payout went in before it (2026-10-21) */
.brow { cursor: pointer; }
.brow.sel td { background: var(--row-line); }
.brow.sel td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.brow.needs td { background: var(--yellow-tint-2); }
.bdetail td { background: var(--ground); border-bottom: 1px solid var(--line); padding: 10px 12px 12px 6px; }
.bgrid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.bfacts { display: grid; grid-template-columns: repeat(4, auto); column-gap: 22px; row-gap: 8px; font-size: 11.5px; justify-content: start; }
.bedit { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gopts { display: flex; border: 1px solid var(--control); border-radius: 3px; overflow: hidden; font-size: 10.5px; margin-top: 2px; }
.gopt { flex: 1; text-align: center; padding: 3px 8px; cursor: pointer; border-left: 1px solid var(--control); font-weight: 600; color: var(--ink-2); }
.gopt:first-child { border-left: 0; }
.gopt.on { color: #fff; }
.gopt.on.res-won { background: var(--green); } .gopt.on.res-lost { background: var(--red); } .gopt.on.res-push, .gopt.on.res-void { background: var(--faint); }
.bfields { display: flex; gap: 8px; }
.bfields .field > span { font-size: 10px; }
.bfields .input { width: 70px; }
.bfields select.input { width: 150px; }
.bbtns { display: flex; gap: 6px; }
.bbtns .btn { flex: 1; }
.bwarn { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.note-info { border-color: var(--control); background: var(--head-bg); color: var(--ink-2); }
/* the Grading row's detail (Dan's mockup of 2026-10-27): an info strip, then a tool card with Grade and Hedge tabs */
.bpanel { display: flex; flex-direction: column; gap: 10px; }
.bstrip { display: flex; flex-wrap: wrap; align-items: center; font-size: 12px; row-gap: 6px; }
.bstrip > div { display: flex; flex-direction: column; gap: 2px; padding-right: 16px; margin-right: 16px; border-right: 1px solid var(--control); min-width: 0; }
.bstrip > div:last-child { border-right: 0; margin-right: 0; }
.bstrip .lab { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.btool { background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.btabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 10px; }
.btab { padding: 7px 12px; font-size: 12px; cursor: pointer; margin-bottom: -1px; color: var(--muted); border-bottom: 2px solid transparent; }
.btab.on { font-weight: 700; color: var(--ink); border-bottom-color: var(--yellow); }
.bgrade { display: flex; align-items: flex-end; gap: 12px; padding: 10px 12px 12px; flex-wrap: wrap; }
.bgrade .gopts { margin: 0 0 1px; font-size: 11.5px; } .bgrade .gopt { padding: 5px 16px; }
.bgrade .field > span { font-size: 10px; } .bgrade .input { width: 76px; } .bgrade select.input { width: 160px; }
.bgrade .ml { flex: 1; }
.bgrade-warn { margin: 0 12px 12px; }
.hgrid { display: grid; grid-template-columns: 250px minmax(180px, 1fr) minmax(360px, 1.6fr); padding: 10px 12px; }
.hsec { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 0 14px; border-left: 1px solid var(--line); }
.hsec:first-child { padding-left: 0; border-left: 0; } .hsec:last-child { padding-right: 0; }
.hhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 22px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.hmode { display: inline-flex; border: 1px solid var(--control); border-radius: 4px; overflow: hidden; font-size: 10.5px; font-weight: 400; white-space: nowrap; }
.hmode-opt { padding: 2px 8px; cursor: pointer; color: var(--muted); border-left: 1px solid var(--control); } .hmode-opt:first-child { border-left: 0; }
.hmode-opt.on { background: var(--sel); color: var(--ink); font-weight: 700; }
.hfields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hfields .field > span { font-size: 10px; } .hfields .input { width: 100%; box-sizing: border-box; }
.hin-hedge { border-width: 2px; border-color: var(--ink); }
.hcap { font-size: 10.5px; color: var(--muted); text-align: right; min-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hslider { width: 100%; margin: 6px 0 0; accent-color: var(--ink); }
.hends { display: flex; justify-content: space-between; font-size: 10.5px; }
.htiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.htile { background: var(--ground); border-radius: 5px; padding: 6px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.htile-l { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .htile-v { font-size: 14px; font-weight: 600; }
.hsentence { font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.hsentence b { font-weight: 600; }
.hfoot { display: flex; justify-content: flex-end; padding: 0 12px 10px; }
.ink { color: var(--ink); }


/* ------------------------------------------STATS------------------------------------------ */
/* One view since 2026-11-18 (Dan's mockup): a filter panel of tick boxes on the left, then the summary line, the tiles and the table. */
.stats { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--ground); flex: 1; }
.sv { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 10px; padding: 10px; min-height: 0; flex: 1; }
.sv .ml { margin-left: auto; }
.sv .ink2 { color: var(--ink-2); }
.sv-panel { min-height: 0; }
.sv-phead { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; flex: none; }
.sv-scroll { overflow-y: auto; min-height: 0; flex: 1; }
.sv-sec { padding: 0 12px 6px; border-top: 1px solid var(--row-line); }
.sv-sec:first-child { border-top: 0; }
.sv-shead { display: flex; align-items: center; gap: 6px; padding: 9px 0 5px; cursor: pointer; user-select: none; }
.sv-chev { color: var(--faint); font-size: 9px; width: 8px; }
.sv-cue { font: 400 11px var(--mono); color: var(--muted); }
.sv-cue.narrowed { color: var(--link); font-weight: 600; }   /* this filter leaves something out */
.sv-grid { display: grid; column-gap: 8px; grid-template-columns: minmax(0, 1fr); }
.sv-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sv-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sv-tick { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; user-select: none; min-width: 0; }
.sv-box { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--control); background: var(--card); color: var(--card); font-size: 9px; line-height: 10px; text-align: center; flex: none; box-sizing: border-box; }
.sv-tick.on .sv-box { background: var(--ink); border-color: var(--ink); }
.sv-lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-tick .tag-faint { margin-left: 0; flex: none; }
.sv-fromto { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 11px; color: var(--muted); }
.sv-fromto select { flex: 1; min-width: 0; height: 24px; }
.sv-allnone { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 4px; }
.sv-hedge { margin-bottom: 6px; }
.sv-sets { flex: none; padding: 9px 12px 12px; border-top: 1px solid var(--line); background: var(--head-bg); }
.sv-setshead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sv-saverow { display: flex; gap: 6px; margin: 4px 0 6px; }
.sv-saverow .input { flex: 1; min-width: 0; }
.sv-set { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.sv-set .link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sv-setnote { font: 10px var(--mono); color: var(--faint); flex: none; }
.sv-x { color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.sv-x:hover { color: var(--red-text); }
.sv-main { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.sv-top { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 9px 14px; flex: none; }
.sv-title { font-size: 16px; font-weight: 600; }
.sv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; flex: none; }
.tile6 { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--card); min-width: 0; }
.tile6.net { background: var(--green-tint); }
.tile6.net.down { background: var(--red-tint); }
.tile6 .big { font-size: 18px; font-weight: 600; margin-top: 2px; white-space: nowrap; }
.sv-tnote { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-open { color: var(--link); }
.sv-table { flex: 1; }
.sv-thead { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.sv-table .tbl-wrap { flex: 1; }
.sv-table .tbl { width: 100%; }
.sv-table .tbl td:first-child { min-width: 170px; }
.sv-th { cursor: pointer; user-select: none; }
.sv-th.on { color: var(--ink); }
.sv-table .tbl tbody tr:not(.total):hover td { background: var(--sel); }
.sv-before td { opacity: .7; }   /* a stretch before the site: figures only, no bets behind them */
.sv-beforenote { font-size: 10px; color: var(--faint); margin-left: 6px; font-weight: 400; }
.sv.stale .sv-tiles, .sv.stale .sv-table .tbl, .sv.stale .sv-top .muted, .psv.stale .sv-tiles, .psv.stale .psv-card { opacity: .55; }   /* the ticks changed; the figures behind them are on their way */


/* ------------------------------------------HOME------------------------------------------ */
.xs { font-size: 10px; } .norm { font-weight: 400; } .min0 { min-width: 0; flex: 1; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.panes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; padding: 4px; background: var(--ground); min-height: 0; flex: 1; overflow: hidden; }
.pane { background: var(--card); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pane-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; }
.pane-body { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: auto; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 400; color: var(--muted); }
.hdot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.health.ok .hdot { background: var(--green); } .health.busy .hdot { background: var(--blue); } .health.off .hdot { background: var(--red); }
.health.off { color: var(--red-text); }
.pane-body.cards { padding: 10px 16px; gap: 8px; }
.pane-empty { padding: 12px 16px; font-size: 11.5px; color: var(--muted); text-align: left; }
.hsplit td.pane-empty, .hsplit td.pane-empty:last-child { padding: 10px 16px; text-align: left; }
.hcard { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.hcard-head { padding: 9px 11px; cursor: pointer; font-size: 12px; }
.hcard-line { display: flex; justify-content: space-between; align-items: baseline; }
.chev { color: var(--faint); font-size: 10px; margin-right: 4px; }
.mt6 { margin-top: 6px; }
.bar { height: 5px; background: var(--row-line); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); }
.hcard-games { border-top: 1px solid var(--line); background: var(--head-bg); }
.hgame { display: flex; align-items: center; gap: 8px; padding: 4px 11px; border-bottom: 1px solid var(--row-line); font-size: 11.5px; }
.hgame .ellip { flex: 1; }
.hcells { display: flex; gap: 2px; }
.pane-scroll { overflow-y: auto; overflow-x: hidden; min-height: 0; }
.halgo { table-layout: fixed; }
.halgo th { cursor: pointer; }
.w44 { width: 44px; } .w72 { width: 72px; } .w76 { width: 76px; } .w112 { width: 112px; }
.halgo .books { font-size: 10.5px; color: var(--ink-2); letter-spacing: -.02em; }
.ptiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); flex: none; }
.ptile { background: var(--card); padding: 10px 16px; }
.pbig { font: 600 20px var(--mono); }
.sub-head { padding: 8px 16px 3px; font-size: 11px; color: var(--muted); font-weight: 600; background: var(--head-bg); border-bottom: 1px solid var(--line); display: flex; flex: none; }
.sub-head.bt { border-top: 1px solid var(--line); }
.ml-auto { margin-left: auto; }
.hsplit { table-layout: fixed; flex: none; }
.hsplit td:first-child { padding-left: 16px; }
.hsplit td:last-child { padding-right: 16px; text-align: right; }
.btn-run { display: inline-block; width: 100%; box-sizing: border-box; text-align: center; font-size: 11px; font-weight: 600; padding: 4px 0; }
.run-line { padding: 6px 16px; font-size: 11.5px; background: var(--green-tint); border-bottom: 1px solid var(--line); }
.run-line.neg { background: var(--red-tint); }
.topgs { display: flex; flex-direction: column; overflow-y: auto; min-height: 0; flex: 1; }
.topg { display: flex; align-items: center; gap: 8px; padding: 3px 16px 3px 13px; border-bottom: 1px solid var(--row-line); border-left: 3px solid var(--faint); font-size: 11.5px; }
.topg.st-live { border-left-color: var(--yellow); } .topg.st-up { border-left-color: var(--blue); } .topg.st-nofeed { border-left-color: var(--red); } .topg.st-final { border-left-color: var(--green); }
.topg .note { display: inline-flex; align-items: center; gap: 4px; }
.live-sq { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--yellow); }
.sheets-foot { flex: none; border-top: 1px solid var(--line); background: var(--head-bg); padding: 10px 16px; }
.sheets-btn { padding: 9px 14px; border-radius: 5px; background: var(--ink); color: #fff; font-weight: 600; display: flex; justify-content: space-between; align-items: center; text-decoration: none; font-size: 13px; }
.sheets-btn .sm { color: #b9bec7; font-weight: 400; }


/* ------------------------------------------LOGS------------------------------------------ */
.logs { display: flex; flex-direction: column; min-height: 0; flex: 1; background: var(--card); }
.log-head { padding: 10px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; flex: none; font-size: 11px; }
.log-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-seg { display: inline-flex; width: 230px; }
.log-list { overflow: auto; min-height: 0; flex: 1; padding: 4px 0; }
.log-row { display: flex; gap: 10px; padding: 3px 18px; font-size: 11.5px; border-bottom: 1px solid var(--row-line); align-items: baseline; }
.log-row .mono { flex: none; }
.log-kind { flex: none; width: 70px; font: 600 9.5px var(--mono); color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.lvl-row-warn, .lvl-row-error { background: var(--yellow-tint-2); }


/* ------------------------------------------SYSTEM------------------------------------------ */
.system { display: flex; flex-direction: column; min-height: 0; overflow: auto; flex: 1; }
.system > * { flex: none; }   /* the cards keep their natural height and the page scrolls (Caden's squished Settings on a small monitor, 2026-10-07) */
.hist { background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.hist-intro { padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.hist .tbl th:first-child, .hist .tbl td:first-child { padding-left: 18px; }
.wrow { cursor: pointer; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-2); }
.dot-sq { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.dot-sq.cur { background: var(--green); } .dot-sq.closed { background: var(--faint); }
.wlinks { display: inline-flex; gap: 6px; }
.exports, .settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 18px; align-content: start; }
.ecard { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ecard-title { font-size: 13px; font-weight: 600; }
/* the Exports page of 2026-10-21 (Dan's design): the four small exports in a column on the left, the Analysis card with its builder on the right */
.exports.ex2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); align-items: start; }
.ex-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.an-card { min-width: 0; }
.an-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-top: 2px; }
.an-tab { font-size: 12px; padding: 0 0 6px; margin-bottom: -1px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.an-tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.an-steps { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.an-step { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--head-bg); padding: 12px; min-width: 0; }
.an-games { flex: 6 1 400px; } .an-books { flex: 0 0 auto; } .an-data { flex: 5 1 280px; }
.an-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.an-num { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 11px var(--sans); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chips.wrap { flex-wrap: wrap; gap: 5px; }
.an-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.an-line .ml { margin-left: auto; }
.an-list { border: 1px solid var(--control); border-radius: 4px; background: var(--card); max-height: 260px; overflow: auto; }
.an-list.short { max-height: 200px; }
.an-row { display: grid; grid-template-columns: 16px 118px minmax(0, 1fr) 52px 74px; gap: 8px; align-items: center; padding: 0 8px; height: 28px; font-size: 11.5px; border-bottom: 1px solid var(--row-line); cursor: pointer; }
.an-row:hover { background: var(--sel); } .an-row.ticked { background: var(--sel); } .an-row.added { background: var(--head-bg); }
.an-row input { margin: 0; width: 13px; height: 13px; accent-color: var(--ink); }
.an-batch { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; gap: 8px; align-items: center; padding: 0 6px 0 8px; height: 30px; font-size: 11.5px; border-bottom: 1px solid var(--row-line); }
.an-selected { border-top: 1px dashed var(--control); padding-top: 10px; }
.an-bookchips { display: flex; flex-direction: column; gap: 4px; }
.an-bookchips .chip { justify-content: flex-start; }
.an-what { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--control); border-radius: 4px; overflow: hidden; background: var(--card); }
.an-whatopt { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; font-size: 11.5px; cursor: pointer; border-left: 1px solid var(--line); }
.an-whatopt:first-child { border-left: 0; } .an-whatopt:hover { background: var(--sel); }
.an-whatopt.on { background: var(--ink); color: #fff; } .an-whatopt.on .sm { opacity: 0.8; }
.an-which { display: flex; flex-direction: column; border: 1px solid var(--control); border-radius: 4px; background: var(--card); overflow: hidden; }
.an-opt { display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-bottom: 1px solid var(--row-line); cursor: pointer; font-size: 11.5px; }
.an-opt:last-child { border-bottom: 0; } .an-opt:hover { background: var(--sel); } .an-opt.on { background: var(--sel); }
.an-ind { width: 14px; height: 14px; box-sizing: border-box; flex: none; border: 1.5px solid var(--faint-2); background: var(--card); }
.an-ind.sq { border-radius: 3px; } .an-ind.rd { border-radius: 50%; }
.an-ind.sq.on { border: 4px solid var(--ink); } .an-ind.rd.on { border: 4.5px solid var(--ink); }
.an-optlabel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.an-n { width: 46px; height: 22px; padding: 0 5px; }
.an-foot { display: flex; align-items: center; gap: 14px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
.an-foot .btn { padding: 6px 14px; font-size: 12px; }
.ebtns { display: flex; gap: 6px; font-size: 12px; align-items: center; }
.ebtns .btn { padding: 6px 14px; font-size: 12px; }
.prof-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; }
.prof-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--row-line); }
.acct-picks { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; }
.pick { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.scard .tbl th:first-child, .scard .tbl td:first-child { padding-left: 12px; }
.scard.pad12 { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.sgrid { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; column-gap: 10px; align-items: center; }
.sgrid.two { grid-template-columns: 1fr auto 1fr auto; column-gap: 10px; }
.sgrid.two > :nth-child(4n+3) { padding-left: 18px; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 3px; background: var(--row-line); color: var(--ink-2); }
.tog-wrap { display: inline-flex; align-items: center; gap: 6px; }
.clock-seg { display: inline-flex; width: 260px; }
.clock-seg .seg-chip { height: 22px; }
.set-in.saved { border-color: var(--green); background: var(--green-tint); }


/* ------------------------------------------PLAIN PAGES (login, 403, password)------------------------------------------ */
body.plain { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.plain-card { width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.plain-title { font-size: 16px; font-weight: 600; }
.plain-text { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.plain-brand { font-size: 11px; color: var(--muted); letter-spacing: .04em; font-weight: 600; }
.plain-logo { width: 120px; height: 120px; object-fit: contain; align-self: center; margin: 4px 0 2px; }
.plain-card .btn-primary { padding: 8px 14px; font-size: 12px; }
.plain-error { font-size: 11.5px; color: var(--red-text); }
.plain-ok { font-size: 11.5px; color: var(--green-text); }


/* ------------------------------------------PHONES AND NARROW WINDOWS------------------------------------------ */
/* the rail becomes a top bar, every two-column layout stacks, wide tables scroll sideways (2026-10-07; the Bet sheet, Scraping and Algorithm first) */

/* Settings (Dan's mockup of 2026-10-12): a category column, one category's cards, drafts marked with a dot, a Save bar */
.system > .settings-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; }
.setnav { border-right: 1px solid var(--line); background: var(--card); padding: 10px 0; display: flex; flex-direction: column; overflow: auto; }
.setnav-item { cursor: pointer; padding: 9px 16px 9px 13px; border-left: 3px solid transparent; border-bottom: 1px solid var(--row-line); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.setnav-item.on { border-left-color: var(--ink); background: var(--head-bg); }
.setnav-foot { margin-top: auto; padding: 10px 16px; font-size: 11px; color: var(--muted); line-height: 1.45; }
.setbody { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.setscroll { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; }
.setbar { display: flex; align-items: center; gap: 10px; padding: 9px 18px; background: var(--card); border-top: 1px solid var(--line); font-size: 12px; flex: none; }
.setbar .btn-xs { padding: 4px 12px; font-size: 11px; }
.dirty-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); margin-left: 6px; vertical-align: middle; }
.dirty-dot.big { width: 7px; height: 7px; margin-left: 0; }
.setcard { max-width: 560px; }
.setcard.wide { max-width: 720px; }
.setcol { max-width: 560px; }
.sgrid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sgrid2 .setcard { max-width: none; }
.setrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--row-line); }
.setrow-l { min-width: 0; }
.setrow-label { font-size: 12.5px; display: flex; align-items: center; }
.setrow-hint { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-ctl { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.set-ctl .input.num { text-align: right; }
.set-unit { width: 34px; font: 11px var(--mono); color: var(--muted); }
.set-pre { font-size: 12px; color: var(--muted); }
.setrow.dirty .input, .book-row.dirty .input { border-color: var(--ink); }
.seg-inline { display: inline-flex; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }   /* the Laddered markets row (2026-10-27) */
.pick-chips .chip.dark { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
/* the market dropdowns on Settings (Dan, 2026-11-09): Laddered, Paper and Excluded markets as a summary button and a panel of tick boxes */
.pick-wrap { position: relative; display: inline-block; max-width: 100%; }
.pick-drop { display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 260px; padding: 0 8px; border: 1px solid var(--control); border-radius: 5px; background: var(--card); font-size: 11px; cursor: pointer; box-sizing: border-box; }
.pick-drop.open { border-color: var(--ink-2); }
.pick-drop .pick-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-drop .pick-caret { color: var(--muted); font-size: 10px; }
.pick-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; max-height: min(380px, 70vh); overflow: auto; overscroll-behavior: contain; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14); text-align: left; }
.pick-panel .pick { padding: 3px 0; font-size: 11px; cursor: pointer; white-space: nowrap; }
.alert-text { white-space: pre-wrap; line-height: 1.5; padding: 4px 0 2px; }   /* the pop-up's text keeps its line breaks (2026-10-27) */
.seg-inline .seg-chip { flex: none; padding: 0 10px; }
.people-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px 50px 120px 40px; gap: 8px; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--row-line); font-size: 12px; }
.people-head, .book-head { font-size: 11px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.pill.pill-ink { background: var(--ink); color: #fff; }
.book-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 72px 66px 60px 110px; gap: 8px; align-items: center; padding: 5px 14px; border-bottom: 1px solid var(--row-line); font-size: 12px; }   /* Scraped, Evaluated, Bettable (2026-11-02), Pooled (2026-11-06), Speed */
.book-row.muted .b500 { color: var(--muted); }

.prof-grid { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px 72px; gap: 8px; align-items: center; }
.prof-grid .input { width: 100%; box-sizing: border-box; text-align: right; }
.prof-head { font-size: 11px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 2px 0; }
.prof-sum { border-top: 1px solid var(--line); padding-top: 4px; }

/* Narrow windows, 861 to 1100 px (the visual hunt of 2026-10-28, Dan's rulings of 2026-11-02): the computer view holds
   together by stacking and wrapping. Nothing here applies at 1101 px and up; the phone block below takes over at 860. */
@media (max-width: 1100px) and (min-width: 861px) {
  .panes { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .tbl-wrap { overflow-x: auto; }
  .tbl-sheet { min-width: 1160px; }   /* the fixed columns take 840 px; Game and Bet keep 160 each and the card scrolls sideways */
  .tbl-sheet.sheet-adv { min-width: 1270px; }
  .tbl-sheet td.nowrap, .tbl-sheet td.nowrap > div { white-space: normal; overflow: visible; text-overflow: clip; }
  .grading { flex-direction: column; }
  .grading > .gcard { flex: none; max-height: 28vh; }
  .grading > .bcard { flex: 1; }
  .hgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hsec:last-child { grid-column: 1 / -1; border-left: 0; padding: 10px 0 0; border-top: 1px solid var(--line); margin-top: 10px; }
  .algo, .algo.gww { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .algo-left { max-height: 40vh; }
  .algo-rail { flex-direction: row; padding: 0; }
  .rail-open { flex-direction: row; width: auto; align-self: stretch; padding: 6px 12px; margin: 6px; }
  .rail-open .vtxt { writing-mode: horizontal-tb; transform: none; }
  .algo-head { grid-template-columns: 1fr; }
  .stat-strip { flex-wrap: wrap; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .clv-key { white-space: normal; flex-wrap: wrap; }
}

/* The phone layout (windows up to 860 px) lives in assets/css/phone.css, loaded only at those widths (2026-11-04). */

/* the Pinnacle schedule on Settings (2026-10-15): a chip per UTC time with the viewer's clock beside it */
.time-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 320px; }
.time-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 8px; border: 1px solid var(--control); border-radius: 3px; background: var(--card); font-size: 12px; }
.time-chip .faint { font-size: 10.5px; }
.time-chip .x { cursor: pointer; color: var(--muted); font-size: 10px; }
.time-chip .x:hover { color: var(--red); }
.time-chip .x.faint { cursor: default; }

/* the FanDuel market table on Settings (2026-10-23): a block row, two numbers per compared market */
.setrow.setrow-block { grid-template-columns: minmax(0, 1fr); }
.fd-table { display: grid; gap: 4px; padding-top: 4px; }
.fd-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 72px; gap: 6px; align-items: center; }
.fd-row .input { width: 100%; }
.fd-row.fd-head { font-size: 10.5px; color: var(--muted); text-align: right; }
.fd-mkt { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-note { padding-top: 2px; }
.time-add { display: inline-flex; align-items: center; gap: 4px; }
.time-add .time-in { width: 92px; padding: 2px 4px; }

/* ------------------------------------------SCRAPER HEALTH (Dan's mockup, 2026-11-16)------------------------------------------
   The tile's top bar is the book's market health, split green / yellow / red; the tile opens the health pop-up, and the weekly
   check's card sits in the tile row while it is unfinished. Sizes and colours are the site's own, so every theme carries them. */
:root { --yellow-text: oklch(0.56 0.13 85); }
:root[data-theme="dark"] { --yellow-text: oklch(0.84 0.15 90); }
.h-fine { color: var(--green-text); } .h-short { color: var(--yellow-text); } .h-miss { color: var(--red-text); }
.hbar { display: flex; overflow: hidden; background: var(--green); }
.hbar > i { display: block; flex: none; height: 100%; }
.hb-fine { background: var(--green); } .hb-short { background: var(--yellow); } .hbar > .hb-miss { flex: 1; background: var(--red); }
.tile-health { border-top: 1px solid var(--line); padding-top: 0; overflow: hidden; cursor: pointer; }
.tile-health:hover { border-color: var(--ink); }
.tile-bar { height: 4px; margin: 0 -10px 6px; }
.hc-card { grid-column: span 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; border: 1px solid var(--req-border); border-radius: 8px; background: var(--req-bg); padding: 7px 12px; }
.hc-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.hc-tag { font: 600 9.5px var(--mono); background: var(--red); color: #fff; border-radius: 3px; padding: 1px 6px; }
.lock-note { text-align: center; }
.modal-health { width: min(1120px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; gap: 0; overflow: hidden; }
.modal-review { width: min(1000px, calc(100% - 24px)); }
.hm-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; min-width: 0; }
.hm-head > * { flex: none; } .hm-head > .ellip { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-barrow { display: flex; align-items: center; gap: 12px; padding: 10px 18px 12px; border-bottom: 1px solid var(--line); }
.hm-bar { flex: 1; height: 8px; border-radius: 4px; }
.hm-body { flex: 1; min-height: 0; overflow: auto; padding: 0 18px 14px; }
.hm-sec { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.hm-sec .seg { margin-left: auto; }
.hm-league { font-size: 13px; font-weight: 600; }
.hm-tbl { table-layout: fixed; }
.hm-tbl td { height: 30px; }
.modal-review .hm-tbl td { height: 34px; padding-top: 2px; padding-bottom: 2px; }   /* one row height with or without the Keep / Use pair */
.modal-health .seg > .on { color: var(--card); }   /* readable in the dark theme too, where the ink is light */
.hm-tbl th.hm-star, .hm-tbl td.hm-star { width: 24px; padding-left: 4px; padding-right: 0; text-align: center; font-size: 13px; line-height: 1; }
.hm-tbl tr.hm-off td { color: var(--faint); opacity: .75; }
.hm-tbl tr.hm-off td.hm-star { color: var(--green-text); opacity: 1; }
.hm-missed { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hm-chips { display: flex; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.hm-missed.wrap .hm-chips { flex-wrap: wrap; }
.hm-chip { flex: none; font-size: 11px; white-space: nowrap; padding: 1px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--head-bg); color: var(--ink); }
a.hm-chip:hover { border-color: var(--ink); text-decoration: underline; }
.hm-more { flex: none; white-space: nowrap; text-decoration: underline; }
.hc-sub { padding: 4px 18px 0; }
.hc-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.hc-tabs .chip { gap: 5px; height: 24px; }
.hc-tabs .chip.hc-done:not(.on) { color: var(--muted); }
.hc-tick { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border-radius: 50%; background: var(--green); color: #fff; font-size: 9px; font-style: normal; }
.hc-seg { display: inline-flex; vertical-align: middle; }
.hc-seg > * { width: 100px; padding: 3px 6px; text-align: center; white-space: nowrap; }
.hc-seg.ro { pointer-events: none; opacity: .7; }
.hc-mancell { white-space: nowrap; }
.hc-man { width: 52px; margin-right: 3px; } .hc-man.on { border-color: var(--ink); }
.hc-mancell .h-fine { margin-left: 6px; }
.hc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--head-bg); }
.hc-foot-r { display: flex; align-items: center; gap: 10px; }
.hc-foot .btn { padding: 7px 14px; font-size: 12px; }
.modal-health > .state-error, .modal-health > .state-empty { padding: 6px 18px; }


/* ------------------------------------------CHAT (2026-11-17, Dan's mockup; assets/js/chat.js)------------------------------------------
   The Open chat and the Locked chat. The Locked chat's list sits on the rail colour with the emblem tiled over it; everything
   else is the site's tokens, so the themes carry over. */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.ch-tabs { flex: none; flex-direction: row; gap: 18px; align-items: flex-end; padding: 10px 14px 0; font-size: 12.5px; }
.ch-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); gap: 4px; }
.ch-card, .ch-logcard { min-height: 0; }
.ch-filter { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 12px; background: var(--head-bg); border-bottom: 1px solid var(--line); }
.ch-show { font-size: 11px; color: var(--muted); }
.ch-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ch-search { display: flex; align-items: center; gap: 4px; }
.ch-search .input { width: 180px; padding: 4px 8px; }
.ch-count { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ch-step { cursor: pointer; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; background: var(--card); color: var(--ink); }
.ch-step:hover { border-color: var(--ink); }
.ch-filter .btn { padding: 4px 12px; }
.ch-list { flex: 1; min-height: 0; overflow: hidden auto; padding: 6px 0; background: var(--card); }
/* The Locked chat's ground (Dan's design "2b", 2026-11-20; the dark rail colour with the emblem tiled over it until then): paper tone,
   a fine diagonal hatch, an ink rule down the left edge, and one large faint emblem in the bottom-right corner that stays put while
   the list scrolls. Two variables colour it; the ink is the theme's rail colour, so each theme gets its own tint. A client's
   Messages page wears the same ground. */
.ch-is-locked .ch-list { --locked-ink: var(--rail); --locked-ground: color-mix(in srgb, var(--locked-ink) 7%, #f3f4ee); position: relative; isolation: isolate;
  background-color: var(--locked-ground); background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--locked-ink) 9%, transparent) 0 1px, transparent 1px 9px);
  box-shadow: inset 4px 0 0 var(--locked-ink); }
:root[data-theme="dark"] .ch-is-locked .ch-list { --locked-ink: #e6e8ec; --locked-ground: #15171c; }
/* the emblem: a box that takes no room (its own height is taken back by the margin under it) and sticks to the bottom-right of the
   list's window; the cut-out image is a mask, so it is painted in the ink colour */
.ch-is-locked .ch-list::before { content: ''; display: block; position: sticky; top: calc(100% - 216px); width: 230px; height: 256px; margin: 0 -30px -256px auto; z-index: -1; pointer-events: none;
  background-color: var(--locked-ink); opacity: .14; -webkit-mask: url(../chat-emblem-mask.png) center / contain no-repeat; mask: url(../chat-emblem-mask.png) center / contain no-repeat; }
.ch-empty { text-align: center; padding: 30px 12px; }
.ch-is-locked .ch-empty { color: var(--muted); }

.ch-row { display: flex; padding: 6px 14px; }
.ch-row.mine { justify-content: flex-end; }
.ch-row.flash .ch-box { box-shadow: 0 0 0 3px var(--yellow-tint); }
.ch-box { position: relative; width: 86%; background: var(--card); border: 1px solid var(--line); border-radius: 8px; transition: box-shadow .3s; }
.ch-row.mine .ch-box { border-color: var(--ink); }
.ch-is-locked .ch-box { border-color: color-mix(in srgb, var(--locked-ink) 22%, var(--locked-ground)); }   /* the boxes stay white on the paper; theirs get a tinted edge and bar */
.ch-is-locked .ch-row:not(.mine) .ch-bar { background: color-mix(in srgb, var(--locked-ink) 6%, var(--locked-ground)); }
.ch-is-locked .ch-row.mine .ch-box { border-color: var(--ink); }
.ch-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 11px; background: var(--band); color: var(--ink); border-radius: 7px 7px 0 0; }
.ch-row.mine .ch-bar { background: var(--ink); color: var(--card); }
.ch-name { font-weight: 600; padding-left: 4px; }
.ch-ed, .ch-date { color: var(--muted); }
.ch-row.mine .ch-ed, .ch-row.mine .ch-date { color: inherit; opacity: .65; }
.ch-when { margin-left: auto; display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.ch-dots { cursor: pointer; width: 22px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-weight: 700; letter-spacing: .1em; user-select: none; }
.ch-dots:hover { background: rgba(127,127,127,.18); }
.ch-dots.on { background: var(--card); color: var(--ink); }
.ch-row.mine .ch-dots.on { background: var(--card); color: var(--ink); }
.ch-menu { position: absolute; right: 6px; top: 26px; z-index: 4; min-width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.14); padding: 4px 0; font-size: 12px; color: var(--ink); }
.ch-mi { padding: 5px 12px; cursor: pointer; }
.ch-mi:hover { background: var(--sel); }
.ch-mi-red { color: var(--red-text); }
.ch-mi-red:hover { background: var(--red-tint); }
.ch-mfoot { margin-top: 4px; padding: 6px 12px 3px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.ch-body { padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.ch-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-body mark, .ch-chip mark { background: var(--yellow-tint); color: inherit; }
.ch-files { display: flex; flex-direction: column; gap: 4px; }
.ch-text + .ch-files, .ch-panel + .ch-files, .ch-edit + .ch-files { margin-top: 6px; }
.ch-file { display: flex; align-items: center; gap: 10px; padding: 5px 8px; background: var(--head-bg); border: 1px solid var(--line); border-radius: 5px; min-width: 0; }
.ch-fname { min-width: 0; overflow-wrap: anywhere; }
.ch-fsize { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ch-fact { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.ch-bar-track { display: inline-block; width: 110px; height: 5px; border-radius: 3px; background: var(--row-line); overflow: hidden; }
.ch-bar-track > i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.ch-pct { font-size: 11px; min-width: 34px; text-align: right; }
.ch-ok { color: var(--green-text); font-weight: 600; font-size: 10.5px; }
.ch-up { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.ch-up .ch-bar-track { flex: 1; width: auto; }
.ch-mini { display: inline-flex; align-items: center; cursor: pointer; border-radius: 5px; font: 600 10.5px var(--sans); padding: 1px 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); white-space: nowrap; }
.ch-mini:hover { border-color: var(--ink); }
.ch-mini.ch-ok { color: var(--green-text); }
.ch-mini-ink { background: var(--ink); border-color: var(--ink); color: var(--card); }
.ch-pw-title { font-weight: 600; }
.ch-pw-note { color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.ch-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; margin-top: 8px; padding: 7px 10px; background: var(--head-bg); border: 1px solid var(--line); border-radius: 5px; }
.ch-lab { font-size: 11px; color: var(--muted); }
.ch-val { overflow-wrap: anywhere; }
.ch-dotted { letter-spacing: .04em; }
.ch-del { margin: 0 10px 8px; padding: 6px 8px; background: var(--req-bg); border: 1px solid var(--req-border); border-radius: 5px; font-size: 11px; }
.ch-edit textarea { width: 100%; resize: vertical; border-color: var(--ink); font: 12px/1.45 var(--sans); }
.ch-edit-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ch-err { color: var(--red-text); font-size: 11px; }

.ch-comp { flex: none; padding: 8px 12px 10px; background: var(--head-bg); border-top: 1px solid var(--line); }
.ch-compbox { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.ch-compbox:focus-within { border-color: var(--ink); }
.ch-pw { margin: 8px 8px 0; padding: 8px; background: var(--head-bg); border: 1px solid var(--line); border-radius: 5px; }
.ch-pw-head { display: flex; align-items: center; gap: 4px; font-size: 11px; margin-bottom: 6px; }
.ch-pw-head .ch-x { margin-left: auto; }
.ch-pw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.ch-pw-grid .input { padding: 5px 8px; font-size: 11.5px; border-radius: 4px; min-width: 0; }
.ch-x { cursor: pointer; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; color: var(--muted); font-size: 13px; }
.ch-x:hover { background: var(--row-line); color: var(--ink); }
.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 8px 0; }
.ch-chip { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px 2px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--head-bg); font-size: 11px; min-width: 0; }
.ch-chip > :first-child { overflow-wrap: anywhere; }
#ch-ta { border: 0; outline: 0; background: transparent; color: var(--ink); padding: 8px 10px 4px; font: 12px/1.4 var(--sans); resize: none; width: 100%; }
.ch-foot { display: flex; align-items: center; gap: 2px; padding: 2px 6px 6px; }
.ch-ghost { cursor: pointer; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; color: var(--ink-2); }
.ch-ghost:hover { background: var(--row-line); }
.ch-ghost.on { background: var(--ink); color: var(--card); }
.ch-foot .ch-err { margin-left: 8px; }
.ch-send { margin-left: auto; height: 26px; padding: 0 14px; font-size: 12px; }

.ch-log { flex: 1; min-height: 0; overflow: auto; }
.ch-ll { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 11.5px; line-height: 1.5; cursor: pointer; }
.ch-ll:hover { background: var(--sel); }
.ch-ll.inert { cursor: default; }
.ch-ll.inert:hover { background: none; }
.ch-ll-what { overflow-wrap: anywhere; }

.ch-gate { flex: 1; min-height: 0; align-items: center; justify-content: center; }
.ch-gate-col { width: 300px; max-width: calc(100% - 24px); display: flex; flex-direction: column; gap: 10px; }
.ch-gate-col.ch-setup { width: 340px; }
.ch-gate-title { font-size: 16px; font-weight: 600; }
.ch-gate-row { display: flex; gap: 8px; }
.ch-gate-row .input { flex: 1; min-width: 0; }
.ch-gate .btn { padding: 6px 14px; font-size: 12px; }
.ch-secret { -webkit-text-security: disc; letter-spacing: .08em; }
.ch-secret::placeholder { letter-spacing: 0; }
.ch-warn { padding: 6px 8px; background: var(--req-bg); border: 1px solid var(--req-border); border-radius: 5px; font-size: 11px; }
.ch-gate-err { color: var(--red-text); font-size: 12px; font-weight: 600; }
.ch-gate-wait { color: var(--muted); }

.modal.ch-dialog { width: 420px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); }
.modal.ch-history { width: 460px; }
.ch-vers { display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 0; }
.ch-ver { border: 1px solid var(--line); border-radius: 5px; flex: none; }
.ch-ver-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 5px 10px; font-size: 11px; background: var(--head-bg); border-bottom: 1px solid var(--line); border-radius: 5px 5px 0 0; }
.ch-ver-when { margin-left: auto; color: var(--muted); white-space: nowrap; }
.ch-ver-body { padding: 8px 10px; line-height: 1.45; }

/* ------------------------------------------THE RECORD STEP (Dan's client mockup, 2026-11-20)------------------------------------------ */
/* NEW (brief step 1, the Record step). One block of rules, added after portal.css and phone.css.
   .prompt.ask replaces the old "Limited? No / max $ [ ] Save" prompt. It appears only when the amount
   placed is under the suggested amount; otherwise Record saves at once. Everything else on the row
   uses the classes that already exist (.row-prompt, .btn, .btn-xs, .link, .faint, .mono). */
.prompt.ask { gap: 6px; align-items: center; flex-wrap: nowrap; }
.ask-q { font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; margin-right: 2px; }
.ask-btns { display: contents; }
.ask-back { font-size: 11px; margin-left: 2px; }
.tbl-sheet td.placed-lock { font-family: var(--mono); font-weight: 600; }

@media (max-width: 860px) {
  .pc-prompt .prompt.ask { gap: 10px; flex-wrap: nowrap; }
  .pc-prompt .ask-q { font-size: 15px; flex: 1; }
  .pc-prompt .prompt.ask .btn-xs { height: 42px; min-width: 76px; font-size: 15px; border-radius: 8px; padding: 0 14px; }
  .pc-prompt .ask-back { font-size: 12.5px; }
  .pc-placed { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
  .pc-placed .mono { font-size: 15px; color: var(--ink); font-weight: 600; }
}

/* ------------------------------------------THE CLIENT SIDE, STEP 2 ON (Dan's client mockup, 2026-11-20)------------------------------------------ */
/* NEW (brief step 2, sign-up from an invite link; step 3, accepting the terms). Added after portal.css.
   Everything else on these pages is the existing plain-page kit: .plain-card, .plain-brand, .plain-title,
   .plain-text, .field, .form-row, .input, .btn-primary, .plain-error, .plain-ok. */
.plain-step { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.plain-card.plain-wide { width: 680px; }
.plain-card.plain-form { width: 560px; }
.plain-form .plain-logo { width: 84px; height: 84px; }
.plain-card .plain-brand { text-align: center; }
.field .plain-error { margin-top: -1px; }
.field.bad > .input { border-color: var(--red); }
.plain-saved { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.plain-saved::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.terms-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.terms-meta .ml { margin-left: auto; display: flex; gap: 6px; }
.terms-box { border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 4px 18px 14px; max-height: 56vh; overflow-y: auto; font-size: 12.5px; line-height: 1.6; color: var(--ink); }
.terms-box h2 { font-size: 13px; font-weight: 600; margin: 16px 0 4px; }
.terms-box p { margin: 0 0 8px; }
.terms-box .faint { font-family: var(--mono); font-size: 11px; }
.agree { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; line-height: 1.45; cursor: pointer; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--ground); }
.agree input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }

@media (max-width: 860px) {
  .plain-card.plain-wide, .plain-card.plain-form { width: calc(100vw - 24px); max-width: none; }
  .plain-form .form-row { grid-template-columns: 1fr; }
  .plain-form .form-row.names { grid-template-columns: 1fr 1fr; }
  .terms-box { max-height: 50vh; padding: 2px 14px 12px; font-size: 14px; }
  .terms-box h2 { font-size: 14.5px; }
  .agree { font-size: 14px; }
  .agree input { width: 20px; height: 20px; }
  .plain-card .field > .input, .plain-card select.input { font-size: 15px; min-height: 40px; }
  .terms-meta .ml { width: 100%; margin-left: 0; }
  .terms-meta .ml .btn { flex: 1; min-height: 36px; font-size: 12.5px; }
}

/* NEW: the Account page (Details, Engagement). Cards are the Exports page's .card.ecard. */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 12.5px; align-items: baseline; }
.acct-tiles { padding: 14px 18px 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acct-tiles .big { font-size: 22px; }
.ebtns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .kv { font-size: 14px; }
  .acct-tiles { padding: 10px 10px 0; grid-template-columns: 1fr; gap: 8px; }
  .acct-tiles .big { font-size: 18px; }
  .acct-tiles + .exports { padding-top: 10px; }
}

/* NEW: Help in the rail foot, under System */
.rail-help { justify-content: flex-start; gap: 8px; margin-top: 4px; }
.rail-help .ring { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 9px; font-weight: 700; line-height: 1; flex: none; }
.state-empty { font-size: 12px; }

/* NEW: Home tiles; the name in the rail head opens Account */
.home-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile6.todo { background: var(--yellow-tint); border-color: var(--req-border-2); }
.tile6.todo .big { font-size: 18px; }
.rail-me { color: inherit; text-decoration: underline; text-decoration-color: var(--rail-line); text-underline-offset: 2px; }
.rail-me:hover, .rail-me.active { color: var(--rail-fg); text-decoration-color: var(--rail-fg); }
.phead-sub .rail-me { color: inherit; }
@media (max-width: 860px) {
  .home-tiles { grid-template-columns: 1fr 1fr; }
  .home-tiles .tile6.todo { grid-column: 1 / -1; }
}

/* NEW: message list on Home */
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 10px; border: 1px solid var(--row-line); border-radius: 6px; background: var(--ground); font-size: 12.5px; line-height: 1.45; }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 860px) { .msg { font-size: 14px; } }


/* NEW: Notifications settings. .toggle is the site's own switch (portal.css). */
.setnav-item { display: block; text-decoration: none; color: inherit; }
.setrow .toggle { cursor: pointer; }

/* Home: a card's button row sits at the bottom of the card, not under the last line */
.system[data-tab="home"] .ecard > .ebtns:last-child { margin-top: auto; padding-top: 6px; }

/* NEW: Home. Profit left, bill right; today's games by slate; quick actions; messages. */
.home2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: minmax(max-content, auto); grid-auto-rows: auto; gap: 12px; padding: 14px 18px; align-content: start; }
.h-profit { grid-column: 1; grid-row: 1; }
.h-bill { grid-column: 2; grid-row: 1; }
.h-today { grid-column: 1; grid-row: 2 / span 2; }
.h-msgs { grid-column: 2; grid-row: 2 / span 2; }
.h-msgs .msg-list { flex: 1; min-height: 0; overflow-y: auto; }
.h-big { font-size: 40px; font-weight: 600; line-height: 1; margin-top: 2px; }
.h-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 0 2px; border-top: 1px solid var(--row-line); margin-top: 4px; }
.h-mini .mono { font-size: 14px; }
.h-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.h-actions .btn { justify-content: flex-start; padding: 7px 12px; font-size: 12px; }
.h-count { margin-left: auto; font-family: var(--mono); font-weight: 600; background: rgba(255,255,255,.18); padding: 0 6px; border-radius: 8px; }
.h-compose { display: flex; gap: 6px; }
.h-compose .input { flex: 1; min-width: 0; }
.system[data-tab="home"] .h-msgs > .ebtns:last-child { margin-top: 0; padding-top: 0; }
@media (max-width: 860px) {
  .home2 { display: flex; flex-direction: column; padding: 10px; }
  .h-profit { order: 1; } .h-msgs { order: 2; } .h-today { order: 3; } .h-bill { order: 4; }
  .h-big { font-size: 36px; }
  .h-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-actions .btn { min-height: 44px; font-size: 14px; }
  .h-compose .input { min-height: 40px; font-size: 15px; }
}
.msg-me { background: var(--card); border-color: var(--line); }

/* NEW: the week's schedule in the owners' format: a band row per slate, a row per game. Slates are named by day and time. */
.sched-band { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sched-band .muted { margin-left: 6px; }
.sched-tbl td { padding: 5px 10px; }
.sched-tbl .band-row td { padding: 6px 10px; }
.sched-tbl .sched-t { width: 86px; padding-left: 22px; }
.sched-tbl tr.past td { color: var(--faint); }
.sched-tbl tr.band-row.past td { background: var(--ground); }
.sched-tbl tr.band-row.past b { color: var(--muted); }
.h-today { max-height: 560px; }
.sched-scroll { overflow-y: auto; min-height: 0; flex: 1; }
.h-today .card-foot { margin-top: auto; }
@media (max-width: 860px) { .sched-tbl td { font-size: 13px; } .sched-tbl .sched-t { width: 76px; padding-left: 12px; } .h-today { max-height: 480px; } }
.h-billrows { border-top: 1px solid var(--row-line); padding-top: 8px; margin-top: 2px; font-size: 12px; }
.h-term { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.h-term-line { display: flex; justify-content: space-between; align-items: baseline; }
.h-bill .h-billrows { margin-top: 4px; padding-top: 10px; }


/* NEW: Results (brief step 4). The owners' Grading with editing removed and only the client's bets. */
.grading { display: flex; flex-direction: row; gap: 12px; }
.grading > .gcard { flex: 0 0 360px; max-height: none; }
.grading > .bcard { flex: 1; min-width: 0; }
.tbl-results { table-layout: fixed; width: 100%; }
.tbl-results th:nth-child(1) { width: 100px; }
.tbl-results th:nth-child(3) { width: 170px; }
.tbl-results th.r { width: 70px; }
.tbl-results th:nth-child(7) { width: 70px; }
.tbl-results td.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grading .gband { padding: 6px 10px; }
.grow.stripe-live { border-left: 3px solid var(--yellow); }
@media (max-width: 860px) {
  .phone .grading { display: block; padding: 0; background: var(--card); }
  .phone .grading > .card { max-height: none; border: 0; border-radius: 0; flex: none; }
  .phone .grading[data-ptab-on="bets"] .gcard, .phone .grading[data-ptab-on="games"] .bcard { display: none; }
  .phone .bcard > .card-head { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .phone .bcard > .card-head > span:first-child, .phone .bcard > .card-head > .ellip { display: none; }
  .phone .bcard .head-actions { width: 100%; display: flex; gap: 6px; }
  .phone .bcard .head-actions .chip { flex: 1; text-align: center; }
  .phone .tbl-results { display: block; table-layout: auto; }
  .phone .tbl-results thead { display: none; }
  .phone .tbl-results tbody { display: block; }
  .phone .tbl-results tr.rrow { display: flex; flex-wrap: wrap; align-items: center; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); gap: 2px 6px; }
  .phone .tbl-results tr.rrow td { display: block; padding: 0; border: 0; background: none; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: visible; text-overflow: clip; }
  .phone .tbl-results tr.rrow td:nth-child(2) { order: 1; flex: 1 1 55%; font-size: 16px; font-weight: 700; color: var(--ink); white-space: normal; line-height: 1.2; }
  .phone .tbl-results tr.rrow td:nth-child(2) .faint { display: none; }
  .phone .tbl-results tr.rrow td:nth-child(8) { order: 2; margin-left: auto; font-family: var(--mono); font-size: 14px; font-weight: 700; text-align: right; }
  .phone .tbl-results tr.rrow td:nth-child(7) { order: 3; flex: none; }
  .phone .tbl-results tr.rrow td:nth-child(1) { order: 4; flex: 1 1 100%; white-space: normal; }
  .phone .tbl-results tr.rrow td:nth-child(3) { order: 5; flex: none; }
  .phone .tbl-results tr.rrow td:nth-child(4) { order: 6; margin-left: auto; font-family: var(--mono); font-size: 13.5px; color: var(--ink); }
  .phone .tbl-results tr.rrow td:nth-child(5) { order: 7; font-family: var(--mono); font-size: 13.5px; color: var(--ink); }
  .phone .tbl-results tr.rrow td:nth-child(5)::before { content: '@ '; color: var(--muted); }
  .phone .tbl-results tr.rrow td:nth-child(6) { order: 8; font-family: var(--mono); font-size: 13.5px; }
  .phone .tbl-results tr.rrow td:nth-child(6)::before { content: '→ '; color: var(--muted); }
  .phone .tbl-results tr.rrow td.pos { color: var(--green); } .phone .tbl-results tr.rrow td.neg { color: var(--red); }
}

/* NEW: History (past weeks, brief step 4). Weeks named by dates; a read-only banner inside one. */
.hist-wrap { padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.tbl-hist th:nth-child(1) { width: 200px; }
.tbl-hist td { padding: 8px 12px; }
.tbl-hist tr.cur td { background: var(--band); }
.hist-week { text-decoration: none; color: var(--ink); }
.hist-week:hover { text-decoration: underline; }
.hist-jump { display: inline-flex; gap: 6px; }
.ro-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 18px; background: var(--yellow-tint, #fff6d6); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink); }
.read-only .btn-primary[data-act="record"], .read-only [data-act="remove"], .read-only [data-act="edit"] { display: none; }
@media (max-width: 860px) {
  .hist-wrap { padding: 8px 10px; }
  .tbl-hist th:nth-child(1) { width: auto; }
  .tbl-hist th:nth-child(3), .tbl-hist td:nth-child(3), .tbl-hist th:nth-child(5), .tbl-hist td:nth-child(5), .tbl-hist th:nth-child(6), .tbl-hist td:nth-child(6) { display: none; }
  .tbl-hist td { font-size: 14px; padding: 10px 12px; }
  .ro-banner { padding: 8px 12px; font-size: 13px; position: sticky; top: 0; z-index: 5; }
}

/* History on the phone: one card per week, like the owners' */
.phone .hist-wrap { padding: 0; gap: 0; }
.phone .hist-note { padding: 12px; font-size: 14px; line-height: 1.4; color: var(--muted); border-bottom: 1px solid var(--line); }
.hwk { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.hwk.cur { background: var(--band); }
.hwk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hwk-name { font-size: 17px; font-weight: 700; }
.hwk-net { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.hwk-mid { display: flex; gap: 12px; font-size: 13.5px; align-items: center; }
.hwk-mid .ml { margin-left: auto; }
.hwk-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.hwk-btns .btn { min-height: 42px; font-size: 15px; border-radius: 8px; justify-content: center; }
.dot-sq.done { background: var(--faint); }

/* NEW: Messages (brief step 5). The owners' chat, one thread, no Open/Locked and no log. Notices from the site are grey. */
.ch-grid.ch-one { grid-template-columns: minmax(0, 1fr); }
.ch-row.sys .ch-box { background: var(--head-bg); border-style: dashed; }
.ch-row.sys .ch-bar { background: transparent; color: var(--muted); }
.ch-row.sys .ch-body { color: var(--ink-2); }
.ch-row.sys .ch-text { font-size: 11.5px; }
.ch-list { scroll-behavior: smooth; }
@media (max-width: 860px) {
  .phone .ch-ptools .chip { flex: none; }
  .phone .ch-list { min-height: calc(100vh - 230px); }
  .phone .ch-row.sys .ch-text { font-size: 13.5px; }
}

/* NEW: an ended engagement (brief step 6). Read-only banner in grey; Record, custom bets and removal gone; the invoice. */
.ro-banner.ended { background: var(--head-bg); }
.ended [data-act="custom"], .ended .btn-primary[data-act="record"], .ended .pc-rec, .ended .input.odds-in, .ended .input.amt-in, .ended [data-act="remove"], .ended [data-act="edit"], .ended .pc-inputs, .ended .ask-btns { display: none !important; }
.ended .tbl-sheet tr.row-live td.rec::after, .ended .pcard.row-live .pc-foot::after { content: 'not placed'; font-size: 11px; color: var(--faint); }
.inv { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; padding: 14px 18px; align-content: start; }
.inv-main { grid-column: 1; }
.inv-pay { grid-column: 2; }
.inv-weeks { grid-column: 1 / -1; }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.inv-top .h-big { font-size: 34px; margin-top: 2px; }
.inv-figs { display: flex; gap: 36px; align-items: flex-start; flex-wrap: wrap; }
.inv-figs .inv-due { font-size: 26px; margin-top: 8px; font-weight: 400; }
.inv-status .status-dot { font-size: 12px; }
.tbl-inv th:first-child { width: 160px; }
.tbl-inv tfoot td { border-top: 2px solid var(--line); background: var(--head-bg); }
@media (max-width: 860px) {
  .inv { display: flex; flex-direction: column; padding: 10px; }
  .inv-top .h-big { font-size: 32px; }
  .inv-figs { gap: 18px; }
  .inv-figs .inv-due { font-size: 22px; margin-top: 8px; }
  .tbl-inv th:nth-child(3), .tbl-inv td:nth-child(3) { display: none; }
  .tbl-inv td { font-size: 13.5px; }
}

.plain-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.plain-head .plain-logo { margin: 0 auto; }
@media (max-width: 860px) { .pc-lab .pc-exp { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 11px; } }
/* Home row 1: the track takes the taller card, so both cards share a bottom edge and nothing clips */
.home2 .h-profit, .home2 .h-bill { height: auto; min-height: 0; align-self: stretch; }
.home2 .ebtns { flex-wrap: wrap; }

/* NEW (step 6): the frozen banner. .still is the site's yellow notice strip; frozen adds the actions and keeps it on top of the page. */
.frozen-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 18px 0; }
.frozen-bar .btn { flex: none; }
@media (max-width: 860px) { .frozen-bar { flex-direction: column; align-items: stretch; margin: 10px 10px 0; } }

/* A client's Home on a computer (Dan, 2026-11-20): the schedule, and the messages beside it when they come, run to the bottom of the
   window and scroll inside their cards; the mockup's fixed 560px height cut the list off on a tall screen. The phone keeps its stack. */
@media (min-width: 861px) {
  .system[data-tab="home"] .home2 { height: calc(100vh - 46px); grid-template-rows: auto minmax(260px, 1fr); }
  body.read-only .system[data-tab="home"] .home2 { height: calc(100vh - 82px); }
  .system[data-tab="home"] .h-today, .system[data-tab="home"] .h-msgs { grid-row: 2; max-height: none; min-height: 0; display: flex; flex-direction: column; }
  .system[data-tab="home"] .h-today .sched-scroll { flex: 1; min-height: 0; overflow-y: auto; }
}

/* The owners' bet sheet (Dan, 2026-11-20): while a row is open the Book cell is the account picker, the profile picker under it */
.tbl-sheet th.w-book-own { width: 150px; }
/* its own class, not the Algorithm page's .book-pick: that one is display flex, and a flex table cell stops filling its row, which left a white block under the picker (2026-11-21) */
.acct-pick select { width: 100%; max-width: 100%; }
.acct-pick .book-prof { margin-top: 3px; }
.pc-pick { margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }

/* ===== The owners' side (Dan's owner mockup, 2026-11-20): owner.css of the mockup, as handed over ===== */
/* NEW rules for the owner side (brief of 2026-11-20). Loaded after portal.css, phone.css, step2.css and record-step.css. Every rule is marked NEW. */

/* NEW · item 1, the Clients card on Manage (third card, between Slates and People & Accounts). Also item 7: requests sit at the top of it. */
.setup #clients-card { flex: 0 0 auto; max-height: 56%; }
.setup.collapse-clients #clients-card { max-height: none; }
.cl-filter { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--head-bg); border-bottom: 1px solid var(--line); }
.tbl-clients td { white-space: nowrap; }
.tbl-clients td:nth-child(3) { white-space: normal; }
.tbl-clients td.acts .link { margin-left: 8px; }
.cl-name { color: var(--ink); font-weight: 600; }
.cl-name:hover { color: var(--ink); text-decoration: underline; }
.dot-sq.invited { background: var(--blue); } .dot-sq.terms { background: var(--yellow); } .dot-sq.ended { background: var(--faint); } .dot-sq.frozen { background: var(--red); }
/* NEW · item 7, requests from the client's side: a yellow "act here" strip, one line per request, until it is marked handled */
.req-strip { flex: none; display: flex; flex-direction: column; background: var(--yellow-tint-2); border-bottom: 1px solid var(--req-border-2); }
.req-line { display: flex; align-items: center; gap: 10px; padding: 5px 12px; font-size: 12px; color: #4a3800; border-top: 1px solid var(--req-border-2); }
.req-line:first-child { border-top: 0; }
.req-who { flex: none; width: 60px; }
.req-what { flex: 1; min-width: 0; }
.req-when { flex: none; }
/* NEW · item 3, the Add a client dialog: one form, working name and the sportsbooks, then the link to copy */
.ac-modal { width: 460px; }
.ac-rows { display: flex; flex-direction: column; gap: 6px; }
.ac-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px 18px; gap: 8px; align-items: center; }
.ac-row.ac-head { font-size: 11px; color: var(--muted); font-weight: 600; }
.ac-row .input { width: 100%; box-sizing: border-box; }
.ac-row .amt-wrap { display: inline-flex; align-items: center; gap: 3px; }
.ac-more { align-self: flex-start; padding-top: 2px; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--head-bg); }
.link-box .mono { flex: 1; min-width: 0; font-size: 12px; }
@media (max-width: 860px) {
  .setup[data-ptab-on="clients"] #slates-card, .setup[data-ptab-on="clients"] #accts-card, .setup[data-ptab-on="slates"] #clients-card, .setup[data-ptab-on="people"] #clients-card { display: none; }   /* NEW */
  body.phone #clients-card > .card-head { flex-wrap: wrap; padding: 8px 10px; }   /* NEW */
  body.phone #clients-card > .card-head > span:first-child { display: none; }
  body.phone #clients-card .head-actions { width: 100%; }
  body.phone #clients-card .head-actions .search { flex: 1; width: auto; min-width: 0; height: 36px; font-size: 14px; }
  body.phone .cl-filter { overflow-x: auto; padding: 8px 10px; }
  body.phone .cl-filter .chips { flex-wrap: nowrap; }
  body.phone .req-line { flex-wrap: wrap; gap: 6px 10px; padding: 10px; font-size: 14px; }
  body.phone .req-who { order: 1; width: auto; font-size: 15px; }
  body.phone .req-when { order: 1; margin-left: auto; }
  body.phone .req-what { order: 2; flex: 1 1 100%; }
  body.phone .req-line .btn { order: 3; flex: 1; height: 36px; font-size: 14px; }
  body.phone .tbl-clients { display: block; }
  body.phone .tbl-clients thead { display: none; }
  body.phone .tbl-clients tbody { display: block; }
  body.phone .tbl-clients tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n a" "s s" "b e" "l i"; gap: 2px 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--row-line); }
  body.phone .tbl-clients td { display: block; padding: 0; border: 0; background: none; min-width: 0; white-space: normal; font-size: 12.5px; color: var(--muted); }
  body.phone .tbl-clients td:nth-child(1) { grid-area: n; font-size: 15px; }
  body.phone .tbl-clients td:nth-child(2) { grid-area: s; font-size: 13px; }
  body.phone .tbl-clients td:nth-child(2) .status-dot { font-size: 13px; }
  body.phone .tbl-clients td:nth-child(3) { grid-area: b; }
  body.phone .tbl-clients td:nth-child(4) { grid-area: e; text-align: right; }
  body.phone .tbl-clients td:nth-child(5) { grid-area: l; }
  body.phone .tbl-clients td:nth-child(5):not(:empty)::before { content: 'signed in '; font-family: var(--sans); }
  body.phone .tbl-clients td:nth-child(6) { grid-area: i; text-align: right; }
  body.phone .tbl-clients td:nth-child(7) { grid-area: a; display: flex; gap: 8px; align-items: center; }
  body.phone .tbl-clients td:nth-child(7) .link { margin: 0; font-size: 13px; }
  body.phone .ac-row { grid-template-columns: minmax(0, 1fr) 96px 86px 18px; gap: 6px; }
  body.phone .ac-row .input { font-size: 14px; min-height: 36px; }
  body.phone .link-box .mono { font-size: 13px; overflow-wrap: anywhere; }
}

/* NEW · item 2, the client sheet: its own page off the Clients list. Cards are the Exports page's .card.ecard; the label/value grid is step2.css's .kv. */
.cs { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; padding: 14px 18px; align-content: start; }
.cs-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cs .ecard { gap: 10px; }
.cs .ecard-title { display: flex; align-items: baseline; gap: 8px; }
.cs .ecard-title .norm { font-weight: 400; color: var(--muted); font-size: 12px; }
.cs .kv > span:first-child { color: var(--muted); }
.cs textarea.input { resize: vertical; min-height: 54px; font-family: var(--sans); }
.page-back { font-size: 12px; padding-bottom: 11px; }
.page-head .page-sub { font-size: 12px; color: var(--muted); padding-bottom: 11px; }
.tbl-signins td { white-space: nowrap; font-size: 11.5px; }
.tbl-signins td.why { white-space: normal; }
.si-ok { color: var(--green-text); font-weight: 600; } .si-no { color: var(--red-text); font-weight: 600; }
/* NEW · item 10, ending and billing: one step per line, the step that needs a hand in yellow */
.bill-steps { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bill-step { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-top: 1px solid var(--row-line); font-size: 12px; }
.bill-step:first-child { border-top: 0; }
.bill-step.now { background: var(--yellow-tint-2); }
.bill-step.todo { color: var(--muted); }
.bill-step .dot-sq { width: 10px; height: 10px; border-radius: 50%; }
.bill-step .dot-sq.todo { background: var(--card); border: 1px solid var(--control); }
.bill-step .when { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.bill-step .btns { display: flex; gap: 6px; }
.still .ml { margin-left: auto; }
/* NEW · item 9, deal and fee: room on the sheet, no form yet */
.deal-wait { padding: 10px 12px; border: 1px dashed var(--control); border-radius: 6px; background: var(--ground); font-size: 12px; color: var(--muted); line-height: 1.5; }
/* NEW · item 10, the Make the invoice dialog */
.inv-modal { width: 560px; }
.inv-modal .kv > span { white-space: nowrap; }
.inv-sum { display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--head-bg); }
.inv-sum > span:nth-child(odd) { color: var(--muted); }
.fee-row { display: flex; align-items: center; gap: 8px; }
.fee-row .input { width: 110px; font-size: 15px; }
@media (max-width: 860px) {
  body.phone .cs { display: flex; flex-direction: column; padding: 10px; gap: 10px; }   /* NEW */
  body.phone .cs .ecard { font-size: 13.5px; }
  body.phone .cs .ecard-title { font-size: 15px; }
  body.phone .cs .kv { font-size: 14px; }
  body.phone .cs .field .input, body.phone .cs select.input { font-size: 15px; min-height: 40px; }
  body.phone .cs .ebtns .btn { min-height: 38px; font-size: 13.5px; }
  body.phone .bill-step { font-size: 14px; padding: 10px; grid-template-columns: 10px minmax(0, 1fr); }
  body.phone .bill-step .btns { grid-column: 2; flex-wrap: wrap; }
  body.phone .bill-step .btn { min-height: 36px; font-size: 13.5px; }
  body.phone .tbl-signins { display: block; } body.phone .tbl-signins thead { display: none; } body.phone .tbl-signins tbody { display: block; }
  body.phone .tbl-signins tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 9px 0; border-bottom: 1px solid var(--row-line); }
  body.phone .tbl-signins td { display: block; padding: 0; border: 0; font-size: 13px; white-space: normal; color: var(--muted); }
  body.phone .tbl-signins td:nth-child(1) { color: var(--ink); font-size: 14px; }
  body.phone .tbl-signins td:nth-child(2) { text-align: right; }
  body.phone .tbl-signins td:nth-child(3), body.phone .tbl-signins td:nth-child(4) { grid-column: 1 / -1; }
  body.phone .tbl-signins td.why { grid-column: 1 / -1; }
  body.phone .inv-sum { font-size: 14px; }
  body.phone .fee-row .input { font-size: 17px; }
  body.phone .still .ml { margin-left: 0; width: 100%; }
}

/* (the mockup's leftover rules for the dropped "limited" list stood here without their opening line; their stray closing brace switched off the rule below) */

/* NEW · item 5, Chat › Clients: a third tab. The client list takes the log’s column, on the left; the conversation is the Open chat’s own
   card (.ch-card, .ch-row, .ch-comp). Notices from the site use step2.css’s .ch-row.sys (grey, dashed). */
.ch-grid.cc-grid { grid-template-columns: 300px minmax(0, 1fr); }
.cc-card { min-height: 0; }
.cc-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.cc-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--row-line); color: var(--ink); text-decoration: none; position: relative; cursor: pointer; }
.cc-row:hover { background: var(--sel); color: var(--ink); }
.cc-row.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--ink); }
.cc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cc-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; min-width: 0; }
.cc-when { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.cc-prev { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 24px; }
.cc-row.unread .cc-prev { color: var(--ink); }
.cc-badge { position: absolute; right: 12px; bottom: 8px; }
.ch-comp textarea { border: 0; outline: 0; background: transparent; color: var(--ink); padding: 8px 10px 4px; font: 12px/1.4 var(--sans); resize: none; width: 100%; }
@media (max-width: 860px) {
  body.phone .ch-comp textarea { font-size: 15px; padding: 10px 12px 4px; }   /* NEW */
  body.phone .ch-ptools .chip { flex: none; }
  body.phone .cc-card { display: none; }
}
/* NEW · item 8, Settings › Terms of Service */
.tbl-terms td { padding: 5px 12px; }
.tbl-terms td:first-child { padding-left: 14px; }
.tt-row-wait td { background: var(--yellow-tint-2); }
.setcard .form-row { margin: 0; }
/* NEW · item 11, Settings › Help page */
.hp-in { width: 260px; }
.hp-row { display: grid; grid-template-columns: 110px 140px minmax(0, 1fr); gap: 8px; align-items: center; }
.hp-row.hp-head { font-size: 11px; color: var(--muted); font-weight: 600; }
.hp-row .input { width: 100%; box-sizing: border-box; }
@media (max-width: 860px) {
  body.phone .hp-row { grid-template-columns: minmax(0, 1fr); }   /* NEW */
  body.phone .hp-row.hp-head { display: none; }
  body.phone .set-ctl .input.hp-in { width: 160px; }
}

/* NEW · phone fixes after review: the terms table, the invoice dialog and the limited head wrap instead of running off the screen */
@media (max-width: 860px) {
  body.phone .tbl-terms td, body.phone .tbl-terms th { white-space: normal; font-size: 12px; padding: 6px 8px; }
  body.phone .tbl-terms td:first-child { padding-left: 10px; }
  body.phone .inv-modal .form-row { grid-template-columns: minmax(0, 1fr); }
  body.phone .inv-modal .kv { grid-template-columns: minmax(0, 1fr) auto; }
  body.phone .inv-modal .kv > span { white-space: normal; }
  body.phone .inv-sum { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  body.phone .inv-sum > span:nth-child(even) { margin-bottom: 6px; }
  body.phone .lim-head { white-space: normal; line-height: 1.4; }
  body.phone .lim-head .muted { display: block; }
}

/* NEW · Manage as three tabs (Dan, 2026-11-20): Slates · Accounts · Clients under the site's .page-head / .page-tabs, one card per tab filling the page */
.setup.tabbed #slates-card, .setup.tabbed #accts-card, .setup.tabbed #clients-card { flex: 1 1 auto; max-height: none; }
.setup.tabbed .fold-head { cursor: default; }

/* NEW · ended clients on Manage › Accounts (Dan, 2026-11-20): paused for good, no new accounts or profiles; every balance taken to $0, then the person comes off */
.tbl-accts .acct-row.ended td { background: var(--ground); color: var(--muted); }
.tbl-accts .acct-row.ended td.b, .tbl-accts .acct-row.ended .num.b { color: var(--ink-2); }
.pause-ctl.locked { cursor: default; }
.pause-ctl.locked .toggle { opacity: .45; cursor: default; }
.tbl-accts .end-row td { padding: 6px 12px 7px 30px; background: var(--head-bg); border-bottom: 1px solid var(--line); }
.tbl-accts .end-row.done td { background: var(--green-tint); }
.end-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.end-form .ml { flex: 1; margin: 0; }
@media (max-width: 860px) {
  body.phone .tbl-accts tr.end-row { display: block; }   /* NEW */
  body.phone .tbl-accts tr.end-row td { display: block; padding: 10px; font-size: 13px; }
  body.phone .end-form .ml { display: none; }
  body.phone .end-form .btn { width: 100%; min-height: 38px; font-size: 14px; }
}

/* NEW · Clients split into Active and Ended (Dan, 2026-11-20): the site's .band-row as the group heading */
.tbl-clients .cl-band td { cursor: default; }
@media (max-width: 860px) {
  body.phone .tbl-clients tr.cl-band { display: block; padding: 8px 10px; background: var(--band); border-bottom: 1px solid var(--line); }   /* NEW */
  body.phone .tbl-clients tr.cl-band td { display: block; font-size: 13px; color: var(--ink); }
}

/* NEW · Clients as two cards, Current clients and Past clients (Dan, 2026-11-20). Replaces the one list with filter chips. */
.setup.tabbed #past-card { flex: 0 0 auto; max-height: 40%; }
.tbl-cl td { white-space: nowrap; }
.tbl-cl td.wrap { white-space: normal; }
.tbl-cl td.acts .link { margin-left: 8px; }
.tbl-cl .sans { font-family: var(--sans); }
@media (max-width: 860px) {
  body.phone #clients-card.cl-card > .card-head > span:first-child, body.phone #past-card > .card-head > span:first-child { display: block; width: 100%; font-size: 15px; }   /* NEW */
  body.phone .setup .cl-card { border-bottom: 8px solid var(--ground); }
  body.phone .tbl-cl { display: block; }
  body.phone .tbl-cl thead { display: none; }
  body.phone .tbl-cl tbody { display: block; }
  body.phone .tbl-cl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "a f" "b b" "c d" "e e"; gap: 3px 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--row-line); }
  body.phone .tbl-cl td { display: block; padding: 0; border: 0; background: none; min-width: 0; white-space: normal; font-size: 12.5px; color: var(--muted); }
  body.phone .tbl-cl td:nth-child(1) { grid-area: a; font-size: 15px; }
  body.phone .tbl-cl td:nth-child(2) { grid-area: b; font-size: 13px; }
  body.phone .tbl-cl td:nth-child(3) { grid-area: c; }
  body.phone .tbl-cl td:nth-child(4) { grid-area: d; text-align: right; }
  body.phone .tbl-cl td:nth-child(5) { grid-area: e; }
  body.phone .tbl-cur td:nth-child(5)::before { content: 'signed in '; font-family: var(--sans); }
  body.phone .tbl-past td:nth-child(5)::before { content: 'read-only until '; font-family: var(--sans); }
  body.phone .tbl-cl td:nth-child(6) { grid-area: f; display: flex; gap: 8px; align-items: center; }
  body.phone .tbl-cl td:nth-child(6) .link { margin: 0; font-size: 13px; }
  body.phone .tbl-past tr { grid-template-areas: "a f" "b b" "c c" "d d" "e e"; }
  body.phone .tbl-past td:nth-child(4) { text-align: left; }
}

/* NEW · Clients tab: Current clients and Past clients as two views behind one switch (Dan, 2026-11-20). Current is for acting; Past is for looking things up and billing. */
.cl-headl { display: flex; align-items: center; gap: 10px; }
.cl-seg .seg-chip { padding: 0 12px; text-decoration: none; }
.cl-seg .seg-chip:hover { color: var(--ink); }
.cl-seg .seg-chip.on:hover { color: #fff; }
.setup.tabbed #past-card.solo { flex: 1 1 auto; max-height: none; }
.tbl-cl td.acts { white-space: nowrap; }
@media (max-width: 860px) {
  body.phone .cl-headl { width: 100%; flex-wrap: wrap; }   /* NEW */
  body.phone .cl-seg { width: 100%; }
  body.phone .cl-seg .seg-chip { flex: 1; height: 34px; font-size: 13px; }
  body.phone #past-card .head-actions { width: 100%; }
  body.phone #past-card .head-actions .search { flex: 1; width: auto; height: 36px; font-size: 14px; }
  body.phone .tbl-cl tr, body.phone .tbl-past tr { grid-template-areas: "a a" "b b" "c d" "e e" "f f"; }
  body.phone .tbl-past tr { grid-template-areas: "a a" "b b" "c c" "d d" "e e" "f f"; }
  body.phone .tbl-cl td:nth-child(6) { flex-wrap: wrap; justify-content: flex-start; margin-top: 4px; }
  body.phone .tbl-cl td:nth-child(6) .btn { margin: 0; }
}

/* NEW · the client's full name, then their username in brackets, set a little apart */
.cl-user { margin-left: 8px; }

/* NEW · a request from the client's side arrives in Chat › Clients, marked Request (Dan, 2026-11-20; replaces the yellow strip on Clients) */
.cc-req { font-weight: 700; color: var(--amber, #8a6a00); }

/* NEW · each sportsbook as its own small label (the site's .pill), so two books read as two */
.cl-books { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.cl-books .pill { white-space: nowrap; }
@media (max-width: 860px) { body.phone .cl-books .pill { font-size: 12px; padding: 2px 8px; } }   /* NEW */

/* NEW · KVM, a quick column left of the client: the unit number, or a dash for none */
.tbl-cl th.kvm, .tbl-cl td.kvm { width: 44px; text-align: center; padding-left: 12px; padding-right: 4px; }
@media (max-width: 860px) {
  body.phone .tbl-cur tr { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "k a a" "b b b" "c c d" "e e e" "f f f"; }   /* NEW: one column more than Past */
  body.phone .tbl-cur td:nth-child(1) { grid-area: k; font-size: 13px; width: auto; padding: 0 2px 0 0; }
  body.phone .tbl-cur td:nth-child(1):not(.muted)::before { content: 'KVM '; font-family: var(--sans); color: var(--muted); font-size: 11px; }
  body.phone .tbl-cur td:nth-child(2) { grid-area: a; font-size: 15px; }
  body.phone .tbl-cur td:nth-child(3) { grid-area: b; font-size: 13px; }
  body.phone .tbl-cur td:nth-child(4) { grid-area: c; text-align: left; }
  body.phone .tbl-cur td:nth-child(5) { grid-area: d; text-align: right; }
  body.phone .tbl-cur td:nth-child(5)::before { content: none; }
  body.phone .tbl-cur td:nth-child(6) { grid-area: e; display: block; margin: 0; }
  body.phone .tbl-cur td:nth-child(6)::before { content: 'signed in '; font-family: var(--sans); }
  body.phone .tbl-cur td:nth-child(7) { grid-area: f; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
  body.phone .tbl-cur td:nth-child(7) .btn { margin: 0; }
}

/* NEW · the client sheet's History: every sign-in, login link, change, account entry, engagement and billing step, in one scrolling list (Dan, 2026-11-20). Replaces the sign-in record. Kind labels are Logs' .log-kind. */
.chist-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 5px; }
.tbl-chist td { font-size: 11.5px; vertical-align: baseline; }
.tbl-chist td.what { white-space: normal; }
.tbl-chist .log-kind { width: auto; }
.tbl-chist .log-kind.neg { color: var(--red-text); }
@media (max-width: 860px) {
  body.phone .chist-scroll { max-height: 420px; }   /* NEW */
  body.phone .tbl-chist { display: block; } body.phone .tbl-chist thead { display: none; } body.phone .tbl-chist tbody { display: block; }
  body.phone .tbl-chist tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "w w b" "k t t"; gap: 2px 8px; padding: 8px 10px; border-bottom: 1px solid var(--row-line); }
  body.phone .tbl-chist td { display: block; padding: 0; border: 0; font-size: 13px; }
  body.phone .tbl-chist td:nth-child(1) { grid-area: w; font-size: 11.5px; color: var(--muted); }
  body.phone .tbl-chist td:nth-child(2) { grid-area: k; }
  body.phone .tbl-chist td:nth-child(3) { grid-area: t; }
  body.phone .tbl-chist td:nth-child(4) { grid-area: b; font-size: 11.5px; }
  body.phone .cs .chips { overflow-x: auto; flex-wrap: nowrap; }
}

/* NEW · Their details and Standing share a row, so the two cards are the same height (Dan, 2026-11-20) */
.cs-pair { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: stretch; }
@media (max-width: 860px) { body.phone .cs-pair { display: flex; flex-direction: column; gap: 10px; } }   /* NEW */

/* NEW · the client sheet's Standing card leads with the standing itself, large (Dan, 2026-11-20) */
.st-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 2px 0 8px; border-bottom: 1px solid var(--row-line); font-size: 13px; }
.st-main > .status-dot { font-size: 22px; font-weight: 600; color: var(--ink); gap: 9px; align-items: center; }
.st-main > .status-dot .dot-sq { width: 12px; height: 12px; border-radius: 3px; }
@media (max-width: 860px) { body.phone .st-main > .status-dot { font-size: 22px; } }   /* NEW */

/* NEW · a card's button row sits at the bottom of the card on the client sheet (Dan, 2026-11-20) */
.cs .ecard > .ebtns:last-child { margin-top: auto; padding-top: 6px; }

/* NEW · the Standing card's four lines spread to the height five took */
.cs-pair .kv { row-gap: 14px; }

/* NEW · space between two values on one line of a label/value list, no dot between them */
.kv-gap { margin-left: 18px; }

/* NEW · start → end with room either side of the arrow */
.kv-arrow { margin: 0 10px; color: var(--muted); }

/* NEW · the client sheet's way back: a real button in the page head, not a text link */
.page-head .btn.page-back { align-self: center; margin-bottom: 10px; padding: 5px 12px; font-size: 12px; }

/* NEW · Deal & fee folded into the Ending & billing card on a past client's sheet (Dan, 2026-11-20) */
.sub-head-in { font-size: 12px; font-weight: 600; padding-top: 8px; border-top: 1px solid var(--row-line); }

/* NEW · several values on one line, spaced apart instead of joined by dots */
.kv-split { display: inline-flex; flex-wrap: wrap; gap: 4px 18px; }

/* NEW · an invited client's sheet: only the invite link until they sign up (Dan, 2026-11-20) */
.cs-solo { padding: 14px 18px; max-width: 560px; }
.cs-solo .ecard { gap: 10px; }
@media (max-width: 860px) {
  body.phone .cs-solo { padding: 10px; max-width: none; }   /* NEW */
  body.phone .cs-solo .btn { min-height: 38px; font-size: 13.5px; }
}

/* NEW · Chat › Clients: archived conversations at the bottom of the list; a new message still shows its badge (Dan, 2026-11-20) */
.cc-arch { border-top: 1px solid var(--line); }
.cc-arch-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--head-bg); border-bottom: 1px solid var(--row-line); }
/* NEW · the Archived heading folds the archive away; collapsed, only the heading and its badge show */
.cc-arch-head { cursor: pointer; user-select: none; }
.cc-arch-head:hover { color: var(--ink); }
.cc-arch-r { display: inline-flex; align-items: center; gap: 8px; }
.cc-arch.collapsed .cc-row { display: none; }

/* NEW · Chat › Clients › Send a notice: pick the clients (current ones ticked by default), then a warning before it goes (Dan, 2026-11-20) */
.nt-modal { width: 520px; }
.nt-modal textarea.input { resize: vertical; font-family: var(--sans); }
.nt-group { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.nt-group + .nt-group { margin-top: 8px; }
.nt-ghead { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; font-size: 12px; background: var(--head-bg); border-bottom: 1px solid var(--row-line); }
.nt-all { margin-left: auto; display: flex; gap: 10px; font-size: 11.5px; }
.nt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; padding: 8px 10px; }
.nt-pick { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; cursor: pointer; }
.nt-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-warn { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: var(--yellow-tint-2); border: 1px solid var(--req-border-2); font-size: 12.5px; color: #4a3800; }
.nt-quote { padding: 8px 10px; border: 1px dashed var(--control); border-radius: 6px; background: var(--ground); font-size: 12.5px; line-height: 1.45; }
@media (max-width: 860px) {
  body.phone .nt-grid { grid-template-columns: minmax(0, 1fr); gap: 2px; }   /* NEW */
  body.phone .nt-pick { font-size: 15px; min-height: 40px; }
  body.phone .nt-pick input { width: 20px; height: 20px; }
  body.phone .nt-ghead, body.phone .nt-all { font-size: 13.5px; }
  body.phone .nt-warn, body.phone .nt-quote { font-size: 14px; }
  body.phone .nt-modal textarea.input { font-size: 15px; }
}

/* NEW · Settings › Terms of Service: the two cards fill the width and meet in the middle (Dan, 2026-11-20). Portal.css caps .setcol at 560px. */
.sgrid-full > .setcol { max-width: none; }
.sgrid-full { align-items: stretch; }
.sgrid-full > .setcol > .setcard { height: 100%; box-sizing: border-box; }

/* NEW · Settings › Clients: one category for everything clients see and get — Emails, Terms of Service, Help page — as tabs inside it (Dan, 2026-11-20) */
.cset-tabs { display: flex; gap: 2px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.cset-tab { padding: 7px 14px 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cset-tab:hover { color: var(--ink); }
.cset-tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.sgrid-full > .setcol { display: flex; flex-direction: column; gap: 12px; }
.sgrid-full > .setcol > .setcard + .setcard { margin-top: 0; }
.em-in { width: 240px; }
.tbl-emails td { padding: 7px 12px; font-size: 12px; }
.tbl-emails td:first-child { padding-left: 14px; }
.tbl-emails .em-row { cursor: pointer; }
.tbl-emails .em-row:hover td { background: var(--sel); }
.tbl-emails .em-row.open td { background: var(--head-bg); border-bottom: 0; }
.tbl-emails .em-body td { background: var(--head-bg); padding: 0 14px 12px; }
.em-text { padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); font: 12px/1.5 var(--mono); }
.em-text p { margin: 0 0 8px; } .em-text p:last-child { margin: 0; }
.tbl-outbox td { padding: 5px 12px; white-space: nowrap; }
.tbl-outbox td:first-child { padding-left: 14px; }
@media (max-width: 860px) {
  body.phone .cset-tabs { overflow-x: auto; margin: 0 0 10px; }   /* NEW */
  body.phone .cset-tab { flex: none; padding: 10px 14px; font-size: 14px; }
  body.phone .em-in { width: 100%; }
  body.phone .tbl-emails td:nth-child(2) { display: none; }
  body.phone .tbl-emails td { font-size: 14px; padding: 10px 12px; }
  body.phone .em-text { font-size: 13px; }
  body.phone .tbl-outbox { display: block; overflow-x: auto; }
}

/* NEW · Logs: emails and browser pushes are a kind of their own ("emails" filter); the outbox left Settings (Dan, 2026-11-20) */
.log-row .amber { font-weight: 600; }

/* NEW · Settings › Clients › Emails: one column, Sending then the emails, full width of the settings area */
.cset-one { max-width: none; display: flex; flex-direction: column; gap: 12px; }
.cset-one > .setcard { max-width: none; }

/* NEW · Emails the site sends: each one has its own on/off toggle and an editable subject and message (Dan, 2026-11-20). {tags} are filled in by the site. Saved with the Save bar. */
.tbl-emails td.em-on { white-space: nowrap; width: 1%; }
.tbl-emails td.em-on .toggle { vertical-align: middle; }
.tbl-emails .em-row.off td:first-child, .tbl-emails .em-row.off td:nth-child(2) { color: var(--faint); }
.em-edit { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.em-ta { font: 12px/1.5 var(--mono); resize: vertical; }
.em-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.em-tag { font: 11px var(--mono); padding: 2px 7px; border: 1px solid var(--control); border-radius: 4px; background: var(--head-bg); cursor: pointer; }
.em-tag:hover { border-color: var(--ink); }
@media (max-width: 860px) {
  body.phone .em-ta { font-size: 14px; }   /* NEW */
  body.phone .em-tag { font-size: 13px; padding: 5px 9px; }
  body.phone .em-edit .input { font-size: 15px; }
}
.tbl-emails td.em-on .set-unit { margin-left: 6px; }   /* NEW */

/* NEW · Settings › Clients is one page: Emails, Terms of Service and Help page as sections, no tabs (Dan, 2026-11-20) */
.cset-sec + .cset-sec { margin-top: 26px; }
.cset-h { font-size: 13px; font-weight: 700; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* NEW · Publish a new version: file and Publish on one line */
.pub-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-go { margin-left: auto; }
@media (max-width: 860px) {
  body.phone .pub-go { margin-left: 0; width: 100%; justify-content: center; min-height: 40px; }   /* NEW */
}

/* NEW · Settings › Clients: terms on the left (current, then publish), Help page on the right */
.cset-split { align-items: stretch; }
.cset-split > .setcol > .setcard { height: auto; }
.cset-split > .setcol > .setcard:last-child { flex: 1; }   /* both columns end at the same line */

/* NEW · Help page contacts: one roomy block per person, add and remove (Dan, 2026-11-20). Replaces the .hp-row grid. */
.hp-contacts { display: flex; flex-direction: column; gap: 10px; }
.hp-top { display: flex; align-items: center; justify-content: space-between; }
.hp-card { position: relative; padding: 12px 36px 12px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--head-bg); }
.hp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
.hp-grid .hp-email { grid-column: 1 / -1; }
.hp-grid .input { width: 100%; box-sizing: border-box; }
.hp-x { position: absolute; top: 10px; right: 10px; }
@media (max-width: 860px) {
  body.phone .hp-grid { grid-template-columns: minmax(0, 1fr); }   /* NEW */
  body.phone .hp-grid .input { font-size: 15px; min-height: 40px; }
  body.phone .hp-top .btn { min-height: 36px; font-size: 13.5px; }
}

/* NEW · Settings category column: grouped (Picks · Clients · Site) and narrower, 250px → 200px (Dan, 2026-11-20) */
.system > .settings-wrap { grid-template-columns: 200px 1fr; }
.setnav { background: var(--ground); padding: 10px 10px 0; }
.setnav-sec + .setnav-sec { margin-top: 18px; }
.setnav-group { padding: 0 4px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.setnav-box { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.setnav-box .setnav-item:last-child { border-bottom: 0; }
.setnav .setnav-foot { padding: 10px 4px; }

/* NEW · item 9, the deal: summary card on the client sheet, and the Edit deal dialog (deal formats from Dan, 2026-11-20).
   Type list on the left, only that type's boxes on the right, extras and a note under them, the live fee line above the buttons. */
.deal-sum { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--head-bg); display: flex; flex-direction: column; gap: 2px; }
.deal-now { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 10px; border-radius: 6px; background: var(--sel); font-size: 12.5px; }
.deal-now b { font-size: 16px; }
.deal-modal { width: 560px; max-width: calc(100vw - 40px); }
.deal-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
.deal-types { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--row-line); padding-right: 14px; }
.deal-lab { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.deal-lab .norm { text-transform: none; letter-spacing: 0; font-weight: 400; }
.deal-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; font-size: 12.5px; cursor: pointer; }
.deal-opt:hover { background: var(--sel); }
.deal-opt.on { background: var(--sel); font-weight: 600; box-shadow: inset 3px 0 0 var(--ink); }
.deal-hint { margin-top: 8px; line-height: 1.4; }
.deal-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.deal-sec { display: flex; flex-direction: column; gap: 8px; }
.deal-sec + .deal-sec { padding-top: 12px; border-top: 1px solid var(--row-line); }
.deal-figs { display: flex; flex-wrap: wrap; gap: 4px 16px; font: 11.5px var(--mono); color: var(--muted); }
.band-up { padding-left: 4px; }
.amt-wrap { display: inline-flex; align-items: center; gap: 3px; }
.amt-wrap .input { width: 80px; }
.pair { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.pair-f { display: inline-flex; align-items: center; gap: 6px; }
.pair-f .input { width: 52px; }
.deal-x { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.deal-x:not(.on) .amt-wrap, .deal-x:not(.on) .deal-note-in, .deal-x:not(.on) > .sm { opacity: .45; }
.deal-chk { display: inline-flex; align-items: center; gap: 7px; width: 150px; font-weight: 600; }
.deal-note-in { width: 200px; }
.mix-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mix-plus { align-self: flex-start; font: 600 11px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: -4px 0; }
.deal-live { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border-radius: 6px; background: var(--sel); font-size: 12.5px; }
.deal-live b { font-size: 18px; }
.deal-rule { margin-left: auto; }
@media (max-width: 860px) {
  body.phone .deal-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }   /* NEW */
  body.phone .deal-types { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--row-line); padding-bottom: 10px; }
  body.phone .deal-opt { font-size: 15px; padding: 10px 8px; }
  body.phone .deal-chk { width: 100%; font-size: 14px; }
  body.phone .deal-note-in { width: 100%; }
  body.phone .deal-live { font-size: 14px; }
  body.phone .deal-rule { margin-left: 0; }
  body.phone .deal-now { font-size: 14px; }
}
.deal-modal { max-height: calc(100vh - 40px); overflow-y: auto; }   /* NEW: the dialog scrolls inside itself on short screens */
@media (max-width: 860px) {
  body.phone .deal-modal { max-height: calc(100vh - 24px); }   /* NEW */
}

/* NEW · item 9, simplified (Dan, 2026-11-20): one of five basic types, one number each. Tiered, threshold, mix and the extras are left out for now. */
.deal-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.deal-row { display: flex; flex-direction: column; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--row-line); cursor: pointer; }
.deal-row:first-child { border-top: 0; }
.deal-row:hover { background: var(--sel); }
.deal-row.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--ink); }
.deal-row-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.deal-row-top input { align-self: center; }
.deal-row-box { display: flex; align-items: center; gap: 8px; padding-left: 22px; }
@media (max-width: 860px) {
  body.phone .deal-row-top { font-size: 15px; }   /* NEW */
  body.phone .deal-row-top .sm { flex-basis: 100%; padding-left: 22px; font-size: 13px; }
  body.phone .deal-row { padding: 12px; }
}
.deal-row { color: var(--ink); text-decoration: none; }   /* NEW: rows are links in the mockup */
.deal-row:hover { color: var(--ink); }
.deal-sum .deal-lab { margin-bottom: 2px; }   /* NEW */
/* NEW · the estimate sits beside its method in one box */
.deal-sum2 { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 12px; }
.deal-sum-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deal-sum-r { text-align: right; flex: none; }
.deal-sum-r b { font-size: 18px; }
/* NEW · Our side and Deal & estimate share a row (same height); the figures sit four across */
.deal-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.deal-stats > div { display: flex; flex-direction: column; gap: 2px; }
.deal-stats span { font-size: 11px; color: var(--muted); }
.deal-stats b { font-size: 12.5px; font-weight: 600; }
@media (max-width: 860px) { body.phone .deal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.phone .deal-stats b { font-size: 14px; } }   /* NEW */
/* NEW · the four figures centred, each in a light tile */
.deal-stats > div { align-items: center; text-align: center; padding: 7px 4px; border-radius: 5px; background: var(--head-bg); border: 1px solid var(--row-line); }
/* NEW · client sheet: the client's full name, centred in the page head (Dan, 2026-11-20) */
.page-head:has(> .cs-title) { position: relative; }
.page-head > .cs-title { position: absolute; left: 50%; transform: translateX(-50%); bottom: 11px; white-space: nowrap; }
.cc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* NEW: long full names shorten with … */
@media (max-width: 860px) { body.phone #clients-card .head-actions .search { display: none; } }   /* NEW · no search on the phone Clients list (Dan, 2026-11-20) */
/* NEW · phone: + Add client moves to the end of the list, full width; the list scrolls with the page (Dan, 2026-11-20) */
.cl-add-foot { display: none; }
@media (max-width: 860px) {
  body.phone #clients-card .head-actions { display: none; }
  body.phone #clients-card .cl-add-foot { display: block; padding: 12px 10px 16px; }
  body.phone #clients-card .cl-add-foot .btn { display: flex; justify-content: center; width: 100%; box-sizing: border-box; min-height: 44px; font-size: 15px; }
  body.phone .setup.tabbed #clients-card { flex: none; overflow: visible; }
  body.phone #clients-card > .tbl-wrap { overflow: visible; flex: none; }
}
/* NEW · phone Current clients card: name, username, standing on top; KVM and books under, the dates on the right; no last sign-in (Dan, 2026-11-20) */
@media (max-width: 860px) {
  body.phone #clients-card .tbl-cur tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; grid-template-areas: none; }
  body.phone #clients-card .tbl-cur tbody tr::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
  body.phone #clients-card .tbl-cur tbody td { grid-area: auto; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(2) { order: 1; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(3) { order: 2; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(1) { order: 3; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(4) { order: 4; flex: 1 1 0; min-width: 0; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(5) { order: 5; margin-left: auto; text-align: right; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(6) { display: none; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(7) { order: 6; flex-basis: 100%; }
}
@media (max-width: 860px) { body.phone #clients-card .tbl-cur tbody td:nth-child(3) { flex: 1 1 auto; min-width: 0; } }   /* NEW: a long standing wraps as one line of text */
@media (max-width: 860px) { body.phone #clients-card .tbl-cur tbody td:nth-child(5) { display: none; } }   /* NEW · no engagement dates on the phone client cards (Dan, 2026-11-20) */
/* NEW · phone client cards: Message and Sheet stacked on the right, so each card is two lines tall (Dan, 2026-11-20) */
@media (max-width: 860px) {
  body.phone #clients-card .tbl-cur tbody tr { position: relative; padding-right: 92px; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(7) { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; flex-basis: auto; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(7) .btn { width: 74px; justify-content: center; margin: 0; }
}
/* NEW · phone client cards all the same shape: name · standing · KVM and books, one line each; long names and many books shorten instead of growing the card */
@media (max-width: 860px) {
  body.phone #clients-card .tbl-cur tbody tr { gap: 5px 10px; padding-top: 12px; padding-bottom: 12px; min-height: 0; }
  body.phone #clients-card .tbl-cur tbody tr::after { display: none; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(2) { flex: 0 0 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(3) { flex: 0 0 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(4) { white-space: nowrap; overflow: hidden; }
  body.phone #clients-card .tbl-cur tbody td:nth-child(4) .cl-books { flex-wrap: nowrap; }
}
/* NEW · phone Past clients cards, the same shape as Current: name · billing standing · read-only until; buttons stacked right; no dates, accounts or search (Dan, 2026-11-20) */
@media (max-width: 860px) {
  body.phone #past-card .head-actions .search { display: none; }
  body.phone .tbl-past tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; padding: 12px 92px 12px 10px; position: relative; grid-template-areas: none; }
  body.phone .tbl-past tbody td { grid-area: auto; }
  body.phone .tbl-past tbody td:nth-child(1) { flex: 0 0 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
  body.phone .tbl-past tbody td:nth-child(2), body.phone .tbl-past tbody td:nth-child(4) { display: none; }
  body.phone .tbl-past tbody td:nth-child(3) { flex: 0 0 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.phone .tbl-past tbody td:nth-child(5) { flex: 0 0 100%; text-align: left; }
  body.phone .tbl-past tbody td:nth-child(6) { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
  body.phone .tbl-past tbody td:nth-child(6) .btn { width: 74px; justify-content: center; margin: 0; }
}
@media (max-width: 860px) { body.phone #chat .ch-filter .ch-search { display: none; } }   /* NEW · no search in the phone conversation (Dan, 2026-11-20) */
/* NEW · phone conversation: a back button and the client's name in place of the filters (Dan, 2026-11-20) */
.ch-pwho { gap: 10px; }
.ch-back { width: 36px; height: 36px; padding: 0; justify-content: center; font-size: 20px; line-height: 1; }
.ch-pname { font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* NEW · phone: all client chats as a list, like the computer's side column; tapping one opens the conversation (Dan, 2026-11-20) */
@media (max-width: 860px) {
  body.phone .cc-phone-list .cc-card { display: flex; flex-direction: column; border-radius: 0; }
  body.phone .cc-phone-list .ch-grid.cc-grid { display: block; }
  body.phone .cc-phone-list .cc-row { padding: 12px 14px; }
  body.phone .cc-phone-list .cc-name { font-size: 15px; }
  body.phone .cc-phone-list .cc-prev { font-size: 13.5px; }
  body.phone .cc-phone-list .cc-when { font-size: 12px; }
  body.phone .cc-phone-list .card-head .btn { min-height: 34px; font-size: 13px; }
}
@media (max-width: 860px) { body.phone .cc-phone-list .cc-list { overflow: visible; flex: none; } body.phone .cc-phone-list .cc-card { overflow: visible; min-height: 0; } body.phone .cc-phone-list .cc-row { min-width: 0; } }   /* NEW · the chat list scrolls with the page, no inner scrollbars */
/* NEW · phone conversation: header, back + name and the message box stay put; only the messages scroll (Dan, 2026-11-20) */
@media (max-width: 860px) {
  body.phone #chat:not(.cc-phone-list) { height: 100vh; height: 100dvh; min-height: 0; max-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.phone #chat:not(.cc-phone-list) > .phead { flex: none; }
  body.phone #chat:not(.cc-phone-list) > .ch-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.phone #chat:not(.cc-phone-list) .ch-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  body.phone #chat:not(.cc-phone-list) .ch-filter, body.phone #chat:not(.cc-phone-list) .ch-comp { flex: none; }
  body.phone #chat:not(.cc-phone-list) .ch-list { flex: 1; min-height: 0; overflow-y: auto; }
}
/* NEW · phone Notifications: the address boxes take the full row width, smaller text (Dan, 2026-11-20) */
@media (max-width: 860px) {
  body.phone .setrow.em-addr { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  body.phone .setrow.em-addr .set-ctl { width: 100%; justify-content: stretch; }
  body.phone .em-in { flex: 1; width: auto; min-width: 0; font-size: 12px; }
}
@media (max-width: 860px) { body.phone .setrow.em-addr .set-ctl input.input.em-in { font-size: 12px; } }   /* NEW: beats phone.css's 15px input size */
/* NEW · Sending card: every row the same height, label and control centred (Dan, 2026-11-20) */
.setrow.em-addr, .cset-one > .setcard:first-child > .setrow { min-height: 52px; padding-top: 8px; padding-bottom: 8px; box-sizing: border-box; align-items: center; }
@media (max-width: 860px) {
  body.phone .cset-one > .setcard:first-child > .setrow { min-height: 82px; padding-top: 10px; padding-bottom: 10px; align-content: center; }   /* NEW */
}
.setrow.em-addr .em-in { height: 30px; width: 300px; box-sizing: border-box; font-size: 12.5px; }   /* NEW · computer: taller, wider address boxes to suit the even rows */
/* NEW · phone: every dialog (forms, confirmations) is centred on the screen, not the page, and scrolls inside itself if tall (Dan, 2026-11-20) */
@media (max-width: 860px) {
  body.phone .scrim { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; z-index: 50; }
  body.phone .scrim > .modal { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; margin: 0; }
}


/* The invoice page (step 6, the client's side; 2026-11-20): the owners' strip, the dispute line, and the print layout behind
   "Print or save as PDF": the invoice alone on a white page, no rail, no buttons. */
.inv-strip { margin: 12px 18px 0; }
.inv-dispute { line-height: 1.5; }
.inv-print-head { display: none; }
@media (max-width: 860px) { .inv-strip { margin: 10px 10px 0; } }
@media (max-width: 860px) { .home-ended .h-bill { order: 2; } .home-ended .h-msgs { order: 3; } .home-ended .h-today { order: 4; } }   /* a past client reads the bill right under the profit */
@media print {
  body.inv-page, html:has(body.inv-page) { height: auto; overflow: visible; background: #fff; }
  body.inv-page .canvas, body.inv-page .frame, body.inv-page .grid, body.inv-page .content, body.inv-page .system { display: block; height: auto; overflow: visible; background: #fff; }
  body.inv-page .rail, body.inv-page .tt-banner, body.inv-page .page-head, body.inv-page .phead, body.inv-page .ebtns, body.inv-page .inv-strip, body.inv-page .state-error { display: none !important; }
  body.inv-page .inv-print-head { display: block; font-size: 15px; padding: 0 0 10px; }
  body.inv-page .inv { display: block; padding: 0; }
  body.inv-page .inv .card { margin: 0 0 12px; break-inside: avoid; box-shadow: none; }
  body.inv-page .tbl-inv th:nth-child(3), body.inv-page .tbl-inv td:nth-child(3) { display: table-cell; }
}

/* A client's conversation, on the client's Messages and on the owners' Chat > Clients (Dan, 2026-11-20): the repeating logo of
   design "2a" (website/Repeating Logo background.zip): the rail's dark colour, the white emblem at 9% every 188 x 156 px (twice the design's size: Dan, 2026-11-20), the grid
   tilted -12 degrees. The pattern sits on a wrapper behind the list, so it stays put while the messages scroll. The Locked chat
   keeps its diagonal stripes. */
.ch-is-clients .ch-ground { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; isolation: isolate; background-color: var(--rail); }
.ch-is-clients .ch-ground::before { content: ''; position: absolute; inset: -50%; background: url(../chat-emblem-tile.png) 0 0 / 188px 156px repeat; transform: rotate(-12deg); pointer-events: none; z-index: -1; }
.ch-is-clients .ch-ground .ch-list { background: transparent; }
.ch-is-clients .ch-ground .state-empty { color: rgba(255, 255, 255, .78); }
.ch-ground { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-is-clients .ch-ground .ch-row.mine .ch-box { border-color: rgba(255, 255, 255, .6); }   /* their own message keeps an edge on the dark ground */
@media (max-width: 860px) { body.phone .ch-is-clients:not(.cc-phone-list), body.phone .ch-is-clients:not(.cc-phone-list) .ch-card { background: var(--rail); } }   /* on a phone the ground runs down to the writing box */

/* The plain pages (sign in, sign up, the terms, reset) in a short or zoomed-in window (Caden, 2026-11-20: on the terms page the
   logo was cut off at the top and the Agree button could not be reached). The page is one screen high and never scrolled, so a
   card taller than the window was clipped at both ends. Now the page scrolls, and the card is centred by its own margins, which
   stop at the top edge instead of pushing the card above it. */
body.plain { overflow-y: auto; align-items: flex-start; padding: 16px 0; box-sizing: border-box; }
body.plain > .plain-card { margin: auto; flex: none; }

/* The walkthrough fixes (Dan and Caden, 2026-11-21) */
/* a window's grey shade is fixed to the screen, so it no longer slides up when the page behind it is scrolled */
.scrim { position: fixed; inset: 0; z-index: 60; }
/* the client sheet: History runs down to the bottom of the screen and scrolls inside itself */
@media (min-width: 861px) {
  .system > .cs { flex: 1 0 auto; grid-template-rows: auto auto minmax(260px, 1fr); }
  .cs > .cs-col:last-child > .ecard { flex: 1 1 0; min-height: 0; }
  .cs > .cs-col:last-child .chist-scroll { flex: 1 1 0; min-height: 120px; max-height: none; }
}
/* Settings > Notifications, "Sent from": only the part before the @ is typed; the site's domain stands beside the box */
.setrow.em-addr .em-in.em-name { width: 150px; text-align: right; }
.em-dom { font-size: 12.5px; color: var(--muted); margin: 0 6px 0 -2px; white-space: nowrap; }
@media (max-width: 860px) { body.phone .em-dom { font-size: 12px; } }
/* phone, Open and Locked chat: the writing box is the last row of the screen-high column, not a layer fixed over it, so the list
   runs right down to it (the 8px left under the list showed as a white strip on the Locked chat's paper ground) */
@media (max-width: 860px) {
  body.phone #chat:not(.cc-phone-list) .ch-comp.pfoot { position: static; }
  body.phone #chat:not(.cc-phone-list) .ch-card { padding-bottom: 0 !important; }
}
/* the client sheet's outer box takes the rest of the screen under the page head, so History has a bottom to reach (2026-11-21) */
@media (min-width: 861px) { .content > .cs-page { flex: 1 0 auto; display: flex; flex-direction: column; } .cs-page > .system { flex: 1 0 auto; overflow: visible; } }
