/* The web portal (/app, app.html): the app shell, its screens and both
   themes (web revamp, phase 3, 18 November 2026). Needs tokens.css and
   components.css first. Replaces style.css.

   Light is paper, as the public site; dark is the app's own green
   (#0A2A1E ground, #11402E top, #134432 panels: tokens.css's forest values).
   The member's choice is html[data-mode] (app-theme.js, the toggle in
   app.js); without one, the system's. data-theme is left to a Plus member's
   accent theme (app.js applyTheme), which sets --gold, --gold-hi and
   --gold-lo: the accent of the one primary action, nothing else.

   Contrast (WCAG AA) is noted where a pair isn't one of tokens.css's. */

/* ---------- portal tokens ---------- */
:root {
  --p-bg: var(--tz-bg);
  --p-surface: var(--tz-surface);
  --p-surface-2: var(--tz-surface-2);
  --p-line: var(--tz-line);
  --p-line-strong: var(--tz-line-strong);
  --p-field: #8A7F68;            /* field borders: 3.95:1 on white, 3.53:1 on surface-2 */
  --p-ink: var(--tz-ink);
  --p-ink-2: var(--tz-ink-2);
  --p-link: var(--tz-link);
  --p-focus: var(--tz-focus);
  --p-heading-accent: var(--tz-ink);
  --p-accent-text: var(--tz-gold-text);
  --p-success: var(--tz-success);  --p-success-bg: var(--tz-success-bg);
  --p-danger: var(--tz-danger);    --p-danger-bg: #FCEBE9;   /* #B3261E on it 5.66:1 */
  --p-warning: var(--tz-warning);  --p-warning-bg: var(--tz-warning-bg);
  --p-info: var(--tz-info);        --p-info-bg: #E6EEF8;     /* #1F5FA8 on it 5.51:1 */
  --p-shadow: var(--tz-shadow);
  --p-side: var(--tz-f-bg);        /* the sidebar and top bar stay green in both themes */
  --p-side-ink: var(--tz-f-ink);
  --p-side-ink-2: var(--tz-f-ink-2);
  --p-side-line: rgba(42, 110, 82, .6);
  --p-cream: #F3EBD6;  --p-cream-ink: #1E2A22;  --p-cream-muted: #4E5A50;  --p-cream-line: #DCD2BA;
  --p-skel: #ECE5D4;
  --p-accent: var(--gold, var(--tz-gold-500));       /* fill of the primary action */
  --p-accent-hi: var(--gold-hi, var(--tz-gold-400));
  /* member colours in seat order, as in the app (white initials 4.5:1 or better) */
  --m1: #C4401B; --m2: #2A70BD; --m3: #17804A; --m4: #8E44C9;
  --m5: #8F6A12; --m6: #C2306B; --m7: #11787C; --m8: #5A781D;
  --p-tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    --p-bg: var(--tz-f-bg); --p-surface: var(--tz-f-surface); --p-surface-2: var(--tz-f-top); --p-line: var(--tz-f-line);
    --p-line-strong: #3B8466; --p-field: #5C9A82; --p-ink: var(--tz-f-ink); --p-ink-2: var(--tz-f-ink-2);
    --p-link: #8FD9A8; --p-focus: var(--tz-f-focus); --p-heading-accent: var(--gold, var(--tz-f-accent));
    --p-accent-text: var(--tz-f-accent); --p-success: #8FD9A8; --p-success-bg: rgba(143, 217, 168, .14);
    --p-danger: #EF9A90; --p-danger-bg: rgba(239, 154, 144, .12); --p-warning: #F4CC6A; --p-warning-bg: rgba(244, 204, 106, .12);
    --p-info: #9CC3F0; --p-info-bg: rgba(156, 195, 240, .12); --p-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 30px rgba(0, 0, 0, .18);
    --p-side: var(--tz-g-950); --p-skel: #1B5A40; color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --p-bg: var(--tz-f-bg);           /* #0A2A1E, the app's ground */
  --p-surface: var(--tz-f-surface); /* #134432, the app's panels */
  --p-surface-2: var(--tz-f-top);   /* #11402E */
  --p-line: var(--tz-f-line);
  --p-line-strong: #3B8466;
  --p-field: #5C9A82;               /* 3.37:1 on #134432 */
  --p-ink: var(--tz-f-ink);         /* 13.7:1 on the ground */
  --p-ink-2: var(--tz-f-ink-2);     /* 6.6:1 on panels */
  --p-link: #8FD9A8;                /* 6.66:1 on panels */
  --p-focus: var(--tz-f-focus);
  --p-heading-accent: var(--gold, var(--tz-f-accent));
  --p-accent-text: var(--tz-f-accent);
  --p-success: #8FD9A8;  --p-success-bg: rgba(143, 217, 168, .14);
  --p-danger: #EF9A90;   --p-danger-bg: rgba(239, 154, 144, .12);   /* 5.1:1 on panels */
  --p-warning: #F4CC6A;  --p-warning-bg: rgba(244, 204, 106, .12);
  --p-info: #9CC3F0;     --p-info-bg: rgba(156, 195, 240, .12);
  --p-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 30px rgba(0, 0, 0, .18);
  --p-side: var(--tz-g-950);
  --p-skel: #1B5A40;
  color-scheme: dark;
}

/* ---------- base ---------- */
html { background: var(--p-bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.tz-app {
  background: var(--p-bg); color: var(--p-ink);
  font-size: 15px; line-height: 1.55; min-height: 100vh; min-height: 100dvh;
  color-scheme: inherit;
}
.tz-app :focus-visible { outline-color: var(--p-focus); }
.tz-app a { color: var(--p-link); }
.tz-app h1 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tz-app h2 { font-size: 20px; line-height: 1.25; letter-spacing: -.01em; margin-bottom: 10px; }
.tz-app h3 { font-size: 17px; line-height: 1.3; }
.tz-app h4 { font-size: 15px; }
.tz-app p { margin: 0; }
.tz-app [tabindex="-1"]:focus { outline: none; }
.tz-app .num, .tz-app .amount, .tz-app .val, .tz-app .price, .tz-app td, .tz-app .day, .tz-app .total strong,
.tz-app .tile-value, .tz-app .code { font-family: var(--tz-font-text); font-variant-numeric: tabular-nums; }
.app-kente { position: relative; z-index: 41; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the shell ---------- */
.app-logo { display: inline-flex; align-items: center; min-height: 44px; border-radius: 8px; }
.app-logo img { height: 36px; width: auto; display: block; }
.app-icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer;
}
.app-icon-btn:hover { background: rgba(255, 255, 255, .08); }
[data-theme-toggle] .i-sun { display: none; }
[data-theme-toggle][aria-pressed="true"] .i-sun { display: block; }
[data-theme-toggle][aria-pressed="true"] .i-moon { display: none; }

/* top bar: phones and tablets */
.app-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--p-side); color: var(--p-side-ink); border-bottom: 1px solid var(--p-side-line);
}
.app-top :focus-visible { outline-color: var(--tz-f-focus); }

/* the sidebar (the drawer below 1024px) */
.app-side {
  background: var(--p-side); color: var(--p-side-ink);
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
}
.app-side :focus-visible { outline-color: var(--tz-f-focus); }
.app-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 8px; }
.app-nav { display: grid; gap: 2px; }
.app-nav a, .app-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left;
  font: 600 15px/1.2 var(--tz-font-text); color: var(--p-side-ink-2); text-decoration: none;
}
.app-nav a:hover, .app-nav button:hover { color: var(--p-side-ink); background: rgba(255, 255, 255, .06); }
.app-nav a[aria-current="page"] {
  color: var(--p-side-ink); background: rgba(232, 184, 74, .14);
  box-shadow: inset 3px 0 0 var(--tz-gold-500);
}
.app-nav a[aria-current="page"] svg { color: var(--tz-f-accent); }
.app-nav svg { flex: none; }
.app-nav-more { display: grid; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--p-side-line); }

.app-account { margin-top: auto; position: relative; padding-top: 10px; border-top: 1px solid var(--p-side-line); }
.app-account-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 8px;
  border: 0; border-radius: 12px; background: none; color: var(--p-side-ink); cursor: pointer; text-align: left;
}
.app-account-btn:hover { background: rgba(255, 255, 255, .06); }
.app-account-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--tz-gold-500); color: var(--tz-on-gold); font: 800 14px/1 var(--tz-font-display);
}
.app-account-name { flex: 1; min-width: 0; display: grid; }
.app-account-name strong { font: 700 14.5px/1.25 var(--tz-font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-account-name small { font-size: 12.5px; color: var(--p-side-ink-2); }
.app-account-caret { transition: transform var(--tz-t-ui); }
.app-account-btn[aria-expanded="false"] .app-account-caret { transform: rotate(180deg); }
.app-account-menu { display: grid; gap: 2px; padding: 6px 0 2px; }
.app-account-btn[aria-expanded="false"] + .app-account-menu { display: none; }
.app-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left;
  font: 600 14.5px/1.2 var(--tz-font-text); color: var(--p-side-ink-2);
}
.app-menu-item:hover { color: var(--p-side-ink); background: rgba(255, 255, 255, .06); }
#premium-account { padding: 8px 12px; font-size: 14px; color: var(--p-side-ink-2); }
#premium-account a { color: var(--p-side-ink); font-weight: 600; }
.plus-badge {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font: 800 12px/1.6 var(--tz-font-text);
  color: var(--tz-on-gold); background: var(--tz-gold-500); /* brand gold, never a theme's */
}

/* the tab bar */
.app-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--p-side); border-top: 1px solid var(--p-side-line);
}
.app-tabs a, .app-tabs button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; border: 0; border-radius: 12px; background: none; cursor: pointer;
  font: 600 12px/1.1 var(--tz-font-text); color: var(--p-side-ink-2); text-decoration: none;
}
.app-tabs a[aria-current="page"] { color: var(--p-side-ink); }
.app-tabs a[aria-current="page"] svg { color: var(--tz-f-accent); }
.app-tabs :focus-visible { outline: 3px solid var(--tz-f-focus); outline-offset: -3px; }
.app-tabs [hidden] { display: none; }

.app-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(4, 18, 12, .6); }

/* main column */
.app-main { display: block; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); min-width: 0; }
.app-main > section, .app-main > .notice, .app-main > .foot-note { max-width: 1160px; margin-inline: auto; }
.app-main > section { display: grid; gap: 16px; align-content: start; }
.foot-note { margin-top: 28px !important; color: var(--p-ink-2); font-size: 13.5px; }

/* phones and tablets */
@media (max-width: 1023.98px) {
  .app-side {
    position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
    overflow-y: auto; transform: translateX(-102%); visibility: hidden;
    transition: transform .28s var(--tz-ease), visibility 0s linear .28s;
    box-shadow: 0 0 60px rgba(0, 0, 0, .35);
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }
  .app-side.is-open { transform: none; visibility: visible; transition: transform .28s var(--tz-ease), visibility 0s; }
  .app-side-head .app-logo { visibility: hidden; }
  body[data-signed="1"] .app-main { padding-bottom: calc(var(--p-tabs-h) + 32px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 1024px) {
  .app-top, .app-tabs, .app-scrim, .app-drawer-close { display: none !important; }
  body[data-signed="1"] .app-shell {
    display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100dvh - 4px);
    background: linear-gradient(90deg, var(--p-side) 264px, transparent 264px);
  }
  body[data-signed="1"] .app-side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
  .app-main { padding: 32px 40px 40px; }
}
body:not([data-signed="1"]) .app-side, body:not([data-signed="1"]) .app-tabs { display: none !important; }
@media (prefers-reduced-motion: reduce) { .app-side, .app-side.is-open { transition: none; } }

/* ---------- cards, headings, notices ---------- */
.card {
  background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--tz-r-lg);
  padding: 18px; box-shadow: var(--p-shadow); min-width: 0;
}
@media (min-width: 768px) { .card { padding: 24px; } }
.card-title { font-size: 18px; }
.page-head { display: grid; gap: 10px; }
.page-head > .muted { max-width: 72ch; }
.page-head .notes { max-width: 80ch; }
.crumbs { font-size: 14px; }
.crumbs a { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.crumbs a::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.crumbs a:hover { text-decoration: underline; }
.eyebrow { font: 700 13px/1.3 var(--tz-font-text); letter-spacing: .04em; color: var(--p-accent-text); margin: 0 0 6px !important; }
.gold { color: var(--p-heading-accent); }
.muted { color: var(--p-ink-2); }
.small { font-size: 13.5px; }
.terms { font-size: 16px; font-weight: 600; margin: 10px 0 4px !important; }
.state { color: var(--p-ink-2); }
.state:empty { display: none; }

/* messages: errors in red, the rest in green; role=alert announces them */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--p-danger-bg); color: var(--p-ink); border: 1px solid transparent;
  border-left: 4px solid var(--p-danger); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-weight: 600;
}
.notice::before {
  content: "!"; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--p-danger); color: var(--p-surface); font: 800 13px/1 var(--tz-font-text); margin-top: 1px;
}
/* ".tz-app p { margin: 0 }" outranks .notice: the page's message keeps its own
   space below it, so it never sits on the card under it (join flow, 20 November 2026). */
.tz-app .app-main > .notice { margin: 0 auto 16px; }
.tz-app .join-step .notice { margin: 0 0 12px; }
.notice.good { background: var(--p-success-bg); border-left-color: var(--p-success); font-weight: 500; }
.notice.good::before { content: "✓"; background: var(--p-success); }
.card.warn { border-color: var(--p-danger); border-left-width: 4px; background: var(--p-danger-bg); box-shadow: none; }
.card.warn h2 { color: var(--p-danger); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plain p { margin: 0 0 6px; }
.notes { margin-top: 4px; color: var(--p-ink-2); }
.notes li { padding-left: 14px; border-left: 3px solid var(--p-line-strong); }
.notes.ticks li { border: 0; position: relative; padding-left: 26px; }
.notes.ticks li::before {
  content: ""; position: absolute; left: 3px; top: .45em; width: 11px; height: 6px;
  border: solid var(--p-success); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg);
}
#owed-list li { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
#owed-list li p { margin: 0; flex: 1 1 240px; }

/* empty states */
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 28px 12px; color: var(--p-ink-2); }
.empty svg { opacity: .7; }

/* loading skeleton */
.app-loading { display: grid; gap: 14px; }
.skel { display: grid; gap: 12px; }
.skel span { display: block; border-radius: 8px; background: var(--p-skel); }
.skel-line { height: 14px; }
.skel-line.w40 { width: 40%; height: 22px; }
.skel-line.w70 { width: 70%; }
.skel-line.w55 { width: 55%; }
.skel-block { height: 96px; border-radius: 14px !important; }
.app-loading:has(#loading-retry:not([hidden])) .skel { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .skel span { animation: p-pulse 1.4s ease-in-out infinite; }
}
@keyframes p-pulse { 50% { opacity: .55; } }

/* ---------- buttons and links ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 48px; padding: 10px 20px; border-radius: var(--tz-r-md); border: 1px solid transparent;
  font: 700 15.5px/1.2 var(--tz-font-text); color: var(--tz-on-gold); background: var(--p-accent);
  cursor: pointer; text-decoration: none; transition: background-color var(--tz-t-ui), border-color var(--tz-t-ui), transform var(--tz-t-ui);
}
.button:hover { background: var(--p-accent-hi); }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.button.ghost {
  min-height: 44px; padding: 8px 16px; font-size: 15px;
  color: var(--p-link); background: transparent; border-color: var(--p-field);
}
.button.ghost:hover { background: var(--p-surface-2); border-color: var(--p-link); }
a.button, .tz-app a.button { text-decoration: none; color: var(--tz-on-gold); }
.tz-app a.button.ghost { color: var(--p-link); }
.link {
  font: 700 15px/1.3 var(--tz-font-text); color: var(--p-link); background: none; border: 0; padding: 10px 0;
  min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px !important; align-items: center; }

/* ---------- forms ---------- */
.portal form { display: grid; gap: 8px; margin-top: 14px; }
.portal label { font-weight: 600; font-size: 14.5px; }
.portal input, .portal select, .portal textarea {
  font: 500 16px/1.4 var(--tz-font-text); color: var(--p-ink); background: var(--p-surface); width: 100%;
  min-height: 48px; border: 1.5px solid var(--p-field); border-radius: 10px; padding: 10px 12px;
}
.portal textarea { min-height: 96px; resize: vertical; }
.portal input::placeholder, .portal textarea::placeholder { color: var(--p-ink-2); opacity: .75; }
.portal input:focus-visible, .portal select:focus-visible, .portal textarea:focus-visible { outline: 3px solid var(--p-focus); outline-offset: 1px; border-color: var(--p-focus); }
.portal input[type=radio], .portal input[type=checkbox] {
  width: auto; min-height: 0; padding: 0; border: 0; background: none; margin: 0; accent-color: var(--p-link);
}
.portal input[type=checkbox] { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.portal input[type=file] { min-height: 0; padding: 8px 0; border: 0; background: none; font-size: 14.5px; }
.portal form > .button, .portal form > p > .button:first-child { justify-self: start; }
.field-row { display: flex; flex-wrap: wrap; gap: 10px; }
.field-row > input, .field-row > select { flex: 1 1 200px; width: auto; }
.portal .dates { display: flex; gap: 12px; flex-wrap: wrap; }
.portal .dates > span, .portal .field { flex: 1 1 160px; display: grid; gap: 6px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; min-height: 44px; padding-top: 8px; }
.networks { border: 0; padding: 0; margin: 10px 0 2px; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.networks legend { font-weight: 600; font-size: 14.5px; margin-bottom: 8px; padding: 0; }
.networks label {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; cursor: pointer;
  border: 1.5px solid var(--p-field); border-radius: 999px; font-weight: 600; background: var(--p-surface);
}
.networks label:has(input:checked) { border-color: var(--p-link); background: var(--p-success-bg); }
.networks label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.filter-bar { align-items: end; }
@media (min-width: 1024px) {
  .filter-bar { grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.4fr); column-gap: 16px; }
  .filter-bar .actions { grid-column: 1 / -1; margin-top: 4px !important; }
}

/* ---------- sign in: split on wide screens, one card on phones ---------- */
.signin-art { display: none; }
body[data-screen="phone"] .app-main, body[data-screen="code"] .app-main {
  min-height: calc(100dvh - 64px); display: grid; align-content: center; justify-items: center;
}
.signin-card, .setup-card { width: 100%; max-width: 480px; margin-inline: auto; padding: 24px; }
.signin-card h1, .setup-card h1 { margin-bottom: 6px; }
.signin-card .button { width: 100%; margin-top: 6px; }
.setup-card { max-width: 600px; }
@media (min-width: 1024px) {
  body[data-screen="phone"] .app-top, body[data-screen="code"] .app-top { display: none; }
  body[data-screen="phone"] .app-main, body[data-screen="code"] .app-main {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
    padding: 0; min-height: calc(100dvh - 4px); align-content: stretch; align-items: stretch; justify-items: stretch;
  }
  body[data-screen="phone"] .signin-art, body[data-screen="code"] .signin-art {
    display: block; position: relative; grid-column: 1; grid-row: 1 / 5; overflow: hidden; background: var(--tz-f-bg);
  }
  .signin-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
  .signin-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 42, 30, .1) 30%, rgba(10, 42, 30, .92)); }
  .signin-art-copy { position: absolute; z-index: 1; left: 48px; right: 48px; bottom: 56px; display: grid; gap: 12px; }
  .signin-art .tz-eyebrow { color: var(--tz-f-accent); }
  .signin-tagline { font: 800 clamp(34px, 3.6vw, 52px)/1.04 var(--tz-font-display); letter-spacing: -.025em; color: var(--tz-f-ink); }
  .signin-tagline span { color: var(--tz-f-accent); }
  body[data-screen="phone"] .app-main > section, body[data-screen="code"] .app-main > section,
  body[data-screen="phone"] .app-main > .notice, body[data-screen="code"] .app-main > .notice {
    grid-column: 2; grid-row: 3; align-self: center; width: min(440px, calc(100% - 64px)); justify-self: center;
  }
  /* The message, then the join banner, then the card: each in its own row, so none sits on another. */
  body[data-screen="phone"] .app-main > .notice, body[data-screen="code"] .app-main > .notice { grid-row: 1; }
  body[data-screen="phone"] .app-main > .join-banner, body[data-screen="code"] .app-main > .join-banner {
    grid-column: 2; grid-row: 2; width: min(440px, calc(100% - 64px)); justify-self: center; margin: 32px 0 0;
  }
  body[data-screen="phone"] .app-main > .notice, body[data-screen="code"] .app-main > .notice { align-self: start; margin: 48px 0 0; position: static; }
  body[data-screen="phone"] .app-main > .notice:not([hidden]) + .join-banner, body[data-screen="code"] .app-main > .notice:not([hidden]) + .join-banner { margin-top: 16px; }
  body[data-screen="phone"] .signin-card, body[data-screen="code"] .signin-card { box-shadow: none; border: 0; background: transparent; padding: 0; }
  body[data-screen="phone"] .foot-note, body[data-screen="code"] .foot-note { grid-column: 2; grid-row: 4; align-self: end; justify-self: center; padding: 0 32px 24px; text-align: center; }
}
body[data-screen="loading"]:not([data-signed="1"]) .app-main { max-width: 640px; margin-inline: auto; }

/* setting up */
.tz-app .steps-list { color: var(--p-ink); padding-left: 22px; display: grid; gap: 12px; margin: 14px 0; }
.steps-list li::marker { font-weight: 700; color: var(--p-accent-text); }
.steps-list li.done strong::after {
  content: "Done"; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font: 700 12px/1.6 var(--tz-font-text);
  color: var(--p-success); background: var(--p-success-bg);
}

/* ---------- home ---------- */
.page-head h1 { font-size: clamp(26px, 3vw, 34px); }
.next-up {
  border-radius: var(--tz-r-lg); padding: 20px; color: var(--tz-f-ink);
  background: linear-gradient(135deg, var(--tz-f-top), var(--tz-f-bg));
  border: 1px solid var(--tz-f-line); box-shadow: var(--p-shadow);
}
.next-up :focus-visible { outline-color: var(--tz-f-focus); }
.next-up-title { font: 700 13px/1.3 var(--tz-font-text) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--tz-f-accent); margin-bottom: 12px !important; }
.next-up-list { gap: 0; }
.next-up-list li { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(42, 110, 82, .7); }
.next-up-list li:first-child { border-top: 0; padding-top: 0; }
.next-up-list li:last-child { padding-bottom: 0; }
.next-up-what { flex: 1 1 260px; min-width: 0; display: grid; gap: 4px; }
.next-up-what strong { font: 800 20px/1.2 var(--tz-font-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.next-up-what span { color: var(--tz-f-ink-2); font-size: 14.5px; }
.next-up-note { margin: 12px 0 0; color: var(--tz-f-ink-2); font-size: 14px; }
.tz-app .next-up a.button.ghost { color: var(--tz-f-ink); border-color: var(--tz-f-line); }
.tz-app .next-up a.button.ghost:hover { background: rgba(255, 255, 255, .06); border-color: var(--tz-f-ink-2); }
@media (min-width: 768px) { .next-up { padding: 24px 28px; } }

.crew-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 12px; }
.crew-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.crew-link {
  display: grid; gap: 8px; align-content: start; height: 100%; text-decoration: none; color: var(--p-ink);
  padding: 16px; border-radius: 16px; background: var(--p-surface-2); border: 1px solid var(--p-line);
  transition: border-color var(--tz-t-ui), transform var(--tz-t-ui), box-shadow var(--tz-t-ui);
}
a.crew-link:hover { border-color: var(--p-link); box-shadow: var(--p-shadow); }
.tz-app .crew-link { color: var(--p-ink); }
.crew-link strong { display: block; font: 700 17px/1.25 var(--tz-font-display); overflow-wrap: anywhere; }
.crew-link small { color: var(--p-ink-2); font-size: 13.5px; line-height: 1.45; }
.crew-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crew-bar { display: flex; gap: 3px; margin-top: 2px; }
.crew-bar i { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--p-line); min-width: 2px; }
.crew-bar i.past { background: var(--p-link); }
.crew-bar i.today { background: var(--p-accent); }

.home-pair { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1024px) { .home-pair { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
/* Home's first few crews, and the way to all of them on Crews */
.crews-more { margin: 14px 0 0; font-weight: 600; }
#home-no-crews { margin: 4px 0 0; }
.getapp-card { position: relative; display: grid; gap: 16px; background: var(--p-surface-2); }
.getapp-body { display: flex; gap: 14px; align-items: center; padding-right: 36px; }
.getapp-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.getapp-card h2 { margin-bottom: 2px; }
.getapp-close { position: absolute; top: 8px; right: 8px; color: var(--p-ink-2); }
.getapp-close:hover { background: var(--p-line); color: var(--p-ink); }
.getapp-card .tz-soon { color: var(--p-accent-text); }
.getapp-card .tz-store:focus-visible { outline-color: var(--p-focus); }
.getapp-card .tz-store img { height: 44px; }

/* ---------- chips: status always in words ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font: 700 12.5px/1.6 var(--tz-font-text); white-space: nowrap;
  color: var(--p-ink-2); background: transparent; border: 1px solid var(--p-line-strong);
}
.chip.ok { color: var(--p-success); background: var(--p-success-bg); border-color: transparent; }
.chip.today { color: var(--tz-on-gold); background: var(--tz-gold-500); border-color: transparent; }
.chip.next { color: var(--p-accent-text); border-color: currentColor; }
.chip.info { color: var(--p-info); background: var(--p-info-bg); border-color: transparent; }
.chip.warnc { color: var(--p-danger); background: var(--p-danger-bg); border-color: transparent; }
.chip.cad { color: var(--p-ink); background: var(--p-surface); }

/* ---------- a crew ---------- */
.crew-cols { display: grid; gap: 16px; align-items: start; }
.crew-main, .crew-side { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 1024px) {
  .crew-cols { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 24px; }
  .crew-side { position: sticky; top: 24px; }
}
.crew-head h1 { margin-bottom: 4px; }
.round-progress { display: flex; gap: 4px; margin: 20px 0 8px; padding: 0; list-style: none; }
.round-progress span { flex: 1 1 0; height: 8px; border-radius: 4px; background: var(--p-line); min-width: 3px; }
.round-progress span.past { background: var(--p-link); }
.round-progress span.today { background: var(--p-accent); box-shadow: 0 0 0 2px var(--p-surface), 0 0 0 4px var(--p-accent); }
.turn-card {
  margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--p-warning-bg); border: 1px solid var(--p-line);
}
.turn-card strong { display: block; font: 800 18px/1.3 var(--tz-font-display); color: var(--p-accent-text); }
.turn-card p { margin: 4px 0 0; color: var(--p-ink-2); }
#crew-actions { display: grid; gap: 12px; justify-items: start; margin-top: 16px; }
#crew-actions:empty { display: none; }
#crew-actions .button { max-width: 480px; }
.pay-note { display: flex; gap: 10px; align-items: flex-start; color: var(--p-ink-2); font-size: 13.5px; max-width: 52ch; }
.pay-note svg { flex: none; margin-top: 2px; }
.paused-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--p-warning-bg); border: 1px solid var(--p-line); color: var(--p-ink); font-size: 14.5px; max-width: 52ch; }

/* the share, split as it's charged: cream, as in the app */
.money-card {
  background: var(--p-cream); color: var(--p-cream-ink); border-radius: 16px; padding: 4px 16px;
  width: 100%; max-width: 480px;
}
.money-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--p-cream-line); }
.money-row:first-child { border-top: 0; }
.money-row .label { color: var(--p-cream-muted); font-size: 14.5px; }
.money-row .val { color: var(--p-cream-ink); font-weight: 600; white-space: nowrap; text-align: right; }
.money-row.sum .label { color: var(--p-cream-ink); font-weight: 700; }
.money-row.sum .val { font-size: 19px; font-weight: 700; }
.money-row.big .val { font-size: 28px; font-weight: 700; line-height: 1.1; }

/* turns: rows like a table */
.turns-card h2 { margin-bottom: 4px; }
.members { list-style: none; padding: 0; margin: 0; display: grid; }
.members li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--p-line); flex-wrap: wrap; }
.members li:first-child { border-top: 0; }
.members strong { display: block; line-height: 1.3; overflow-wrap: anywhere; font-weight: 700; }
.members small { color: var(--p-ink-2); font-size: 13.5px; }
.turns li > span:not(.day):not(.avatar):not(.status) { flex: 1 1 140px; min-width: 0; }
.turns .day { flex: none; width: 72px; color: var(--p-ink-2); font-weight: 600; font-size: 14px; }
.turns .status { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.turns li .button { margin-left: auto; }
.turns li.is-today { background: var(--p-warning-bg); margin-inline: -12px; padding-inline: 12px; border-radius: 12px; border-top-color: transparent; }
.turns li.is-today + li { border-top-color: transparent; }
.turns li.is-today .day { color: var(--p-accent-text); }
@media (min-width: 640px) {
  #turns li { display: grid; grid-template-columns: 40px 72px minmax(0, 1fr) auto auto; }
  #turns li > span:not(.day):not(.avatar):not(.status) { grid-column: 3; }
}
@media (max-width: 639.98px) {
  .turns .status { flex-basis: 100%; justify-content: flex-start; padding-left: 52px; }
}
.avatar {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font: 700 15px/1 var(--tz-font-text); color: #fff; background: var(--m1); position: relative;
}
.avatar.received::after {
  content: ""; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
  background: #17804A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/12px no-repeat;
  border: 2px solid var(--p-surface);
}
.avatar.today { box-shadow: 0 0 0 3px var(--p-accent); }
.avatar.you { outline: 2px solid var(--p-ink); outline-offset: 2px; }

/* the right column */
.rules-card { padding: 4px 18px; }
@media (min-width: 768px) { .rules-card { padding: 4px 24px; } }
.rules-card details.rules { margin: 0; padding: 0; background: none; border: 0; }
.rules-card details.rules > summary { font-size: 17px; font-family: var(--tz-font-display); padding-block: 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; }
.facts dt, .facts dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--p-line); }
.facts dt { color: var(--p-ink-2); font-size: 14px; padding-right: 16px; }
.facts dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.start-date { display: grid; gap: 8px; }
.start-date .button { justify-self: start; }
.start-date label { font-weight: 600; font-size: 14.5px; }
#crew-notes-card:has(#crew-notes:empty) { display: none; }
#crew-notes { margin: 0; }

/* rules everywhere: shown as the API gives them */
.rules { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--p-surface-2); border: 1px solid var(--p-line); }
.rules h3 { font-size: 17px; margin: 14px 0 6px; }
.rules h4 { font-size: 15px; font-weight: 700; margin: 12px 0 4px; }
.rules p { color: var(--p-ink-2); margin: 0 0 8px; }
.rules .notice { color: var(--p-ink); margin-top: 12px; }
details.rules { padding: 2px 16px; }
details.rules > summary {
  cursor: pointer; font-weight: 700; padding-block: 12px; min-height: 44px; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
details.rules > summary::-webkit-details-marker { display: none; }
details.rules > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: translateY(-3px) rotate(45deg);
  transition: transform .2s var(--tz-ease);
}
details.rules[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.rules h3 { font-size: 16px; margin: 14px 0 4px; }

/* ---------- dialogs ---------- */
.app-dialog {
  width: 100%; max-width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  border: 1px solid var(--p-line); border-radius: 20px; background: var(--p-surface); color: var(--p-ink);
  padding: 22px; box-shadow: var(--tz-shadow-lg);
}
.app-dialog::backdrop { background: rgba(4, 18, 12, .62); backdrop-filter: blur(2px); }
.app-dialog h2 { font-size: 21px; margin: 4px 0 8px; }
.app-dialog h3 { font-size: 16px; margin: 12px 0 8px; }
.app-dialog form { display: grid; gap: 8px; }
.close-dialog h2 { color: var(--p-danger); }
.close-points { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; color: var(--p-ink); }
.close-store { padding: 10px 14px; border-radius: 12px; background: var(--p-danger-bg); border-left: 4px solid var(--p-danger); font-weight: 600; white-space: pre-line; }
.close-dialog input { font-family: var(--tz-font-text); letter-spacing: 2px; text-transform: uppercase; }
.close-dialog .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 8px 0 0; }
.button.danger { background: var(--p-danger); color: var(--p-surface); border-color: var(--p-danger); }
.button.danger:disabled { opacity: .45; cursor: not-allowed; }
.app-menu-item.app-menu-danger { color: var(--p-danger); border-top: 1px solid var(--p-line); margin-top: 6px; padding-top: 12px; }
dialog#momo { max-width: min(440px, calc(100vw - 32px)); text-align: center; }
dialog#momo progress { width: 100%; accent-color: var(--p-link); margin: 12px 0; }
dialog#momo form { text-align: left; margin: 10px 0; }
dialog#momo input { font-family: var(--tz-font-text); font-size: 24px; letter-spacing: 6px; text-align: center; }
dialog#momo .actions { display: grid; gap: 8px; margin: 12px 0 0; }
dialog#momo .actions .button { width: 100%; }

/* ---------- plans ---------- */
.plan-cols, .plus-cols, .group-pair { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1024px) {
  .plan-cols, .plus-cols, .group-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-pair > [hidden] + :not([hidden]), .group-pair > :not([hidden]):only-child { grid-column: 1 / -1; }
}
.plan-card { display: grid; gap: 12px; align-content: start; }
.plan-card .terms { font: 800 22px/1.2 var(--tz-font-display); color: var(--p-ink); margin: 0 !important; }
.plan-banner { border-left: 4px solid var(--p-success); background: var(--p-success-bg); box-shadow: none; }
.plan-states .actions, .plan-grid .actions { margin-top: 8px !important; }
.plan-state, .plan-grid .plan { padding: 14px 16px; border-radius: 14px; background: var(--p-surface); border: 1px solid var(--p-line); }
.plan-state p, .plan-grid p { margin: 4px 0; }
.plan-state strong { font-family: var(--tz-font-display); }
.plan-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin-top: 4px; }
.plan-grid .plan { display: grid; gap: 2px; align-content: start; background: var(--p-surface-2); }
.plan-grid .plan strong { font: 700 17px/1.3 var(--tz-font-display); }
.plan-grid .price { color: var(--p-accent-text); font-weight: 700; }
.plan-grid .button.ghost { margin-top: 8px; justify-self: start; }
#plan-choose { border: 2px solid var(--p-accent); }

/* ---------- data tables ---------- */
.table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--p-line); border-radius: 14px; max-height: 70vh; }
.table-wrap:has(table[hidden]) { display: none; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--p-line); vertical-align: top; white-space: nowrap; }
.data-table th {
  position: sticky; top: 0; z-index: 1; background: var(--p-surface-2); color: var(--p-ink-2);
  font: 700 12.5px/1.3 var(--tz-font-text); letter-spacing: .03em;
}
.data-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--p-surface-2) 55%, transparent); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:nth-child(n+6):not(:last-child), .data-table th:nth-child(n+6):not(:last-child) { text-align: right; }

/* insights */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 8px; }
.total { display: grid; padding: 14px 16px; border-radius: 14px; background: var(--p-cream); }
.total strong { font-size: 24px; color: var(--p-cream-ink); line-height: 1.2; font-weight: 700; }
.total small { color: var(--p-cream-muted); font-size: 13.5px; }
.portal h3.sub { font-size: 16px; margin: 20px 0 8px; }
.bars { gap: 8px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr; gap: 2px 10px; align-items: center; }
.bar { height: 10px; border-radius: 999px; background: var(--p-line); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--p-link); }
.bar-label { color: var(--p-ink-2); font-size: 13.5px; }
.bar-text { grid-column: 2; color: var(--p-ink-2); font-size: 13.5px; }
#plus progress, #in-goal-bar { width: 100%; accent-color: var(--p-link); }

/* ---------- groups ---------- */
.group-head { display: flex; align-items: center; gap: 14px; }
.group-head img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; flex: none; }
.subnav {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0; background: var(--p-bg);
}
.subnav::-webkit-scrollbar { display: none; }
@media (max-width: 1023.98px) { .subnav { top: 60px; } }
.subnav a {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  font: 600 14px/1 var(--tz-font-text); color: var(--p-ink-2); text-decoration: none; border: 1px solid var(--p-line); background: var(--p-surface);
}
.subnav a:hover { color: var(--p-ink); border-color: var(--p-field); }
.subnav [hidden] { display: none; }
#group > .card[id] { scroll-margin-top: 72px; }
.group-crew { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.group-crew .crew-link { flex: 1 1 260px; height: auto; }
.group-crew .button.ghost { flex: none; }
#group-crews { margin-bottom: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-bottom: 8px; }
.tile { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--p-surface-2); border: 1px solid var(--p-line); }
.tile-value { font: 700 28px/1.15 var(--tz-font-text); color: var(--p-ink); }
.tile-label { font-size: 13.5px; color: var(--p-ink-2); font-weight: 600; }
.tile.is-alert .tile-value { color: var(--p-danger); }
#group-dash .notes, #ann-list { margin-top: 8px; }
.dash-tagged { padding: 4px 0 8px; }
.dash-crews { display: grid; gap: 12px; margin-top: 16px; }
.dash-crew { padding: 16px; border-radius: 14px; background: var(--p-surface-2); border: 1px solid var(--p-line); display: grid; gap: 4px; }
.dash-crew > h3 { font-size: 17px; }
.dash-crew p { margin: 0; }
.dash-crew details.rules { background: var(--p-surface); margin-top: 8px; }
.code-box {
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 8px 0 !important;
  padding: 8px 12px; border-radius: 12px; background: var(--p-surface); border: 1px dashed var(--p-field);
}
.code-box .button.ghost { margin-left: auto; }
/* A member's personal invite and vouching (19 November 2026) */
#crew-invite .invite-link { overflow-wrap: anywhere; font-weight: 600; }
#crew-invite .vouch-line { margin: 10px 0 0; color: var(--p-ink); }
#crew-invite .muted.small { margin: 10px 0 0; }
#join-vouch { margin: 8px 0 12px; }
#join-vouch.vouch-note {
  background: var(--p-info-bg); color: var(--p-ink); border-left: 4px solid var(--p-info);
  border-radius: 12px; padding: 12px 16px; font-weight: 600;
}
.turns small { display: block; }
.vouched-seats li { margin: 2px 0; }
#ann-list p { margin: 0; color: var(--p-ink); }
#ann-list small { font-size: 13px; }

/* Start a crew (#/crews/new, 19 November 2026): choices as cards, errors by their field */
.nc-card { max-width: 760px; }
/* The level line and the bars (20 November 2026): the level chip to #/level,
   a pill per cadence, and what's typed against the limit, gold when over */
.level-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 6px; }
.level-line[hidden], .level-bar[hidden], .level-chip[hidden] { display: none; }
.tz-app a.level-chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px;
  font: 700 13.5px/1.3 var(--tz-font-text); text-decoration: none;
  color: var(--p-success); background: var(--p-success-bg); border: 1px solid transparent;
}
.tz-app a.level-chip::after { content: ""; width: 6px; height: 6px; margin-left: 8px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.tz-app a.level-chip:hover { border-color: currentColor; }
.level-pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font: 600 12.5px/1.5 var(--tz-font-text); font-variant-numeric: tabular-nums;
  color: var(--p-ink-2); border: 1px solid var(--p-line-strong); background: var(--p-surface);
}
.level-bar { display: grid; gap: 4px; margin: 2px 0 0; }
.level-bar-track { height: 8px; border-radius: 99px; background: var(--p-line); overflow: hidden; }
.level-bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--p-success); transition: width var(--tz-t-ui, .15s); }
.level-bar-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 13px; color: var(--p-ink-2); font-variant-numeric: tabular-nums; }
.level-bar.over .level-bar-track i { background: var(--tz-gold-500); }
.level-bar.over .level-bar-text { color: var(--p-accent-text); font-weight: 700; }
.level-bar-need { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .level-bar-track i { transition: none; } }
#home-level { margin-top: 2px; }

/* Your level (#/level, 20 November 2026) */
.lv-page { display: grid; gap: 16px; max-width: 640px; }
.lv-page[hidden] { display: none; }
.lv-card {
  border-radius: var(--tz-r-lg, 18px); padding: 20px; color: var(--p-cream);
  background: linear-gradient(135deg, var(--tz-g-900), var(--tz-g-800)); border: 1px solid var(--tz-g-700);
}
.lv-card p { margin: 0; }
.lv-eyebrow { font-size: 13.5px; color: var(--tz-f-ink-2, #CFE3D6); }
.lv-name { font: 800 32px/1.15 var(--tz-font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.lv-count { font-size: 15px; font-weight: 600; color: var(--p-cream); margin-top: 2px !important; }
.lv-segs { display: flex; gap: 4px; margin: 16px 0 10px; }
.lv-segs i { flex: 1; min-width: 4px; height: 8px; border-radius: 99px; background: rgba(246, 241, 228, .22); }
.lv-segs i.on { background: var(--tz-gold-500); }
.lv-goal { color: var(--tz-gold-400); font-weight: 700; font-size: 15px; margin-top: 6px !important; }
.lv-label { font: 700 12.5px/1.3 var(--tz-font-text) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--p-ink-2); margin: 0 0 10px !important; }
.lv-scroll { overflow-x: auto; }
.lv-table { width: 100%; border-collapse: collapse; }
.lv-table th, .lv-table td { padding: 10px 0; text-align: right; vertical-align: top; }
.lv-table thead th { font-size: 12.5px; font-weight: 600; color: var(--p-ink-2); padding: 0 0 8px; }
.lv-table tbody th, .lv-table tbody td { border-top: 1px solid var(--p-line); font-size: 15px; }
.lv-table th:first-child { text-align: left; font-weight: 700; color: var(--p-ink); }
.lv-table td + td, .lv-table th + th { padding-left: 12px; }
.lv-table small { display: block; font-size: 12.5px; font-weight: 400; color: var(--p-ink-2); }
.lv-table td.up { color: var(--p-accent-text); font-weight: 700; }
.lv-rules li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--p-ink); }
.lv-tick {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--p-success-bg); color: var(--p-success); font-weight: 800; font-size: 13px;
}
.lv-path { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; display: grid; }
.lv-stop { position: relative; padding: 8px 0; }
.lv-stop b { display: block; font-size: 15px; color: var(--p-ink); }
.lv-stop > span { display: block; font-size: 13.5px; color: var(--p-ink-2); }
/* the rail: each stop's line down to the next, green past the ones reached */
.lv-stop::after { content: ""; position: absolute; left: -21px; top: 22px; bottom: -14px; width: 3px; border-radius: 3px; background: var(--p-line); }
.lv-stop:last-child::after { display: none; }
.lv-stop.done::after { background: var(--p-success); bottom: -22px; }
.lv-stop::before {
  content: ""; position: absolute; left: -27px; top: 12px; width: 15px; height: 15px; border-radius: 50%; box-sizing: border-box;
  background: var(--p-surface); border: 3px solid var(--p-line-strong); z-index: 1;
}
.lv-stop.done::before { background: var(--p-success); border-color: var(--p-success); }
.lv-stop.next b { color: var(--p-accent-text); }
.lv-stop.me { margin: 6px 0; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--tz-gold-500); background: var(--p-warning-bg); }
.lv-stop.me::before { left: -29px; top: 18px; width: 17px; height: 17px; background: var(--tz-gold-500); border-color: var(--tz-gold-text); }
.lv-stop.me::after { top: 36px; bottom: -20px; left: -22px; }
.lv-mini { height: 6px; margin: 8px 0 4px; border-radius: 99px; background: var(--p-line); overflow: hidden; }
.lv-mini i { display: block; height: 100%; background: var(--p-success); }
.lv-toggle { margin-top: 10px; }
@media (min-width: 1100px) {
  .lv-page { max-width: 1040px; grid-template-columns: 1fr 1fr; align-items: start; }
  .lv-card { grid-column: 1 / -1; }
}
.nc-field { display: grid; gap: 6px; margin-top: 8px; }
.nc-field p, .portal form > p.muted.small { margin: 0; }
.choices { border: 0; padding: 0; margin: 14px 0 2px; display: grid; gap: 10px; min-width: 0; }
.choices legend { font-weight: 700; font-size: 16px; margin-bottom: 8px; padding: 0; font-family: var(--tz-font-display); }
.choices > p { margin: -2px 0 2px; }
.portal .choices label.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer; font-weight: 400;
  border: 1.5px solid var(--p-field); border-radius: 14px; background: var(--p-surface);
}
.choice input[type=radio] { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.choice > span { display: grid; gap: 2px; }
.choice strong { font-size: 15.5px; color: var(--p-ink); }
.choice .muted { font-size: 14px; }
.choice-note { font-size: 13.5px; color: var(--p-danger); font-weight: 600; }
.portal .choices label.choice:has(input:checked) { border-color: var(--p-link); background: var(--p-success-bg); }
.portal .choices label.choice:has(input:disabled) { cursor: not-allowed; }
.choice:has(input:disabled) strong, .choice:has(input:disabled) .muted { opacity: .6; }
.portal .choices label.choice:has(input:focus-visible) { outline: 3px solid var(--p-focus); outline-offset: 1px; }
.field-error { margin: 0; color: var(--p-danger); font-weight: 600; font-size: 14px; }
.portal input[aria-invalid="true"] { border-color: var(--p-danger); }
#nc-preview .notice { margin: 4px 0 0; }
#nc-error { margin: 8px 0 0; }
#nc-rules { margin-top: 18px; }
#nc-rules-head { margin: 0 0 6px; }
#nc-rules-list h3 { font-size: 16px; }
#home-no-crews .actions { margin-top: 10px !important; }

/* ---------- print-safe and forced colours ---------- */
@media (forced-colors: active) {
  .chip, .notice, .card, .button { border: 1px solid CanvasText; }
  .app-nav a[aria-current="page"] { outline: 2px solid CanvasText; }
}

/* ---------- the join flow (20 November 2026) ---------- */
.join-banner {
  max-width: 600px; margin: 0 auto 16px; padding: 16px 18px; border-radius: var(--tz-r-lg);
  background: var(--p-surface); border: 1px solid var(--p-line); border-top: 4px solid var(--p-accent); box-shadow: var(--p-shadow);
}
.join-banner[hidden] { display: none; }
.join-banner p { margin: 0; }
.join-banner-eyebrow { font: 700 12.5px/1.3 var(--tz-font-text); letter-spacing: .06em; text-transform: uppercase; color: var(--p-accent-text); }
.join-banner-name { font: 800 20px/1.25 var(--tz-font-display); color: var(--p-ink); margin-top: 2px !important; }
.join-banner-terms { color: var(--p-ink-2); font-size: 14.5px; margin-top: 4px !important; }
.join-banner-step { font-weight: 700; color: var(--p-ink); margin-top: 12px !important; }
.join-steps { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 0; margin: 8px 0 0; }
.join-steps li { font-size: 12.5px; line-height: 1.25; color: var(--p-ink-2); padding-top: 8px; border-top: 4px solid var(--p-line); }
.join-steps li.done { border-top-color: var(--p-success); }
.join-steps li.done span:first-child::before { content: "✓ "; color: var(--p-success); font-weight: 700; }
.join-steps li.current { border-top-color: var(--p-accent); color: var(--p-ink); font-weight: 700; }
.join-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px !important; }
.join-banner.compact { border-top-width: 1px; border-left: 4px solid var(--p-accent); }
.join-banner.compact .join-banner-name { font-size: 17px; }
@media (max-width: 767.98px) {
  .join-banner-actions .button { width: 100%; }
  .join-steps li span:first-child { display: block; }
}

.join-step h1 { overflow-wrap: anywhere; }
.join-step .join-rules-box { max-height: none; }
.join-step .join-rules-box h2 { font-size: 17px; margin: 0 0 4px; }
.join-blocked { padding: 14px 16px; border-radius: 14px; background: var(--p-surface-2); border: 1px solid var(--p-line); }
.join-blocked p { margin: 0 0 10px; }
.join-step-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.join-step-actions .button { min-height: 48px; }
#jf-form { display: grid; gap: 10px; margin-top: 14px; }
#jf-form[hidden], .join-blocked[hidden] { display: none; }
#jf-form .join-go { width: 100%; min-height: 52px; font-size: 17px; }
.join-agree { font-weight: 600; }
/* "I agree" and Join stay in reach at the foot of the screen while the rules scroll (above the tab bar on phones). */
#jf-form {
  position: sticky; z-index: 5; bottom: 16px;
  margin-inline: -10px; padding: 10px 12px 12px; border-radius: 16px;
  background: var(--p-surface); border: 1px solid var(--p-line); box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
}
@media (max-width: 1023.98px) {
  body[data-signed="1"] #jf-form { bottom: calc(var(--p-tabs-h) + 8px + env(safe-area-inset-bottom, 0px)); }
  body:not([data-signed="1"]) #jf-form { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 767.98px) {
  .join-step-actions .button { width: 100%; }
  .setup-card #setup-action, .setup-card form .button { width: 100%; min-height: 52px; }
}

/* ---------- Manage, on a crew's board ---------- */
.manage-card { display: grid; gap: 4px; }
.manage-card > h2 { margin-bottom: 4px; }
.manage-block { padding: 12px 0; border-top: 1px solid var(--p-line); }
.manage-block[hidden] { display: none; }
.manage-block h3 { font-size: 16px; margin: 0 0 4px; }
.manage-block .muted.small { margin: 0 0 8px; }
.manage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; }
.manage-code strong { font: 800 20px/1.2 var(--tz-font-display); letter-spacing: .12em; }
.manage-list { display: grid; gap: 6px; margin: 0; }
.manage-list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 48px; }
.manage-order-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.manage-order-list li { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.manage-order-list .day { min-width: 52px; font-size: 13px; color: var(--p-ink-2); font-weight: 700; }
.manage-order-list .who { flex: 1; min-width: 0; }
.manage-order-list .who small { color: var(--p-ink-2); }
.manage-order-list .order-move { min-width: 48px; min-height: 48px; padding: 0; font-size: 18px; }
#manage-leave .button { color: var(--p-danger, #B42318); }
@media (max-width: 767.98px) {
  .manage-actions .button, #manage-leave .button, #order-save, #manage-start-now .button, .start-date .button, #crew-invite-share { width: 100%; }
}
/* The set-up and join steps read as one column under the join banner, on every width. */
.tz-app .app-main > section.setup-card { max-width: 640px; width: 100%; }
.tz-app .join-banner { max-width: 640px; }
body[data-screen="join"] .app-main > .notice, body[data-screen="setup"] .app-main > .notice,
body[data-screen="name"] .app-main > .notice, body[data-screen="share-record"] .app-main > .notice { max-width: 640px; }

/* ---------- crew changes by unanimous vote (20 November 2026) ---------- */
/* The vote: a gold-bordered card, the change as chips, agreed in words and a bar. */
.change-card { border: 2px solid var(--p-accent); background: var(--p-warning-bg); display: grid; gap: 10px; }
.change-card.is-passed { border-color: var(--p-success); background: var(--p-success-bg); }
.change-card.is-lapsed { border-color: var(--p-line-strong); background: var(--p-surface); }
.change-card h2 { margin: 0; }
.change-card .change-by { margin-top: -6px; }
.change-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.change-chip { white-space: normal; color: var(--p-ink); background: var(--p-surface); font-weight: 600; }
.change-chip strong { font-weight: 800; }
.change-chip.money { color: var(--p-accent-text); border-color: var(--p-accent); }
.change-chip .arrow { color: var(--p-ink-2); }
.change-count { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: var(--p-ink-2); font-size: 14.5px; }
.change-count strong { color: var(--p-ink); }
.change-bar { height: 8px; border-radius: 4px; background: var(--p-line); overflow: hidden; }
.change-bar span { display: block; height: 100%; border-radius: 4px; background: var(--p-link); }
.change-seats { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.change-seat > span[aria-hidden]:first-child {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  font: 700 14px/1 var(--tz-font-text); color: var(--p-ink); background: var(--p-surface); border: 2px solid var(--p-line-strong);
}
.change-seat.agreed > span[aria-hidden]:first-child { color: var(--p-success); background: var(--p-success-bg); border-color: var(--p-success); }
.change-seat.needs-vouch > span[aria-hidden]:first-child { border: 2px dashed var(--p-accent-text); }
.change-seat { display: grid; justify-items: center; gap: 4px; min-width: 64px; max-width: 88px; text-align: center; }
.change-seat-name { display: grid; gap: 1px; font-size: 13px; line-height: 1.25; color: var(--p-ink); overflow-wrap: anywhere; }
.change-seat-name b { font-weight: 700; }
.change-seat-name small { font-size: 12px; color: var(--p-ink-2); }
.change-seat.agreed .change-seat-name small:first-of-type { color: var(--p-success); font-weight: 600; }
.link-button { padding: 0; border: 0; background: none; color: var(--p-link); font: inherit; text-decoration: underline; cursor: pointer; min-height: 24px; }
.change-need { padding: 10px 12px; border-radius: 12px; background: var(--p-surface); border: 1px solid var(--p-line); color: var(--p-ink); }
.change-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.change-actions .button { width: 100%; min-height: 48px; }
.change-actions .button.ghost { background: var(--p-surface); color: var(--p-ink); }
.change-you { font-weight: 700; color: var(--p-success); }
.change-outcome { color: var(--p-ink); }
.change-foot { margin-top: -2px; }
.change-vouches { display: grid; gap: 16px; }
.vouch-card { display: grid; gap: 8px; }
.vouch-card h3 { margin: 0; }
.vouch-card .button { width: 100%; }
.cx-card { max-width: 760px; }
.cx-card h2 { margin-bottom: 4px; }
.cx-seats { font-weight: 600; margin-top: 8px !important; }
.change-rule { margin-top: 10px !important; padding: 10px 12px; border-left: 3px solid var(--p-accent); background: var(--p-warning-bg); border-radius: 0 10px 10px 0; }
@media (min-width: 768px) {
  .change-actions { max-width: 420px; }
  .vouch-card .button { width: auto; justify-self: start; min-width: 220px; }
}

/* ---------- the connection banner (20 November 2026) ----------
   Only when Taggz can't be reached (app.js renderConn): a cream card pinned
   under the kente stripe, over the page (nothing below moves), then a short
   green "Back online". Cream in both themes: #1E2A22 on #F3EBD6 is 13.1:1,
   #4E5A50 on it 6.2:1; white on #145C2B 7.9:1. */
.conn { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 0; right: 0; z-index: 60; display: flex; justify-content: center;
  padding: 0 16px; pointer-events: none; }
.conn > * { pointer-events: auto; }
.conn-card { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; box-sizing: border-box;
  background: var(--p-cream); color: var(--p-cream-ink); border: 1px solid var(--p-cream-line); border-radius: 14px;
  padding: 8px 8px 8px 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); font-size: 14px; }
.conn-card[hidden], .conn-back[hidden], .conn-icon[hidden], .conn-spin[hidden], .conn-retry[hidden] { display: none; }
.conn-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--p-cream-line); color: #0B2A1F;
  display: grid; place-items: center; flex: none; }
.conn-spin { width: 16px; height: 16px; margin: 0 6px; flex: none; border-radius: 50%;
  border: 2.5px solid #9AA59C; border-top-color: #0B2A1F; animation: conn-spin 0.9s linear infinite; }
@keyframes conn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .conn-spin { animation-duration: 2.4s; } }
.conn-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.conn-text strong { font-size: 14px; }
.conn-text small { font-size: 12.5px; color: var(--p-cream-muted); }
.conn-retry { margin-left: auto; min-height: 40px; padding: 6px 12px; border-radius: 10px; flex: none; cursor: pointer;
  background: transparent; color: #0B2A1F; border: 1.5px solid #0B2A1F; font: inherit; font-weight: 800; font-size: 13px; }
.conn-retry:hover { background: rgba(11, 42, 31, .08); }
.conn-retry:focus-visible { outline: 3px solid #1F5FA8; outline-offset: 2px; }
.conn-back { margin: 0; background: #145C2B; color: #fff; font-weight: 700; font-size: 13px; border-radius: 99px;
  padding: 7px 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
/* Wide layouts (audit3 r2 W2-5): centred on the main column, not the
   viewport, and the page makes room above its heading while it shows, so it
   never covers "Your crews" or a crew's name. */
@media (min-width: 1024px) {
  body[data-signed="1"] .conn { left: 264px; }
  body[data-signed="1"][data-conn="1"] .app-main { padding-top: 92px; }
}
.conn-updated { margin: 8px 2px 0; font-size: 12px; color: var(--p-ink-2); }
.conn-updated[hidden] { display: none; }

/* Early-turn warnings while a crew forms (20 November 2026): the server's sentences, before agreeing */
.early-warnings { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--p-warning, #b7791f); background: var(--p-warning-bg, rgba(183, 121, 31, .1)); border-radius: 8px; }
.early-warnings li { margin: 0; }
.early-warnings li + li { margin-top: 6px; }
/* In the join bar, right above "I agree" (audit4 r1 C1-3); on the vote card and the change's rules, above Agree. */
#jf-form .early-warnings { margin: 0 0 10px; }
/* A long list (clients r2 C2-7): folded behind a button that says how many there are; opened, every warning shows
   and the bar scrolls as a whole, I agree after the last one, never a box cut off at a line. */
#jf-form { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
/* Below 1024px the 60px top bar is sticky too: the opened bar never runs under it (audit4 r3, R3-7). */
@media (max-width: 1023.98px) {
  #jf-form { max-height: calc(100dvh - 60px - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  body[data-signed="1"] #jf-form {
    max-height: calc(100dvh - 60px - var(--p-tabs-h) - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
/* "I agree" waiting for the folded warnings to be opened looks unavailable (R3-7). */
.join-agree:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.early-warnings li[hidden] { display: none; }
.early-warnings .early-more { margin-top: 8px; }
.early-warnings .early-more .button { min-height: 44px; width: 100%; white-space: normal; text-align: center; }
#cx-accept .change-moves { margin: 12px 0; }
.change-card .change-moves { margin: 12px 0 0; }
.order-safeguard { margin-top: 4px; }
/* A turn drawn by lot (20 November 2026): said under the turn, in the seats list and the turn order. */
.day .drawn-lot { display: block; font-size: 12px; font-weight: 400; color: var(--p-ink-2); }

/* Help for a member who's started falling behind (behavioural features,
   27 November 2026): calm, not a warning: the quiet surface, an info edge. */
.help-card { position: relative; background: var(--p-surface-2); border-left: 4px solid var(--p-info); }
.help-card h2 { margin-bottom: 4px; padding-right: 36px; }
.help-card > p:not(.actions) { color: var(--p-ink-2); margin: 0; }
.help-close { position: absolute; top: 8px; right: 8px; color: var(--p-ink-2); }
.help-close:hover { background: var(--p-line); color: var(--p-ink); }
#reminders .check { font-weight: 600; }
#smart-reminders-box .muted.small { margin: 4px 0 0 30px; }
.about-you { display: grid; gap: 6px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--p-line); }
.about-you h3 { margin: 0 !important; }
.about-you label { margin-top: 6px; font-weight: 600; }
