/* Hallmark · shape: app screen · genre: modern-minimal · theme: Tracker (custom, by request: a work-tracker blue in place of Console's amber)
 * nav: the project's own sidebar, a project switcher on top · signature: the project portfolio as one ruled table; the setup wizard's live record and its span line · states: loading, empty, error, full · light and dark
 * axes: light/grotesk-sans/chromatic-blue · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V3 · weakest: V, a work tracker should feel familiar; one blue for action and selection, flat 3px controls, white surfaces on grey, status as tinted lozenges, no dots, gradients or glass */
/* Hallmark · answered fonts: Host Grotesk and Atkinson Hyperlegible Mono ship no Vietnamese subset, so Be Vietnam Pro (grotesk) and IBM Plex Mono carry the same roles */
/* Hallmark · finish-review: subagent · fix · 8 findings · 8 resolved (dashes, phone record first, phone milestone line, neutral API notice, no selected stripe, login top edge, one primary on welcome, phone step labels, four-digit years) · gap: the app shell's sticky pair (56) and sidebar foot (72) predate this redesign */
/* Hallmark · waive 39b · .wl-row is a whole project row of two text lines on the welcome list, a list item not a control · a 56px row holds the project name above its type */
/* Hallmark · reworded login errors, the sign-in title and three wizard errors from an em dash to a colon or a full stop · 19 names the dash */
/* Hallmark · dismissed F7 · cards, tables and inputs share one recipe on purpose: a work tracker reads as one surface system */
/* Hallmark · dismissed 23 · the primary button is a 40px control, never a viewport-scale fill */
/* Hallmark · dismissed F4 · the sign-in page and the app are separate documents, each with one filled primary */
/* Hallmark · reworded "Bạn duyệt trước khi tạo" panel heading into the record's closing note · the record replaces the two bullet panels */

/* ---------------------------------------------------------------- tokens */
/* Work-tracker palette: cool neutrals, one blue for the primary action and the current selection,
 * status colours (green done, red late or blocked, orange warning) used for status only. */
:root {
  color-scheme: light;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.125rem; --text-xl: 1.266rem; --text-2xl: 1.424rem; --text-3xl: 1.602rem;
  --hm-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms; --dur-short: 200ms;

  --color-paper: oklch(98.4% 0.003 250); --color-paper-2: oklch(100% 0 0); --color-paper-3: oklch(96.2% 0.005 255);
  --color-ink: oklch(29% 0.045 262); --color-ink-2: oklch(39% 0.04 262); --color-muted: oklch(49% 0.03 262);
  --color-rule: oklch(91.5% 0.008 260); --color-rule-2: oklch(84% 0.012 260);
  --color-accent: oklch(53% 0.2 258); --color-accent-ink: oklch(100% 0 0); --color-accent-text: oklch(49% 0.19 258); --color-accent-soft: oklch(95.6% 0.025 255);
  --color-accent-hover: oklch(47% 0.19 258);
  --color-focus: oklch(56% 0.2 258);
  --color-cool: oklch(55% 0.17 252); --color-cool-soft: oklch(95.6% 0.025 255);
  --color-ok: oklch(50% 0.13 155); --color-ok-soft: oklch(95% 0.04 155);
  --color-bad: oklch(53% 0.19 27); --color-bad-soft: oklch(95.5% 0.03 25);
  --color-warn: oklch(55% 0.14 55); --color-warn-soft: oklch(95.5% 0.045 70);
  --font-display: "Be Vietnam Pro", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display);
  --font-outlier: var(--font-body);
  --radius-card: 6px; --radius-pill: 3px; --radius-chip: 3px; --rule-hair: 1px;
  --shadow-raise: 0 1px 1px oklch(29% 0.045 262 / 0.12), 0 0 1px oklch(29% 0.045 262 / 0.24);
  --shadow-pop: 0 8px 16px -4px oklch(29% 0.045 262 / 0.2), 0 0 1px oklch(29% 0.045 262 / 0.28);
  --color-badge: oklch(100% 0 0);
  --brand-fill: oklch(53% 0.2 258);
  --tracking-display: -0.012em;
}
/* The app sets data-theme; a page without it (sign-in) follows the device. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --color-paper: oklch(21.5% 0.008 250); --color-paper-2: oklch(24.5% 0.009 250); --color-paper-3: oklch(28.5% 0.01 250);
    --color-ink: oklch(89% 0.015 250); --color-ink-2: oklch(82% 0.015 250); --color-muted: oklch(70% 0.015 250);
    --color-rule: oklch(33% 0.01 250); --color-rule-2: oklch(41% 0.012 250);
    --color-accent: oklch(69% 0.15 255); --color-accent-ink: oklch(21% 0.02 255); --color-accent-text: oklch(73% 0.13 255); --color-accent-soft: oklch(31% 0.06 255);
    --color-accent-hover: oklch(74% 0.14 255); --color-focus: oklch(72% 0.14 255);
    --color-cool: oklch(72% 0.12 250); --color-cool-soft: oklch(31% 0.06 255);
    --color-ok: oklch(74% 0.14 155); --color-ok-soft: oklch(29% 0.04 155);
    --color-bad: oklch(70% 0.16 25); --color-bad-soft: oklch(29% 0.05 25);
    --color-warn: oklch(78% 0.13 70); --color-warn-soft: oklch(30% 0.05 70);
    --shadow-raise: 0 0 0 1px oklch(33% 0.01 250); --shadow-pop: 0 8px 16px -4px oklch(0% 0 0 / 0.5), 0 0 0 1px oklch(38% 0.01 250);
    --brand-fill: oklch(56% 0.17 258);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: oklch(21.5% 0.008 250); --color-paper-2: oklch(24.5% 0.009 250); --color-paper-3: oklch(28.5% 0.01 250);
  --color-ink: oklch(89% 0.015 250); --color-ink-2: oklch(82% 0.015 250); --color-muted: oklch(70% 0.015 250);
  --color-rule: oklch(33% 0.01 250); --color-rule-2: oklch(41% 0.012 250);
  --color-accent: oklch(69% 0.15 255); --color-accent-ink: oklch(21% 0.02 255); --color-accent-text: oklch(73% 0.13 255); --color-accent-soft: oklch(31% 0.06 255);
  --color-accent-hover: oklch(74% 0.14 255); --color-focus: oklch(72% 0.14 255);
  --color-cool: oklch(72% 0.12 250); --color-cool-soft: oklch(31% 0.06 255);
  --color-ok: oklch(74% 0.14 155); --color-ok-soft: oklch(29% 0.04 155);
  --color-bad: oklch(70% 0.16 25); --color-bad-soft: oklch(29% 0.05 25);
  --color-warn: oklch(78% 0.13 70); --color-warn-soft: oklch(30% 0.05 70);
  --shadow-raise: 0 0 0 1px oklch(33% 0.01 250); --shadow-pop: 0 8px 16px -4px oklch(0% 0 0 / 0.5), 0 0 0 1px oklch(38% 0.01 250);
  --brand-fill: oklch(56% 0.17 258);
}

/* The app's own token names, pointed at the theme (style.css reads these everywhere). */
:root, :root[data-theme="dark"] {
  --bg: var(--color-paper); --bg-2: var(--color-paper-3);
  --panel: var(--color-paper-2); --panel-2: var(--color-paper); --panel-subtle: var(--color-paper-3); --panel-tint: var(--color-accent-soft);
  --line: var(--color-rule); --line-2: var(--color-rule-2);
  --txt: var(--color-ink); --txt-2: var(--color-ink-2); --muted: var(--color-muted); --muted-2: var(--color-muted);
  /* --brand is a fill under white text in style.css: a deep amber that keeps 5:1 in both modes; amber as text is --brand-ink. */
  --brand: var(--brand-fill); --brand-2: var(--brand-fill); --brand-ink: var(--color-accent-text);
  --brand-soft: var(--color-accent-soft); --brand-border: var(--color-rule-2);
  --brand-grad: var(--brand-fill); --brand-grad-soft: var(--color-accent-soft);
  --ok: var(--color-ok); --ok-bg: var(--color-ok-soft); --ok-border: var(--color-rule-2);
  --warn: var(--color-warn); --warn-bg: var(--color-warn-soft); --warn-border: var(--color-rule-2);
  --danger: var(--color-bad); --danger-bg: var(--color-bad-soft); --danger-border: var(--color-rule-2);
  --info: var(--color-cool); --info-bg: var(--color-cool-soft); --info-border: var(--color-rule-2);
  --pink: var(--color-accent-text);
  --r-lg: var(--radius-card); --r: var(--radius-card); --r-sm: var(--radius-pill); --r-xs: var(--radius-chip);
  --shadow-xs: none; --shadow-sm: var(--shadow-raise); --shadow-pink: none;
  --shadow: var(--shadow-pop);
  --control-bg: var(--color-paper-2); --control-hover: var(--color-paper-3); --control-rim: var(--color-rule-2); --control-edge: transparent;
  --control-shadow: none; --control-primary: var(--color-accent); --control-primary-hover: var(--color-accent-hover);
  --chart-grid: var(--color-rule); --chart-tick: var(--color-muted);
}

html, body { overflow-x: clip; }
body { font-family: var(--font-body); background: var(--color-paper); color: var(--color-ink); }
h1, h2, h3, .topbar-title { font-family: var(--font-display); letter-spacing: var(--tracking-display); text-wrap: balance; }
html { scrollbar-color: var(--color-rule-2) transparent; }
.pj-switch:active, .pj-menu-item:active, .np-type:active, .hm-btn:active, .pj-table tbody tr:active { transform: scale(0.98); transition: transform var(--dur-micro) var(--hm-ease-out); }
::selection { background: color-mix(in oklab, var(--color-accent) 30%, transparent); }

/* One primary control: amber fill, dark ink. */
body .btn.btn-primary, body .btn-primary {
  background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); box-shadow: none;
}
body .btn.btn-primary:not(:disabled):hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* What the system measured: figures, ids, dates. */
.hm-measured { font-family: var(--font-outlier); font-variant-numeric: tabular-nums slashed-zero; }

/* ------------------------------------------------------- project switcher */
.pj-switch {
  display: flex; align-items: center; gap: var(--space-xs); width: 100%; min-height: 44px; padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink);
  font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur-micro) var(--hm-ease-out), border-color var(--dur-micro) var(--hm-ease-out);
}
.pj-switch:hover { background: var(--color-paper-3); border-color: var(--color-rule-2); }
.pj-switch[aria-expanded="true"] { border-color: var(--color-rule-2); }
.pj-switch-t { min-width: 0; flex: 1; }
.pj-switch-t b { display: block; font-weight: 600; font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-switch-t small { display: block; font-size: var(--text-xs); color: var(--color-muted); }
.pj-switch > i { color: var(--color-muted); font-size: 12px; }
.pj-menu {
  position: absolute; z-index: 400; top: 100%; left: var(--space-sm); right: var(--space-sm); margin-top: var(--space-2xs);
  border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-card); background: var(--color-paper-2);
  overflow: hidden; max-height: min(70vh, 520px); display: flex; flex-direction: column;
}
.pj-menu[hidden] { display: none; }
.pj-menu-list { overflow-y: auto; padding: var(--space-2xs); }
.pj-menu-item {
  display: flex; align-items: center; gap: var(--space-xs); width: 100%; min-height: 44px; padding: var(--space-xs) var(--space-sm);
  border: 0; border-radius: var(--radius-pill); background: none; color: var(--color-ink); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer;
}
.pj-menu-item:hover { background: var(--color-paper-3); }
.pj-menu-item[aria-current="true"] { background: var(--color-accent-soft); }
.pj-menu-item span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-menu-item small { color: var(--color-muted); font-size: var(--text-xs); }
.pj-menu-foot { display: flex; gap: var(--space-2xs); padding: var(--space-xs); border-top: var(--rule-hair) solid var(--color-rule); }
.pj-menu-foot .btn { flex: 1; justify-content: center; }
.brand { position: relative; }

/* ------------------------------------------------------- project portfolio */
.pj-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-lg); }
.pj-head h2 { margin: 0; font-size: var(--text-2xl); font-weight: 500; }
.pj-head p { margin: var(--space-2xs) 0 0; color: var(--color-muted); max-width: 60ch; }
.pj-filter { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.pj-table-wrap { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); overflow-x: auto; }
.pj-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 760px; }
.pj-table th { text-align: left; font-weight: 500; color: var(--color-muted); padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); white-space: nowrap; }
.pj-table td { padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); vertical-align: top; }
.pj-table tr:last-child td { border-bottom: 0; }
.pj-table tbody tr { cursor: pointer; transition: background-color var(--dur-micro) var(--hm-ease-out); }
.pj-table tbody tr:hover { background: var(--color-paper-3); }
.pj-table tbody tr.is-current { background: var(--color-accent-soft); }
.pj-name { display: block; font-weight: 600; color: var(--color-ink); text-decoration: none; }
.pj-name:hover { text-decoration: underline; text-decoration-color: var(--color-rule-2); }
.pj-sub { display: block; color: var(--color-muted); font-size: var(--text-xs); margin-top: var(--space-3xs); }
.pj-next { color: var(--color-accent-text); }
.pj-num { text-align: right; white-space: nowrap; }
.pj-bar { display: block; height: 4px; margin-top: var(--space-2xs); background: var(--color-rule); border-radius: 2px; overflow: hidden; min-width: 80px; }
.pj-bar i { display: block; height: 100%; background: var(--color-cool); transform-origin: left; }
.chip-hm { display: inline-block; padding: 1px var(--space-xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-chip); font-size: var(--text-xs); color: var(--color-ink-2); white-space: nowrap; }
.chip-hm.is-active { background: var(--color-cool-soft); }
.chip-hm.is-hold { background: var(--color-warn-soft); }
.chip-hm.is-done { background: var(--color-ok-soft); }
.chip-hm.is-bad { background: var(--color-bad-soft); }

/* ---------------------------------------------------------- setup wizard */
.np { max-width: 1180px; }
/* Steps: a quiet trail, the current step underlined in amber (a person's place), done steps in ink-2. */
.np-steps { display: flex; gap: var(--space-lg); margin: 0 0 var(--space-xl); padding: 0; list-style: none; border-bottom: var(--rule-hair) solid var(--color-rule); overflow-x: auto; }
.np-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-xs); align-items: baseline; padding: var(--space-xs) 0 var(--space-sm); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap; }
.np-steps li b { font-weight: 500; color: inherit; }
.np-steps li small { grid-column: 2; font-size: var(--text-xs); color: var(--color-muted); }
.np-step-n { font-size: var(--text-xs); }
@media (max-width: 40rem) { .np-steps { gap: var(--space-md); } .np-steps li:not([aria-current]) b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.np-steps li[aria-current="step"] { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.np-steps li.is-done { color: var(--color-ink-2); }
.np-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: var(--space-2xl); align-items: start; }
@media (max-width: 60rem) { .np-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); } .np-steps li small { display: none; } }
.np-main { min-width: 0; max-width: 720px; }
.np-intro { margin: 0 0 var(--space-lg); color: var(--color-ink-2); max-width: 60ch; line-height: 1.55; }
.np-panel { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); color: var(--color-ink); padding: var(--space-lg); min-width: 0; }
.np-panel h3 { margin: 0 0 var(--space-2xs); font-size: var(--text-lg); font-weight: 500; }
.np-panel > p { margin: 0 0 var(--space-md); color: var(--color-muted); }
.np-field { display: grid; gap: var(--space-2xs); margin-bottom: var(--space-md); }
.np-fieldset { border: 0; padding: 0; margin: 0 0 var(--space-lg); min-width: 0; }
.np-fieldset legend { padding: 0; margin-bottom: var(--space-xs); }
.np-field label, .np-field .np-label { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.np-hint { font-size: var(--text-xs); font-weight: 400; color: var(--color-muted); }
.np-sub-h { margin: var(--space-xl) 0 var(--space-sm); padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); font-size: var(--text-md); font-weight: 500; letter-spacing: 0; }
.np-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
@media (max-width: 40rem) { .np-row { grid-template-columns: minmax(0, 1fr); } }
/* The field: a muted edge that holds 3:1, a constant border, the ring as an inset outline. */
.np-main input[type="text"], .np-main input[type="date"], .np-main input[type="number"], .np-main textarea, .np-main select {
  width: 100%; min-height: 40px; padding: var(--space-xs) var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-pill);
  background: var(--color-paper-2); color: var(--color-ink); font: inherit; font-size: var(--text-md); outline: 2px solid transparent; outline-offset: -3px;
  transition: background-color var(--dur-micro) var(--hm-ease-out);
}
.np-main input:hover, .np-main textarea:hover { background: var(--color-paper-3); }
.np-main input:focus-visible, .np-main textarea:focus-visible, .np-main select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -3px; }
.np-main input[type="date"] { font-family: var(--font-outlier); font-size: var(--text-sm); }
.np-main .np-name-input { min-height: 48px; font-size: var(--text-lg); font-weight: 500; }
.np-main textarea { min-height: 132px; resize: vertical; line-height: 1.5; }
.np [aria-invalid="true"] { border-color: var(--color-bad); }
.np-err { color: var(--color-bad); font-size: var(--text-sm); }
/* Project type: one surface cut by hairlines, two columns of rows; the chosen row tinted amber with a rule-2 spine. */
.np-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--rule-hair); background: var(--color-rule); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; }
@media (max-width: 40rem) { .np-types { grid-template-columns: minmax(0, 1fr); } }
.np-type { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--space-3xs) var(--space-sm); align-items: start; padding: var(--space-sm) var(--space-md); min-height: 44px;
  background: var(--color-paper-2); cursor: pointer;
  transition: background-color var(--dur-micro) var(--hm-ease-out); }
.np-type:hover { background: var(--color-paper-3); }
.np-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.np-type i { grid-row: span 2; color: var(--color-muted); margin-top: var(--space-2xs); text-align: center; }
.np-type b { font-weight: 500; font-size: var(--text-sm); }
.np-type small { color: var(--color-muted); font-size: var(--text-xs); line-height: 1.45; }
.np-type:has(input:checked) { background: var(--color-accent-soft); }
.np-type:has(input:checked) b { color: var(--color-ink); font-weight: 600; }
.np-type:has(input:checked) i { color: var(--color-accent-text); }
.np-type:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: -2px; z-index: 1; }
.np-type:last-child:nth-child(odd) { grid-column: 1 / -1; }
.np-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; margin-top: var(--space-lg); }
.np-actions .np-spacer { flex: 1; }
/* The record the brief will become, kept beside the form and updated as it is typed. */
.np-aside { position: sticky; top: calc(var(--topbar-h, 66px) + var(--space-md)); min-width: 0; }
@media (max-width: 60rem) { .np-aside { position: static; order: -1; } .np-record .np-will, .np-record .np-record-body h2, .np-record .np-record-note { display: none; } .np-record .np-record-body { padding-top: var(--space-md); } .np-record .np-record-body:not(:has(.np-notice)) { display: none; } .np-record .np-record-body .np-notice { margin-top: 0; } }
.np-record { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); overflow: hidden; }
.np-record-head { padding: var(--space-lg) var(--space-lg) var(--space-md); }
.np-record-type { margin: 0 0 var(--space-2xs); font-size: var(--text-sm); color: var(--color-muted); }
.np-record-name { margin: 0; font-size: var(--text-2xl); font-weight: 500; line-height: 1.2; letter-spacing: var(--tracking-display); overflow-wrap: break-word; min-width: 0; }
.np-record-name.is-blank { color: var(--color-muted); }
.np-record .np-span { padding: var(--space-md) var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); border-bottom: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-3); }
.np-record-body { padding: var(--space-md) var(--space-lg) var(--space-lg); }
.np-record-body h2 { margin: 0 0 var(--space-xs); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); letter-spacing: 0; }
.np-will { margin: 0; display: grid; }
.np-will > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--space-sm); padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); font-size: var(--text-sm); }
.np-will > div:last-child { border-bottom: 0; }
.np-will dt { font-weight: 500; color: var(--color-ink); }
.np-will dd { margin: 0; color: var(--color-muted); }
.np-record-note { margin: var(--space-md) 0 0; font-size: var(--text-sm); color: var(--color-muted); line-height: 1.5; }
.np-record .np-notice { margin: var(--space-md) 0 0; background: var(--color-paper-3); border-color: var(--color-rule); }
.np-notice { padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-warn-soft); color: var(--color-ink); font-size: var(--text-sm); margin-bottom: var(--space-md); line-height: 1.5; }
/* The span: start, end (amber, named by the type), length in days; a drafted plan's milestones on the line. */
.np-span-line { position: relative; height: 14px; margin: 0 var(--space-xs) var(--space-sm); }
.np-span-line::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 1px; background: var(--color-rule-2); }
.np-span-line::after { content: ""; position: absolute; left: -4px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-ink-2); }
.np-span-ms { position: absolute; top: 3px; width: 8px; height: 8px; background: var(--color-cool); transform: translateX(-50%) rotate(45deg); }
.np-span-end { position: absolute; right: -6px; top: 1px; width: 12px; height: 12px; background: var(--color-accent); transform: rotate(45deg); }
.np-span-ends { display: flex; justify-content: space-between; align-items: end; gap: var(--space-sm); }
.np-span-ends > span { display: grid; gap: var(--space-3xs); min-width: 0; }
.np-span-ends small { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.np-span-ends b { font-weight: 500; font-size: var(--text-md); color: var(--color-ink); }
.np-span-ends .is-end { text-align: right; }
.np-span-ends .is-end b { color: var(--color-accent-text); }
.np-span-len { align-self: center; font-size: var(--text-xs); color: var(--color-muted); }
.np-span.is-empty p { margin: 0; font-size: var(--text-sm); color: var(--color-muted); }
/* Step 2's head: the plan's name and source beside its span. */
.np-plan-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: var(--space-xl); align-items: end; margin-bottom: var(--space-lg); }
@media (max-width: 60rem) { .np-plan-head { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); } }
.np-plan-t h2 { margin: 0 0 var(--space-2xs); font-size: var(--text-3xl); font-weight: 500; line-height: 1.15; overflow-wrap: break-word; min-width: 0; }
.np-plan-t p { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; color: var(--color-muted); font-size: var(--text-sm); }
.np-plan-t .np-plan-sum { display: block; margin-top: var(--space-sm); color: var(--color-ink-2); font-size: var(--text-md); max-width: 70ch; line-height: 1.55; }
.np-plan-head .np-span { padding: var(--space-md) var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); }

/* The plan, as the record it will become. */
.np-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--rule-hair); background: var(--color-rule); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); overflow: hidden; margin-bottom: var(--space-lg); }
.np-summary > div { background: var(--color-paper-2); padding: var(--space-md); }
.np-summary b { display: block; font-family: var(--font-outlier); font-size: var(--text-3xl); font-weight: 400; font-variant-numeric: tabular-nums slashed-zero; line-height: 1.1; }
.np-summary span { font-size: var(--text-sm); color: var(--color-muted); }
@media (max-width: 40rem) { .np-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.np-sec { margin-bottom: var(--space-lg); }
.np-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-xs); }
.np-sec-h h3 { margin: 0; font-size: var(--text-lg); font-weight: 500; }
.np-sec-h small { color: var(--color-muted); }
.np-tbl-wrap { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); overflow-x: auto; }
.np-tbl { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.np-tbl th { text-align: left; font-weight: 500; color: var(--color-muted); padding: var(--space-xs) var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); white-space: nowrap; }
.np-tbl td { padding: var(--space-2xs) var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); vertical-align: middle; }
.np-tbl tr:last-child td { border-bottom: 0; }
.np-tbl tr.is-ms td { background: var(--color-paper-3); }
.np-tbl input, .np-tbl select { width: 100%; border: var(--rule-hair) solid transparent; border-radius: var(--radius-pill); color: var(--color-ink); font: inherit; }
.np-tbl input[type="number"] { width: auto; }
.np-tbl input, .np-tbl select { min-height: 36px !important; font-size: var(--text-sm) !important; background: transparent !important; border-color: transparent !important; padding: var(--space-2xs) var(--space-xs) !important; }
.np-tbl input:hover, .np-tbl select:hover { border-color: var(--color-rule) !important; }
.np-tbl input:focus-visible, .np-tbl select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; background: var(--color-paper-3) !important; }
.np-tbl input[type="date"] { font-family: var(--font-outlier); min-width: 140px; }
.np-tbl .np-x { min-width: 36px; min-height: 36px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--color-muted); cursor: pointer; }
.np-tbl .np-x:hover { background: var(--color-bad-soft); color: var(--color-bad); }
.np-ms { color: var(--color-accent-text); font-size: 12px; }
.np-add { margin-top: var(--space-xs); }
.np-mods { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.np-mod { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 36px; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); font-size: var(--text-sm); cursor: pointer; background: var(--color-paper-2); }
.np-mod:has(input:checked) { background: var(--color-cool-soft); }
.np-mod input { accent-color: var(--color-cool); }
.np-busy { display: grid; gap: var(--space-sm); padding: var(--space-xl) var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); }
.np-busy p { margin: 0; color: var(--color-ink-2); }
.np-busy .np-trail { list-style: none; margin: 0; padding: 0 0 0 var(--space-md); border-left: var(--rule-hair) solid var(--color-rule-2); display: grid; gap: var(--space-2xs); color: var(--color-muted); font-size: var(--text-sm); }
.np-busy .np-trail li.is-on { color: var(--color-accent-text); }
.np-skel { height: 12px; border-radius: 3px; background: var(--color-paper-3); }

/* ------------------------------------------------------------- welcome */
.wl { max-width: 880px; }
.wl-head { padding-bottom: var(--space-xl); margin-bottom: var(--space-xl); border-bottom: var(--rule-hair) solid var(--color-rule); }
.wl-head h2 { margin: 0 0 var(--space-sm); font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); font-weight: 500; line-height: 1.1; overflow-wrap: break-word; min-width: 0; }
.wl-head p { margin: 0 0 var(--space-lg); max-width: 56ch; color: var(--color-ink-2); line-height: 1.55; }
.wl-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.wl-list h3 { display: flex; gap: var(--space-xs); align-items: baseline; margin: 0 0 var(--space-sm); font-size: var(--text-lg); font-weight: 500; }
.wl-rows { list-style: none; margin: 0; padding: 0; border-top: var(--rule-hair) solid var(--color-rule-2); }
.wl-rows li { border-bottom: var(--rule-hair) solid var(--color-rule); }
.wl-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: var(--space-lg); align-items: center; width: 100%; min-height: 56px; padding: var(--space-sm) var(--space-xs);
  border: 0; background: none; color: var(--color-ink); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur-micro) var(--hm-ease-out); }
.wl-row:hover { background: var(--color-paper-3); }
.wl-row:active { background: var(--color-paper-3); }
.wl-row:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.wl-row > span { display: grid; gap: var(--space-3xs); min-width: 0; }
.wl-row small { font-size: var(--text-xs); color: var(--color-muted); }
.wl-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-next .pj-next { font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-end { text-align: right; }
.wl-end b { font-weight: 500; font-size: var(--text-sm); }
@media (max-width: 40rem) { .wl-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name end" "next next"; row-gap: var(--space-xs); } .wl-name { grid-area: name; } .wl-end { grid-area: end; } .wl-next { grid-area: next; } }
.wl-empty, .wl-note { margin: var(--space-md) 0 0; color: var(--color-muted); font-size: var(--text-sm); max-width: 60ch; }
.wl-skel { display: grid; gap: var(--space-xs); padding: var(--space-md) var(--space-xs); border-bottom: var(--rule-hair) solid var(--color-rule); }

/* ----------------------------------------------------------------- login */
body.hm-login { min-height: 100dvh; display: grid; place-items: center; margin: 0; padding: var(--space-xl) var(--space-md); background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); }
body.hm-login *, body.hm-login *::before, body.hm-login *::after { box-sizing: border-box; }
.hm-login-wrap { width: min(100%, 1040px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-2xl); align-items: start; }
@media (max-width: 60rem) { .hm-login-wrap { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); max-width: 440px; } }
.hm-login-main { min-width: 0; }
.hm-login-mark { margin: 0 0 var(--space-xl); font-weight: 600; font-size: var(--text-md); }
.hm-login h1 { margin: 0 0 var(--space-sm); font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: 500; line-height: 1.08; letter-spacing: var(--tracking-display); overflow-wrap: break-word; min-width: 0; }
.hm-login-lede { margin: 0 0 var(--space-xl); max-width: 40ch; color: var(--color-ink-2); line-height: 1.55; }
.hm-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font: inherit; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--dur-micro) var(--hm-ease-out); }
.hm-btn:hover { background: var(--color-paper-3); }
.hm-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.hm-btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.hm-btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.hm-btn-wide { width: 100%; }
.hm-btn-primary .hm-g { background: var(--color-badge); border-radius: 50%; padding: var(--space-3xs); width: 22px; height: 22px; }
.hm-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.hm-alert { margin: 0 0 var(--space-md); padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-bad-soft); font-size: var(--text-sm); line-height: 1.5; }
.hm-login-admin { display: grid; gap: var(--space-xs); margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }
.hm-login-admin label { font-size: var(--text-sm); font-weight: 500; }
.hm-input { width: 100%; min-height: 44px; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font: inherit; outline: 2px solid transparent; outline-offset: -3px; }
.hm-input:hover { background: var(--color-paper-3); }
.hm-input:focus-visible { outline-color: var(--color-focus); }
.hm-login-foot { margin: var(--space-lg) 0 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.5; }
/* The side: one reading the system measured, then the index of project types. */
.hm-login-side { min-width: 0; border-left: var(--rule-hair) solid var(--color-rule); padding-left: var(--space-2xl); }
@media (max-width: 60rem) { .hm-login-side { border-left: 0; padding-left: 0; border-top: var(--rule-hair) solid var(--color-rule); padding-top: var(--space-xl); } }
.hm-reading { display: grid; gap: var(--space-2xs); margin: 0 0 var(--space-xl); color: var(--color-muted); font-size: var(--text-sm); }
.hm-reading-n { font-size: clamp(3rem, 2rem + 4vw, 4.5rem); line-height: 1; letter-spacing: -0.04em; color: var(--color-ink); }
.hm-login-side h2 { margin: 0 0 var(--space-sm); font-size: var(--text-lg); font-weight: 500; overflow-wrap: break-word; min-width: 0; }
.hm-types { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.hm-types th { text-align: left; font-weight: 500; color: var(--color-muted); padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule-2); }
.hm-types td { padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); color: var(--color-ink); }
.hm-types td + td, .hm-types th + th { padding-left: var(--space-md); color: var(--color-muted); }
.hm-types tr:last-child td { border-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .pj-switch, .pj-table tbody tr, .np-type, .hm-btn, .wl-row, .np-main input, .np-main textarea { transition: none; }
  .pj-switch:active, .pj-menu-item:active, .np-type:active, .hm-btn:active, .pj-table tbody tr:active { transform: none; }
}

/* Floor 9: labels, table heads and nav groups are sentence case in the body face, never tracked capitals. */
.nav-label, th, .kcol-head, .fl, .card-sub, .tiny-caps, .eyebrow { text-transform: none !important; letter-spacing: 0 !important; }
.nav-label { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }

/* ------------------------------------------------------------- invites */
.iv { display: grid; gap: var(--space-md); }
.iv .field { display: grid; gap: var(--space-2xs); }
.iv label { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.iv-res, .iv-rows { list-style: none; margin: 0; padding: 0; }
.iv-res li { display: grid; gap: var(--space-3xs); padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.iv-link { padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-chip); background: var(--color-paper-3); font-family: var(--font-outlier); font-size: var(--text-sm); overflow-wrap: anywhere; }
.iv-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-md); align-items: center; padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.iv-rows li:last-child { border-bottom: 0; }
.iv-who { display: grid; gap: var(--space-3xs); min-width: 0; }
.iv-who small { font-size: var(--text-xs); color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-state { font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap; }
.iv-state.is-in { color: var(--color-ok); }
.iv-act { display: flex; gap: var(--space-2xs); }
.iv-req { margin-bottom: var(--space-md); padding: var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-card); background: var(--color-accent-soft); }
.iv-req h3 { margin: 0 0 var(--space-2xs); font-size: var(--text-md); font-weight: 600; }
.iv-req .iv-rows li { grid-template-columns: minmax(0, 1fr) minmax(0, 200px) auto; border-color: var(--color-rule-2); }
@media (max-width: 40rem) { .iv-rows li, .iv-req .iv-rows li { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); } }

/* --------------------------------------------------- start checklist */
.st-card { margin-bottom: var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); color: var(--color-ink); }
.st-head { display: flex; align-items: baseline; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-rule); }
.st-head h2 { margin: 0; font-size: var(--text-lg); font-weight: 500; }
.st-head .btn { margin-left: auto; }
.st-steps { list-style: none; margin: 0; padding: 0; }
.st-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--space-md); align-items: center; padding: var(--space-md) var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-rule); }
.st-steps li:last-child { border-bottom: 0; }
.st-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--color-rule-2); display: grid; place-items: center; font-size: 11px; color: var(--color-ok); }
.st-steps li.is-done .st-mark { border-color: var(--color-ok); background: var(--color-ok-soft); }
.st-t { display: grid; gap: var(--space-3xs); min-width: 0; }
.st-t b { font-weight: 500; }
.st-t span { font-size: var(--text-sm); color: var(--color-muted); }
.st-steps li.is-done .st-t b { color: var(--color-muted); }
@media (max-width: 40rem) { .st-steps li { grid-template-columns: 24px minmax(0, 1fr); } .st-act { grid-column: 2; } }
.wl-head:has(+ .st-card) { border-bottom: 0; padding-bottom: 0; margin-bottom: var(--space-lg); }
.wl-sub { margin: var(--space-lg) 0 var(--space-xs); font-size: var(--text-md); font-weight: 500; }
.wl-tasks { list-style: none; margin: 0 0 var(--space-lg); padding: 0; border-top: var(--rule-hair) solid var(--color-rule-2); }
.wl-tasks li { border-bottom: var(--rule-hair) solid var(--color-rule); }
.wl-task { display: flex; justify-content: space-between; gap: var(--space-md); align-items: baseline; width: 100%; min-height: 44px; padding: var(--space-sm) var(--space-xs); border: 0; background: none; color: var(--color-ink); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur-micro) var(--hm-ease-out); }
.wl-task:hover { background: var(--color-paper-3); }
.wl-task:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.wl-task small { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.wl-empty-lead { margin: var(--space-md) 0 var(--space-lg); max-width: 56ch; color: var(--color-ink-2); }

/* ------------------------------------------------ my tasks: blocker / note */
.my-quick { flex-wrap: wrap; }
.my-note { flex-basis: 100%; display: grid; gap: var(--space-2xs); margin-top: var(--space-xs); padding: var(--space-sm); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-paper-3); }
.my-note textarea { min-height: 3.2em; resize: vertical; }
.mf-label { text-transform: none !important; letter-spacing: 0 !important; }
/* Task list: six columns unless the person asks for start, progress and priority. */
#task-table.few table > thead > tr > th:nth-child(5), #task-table.few table > tbody > tr > td:nth-child(5),
#task-table.few table > thead > tr > th:nth-child(8), #task-table.few table > tbody > tr > td:nth-child(8),
#task-table.few table > thead > tr > th:nth-child(9), #task-table.few table > tbody > tr > td:nth-child(9) { display: none; }

/* =================================================================== shape
 * A work tracker's shape: small radii (3px controls, 6px surfaces), flat fills, no gradients or glass,
 * one blue for the primary action and the current page, compact 32px controls with 44px hit areas on touch.
 */
:root { --press: 1; }
body { font-size: 14px; }
/* Sidebar: narrower, items left-aligned, the current page a blue tint with blue text. */
.sidebar { width: 240px; flex-basis: 240px; background: var(--color-paper-2); }
.nav { gap: 1px; padding: var(--space-xs); }
.nav .nav-label { padding: var(--space-md) var(--space-xs) var(--space-2xs); font-size: 11.5px; font-weight: 600; color: var(--color-muted); }
.nav .nav-label:first-child { padding-top: var(--space-2xs); }
.nav a { gap: var(--space-sm); padding: var(--space-2xs) var(--space-xs); min-height: 36px; border-radius: var(--radius-pill); color: var(--color-ink-2); font-size: 14px; font-weight: 500; }
.nav a i { color: var(--color-muted); width: 16px; font-size: 13px; }
@media (hover: hover) { .nav a:hover { background: var(--color-paper-3); color: var(--color-ink); } .nav a:hover i { color: var(--color-ink-2); } }
.nav a.active, .nav a.active:hover { background: var(--color-accent-soft) !important; color: var(--color-accent-text); font-weight: 600; }
.nav a.active i { color: var(--color-accent-text); }
.nav-ind { display: none !important; }
.nav-fold > summary { cursor: pointer; }
.pj-switch { border-radius: var(--radius-pill); }
/* Topbar: white, a hairline under it, quiet controls. */
.topbar { background: var(--color-paper-2); border-bottom: var(--rule-hair) solid var(--color-rule); height: 56px; }
.topbar-title { font-size: 18px; font-weight: 600; letter-spacing: 0; }
.countdown { border-radius: var(--radius-pill); padding: var(--space-2xs) var(--space-sm); font-weight: 500; color: var(--color-ink-2); background: var(--color-paper-3); border-color: transparent; }
.countdown::before { background: var(--color-accent) !important; box-shadow: none !important; }
.search-btn { height: 32px; border-radius: var(--radius-pill); background: var(--color-paper-3); border-color: var(--color-rule-2); box-shadow: none; }
.search-btn kbd { border-radius: var(--radius-chip); }
/* Buttons: flat, 32px, 3px corners; primary is solid blue with white text. */
.btn { border-radius: var(--radius-pill); padding: var(--space-2xs) var(--space-sm); min-height: 32px; font-size: 14px; font-weight: 500; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--color-paper-2); border-color: var(--color-rule-2); color: var(--color-ink); }
@media (hover: hover) { .btn:not(:disabled, [aria-disabled="true"]):hover { background: var(--color-paper-3); border-color: var(--color-rule-2); } }
.btn-sm { border-radius: var(--radius-pill); padding: var(--space-3xs) var(--space-xs); min-height: 28px; font-size: 13px; }
body .btn.btn-primary, body .btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); box-shadow: none; }
.btn-ghost { background: transparent; border-color: transparent; }
@media (hover: hover) { .btn-ghost:not(:disabled):hover { background: var(--color-paper-3); border-color: transparent; } }
.btn-danger { border-radius: var(--radius-pill); }
.icon-btn { border-radius: var(--radius-pill); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (pointer: coarse) { .btn, .icon-btn, .search-btn { min-height: 44px; } }
/* Inputs: white, a 1px edge that holds 3:1, blue focus ring. */
.input, select.input, textarea.input { border-radius: var(--radius-pill); border-color: var(--color-rule-2); background: var(--color-paper-2); box-shadow: none; }
.input:hover { border-color: var(--color-muted); }
/* Surfaces: white cards on the grey page, a hairline edge, a soft raise; no inner glow. */
.card, .tbl-wrap, .st-card, .np-record, .np-panel, .pj-table-wrap, .np-tbl-wrap { border-radius: var(--radius-card); background: var(--color-paper-2); border-color: var(--color-rule); box-shadow: var(--shadow-raise); color: var(--color-ink); }
.card .tbl-wrap, .card .card { box-shadow: none; }
.modal, .qs, .pj-menu, .more-pop { border-radius: var(--radius-card) !important; box-shadow: var(--shadow-pop) !important; }
/* Status lozenges and chips: 3px corners, bold small type, tinted by meaning. */
.badge, .chip, .chip-hm, .my-chip, .fchip, .imp-badge, .wait-chip, .dep-jump, .count-badge, .page-jump a, .mh-u button, .my-undo, .f-n { border-radius: var(--radius-chip) !important; }
.badge { padding: var(--space-3xs) var(--space-xs); font-weight: 600; line-height: 1.35; }
.page-jump a { padding: var(--space-2xs) var(--space-sm); }
/* Tables: sentence-case heads on a light band, compact rows. */
table thead th { background: var(--color-paper-3); color: var(--color-muted); font-weight: 600; font-size: 12.5px; }
/* Brand mark in the sidebar: plain, no gradient pill. */
.brand-pill { background: var(--color-accent) !important; border-radius: var(--radius-chip) !important; letter-spacing: 0 !important; text-transform: none !important; }
/* Status reads from the lozenge's tint and word; no decorative dot in front. */
.badge.dot::before { display: none !important; }
/* Denser rows: a work list shows more at once. */
.tbl-wrap table td { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
/* Segmented controls: one strip, 3px corners. */
.seg, .seg button, .seg a { border-radius: var(--radius-pill) !important; }
.seg button.active, .seg button[aria-pressed="true"] { box-shadow: none !important; }

/* Start screen for someone in no project yet: two ways in. */
.wl-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-md); margin: 0 0 var(--space-xl); }
.wl-choice { display: flex; gap: var(--space-md); align-items: flex-start; padding: var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); color: var(--color-ink); text-decoration: none; }
.wl-choice > i { font-size: 1.25rem; color: var(--color-accent-text); margin-top: 2px; }
.wl-choice span { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.wl-choice small { color: var(--color-ink-2); line-height: 1.5; overflow-wrap: anywhere; }
a.wl-choice:hover { border-color: var(--color-accent); }
a.wl-choice:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.wl-head:has(+ .wl-choices) { border-bottom: 0; padding-bottom: 0; margin-bottom: var(--space-lg); }

/* Sign-in entrance: three dots hop while the app loads, a tick pops in, then the circle opens into the app. */
.portal .portal-wait { position: absolute; display: flex; flex-direction: column; align-items: center; gap: var(--space-md); transition: opacity .2s, transform .25s var(--ease-out, ease-out); }
.portal-hop { display: flex; gap: 10px; height: 44px; align-items: flex-end; }
.portal-hop i { width: 14px; height: 14px; border-radius: 50%; background: #1f5fe0; transform-origin: 50% 100%; animation: portal-hop .9s cubic-bezier(.3, 0, .3, 1) infinite; }
.portal-hop i:nth-child(2) { background: #eb63ad; animation-delay: .12s; }
.portal-hop i:nth-child(3) { background: #f5a524; animation-delay: .24s; }
@keyframes portal-hop {
  0%, 100% { transform: translateY(0) scale(1.25, .75); }
  15% { transform: translateY(0) scale(1, 1); }
  45% { transform: translateY(-26px) scale(.9, 1.1); }
  70% { transform: translateY(0) scale(1, 1); }
}
.portal-hi { margin: 0; color: var(--color-ink-2); font-size: 14px; }
.portal .portal-orb { transform: scale(0); transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.portal.ok .portal-wait { opacity: 0; transform: scale(.8); }
.portal.ok .portal-orb { transform: scale(1); }
.portal.open .portal-orb { transition: transform .6s cubic-bezier(.7, 0, .3, 1); }
@media (prefers-reduced-motion: reduce) { .portal-hop i { animation: none; } }

/* ---------------------------------------------------------------- admin console (#/admin) */
.ad { display: flex; flex-direction: column; gap: var(--space-lg); }
.ad-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--space-md); }
.ad-kpi .k-foot { line-height: 1.45; }
.ad-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr); gap: var(--space-md); align-items: start; }
@media (max-width: 1100px) { .ad-row { grid-template-columns: 1fr 1fr; } .ad-trend { grid-column: 1 / -1; } }
@media (max-width: 720px) { .ad-row { grid-template-columns: 1fr; } }
.ad-sparks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: var(--space-lg); }
.ad-spark { margin: 0; min-width: 0; }
.ad-spark figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; }
.ad-spark figcaption span { flex: 1 0 100%; color: var(--color-ink-2); font-size: 13px; }
.ad-spark figcaption b { font-size: 22px; font-weight: 600; }
.ad-spark figcaption small { color: var(--color-ink-2); font-size: 12px; }
.ad-spark svg { width: 100%; height: 78px; display: block; overflow: visible; }
.ad-spark rect { fill: var(--color-accent-soft); }
.ad-spark rect.now { fill: var(--color-accent); }
.ad-spark text { font-size: 9px; fill: var(--color-ink-2); }
.ad-att { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ad-att li { display: flex; align-items: center; gap: var(--space-sm); padding: 10px 0; border-top: var(--rule-hair) solid var(--color-rule); }
.ad-att li:first-child { border-top: 0; padding-top: 0; }
.ad-att li > i { color: var(--color-accent-text); width: 18px; text-align: center; }
.ad-att li span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ad-att small, .ad-sub { display: block; color: var(--color-ink-2); font-size: 12px; overflow-wrap: anywhere; }
.ad-h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--color-ink-2); text-transform: uppercase; letter-spacing: .04em; }
.ad-mixl { list-style: none; margin: 0 0 var(--space-md); padding: 0; }
.ad-mixl li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 14px; }
.ad-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: var(--space-md); }
.ad-tabs [role=tab] { border: var(--rule-hair) solid transparent; background: none; color: var(--color-ink-2); padding: 6px 12px; border-radius: var(--radius-pill); font: inherit; font-size: 14px; cursor: pointer; }
.ad-tabs [role=tab] small { margin-left: 4px; color: inherit; opacity: .8; }
.ad-tabs [role=tab][aria-selected=true] { background: var(--color-accent-soft); color: var(--color-accent-text); font-weight: 600; }
.ad-tabs [role=tab]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.ad-q { margin-left: auto; width: min(100%, 260px); }
.ad-tbl td { vertical-align: top; }
.ad-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.ad-bar { display: block; width: 90px; height: 6px; border-radius: 3px; background: var(--color-paper-3); overflow: hidden; margin-top: 6px; }
.ad-bar i { display: block; height: 100%; background: var(--color-accent); }
.ad-st { font-size: 13px; }
.ad-flag { color: oklch(55% 0.17 40); }
.link-btn { border: 0; background: none; padding: 0; color: var(--color-ink); font: inherit; cursor: pointer; text-align: left; }
.link-btn:hover b { color: var(--color-accent-text); text-decoration: underline; }

/* account page: Kết nối AI (MCP) */
.mcp-list { list-style: none; margin: 0; padding: 0; }
.mcp-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: var(--rule-hair) solid var(--color-rule); }
.mcp-list li span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mcp-list small { color: var(--color-ink-2); font-size: 12px; }
.mcp-copy { display: flex; gap: 8px; align-items: flex-start; }
.mcp-copy code, .mcp-copy pre { flex: 1; min-width: 0; margin: 0; padding: 8px 10px; border-radius: var(--radius-pill); background: var(--color-paper-3); font-size: 12px; overflow-x: auto; white-space: pre; }
.mcp-copy code { word-break: break-all; white-space: normal; }
@media (max-width: 720px) { .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ad-q { margin-left: 0; width: 100%; } }
.ad-tbl { min-width: 760px; }
.ad-spark svg { max-width: 260px; }

/* UAT deployment: never mistaken for production */
.uat-badge { position: fixed; z-index: 10000; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 3px 10px; border-radius: 999px;
  background: oklch(62% 0.19 45); color: #fff; font: 600 11px/1.6 system-ui, sans-serif; letter-spacing: .04em; pointer-events: none; box-shadow: 0 2px 8px rgb(0 0 0 / .2); }
.hm-uat-t { margin: 0; font-weight: 600; color: oklch(55% 0.17 45); }
