/* The Nest. Brand colors from brain/brand.md; surface and ink tones from the Nov 3 mockup. */

:root {
  --navy: #005896;
  --sky: #0089ce;
  --gold: #fec553;
  --on-gold: #2b1e00;
  --red: #ce181e;
  --bg: #f2f5f9;
  --surface: #ffffff;
  --ink: #0f2233;
  --ink-2: #44586c;
  --line: #d5dfe9;
  --good: #1b7a44;
  --good-soft: #e0f3e8;
  --crit: #b42318;
  --crit-soft: #fde6e3;
  --r: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #6db7ec;
    --bg: #0a1520;
    --surface: #0f1f2e;
    --ink: #e7eef6;
    --ink-2: #a9bacb;
    --line: #24394e;
    --good: #5cc98b;
    --good-soft: #12301f;
    --crit: #ff8a80;
    --crit-soft: #3a1512;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* The bottom padding leaves room for the tab bar. */
  padding: env(safe-area-inset-top) 16px calc(96px + env(safe-area-inset-bottom));
}

#app { max-width: 560px; margin: 0 auto; }

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}
.brand { font-weight: 800; color: var(--navy); font-size: 1.15rem; }
.hi { color: var(--ink-2); margin-left: auto; }
.bar .link:only-of-type, .bar .brand + .link { margin-left: auto; }
/* Nov 16: the greeting sits beside Sign out, which is a quiet pill rather than an underlined link. */
.bar .hi { font-size: 0.9rem; }
.bar .hi ~ .link { margin-left: 0; }
.bar .link {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  margin: 12px 0;
}

h1 { font-size: 1.5rem; margin: 0 0 12px; color: var(--navy); }
h2 { font-size: 1.15rem; margin: 0; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }

input[type="email"], input#code, select {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
input#code { letter-spacing: 0.3em; font-size: 1.4rem; text-align: center; }
input[type="email"]:focus-visible, input#code:focus-visible, select:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 1px;
  border-color: transparent;
}

/* Sign-in (Nov 16): one quiet card, the code a big centered figure, the two links as quiet
   buttons. */
.signin.card {
  margin-top: 24px;
  padding: 22px 18px 18px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.signin h1 { font-size: 1.35rem; color: var(--ink); margin: 0 0 6px; }
.signin .note { margin: 4px 0 8px; }
.signin label { font-size: 0.9rem; margin: 14px 0 6px; }
.signin form > p { margin: 0 0 4px; color: var(--ink-2); font-size: 0.95rem; overflow-wrap: anywhere; }
.signin .hint { margin: 8px 0 0; font-size: 0.85rem; }
.signin input#code { min-height: 60px; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.signin form > button[type="submit"] { min-height: 50px; border-radius: 12px; }
.signin .links { gap: 8px; margin-top: 12px; }
.signin .links .link {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 8px 10px;
  white-space: nowrap;
  border-radius: 10px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.signin .error { margin: 12px 0 0; }

button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--gold);
  color: var(--on-gold);
  cursor: pointer;
}
form > button[type="submit"] { width: 100%; margin-top: 14px; }
button:disabled { opacity: 0.6; cursor: default; }
button.link {
  background: none;
  color: var(--navy);
  padding: 8px 4px;
  font-weight: 600;
  text-decoration: underline;
}
.links { display: flex; justify-content: space-between; margin-top: 8px; }

.hint, .muted { color: var(--ink-2); }
.note { background: var(--good-soft); border-radius: 10px; padding: 10px 12px; }
.error { background: var(--crit-soft); color: var(--crit); border-radius: 10px; padding: 10px 12px; }

.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.today-head select { width: auto; flex: 1; font-weight: 700; }
.site { font-weight: 800; font-size: 1.3rem; margin: 0; }
.day { color: var(--ink-2); margin: 0; }
.today .day { font-size: 0.9rem; }

/* Today (Nov 16): quieter cards, a progress bar per checklist, round checkboxes, and a small flag
   for "Report a problem". */
.today .card {
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.checklist-head { display: flex; align-items: baseline; justify-content: space-between; }
.progress { color: var(--ink-2); margin: 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.checklist-meter { height: 6px; margin: 10px 0 4px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.checklist-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--sky); transition: width 0.25s ease; }
.checklist-meter.full > span { background: var(--good); }

.checklist ul { list-style: none; padding: 0; margin: 6px 0 0; }
.checklist li { border-top: 1px solid var(--line); padding: 2px 0; }
.checklist li:first-child { border-top: 0; }
.checklist .item-row { display: flex; align-items: center; gap: 6px; }
.checklist li label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  min-height: 52px;
  font-weight: 500;
  cursor: pointer;
}
.checklist input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface) center / 16px no-repeat;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.checklist input[type="checkbox"]:checked {
  border-color: var(--good);
  background-color: var(--good);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E");
}
.checklist input[type="checkbox"]:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.checklist input[type="checkbox"]:disabled { cursor: default; }
.checklist li.done span { color: var(--ink-2); text-decoration: line-through; }
.who { margin: -8px 0 8px 38px; font-size: 0.8rem; color: var(--good); }
.checklist .report-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  opacity: 0.7;
}
.checklist .report-icon:hover, .checklist .report-icon:focus-visible { opacity: 1; color: var(--crit); background: var(--crit-soft); }

/* The tab bar: fixed to the bottom, within the app's width, above the phone's home bar. */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 54px;
  padding: 6px 2px;
  background: none;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 10px;
}
.tabbar button[aria-current="page"] { color: var(--navy); background: var(--bg); font-weight: 800; }

/* More (Nov 16): every other screen as a row in one quiet card: an icon on a soft tile, the
   name, one line of what's there (cut short with an ellipsis), and a chevron. */
.more-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--r);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
  overflow: hidden;
}
.more-list li + li { border-top: 1px solid var(--line); }
.more-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 14px 10px 12px;
  border-radius: 0;
  text-align: left;
  background: none;
  color: var(--ink);
  font-weight: 600;
}
.more-list button > svg {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--navy);
}
.more-list button > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.more-list strong { font-size: 1rem; font-weight: 700; }
.more-list .muted {
  font-weight: 400;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.more-list button::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-top: 2px solid var(--ink-2);
  border-right: 2px solid var(--ink-2);
  transform: rotate(45deg);
  opacity: 0.7;
}

/* A two- or three-way switch inside a screen (My training / My team, People / Shifts), Nov 16:
   a soft track with the chosen part raised on it. */
.seg {
  display: flex;
  gap: 2px;
  margin: 4px 0 12px;
  padding: 3px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 7%, var(--bg));
}
.seg button {
  flex: 1;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 9px;
  background: none;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 600;
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.14);
}
@media (prefers-color-scheme: dark) {
  .seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--ink) 14%, var(--surface)); box-shadow: none; }
}

.card h2 { margin-bottom: 4px; }
input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.rows { list-style: none; padding: 0; margin: 8px 0 0; }
.rows li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.row-main { min-width: 0; overflow-wrap: anywhere; }
.role { font-size: 0.85rem; color: var(--ink-2); background: var(--bg); border-radius: 999px; padding: 2px 8px; }
.small { font-size: 0.85rem; }
.confirm { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.confirm button:not(.link) { background: var(--crit-soft); color: var(--crit); }
.warn { color: var(--crit); margin: 6px 0 0; font-size: 0.9rem; }
.sent .message { background: var(--surface); border-radius: 8px; padding: 10px; margin: 6px 0; }
.sent { margin-top: 12px; }

/* activity.css */
/* The activity log (D74): quiet rows; a failed run stands out. Scoped under .activity. */
.activity h1 { font-size: 1.3rem; margin: 0 0 12px; }
.activity .rows { list-style: none; margin: 8px 0 0; padding: 0; }
.activity .rows li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.activity .activity-job { font-weight: 700; }
.activity .activity-status { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); }
.activity .activity-status.failed, .activity .activity-status.rejected { color: var(--crit); }
.activity .activity-status.approved, .activity .activity-status.edited { color: var(--good); }
.activity .activity-failed { border-left: 3px solid var(--crit); padding-left: 10px; }
.activity .activity-filter { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.9rem; }

/* approvals.css */
/* Approvals: the queue, my requests and the swap form (src/app/approvals). Tokens from
   web/styles.css, so dark mode follows them. Phone first: everything stacks, nothing scrolls
   sideways (long text wraps, the proposed brain text included). Nov 16 redesign: the shared
   pills, rows and quiet cards are the owner screens' kit at the top of web/styles/numbers.css
   (under .owner-ui); what's here is Approvals' own. */

.approvals-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 4px; }
.approvals-head h1 { margin: 0; }
.approvals-head .pill { background: var(--surface); }

/* A group of one kind: its name and how many, then one row per request. */
.approvals .approval-group { padding-bottom: 4px; }
.approval-list { list-style: none; padding: 0; margin: 8px 0 0; }
.approval { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.approval p { margin: 4px 0; }

.approvals .approval-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 2px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 400;
  text-align: left;
}
.approvals .approval-row::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.approvals .approval-row[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.approvals .approval-row:focus-visible { outline: 2px solid var(--sky); outline-offset: -2px; }
.approvals .approval-summary { font-weight: 600; line-height: 1.35; }
.approvals .approval-by { font-size: 0.8rem; color: var(--ink-2); }
.approvals .approval-body { padding: 0 2px 14px; }

.approval-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 4px 0 8px;
  font-size: 0.9rem;
}
.approval-fields dt { color: var(--ink-2); }
.approval-fields dd { margin: 0; min-width: 0; }

.approval-label { color: var(--ink-2); font-size: 0.8rem; font-weight: 600; margin-top: 10px; }
/* A caption or drafted reply: a soft block, no colored side border (DESIGN.md rule 4). */
.approval-quote {
  margin: 6px 0;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.review { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.review p { margin: 2px 0; }
.stars { color: var(--gold); letter-spacing: 2px; }
@media (prefers-color-scheme: light) { .stars { color: #b07d00; } }
.approvals .review { font-size: 0.95rem; }

.plan-posts { margin: 8px 0; padding-left: 20px; font-size: 0.95rem; }
.plan-posts li { margin: 4px 0; }

.proposed {
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow-y: auto;
}

.approval-actions, .approval-confirm .confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
}
.approval-confirm { margin-top: 10px; }
.approval-confirm p { font-weight: 600; margin: 0; }
.approval-confirm .confirm { flex-direction: row; align-items: center; margin-top: 6px; }
/* "Yes, approve" is the gold main button; "Yes, reject" is soft red. */
.approvals .approval-confirm .confirm button.yes { background: var(--gold); color: var(--on-gold); }
.approvals .approval-confirm .confirm button.yes.no { background: var(--crit-soft); color: var(--crit); }
.approvals .approval-actions button:not(.link) { min-width: 120px; }
button.secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }

.approval-edit textarea, .swap-form textarea, .approval-edit input[type="date"], .approval-edit input[type="email"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
}
.approval-edit textarea, .swap-form textarea { resize: vertical; }
.approvals .approval-edit label { font-size: 0.9rem; }

/* What deciding did: a quiet green note, the reply with a small copy button. */
.approval-results { margin: 8px 0; }
.approval-result { display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 4px; }
.approval-result p { margin: 2px 0; grid-column: 1; }
.approval-result .message { background: var(--surface); border-radius: 8px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; }
.approvals .approval-result .icon-btn { grid-column: 2; grid-row: 2; align-self: center; color: var(--good); }

/* My requests: the request and when on the left, its status as a pill on the right. */
.my-requests h2 { margin: 0; }
.my-requests .rows.mine li { align-items: flex-start; }
.my-requests .rows.mine .row-main > .link { align-self: flex-start; padding: 6px 0; min-height: 36px; }
.my-requests .rows.mine .confirm { flex-direction: row; align-items: center; gap: 8px; margin-top: 6px; }
.my-requests .approval-status { margin-top: 2px; color: var(--ink-2); font-weight: 700; }
.my-requests .status-approved, .my-requests .status-edited { background: var(--good-soft); color: var(--good); }
.my-requests .status-rejected { background: var(--crit-soft); color: var(--crit); }

.swap-open { padding-left: 0; }
.swap-form { margin-top: 8px; }
.swap-form label:first-of-type { margin-top: 4px; }
.swap-sent { margin-top: 8px; }

/* ask.css */
/* Ask Jay (src/app/ask). Nov 16 redesign: the box in a quiet card, the warning as fine print,
   each answer under its question's bubble. Tokens from web/styles.css only, so dark mode follows
   them. Every selector sits under .ask. */

.ask h1 { margin: 8px 0 4px; }
.ask .card {
  padding: 16px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.ask .ask-box label { margin: 0 0 8px; font-size: 0.9rem; color: var(--ink-2); }
.ask textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  min-height: 96px;
}
.ask textarea:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; border-color: transparent; background: var(--surface); }
.ask form > button[type="submit"] { width: 100%; min-height: 50px; margin-top: 12px; border-radius: 12px; }
.ask .note, .ask .error { margin: 12px 0 0; }
.ask .ask-fine {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 2px 4px;
  font-size: 0.8rem;
  color: var(--ink-2);
}
.ask .ask-fine svg { flex: none; margin-top: 1px; }

.ask .answers { list-style: none; padding: 0; margin: 12px 0 0; }
.ask .answers .asked {
  width: fit-content;
  max-width: 85%;
  margin: 0 0 10px auto;
  padding: 8px 12px;
  border-radius: 14px 14px 4px 14px;
  background: color-mix(in srgb, var(--navy) 12%, var(--surface));
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ask .answers .answer { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ask .answers .sources {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* briefing.css */
/* The Monday briefing and Today's heads-up items (src/app/briefing/). Nov 16 redesign: a few
   tiles for the numbers, one row per list with a count, details a tap away. Only the tokens from
   web/styles.css, so dark mode follows them. Every selector sits under .briefing-card or
   .watch-card, so nothing here restyles the shell (test/web-styles.test.ts). Phone first. */

.briefing-card { padding: 16px; }
.briefing-card .briefing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.briefing-card h2 { font-size: 1.05rem; margin: 0; }
.briefing-card .briefing-week { margin: 2px 0 0; color: var(--ink-2); font-size: 0.85rem; }
.briefing-card .briefing-done {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 700;
}

/* The numbers: two tiles a row. */
.briefing-card .stat-grid {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.briefing-card .stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
}
.briefing-card .stat-label { flex-basis: 100%; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.briefing-card .stat-value {
  flex-basis: 100%;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.briefing-card .stat-change { font-size: 0.85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.briefing-card .stat-change.up { color: var(--good); }
.briefing-card .stat-change.down { color: var(--crit); }
.briefing-card .stat-change.flat { color: var(--ink-2); }
.briefing-card .stat-note { font-size: 0.8rem; color: var(--ink-2); }
.briefing-card .briefing-fine { margin: 6px 2px 0; font-size: 0.75rem; color: var(--ink-2); }
.briefing-card .briefing-stale {
  position: relative;
  margin: 8px 0 0;
  padding-left: 16px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.briefing-card .briefing-stale::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.briefing-card .briefing-empty { margin: 8px 0 0; color: var(--ink-2); }

/* "More on these numbers": a quiet link-like toggle with a chevron. */
.briefing-card .briefing-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 4px;
  padding: 6px 2px;
  background: none;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
}
.briefing-card .briefing-more::after,
.briefing-card .briefing-row > button::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.briefing-card .briefing-more[aria-expanded="true"]::after,
.briefing-card .briefing-row > button[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }

/* The lists: one row each, with how many. */
.briefing-card .briefing-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.briefing-card .briefing-row { border-top: 1px solid var(--line); }
.briefing-card .briefing-row > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 2px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.briefing-card .briefing-row > button::after { color: var(--ink-2); }
.briefing-card .row-icon { flex: none; color: var(--navy); }
.briefing-card .row-title { flex: 1; min-width: 0; }
.briefing-card .row-count {
  flex: none;
  min-width: 30px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.briefing-card .briefing-row.alert .row-icon,
.briefing-card .briefing-row.alert .row-count { color: var(--crit); }
.briefing-card .briefing-row.alert .row-count { background: var(--crit-soft); }
.briefing-card .briefing-row.clear .row-title { color: var(--ink-2); font-weight: 500; }
.briefing-card .briefing-row.clear .row-icon { color: var(--ink-2); }
.briefing-card .briefing-row.clear .row-count { background: var(--good-soft); color: var(--good); font-weight: 700; }

/* What a row or the numbers open to. */
.briefing-card .briefing-detail { margin: 0 0 10px; font-size: 0.9rem; }
.briefing-card .briefing-row .briefing-detail { padding-left: 34px; }
.briefing-card .briefing-detail ul { margin: 0; padding-left: 16px; }
.briefing-card .briefing-detail li { margin: 4px 0; overflow-wrap: anywhere; }
.briefing-card .briefing-detail .tone-alert,
.briefing-card .briefing-detail .tone-down { color: var(--crit); }
.briefing-card .briefing-detail .tone-up { color: var(--good); }
.briefing-card .briefing-sources { margin-top: 8px; font-size: 0.8rem; color: var(--ink-2); }
.briefing-card .briefing-source { margin: 6px 0 0; font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; }

/* Heads-up items under the briefing: quiet cards, a red dot for what's late. */
.watch-card { padding: 14px 16px; }
.watch-card h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.watch-card h2::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crit);
}
.watch-card ul { list-style: none; margin: 8px 0 0; padding: 0; }
.watch-card li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.95rem; overflow-wrap: anywhere; }
.watch-card a { color: var(--navy); font-weight: 700; text-decoration: none; }
.watch-card .watch-overdue { color: var(--crit); }
.watch-card .watch-overdue a { color: inherit; }
.watch-card .watch-source { margin: 4px 0 0; font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; }

/* The email switch (D68): one quiet row under the lists. */
.briefing-card .briefing-email { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 0.9rem; color: var(--ink-2); min-height: 44px; }
.briefing-card .briefing-email input { width: 20px; height: 20px; margin: 0; }

/* Swap suggestions (D71): the action sits under its line, full width on a phone. */
.watch-card .watch-act { display: block; margin: 8px 0 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--navy); border-radius: 8px; background: var(--surface); color: var(--navy); font-weight: 700; }
.watch-card .watch-act:disabled { opacity: 0.6; }
.watch-card .watch-note { margin: 8px 0 0; font-size: 0.9rem; color: var(--ink); }

/* connections.css */
/* The Connections page (src/app/connections). Nov 16 redesign: a summary line with a colored dot,
   then one quiet card with a row per outside source (how it comes in as an icon, its name, its
   status as a pill); the rest opens from the row. Every selector sits under .connections, so
   nothing here restyles the shell. Only web/styles.css's tokens, so dark mode follows them. Phone
   first: long runbook names break, nothing scrolls sideways. A status is always a word; the color
   only backs it up. */

.connections h1 { margin: 8px 0 4px; }
.connections .card {
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}

.connections .connections-summary {
  position: relative;
  margin: 0 0 10px;
  padding-left: 16px;
  font-size: 0.95rem;
  font-weight: 600;
}
.connections .connections-summary::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
}
.connections .connections-summary.stale::before { background: var(--gold); }
.connections .connections-summary.failed::before { background: var(--crit); }

.connections .connections-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 4px 16px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--r);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.connections .connections-item + .connections-item { border-top: 1px solid var(--line); }

.connections .connections-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.connections .connections-row::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.connections .connections-row[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.connections .connections-row:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.connections .connections-icon { flex: none; color: var(--navy); }
.connections .connections-item.off .connections-icon,
.connections .connections-item.unknown .connections-icon { color: var(--ink-2); }
.connections .connections-name { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.connections .connections-item.off .connections-name,
.connections .connections-item.unknown .connections-name { color: var(--ink-2); font-weight: 500; }

.connections .connections-status {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.connections .connections-status.working { color: var(--good); background: var(--good-soft); }
.connections .connections-status.failed { color: var(--crit); background: var(--crit-soft); }
.connections .connections-status.stale { color: var(--ink); }
.connections .connections-status.stale::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: var(--gold);
}

/* What a row opens to. */
.connections .connections-more { padding: 0 2px 12px 32px; font-size: 0.9rem; }
.connections .connections-brings { margin: 0; }
.connections .connections-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--ink-2);
}
/* What it does, what the status means, and the steps to switch it on or use it. */
.connections .connections-meaning { margin: 6px 0 0; color: var(--ink); }
.connections .connections-sub {
  margin: 14px 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.connections .connections-does { margin: 0; line-height: 1.45; }
.connections .connections-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; line-height: 1.45; overflow-wrap: anywhere; }

/* How it comes in: plain words, not a pill, so it doesn't look like something to tap. */
.connections .connections-how { color: var(--ink-2); }
/* An upload's way in: a real button to Money's form, on that report. */
.connections .connections-send {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 700;
  text-decoration: none;
}
.connections .connections-send:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.connections .connections-note { margin: 8px 0 0; }
.connections .connections-item.failed .connections-note { color: var(--crit); }
.connections .connections-runbook {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

/* inbox.css */
/* The Inbox (src/app/inbox): the owner's list, one email, and the builders' Inboxes card. Uses
   web/styles.css's tokens, so dark mode follows them. Phone first: rows wrap, nothing scrolls
   sideways, long addresses and unbroken text break. Nov 16 redesign: the shared pills, rows and
   quiet cards are the owner screens' kit at the top of web/styles/numbers.css (under .owner-ui);
   what's here is the Inbox's own. */

.inbox h1 { margin: 8px 0 4px; }

/* Her inboxes: one row with a pill saying how they are, opening to each inbox and Connect. */
.inbox .inbox-boxes-card { padding: 0 16px; }
.inbox .boxes-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 2px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.inbox .boxes-row .icon { color: var(--navy); }
.inbox .boxes-row.alert .icon { color: var(--crit); }
.inbox .boxes-row .row-title { flex: 1; min-width: 0; }
.inbox .boxes-row::after,
.inbox .mail-row::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.inbox .boxes-row[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.inbox .boxes-detail { padding-bottom: 10px; }
.inbox .inbox-boxes { margin-top: 0; }
.inbox .inbox-boxes li { padding: 8px 0; }
.inbox .connect { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 8px 2px; }
.mailbox-reconnect, .mailbox-failing,
.inbox .row-fine.mailbox-reconnect, .inbox .row-fine.mailbox-failing { color: var(--crit); }

/* Builders' card: a dot before each inbox for how it is. */
.mailboxes h2 { margin: 0; }
.mailboxes .mailbox .row-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--line);
  vertical-align: 1px;
}
.mailboxes .mailbox-connected .row-title::before { background: var(--good); }
.mailboxes .mailbox-reconnect .row-title::before,
.mailboxes .mailbox-failing .row-title::before { background: var(--crit); }
.mailboxes .mailbox-reconnect .row-fine,
.mailboxes .mailbox-failing .row-fine { color: var(--crit); }

/* Needs you, FYI, Done: the count as a small pill, the words on one line. */
.inbox .seg button { white-space: nowrap; font-size: 0.9rem; padding: 6px 6px; }
.inbox .seg button .count {
  display: inline-block;
  min-width: 22px;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.inbox .seg button[aria-pressed="true"] .count { background: color-mix(in srgb, var(--navy) 14%, transparent); color: var(--navy); }

/* The list: one quiet card, one row per email. */
.inbox .mail-empty { padding: 16px; }
.inbox .mail-rows { list-style: none; padding: 0 16px; margin: 4px 0 12px; }
.inbox .mail-rows li + li { border-top: 1px solid var(--line); }
.inbox .mail-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  min-height: 64px;
  padding: 12px 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 400;
  text-align: left;
}
.inbox .mail-row > span { grid-column: 1; min-width: 0; }
/* A chevron pointing right: the row opens the email. */
.inbox .mail-row::after { grid-column: 2; grid-row: 1 / span 3; transform: rotate(-45deg); margin: 0 2px 0 0; opacity: 0.7; }
.inbox .mail-row:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.inbox .mail-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.inbox .mail-from { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.inbox .mail-when { flex: none; font-size: 0.8rem; color: var(--ink-2); }
.inbox .mail-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}
.inbox .mail-where { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
.inbox .mail-to { font-size: 0.8rem; color: var(--ink-2); overflow-wrap: anywhere; }
.inbox .mail-where .pill { font-size: 0.75rem; padding: 0 8px; }

.chip {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--good);
  background: var(--good-soft);
  border-radius: 999px;
  padding: 1px 8px;
}

/* One email */
.inbox .back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 40px;
  margin-top: 6px;
  padding: 6px 10px 6px 2px;
  background: none;
  color: var(--navy);
  font-weight: 700;
}
.mail-subject { font-size: 1.2rem; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.inbox .mail-meta { margin: 2px 0; font-size: 0.85rem; color: var(--ink-2); overflow-wrap: anywhere; }
.inbox .mail-from-line { color: var(--ink); font-weight: 600; }
.inbox .mail-attach {
  display: inline-block;
  margin: 8px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
}
.mail-text {
  margin: 12px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.mail-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--navy); font-weight: 700; text-decoration: none; }
.mail-problem button { margin-top: 10px; }
.mail-problem .note, .mail-problem .error { margin: 10px 0 0; }
.inbox .mail-draft h2 { margin: 0 0 6px; }

.mail-reply textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  min-height: 120px;
}
.inbox .mail-reply label { margin-top: 0; font-size: 0.9rem; }
.inbox .mail-reply button[type="submit"] { width: 100%; margin-top: 12px; }

/* Mark done is the main button; moving it is a quiet link beside it. */
.mail-actions { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.mail-actions button:not(.link) { flex: 1; }

/* Routing an email on (D72): a partner's page, Add to Partners, or its PDF into Money. */
.mail-route { display: flex; flex-direction: column; gap: 10px; }
.mail-route p { margin: 0; }
.mail-route a { color: var(--navy); font-weight: 700; }
.mail-route .mail-route-link { display: inline-flex; align-items: center; min-height: 44px; }
.mail-route button { min-height: 44px; }

/* issues.css */
/* The equipment log and the report-a-problem form. Uses web/styles.css's tokens, so dark mode
   follows them. */

.report-problem textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  min-height: 88px;
}

.report-problem input[type="file"] {
  width: 100%;
  font: inherit;
  color: var(--ink-2);
  padding: 10px 0;
}
.report-problem input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-right: 12px;
  min-height: 44px;
  background: var(--bg);
  color: var(--navy);
  cursor: pointer;
}

.photo-added { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

.report-problem .actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.report-problem .actions button[type="submit"] { flex: 1; }
.report-problem .note, .report-problem .error { margin: 12px 0 0; }

.thumb {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.thumb-link { display: inline-block; margin-top: 8px; }

/* The log (Nov 16 redesign): quiet cards, one row per problem with who and when, its details and
   photo a tap away, a small tick to mark it fixed. Every selector sits under .equipment-log. */
.equipment-log .card {
  padding: 16px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.equipment-log .report-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  margin: 4px 0 0;
  border-radius: 12px;
}
.equipment-log .report-problem h2 { font-size: 1.05rem; }

.equipment-log .log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.equipment-log .log-head h2 { margin: 0; font-size: 1.05rem; }
.equipment-log .log-count {
  flex: none;
  min-width: 30px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--crit-soft);
  color: var(--crit);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.equipment-log .log-count.none { background: var(--good-soft); color: var(--good); font-weight: 700; }
.equipment-log .log-open > .muted { margin: 8px 0 0; }

.equipment-log .problems { list-style: none; margin: 8px 0 0; padding: 0; }
.equipment-log .problem { border-top: 1px solid var(--line); }
.equipment-log .problem-row { display: flex; align-items: center; gap: 6px; }
.equipment-log .problem-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 2px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.equipment-log button.problem-open::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.equipment-log button.problem-open[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.equipment-log button.problem-open:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.equipment-log .problem-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
.equipment-log .fixed-problems .problem-dot { background: var(--good); }
.equipment-log .problem-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.equipment-log .problem-title { overflow-wrap: anywhere; }
.equipment-log .fixed-problems .problem-title { color: var(--ink-2); }
.equipment-log .problem-meta { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); }
.equipment-log .problem-photo-mark { flex: none; color: var(--ink-2); }
.equipment-log .problem-more { padding: 0 2px 12px 22px; font-size: 0.95rem; }
.equipment-log .problem-detail { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.equipment-log .problem-more .muted { margin: 8px 0 0; }

.equipment-log .fix-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
}
.equipment-log .fix-icon:hover, .equipment-log .fix-icon:focus-visible { color: var(--good); background: var(--good-soft); }
.equipment-log .problem-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 12px 22px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 0.95rem;
  font-weight: 600;
}
.equipment-log .problem-confirm > div { display: flex; align-items: center; gap: 12px; }
.equipment-log .fix-yes {
  min-height: 40px;
  padding: 8px 14px;
  background: var(--good);
  color: var(--surface);
  font-size: 0.9rem;
  white-space: nowrap;
}
.equipment-log .reopen {
  flex: none;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.85rem;
}

.equipment-log .fixed-problems > h2 { margin: 0; }
.equipment-log .log-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 2px;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: left;
}
.equipment-log .log-toggle .toggle-title { flex: 1; }
.equipment-log .log-toggle::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.equipment-log .log-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.equipment-log .log-toggle:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* Today integration: the form "Report a problem" opens in place under a checklist item. The small
   flag that opens it is styled with the checklist in web/styles.css (Nov 16). */
.checklist .report-problem { margin: 6px 0 10px; padding: 14px; background: var(--bg); }
.checklist .report-problem h2 { font-size: 1rem; }
.checklist .reported { margin: 0 0 8px 40px; font-size: 0.85rem; padding: 6px 10px; }
/* Undo the checklist row styles (web/styles.css) inside the form. */
.checklist .report-problem label {
  display: block;
  min-height: 0;
  margin: 12px 0 6px;
  font-weight: 600;
  cursor: default;
}
.checklist li.done .report-problem span { color: inherit; text-decoration: none; }

/* marketing.css */
/* The Marketing tab and the filming to-dos on Today (src/app/marketing). Phone first: everything
   stacks in one column at 390 px, nothing scrolls sideways. Colours are the tokens in
   web/styles.css, so dark mode follows them. */

.marketing textarea, .filming textarea, .shoot-form textarea,
.marketing input[type="date"], .marketing input[type="time"],
.filming input[type="date"], .filming input[type="time"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.marketing textarea, .shoot-form textarea { resize: vertical; }
.marketing .actions, .filming .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; }
.marketing button.secondary, .filming button.secondary {
  background: var(--surface);
  color: var(--navy);
  border: 1px solid var(--line);
}
.marketing h3, .filming h3 { font-size: 1rem; margin: 0 0 4px; }

/* Two fields side by side (day and time), stacking when the phone is narrow. */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair label { margin-top: 12px; }
@media (max-width: 340px) { .pair { grid-template-columns: 1fr; } }

/* Calendar */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.month-nav h2 { color: var(--navy); text-align: center; flex: 1; }
.week h3 { color: var(--ink-2); font-weight: 700; }
.posts li { align-items: flex-start; }
.post-when { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.chip {
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--bg);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.chip.status-scheduled, .chip.status-posted, .chip.approval-approved, .chip.approval-edited, .chip.done {
  background: var(--good-soft); color: var(--good); border-color: transparent;
}
.chip.approval-pending { background: var(--gold); color: var(--on-gold); border-color: transparent; }
.chip.approval-rejected, .chip.missed { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.chip.status-skipped { text-decoration: line-through; }

/* A caption as the post will read: facts underlined, unknown keys marked. */
.preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 6px 0;
}
.preview .fact { text-decoration: underline dotted var(--navy); text-underline-offset: 3px; }
.preview mark.missing { background: var(--crit-soft); color: var(--crit); border-radius: 4px; padding: 0 2px; }
.preview-head { margin-top: 12px; }
.filming-line { margin: 2px 0 0; }

/* Post editor */
.post-editor .channels { border: 0; padding: 0; margin: 12px 0 0; }
.post-editor .channels legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.post-editor .check { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 0 0; font-weight: 500; }
.post-editor .check input { width: 22px; height: 22px; }
.post-filming { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.shoot-form { margin-top: 8px; }
.shoot-form input[type="date"], .shoot-form input[type="time"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

/* Ideas */
.idea-text { margin: 0; overflow-wrap: anywhere; }
.idea-actions { display: flex; flex-direction: column; align-items: flex-end; }

/* Results: a short bar per week for Join clicks and new members, scaled to the busiest week. */
.result-weeks h3 { margin: 0; }
.bars { display: grid; gap: 3px; margin: 6px 0; }
/* Scoped under .results: the app's top bar is also .bar (test/web-styles.test.ts). */
.results .bar { display: inline-block; height: 6px; border-radius: 3px; min-width: 2px; }
.results .bar.clicks { background: var(--navy); }
.results .bar.members { background: var(--good); }
.results .legend .bar { width: 14px; margin: 0 4px 0 8px; vertical-align: middle; }

/* Filming to-dos on Today */
.filming h2 { margin-bottom: 4px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.filming-task button.secondary { margin-top: 8px; width: 100%; }
.shots { padding-left: 22px; margin: 8px 0; }
.shot { padding: 6px 0; border-top: 1px dashed var(--line); }
.shot:first-child { border-top: 0; }
.shot > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shot-file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.film label { margin: 8px 0 4px; font-weight: 600; }
.film input[type="file"] { width: 100%; max-width: 100%; font: inherit; color: var(--ink-2); }
.film input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-right: 10px;
  background: var(--gold);
  color: var(--on-gold);
}
.who-films { color: var(--ink-2); }

/* Publishing to Facebook and Instagram (D41): the card on the calendar, and each post's line per
   channel. Scoped under .marketing; .publish-* names are this feature's own. */
.marketing .publishing h2 { margin-bottom: 4px; }
.marketing .publishing p { margin: 6px 0 0; overflow-wrap: anywhere; }
.marketing .publishing .snow-line { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.marketing .post-cell { flex: 1; min-width: 0; }
.marketing .publish-lines { margin: 4px 0 0; }
.marketing .publish-line { margin: 2px 0 0; overflow-wrap: anywhere; color: var(--ink-2); }
.marketing .publish-line.publish-published { color: var(--good); }
.marketing .publish-line.publish-failed { color: var(--crit); }
.marketing .publish-line a { color: inherit; font-weight: 700; }
.marketing .publish-line button.link { margin-left: 2px; }

/* Small phones (Nov 24 phone pass): the "Add a filming to-do" link took its own column and
   squeezed the post to a few words a line. Stack it under the post instead. */
@media (max-width: 380px) {
  .posts li.post-row { flex-direction: column; align-items: stretch; }
  .posts li.post-row > button.link { align-self: flex-start; min-height: 44px; }
}

/* money.css */
/* Money: report uploads, bills and the 13-week cash projection. Uses web/styles.css's tokens, so
   dark mode follows them. Phone first: everything stacks, nothing scrolls sideways. Nov 16
   redesign: the shared tiles, pills, toggles and quiet cards are the owner screens' kit at the
   top of web/styles/numbers.css (under .owner-ui); what's here is Money's own. */

.money-uploads form > button[type="submit"],
.cash-inputs > button[type="submit"] { width: 100%; margin-top: 14px; }

.money-uploads h2,
.cash-projection h2 { margin: 0; }
.money-uploads label,
.cash-projection label { font-size: 0.9rem; margin: 12px 0 6px; }

.money-uploads input[type="date"],
.money-uploads input[type="month"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  min-height: 48px;
}

.money-file {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink-2);
  padding: 6px 0;
}
.money-file::file-selector-button {
  font: inherit;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-right: 12px;
  min-height: 44px;
  background: var(--bg);
  color: var(--navy);
  cursor: pointer;
}

.money-site { font-weight: 700; margin: 12px 0 0; }

/* Two fields side by side (From and To; the two property tax halves), stacked when narrow. */
.money-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money-range > div { min-width: 0; }
@media (max-width: 340px) { .money-range { grid-template-columns: 1fr; } }

.money-outcome { margin: 12px 0 0; }
.money-outcome p { margin: 0; }
.money-outcome p + p { margin-top: 6px; }

/* Recent reports and bills: one row each, a pill or an icon button on the right. */
.money-uploads .money-rows { margin-top: 10px; }
.money-uploads .money-rows .icon-btn { margin-right: -8px; }

/* Whether Sonny's report emails are coming in: a quiet line, red with a dot when the last one
   wasn't saved. */
.money-uploads .money-email { margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-2); overflow-wrap: anywhere; }
.money-uploads .money-email.warn { position: relative; padding-left: 16px; color: var(--crit); }
.money-uploads .money-email.warn::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crit);
}

/* The cash projection: tiles, then one line per week (dates, bar, amount). */
.cash-projection .cash-legend { margin: 14px 0 0; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }

.cash-projection .cash-weeks { list-style: none; padding: 0; margin: 4px 0 2px; }
.cash-projection .cash-week {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  column-gap: 10px;
  min-height: 36px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.cash-projection .cash-week:first-child { border-top: 0; }
.cash-projection .cash-dates { font-size: 0.8rem; line-height: 1.25; color: var(--ink-2); }
.cash-projection .cash-week.lowest .cash-dates { color: var(--ink); font-weight: 700; }
.cash-projection .cash-amount { font-size: 0.95rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.cash-projection .cash-week.below .cash-amount { color: var(--crit); }
.cash-projection .cash-below { font-weight: 600; font-size: 0.8rem; }

.cash-projection .cash-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}
.cash-projection .cash-bar span { display: block; height: 100%; border-radius: 999px; background: var(--navy); }
.cash-projection .cash-week.lowest .cash-bar span { background: var(--gold); }

.cash-projection .cash-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.cash-projection .cash-tags .pill { white-space: normal; }

.cash-inputs input[type="text"] { font-variant-numeric: tabular-nums; }
.cash-projection .error { margin: 12px 0 0; }

/* numbers.css */
/* The owner's numbers: the Numbers screen, the Money overview and the managers' member card.
   Only the tokens from web/styles.css, so dark mode follows them. Phone first: nothing wider than
   the card, no tables. */

/* ---- The owner screens' kit (src/app/numbers/ui.tsx), Nov 16 redesign ----
   Numbers, Money, Approvals and the Inbox put `owner-ui` on their root and share these: quiet
   cards, tiles, pills, a toggle that opens details in place, rows and small icon buttons. They
   copy the briefing's and Today's looks (web/styles/briefing.css, `.today .card`) so the screens
   read as one app. Everything sits under .owner-ui (test/web-styles.test.ts), inside :where() so
   it adds no specificity: a feature's own rule always wins, whatever order the files load in.
   To move to web/styles.css once other screens want it. */

:where(.owner-ui) .card,
:where(.owner-ui).card {
  padding: 16px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
:where(.owner-ui) h2 { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
:where(.owner-ui) .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
:where(.owner-ui) .card-head h2 { margin: 0; min-width: 0; }
:where(.owner-ui) .card-sub { margin: 0; font-size: 0.85rem; color: var(--ink-2); text-align: right; }
:where(.owner-ui) .fine { margin: 6px 0 0; font-size: 0.75rem; line-height: 1.4; color: var(--ink-2); }
:where(.owner-ui) .empty { margin: 8px 0 0; color: var(--ink-2); }
:where(.owner-ui) .source { margin: 6px 0 0; font-size: 0.75rem; line-height: 1.4; color: var(--ink-2); overflow-wrap: anywhere; }

/* Out of date: a quiet line with a gold dot, shown without a tap (DESIGN.md rule 3). */
:where(.owner-ui) .stale-line {
  position: relative;
  margin: 8px 0 0;
  padding-left: 16px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
:where(.owner-ui) .stale-line::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

/* Tiles: label, big figure, change, a few words. Two a row. */
:where(.owner-ui) .stat-grid {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
:where(.owner-ui) h2 + .stat-grid { margin-top: 10px; }
:where(.owner-ui) .stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
}
:where(.owner-ui) .stat-label { flex-basis: 100%; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
:where(.owner-ui) .stat-value {
  flex-basis: 100%;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
:where(.owner-ui) .stat-value.none { font-size: 1rem; line-height: 1.9; font-weight: 700; color: var(--ink-2); letter-spacing: 0; }
:where(.owner-ui) .stat-change { font-size: 0.85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
:where(.owner-ui) .stat-change.up { color: var(--good); }
:where(.owner-ui) .stat-change.down { color: var(--crit); }
:where(.owner-ui) .stat-change.flat { color: var(--ink-2); }
:where(.owner-ui) .stat-note { font-size: 0.8rem; color: var(--ink-2); }
:where(.owner-ui) .stat.below .stat-value { color: var(--crit); }

/* Pills for counts and states: soft background, bold short word. */
:where(.owner-ui) .pill {
  display: inline-block;
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
:where(.owner-ui) .pill.good { background: var(--good-soft); color: var(--good); }
:where(.owner-ui) .pill.crit { background: var(--crit-soft); color: var(--crit); }
:where(.owner-ui) .pill.gold { background: var(--gold); color: var(--on-gold); }
:where(.owner-ui) .pill.quiet { color: var(--ink-2); font-weight: 700; }

/* The toggle that opens details or a source in place: link-like, with a chevron. */
:where(.owner-ui) .reveal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 4px;
  padding: 6px 2px;
  border-radius: 8px;
  background: none;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
}
:where(.owner-ui) .reveal::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
:where(.owner-ui) .reveal[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
:where(.owner-ui) .reveal-detail { margin: 0 0 6px; font-size: 0.9rem; }
:where(.owner-ui) .reveal-detail p { margin: 4px 0; overflow-wrap: anywhere; }
:where(.owner-ui) .reveal-detail .hint { font-size: 0.85rem; }

/* Rows: a title, a line under it, and an amount or pill on the right. */
:where(.owner-ui) .rows li { align-items: center; min-height: 52px; padding: 8px 0; }
:where(.owner-ui) .row-main { flex: 1; display: flex; flex-direction: column; gap: 1px; }
:where(.owner-ui) .row-title { font-weight: 600; overflow-wrap: anywhere; }
:where(.owner-ui) .row-sub { font-size: 0.85rem; color: var(--ink-2); }
:where(.owner-ui) .row-fine { font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; }
:where(.owner-ui) .amount { flex: none; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
:where(.owner-ui) .amount.none { font-weight: 600; font-size: 0.85rem; color: var(--ink-2); }

/* Links read as quiet buttons, not underlined text; small icon buttons for the rest. */
:where(.owner-ui) button.link { text-decoration: none; font-weight: 700; }
:where(.owner-ui) .icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
}
:where(.owner-ui) .icon-btn:hover,
:where(.owner-ui) .icon-btn:focus-visible { background: var(--bg); color: var(--navy); }
:where(.owner-ui) .icon { flex: none; }

/* ---- The Numbers screen ---- */

/* The four tiles open their details, one at a time, under them. */
.numbers-glance .stat { padding: 0; }
.numbers-glance .stat > button {
  position: relative;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: flex-start;
  column-gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font-weight: 400;
  text-align: left;
}
.numbers-glance .stat > button::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 14px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  opacity: 0.6;
  transition: transform 0.15s ease;
}
.numbers-glance .stat > button[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--navy); }
.numbers-glance .stat > button[aria-expanded="true"]::after { transform: rotate(-135deg); top: 19px; opacity: 1; }
.numbers-glance .stat > button:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.numbers-glance .stat.stale .stat-label::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: 1px;
}

/* Progress toward the members goal: a slim bar, the numbers in words under it. */
.numbers-glance .goal { margin-top: 12px; }
.numbers-glance .goal-bar { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.numbers-glance .goal-bar span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.numbers-glance .goal-words { margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* What a tile opens to. */
.numbers-detail { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.numbers-detail p { margin: 4px 0; overflow-wrap: anywhere; }
.numbers-detail .hint { font-size: 0.85rem; color: var(--ink-2); }

/* This week in words: one sentence per line, a dot for which way it went. */
.numbers-glance .changes { list-style: none; padding: 0; margin: 0; }
.numbers-glance .change { position: relative; border-top: 1px solid var(--line); padding: 8px 0 8px 20px; overflow-wrap: anywhere; }
.numbers-glance .change:first-child { border-top: 0; }
.numbers-glance .change::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.numbers-glance .change.up::before { background: var(--good); }
.numbers-glance .change.down::before { background: var(--crit); }
.numbers-glance .change.stale::before { background: var(--gold); }
.numbers-glance .change.stale { color: var(--ink-2); }
/* A sentence's tone "note" shares its name with the app's green .note box: keep it a plain line. */
.numbers-glance .change.note { background: none; border-radius: 0; padding: 8px 0 8px 20px; }

/* Plan mix: name and count on one line, its billing (or "not mapped") under it, a thin share bar. */
.plan-mix .mix { list-style: none; padding: 0; margin: 8px 0 0; }
.plan-mix .mix li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.plan-mix .mix-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.plan-mix .mix-count { order: 1; flex: none; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-mix .mix-detail { order: 2; flex-basis: 100%; font-size: 0.8rem; color: var(--ink-2); }
.plan-mix .unmapped .mix-detail { font-style: italic; }
.plan-mix .mix-bar { order: 3; flex-basis: 100%; display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.plan-mix .mix-bar i { display: block; height: 100%; border-radius: inherit; background: var(--navy); }

/* The manager's member card on Today: two tiles. */
.member-count h2 { margin: 0; }

/* ---- The Money overview: payroll and hours ---- */
.money-overview .today-head { margin-top: 18px; }
.money-overview .card h2 { margin: 0; }
.money-overview .rows { margin-top: 6px; }

/* offline.css */
/* The offline line above the app (src/app/offline.tsx) and the invite email's result on Team
   (src/app/Team.tsx). Uses the tokens in web/styles.css; gold with --on-gold reads the same in
   light and dark mode. */

/* Empty takes no room but stays in the page, so a screen reader hears the line when it appears. */
.offline-slot {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 11;
  padding-top: 8px;
}
.offline-slot:empty { padding-top: 0; }
.offline-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 700;
}

.sent [role="status"] { margin: 8px 0 0; font-weight: 700; color: var(--good); }
.sent .error { margin: 8px 0 0; }

/* partners.css */
/* Partners (src/app/partners). Uses only the tokens in web/styles.css, so dark mode follows them.
   Phone first: stages stack as sections, cards fill the width, nothing scrolls sideways. */

.partners-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.partners-head h1 { margin: 0; }
.partners-head button { flex: none; }
.partners-overdue { color: var(--crit); font-weight: 700; margin: 8px 0 0; }

.partner-stage h2 .muted { font-weight: 500; }
.partner-cards { list-style: none; padding: 0; margin: 10px 0 0; }
.partner-cards li + li { margin-top: 8px; }
.partner-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.partner-name { font-weight: 700; }
.partner-kind { font-size: 0.85rem; color: var(--ink-2); }
.partner-payout { font-size: 0.85rem; font-weight: 700; }

.partners .step { margin: 0; }
.partners .step.none { font-size: 0.9rem; color: var(--ink-2); }
.partners .step.overdue { color: var(--crit); font-weight: 700; }

.partners button.back { padding-left: 0; }
.partner-head h1 { margin-bottom: 4px; overflow-wrap: anywhere; }
.partner-head p { margin: 0; }
.partner-contact { margin-top: 6px; overflow-wrap: anywhere; }

.partners textarea,
.partners input[type="date"] {
  width: 100%;
  min-height: 48px;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.partners textarea { resize: vertical; }

/* Two dates side by side; the next step's text takes the whole row. */
.partner-step-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.partner-step-fields .wide { grid-column: 1 / -1; }
.partner-step-form .link, .partner-form .link { display: block; margin: 6px auto 0; }

.note-kind {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}
.note-body { margin: 2px 0; white-space: pre-wrap; }

.partner-money h3 { font-size: 1rem; margin: 18px 0 0; }
.partner-due { margin: 8px 0 0; }
.partner-wash-items { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 0.9rem; }
.partner-rate {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.9rem;
}

/* House accounts (src/app/partners/HouseAccounts.tsx): tiles for the month, one row per account
   with a pill (a total in navy, "Rates needed" in gold), the statement a tap away. DESIGN.md. */
.partners .ha-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 12px 16px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}
.partners .ha-entry-title { font-size: 1rem; font-weight: 600; }
.partners .ha-entry-sub { font-size: 0.85rem; font-weight: 400; color: var(--ink-2); }

.partners .ha-month { padding: 16px; }
.partners .ha-pick { display: flex; align-items: center; gap: 12px; }
.partners .ha-pick label { margin: 0; font-weight: 600; }
.partners .ha-pick select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.partners .ha-stats {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.partners .ha-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
}
.partners .ha-stat-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.partners .ha-stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.partners .ha-stat-value.need { font-size: 1.05rem; padding-top: 4px; }
.partners .ha-stat-note { font-size: 0.8rem; color: var(--ink-2); }

.partners .ha-alert { margin: 12px 0 0; color: var(--crit); font-weight: 700; }
.partners .ha-stale {
  position: relative;
  margin: 8px 0 0;
  padding-left: 16px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.partners .ha-stale::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.partners .ha-rows { list-style: none; margin: 12px 0 0; padding: 0; }
.partners .ha-row { border-top: 1px solid var(--line); }
.partners .ha-row > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 2px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  text-align: left;
}
.partners .ha-row > button::after,
.partners .ha-more::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.partners .ha-row > button[aria-expanded="true"]::after,
.partners .ha-more[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.partners .ha-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.partners .ha-row-title { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.partners .ha-row-sub { font-size: 0.85rem; font-weight: 400; color: var(--ink-2); }
.partners .ha-pill {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.partners .ha-pill.need { background: var(--gold); color: var(--on-gold); }

.partners .ha-detail { margin: 0 0 12px; font-size: 0.9rem; }
.partners .ha-lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.partners .ha-lines th,
.partners .ha-lines td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.partners .ha-lines th:first-child { text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.partners .ha-lines thead th { font-size: 0.75rem; font-weight: 700; color: var(--ink-2); }
.partners .ha-lines tfoot th,
.partners .ha-lines tfoot td { border-bottom: none; }
.partners .ha-lines .ha-total th,
.partners .ha-lines .ha-total td { font-weight: 800; border-top: 2px solid var(--ink); }
.partners .ha-lines .need { color: var(--ink-2); font-style: italic; }
.partners .ha-missing { margin: 8px 0 0; padding-left: 18px; color: var(--ink); }
.partners .ha-fine { margin: 6px 0 0; font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; }
.partners .ha-invoice { margin-top: 12px; width: 100%; }
.partners .ha-all { display: block; margin: 8px 0 0; }

.partners .ha-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 8px;
  padding: 6px 2px;
  background: none;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
}
.partners .ha-sources p { margin: 6px 0 0; font-size: 0.8rem; color: var(--ink-2); overflow-wrap: anywhere; }

/* The invoice-ready statement. */
.partners .ha-actions { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.partners .ha-print { padding: 20px 16px; }
.partners .ha-print h1 { margin: 16px 0 2px; }
.partners .ha-print h2 { font-size: 0.85rem; margin: 16px 0 4px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.partners .ha-print p { margin: 0; }
.partners .ha-from-name { font-weight: 800; font-size: 1.05rem; }
.partners .ha-bill-to { overflow-wrap: anywhere; }
.partners .ha-print .ha-lines { margin-top: 16px; }

/* Printing the statement: only the statement, in black on white. Anchored on .ha-print, so it
   applies only while the invoice-ready view is on screen; every other screen prints as it is. */
@media print {
  #app:has(.ha-print) > :not(.partners) { display: none; }
  .partners .ha-noprint { display: none; }
  .partners .ha-print {
    border: none;
    box-shadow: none;
    padding: 0;
    color: #000;
    background: #fff;
  }
  .partners .ha-print .ha-lines th,
  .partners .ha-print .ha-lines td,
  .partners .ha-print .ha-fine,
  .partners .ha-print h2 { color: #000; border-color: #000; }
}

/* A follow-up Jay drafted (D73): open it in her own mail. */
.note-mail { display: inline-block; margin-top: 4px; font-weight: 700; color: var(--navy); }

/* reviews.css */
/* Google reviews (src/app/reviews/). DESIGN.md: the figures lead in tiles; one row per review with
   the stars, who, a short text and a pill; the full review and its reply a tap away. Only the tokens
   from web/styles.css, so dark mode follows them. Every selector sits under .reviews, so nothing here
   restyles the shell (test/web-styles.test.ts). Phone first. */

.reviews .reviews-card,
.reviews .reviews-google { padding: 16px; }
.reviews .reviews-card h2,
.reviews .reviews-google h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.reviews .reviews-google .actions { margin-top: 10px; }
.reviews .reviews-google .small { font-size: 0.85rem; }
.reviews .reviews-google .warn { color: var(--crit); font-weight: 600; }

/* The figures: three tiles, one row on a phone. */
.reviews .reviews-stats {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.reviews .reviews-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
}
.reviews .reviews-stat-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.reviews .reviews-stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.reviews .reviews-stat.alert .reviews-stat-value { color: var(--crit); }

/* One row per review. */
.reviews .reviews-rows { list-style: none; margin: 12px 0 0; padding: 0; }
.reviews .reviews-row { border-top: 1px solid var(--line); }
.reviews .reviews-row > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 2px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  text-align: left;
}
.reviews .reviews-row > button::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.reviews .reviews-row > button[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.reviews .reviews-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reviews .reviews-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.reviews .reviews-stars { flex: none; color: var(--gold); letter-spacing: 1px; font-size: 0.95rem; }
.reviews .reviews-who { min-width: 0; font-size: 1rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reviews .reviews-short { font-size: 0.85rem; color: var(--ink-2); overflow-wrap: anywhere; }

/* Pills, not prose, for state. */
.reviews .reviews-pill {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}
.reviews .reviews-pill.navy { color: var(--navy); }
.reviews .reviews-pill.good { background: var(--good-soft); color: var(--good); }
.reviews .reviews-pill.alert { background: var(--crit-soft); color: var(--crit); }

/* What a row opens to. */
.reviews .reviews-detail { padding: 0 2px 12px; font-size: 0.95rem; }
.reviews .reviews-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.reviews .reviews-meta { margin: 6px 0 0; font-size: 0.75rem; color: var(--ink-2); }
.reviews .reviews-reply {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
}
.reviews .reviews-reply-label { margin: 0 0 2px; font-size: 0.75rem; font-weight: 700; color: var(--ink-2); }
.reviews .reviews-reply-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.reviews .reviews-line { margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.reviews .reviews-failed { margin: 8px 0 0; color: var(--crit); font-size: 0.9rem; }
.reviews .reviews-failed p { margin: 0 0 8px; overflow-wrap: anywhere; }
.reviews .reviews-empty { margin: 12px 0 0; }

/* Drafting a reply. */
.reviews .reviews-draft { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; }
.reviews .reviews-draft label { font-weight: 600; font-size: 0.9rem; }
.reviews .reviews-draft textarea { width: 100%; min-height: 96px; box-sizing: border-box; font: inherit; }
.reviews .reviews-hint { margin: 0; font-size: 0.75rem; color: var(--ink-2); }

/* shifts.css */
/* The Team tab (src/app/TeamTab.tsx): People (src/app/Team.tsx) and the roster (src/app/shifts),
   plus the Today screen's shift card. Nov 16 redesign: quiet cards, one row per person or shift
   with a pill, details and forms a tap away. Tokens from web/styles.css only, so dark mode
   follows them. Every selector sits under .team-tab, .team-people, .roster or .shift-card. */

/* The Today screen's shift card. */
.shift-card p { margin: 0; }
.shift-card strong { font-weight: 700; }
.shift-card h2 { font-size: 1rem; }
.shift-card ul { margin: 6px 0 0; padding-left: 20px; }

/* Quiet cards, like Today's. */
.team-tab .card {
  padding: 16px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.team-tab .card > h2 { margin: 0; }

/* A folded form's toggle ("Invite someone", "Add a shift"): an icon tile, the title, a chevron. */
.team-tab .team-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 2px;
  border-radius: 10px;
  background: none;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: left;
}
.team-tab .team-toggle > span { flex: 1; min-width: 0; }
.team-tab .team-icon {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--navy);
}
.team-tab .team-toggle::after,
.team-people .team-row-main::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 6px 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.team-tab .team-toggle[aria-expanded="true"]::after,
.team-people .team-row-main[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.team-tab .team-toggle:focus-visible,
.team-people .team-row-main:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

.team-tab input[type="time"] {
  width: 100%;
  min-height: 48px;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.team-tab .hint { margin: 8px 0 0; font-size: 0.85rem; }
.team-tab .error { margin: 12px 0 0; }

/* People: a count pill per group, then one row each. */
.team-people .team-group-head,
.roster .roster-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-people .team-group-head h2,
.roster .roster-head h2 { margin: 0; font-size: 1.05rem; }
.team-people .team-count,
.roster .roster-count {
  flex: none;
  min-width: 30px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.team-people .team-count.none,
.roster .roster-count.none { background: var(--good-soft); color: var(--good); font-weight: 700; }

.team-people .team-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.team-people .team-row { border-top: 1px solid var(--line); }
.team-people .team-row-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 2px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.team-people .team-row-main::after { color: var(--ink-2); }
.team-people .avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--navy) 13%, var(--surface));
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.team-people .avatar.waiting { background: none; border: 1.5px dashed var(--ink-2); color: var(--ink-2); }
.team-people .team-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.team-people .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-people .team-sub { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); }
.team-people .team-role {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 700;
}
.team-people .team-detail { padding: 0 2px 12px 48px; font-size: 0.9rem; }
.team-people .team-email { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.team-people .team-fine { margin: 2px 0 0; font-size: 0.8rem; color: var(--ink-2); }
.team-people .warn { margin: 8px 0 0; color: var(--ink); font-weight: 600; }
.team-people .team-remove {
  min-height: 40px;
  margin-top: 4px;
  padding: 6px 0;
  background: none;
  color: var(--crit);
  font-size: 0.9rem;
  font-weight: 700;
}
.team-people .team-confirm,
.roster .shift-confirm > div { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.team-people .team-yes,
.roster .shift-yes {
  min-height: 40px;
  padding: 8px 14px;
  background: var(--crit-soft);
  color: var(--crit);
  font-size: 0.9rem;
}

/* A person's Homebase Payroll ID (D57): a label, a short field and Save on one line. */
.team-people .team-payroll { margin-top: 10px; display: grid; gap: 4px; }
.team-people .team-payroll label { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); }
.team-people .team-payroll-row { display: flex; gap: 8px; align-items: center; }
.team-people .team-payroll-row input { flex: 1; min-width: 0; max-width: 14rem; min-height: 40px; }
.team-people .team-payroll-row button { min-height: 40px; padding: 8px 14px; font-size: 0.9rem; }
.team-people .team-payroll-row button:disabled { opacity: 0.45; cursor: default; }
.team-people .team-payroll .error { margin: 0; font-size: 0.85rem; }

/* After inviting: the message to send, then Email, Share and Copy as quiet buttons. */
.team-people .sent { margin-top: 12px; }
.team-people .sent > p:first-child { margin: 0; font-weight: 700; font-size: 0.95rem; }
.team-people .sent .message { margin: 8px 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.team-people .sent .links { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.team-people .sent .links .link {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

/* The roster: a day switcher, then one row per shift with its times as a column. */
.roster .roster-days {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06);
}
.roster .roster-days button {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  background: var(--bg);
  color: var(--navy);
}
.roster .roster-day { flex: 1; min-width: 0; margin: 0; text-align: center; font-weight: 700; font-size: 0.95rem; }
.roster .back-today { display: block; margin: 0 auto; font-size: 0.9rem; text-decoration: none; }

.roster .roster-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.roster .roster-rows > li { border-top: 1px solid var(--line); }
.roster .shift-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; }
.roster .shift-time {
  flex: none;
  width: 84px;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.roster .shift-start { font-weight: 800; }
.roster .shift-end { font-size: 0.8rem; color: var(--ink-2); }
.roster .shift-who { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 12px; border-left: 2px solid var(--line); }
.roster .mine .shift-who { border-left-color: var(--sky); }
.roster .shift-name { font-weight: 600; overflow-wrap: anywhere; }
.roster .shift-station { font-size: 0.85rem; color: var(--ink-2); }
.roster .shift-from {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 700;
}
.roster .shift-remove {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  opacity: 0.75;
}
.roster .shift-remove:hover, .roster .shift-remove:focus-visible { opacity: 1; color: var(--crit); background: var(--crit-soft); }
.roster .shift-confirm { padding: 0 0 12px 96px; }
.roster .shift-confirm .warn { margin: 0; color: var(--ink); font-weight: 600; }
.roster .roster-fine { margin: 8px 0 0; font-size: 0.75rem; color: var(--ink-2); }

.roster .roster-add #roster-add-form > .hint:first-child { margin-top: 4px; }
.roster .shift-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Small phones (Nov 24 phone pass): at 320px the role badge cut names to "Mia Ma...". Let the
   name wrap instead, and keep the badge compact. */
@media (max-width: 380px) {
  .team-people .team-name { white-space: normal; overflow-wrap: anywhere; }
  .team-people .team-role { padding: 2px 8px; font-size: 0.72rem; }
}

/* training.css */
/* Training: the module list, a module's lesson and quiz, and the team's progress
   (src/app/training). Nov 16 redesign: a bar for what's finished, one row per module, rings for
   progress and quiz scores, quiet cards. Tokens from web/styles.css only, so dark mode follows
   them. Every selector sits under .training (TrainingScreen's main), so nothing here reaches
   another screen. Phone first: nothing wider than the screen, tap targets at least 44px. */

.training .card {
  padding: 16px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}

/* My training / My team uses the shared .seg switch (web/styles.css). */

.training .training-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 0; }
.training .training-head h1 { margin: 0; }
.training .progress { margin: 0; color: var(--ink-2); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.training .training-meter,
.training .quiz-meter { height: 6px; margin: 10px 0 4px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, var(--bg)); overflow: hidden; }
.training .quiz-meter { background: var(--bg); }
.training .training-meter > span,
.training .quiz-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--sky); transition: width 0.25s ease; }
.training .training-meter.full > span,
.training .quiz-meter.full > span { background: var(--good); }

/* The list: one card, one row per module. The title's button stretches over the whole row. */
.training .modules {
  list-style: none;
  margin: 12px 0;
  padding: 4px 16px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--r);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.training .module-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 0;
}
.training .module-row + .module-row { border-top: 1px solid var(--line); }
.training .module-row::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 0 -2px;
  border-top: 2px solid var(--ink-2);
  border-right: 2px solid var(--ink-2);
  transform: rotate(45deg);
  opacity: 0.7;
}
.training .module-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.training .module-mark.done { background: var(--good); color: var(--surface); }
.training .module-mark.tried { background: var(--crit-soft); color: var(--crit); }
.training .module-mark.writing { background: none; border: 1.5px dashed var(--ink-2); color: var(--ink-2); }
.training .module-text { flex: 1; min-width: 0; }
.training .module-row h2 { margin: 0; font-size: 1rem; line-height: 1.3; }
.training .module-row h2 button {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.training .module-row h2 button::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.training .module-row h2 button:focus-visible { outline: none; }
.training .module-row h2 button:focus-visible::after { outline: 2px solid var(--sky); outline-offset: 2px; }
.training .module-row.writing h2 button { color: var(--ink-2); }
.training .meta { margin: 2px 0 0; color: var(--ink-2); font-size: 0.85rem; }
.training .module-missing { margin: 2px 0 0; color: var(--ink-2); font-size: 0.75rem; }

/* Status pills. Not started is just quiet words; finished is green, not passed yet is red. */
.training .pill {
  flex: none;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
/* In the module list a numbered circle already says "not started", so the word is for screen
   readers only there; in the team's progress it shows. */
.training .module-row .pill.not_started {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.training .pill.not_started { background: none; padding: 2px 0; font-weight: 600; }
.training .pill.passed, .training .pill.done { background: var(--good-soft); color: var(--good); }
.training .pill.tried { background: var(--crit-soft); color: var(--crit); }
.training .pill.writing { background: none; border: 1px dashed var(--line); white-space: normal; text-align: center; max-width: 7.5em; line-height: 1.25; }

/* A module */
.training .back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  margin: 4px 0 0;
  padding: 4px 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}
.training .lesson h1 { margin: 6px 0 2px; }
.training .lesson > .meta { margin: 0 0 8px; }
.training .review { margin: 0 0 8px; color: var(--ink-2); font-size: 0.8rem; font-style: italic; }
.training .lesson .card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.training .lesson h3 { font-size: 1rem; margin: 14px 0 4px; color: var(--navy); }
.training .lesson p { margin: 8px 0; }
.training .lesson .card ul { padding-left: 1.2em; margin: 8px 0; }
.training .lesson .card li { margin: 4px 0; }
.training .lesson > .muted.small { font-size: 0.8rem; }
.training .finish { margin: 12px 0; }
.training .finish button { width: 100%; min-height: 50px; border-radius: 12px; }

/* "Talk with your manager": one row with how many, opening to the list. */
.training .talk > h2 { margin: 0; }
.training .training-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 2px;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}
.training .training-icon { flex: none; color: var(--navy); }
.training .toggle-title { flex: 1; min-width: 0; }
.training .training-count {
  flex: none;
  min-width: 30px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.training .training-toggle::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.training .training-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.training .training-toggle:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.training .talk ul { margin: 8px 0 0; padding-left: 1.2em; font-size: 0.95rem; }

/* The quiz */
.training .quiz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.training .quiz-head h2 { margin: 0; font-size: 1.05rem; }
.training .quiz .hint { margin: 8px 0 4px; font-size: 0.85rem; }
.training .quiz .note { margin: 10px 0 0; font-size: 0.9rem; }
.training .question { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.training .question legend { padding: 0; margin-bottom: 8px; font-weight: 700; line-height: 1.35; }
.training .option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 6px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.training .option:has(input:checked) { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 8%, var(--surface)); }
.training .option input[type="radio"] { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--navy); }
.training .option span { min-width: 0; overflow-wrap: anywhere; }
.training .question:disabled .option { cursor: default; }
.training .question.missed .option:has(input:checked) { border-color: var(--crit); background: var(--crit-soft); }
.training .mark { margin: 8px 0 0; font-size: 0.85rem; font-weight: 700; }
.training .mark.good {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good);
}
.training .mark.bad { color: var(--crit); }
.training .quiz .error { margin: 14px 0 0; }
.training .quiz form > button[type="submit"] { width: 100%; min-height: 50px; margin-top: 18px; border-radius: 12px; }

/* The score: a ring with the figure in it, beside its sentence. */
.training .quiz-score { display: flex; align-items: center; gap: 14px; margin: 16px 0 0; padding: 12px; border-radius: 12px; background: var(--bg); }
.training .quiz-score p { margin: 0; font-weight: 700; }
.training .quiz-score.passed p { color: var(--good); }
.training .quiz-ring { position: relative; flex: none; display: grid; place-items: center; width: 56px; height: 56px; }
.training .quiz-ring .ring { position: absolute; inset: 0; }
.training .quiz-figure { position: relative; font-size: 0.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.training .quiz-again { width: 100%; min-height: 50px; margin-top: 12px; border-radius: 12px; }

/* Rings (icons.tsx): a soft track, sky while under way, green when full, red for a short score. */
.training .ring-track { stroke: color-mix(in srgb, var(--ink) 10%, var(--surface)); }
.training .ring-fill { stroke: var(--sky); transition: stroke-dasharray 0.3s ease; }
.training .ring.full .ring-fill { stroke: var(--good); }
.training .ring.short .ring-fill { stroke: var(--crit); }

/* The team's progress: one row per person, opened with a tap. No tables. */
.training .tt-fine { margin: 8px 2px 0; font-size: 0.75rem; color: var(--ink-2); }
.training .tt-people {
  list-style: none;
  margin: 12px 0;
  padding: 4px 16px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--r);
  box-shadow: 0 1px 3px rgba(15, 34, 51, 0.06), 0 1px 2px rgba(15, 34, 51, 0.04);
}
.training .tt-person + .tt-person { border-top: 1px solid var(--line); }
.training .tt-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.training .tt-row .ring { flex: none; }
.training .tt-row::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.training .tt-row[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
.training .tt-row:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.training .tt-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.training .tt-name { overflow-wrap: anywhere; }
.training .tt-sub { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.training .tt-modules { list-style: none; margin: 0 0 10px 48px; padding: 0; }
.training .tt-modules li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.training .tt-modules li > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
