/* Atlas design v2 — the approved Figma design (file sQ2vhwm33zxcYXCMm3PxoR), WO#0593;
 * colour scheme re-based on the founder's charcoal · graphite · gold revision (WO#0595,
 * docs/design/figma-baseline-2026-10-11/README.md).
 *
 * Tokens and components are lifted from the 20 inspected screens; every
 * value here is one the canvas uses. The device mockup chrome in the Figma
 * frames (status bar, home-indicator handle, the 28px device corner) is NOT
 * rendered: the app renders only the controls it owns and leaves the safe
 * areas to the device.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/design/fonts/inter-latin-var.woff2") format("woff2");
}

:root {
  /* surfaces — the approved charcoal · graphite · gold scheme (canvas revision 2026-10-11) */
  --v2-bg: #1e1e1e;        /* ground: page, nav, entrance tile, contextual assistant */
  --v2-black: #1e1e1e;     /* kept name: the ground surface under assistant / composer chrome */
  --v2-card: #2b2b2b;      /* cards, actions, selectors, inputs, composer, question bubble */
  --v2-raised: #2b2b2b;    /* a control inside a card keeps the card value; the border separates it */
  --v2-green: #35322d;     /* kept name: the highlight (featured / today's plan / content) card */
  --v2-highlight-border: #534d43;
  --v2-badge: #35322d;     /* status badge, alt bar segment, future-feature notice */
  --v2-border: #41403e;    /* borders, dividers, progress track, chart grid, binding rule */
  --v2-border-warn: #534d43;
  /* ink */
  --v2-gold: #cdb47b;
  --v2-on-gold: #1e1e1e;
  --v2-text: #f0ebe0;
  --v2-text-2: #b7ad9c;
  --v2-text-3: #a39d91;
  --v2-positive: #cdb47b;  /* the canvas carries no green; a favourable delta reads in gold */
  --v2-amber: #d4854a;     /* overdue */
  --v2-amber-bg: #3d2318;  /* overdue badge fill */
  /* shape */
  --v2-r-card: 18px;
  --v2-r-control: 10px;
  --v2-r-seg: 7px;
  --v2-r-tile: 9px;
  --v2-r-emblem: 8px;
  --v2-r-entrance: 13px;
  --v2-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --v2-nav-h: 90px; /* measured: 89 px tall with the entrance tile (12+42+6+13+10 + borders) */
  --v2-max: 520px;
  color-scheme: dark;
}

html, body { margin: 0; padding: 0; background: var(--v2-bg); }
body.v2 {
  font-family: var(--v2-font);
  color: var(--v2-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--v2-nav-h) + env(safe-area-inset-bottom, 0px));
}
body.v2 * { box-sizing: border-box; }
body.v2 a { color: inherit; text-decoration: none; }
body.v2 button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
body.v2 p, body.v2 h1, body.v2 h2, body.v2 h3 { margin: 0; }
body.v2 img { display: block; }
body.v2 :focus-visible { outline: 2px solid var(--v2-gold); outline-offset: 2px; }
body.v2 [hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.v2-page { max-width: var(--v2-max); margin: 0 auto; width: 100%; }
.v2-header { padding: calc(4px + env(safe-area-inset-top, 0px)) 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.v2-controls { display: flex; align-items: center; justify-content: space-between; min-height: 42px; }
.v2-back { display: inline-flex; align-items: center; gap: 6px; height: 42px; font-size: 0.8125rem; font-weight: 500; color: var(--v2-text); margin-left: -4px; padding: 0 4px; }
.v2-back img { width: 20px; height: 20px; }
.v2-ask { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 100px; background: var(--v2-black); border: 1px solid var(--v2-border); font-size: 0.75rem; font-weight: 500; color: var(--v2-gold); }
.v2-emblem { object-fit: cover; border-radius: var(--v2-r-emblem); }
.v2-ask .v2-emblem { width: 32px; height: 24px; }
.v2-eyebrow { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.02em; color: var(--v2-gold); text-transform: uppercase; }
.v2-title { font-size: 1.75rem; font-weight: 600; line-height: 1.14; color: var(--v2-text); }
.v2-subtitle { font-size: 0.875rem; line-height: 1.5; color: var(--v2-text-2); }
.v2-header .v2-eyebrow + .v2-title { margin-top: -6px; }

.v2-content { padding: 0 20px 28px; display: flex; flex-direction: column; gap: 24px; min-height: 60vh; }
.v2-home .v2-content { padding-top: 12px; }

/* greeting (home) */
.v2-greeting { display: flex; align-items: center; gap: 14px; }
.v2-greeting h1 { flex: 1; font-size: 1.5625rem; font-weight: 600; min-width: 0; }
.v2-avatar { width: 40px; height: 40px; border-radius: 100px; background: var(--v2-raised); border: 1px solid var(--v2-border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.825rem; font-weight: 600; color: var(--v2-gold); flex: none; }
.v2-avatar.lg { width: 46px; height: 46px; font-size: 0.9375rem; }

/* ---------------------------------------------------------------- cards */
.v2-card { background: var(--v2-card); border: 1px solid var(--v2-border); border-radius: var(--v2-r-card); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.v2-card.green { background: var(--v2-green); border-color: var(--v2-highlight-border); }
.v2-card.warn { background: var(--v2-badge); border-color: var(--v2-border-warn); }
.v2-card.black { background: var(--v2-black); }
.v2-card.flat { border: 0; border-radius: 16px; padding: 16px; }
.v2-rule { height: 1px; background: var(--v2-border); width: 100%; }

.v2-section { display: flex; flex-direction: column; gap: 12px; }
.v2-section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; row-gap: 4px; }
.v2-section-head h2 { flex: 1; font-size: 1.25rem; font-weight: 600; line-height: 1.25; min-width: min-content; overflow-wrap: break-word; }
.v2-link { font-size: 0.75rem; font-weight: 500; color: var(--v2-gold); white-space: nowrap; }
.v2-link.plain { font-weight: 400; }

/* list rows */
.v2-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--v2-border); width: 100%; text-align: left; }
.v2-row:last-child.last { border-bottom: 0; }
.v2-row .v2-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.v2-row .v2-info b { font-size: 0.875rem; font-weight: 500; color: var(--v2-text); }
.v2-row .v2-info span { font-size: 0.75rem; color: var(--v2-text-2); }
.v2-row .v2-info span.amber { color: var(--v2-amber); }
.v2-row .v2-info span.positive { color: var(--v2-positive); }
.v2-row > img { width: 17px; height: 17px; flex: none; }
.v2-row .v2-time { width: 42px; flex: none; font-size: 0.75rem; font-weight: 500; color: var(--v2-gold); }
.v2-row.sched { padding: 11px 0; border-bottom: 0; }
.v2-row.sched .v2-info b { font-size: 0.8125rem; font-weight: 600; }
.v2-row.sched .v2-info span { font-size: 0.6875rem; }
.v2-row.sched > img { width: 16px; height: 16px; }
.v2-tile { width: 34px; height: 34px; border-radius: var(--v2-r-tile); background: var(--v2-card); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.v2-tile img { width: 18px; height: 18px; }
.v2-card .v2-tile { background: var(--v2-raised); }

.v2-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 100px; background: var(--v2-badge); font-size: 0.625rem; font-weight: 600; color: var(--v2-gold); white-space: nowrap; width: max-content; }
.v2-badge.green { background: var(--v2-green); color: var(--v2-positive); }
.v2-badge.overdue { background: var(--v2-amber-bg); color: var(--v2-amber); }

/* metrics */
.v2-metrics { display: flex; gap: 16px; width: 100%; }
.v2-metrics.wide { gap: 20px; }
.v2-metric { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.v2-metric .l { font-size: 0.6875rem; color: var(--v2-text-2); }
.v2-metric .v { font-size: 1.75rem; font-weight: 500; color: var(--v2-text); }
.v2-metric .d { font-size: 0.6875rem; color: var(--v2-positive); }
.v2-metric .d.muted { color: var(--v2-text-2); }
.v2-big { font-size: 2rem; font-weight: 500; }
.v2-track { height: 5px; width: 100%; border-radius: 5px; background: var(--v2-border); overflow: hidden; }
.v2-track > i { display: block; height: 5px; border-radius: 5px; background: var(--v2-gold); width: 0; transition: width 240ms ease; }
.v2-track.positive > i { background: var(--v2-positive); }

/* buttons */
.v2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 14px; border-radius: var(--v2-r-control); background: var(--v2-raised); border: 1px solid var(--v2-border); font-size: 0.8125rem; font-weight: 600; color: var(--v2-text); width: 100%; text-align: center; }
.v2-btn.primary { background: var(--v2-gold); border-color: var(--v2-gold); color: var(--v2-on-gold); }
.v2-btn.ghost { background: transparent; }
.v2-btn.danger { background: var(--v2-amber-bg); border-color: var(--v2-amber); color: var(--v2-amber); }
.v2-btn.quiet { background: transparent; border-color: transparent; color: var(--v2-gold); }
.v2-seg.off > button, .v2-seg > button:disabled { opacity: 0.5; cursor: default; }
.v2-toggle[aria-disabled="true"] { opacity: 0.5; }
.v2-row:disabled { opacity: 0.6; cursor: default; }
.v2-btn.small { min-height: 36px; padding: 8px 12px; width: auto; }
.v2-btn img { width: 17px; height: 17px; }
.v2-btn.primary img { filter: brightness(0) saturate(100%) invert(9%) sepia(12%) saturate(900%) hue-rotate(100deg); }
.v2-btn:disabled { opacity: 0.5; cursor: default; }
.v2-btns { display: flex; gap: 8px; width: 100%; }
.v2-btns > * { flex: 1; min-width: 0; }
.v2-btns.col { flex-direction: column; }

/* segmented selector */
.v2-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--v2-r-control); background: var(--v2-card); width: 100%; }
.v2-seg > button { flex: 1; min-width: 0; min-height: 40px; padding: 8px 4px; border-radius: var(--v2-r-seg); font-size: 0.6875rem; font-weight: 400; color: var(--v2-text-2); white-space: nowrap; }
.v2-seg > button[aria-selected="true"] { background: var(--v2-raised); color: var(--v2-gold); font-weight: 600; }
.v2-seg > button:disabled { color: var(--v2-text-3); cursor: default; }
.v2-card .v2-seg { background: var(--v2-raised); }
.v2-card .v2-seg > button[aria-selected="true"] { background: var(--v2-card); }

/* assistant */
.v2-assistant { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--v2-r-control); background: var(--v2-black); border: 1px solid var(--v2-border); width: 100%; text-align: left; }
.v2-assistant .v2-emblem { width: 40px; height: 30px; flex: none; }
.v2-assistant .v2-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 0.75rem; line-height: 1.5; }
.v2-assistant .v2-info b { font-weight: 600; color: var(--v2-gold); }
.v2-assistant .v2-info span { color: var(--v2-text-2); }
.v2-assistant > img { width: 18px; height: 18px; flex: none; }
.v2-foot { font-size: 0.6875rem; line-height: 1.5; color: var(--v2-text-3); }
.v2-foot.center { text-align: center; }

/* hero wordmark (home) */
.v2-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 18px 12px; }
.v2-wordmark { position: relative; height: 72px; width: 100%; overflow: hidden; mix-blend-mode: screen; }
.v2-wordmark img { position: absolute; left: 0; top: -42.51%; width: 100%; height: 185.02%; max-width: none; object-fit: fill; }
.v2-tagline { font-size: 0.75rem; line-height: 1.5; color: var(--v2-gold); text-align: center; width: 100%; }
.v2-suggest { display: flex; flex-direction: column; gap: 6px; width: 100%; font-size: 0.75rem; line-height: 1.5; color: var(--v2-text-2); white-space: pre-wrap; }
.v2-suggest button { text-align: left; color: inherit; }
.v2-hero .v2-btn { margin-top: 4px; }

/* chart */
.v2-chart { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.v2-plot { position: relative; height: 86px; width: 100%; }
.v2-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.v2-axis { display: flex; justify-content: space-between; font-size: 0.625rem; color: var(--v2-text-2); }
.v2-bars { display: flex; align-items: flex-end; gap: 6px; height: 86px; width: 100%; }
.v2-bars > i { flex: 1; display: block; background: var(--v2-gold); border-radius: 3px 3px 0 0; min-height: 2px; }
.v2-bars > i.alt { background: var(--v2-positive); }
.v2-legend { display: flex; gap: 14px; font-size: 0.6875rem; color: var(--v2-text-2); flex-wrap: wrap; }
.v2-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 8px; background: var(--v2-gold); margin-right: 6px; vertical-align: middle; }
.v2-legend i.alt { background: var(--v2-positive); }

/* forms */
.v2-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; line-height: 1.5; }
.v2-field label { font-size: 0.8125rem; color: var(--v2-text-2); }
.v2-field .v2-help { font-size: 0.6875rem; line-height: 1.5; color: var(--v2-text-3); }
.v2-field.error input, .v2-field.error select, .v2-field.error textarea, .v2-field.error .v2-step { border-color: var(--v2-amber); outline: none; }
.v2-field.error .v2-help { color: var(--v2-amber); }
.v2-field input, .v2-field select, .v2-field textarea { font: inherit; font-size: 0.8125rem; color: var(--v2-text); background: var(--v2-card); border: 1px solid var(--v2-border); border-radius: var(--v2-r-control); padding: 10px 12px; width: 100%; min-height: 42px; }
.v2-field textarea { min-height: 96px; resize: vertical; }
.v2-field input:focus, .v2-field select:focus, .v2-field textarea:focus { outline: 1px solid var(--v2-gold); border-color: var(--v2-gold); }
/* WO#0598 §4: a date/time field whose picker button (inside the browser's own control) has keyboard focus keeps the ring */
.v2-field input:focus-within { outline: 1px solid var(--v2-gold); border-color: var(--v2-gold); }
.v2-fields { display: flex; gap: 12px; width: 100%; }
.v2-toggle { display: inline-flex; align-items: center; width: 44px; height: 26px; border-radius: 26px; background: var(--v2-border); padding: 3px; flex: none; transition: background 160ms; }
.v2-toggle i { display: block; width: 20px; height: 20px; border-radius: 20px; background: var(--v2-text-2); transition: transform 160ms, background 160ms; }
.v2-toggle[aria-checked="true"] { background: var(--v2-gold); }
.v2-toggle[aria-checked="true"] i { transform: translateX(18px); background: var(--v2-on-gold); }
.v2-switchrow { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--v2-border); }
.v2-switchrow .v2-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.v2-switchrow .v2-info b { font-size: 0.875rem; font-weight: 500; }
.v2-switchrow .v2-info span { font-size: 0.75rem; color: var(--v2-text-2); }

/* nested views (WO#0596): an editor or detail view on the page's own shell. The page
 * content is hidden, the header's eyebrow and title are swapped, Back returns to the
 * parent with its scroll and draft kept; browser Back closes it. */
.v2-view { padding: 0 20px 28px; display: flex; flex-direction: column; gap: 24px; min-height: 60vh; }
body.v2-nested > .v2-page > .v2-content { display: none; }
.v2-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--v2-r-control); background: var(--v2-card); border: 1px solid var(--v2-border); font-size: 0.75rem; line-height: 1.5; color: var(--v2-text-2); }
.v2-notice b { color: var(--v2-text); font-weight: 500; }
.v2-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--v2-r-control); background: var(--v2-badge); border: 1px solid var(--v2-highlight-border); font-size: 0.75rem; line-height: 1.5; color: var(--v2-text); }
.v2-banner span { flex: 1; min-width: 0; }
.v2-banner button { font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--v2-gold); white-space: nowrap; }
.v2-emptystate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 18px; border-radius: var(--v2-r-card); background: var(--v2-card); border: 1px solid var(--v2-border); }
.v2-emptystate b { font-size: 1rem; font-weight: 500; }
.v2-emptystate p { font-size: 0.8125rem; line-height: 1.5; color: var(--v2-text-2); }
.v2-emptystate .v2-btn { width: auto; margin-top: 6px; }
.v2-chips { display: flex; gap: 6px; width: 100%; }
.v2-chip { flex: 1; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--v2-r-control); background: var(--v2-card); border: 1px solid var(--v2-border); font-size: 0.75rem; font-weight: 600; color: var(--v2-text-2); }
.v2-chip[aria-pressed="true"] { background: var(--v2-gold); border-color: var(--v2-gold); color: var(--v2-on-gold); }
.v2-menu { position: absolute; right: 12px; min-width: 220px; background: var(--v2-card); border: 1px solid var(--v2-border); border-radius: 14px; padding: 6px; z-index: 30; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.v2-menu button { text-align: left; padding: 11px 12px; border-radius: 9px; font-size: 0.8125rem; font-weight: 500; color: var(--v2-text); }
.v2-menu button.danger { color: var(--v2-amber); }
.v2-menu button:active { background: var(--v2-raised); }
.v2-scale { display: flex; gap: 4px; padding: 4px; border-radius: var(--v2-r-control); background: var(--v2-card); }
.v2-scale button { flex: 1; min-height: 34px; border-radius: var(--v2-r-seg); font-size: 0.6875rem; color: var(--v2-text-2); }
.v2-scale button[aria-pressed="true"] { background: var(--v2-green); color: var(--v2-gold); font-weight: 600; }

/* states */
.v2-empty { font-size: 0.8125rem; line-height: 1.5; color: var(--v2-text-2); padding: 4px 0; }
.v2-empty b { color: var(--v2-text); font-weight: 500; }
.v2-error { font-size: 0.8125rem; line-height: 1.5; color: var(--v2-amber); }
.v2-loading { color: var(--v2-text-3); font-size: 0.75rem; }
.v2-skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--v2-border) 0%, var(--v2-raised) 50%, var(--v2-border) 100%); background-size: 200% 100%; animation: v2-shimmer 1.2s linear infinite; }
@keyframes v2-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.v2-unavail { display: flex; flex-direction: column; gap: 8px; }
.v2-unavail .v2-badge { align-self: flex-start; }

/* toast + sheet */
.v2-toast { position: fixed; left: 50%; bottom: calc(var(--v2-nav-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--v2-raised); border: 1px solid var(--v2-border); color: var(--v2-text); border-radius: var(--v2-r-control); padding: 10px 14px; font-size: 0.8125rem; max-width: calc(100% - 40px); opacity: 0; transition: opacity 160ms, transform 160ms; z-index: 60; pointer-events: none; }
.v2-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.v2-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); opacity: 0; pointer-events: none; transition: opacity 160ms; z-index: 50; }
.v2-scrim.open { opacity: 1; pointer-events: auto; }
.v2-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: var(--v2-max); margin: 0 auto; background: var(--v2-card); border: 1px solid var(--v2-border); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateY(105%); transition: transform 200ms ease; z-index: 55; display: flex; flex-direction: column; gap: 12px; max-height: 86vh; overflow: auto; }
.v2-sheet.open { transform: translateY(0); }
.v2-sheet h3 { font-size: 1.125rem; font-weight: 600; }
.v2-sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--v2-border); margin: -6px auto 2px; }

/* ---------------------------------------------------------------- nav */
.v2-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--v2-bg); border-top: 1px solid var(--v2-border); padding: 12px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.v2-nav-in { max-width: var(--v2-max); margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-between; }
.v2-nav a { width: 60px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.6875rem; color: var(--v2-text-2); padding: 2px 0; }
.v2-nav-icon { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.v2-nav a[aria-current="page"] { color: var(--v2-gold); font-weight: 600; }
.v2-entrance { width: 56px; height: 42px; border-radius: var(--v2-r-entrance); background: var(--v2-black); border: 1px solid var(--v2-gold); display: inline-flex; align-items: center; justify-content: center; }
.v2-entrance .v2-emblem { width: 48px; height: 36px; }
.v2-nav a[aria-current="page"] .v2-entrance { box-shadow: 0 0 14px rgba(205, 180, 123, 0.35); }

/* calendar grid */
.v2-cal { display: flex; flex-direction: column; gap: 4px; }
.v2-cal-row { display: flex; gap: 4px; }
.v2-cal-row > * { flex: 1; min-width: 0; text-align: center; }
.v2-cal-wd { font-size: 0.6875rem; color: var(--v2-text-3); }
.v2-cal-day { height: 40px; border-radius: var(--v2-r-tile); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 0.8125rem; color: var(--v2-text); }
.v2-cal-day.out { color: var(--v2-text-3); }
.v2-cal-day i { width: 3px; height: 3px; border-radius: 3px; background: var(--v2-gold); display: block; }
.v2-cal-day.today { background: var(--v2-gold); color: var(--v2-on-gold); font-weight: 600; }
.v2-cal-day.today i { background: var(--v2-on-gold); }
.v2-cal-day.sel:not(.today) { outline: 1px solid var(--v2-gold); }
.v2-cal-ctl { display: flex; align-items: center; justify-content: space-between; }
.v2-cal-ctl h3 { font-size: 1.25rem; font-weight: 500; }
.v2-cal-ctl button img { width: 20px; height: 20px; }

/* timeline (today's plan) */
.v2-tl { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; width: 100%; text-align: left; }
.v2-tl .v2-time { width: 43px; flex: none; font-size: 0.75rem; font-weight: 500; color: var(--v2-gold); padding-top: 1px; }
.v2-tl .mark { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.v2-tl .mark img { width: 18px; height: 18px; }
.v2-tl .mark i { width: 1px; height: 35px; background: var(--v2-border); display: block; }
.v2-tl:last-child .mark i { display: none; }
.v2-tl .v2-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.v2-tl .v2-info b { font-size: 0.875rem; font-weight: 500; }
.v2-tl .v2-info span { font-size: 0.75rem; color: var(--v2-text-2); }
.v2-tl > img { width: 15px; height: 15px; flex: none; margin-top: 3px; }

/* conversation */
.v2-bubble { max-width: 86%; padding: 12px 14px; border-radius: 14px; font-size: 0.875rem; line-height: 1.5; }
.v2-bubble.me { align-self: flex-end; background: var(--v2-raised); border: 1px solid var(--v2-border); }
.v2-bubble.atlas { align-self: flex-start; background: var(--v2-card); border: 1px solid var(--v2-border); }
/* numeric steppers (WO#0595): keyboard entry plus visible −/+ sized to the unit */
.v2-step { display: flex; align-items: stretch; flex: 1; min-width: 0; border-radius: 9px; background: var(--v2-raised); overflow: hidden; }
.v2-step input[type=number] { flex: 1; min-width: 0; width: 100%; text-align: center; background: transparent; border: 0; font: inherit; font-size: 1rem; color: var(--v2-text); padding: 8px 2px; -moz-appearance: textfield; }
.v2-step input[type=number]::-webkit-outer-spin-button, .v2-step input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.v2-step-btn { width: 40px; min-height: 40px; flex: none; font: inherit; font-size: 1.25rem; line-height: 1; color: var(--v2-gold); background: transparent; border: 0; border-radius: 0; }
.v2-step-btn:active { background: var(--v2-border); }
.v2-field .v2-step { width: 100%; }
/* actions stay reachable with the keyboard open: an action row sticks to the
 * bottom of its scrolling container (a sheet or the page) */
.v2-sheet .v2-btns.col, .v2-sheet .v2-actions { position: sticky; bottom: 0; background: var(--v2-card); padding-top: 8px; margin-top: 4px; }
.v2-actions { position: sticky; bottom: calc(var(--v2-nav-h) + env(safe-area-inset-bottom, 0px) + var(--v2-kbd-offset, 0px)); background: var(--v2-bg); padding: 8px 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.v2-card .v2-actions, .v2-section .v2-card .v2-actions { background: inherit; }
/* the keyboard (WO#0595): the nav steps aside; bottom-anchored controls follow the keyboard's edge */
body.v2-kbd { --v2-nav-h: 0px; }
body.v2-kbd .v2-nav { display: none; }
.v2-sheet { bottom: var(--v2-kbd-offset, 0px); }
.v2-toast { bottom: calc(var(--v2-nav-h) + 16px + env(safe-area-inset-bottom, 0px) + var(--v2-kbd-offset, 0px)); }
.v2-composer, .v2-composer-card { bottom: calc(var(--v2-nav-h) + 8px + env(safe-area-inset-bottom, 0px) + var(--v2-kbd-offset, 0px)) !important; }
.v2-composer { position: sticky; bottom: calc(var(--v2-nav-h) + env(safe-area-inset-bottom, 0px)); display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-radius: 14px; background: var(--v2-card); border: 1px solid var(--v2-border); }
.v2-composer textarea { flex: 1; min-width: 0; font: inherit; font-size: 0.875rem; color: var(--v2-text); background: transparent; border: 0; resize: none; min-height: 24px; max-height: 120px; padding: 6px 4px; }
.v2-composer textarea:focus { outline: none; }
.v2-iconbtn { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--v2-raised); border: 1px solid var(--v2-border); flex: none; }
.v2-iconbtn img { width: 18px; height: 18px; }
.v2-iconbtn.gold { background: var(--v2-gold); border-color: var(--v2-gold); }
.v2-iconbtn:disabled { opacity: 0.45; }

/* responsive: wider screens keep the phone column centred; the nav spans */
@media (min-width: 760px) {
  :root { --v2-max: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  body.v2 * { transition: none !important; animation: none !important; }
}

/* WO#0596 — the kit's controls, matched to the canvas (Button, Select, Number stepper, List row).
 * `body.v2 button` resets every button; these selectors carry `body.v2` so the kit's look wins. */
body.v2 .v2-btn { background: var(--v2-raised); border: 1px solid var(--v2-border); color: var(--v2-text); }
body.v2 .v2-btn.primary { background: var(--v2-gold); border-color: var(--v2-gold); color: var(--v2-on-gold); }
body.v2 .v2-btn.ghost { background: transparent; }
body.v2 .v2-btn.danger { background: var(--v2-amber-bg); border-color: var(--v2-amber); color: var(--v2-amber); }
body.v2 .v2-btn.quiet { background: transparent; border-color: transparent; color: var(--v2-gold); }
/* WO#0603 §8 — the kit's own type and spacing for <button class="v2-link"> and
 * <button class="v2-btn"> on EVERY page (the reset above out-ranks the plain class
 * rules, so a button link read white at body size, and a button had no padding;
 * WO#0602 fixed this only inside the tour and first-time screens). An <a> with the
 * same class already looked like this; now a <button> does too. */
body.v2 button.v2-link { font-size: 0.75rem; font-weight: 500; color: var(--v2-gold); }
body.v2 button.v2-link.plain { font-weight: 400; }
body.v2 button.v2-btn { padding: 12px 14px; font-size: 0.8125rem; font-weight: 600; }
body.v2 button.v2-btn.small { padding: 8px 12px; }
body.v2 button.v2-row { border-bottom: 1px solid var(--v2-border); }
body.v2 button.v2-row.last, body.v2 button.v2-row:last-child.last { border-bottom: 0; }
.v2-field select { -webkit-appearance: none; appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cdb47b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px; }
.v2-field input, .v2-field select { min-height: 46px; padding: 12px 14px; font-size: 0.875rem; }
.v2-field .v2-step { background: var(--v2-card); border: 1px solid var(--v2-border); border-radius: var(--v2-r-control); min-height: 46px; align-items: center; }
.v2-field .v2-step:focus-within { border-color: var(--v2-gold); }
.v2-step input[type=number] { flex: 0 1 auto; width: 5ch; min-width: 3ch; text-align: right; padding-right: 4px; }
.v2-step .v2-step-unit { flex: 1 1 auto; min-width: 0; text-align: left; font-size: 0.8125rem; color: var(--v2-text-2); padding-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-step:not(:has(.v2-step-unit)) input[type=number] { flex: 1; width: 100%; text-align: center; padding-right: 2px; }

/* WO#0597 §4 — the editor's actions never hide the fields being edited (Figma: Action bar, one row).
   The stacked Save/Cancel block (116 px) sat over the recurrence card, the stepper and the weekday chips
   when the browser scrolled a focused control into view — measured in docs/work-orders/wo0597-shots.
   Now: one compact row (Cancel | Save), the destructive action out of the bar, and the document's scroll
   padding reserves the bar + navigation so focusing any control scrolls it fully into the clear. */
html { scroll-padding-top: 12px; scroll-padding-bottom: calc(var(--v2-nav-h) + 4.75rem + env(safe-area-inset-bottom, 0px) + var(--v2-kbd-offset, 0px)); }
.v2-view .v2-actions, .v2-content .v2-actions { flex-direction: row-reverse; gap: 10px; padding: 10px 0; border-top: 1px solid var(--v2-border); }
.v2-view .v2-actions .v2-btn, .v2-content .v2-actions .v2-btn { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.2; }
.v2-sheet .v2-actions { flex-direction: column; border-top: 0; }
.v2-danger-row { display: flex; padding: 4px 0 8px; }
.v2-danger-row .v2-btn { width: 100%; }
/* larger text (an 18em-wide screen at the reader's own font size): the two actions stack again,
   still compact, and the scroll padding grows with them */
@media (max-width: 18em) {
  .v2-view .v2-actions, .v2-content .v2-actions { flex-direction: column; }
  html { scroll-padding-bottom: calc(var(--v2-nav-h) + 9.5rem + env(safe-area-inset-bottom, 0px) + var(--v2-kbd-offset, 0px)); }
}

/* ------------------------------------------------------------------------------------------
 * WO#0602 §2 — the first-time experience (Figma A1–A3, B1–B5, C1) and the guided
 * introduction (T1–T9, T2b, TA2–TA7, F1, H1, S1, R9b, K1, L1–L3). First-time screens have
 * no bottom navigation (`body.v2-first`); the tour panel sits at the top of a real section
 * page's content and is gone once the introduction is finished or ended.
 * ---------------------------------------------------------------------------------------- */
body.v2.v2-first { padding-bottom: env(safe-area-inset-bottom, 0px); --v2-nav-h: 0px; }
.v2-first .v2-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.v2-first-main { flex: 1; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 0; gap: 20px; }
.v2-first-bottom { position: sticky; bottom: var(--v2-kbd-offset, 0px); background: var(--v2-bg); padding: 12px 0 calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.v2-first-bottom .v2-btn { white-space: normal; line-height: 1.25; }
.v2-first-bottom .v2-foot { text-align: center; font-size: 0.75rem; color: var(--v2-text-2); }
.v2-first-bottom .v2-link { align-self: center; font-size: 0.75rem; min-height: 32px; }
/* the brand art has a dark box; Lighten makes it vanish on the charcoal ground (WO#0600 §1) */
.v2-brand { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; padding: 24px 0 8px; }
.v2-brand .wm { width: min(348px, 92%); aspect-ratio: 1584 / 340; overflow: hidden; mix-blend-mode: lighten; }
.v2-brand .wm img { width: 100%; height: auto; margin-top: -10.1%; mix-blend-mode: lighten; }
.v2-brand h1 { font-size: 1.625rem; font-weight: 600; line-height: 1.2; }
.v2-brand p { font-size: 0.875rem; line-height: 1.6; color: var(--v2-text-2); max-width: 22rem; }
.v2-first-head { display: flex; flex-direction: column; gap: 10px; }
.v2-first-head .v2-eyebrow { margin-top: 4px; }
.v2-first-head p.lead { font-size: 0.875rem; line-height: 1.5; color: var(--v2-text-2); }
.v2-first h2.sub { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.v2-receipt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--v2-card); border: 1px solid var(--v2-border); font-size: 0.75rem; line-height: 1.5; text-align: left; }
.v2-receipt .tick { color: var(--v2-gold); font-weight: 600; flex: none; }
.v2-warnbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--v2-r-control); background: var(--v2-badge); border: 1px solid var(--v2-highlight-border); font-size: 0.75rem; line-height: 1.5; color: var(--v2-gold); }
.v2-warnbox .i { flex: none; width: 16px; height: 16px; border-radius: 16px; border: 1.5px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 700; margin-top: 1px; }
.v2-photo-row { display: flex; align-items: center; gap: 14px; }
.v2-photo-row .v2-avatar { width: 38px; height: 38px; overflow: hidden; }
.v2-photo-row .v2-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.4; }
.v2-photo-row .v2-info b { font-size: 0.875rem; font-weight: 500; }
.v2-photo-row .v2-info span { font-size: 0.75rem; color: var(--v2-text-2); }
.v2-choice { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px; border-radius: var(--v2-r-card); border: 1px solid var(--v2-border); background: var(--v2-card); }
.v2-choice.green { background: var(--v2-green); border-color: var(--v2-highlight-border); }
.v2-choice b { font-size: 1.0625rem; font-weight: 500; line-height: 1.35; }
.v2-choice p { font-size: 0.8125rem; line-height: 1.6; color: var(--v2-text-2); }

/* the tour panel (T2–T7) */
.v2-intro { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--v2-r-card); background: var(--v2-green); border: 1px solid var(--v2-highlight-border); }
.v2-intro-chip { display: flex; flex-direction: column; gap: 8px; }
.v2-intro-chip .v2-badge { background: var(--v2-badge); text-transform: uppercase; letter-spacing: 0.02em; }
.v2-intro-chip .v2-track { height: 3px; }
.v2-intro h2 { font-size: 1.375rem; font-weight: 500; line-height: 1.35; }
.v2-intro p.body { font-size: 0.8125rem; line-height: 1.6; color: var(--v2-text-2); }
.v2-intro .tip { display: flex; flex-direction: column; gap: 4px; }
.v2-intro .tip .k { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.06em; color: var(--v2-text-2); text-transform: uppercase; }
.v2-intro .tip q { font-size: 0.9375rem; font-weight: 500; line-height: 1.45; color: var(--v2-text); quotes: "“" "”"; }
.v2-intro .tip b { font-size: 0.9375rem; font-weight: 500; line-height: 1.45; }
.v2-intro .tip span { font-size: 0.75rem; line-height: 1.5; color: var(--v2-text-2); }
.v2-intro .v2-btns { flex-wrap: wrap; }
.v2-intro .v2-btn { white-space: normal; line-height: 1.25; }
.v2-intro .row2 { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-around; }
.v2-intro .row2 .v2-link, .v2-intro .v2-link.center { font-size: 0.8125rem; font-weight: 600; min-height: 40px; padding: 8px 4px; white-space: normal; text-align: center; }
.v2-intro .v2-link.center { align-self: center; }
.v2-intro .later { font-size: 0.75rem; line-height: 1.5; color: var(--v2-text-2); }
.v2-intro .saved { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--v2-r-control); background: var(--v2-card); border: 1px solid var(--v2-border); font-size: 0.8125rem; line-height: 1.5; }
.v2-intro .saved .tick { color: var(--v2-gold); flex: none; }
/* the Tell Atlas sheet (TA2–TA7) */
.v2-tell-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--v2-gold); background: var(--v2-card); }
.v2-tell-box span { font-size: 0.6875rem; color: var(--v2-text-2); }
.v2-tell-box b { font-size: 0.875rem; font-weight: 400; line-height: 1.5; }
.v2-happens { display: flex; flex-direction: column; }
.v2-happens > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--v2-border); line-height: 1.5; }
.v2-happens b { font-size: 0.875rem; font-weight: 500; }
.v2-happens span { font-size: 0.75rem; color: var(--v2-text-2); }
/* the Atlas page during the tour (K1) */
.v2-intro-back { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.v2-intro-back a { font-size: 0.8125rem; font-weight: 600; color: var(--v2-gold); min-height: 40px; display: inline-flex; align-items: center; }
.v2-intro-back p { font-size: 0.75rem; line-height: 1.5; color: var(--v2-text-2); text-align: left; align-self: stretch; }
/* resume card (H1) */
.v2-resume { display: flex; flex-direction: column; gap: 12px; }
.v2-resume .v2-card b { font-size: 1.125rem; font-weight: 500; }
.v2-resume .v2-card p { font-size: 0.8125rem; line-height: 1.6; color: var(--v2-text-2); }
.v2-resume .v2-btns .v2-btn { white-space: normal; line-height: 1.25; }
@media (max-width: 18em) {
  .v2-resume .v2-btns, .v2-intro .v2-btns { flex-direction: column; }
}
/* `body.v2 button` resets font and colour; the tour's and first-time screens' controls keep the kit's */
body.v2 .v2-intro .v2-btn, body.v2.v2-first .v2-btn, body.v2 .v2-resume .v2-btn { font-size: 0.8125rem; font-weight: 600; }
body.v2 .v2-intro .v2-link, body.v2.v2-first .v2-link { color: var(--v2-gold); font-weight: 600; }
body.v2.v2-first .v2-step-btn { color: var(--v2-gold); }
