/* Tipout: the tip pool. This sheet is the whole look of the product.
   kit.css still loads first for the shared patterns (dialog, the File menu, toast, tables, print);
   everything it draws is restyled here. Nothing is fetched from anywhere: the type ships in fonts/. */

@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/Geist-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Geist"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("fonts/Geist-Variable-Italic.woff2") format("woff2");
}

/* ---------- tokens ----------
   Made for the end of the night: near-black, a soft warm white, and one accent (amber) that marks
   the thing to press and the tick that says it adds up. Red is kept for mistakes and always comes with words.
   The dark set is the first design; the light set is its own, for a bright office the morning after. */
:root {
  --paper: #F5F2EA;
  --card: #FDFBF6;
  --field: #FFFDF9;
  --sunk: #EBE7DC;
  --ink: #16140F;
  --ink-2: #3A362E;
  --muted: #5F594E;
  --rule: #E0DBCE;
  --rule-2: #CBC5B6;
  --edge: #857F73;
  --accent: #855000;
  --fill: #16140F;          /* the one filled button, and a ticked box */
  --fill-hover: #3A362E;
  --on-fill: #F5F2EA;
  --over: #A32A1B;
  --toast-err: #FF9E8C;     /* the error edge on the toast, which is drawn in the opposite tone */
  --good: #855000;
  --mark: #855000;
  --focus: var(--accent);
  --shadow: 0 .75rem 2.5rem rgba(40, 30, 10, .16);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  --radius: 10px;
  --radius-2: 14px;
  --tap: 3rem;              /* 48px: the job is done on a phone */
  --wrap: 80rem;
  --measure: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E0D0B; --card: #181613; --field: #14120F; --sunk: #211E1A; --ink: #F2EDE2; --ink-2: #CFC8BA; --muted: #A09A8D;
    --rule: #27241F; --rule-2: #3B3730; --edge: #757065; --accent: #EFB45E; --fill: #EFB45E; --fill-hover: #F6C883; --on-fill: #181204; --over: #FF9E8C; --good: #EFB45E; --mark: #EFB45E; --toast-err: #A32A1B;
    --shadow: 0 .75rem 2.5rem rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E0D0B; --card: #181613; --field: #14120F; --sunk: #211E1A; --ink: #F2EDE2; --ink-2: #CFC8BA; --muted: #A09A8D;
  --rule: #27241F; --rule-2: #3B3730; --edge: #757065; --accent: #EFB45E; --fill: #EFB45E; --fill-hover: #F6C883; --on-fill: #181204; --over: #FF9E8C; --good: #EFB45E; --mark: #EFB45E; --toast-err: #A32A1B;
  --shadow: 0 .75rem 2.5rem rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (min-width: 64rem) and (pointer: fine) { :root { --tap: 2.75rem; } }

/* ---------- base ---------- */
body {
  font-family: var(--sans); font-size: 1rem; line-height: 1.5; letter-spacing: -.005em;
  font-variant-numeric: lining-nums; font-optical-sizing: auto; text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.015em; }
a:hover { text-decoration-color: currentColor; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
/* Tabular figures wherever a number sits. */
.num, .fig, .pool-fig, .pool-sub, .stats dd, .signal, .line .amt, .pline strong, .pline small, .who-meta, .roles-sum, .pct-total, .cash-lede, .bill, .ledger td, .ledger tfoot th,
.insight, .shift-meta, .shift-pool, .field-msg, .fee-kept, .howto .worked, .input.num {
  font-family: inherit; font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1;
}
.skip { font-family: inherit; font-size: .875rem; font-weight: 500; border-radius: var(--radius); }

/* ---------- top bar ---------- */
.strip { flex-wrap: nowrap; gap: 1rem; padding: .625rem 0 .375rem; border-bottom: 0; }
.brand { display: flex; align-items: center; gap: .625rem; min-width: 0; min-height: var(--tap); }
.brand h1 { font-size: 1.1875rem; font-weight: 650; line-height: 1; letter-spacing: -.03em; }
.mark { display: block; }
.mark-a { stroke: var(--ink); }
.mark-b { stroke: var(--accent); }
.tagline { display: none; margin-left: .375rem; padding-left: 1rem; border-left: 1px solid var(--rule-2); font-size: .875rem; line-height: 1.25rem; color: var(--muted); white-space: nowrap; }
@media (min-width: 62rem) { .tagline { display: block; } }
.actions { flex-wrap: nowrap; gap: 0 .125rem; margin: 0 -.625rem 0 0; }
@media (min-width: 40rem) { .actions { flex-wrap: wrap; justify-content: flex-end; } }

/* ---------- views: two halves of one switch ---------- */
.views {
  display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; margin: .5rem 0 1.25rem; padding: .25rem; overflow: visible;
  background: var(--sunk); border: 0; border-radius: 999px;
}
.view-tab {
  min-height: 2.75rem; margin: 0; padding: 0 1.5rem; border: 0; border-radius: 999px;
  font-family: inherit; font-size: .9375rem; font-weight: 500; color: var(--ink-2);
}
.view-tab:first-child { padding-left: 1.5rem; }
.view-tab:hover { color: var(--ink); }
.view-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); font-weight: 550; }
.view-tab:focus-visible { outline-offset: 2px; border-radius: 999px; }
@media (min-width: 40rem) { .views { display: inline-grid; margin-bottom: 1.75rem; } .view-tab { min-width: 8.5rem; } }
@media (max-width: 30rem) { .view-tab { padding: 0 1rem; font-size: .9375rem; } }

/* ---------- buttons ---------- */
.btn {
  gap: .45rem; padding: .375rem 1rem; font-family: inherit; font-size: .9375rem; font-weight: 500; letter-spacing: -.003em;
  border-color: var(--edge); border-radius: var(--radius);
}
.btn:hover { background: var(--sunk); border-color: var(--ink-2); }
.btn:active { background: var(--rule-2); }
.btn.primary { background: var(--fill); color: var(--on-fill); border-color: var(--fill); font-weight: 600; }
.btn.primary:hover { background: var(--fill-hover); border-color: var(--fill-hover); }
.btn.quiet { border-color: transparent; color: var(--ink-2); font-weight: 500; padding-left: .75rem; padding-right: .75rem; }
.btn.quiet:hover { border-color: transparent; color: var(--ink); background: var(--sunk); }
.btn.danger { color: var(--over); }
.btn.danger.primary { background: var(--over); border-color: var(--over); color: var(--paper); }
.btn.danger.primary:hover { background: color-mix(in srgb, var(--over) 86%, var(--ink)); border-color: transparent; }
.btn.add { border: 0; margin-left: -.75rem; padding-left: .75rem; padding-right: .875rem; color: var(--ink-2); }
.btn.add:hover { color: var(--ink); background: var(--sunk); }

/* ---------- form controls ---------- */
.label, .field > label { font-family: inherit; font-size: .8125rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.hint { font-family: inherit; font-size: .8125rem; line-height: 1.5; color: var(--muted); }
.input {
  padding: 0 .75rem; font-family: inherit; font-size: 1.0625rem; letter-spacing: -.005em;
  background: var(--field); border: 1px solid var(--edge); border-radius: var(--radius);
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--ink-2); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
select.input {
  padding-right: 1.75rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - .95rem) 52%, calc(100% - .65rem) 52%; background-size: .3rem .3rem;
}
.affix > .pre, .affix > .suf { font-family: inherit; font-size: .9375rem; color: var(--muted); }
.affix > .pre { left: .75rem; }
.affix > .suf { right: .75rem; }
.affix.has-pre > .input { padding-left: 1.6rem; }
.affix.has-suf > .input { padding-right: 1.75rem; }
.field-msg { font-family: inherit; font-size: .8125rem; line-height: 1.45; color: var(--ink-2); }
.field-msg.is-error { color: var(--over); font-weight: 500; }
.field-msg.is-error::before { width: .375rem; height: .375rem; margin-right: .4rem; vertical-align: .08em; }
input[type="date"].input { min-width: 0; }
/* Date and shift sit under the two big tip boxes: same corners, a touch taller and firmer, so the four read as one set. */
.f-date .input, .f-shift .input { height: 3rem; font-size: 1.0625rem; font-weight: 500; border-radius: 12px; }

/* Tick boxes: a square that fills, with a tick drawn in it. */
.check {
  display: inline-flex; align-items: center; gap: .625rem; min-height: var(--tap); padding-right: .25rem;
  font-size: .9375rem; line-height: 1.25; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.check input {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 1.375rem; height: 1.375rem; margin: 0;
  background: var(--field); border: 1.5px solid var(--edge); border-radius: 6px; cursor: pointer;
}
.check input:hover { border-color: var(--ink-2); }
.check input:checked { background: var(--fill); border-color: var(--fill); }
.check input:checked::after {
  content: ""; position: absolute; left: 50%; top: 46%; width: .4rem; height: .7rem; border: solid var(--on-fill); border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.check.big { font-size: 1rem; font-weight: 500; color: var(--ink); }

/* ---------- notices ---------- */
.notice {
  gap: .25rem 1rem; margin: .25rem 0 .75rem; padding: .5rem .5rem .5rem 1rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-2);
  font-size: .9375rem; color: var(--ink-2);
}
.notice p { padding: .3rem 0; }
.notice .notice-actions { gap: .375rem; }
.notice .btn { min-height: 2.75rem; padding-left: .75rem; padding-right: .75rem; font-size: .875rem; }
.notice.is-error { border-color: var(--over); }
.notice.toast {
  max-width: 38rem; padding: .5rem .5rem .5rem 1.125rem; background: var(--ink); color: var(--paper); border: 0; border-radius: var(--radius-2); box-shadow: var(--shadow);
}
.notice.toast.is-error { box-shadow: inset 0 0 0 2px var(--toast-err), var(--shadow); }
.notice.toast .btn { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 55%, transparent); }
.notice.toast .btn.quiet { border-color: transparent; color: color-mix(in srgb, var(--paper) 84%, var(--ink)); }
.notice.toast .btn:hover { background: color-mix(in srgb, var(--paper) 14%, transparent); color: var(--paper); }
.notice.toast :focus-visible { outline-color: var(--paper); }

/* ---------- Tonight: the frame ----------
   One column on a phone, in the order the night goes: what came in, how it's shared, who worked, the check, the cash.
   With room, what came in stays put on the left while the crew scrolls on the right. */
.tonight { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.25rem; padding-bottom: 3rem; }
.setup, .work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.25rem; min-width: 0; align-content: start; }
@media (min-width: 64rem) {
  .tonight { grid-template-columns: 23rem minmax(0, 1fr); gap: 0 4.5rem; align-items: start; }
  .setup { position: sticky; top: 1.5rem; }
}
.block { min-width: 0; }
.block-h { padding: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; color: var(--ink); }
.block > .block-h, .method > .block-h, .tally > .block-h { margin-bottom: .875rem; }

/* ---------- the pool: the figure the night comes down to ---------- */
.pool { min-width: 0; margin-bottom: -.75rem; }
.pool-label { font-size: .9375rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.pool-fig {
  margin-top: .125rem; font-size: clamp(3rem, 15.5vw, 4.25rem); font-weight: 560; line-height: 1.05; letter-spacing: -.045em; white-space: nowrap; color: var(--ink);
}
.pool-fig[data-long] { font-size: clamp(2.25rem, 11.5vw, 4.25rem); }
.pool-fig .cur { margin-right: .04em; font-weight: 400; color: var(--muted); }
.pool-sub { margin-top: .5rem; font-size: .875rem; line-height: 1.4; color: var(--muted); }

/* ---------- tips in ---------- */
.tips-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem .75rem; }
.field.big .input { height: 3.75rem; font-size: 1.625rem; font-weight: 550; letter-spacing: -.025em; border-radius: 12px; }
.field.big .affix > .pre { left: .875rem; font-size: 1.125rem; }
.field.big .affix.has-pre > .input { padding-left: 1.75rem; padding-right: .875rem; }
.fee { grid-column: 1 / -1; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .3rem 1rem; align-items: center; }
.fee .f-fee { display: contents; }
.fee .f-fee > label, .fee > .field-msg, .fee > .hint { grid-column: 1 / -1; }
.fee > .hint { margin-top: .3rem; }
.fee-kept { margin: 0; line-height: 1.25; }
.fee-kept dt { font-size: .75rem; color: var(--muted); }
.fee-kept dd { margin-top: .1rem; font-size: 1.0625rem; font-weight: 600; text-align: left; color: var(--ink); }

/* ---------- how it's shared: one switch, three ways, and a line that says what the chosen one does ---------- */
.method { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; padding: .25rem; background: var(--sunk); border-radius: var(--radius-2); }
.seg label { display: contents; }
.seg input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.seg .t {
  grid-row: 1; display: flex; align-items: center; justify-content: center; min-height: 3rem; padding: .375rem .5rem; border-radius: 10px;
  font-size: .875rem; font-weight: 500; line-height: 1.2; text-align: center; text-wrap: balance; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.seg label:nth-child(1) .t { grid-column: 1; }
.seg label:nth-child(2) .t { grid-column: 2; }
.seg label:nth-child(3) .t { grid-column: 3; }
.seg .t:hover { color: var(--ink); }
.seg input:checked + .t { background: var(--ink); color: var(--paper); font-weight: 550; }
.seg input:focus-visible + .t { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg .d { display: none; grid-row: 2; grid-column: 1 / -1; padding: .5rem .625rem .5rem; font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
.seg input:checked ~ .d { display: block; }
.method-note { margin-top: .625rem; max-width: 40rem; }

/* ---------- who worked ----------
   A list, not a table. Narrow: each line is the name, the hours and the tips, and the name opens the rest.
   Wide: every box sits in one row under a header. Every input keeps its own label either way. */
.people-block { container-type: inline-size; container-name: lines; }
.lines-head, .pline { display: grid; column-gap: .625rem; grid-template-columns: minmax(0, 1fr) 5rem minmax(5.75rem, auto); }
.lines-head { padding: 0 0 .5rem; align-items: end; font-size: .75rem; font-weight: 500; line-height: 1.3; color: var(--muted); }
.lines-head span:nth-child(2), .lines-head span:nth-child(4), .lines-head span:nth-child(5), .lines-head span:nth-child(7) { display: none; }
.lines-head span:nth-child(3) { text-align: right; padding-right: .75rem; }
.h-out { text-align: right; }
.line { border-top: 1px solid var(--rule); }
.line:first-child { border-top-color: var(--rule-2); }
.pline {
  grid-template-areas: "who hours amt" "who sub sub" "name name name" "role role extra" "mgr mgr x" "msg msg msg";
  grid-template-rows: auto auto; align-items: center; padding: .625rem 0 .75rem;
}
.m-hours .pline { grid-template-areas: "who hours amt" "who sub sub" "name name name" "role role role" "mgr mgr x" "msg msg msg"; }
.pline .c-who { grid-area: who; display: grid; grid-template-rows: subgrid; align-self: stretch; min-width: 0; }
.who-btn {
  grid-row: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: subgrid; column-gap: .5rem; align-items: center;
  min-width: 0; margin: 0 0 0 -.25rem; padding: 0 0 0 .25rem; background: none; border: 0; border-radius: 8px; color: inherit; font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.who-btn svg { grid-column: 1; grid-row: 1; color: var(--muted); transform: rotate(-90deg); }
.who-btn[aria-expanded="true"] svg { transform: none; }
@media (prefers-reduced-motion: no-preference) { .who-btn svg { transition: transform .15s; } }
.who-name { grid-column: 2; grid-row: 1; font-size: 1.0625rem; font-weight: 550; line-height: 1.25; letter-spacing: -.012em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-meta { grid-column: 2; grid-row: 2; align-self: start; font-size: .8125rem; line-height: 1.4; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-btn:hover .who-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.pline .c-hours { grid-area: hours; }
.pline .c-hours > label, .pline .c-out > .label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.pline .c-hours { gap: 0; }
.pline .c-hours .input { height: 2.75rem; font-weight: 500; }
.pline .c-out, .pline .c-out .amt { display: contents; }
.pline strong { grid-area: amt; justify-self: end; font-size: 1.25rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); }
.pline small { grid-area: sub; justify-self: end; align-self: start; font-size: .8125rem; line-height: 1.4; white-space: nowrap; color: var(--muted); }
.pline.is-out strong { font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.pline.is-none strong { font-weight: 400; color: var(--muted); }
.pline.is-out .c-hours .input { color: var(--muted); }
.pline .c-name { grid-area: name; }
.pline .c-role { grid-area: role; }
.pline .c-extra { grid-area: extra; }
.pline .c-extra .input { width: 0; min-width: 100%; }   /* so a wide box can't push the tips column out */
.pline .c-mgr { grid-area: mgr; }
.pline .c-x { grid-area: x; justify-self: end; }
.pline .c-x .btn { color: var(--muted); }
.pline .c-x .btn:hover { color: var(--over); }
.pline .c-msg { grid-area: msg; margin-top: .5rem; }
.pline .c-msg:empty { display: none; }
.pline .c-name, .pline .c-role, .pline .c-extra { margin-top: .75rem; }
.pline .c-mgr, .pline .c-x { margin-top: .375rem; }
.pline:not(.is-open) > .c-name, .pline:not(.is-open) > .c-role, .pline:not(.is-open) > .c-extra, .pline:not(.is-open) > .c-mgr, .pline:not(.is-open) > .c-x { display: none; }
@container lines (max-width: 20.5rem) { .pline small .sh { display: none; } }
.lines-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; padding: .375rem 0 0; border-top: 1px solid var(--rule); }
.pct-total { font-size: .9375rem; font-weight: 500; }
.pct-total.is-ok { color: var(--good); }
.pct-total.is-ok::before { content: ""; display: inline-block; width: .35rem; height: .65rem; margin: 0 .5rem .1rem .15rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pct-total.is-off { color: var(--over); }
.keys-hint { margin-top: .75rem; max-width: 40rem; }

@container lines (min-width: 47rem) {   /* the wide row needs 40rem of columns + the remove button + six gaps */
  .compact-only { display: none; }
  .lines-head, .pline {
    grid-template-columns: minmax(8rem, 1.3fr) minmax(7rem, 1fr) 5rem 5.5rem 5rem 9.5rem var(--tap);
    grid-template-areas: "name role hours extra mgr out x" "msg msg msg msg msg msg msg";
  }
  .m-hours .lines-head, .m-hours .pline {
    grid-template-columns: minmax(8rem, 1.3fr) minmax(7rem, 1fr) 5rem 5rem 9.5rem var(--tap);
    grid-template-areas: "name role hours mgr out x" "msg msg msg msg msg msg";
  }
  .lines-head span:nth-child(n) { display: block; }
  .lines-head span:nth-child(3) { padding-right: 0; text-align: left; }
  .lines-head span:nth-child(5) { text-align: center; }
  .m-hours .h-extra { display: none !important; }
  .pline { grid-template-rows: auto; align-items: center; padding: .5rem 0; }
  .pline .c-who { display: none; }
  .pline:not(.is-open) > .c-name, .pline:not(.is-open) > .c-role, .pline:not(.is-open) > .c-extra { display: grid; }
  .pline:not(.is-open) > .c-mgr, .pline:not(.is-open) > .c-x { display: block; }
  .pline .c-name, .pline .c-role, .pline .c-extra, .pline .c-mgr, .pline .c-x { margin-top: 0; }
  .pline > .field > label, .pline .check > span {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .pline > .field { gap: 0; }
  .pline .c-mgr { justify-self: center; }
  .pline .c-mgr .check { gap: 0; padding: 0; justify-content: center; min-width: var(--tap); }
  .pline .c-out { grid-area: out; display: block; text-align: right; }
  .pline .c-out .amt { display: block; }
  .pline strong { display: block; font-size: 1.125rem; }
  .pline small { display: block; margin-top: .1rem; font-size: .75rem; }
  .pline.is-out small { display: none; }
  .pline .c-msg { margin-top: .25rem; margin-bottom: .25rem; }
}

/* ---------- roles and points ---------- */
.roles { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: -.75rem; }
.roles > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .75rem; min-height: 3.5rem; padding: .625rem 0; cursor: pointer; list-style: none; border-radius: 6px; }
.roles > summary::-webkit-details-marker { display: none; }
.roles > summary::before { content: ""; width: .4375rem; height: .4375rem; flex: none; margin: 0 .25rem 0 .2rem; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
.roles[open] > summary::before { transform: rotate(45deg); }
.roles-t { font-size: 1rem; font-weight: 600; letter-spacing: -.012em; }
.roles-sum { flex: 1 1 12rem; font-size: .8125rem; color: var(--muted); }
.roles[open] .roles-sum { visibility: hidden; }
.roles-body { padding: 0 0 1.25rem; max-width: 30rem; }
.role-list { margin: .75rem 0 .25rem; }
.rrow { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem var(--tap); gap: .5rem; padding: .3rem 0; align-items: end; }
.rrow:not(:first-child) .field > label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.rrow .c-x .btn { color: var(--muted); }
.rrow .c-x .btn:hover { color: var(--over); }

/* ---------- the split: four figures, one line that says whether it adds up, and the two things to do next ---------- */
.tally { min-width: 0; }
.stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem 1rem; margin-top: 0; }
.stats > div { display: block; padding: 0; border: 0; }
/* Seven-figure amounts ("$1,234,567.89") are wider than a half-width column on a 320px phone in Safari: shrink them to fit, only below 400px. */
.stats dd[data-long], .stats .strong dd[data-long] { font-size: min(1.5rem, 6vw); }
.stats dt { font-size: .8125rem; line-height: 1.3; color: var(--muted); }
.stats dd, .stats .strong dd { margin-top: .2rem; font-family: inherit; font-size: 1.5rem; font-weight: 560; line-height: 1.15; letter-spacing: -.03em; text-align: left; color: var(--ink); }
@media (min-width: 40rem) { .stats { grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: 1rem 3rem; } }
.signal { gap: .75rem; margin-top: 1.5rem; padding: .875rem 1rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-2); font-size: .9375rem; line-height: 1.45; color: var(--ink); }
.signal svg { margin-top: .15rem; }
.signal.good { background: var(--card); border-color: var(--rule); }
.signal.good svg { color: var(--good); }
.signal.over { background: var(--card); border-color: var(--over); }
.signal.over svg { color: var(--over); }
.signal.idle { color: var(--ink-2); }
.side-actions { display: grid; gap: .625rem; margin-top: 1.25rem; }
.side-actions .btn { min-height: 3.25rem; font-size: 1rem; }
.side-actions .hint { margin-top: .125rem; max-width: 38rem; }
@media (min-width: 40rem) {
  .side-actions { grid-template-columns: auto auto; justify-content: start; }
  .side-actions .btn { min-height: var(--tap); font-size: .9375rem; padding-left: 1.25rem; padding-right: 1.25rem; }
  .side-actions .hint { grid-column: 1 / -1; }
}

/* ---------- cash payout ---------- */
.cash { padding-top: 1.5rem; border-top: 1px solid var(--rule); min-width: 0; }
.cash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .125rem 1.5rem; }
.cash-lede { margin-top: .5rem; max-width: 40rem; font-size: .9375rem; color: var(--ink-2); }
.bills-have { border: 0; padding: 0; margin: 1.25rem 0 0; min-width: 0; }
.bills-have legend { padding: 0; margin-bottom: .5rem; }
.bills-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .625rem; }
.bills-row .check { min-height: 2.75rem; gap: .5rem; padding: 0 .875rem 0 .625rem; border: 1px solid var(--edge); border-radius: 999px; font-size: .9375rem; font-weight: 500; color: var(--ink-2); }
.bills-row .check:has(input:checked) { border-color: var(--ink); color: var(--ink); }
.bills-row .check input { width: 1.25rem; height: 1.25rem; border-radius: 50%; }
.bills-row .check:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.bills-row .check input:focus-visible { outline: none; }
.envs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .625rem; margin-top: 1.5rem; }
.env { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; align-content: start; gap: .625rem 1rem; padding: .875rem 1rem 1rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-2); }
.env .who { min-width: 0; font-size: 1rem; font-weight: 550; line-height: 1.3; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env .amt { font-size: 1.25rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.bills { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .375rem; }
.bill { padding: .2rem .5rem; font-size: .875rem; line-height: 1.4; color: var(--ink-2); background: var(--sunk); border-radius: 6px; white-space: nowrap; }
.bill b { font-weight: 600; color: var(--ink); }
.safe { margin-top: 2rem; max-width: 26rem; }
.safe h3 { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }

/* ---------- tables ---------- */
.table-wrap { border-radius: 0; }
.ledger { font-size: .9375rem; }
.ledger th, .ledger td { padding: .7rem .75rem; border-bottom: 1px solid var(--rule); }
.ledger thead th { font-family: inherit; font-size: .75rem; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--rule-2); }
.ledger tbody th { font-weight: 500; text-align: left; }
.ledger tfoot th, .ledger tfoot td { border-top: 1px solid var(--ink); font-weight: 600; }

/* ---------- the log ---------- */
.sec-head { margin-bottom: 1.5rem; }
.sec-head h2 { font-size: clamp(1.5rem, 5vw, 1.75rem); line-height: 1.15; letter-spacing: -.03em; }
.sec-head p { max-width: 40rem; margin-top: .5rem; font-size: .9375rem; color: var(--ink-2); }
.range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; margin-bottom: 1.75rem; }
.range-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1 1 100%; gap: .25rem; padding: .25rem; background: var(--sunk); border-radius: var(--radius-2); }
.range-quick .btn { min-height: 2.75rem; padding: 0 .75rem; border-color: transparent; color: var(--ink-2); white-space: nowrap; }
.range-quick .btn:hover { background: none; color: var(--ink); }
.range-quick .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 550; }
@media (min-width: 40rem) { .range-quick { flex: 0 0 auto; } .range-quick .btn { padding: 0 1.125rem; } }
.range-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; flex: 1 1 17rem; max-width: 23rem; }
.week-start { width: 9rem; }
.range-msg { flex: 1 1 100%; }
.insight { max-width: 40rem; margin-bottom: 1.75rem; font-size: 1.1875rem; font-weight: 500; line-height: 1.4; letter-spacing: -.015em; color: var(--ink); }
.insight:empty { display: none; }
.empty { max-width: 38rem; padding: 1.25rem; margin-bottom: 2.5rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-2); color: var(--ink-2); }
.empty-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
#log-body { padding-bottom: 3rem; }
#totals-table { max-width: 46rem; }
#totals-table tbody th { font-size: 1rem; }
#totals-table strong { font-weight: 600; }
.log-hint { margin-top: 1rem; max-width: var(--measure); }
.log-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.shifts-h { margin: 2.75rem 0 .875rem; }
.shifts { max-width: 46rem; }
.shift { padding: 1rem 0 1.125rem; border-top: 1px solid var(--rule); }
.shift:first-child { border-top-color: var(--rule-2); }
.shift-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.shift-top h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.shift-meta { margin-top: .15rem; font-size: .8125rem; color: var(--muted); }
.shift-pool { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.shift details { margin-top: .25rem; }
.shift summary { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--tap); font-size: .9375rem; color: var(--ink-2); cursor: pointer; list-style: none; border-radius: 6px; }
.shift summary::-webkit-details-marker { display: none; }
.shift summary::before { content: ""; width: .4rem; height: .4rem; flex: none; margin: 0 .25rem 0 .15rem; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
.shift details[open] > summary::before { transform: rotate(45deg); }
.shift-table { margin-bottom: .625rem; }
.shift-table th, .shift-table td { padding-top: .5rem; padding-bottom: .5rem; }
.shift-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .375rem; }
@media (max-width: 30rem) { .shift-table .col-role { display: none; } }
/* Totals on a phone: the name and the money on one line, the rest in a quiet line under it. */
@media (max-width: 43.99rem) {
  #totals-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  #totals-table, #totals-table tbody, #totals-table tfoot { display: block; }
  #totals-table tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: .9rem; row-gap: .15rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
  #totals-table tbody tr:first-child { border-top: 1px solid var(--rule-2); }
  #totals-table tfoot tr { border-bottom: 0; border-top: 1px solid var(--ink); margin-top: -1px; }
  #totals-table th, #totals-table td { display: block; padding: 0; border: 0; }
  #totals-table th { grid-column: 1 / span 3; grid-row: 1; font-size: 1.0625rem; font-weight: 550; text-align: left; }
  #totals-table .t-tips { grid-column: 4; grid-row: 1; font-size: 1.1875rem; letter-spacing: -.02em; }
  #totals-table .t-meta { grid-row: 2; text-align: left; font-size: .8125rem; font-weight: 400; color: var(--muted); }
  #totals-table .t-meta::after { content: " " attr(data-unit); }
  #totals-table .t-hr { grid-column: 3 / span 2; }
}

/* ---------- how this is worked out ---------- */
.howto { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.howto > summary { gap: .625rem; min-height: 3.5rem; padding: .75rem 0; font-size: 1rem; font-weight: 600; letter-spacing: -.012em; border-radius: 6px; }
.howto > summary::before { width: .4375rem; height: .4375rem; margin: 0 .25rem 0 .2rem; border-color: var(--muted); }
.howto .howto-body { max-width: var(--measure); padding: .25rem 0 2.25rem; font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }
.howto h3 { font-size: 1rem; font-weight: 600; color: var(--ink); margin-top: 1.75rem; }
.howto .worked { padding: 1rem 1.125rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-2); font-size: .9375rem; }
.howto .worked .fig { font-weight: 500; color: var(--ink); }
.howto strong { font-weight: 600; color: var(--ink); }

/* ---------- custom version ---------- */
.custom { margin-top: 3rem; padding: 1.75rem 1.25rem 1.5rem; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; }
.custom-kicker { gap: 0; font-size: .8125rem; font-weight: 500; font-style: normal; color: var(--accent); }
.custom-kicker::before { content: none; }
.custom h2 { margin-top: .375rem; font-size: clamp(1.5rem, 5vw, 1.75rem); line-height: 1.15; font-weight: 600; letter-spacing: -.03em; }
.custom-lede { margin-top: .75rem; max-width: var(--measure); font-size: .9375rem; color: var(--ink-2); }
.custom-list { column-gap: 2.5rem; margin-top: 1.5rem; border-bottom: 1px solid var(--rule); font-size: .875rem; line-height: 1.5; color: var(--ink-2); }
.custom-list li { padding: .8rem 0; border-top: 1px solid var(--rule); }
.custom-list li:first-child, .custom-list li:nth-child(2) { border-top-color: var(--rule); }
.custom-list strong { display: block; font-weight: 600; color: var(--ink); }
.custom-cta { align-items: center; gap: .625rem 1rem; margin-top: 1.25rem; }
.custom-cta a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: .5rem 1.125rem; font-size: .9375rem; font-weight: 550; text-decoration: none;
  color: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius);
}
.custom-cta a:hover { background: var(--ink); color: var(--paper); }
.custom-cta span { font-style: normal; font-size: .875rem; color: var(--muted); }
@media (min-width: 48rem) { .custom { padding: 2.25rem 2.25rem 2rem; } }
@media (min-width: 68rem) {
  .custom { grid-template-columns: 20rem minmax(0, 1fr); column-gap: 4rem; padding: 2.5rem 2.5rem 2.25rem; }
  .custom-list { margin-top: 0; }
  .custom-cta { margin-top: 1.5rem; }
  .custom-cta span { margin-top: .625rem; }
}

/* ---------- foot: what it is, what stays on the device, and who made it ---------- */
.foot { display: block; margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 0; font-size: .8125rem; line-height: 1.55; color: var(--muted); }
.foot .about { display: grid; gap: .5rem; max-width: 44rem; }
.foot .privacy { margin: 0; padding: 0; max-width: none; border: 0; font-size: inherit; font-style: normal; color: inherit; }
.foot .by { margin-top: 1.75rem; font-style: normal; color: var(--muted); }
.foot a { display: inline; min-height: 0; }

/* ---------- dialog ---------- */
.dialog { width: min(27rem, calc(100vw - 2rem)); padding: 1.5rem; background: var(--card); border: 1px solid var(--rule-2); border-radius: 18px; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(8, 7, 6, .6); }
.dialog h2 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -.02em; }
.dialog p { margin-top: .5rem; font-size: .9375rem; color: var(--ink-2); }
.dialog .dialog-actions { margin-top: 1.5rem; }

/* ---------- the File menu on a phone ---------- */
@media (max-width: 39.99rem) {
  .actions:has(.more[data-ready]) { gap: 0 .125rem; margin: 0 -.5rem 0 0; }
  .actions:has(.more[data-ready]) > .btn.quiet, .more[data-ready] .more-btn { padding-left: .75rem; padding-right: .75rem; }
  .more[data-ready] .more-btn::after { width: .375rem; height: .375rem; margin: -.2rem .125rem 0 .2rem; }
  .more[data-ready].is-open .more-btn { background: var(--sunk); }
  .more[data-ready] .more-list { top: calc(100% - .25rem); min-width: 13.5rem; padding: .375rem; background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--radius-2); box-shadow: var(--shadow); }
  .more[data-ready] .more-list .btn { min-height: 3rem; padding-left: .875rem; font-size: 1rem; color: var(--ink); }
  .strip:has(.more[data-ready]) .theme-btn { position: static; }
}

/* ---------- print: the payout sheet, plain ---------- */
.print-head { margin: 0 0 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid #000; }
.print-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.print-title span { margin-left: .5rem; font-size: .875rem; font-weight: 400; letter-spacing: 0; }
.print-date { font-size: .8125rem; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #fff; --card: #fff; --field: #fff; --sunk: #fff; --ink: #000; --ink-2: #222; --muted: #555; --rule: #bbb; --rule-2: #999; --edge: #999;
    --accent: #000; --fill: #000; --on-fill: #fff; --over: #000; --good: #000; --mark: #000; color-scheme: light;
  }
  html { font-size: 11px; }
  .howto, .custom, .foot { display: none !important; }
  .print-head.print-only { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

  .sheet-meta { font-size: 1.2rem; font-weight: 500; margin-bottom: .8rem; }
  .sheet-sums { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: .25rem 2.5rem; margin-bottom: 1.2rem; }
  .sheet-sums dt { font-size: .85rem; color: var(--muted); }
  .sheet-sums dd { font-size: 1.15rem; font-weight: 600; text-align: left; }
  .sheet-table th, .sheet-table td { padding-top: 1.1rem; padding-bottom: .45rem; vertical-align: bottom; }
  .sheet-table thead th { padding-top: .3rem; }
  .sheet-table .sig { width: 38%; border-bottom: 1px solid var(--ink); }
  .sheet-table .sig-h { padding-left: .75rem; }
  .sheet-table tfoot .num { font-weight: 700; }
  .sheet-h { font-size: 1.2rem; font-weight: 600; margin: 1.6rem 0 .3rem; break-after: avoid; }
  .sheet-env { break-inside: avoid; }
  .sheet-env th, .sheet-env td { padding-top: .3rem; padding-bottom: .3rem; }
  .sheet-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 2.6rem; break-inside: avoid; }
  .sheet-sign p { padding-top: .3rem; border-top: 1px solid var(--ink); font-size: .85rem; color: var(--muted); }

  .log .sec-head p, .log-hint { display: none; }
  .sec-head h2 { font-size: 1.4rem; }
  .range { margin-bottom: 1rem; }
  .range-dates { max-width: 20rem; }
  .insight { font-size: 1.05rem; font-weight: 400; margin-bottom: 1rem; }
  .shift { break-inside: avoid; padding: .6rem 0; }
  .shift summary { min-height: 0; }
  #log-body { padding-bottom: 0; }
  #totals-table .t-meta::after { content: none; }
}

/* ---------- the log with room: totals on the left, the shifts beside them ---------- */
@media (min-width: 72rem) {
  #log-body { display: grid; grid-template-columns: minmax(0, 1fr) 27rem; grid-template-rows: auto auto auto 1fr; column-gap: 4.5rem; align-items: start; }
  #log-body > * { grid-column: 1; }
  #totals-table { max-width: none; }
  #log-body > .shifts-h { grid-column: 2; grid-row: 1; margin: .35rem 0 0; }
  #log-body > .shifts { grid-column: 2; grid-row: 1 / span 4; margin-top: 2.75rem; max-width: none; }
}
@media print { #log-body { display: block; } #log-body > .shifts-h { margin: 1.5rem 0 .5rem; } #log-body > .shifts { margin-top: 0; } }

/* ---------- the way back to the tools list: small and quiet, above the product's own bar ---------- */
.to-tools {
  display: inline-flex; align-items: center; gap: .25rem; min-height: 1.75rem; margin-top: .5rem;
  font-size: .8125rem; font-weight: 500; line-height: 1; color: var(--muted); text-decoration: none;
}
.to-tools:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.to-tools svg { flex: none; }
@media print { .to-tools { display: none; } }

/* ---------- quick-win additions (3 Dec) ---------- */
/* The keyboard hint means nothing on a touch phone. */
@media (hover: none) and (pointer: coarse) { .keys-only { display: none; } }
/* A note with nothing to put back fades out after a few seconds. */
.notice.toast.is-leaving { opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .notice.toast { transition: opacity .4s; } }
