/* Honu Timesheets. Ported from mocks/timesheet-mocks.html: same tokens and components. */
:root {
  --bg: #ffffff;
  --surface: #eef3f3;   /* cards */
  --surface-2: #e4ecec; /* headers, hovered and open rows inside cards */
  --field: #ffffff;     /* inputs, buttons, menus */
  --ink: #12282b;
  --muted: #5a6f72;
  --line: #d5e0e0;
  --accent: #0b746c;
  --accent-ink: #ffffff;
  --accent-soft: #dbefec;
  --slate: #3b5b8c;
  --slate-soft: #e2e9f5;
  --warn: #a2500d;
  --warn-soft: #fbeedb;
  --bad: #ad2234;
  --bad-soft: #fbe2e5;
  --good: #23743a;
  --good-soft: #dff1e3;
  --tele: #8a3fa8;
  --tele-soft: #f2e5f7;
  --shadow: 0 1px 2px rgb(18 40 43 / .06), 0 4px 16px rgb(18 40 43 / .06);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
/* No dark mode for now. */

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45 }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; margin: 0; text-wrap: balance; letter-spacing: -.01em }
p { margin: 0 }
a { color: var(--accent) }
button, input, select, textarea { font: inherit; color: inherit }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
[hidden] { display: none !important }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }

/* ---------- page frame ---------- */
.demo-banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .04em; padding-block: 6px; padding-top: max(6px, env(safe-area-inset-top, 0px)) }
.stage { max-width: 1240px; margin-inline: auto; padding-block: 18px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); container-type: inline-size; container-name: app }
.screen { display: grid; gap: 18px }

.topnav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 4px; margin-bottom: 18px }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none }
.brand img { display: block; width: auto }
.msg-alert { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; margin-left: 8px; padding: 0 9px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 17px; font-weight: 700; line-height: 1; text-decoration: none; box-shadow: 0 0 0 3px var(--bad-soft) }
.msg-alert:hover { background: color-mix(in srgb, var(--bad) 85%, #000) }
.msg-alert:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px }
.tabs { display: flex; gap: 2px; flex-wrap: wrap }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500 }
.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent) }
.tabs a .chip { margin-left: 4px }
/* The red circle by the logo, smaller, in the Messages tab (those who aren't admins) */
.msg-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; vertical-align: 1px; box-shadow: 0 0 0 2px var(--bad-soft) }
.whowrap { margin-left: auto; position: relative }
.whowrap > summary { list-style: none; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 2px 2px 2px 8px; border-radius: 999px; cursor: pointer }
.whowrap > summary::-webkit-details-marker { display: none }
.whowrap > summary:hover { background: var(--surface-2) }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none }
img.avatar { object-fit: cover; background: var(--accent-soft) }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: max-content; max-width: min(360px, calc(100cqw - 24px)); background: var(--field); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 4px; justify-items: start }
.menu form { margin-top: 8px }
.menu-email { justify-self: stretch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px }
.panel-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px }
.panel-h h2 { font-size: 19px }
.panel-h .sub { color: var(--muted); font-size: 13px }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600 }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--field); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink) }
.btn:hover { border-color: var(--muted) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600 }
.btn.primary:hover { filter: brightness(1.08) }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent) }
.btn.soft { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--accent) }
.btn.soft:hover { border-color: var(--accent) }
.btn.small { padding: 4px 9px; font-size: 13px; border-radius: 7px }
.btn.danger { color: var(--bad) }
.btn.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none }
.why-not { display: inline-flex; cursor: not-allowed }  /* around a greyed-out button: says why on hover (staff/_approve_waiting.html) */
.input:disabled { background: var(--surface); color: var(--muted); cursor: not-allowed }
.inline-form { display: inline }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent }
.chip.slate { background: var(--slate-soft); color: var(--slate); border-color: transparent }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent }
.chip.tele { background: var(--tele-soft); color: var(--tele); border-color: transparent }

.messages { display: grid; gap: 8px; margin-bottom: 14px; padding: 0; list-style: none }
.messages li { padding: 10px 14px; border-radius: 10px; background: var(--good-soft) }
.messages li.error { background: var(--bad-soft) }
.messages li.warning { background: var(--warn-soft) }
.messages.floating { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40; margin: 0;
                     width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow); border-radius: 10px }  /* clients.js, after Save */

/* ---------- sign in ---------- */
.login-wrap { min-height: 80vh; display: grid; place-items: center; padding: 24px 0 }
.login { width: min(400px, 100%); display: grid; gap: 14px }
.login .card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 14px; box-shadow: var(--shadow) }
.login h1 { font-size: 26px }
.login p { color: var(--muted) }
.login .lockup { display: flex; align-items: center; justify-content: center; gap: 14px }
.login .lockup img { display: block; width: auto }
.login .head { display: grid; gap: 6px; text-align: center }
.login .btn { justify-content: center; padding: 11px; gap: 10px }
.contact { font-weight: 600; color: var(--ink); user-select: all; overflow-wrap: anywhere }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; min-width: 0 }
.field > label, .lbl { font-size: 13px; font-weight: 600 }
.hint { font-size: 12px; color: var(--muted) }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--bad); font-size: 13px; font-weight: 500 }
.input { width: 100%; border: 1px solid var(--line); background: var(--field); border-radius: 9px; padding: 9px 11px; min-width: 0 }
.input::-webkit-datetime-edit-fields-wrapper { padding: 0 }  /* a date or time box as tall as a text box beside it (Chrome pads it 2px) */
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft) }
/* A box whose value is wrong (entry-form.js): red, focused or not. */
.input[aria-invalid="true"] { border-color: var(--bad) }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--bad-soft) }
/* Drop-downs draw their own chevron, set in from the right edge. */
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a6f72' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px }
.row { display: flex; gap: 10px; flex-wrap: wrap }
.row > .field { flex: 1 1 120px; align-content: start }  /* side by side, each keeps its own height: a hint under one doesn't stretch the other's box */
.seg { display: flex; flex-wrap: wrap; gap: 6px }
.seg label { border: 1px solid var(--line); background: var(--field); border-radius: 9px; padding: 7px 11px; cursor: pointer; font-weight: 500; font-size: 14px; display: inline-flex; gap: 7px; align-items: center }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent) }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px }
.seg .dot { width: 9px; height: 9px; border-radius: 50% }
.seg.small label { padding: 4px 10px; font-size: 13px }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer }
.check input { width: 17px; height: 17px; accent-color: var(--accent) }
/* The certification: on the Submit page, and as signed on its own page
   (timesheets/_signed_certification.html). Every statement apart, its box on
   the statement's first line at any width, the paragraphs of one apart. */
.certify { display: grid; gap: 12px; margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 14px }
.certify legend { font-weight: 600; padding: 0 6px }
.check.cert { align-items: flex-start; line-height: 1.45 }
.check.cert input, .check.cert .tick { flex: none; width: 17px; height: 17px; margin: calc(.725em - 8.5px) 0 0 }
.check.cert .p { display: block }
.check.cert .p + .p { margin-top: 4px }
.certify.signed .check.cert { cursor: default }
.certify.signed .cert.unticked { background: var(--warn-soft); border-radius: 8px; padding: 6px 8px; margin: 0 -8px }
.tick rect { fill: var(--field); stroke: var(--muted) }
.tick.on rect { fill: var(--accent); stroke: var(--accent) }
.signed-cert { display: grid; gap: 14px }  /* spaced like the Submit page's form */
.signed-cert .cert-sign { margin: 0 }
.signed-cert .answer { background: var(--field); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 40px; overflow-wrap: anywhere }
.signed-cert .answer .none { color: var(--muted) }
.computed { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--field); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px }
.computed .big { font-family: var(--f-mono); font-size: 20px; font-weight: 500 }
/* The line under This entry always keeps its height, empty or not, so the buttons below don't move while times are typed. */
.computed .hint { flex-basis: 100%; min-height: 1lh }
.computed .hint.problem { color: var(--bad); font-weight: 600 }
.form { display: grid; gap: 14px }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end }
.form-errors { background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px }

/* Only the fields for the picked kind are shown. Works without JavaScript. */
.fs { display: none; gap: 14px }
#entry-form:has([name="kind"][value="client"]:checked) .fs-client,
#entry-form:has([name="kind"][value="supervision"]:checked) .fs-supervision,
#entry-form:has([name="kind"][value="drive"]:checked) .fs-drive,
#entry-form:has([name="kind"][value="admin"]:checked) .fs-admin,
#entry-form:has([name="kind"][value="school_admin"]:checked) .fs-school_admin,
#entry-form:has([name="kind"][value="sick"]:checked) .fs-sick,
#entry-form:has([name="kind"][value="pto"]:checked) .fs-pto,
#entry-form:has([name="kind"][value="break"]:checked) .fs-break,
#entry-form:has([name="kind"][value="lunch"]:checked) .fs-lunch,
#entry-form:has([name="kind"][value="reimbursement"]:checked) .fs-reimbursement { display: var(--fs-display, grid) }
/* A supervision with a client shows the client fields; at a school, the school picker in their place. */
#entry-form:not(:has(#f-supervising option[value="school"]:checked)) .for-school,
#entry-form:has([name="kind"][value="supervision"]:checked):has(#f-supervising option[value="school"]:checked) .for-client { display: none }
/* Home or office: a supervision's only (of an insurance client: entry-form.js). */
#entry-form:not(:has([name="kind"][value="supervision"]:checked)) #place-field { display: none }
/* Every item has a start and an end; a drive has miles beside its times.
   The times say "Session start", "Drive start" or just "Start". */
#entry-form:is(:has([name="kind"][value="client"]:checked), :has([name="kind"][value="supervision"]:checked), :has([name="kind"][value="admin"]:checked), :has([name="kind"][value="school_admin"]:checked), :has([name="kind"][value="drive"]:checked)) .lbl-plain { display: none }
.lbl-session, .lbl-drive, .drive-miles { display: none }
#entry-form:is(:has([name="kind"][value="client"]:checked), :has([name="kind"][value="supervision"]:checked), :has([name="kind"][value="admin"]:checked), :has([name="kind"][value="school_admin"]:checked)) .lbl-session,
#entry-form:has([name="kind"][value="drive"]:checked) .lbl-drive { display: inline }
#entry-form:has([name="kind"][value="drive"]:checked) .drive-miles { display: grid }

.cancel-reason { display: none }
.new-client { display: none }
/* Without JavaScript, a new client's name goes in a field of its own; with it, "+ New client…" opens a dialog. */
#entry-form:not(.has-picker) .new-client { display: grid }
#entry-form:has([name="cancelled"]:checked) .cancel-reason { display: grid }

/* client menu (entry-form.js draws it over the real <select>) */
.picker { position: relative }
.picker-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; display: grid; gap: 1px; padding: 4px; max-height: min(320px, 60vh); overflow-y: auto; background: var(--field); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow) }
.picker-row { display: flex; align-items: center; gap: 2px }
.picker-opt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer }
.picker-opt .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.picker-opt .code { margin-left: auto; font-family: var(--f-mono); font-size: 12px; color: var(--muted) }
.picker-opt:hover { background: var(--surface) }
/* the row Enter would pick (arrow keys move it) */
.picker-opt[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent) }
.picker-empty { padding: 9px 10px; color: var(--muted); font-size: 14px }
.picker-add { color: var(--accent); font-weight: 600 }
/* Mentions (mentions.js): the list under a text box as @ is typed, and a client mentioned in a text. */
.mention-menu { position: absolute; right: auto; z-index: 60; min-width: 15rem; max-width: 22.5rem }
.mention-menu .picker-empty { font-size: 12px; border-top: 1px solid var(--line); margin-top: 2px }
.mention { border-radius: 2px; background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-soft); color: var(--ink); font-weight: 600; white-space: nowrap }  /* (no padding: "’s" stays against the name) */
.picker-row:has(.picker-add) { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 3px }
.picker-del { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer }
.picker-del:hover, .picker-del:focus-visible { color: var(--bad); background: var(--bad-soft); outline: none }
.picker-del:focus-visible { box-shadow: inset 0 0 0 2px var(--bad) }

/* dialogs: new client, delete a client */
.dialog { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--ink); box-shadow: var(--shadow) }
.dialog::backdrop { background: rgb(18 40 43 / .35) }
.dialog h2 { font-size: 19px }
.dialog .form { gap: 12px }

/* A date as a pill (Clone's "Clone to"): today and yesterday in green. */
.dayname { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; font-weight: 600; padding: 6px 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); height: 40px }
.dayname.rel { color: var(--accent); background: var(--accent-soft); border-color: transparent }
/* Saturday and Sunday in red, so time isn't logged there by mistake (it still can be). */
.dayname.weekend { color: var(--bad); background: var(--bad-soft); border-color: transparent }
.btn.icon { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 20px; line-height: 1; flex: none }
/* Tapping the date opens the phone's own date picker: the real date input
   lies invisibly over the date. */
.dayname { position: relative; cursor: pointer }
.dayname:focus-within { outline: 2px solid var(--accent); outline-offset: 2px }
.dayname input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: inherit; border: 0; padding: 0 }
.dayname input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: inherit }
.dayname:hover { border-color: var(--accent) }
.clone-to { display: flex; align-items: center; gap: 10px; font-weight: 600 }
.clone-to .dayname { flex: 1 }
.quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center }

/* ---------- timesheet page ---------- */
.ts-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between }
.ts-head h1 { font-size: 28px }
/* The period's status sits on the title, glued to the dates. */
.title-tail { white-space: nowrap }
.title-chip { margin-left: 4px; vertical-align: middle; position: relative; top: -2px; font-family: var(--f-body); letter-spacing: 0 }
/* Beside the title: Submit or Edit, then This period / Past periods, all
   the same size of button; the period being shown is light green. */
.ts-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.ts-actions .btn, .ts-actions .tabs a { height: 40px; padding: 0 14px; border-radius: 9px; font-size: 15px }
.ts-actions .tabs { gap: 10px }
.ts-actions .tabs a { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--field); color: var(--ink); font-weight: 500 }
.ts-actions .tabs a:hover { border-color: var(--muted) }
.ts-actions .tabs a[aria-current="page"] { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--accent) }
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px }
.banner.info { background: var(--accent-soft) }
.banner.warn { background: var(--warn-soft) }
.banner.good { background: var(--good-soft) }
.banner.bad { background: var(--bad-soft) }
.banner.cert-standing .grow { display: grid; gap: 2px }
.banner.cert-standing > .cert-icon { width: 22px; height: 22px }
.banner .grow { flex: 1; min-width: 200px }
.banner.certified .grow { display: grid; gap: 4px }
.summary { padding: 6px 18px }
.summary dl { margin: 0; display: grid }
.summary dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line) }
.summary dl > div:last-child { border-bottom: 0 }
.summary dd { margin: 0; font-size: 17px; white-space: nowrap }
.screen > * { min-width: 0 }
@container app (max-width: 620px) {
  .ts-head h1 { font-size: 23px }
  .tabs a { padding: 6px 8px; font-size: 14px }
  .ts-actions .btn, .ts-actions .tabs a { padding: 0 12px; font-size: 14px }
  .whowrap > summary > span:not(.avatar) { display: none }
}
/* Each kind of item's colour: .c-<kind> sets --kind (and --kind-ink, for text on it) from config/colors.json (timesheets/colors.py, in base.html); grey if it has none. Unpaid breaks and lunch are striped in it. */
.dot, .bar, .tl-seg, .tl-mark { background: var(--kind, var(--muted)) }
.c-lunch:not(.paid), .c-break.unpaid { background: repeating-linear-gradient(135deg, var(--kind, var(--muted)) 0 2px, var(--field) 2px 4px) }

/* day-by-day list (a table built from <details> so days open without JavaScript) */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); container-type: inline-size; container-name: daytable }
.days { font-size: 14px }
.days-row { display: grid; grid-template-columns: 9em minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--line) }
.days-row > * { padding: 8px 10px; min-width: 0 }
/* A day's line, then (if any) what to check, under it. */
/* Every closed day is one height: room for one line of what to check under
   its line, whether there's any or not (a note too long for the room ends
   in "…", and says it all on hover), and a line one lane tall (items that
   overlap share it). */
.dline { display: grid; grid-template-rows: auto 24px; gap: 5px }
.dline .timeline { margin: 0 }
.dline .tl-track { height: 34px }
.dline .tl-seg, .dline .tl-mark { top: calc(5px + var(--lane, 0) * 26px / var(--lanes, 1)); height: calc(26px / var(--lanes, 1) - 4px) }
.dline .flags { display: flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden }
.dline .flags .chip { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis }
/* The small type goes on the header's cells, not the row: the columns are sized in em,
   so a smaller row would get narrower columns than the rows under it. */
.days-head > * { white-space: normal; line-height: 1.2; font-size: 11px; text-transform: uppercase; letter-spacing: .06em }
.days-head { background: var(--surface-2); color: var(--muted); font-weight: 600 }
.days-foot { background: var(--surface-2); font-weight: 600; border-bottom: 0 }
/* The hours over the lines: every other one on a phone, so they don't run together. */
.days-head .tl-labels { text-transform: none; letter-spacing: 0 }
/* An open day's hours, over its line: the summary's first row, only while it's open (not today's: it's
   just under the list's own). */
details.day > summary > .day-hours { display: none }
details.day[open]:not(.today) > summary > .day-hours { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; padding: 0; border-bottom: 1px solid var(--line) }
.day-hours > * { padding: 8px 10px }
@container daytable (max-width: 560px) {
  .days-row { grid-template-columns: 6.6em minmax(0, 1fr) }
  .days-row > *, .day-hours > * { padding-inline: 8px }
  .days-head .tl-labels span:nth-child(even) { visibility: hidden }
}
details.day > summary { list-style: none; cursor: pointer; background: var(--surface) }
details.day > summary::-webkit-details-marker { display: none }
details.day > summary:hover { background: var(--surface-2) }
details.day.today > summary > .day-hours + * { box-shadow: inset 3px 0 0 var(--accent) }
details.day[open] > summary { background: var(--surface-2) }
.zero { color: var(--line) }
.dname { font-weight: 600 }
.dname.weekend { color: var(--bad) }
.dname + small { color: var(--accent); font-weight: 600; margin-left: 6px; font-size: 12px }
@container daytable (max-width: 560px) { .dname + small { display: block; margin: 0 } }
.entries { display: grid; padding: 4px 10px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line) }
.entry { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px dashed var(--line) }
.entry:last-of-type { border-bottom: 0 }
.entry .bar { width: 4px; height: 100%; min-height: 26px; border-radius: 4px }
.entry .what { min-width: 0 }
.entry .what .t { font-weight: 600 }
.entry .what .s { color: var(--muted); font-size: 13px }
.entry .h { font-family: var(--f-mono); font-variant-numeric: tabular-nums }
.entry .acts { display: flex; gap: 2px }
/* Under a day's items: its Add item menu, and Delete All on the right, under the Delete buttons. */
/* Under a day's items: Add item, Clone, and Delete All on the right, under the
   Delete buttons; then the day's totals, the last thing in it. */
.day-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding-top: 8px }
.day-foot .day-clear { margin: 0 4px 0 auto }
/* A note the office left on the day (timesheets/_day_note.html), over its items;
   in the office's view, with Edit (a box that opens under it) and Delete. */
.day-note { margin: 8px 0 4px; padding: 10px 12px; border-left: 4px solid var(--accent); border-radius: 8px; background: var(--accent-soft) }
.day-note-h { font-size: 13px }
.day-note-text { margin: 4px 0 0; overflow-wrap: anywhere }
.day-note-acts { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; margin-top: 6px }
.note-box > summary { list-style: none; cursor: pointer }
.note-box > summary::-webkit-details-marker { display: none }
.note-box[open] { flex: 1 1 100% }
.day-foot .note-add[open] { order: 1 }  /* (under the day's other buttons, Delete All included) */
.day-note-acts .note-box[open] + form { display: none }  /* (the note's Delete, while it's being changed) */
.note-form { margin-top: 8px; gap: 8px; max-width: 560px }
.note-form textarea { width: 100%; resize: vertical }
.day-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; font-size: 14px }
.entries > .day-totals { margin-top: 10px; padding: 9px 4px 0; border-top: 1px dashed var(--line) }
.tot { white-space: nowrap }
.tot small { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-right: 3px }

.recur { display: grid; gap: 8px }
.recur-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field) }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0 }

/* staff overview, clients and other plain tables */
table.simple { width: 100%; border-collapse: collapse; font-size: 14px }
table.simple.wide { min-width: 760px }  /* scrolls sideways on a phone */
table.simple th, table.simple td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle }
table.simple th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2) }
table.simple tbody tr:last-child td { border-bottom: 0 }
table.simple .r { text-align: right }
table.simple td.actions { white-space: nowrap; text-align: right }
table.simple td .chip { margin: 1px 2px 1px 0 }
table.simple a { color: var(--ink) }

/* the Clients page: what's shown, each on (pressed) or off, and the headers that sort it */
.toggles { display: flex; gap: 6px; flex-wrap: wrap }
.toggles .btn { min-width: 56px; justify-content: center }
.toggles .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600 }
.toggles .btn[aria-pressed="false"] { color: var(--muted); text-decoration: line-through }
table.simple th a { color: inherit; text-decoration: none }
table.simple th a:hover, table.simple th[aria-sort] a { color: var(--ink) }
table.simple th[aria-sort] a::after { content: " ▲"; font-size: 9px }
table.simple .c { text-align: center }
/* Approval's Certified column: an icon for each timesheet (staff/_certified_icon.html), opening what
   was signed. The title, once pressed, shows the icon of the kind on top in place of the arrow. */
.cert-icon { display: block; width: 20px; height: 20px; flex: none }
.cert-icon.certified { color: var(--good) }
.cert-icon.look { color: var(--warn) }
.cert-icon.unsigned { color: var(--bad) }
.cert-link { display: inline-flex; padding: 4px; margin: -4px 0; border-radius: 999px; vertical-align: middle }
.cert-link:hover { background: var(--surface-2) }
.cert-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px }
table.simple th.cert-col a { display: inline-flex; align-items: center; gap: 5px }
table.simple th.cert-col[aria-sort] a::after { content: none }
table.simple th.cert-col .cert-icon { width: 13px; height: 13px }
table.simple td.left { white-space: nowrap }
table.simple td.left .over { color: var(--bad); font-weight: 600 }
table.simple td.left:has(.code-left) { white-space: normal; min-width: 220px }  /* an ABA client's codes wrap, each in one piece */
.code-left { white-space: nowrap }

/* a list (Clients, Schools, Insurances, Due...): the head, then one panel that's all table */
.list-panel { padding: 0; overflow: hidden }
.list-panel .tablewrap { border: 0; border-radius: 0 }
.name-search { width: 260px; max-width: 100% }  /* the Directory's and the Clients list's (js/name-search.js) */
table.directory { table-layout: fixed }  /* the columns stay put as the search narrows the list */
table.directory th:nth-child(1) { width: 30% }
table.directory th:nth-child(2) { width: 45% }
table.directory td { overflow-wrap: anywhere }
@media (max-width: 520px) {  /* on a phone, each person is a block, so the phone number isn't cut off */
  table.directory thead { display: none }
  table.directory tr, table.directory td { display: block }
  table.directory tr { padding: 8px 0; border-bottom: 1px solid var(--line) }
  table.directory td { padding: 2px 12px; border-bottom: 0 }
}

/* a record's page (a client, a school, an insurance): the head with its name, Back and Save, then its panels;
   a client's sections may be folded (details.panel), and an EI authorization has its months */
.record-page .panel { display: grid; gap: 14px }
.record-page .row { max-width: 900px }
.record-page .row > .field { flex: 1 1 180px; align-content: start }  /* one without a hint doesn't stretch */
.record-page .row > .fields { flex: 1 1 180px; display: grid; gap: 14px; align-content: start }  /* a menu, and what its choice asks for under it */
.record-page h3 { font-size: 15px; margin: 4px 0 -4px }
.aba-period summary .btn, .panel-h > .btn { margin-left: auto; align-self: center }
.staff-picker { margin-top: 12px; max-width: 320px }
table.row-fields td { vertical-align: top }  /* a table whose rows are fields: an insurance's codes, an ABA client's */
table.row-fields .input { padding: 6px 8px; min-width: 76px }
table.row-fields input[type="date"].input { min-width: 136px }
table.row-fields select.input { min-width: 124px; padding-right: 30px; background-position: right 10px center }
table.row-fields .period, table.row-fields td.num, table.row-fields td.left { padding-top: 16px; white-space: nowrap }
table.row-fields .units, table.row-fields .short { width: 112px }
table.row-fields .code-name .input { min-width: 200px }  /* room for the name: the table scrolls sideways before it's cut off */
h1 .code { font-family: var(--f-mono); font-size: .6em; color: var(--muted); font-weight: 500 }
details.panel > summary { list-style: none; cursor: pointer; margin: 0 }
details.panel > summary::-webkit-details-marker { display: none }
details.panel > summary h2::before { content: "›"; display: inline-block; width: 16px; color: var(--muted); transition: transform .15s }
details.panel[open] > summary h2::before { transform: rotate(90deg) }
details.earlier { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 14px }
details.earlier > summary { cursor: pointer; font-weight: 600 }
table.months th, table.months td { white-space: nowrap }
table.months .input { width: 84px; text-align: right; padding: 6px 8px }
table.months .input.changed { border-color: var(--warn); background: var(--warn-soft) }
table.months td.over { color: var(--bad); font-weight: 600 }

/* Due: what's due, who does it and its status; a due item's notes */
table.due td { white-space: nowrap }
table.due td.late { color: var(--bad); font-weight: 600 }
table.due tr.done td { color: var(--muted) }
table.due select.input { width: auto; min-width: 150px; padding-top: 6px; padding-bottom: 6px }
table.due .btn .count { font-size: 11px; font-weight: 600; color: var(--muted) }
table.due .saved { margin-left: 6px; font-size: 12px; color: var(--muted) }
.due-what { margin: -6px 0 0; color: var(--muted) }
.notes { display: grid; gap: 14px; max-width: 760px }
.note { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px }
.note-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap }
.note-h .acts { margin-left: auto; display: flex; gap: 6px }
.note-text { white-space: normal; overflow-wrap: anywhere }

/* past periods and change requests */
.periods { display: grid; gap: 10px }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink) }
.prow:hover { border-color: var(--accent) }
.prow .t { font-weight: 600 }
.prow .s { color: var(--muted); font-size: 13px }
@container app (max-width: 620px) { .prow { grid-template-columns: minmax(0, 1fr) auto } .prow .hrs { display: none } }
.req { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--field) }
.req .top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between }
.diff { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; background: var(--field) }
.diff > div { padding: 8px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere }
.diff .h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); font-weight: 600 }
.diff .old { background: var(--bad-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent) }
.diff .new { background: var(--good-soft) }
.diff .k { color: var(--muted) }

/* Before the office changes someone's timesheet: each day it touches, item by
   item, before and after (timesheets/_change_body.html), in a dialog, at the
   top of the card, or on a page of its own. */
.change-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto }
.change-body h2 { font-size: 19px; overflow-wrap: anywhere }
.change-body h2:focus { outline: none }
.change-body p { margin: 0 }
.change-day { display: grid; gap: 6px }
.change-day h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 0 }
.day-diff .sum { font-weight: 600; background: var(--surface-2) }
.day-diff .k.sum { color: var(--ink) }
.day-diff .sum.old { background: var(--bad-soft) }
.day-diff .sum.new { background: var(--good-soft) }
.day-diff > div:nth-last-child(-n+3) { border-bottom: 0 }
.change-ask { margin-bottom: 14px; padding: 14px; border: 2px solid var(--warn); border-radius: 12px; background: var(--field) }
section.change-ask { max-width: 760px; margin: 0 auto }
/* On a phone, each item's kind goes over its before and after. */
@media (max-width: 560px) {
  .day-diff { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) }
  .day-diff .h:first-child { display: none }
  .day-diff .k { grid-column: 1 / -1; padding-bottom: 2px; border-bottom: 0; font-size: 12px; font-weight: 600 }
}

/* A day's line: entries placed by start and end time on an 8am–6pm line (all the days' lines on the same hours). */
.timeline { margin: 6px 4px 10px; display: grid; gap: 4px }
.tl-labels { display: block; position: relative; height: 14px; font-family: var(--f-mono); font-size: 11px; color: var(--muted) }
.tl-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap }
.tl-labels span:first-child { transform: none }
.tl-labels span:last-child { transform: translateX(-100%) }
.tl-track { display: block; position: relative; height: calc(var(--lanes, 1) * 26px + 8px); background: var(--field); border: 1px solid var(--line); border-radius: 8px; overflow: hidden }
/* A day items can be added to: dragging across its line picks a new item's times (entry-form.js), shown as it's dragged. */
details.day:has([data-add-menu]) > summary .tl-track { cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none }
.tl-pick { position: absolute; top: 3px; bottom: 3px; z-index: 2; display: flex; align-items: center; justify-content: center; min-width: 2px; overflow: visible; border: 2px dashed var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); font-family: var(--f-mono); font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none }
.tl-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line) }
.tl-seg { position: absolute; top: calc(5px + var(--lane, 0) * 26px); height: 22px; min-width: 6px; border-radius: 5px; padding: 3px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--kind-ink, var(--accent-ink)); text-decoration: none; box-shadow: 0 0 0 1px var(--field) }
.tl-seg.cancelled { background: repeating-linear-gradient(135deg, var(--bad-soft) 0 6px, var(--field) 6px 12px); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); text-decoration: line-through }
/* The card, under its day: over the day's items, at the page's text size. */
.entries > .add-time { margin: 6px 0 10px; padding: 14px; font-size: 15px }
details.day.has-card .day-add { display: none }
/* Breaks and lunch: as tall as the item they fall during, on its lane; the colour (.c-break, .c-lunch) is solid if paid, striped if not. */
.tl-mark { position: absolute; top: calc(5px + var(--lane, 0) * 26px); height: 22px; min-width: 4px; border-radius: 3px; box-shadow: 0 0 0 1px var(--field); z-index: 1 }

/* "Add item": a full-width card. The fields stack in one column (each kind's
   block, .fs, lays its fields straight into the form's grid). The title and
   form grow with the page up to 862px wide, then keep that width and stay
   centered. */
.add-time { display: grid; gap: 14px }
.add-time > h2, .add-time > .at-form { width: 100%; max-width: 862px; justify-self: center }
.add-time h2 { font-size: 19px }
.at-form { --fs-display: contents; grid-template-columns: minmax(0, 1fr); gap: 14px 18px; align-items: start }
.at-form > *, .at-form .fs > * { grid-column: 1 / -1 }
/* Cancel, (Delete,) Save: one row, evenly spaced, on the right
   (wrapping, in the same order, only on the narrowest phones). */
.at-form .form-actions { flex-wrap: nowrap }
@container app (max-width: 380px) { .at-form .form-actions { flex-wrap: wrap } }
/* A reimbursement's receipt (templates/timesheets/_entry_fields.html, entry-form.js): Take photo
   and Choose file, their file boxes hidden inside them; what's attached, with its picture. */
.receipt-pick { display: flex; flex-wrap: wrap; gap: 8px }
.receipt-pick .btn { position: relative; justify-content: center; min-height: 44px; flex: 1 1 120px; max-width: 220px }
.receipt-pick .btn:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px }
@media (hover: hover) and (pointer: fine) { .receipt-pick .receipt-camera { display: none } }  /* no camera to open on a computer */
.receipt-file { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--field); border-radius: 10px; padding: 8px; min-width: 0 }
.receipt-thumb { flex: none; width: 56px; height: 56px; border-radius: 7px; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); text-decoration: none }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover }
.receipt-doc { font-size: 12px; font-weight: 700; letter-spacing: .04em }
.receipt-about { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 14px }
.receipt-about > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.js .receipt-clear { display: none }  /* the script's Remove button stands in for it */
/* totals: collapsed at the bottom until opened */
details.totals { padding: 0 }
details.totals > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 14px 18px }
details.totals > summary::-webkit-details-marker { display: none }
details.totals > summary::before { content: "›"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s }
details.totals[open] > summary::before { transform: rotate(90deg) }
details.totals .totals-title { font-family: var(--f-display); font-weight: 700; font-size: 17px }
details.totals dl { padding: 0 18px 8px; border-top: 1px solid var(--line) }
@media (prefers-reduced-motion: reduce) { details.totals > summary::before { transition: none } }

/* a day whose card is on its way */
details.day[aria-busy="true"] > .entries { opacity: .6; transition: opacity .1s }

/* A day's Add item menu: a button that opens the kinds of item. */
.add-menu { position: relative }
.add-menu > summary { list-style: none; cursor: pointer }
.add-menu > summary::-webkit-details-marker { display: none }
.add-menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; margin-left: 2px; transform: translateY(-2px) rotate(45deg) }
.add-menu[open] > summary::after { transform: translateY(1px) rotate(-135deg) }
.add-menu-list { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; display: grid; gap: 1px; padding: 4px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow) }
.add-menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap }
.add-menu-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none }
a.add-menu-item:hover, a.add-menu-item:focus-visible { background: var(--surface-2); outline: none }
a.add-menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent) }
.add-menu-item[aria-disabled="true"] { color: var(--muted) }
.add-menu-item small { margin-left: auto; padding-left: 12px; font-size: 12px }
/* In a day of the list, the kinds open in place (the list scrolls sideways, which would clip a drop-down). */
.add-menu.end .add-menu-list { left: auto; right: 0 }  /* at the right edge (app.js keeps it on screen) */
.day-add .add-menu-list { position: static; margin-top: 6px; box-shadow: none; width: max-content; max-width: 100% }

/* Messages: the page they're read on, and the page that writes one. */
.inbox { display: grid; gap: 0 }
.inbox-item { padding: 14px 0; border-bottom: 1px solid var(--line) }
.inbox-item:first-child { padding-top: 0 }
.inbox-item:last-child { padding-bottom: 0; border-bottom: 0 }
.inbox-from { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px }
.inbox-text { margin: 6px 0 0; overflow-wrap: anywhere }
.inbox-text.unread { font-weight: 700 }
.inbox-action { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px }
.sent-count { white-space: nowrap }
.audience { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px }
.audience-group { margin: 0; padding: 0; border: 0; min-width: 0 }
.audience-all { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line) }
.audience-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px }


/* A client's addresses (templates/staff/_client_address.html): each set off from the next. */
.address-card { border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 10px }
