/* generated from byflow/src/brand/brand.json; do not edit */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0A06;
  --surface: #18130E;
  --surface-2: #211C16;
  --surface-3: #2F2A25;
  --glass: rgba(24, 19, 14, 0.80);
  --border: rgba(234, 231, 227, 0.14);
  --border-strong: rgba(234, 231, 227, 0.54);
  --wash-1: rgba(255, 255, 255, 0.05);
  --wash-2: rgba(255, 255, 255, 0.09);
  --wash-3: rgba(255, 255, 255, 0.15);
  --scrim: rgba(0, 0, 0, 0.60);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.40), 0 12px 32px rgba(0, 0, 0, 0.45);
  --text: #F7F5F2;
  --text-dim: #C4C0BB;
  --text-faint: #A29D97;
  --accent: #F5A420;
  --accent-hover: #FFB84D;
  --on-accent: #110C09;
  --accent-text: #FBD28A;
  --accent-graphic: #F5A420;
  --info: #7FB0EE;
  --info-text: #9CC4F2;
  --on-info: #0E0A06;
  --caution: #FF9230;
  --caution-text: #FFA864;
  --on-caution: #1A0C00;
  --alert: #FF4245;
  --alert-text: #FF7B7D;
  --on-alert: #1A0000;
  --focus: #FBD28A;
  --focus-inner: #18130E;
  --brand-amber: #F5A420;
  --brand-ink: #0E0A06;
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F7F7FA;
  --surface-3: #E5E5EA;
  --glass: rgba(255, 255, 255, 0.82);
  --border: rgba(60, 60, 67, 0.20);
  --border-strong: rgba(60, 60, 67, 0.72);
  --wash-1: rgba(60, 60, 67, 0.05);
  --wash-2: rgba(60, 60, 67, 0.09);
  --wash-3: rgba(60, 60, 67, 0.15);
  --scrim: rgba(0, 0, 0, 0.30);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12);
  --text: #0E0A06;
  --text-dim: #48484D;
  --text-faint: #636368;
  --accent: #F5A420;
  --accent-hover: #D78100;
  --on-accent: #110C09;
  --accent-text: #8F4F00;
  --accent-graphic: #B86A00;
  --info: #1E4FA3;
  --info-text: #1E4FA3;
  --on-info: #FFFFFF;
  --caution: #C55300;
  --caution-text: #9E4300;
  --on-caution: #FFFFFF;
  --alert: #D92D20;
  --alert-text: #B3362C;
  --on-alert: #FFFFFF;
  --focus: #B86A00;
  --focus-inner: #FFFFFF;
  --brand-amber: #F5A420;
  --brand-ink: #0E0A06;
}
@media (prefers-color-scheme: light) { :root:not([data-theme]) { color-scheme: light;
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F7F7FA;
  --surface-3: #E5E5EA;
  --glass: rgba(255, 255, 255, 0.82);
  --border: rgba(60, 60, 67, 0.20);
  --border-strong: rgba(60, 60, 67, 0.72);
  --wash-1: rgba(60, 60, 67, 0.05);
  --wash-2: rgba(60, 60, 67, 0.09);
  --wash-3: rgba(60, 60, 67, 0.15);
  --scrim: rgba(0, 0, 0, 0.30);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12);
  --text: #0E0A06;
  --text-dim: #48484D;
  --text-faint: #636368;
  --accent: #F5A420;
  --accent-hover: #D78100;
  --on-accent: #110C09;
  --accent-text: #8F4F00;
  --accent-graphic: #B86A00;
  --info: #1E4FA3;
  --info-text: #1E4FA3;
  --on-info: #FFFFFF;
  --caution: #C55300;
  --caution-text: #9E4300;
  --on-caution: #FFFFFF;
  --alert: #D92D20;
  --alert-text: #B3362C;
  --on-alert: #FFFFFF;
  --focus: #B86A00;
  --focus-inner: #FFFFFF;
  --brand-amber: #F5A420;
  --brand-ink: #0E0A06;
 } }

/* @file src/ui/app.css (core styles; the marker lets test/ui-css.test.ts find each file in the built public/app.css) */
/* Colors come only from src/ui/tokens.css (generated from brand.json). Derived colors are color-mix of tokens. Shape, motion
   and press tokens follow the Bywatts iOS 27 system (../byflow/spec/IOS27.md). Amber has three roles: --accent is a FILL
   (always with --on-accent text), --accent-graphic is for lines, rings and marks, --accent-text is for text. */
:root {
  --r-chip: 9999px; --r-ctl: 12px; --r-card: 16px; --r-panel: 22px; --r-sheet: 28px;
  --ctl-h: 40px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1); --dur-1: 80ms; --dur-2: 200ms; --dur-3: 300ms; --dur-4: 450ms;
  --press: .7;
  --glass-fx: blur(20px) saturate(180%);
  --sel-bg: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --fill-thumb: var(--surface-3);
  --shade: color-mix(in srgb, var(--scrim) 45%, transparent);
}
:root[data-theme="light"] { --fill-thumb: var(--surface); }
@media (prefers-color-scheme: light) { :root:not([data-theme]) { --fill-thumb: var(--surface); } }

*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins over a class that sets display (buttons, rows, flex boxes). */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h1[tabindex="-1"]:focus { outline: none; }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-inner); }

/* ---- skip link, top bar, navigation ---- */
.skip { position: absolute; left: 12px; top: -100px; z-index: 30; padding: 10px 18px; border-radius: var(--r-chip); background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 20px; background: var(--glass); backdrop-filter: var(--glass-fx); -webkit-backdrop-filter: var(--glass-fx); border-bottom: 1px solid var(--border); }
.brand { display: flex; flex: none; align-items: center; gap: 8px; min-height: 40px; font: 700 18px var(--font-display); color: var(--text); text-decoration: none; }
.brand i { width: 24px; height: 24px; border-radius: 6px; background: var(--brand-amber); color: var(--brand-ink); display: grid; place-items: center; font: 700 14px var(--font-display); font-style: normal; }
.nav { display: flex; flex: 1 1 0; align-items: center; gap: 4px; min-width: 0; margin-left: 8px; }
.nav__list { display: flex; gap: 4px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.nav__item { flex: none; }
.nav a, .navsheet__link, .menu__item { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-chip); color: var(--text-dim); text-decoration: none; font-weight: 600; white-space: nowrap; transition: opacity var(--dur-1) var(--ease); }
.nav a:hover, .navsheet__link:hover { color: var(--text); background: var(--wash-1); }
.nav a:active, .navsheet__link:active, .menu__item:active { opacity: var(--press); }
.nav a[aria-current="page"], .navsheet__link[aria-current="page"] { background: var(--sel-bg); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-graphic); }
.topbar__end { display: flex; flex: 0 1 auto; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.topbar__email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-features { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar__menu { display: none; }
.nav__more--current { background: var(--sel-bg); box-shadow: inset 0 0 0 1px var(--accent-graphic); }
@media (max-width: 1399px) { .topbar__email { display: none; } }
/* Below 1100 px the strip becomes a Menu button that opens a navigation sheet (no sideways scrolling strip). */
@media (max-width: 1099px) {
  .nav, .topbar__email, .topbar__theme { display: none; }
  .topbar__menu { display: inline-flex; }
}
.navsheet { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(380px, calc(100vw - 24px)); padding: 0; border: 0; border-left: 1px solid var(--border); border-radius: var(--r-sheet) 0 0 var(--r-sheet); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.navsheet::backdrop { background: var(--scrim); }
.navsheet__inner { display: flex; flex-direction: column; gap: 16px; min-height: 100%; padding: 16px 16px 24px; }
.navsheet__head { display: flex; align-items: center; gap: 12px; }
.navsheet__head h2 { font-size: 20px; }
.navsheet__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.navsheet__link { display: flex; min-height: 44px; font-size: 16px; }
.navsheet__foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.navsheet__email { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .navsheet[open] { animation: navsheet-in var(--dur-3) var(--ease); }
  @keyframes navsheet-in { from { translate: 24px 0; opacity: 0; } }
}

/* ---- menus (Project actions, More): a popover in the top layer, glass like every floating control ---- */
.menu { position: fixed; inset: auto; margin: 0; min-width: 220px; max-width: min(320px, calc(100vw - 24px)); max-height: min(70vh, 480px); overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--glass); backdrop-filter: var(--glass-fx); -webkit-backdrop-filter: var(--glass-fx); box-shadow: var(--shadow); color: var(--text); }
.menu--fixed { z-index: 50; }
.menu__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.menu__item { width: 100%; border: 0; background: transparent; font: 600 14px var(--font); color: var(--text); text-align: left; cursor: pointer; border-radius: var(--r-ctl); }
.menu__item:hover, .menu__item:focus-visible { background: var(--wash-2); }
.menu__item[aria-current="page"] { background: var(--sel-bg); color: var(--accent-text); }
.menu__item--danger { color: var(--alert-text); }
.menu__sep { height: 1px; margin: 4px 8px; background: var(--border); }
.menu-btn[aria-expanded="true"] { background: var(--wash-3); }

/* ---- page frame ---- */
.boot { margin: 0; padding: 24px 20px; color: var(--text-dim); }
.grow { flex: 1; }
main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 80px; }
main[aria-busy="true"] > .page-loading { display: block; }
.page-loading { display: none; margin: 0 0 12px; }
.page-error { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.page-error h1 { font-size: 22px; }

/* ---- buttons: primary = amber fill + ink; default = quiet wash capsule with an amber-text label; press = opacity ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ctl-h); padding: 0 18px; border: 0; border-radius: var(--r-chip); background: var(--wash-2); color: var(--accent-text); font: 600 14px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: opacity var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease); }
.btn:hover { background: var(--wash-3); }
.btn:active { opacity: var(--press); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--danger { background: color-mix(in srgb, var(--alert) 12%, var(--surface)); color: var(--alert-text); }
.btn--danger:hover { background: color-mix(in srgb, var(--alert) 20%, var(--surface)); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn--dense { padding: 0 12px; }
.input, .select { min-height: var(--ctl-h); padding: 6px 14px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; width: 100%; }
.input--dense, .select--dense { padding: 2px 10px; border-radius: 10px; }
.select--dense { min-width: 112px; }
textarea.input { line-height: 1.45; }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; }
.card--link { text-decoration: none; color: inherit; display: block; transition: opacity var(--dur-1) var(--ease); }
.card--link:hover { border-color: var(--border-strong); }
.card--link:active { opacity: var(--press); }
.search { max-width: 280px; }
.mb-16 { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 10px; border-radius: var(--r-chip); background: var(--wash-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip--active { background: color-mix(in srgb, var(--info) 14%, var(--surface)); color: var(--info-text); }
.chip--hold { background: color-mix(in srgb, var(--caution) 14%, var(--surface)); color: var(--caution-text); }
.muted { color: var(--text-dim); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* left: 0 so a hidden label in a wide table never widens the page */
.provenance { font-size: 12px; }

/* ---- segmented control: a capsule well with a raised, bordered thumb (selected state >= 3:1 against the well in both themes) ---- */
.seg { display: inline-flex; gap: 2px; max-width: 100%; overflow-x: auto; padding: 2px; border-radius: var(--r-chip); background: var(--wash-2); }
.seg button { flex: none; border: 1px solid transparent; background: transparent; min-height: var(--ctl-h); padding: 0 14px; border-radius: var(--r-chip); font: 600 14px var(--font); color: var(--text-dim); white-space: nowrap; cursor: pointer; transition: opacity var(--dur-1) var(--ease); }
.seg button:hover { color: var(--text); }
.seg button:active { opacity: var(--press); }
.seg button[aria-pressed="true"] { background: var(--fill-thumb); border-color: var(--border-strong); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px var(--shade); }

/* ---- tabs (project page): a tablist; the selected tab has amber text, an amber graphic underline and a tinted fill ---- */
.tabs { display: flex; gap: 2px; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; border-bottom: 1px solid var(--border); overscroll-behavior-x: contain; }
.tab { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent; border-radius: var(--r-ctl) var(--r-ctl) 0 0; background: transparent; font: 600 14px var(--font); color: var(--text-dim); white-space: nowrap; cursor: pointer; transition: opacity var(--dur-1) var(--ease); }
.tab:hover { color: var(--text); background: var(--wash-1); }
.tab:active { opacity: var(--press); }
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent-graphic); background: var(--sel-bg); font-weight: 700; }
.tab:focus-visible { outline-offset: -4px; box-shadow: inset 0 0 0 6px var(--focus-inner); }

/* ---- toasts (session.ts): a host in the top layer, solid-backed glass cards, Dismiss on every message ---- */
.toasts { position: fixed; inset: auto 0 20px 0; z-index: 40; margin: 0 auto; padding: 0; border: 0; background: transparent; overflow: visible; width: min(560px, calc(100vw - 32px)); max-width: none; display: flex; flex-direction: column; gap: 8px; pointer-events: none; color: var(--text); }
.toasts__list { display: flex; flex-direction: column; gap: 8px; }
.toast-card { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-radius: var(--r-panel); border: 1px solid var(--border); background: var(--glass); backdrop-filter: var(--glass-fx); -webkit-backdrop-filter: var(--glass-fx); box-shadow: var(--shadow); }
.toast-card--error { border-color: var(--alert); }
.toast-card--error .toast::before { content: "Problem: "; font-weight: 700; color: var(--alert-text); }
.toast { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-card__close { flex: none; }
@media (prefers-reduced-motion: no-preference) { .toast-card { animation: toast-in var(--dur-2) var(--ease); } @keyframes toast-in { from { opacity: 0; translate: 0 8px; } } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---- tables ---- */
.tbl-wrap { position: relative; overflow: auto; margin-top: 16px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 8px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl .input { min-width: 90px; }
.input--name { min-width: 180px; }
.input--durationDays, .input--percentComplete { min-width: 64px; width: 76px; }
.deps-cell { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.deps-cell__names { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deps-list { display: flex; flex-direction: column; gap: 2px; max-height: min(50vh, 420px); overflow: auto; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-ctl); }
.deps-list label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 8px; border-radius: 10px; cursor: pointer; }
.deps-list label:hover { background: var(--wash-1); }
.deps-list input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-graphic); }

/* ---- project page ---- */
.project-head { display: flex; flex-direction: column; gap: 8px; }
.project-head__title { display: flex; align-items: flex-start; gap: 12px; }
.project-head__title h1 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.project-head__actions { flex: none; }
.project-head__line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.project-head__chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.project-head__meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; }
.project-head__meta > span + span::before { content: "\00b7"; padding: 0 8px; }
.project-progress { display: flex; align-items: center; gap: 12px; }
.feature-slots { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 0; }
.feature-slot { min-width: 0; }
.toolbar { margin: 12px 0; }
.schedule-tools { margin: 16px 0 0; }
.phase-bar { margin: 12px 0 0; }
.phase-chip { min-height: 40px; gap: 8px; padding: 0 4px 0 12px; }
.tabpanel:focus-visible { outline-offset: 4px; }
.progress { width: 200px; height: 8px; border-radius: var(--r-chip); background: var(--wash-3); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.progress i { display: block; height: 100%; background: var(--accent-graphic); }
.pane-loading { margin: 16px 0; }

/* ---- Gantt: a card with a sideways scroller (sticky task-name column) and the key below ---- */
.gantt-card { margin-top: 16px; padding: 12px 0 16px; overflow: hidden; }
.gantt-scroll:focus-visible { outline-offset: -3px; }
.gantt-scroll { position: relative; overflow: auto; }
.gantt-scroll svg { display: block; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y; }
.gantt-inner { position: relative; }
.gantt-labels { position: sticky; left: 0; z-index: 1; }
.gantt-card .gbar.editable { touch-action: none; cursor: grab; }
.gantt-card .gbar:focus-visible { outline: none; }
.gantt-card .gbar:focus-visible .bar, .gantt-card .gbar:focus-visible .milestone { stroke: var(--focus); stroke-width: 3; }
.gantt-card .gbar.readonly { cursor: pointer; }
.gantt-card .gbar .grip { cursor: ew-resize; }
.gantt-card text { font-family: var(--font); }
.gantt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 12px 0 0; padding: 0 16px; list-style: none; font-size: 13px; color: var(--text-dim); }
.gantt-legend li { display: inline-flex; align-items: center; gap: 8px; }
.gantt-swatch { display: inline-block; flex: none; width: 22px; height: 10px; border-radius: var(--r-chip); }
.gantt-swatch--p0 { background: var(--accent-graphic); }
.gantt-swatch--p1 { background: var(--info); }
.gantt-swatch--p2 { background: var(--text-dim); }
.gantt-swatch--critical { background: transparent; box-shadow: inset 0 0 0 2px var(--alert-text); }
.gantt-swatch--today { width: 0; height: 14px; border-left: 2px dashed var(--text); border-radius: 0; }
.gantt-swatch--baseline { height: 5px; background: var(--text-faint); }

/* ---- feeds, dialogs ---- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 6px 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); min-height: 40px; align-items: center; }
.dlg { border: 1px solid var(--border); border-radius: var(--r-sheet); background: var(--surface); color: var(--text); padding: 24px; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--shadow); }
.dlg::backdrop { background: var(--scrim); }
.dlg-form { display: flex; flex-direction: column; gap: 14px; }
.dlg-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.dlg-field__label { display: flex; flex-direction: column; gap: 6px; }
.dlg-field__label > span { font-size: 13px; color: var(--text-dim); }
.dlg-field .input, .dlg-field .select { font-weight: 400; }
.dlg-hint { font-weight: 400; }
.dlg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.dlg-error { margin: 0; color: var(--alert-text); font-weight: 600; }
.dlg-message { margin: 0; }

/* ---- 2D map, People ---- */
.map-card { padding: 8px; overflow-x: auto; }
.map-svg { display: block; width: 100%; min-width: 720px; height: auto; }
.map-pin { cursor: pointer; outline: none; }
.map-pin:hover circle:nth-child(2), .map-pin:focus-visible circle:nth-child(2) { stroke: var(--accent-text); stroke-width: 4; }
.map-pin:focus-visible circle:first-child { stroke: var(--accent-text); stroke-width: 2; fill: var(--wash-2); }
.map-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.map-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--r-chip); background: var(--wash-2); text-decoration: none; font-weight: 600; }
.map-link:active { opacity: var(--press); }
.page-title { margin-bottom: 16px; }
.section-gap { margin-top: 16px; }
.people-table { margin-top: 0; }
.tbl .people-email { font-size: 14px; letter-spacing: normal; text-transform: none; color: var(--text); font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.admin-section { margin-top: 32px; }
.admin-section__head { margin-bottom: 8px; }

/* Task marks set by features through ctx.markTask (for example realtime "Editing: Ana"): a text label, not color alone. */
tr[data-task-mark] > td:first-child { box-shadow: inset 3px 0 0 var(--caution); }
tr[data-task-mark] > td:first-child::after { content: attr(data-task-mark); display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--caution-text); }
g[data-task-mark] { outline: 2px dashed var(--caution); outline-offset: 1px; }

/* ---- phones ---- */
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 8px 12px; }
  main { padding: 16px 16px 64px; }
  h1 { font-size: 24px; }
  .progress { width: 120px; }
  .search { max-width: none; }
  /* Calendar, Watch and Live share one row that scrolls sideways instead of stacking (keeps the header short). */
  .feature-slots { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .feature-slot { flex: none; max-width: 85vw; }
}
/* Touch: every control is at least 44 px tall. */
@media (pointer: coarse), (max-width: 640px) {
  :root { --ctl-h: 44px; }
  .nav a, .menu__item, .map-link, summary { min-height: 44px; }
}

/* ---- glass needs an opaque fallback: no backdrop-filter, reduced transparency, increased contrast ---- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .toast-card, .menu { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .topbar, .toast-card, .menu { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .card, .tbl td, .feed li { border-color: var(--border-strong); }
  .seg button[aria-pressed="true"], .tab[aria-selected="true"] { text-decoration: underline; text-underline-offset: 4px; }
}
/* Windows high contrast: states keep a visible shape (system colors are allowed only here). */
@media (forced-colors: active) {
  .seg button[aria-pressed="true"], .tab[aria-selected="true"], .nav a[aria-current="page"], .navsheet__link[aria-current="page"] { outline: 2px solid CanvasText; outline-offset: -2px; }
  .progress { border: 1px solid CanvasText; }
  .progress i { forced-color-adjust: none; background: Highlight; }
  .btn { border: 1px solid ButtonText; }
}

/* @file src/ui/features/attachments/style.css */
/* Attachments (Files tab and attachmentsPanel). Tokens only; every class is prefixed attachments-. */
.attachments{display:flex;flex-direction:column;gap:16px}
.attachments-title{font-size:20px}
.attachments-controls{display:flex;flex-wrap:wrap;gap:12px}
.attachments-field{display:flex;flex-direction:column;gap:4px;flex:1 1 220px;max-width:380px;font-weight:600}
.attachments-field>span{font-size:13px;color:var(--text-dim)}
.attachments-field .select{font-weight:400}
.attachments-drop{display:flex;flex-direction:column;align-items:center;gap:10px;padding:24px 16px;text-align:center;border:2px dashed var(--border-strong);border-radius:16px;background:var(--wash-1)}
.attachments-drop--active{border-color:var(--accent-graphic);border-style:solid;background:var(--sel-bg)}
.attachments-drop__title{margin:0;font-weight:600}
.attachments-hint,.attachments-note,.attachments-usage{margin:0;font-size:13px}
.attachments-queue,.attachments-list{list-style:none;margin:0;padding:0}
.attachments-up{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:10px 12px;margin-bottom:8px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.attachments-up[data-status="error"]{border-color:var(--alert)}
.attachments-up__info{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:6px}
.attachments-up__name{font-weight:600;overflow-wrap:anywhere}
.attachments-progress{width:min(240px,100%);height:10px;accent-color:var(--accent-graphic)}
.attachments-error{margin:0;color:var(--alert-text);font-weight:600}
.attachments-badge{flex:none;display:inline-flex;align-items:center;justify-content:center;width:60px;height:40px;padding:0 4px;border-radius:10px;font:700 11px var(--font);letter-spacing:.05em;text-transform:uppercase;background:var(--wash-2);color:var(--text-dim)}
.attachments-badge--alert{background:color-mix(in srgb,var(--alert) 14%,var(--surface));color:var(--alert-text)}
.attachments-badge--info{background:color-mix(in srgb,var(--info) 14%,var(--surface));color:var(--info-text)}
.attachments-badge--caution{background:color-mix(in srgb,var(--caution) 14%,var(--surface));color:var(--caution-text)}
.attachments-info{flex:1 1 240px;min-width:0}
.attachments-name{font-weight:600;overflow-wrap:anywhere}
.attachments-meta{font-size:13px;overflow-wrap:anywhere}
.attachments-actions{display:flex;flex-wrap:wrap;gap:8px}
.attachments-actions a.btn,.attachments-preview a.btn{text-decoration:none}
.attachments-empty{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.attachments-empty p{margin:0}
.attachments-empty__title{font-weight:600}
.attachments-preview{width:min(900px,calc(100vw - 32px))}
.attachments-preview__title{overflow-wrap:anywhere}
.attachments-preview__body{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin:12px 0}
.attachments-preview__img{max-width:100%;max-height:70vh;object-fit:contain;border-radius:12px;background:var(--wash-1)}
@media (max-width:640px){
  .attachments-actions{width:100%}
  .attachments-actions .btn{flex:1}
  .attachments-field{max-width:none}
}

/* @file src/ui/features/calendars/style.css */
/* Calendars feature. Tokens only (src/ui/tokens.css); every class starts with calendars-. */
.calendars-top{margin-bottom:16px}
.calendars-select{width:auto;min-width:220px;max-width:100%}
.calendars-section+.calendars-section{margin-top:16px}
.calendars-section h2{font-size:18px}
.calendars-section>p{margin:8px 0 0}
.calendars-years{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.calendars-year{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 16px;border-radius:9999px;background:var(--wash-2);font-weight:600;cursor:pointer}
.calendars-year input,.calendars-check input{width:20px;height:20px;margin:0;accent-color:var(--accent-graphic)}
.calendars-check{display:flex;align-items:center;gap:10px;min-height:40px;cursor:pointer}
.calendars-add{display:grid;grid-template-columns:minmax(150px,200px) minmax(180px,1fr) auto;gap:12px;align-items:end;margin:12px 0}
.calendars-year-filter{width:auto;min-width:140px}
.calendars-table{margin-top:12px}
.calendars-date{white-space:nowrap}
.calendars-wd{display:inline-block;width:3em;color:var(--text-dim);font-weight:600}
.calendars-note{display:block}
.calendars-act{width:1%;white-space:nowrap}
.calendars-ctl{gap:8px;flex-wrap:nowrap}
.calendars-ctl__select{width:auto;min-width:200px;max-width:100%}
.calendars-ctl__link{display:inline-flex;align-items:center;min-height:40px;padding:0 8px;font-weight:600}
@media (max-width:640px){
  .calendars-add{grid-template-columns:1fr}
  .calendars-select,.calendars-year-filter{width:100%}
  .calendars-ctl__select{width:auto;min-width:0;max-width:62vw}
  .calendars-ctl__chip--with-select{display:none}
}

/* @file src/ui/features/comments/style.css */
/* comments: bell, Discussion tab, watch toggle, notification inbox. Tokens only (var(--...)), every class prefixed comments-. */

/* ---- bell (top bar) ---- */
.comments-bell{position:relative;min-width:40px;padding:0 10px;text-decoration:none}
.comments-bell__icon{display:block}
.comments-bell__count{position:absolute;top:2px;right:0;min-width:18px;height:18px;padding:0 5px;border-radius:9999px;background:var(--accent);color:var(--on-accent);font:700 11px/18px var(--font);text-align:center}

/* ---- watch toggle ---- */
.comments-watchbox{gap:10px}
.comments-watch__hint{font-size:12px}
.comments-watch__hint:empty{display:none}

/* ---- Discussion tab ---- */
.comments-tab{display:flex;flex-direction:column;gap:16px}
.comments-head{gap:12px}
.comments-composer{display:flex;flex-direction:column;gap:12px}
.comments-label{font-weight:600;font-size:13px;color:var(--text-dim)}
.comments-box{position:relative}
.comments-input{display:block;resize:vertical;min-height:88px;line-height:1.45;font-family:var(--font)}
.comments-actions{gap:10px}
.comments-counter{font-size:12px}
.comments-counter--warn{color:var(--caution-text);font-weight:600}
.comments-tip{font-size:12px}
.comments-field{display:flex;flex-direction:column;gap:6px;max-width:420px}
.comments-field label{font-weight:600;font-size:13px;color:var(--text-dim)}
.comments-filter{gap:10px}
.comments-filter label{font-weight:600;color:var(--text-dim)}
.comments-filter__select{max-width:360px}
.comments-suggest{position:absolute;left:0;right:0;top:100%;z-index:5;margin:4px 0 0;padding:4px;list-style:none;max-height:260px;overflow:auto;background:var(--surface);border:1px solid var(--border-strong);border-radius:12px;box-shadow:var(--shadow)}
.comments-suggest__item{display:flex;align-items:center;flex-wrap:wrap;gap:0 6px;min-height:40px;padding:6px 12px;border-radius:8px;cursor:pointer;overflow-wrap:anywhere}
.comments-suggest__item:hover{background:var(--wash-2)}
.comments-suggest__item[aria-selected="true"]{background:var(--sel-bg);box-shadow:inset 0 0 0 2px var(--accent-graphic);font-weight:600}
.comments-suggest__item:active{opacity:var(--press)}
.comments-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.comments-item{display:flex;flex-direction:column;gap:8px;padding:14px 16px;background:var(--surface);border:1px solid var(--border);border-radius:16px}
.comments-item--flash{border-color:var(--accent-graphic);box-shadow:inset 3px 0 0 var(--accent-graphic);background:var(--sel-bg)}
.comments-item__head{gap:8px}
.comments-when{font-size:12px}
.comments-text{white-space:pre-wrap;overflow-wrap:anywhere}
.comments-mention{background:color-mix(in srgb,var(--accent) 18%,var(--surface));color:var(--accent-text);white-space:normal;vertical-align:baseline}
.comments-link{overflow-wrap:anywhere}
.comments-item__actions{gap:8px}
.comments-empty{margin:0}
.comments-more{margin-top:4px}
.comments-more:empty{display:none}

/* ---- notification inbox ---- */
.comments-page{display:flex;flex-direction:column;gap:4px}
.comments-notes li{align-items:flex-start;gap:12px}
.comments-note .grow{min-width:min(240px,100%)}
.comments-dot{flex:none;width:10px;height:10px;margin-top:6px;border-radius:9999px;background:transparent}
.comments-note--unread .comments-dot{background:var(--accent-graphic)}
.comments-note--unread .comments-note__msg{font-weight:600}
.comments-note__msg{color:var(--text);overflow-wrap:anywhere}
a.comments-note__msg{color:var(--accent-text)}
.comments-note__meta{gap:8px;margin-top:4px;font-size:12px}
.comments-prefs{display:flex;flex-direction:column;gap:2px;margin:24px 0 0}
.comments-prefs legend{padding:0 6px;font-weight:600}
.comments-check{display:flex;align-items:center;gap:12px;min-height:40px;cursor:pointer}
.comments-check input{flex:none;width:22px;height:22px;margin:0;accent-color:var(--accent-graphic)}
.comments-pref-note{margin:4px 0 0}

@media (max-width:640px){
  .comments-item{padding:12px}
  .comments-field,.comments-filter__select{max-width:none;width:100%}
  .comments-filter label{flex-basis:100%}
}

/* @file src/ui/features/costs/style.css */
/* Costs feature. Colors only through the design tokens (var(--...)); every class is prefixed costs-. */
.costs-tab{display:flex;flex-direction:column;gap:16px}
.costs-tab>*{min-width:0}
.costs-toolbar{gap:12px}
.costs-asof{display:inline-flex;align-items:center;gap:8px;font-weight:600}
.costs-asof__input{width:auto;min-width:160px}
.costs-empty h2{margin-bottom:8px}.costs-empty p{margin:0 0 12px;max-width:62ch}

.costs-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.costs-kpi{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;padding:14px 16px;background:var(--surface);border:1px solid var(--border);border-radius:16px}
.costs-kpi__label{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-dim)}
.costs-kpi__value{font:700 26px/1.1 var(--font-display);letter-spacing:-.02em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.costs-kpi__value--empty{font:600 15px/1.3 var(--font);letter-spacing:0;color:var(--text-dim)}
.costs-kpi__sub{font-size:13px}
.costs-sim{min-height:18px;padding:0 6px;font-size:10px;letter-spacing:.06em}
.costs-kpis .provenance-note{grid-column:1/-1;margin:0}

.costs-band{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600}
.costs-band--ok{color:var(--info-text)}.costs-band--watch{color:var(--caution-text)}.costs-band--off{color:var(--alert-text)}.costs-band--check{color:var(--accent-text)}.costs-band--none{color:var(--text-dim)}
.costs-band__value{font-variant-numeric:tabular-nums}
.costs-icon{flex:none;color:inherit}
.costs-icon circle,.costs-icon path{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.costs-icon__dash{stroke-dasharray:2 2.5}

.costs-chart-card h2,.costs-budget h2{font-size:18px}
.costs-chart-wrap{margin-top:12px}
.costs-chart{display:block;width:100%;max-width:960px;height:auto}
.costs-grid{stroke:var(--border);stroke-width:1}
.costs-baseline{stroke:var(--border-strong);stroke-width:1}
.costs-bac{stroke:var(--text-faint);stroke-width:1;stroke-dasharray:2 4}
.costs-axis{fill:var(--text-dim);font:12px var(--font)}
.costs-line{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.costs-line--pv{stroke:var(--text-dim);stroke-dasharray:8 5}
.costs-line--ev{stroke:var(--accent-graphic);stroke-width:4}
.costs-line--ac{stroke:var(--info);stroke-width:4;stroke-dasharray:.1 7}
.costs-today{stroke:var(--text);stroke-width:1.5;stroke-dasharray:4 3}
.costs-today__label{fill:var(--text);font:600 12px var(--font)}
.costs-dot--pv{fill:var(--surface);stroke:var(--text-dim);stroke-width:2}
.costs-dot--ev{fill:var(--accent-graphic)}
.costs-dot--ac{fill:var(--info)}
.costs-legend{display:flex;flex-wrap:wrap;gap:8px 24px;margin:12px 0 0;padding:0;list-style:none}
.costs-legend li{display:flex;align-items:center;gap:10px}
.costs-swatch{flex:none}
.costs-alt{margin-top:12px}
.costs-alt summary,.costs-details summary{display:flex;align-items:center;min-height:40px;cursor:pointer;font-weight:600}

.costs-num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.costs-details .tbl th[scope="row"],.costs-portfolio .tbl th[scope="row"],.costs-budget .tbl tfoot th{font-size:inherit;letter-spacing:normal;text-transform:none;color:var(--text);font-weight:600;white-space:normal}
.costs-details td.muted .chip{margin-left:8px;vertical-align:middle}
.costs-budget__head{margin-bottom:8px;gap:8px}
.costs-budget .tbl tfoot th,.costs-budget .tbl tfoot td,.costs-portfolio .tbl tfoot th,.costs-portfolio .tbl tfoot td{border-top:2px solid var(--border-strong);border-bottom:0;font-weight:700}
.costs-table .tbl td{vertical-align:top}
.costs-text--name{min-width:200px}.costs-text--code{min-width:96px;width:110px}
.costs-select{min-width:150px}
.costs-money{min-width:128px;text-align:right}
.costs-rem{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.costs-entries-row>td{background:var(--surface-2);padding:12px 16px}
.costs-entries h3{font-size:15px}
.costs-entries .tbl-wrap{margin-top:8px}
.costs-name a{font-weight:600}
.costs-sort{width:auto;min-width:240px}

@media (max-width:640px){
  .costs-kpi{padding:12px}
  .costs-kpi__value{font-size:22px}
  .costs-asof{width:100%}.costs-asof__input{flex:1}
  .costs-sort{min-width:0;width:100%}
  .costs-chart-card,.costs-budget,.costs-details,.costs-portfolio{padding:12px}
}

/* @file src/ui/features/crews/style.css */
/* crews feature. Tokens only (var(--...)); every class is prefixed crews-. */
.crews-section{margin-top:28px}
.crews-note{white-space:pre-wrap;color:var(--text-dim)}
.crews-archived td{color:var(--text-dim)}
.crews-check{gap:8px;min-height:40px;cursor:pointer}
.crews-check input{width:20px;height:20px}
.crews-textarea{min-height:72px;resize:vertical;font:inherit}
.crews-chip--warn{background:color-mix(in srgb,var(--caution) 16%,var(--surface));color:var(--caution-text)}
.crews-chip--missing{background:color-mix(in srgb,var(--alert) 14%,var(--surface));color:var(--alert-text)}
.crews-chip--quiet{background:transparent;border:1px solid var(--border);color:var(--text-dim)}

/* utilization timeline */
.crews-tl-wrap{overflow-x:auto;padding:12px;margin-top:8px}
.crews-tl{min-width:760px}
.crews-tl__row{display:grid;grid-template-columns:190px minmax(0,1fr);gap:12px;align-items:start;border-bottom:1px solid var(--border);padding:8px 0}
.crews-tl__row--axis{border-bottom:1px solid var(--border-strong);padding:0 0 4px}
.crews-tl__label{display:flex;flex-direction:column;gap:4px;align-items:flex-start;min-width:0}
.crews-tl__track{position:relative;min-height:52px;background:var(--wash-1);border-radius:10px}
.crews-tl__track--axis{background:transparent;height:24px;min-height:24px}
.crews-tl__tick{position:absolute;top:0;height:100%;padding-left:4px;border-left:1px solid var(--border);font-size:11px;color:var(--text-faint);white-space:nowrap}
.crews-tl__today{position:absolute;top:0;bottom:0;width:2px;background:var(--accent-graphic);pointer-events:none}
.crews-bar{position:absolute;display:flex;align-items:center;height:40px;min-width:10px;padding:0 10px;overflow:hidden;white-space:nowrap;border-radius:10px;border:1px solid var(--info);background:color-mix(in srgb,var(--info) 22%,var(--surface));color:var(--info-text);font-size:12px;font-weight:600;text-decoration:none}
.crews-bar span{overflow:hidden;text-overflow:ellipsis}
.crews-bar--conflict{border:2px dashed var(--caution);background:color-mix(in srgb,var(--caution) 26%,var(--surface));color:var(--caution-text)}
.crews-bar--conflict span::before{content:"Overlap: ";font-weight:700}
.crews-legend{display:flex;flex-wrap:wrap;gap:8px 20px;margin:8px 0 0;padding:0;list-style:none;font-size:13px;color:var(--text-dim)}
.crews-legend li{display:inline-flex;align-items:center;gap:8px}
.crews-legend__bar{display:inline-block;width:28px;height:14px;border-radius:6px;border:1px solid var(--info);background:color-mix(in srgb,var(--info) 22%,var(--surface))}
.crews-legend__bar--conflict{border:2px dashed var(--caution);background:color-mix(in srgb,var(--caution) 26%,var(--surface))}
.crews-legend__today{display:inline-block;width:2px;height:16px;background:var(--accent-graphic)}

/* project Crews tab */
.crews-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:12px 0}
.crews-kpi{display:flex;flex-direction:column;gap:6px}
.crews-kpi__value{font:700 26px var(--font-display);letter-spacing:-.02em}
.crews-kpi__hint{gap:8px}
.crews-conflicts{display:flex;flex-direction:column;gap:6px}

/* Daily logs tab */
.crews-logs{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);gap:16px;align-items:start}
.crews-list{padding:12px}
@media (min-width:861px){.crews-list{position:sticky;top:76px;max-height:calc(100vh - 100px);overflow:auto}}
@media (max-width:860px){.crews-logs{grid-template-columns:1fr}}
.crews-monthbar{flex-wrap:nowrap;gap:8px}
.crews-month{text-align:center}
.crews-missing-note{margin:8px 0;color:var(--alert-text);font-weight:600}
.crews-days{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.crews-day{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:48px;padding:6px 10px;border:0;border-radius:12px;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}
.crews-day:hover{background:var(--wash-1)}
.crews-day:active{opacity:var(--press)}
.crews-day[aria-current="true"]{background:var(--sel-bg);box-shadow:inset 3px 0 0 var(--accent-graphic)}
.crews-day[aria-current="true"] .crews-day__date{color:var(--accent-text)}
.crews-day__main{display:flex;flex-direction:column;min-width:0}
.crews-day__date{font-weight:600}
.crews-day__meta{font-size:12px}
.crews-list-foot{margin-top:12px}
.crews-form{display:flex;flex-direction:column;gap:16px}
.crews-head h2{outline:none}
.crews-fieldset{display:flex;flex-direction:column;gap:22px;min-width:0;margin:0;padding:0;border:0}
.crews-block{display:flex;flex-direction:column;gap:10px}
.crews-block h3{font-size:16px}
.crews-cell{display:flex;flex-direction:column;gap:4px;min-width:0}
.crews-cap{font-size:12px;font-weight:600;color:var(--text-dim)}
.crews-cell--wide{width:100%}
.crews-grid4{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}
.crews-rows{display:flex;flex-direction:column;gap:12px}
.crews-row{display:grid;grid-template-columns:minmax(150px,2fr) 92px 110px minmax(120px,2fr) auto;gap:10px;align-items:end;padding:10px;border:1px solid var(--border);border-radius:12px}
.crews-row--progress{grid-template-columns:minmax(150px,2fr) 90px 150px minmax(120px,2fr) auto}
@media (max-width:640px){.crews-row,.crews-row--progress{grid-template-columns:1fr 1fr}.crews-row>:first-child,.crews-row>:nth-child(4),.crews-row>.btn{grid-column:1 / -1}}
.crews-now{display:flex;align-items:center;min-height:40px}
.crews-totals{margin:0}
.crews-wnote{margin:0}
.crews-error{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:10px 14px;border-radius:12px;background:color-mix(in srgb,var(--alert) 12%,var(--surface));color:var(--alert-text);font-weight:600}
.crews-actions{gap:12px;justify-content:flex-end;padding-top:14px;border-top:1px solid var(--border)}
.crews-fieldset:disabled .crews-row>.btn{display:none}
.crews-range{display:flex;flex-direction:column;gap:2px;font-size:12px}
.crews-range .input{width:160px}

/* @file src/ui/features/equipment/style.css */
/* Equipment feature. Tokens only (src/ui/tokens.css); every class starts with .equipment- */
.equipment-icon{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px}
.equipment-strong{font-weight:600}
.equipment-lead{margin:-8px 0 16px;max-width:72ch}
.equipment-h2{font-size:18px;margin:0 0 8px}
.equipment-section{margin-top:16px}
.equipment-empty{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:20px}
.equipment-empty .equipment-icon{width:28px;height:28px;color:var(--text-faint)}
.equipment-empty h2{font-size:18px}
.equipment-empty p{margin:0;max-width:60ch}
.equipment-more{margin-top:12px}
.equipment-role-filter{max-width:240px;width:auto}
.equipment-check{display:inline-flex;align-items:center;gap:10px;min-height:40px;font-weight:600}
.equipment-check input{width:20px;height:20px;accent-color:var(--accent-graphic)}

/* summary strip */
.equipment-strip{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 4px}
.equipment-strip:empty{display:none}
.equipment-stat{display:flex;flex-direction:column;gap:2px;min-width:96px;padding:8px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--border)}
.equipment-stat__label{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-faint)}
.equipment-stat__value{font:600 16px var(--font-display)}
.equipment-stat--late{border-color:var(--caution);background:color-mix(in srgb,var(--caution) 10%,var(--surface))}
.equipment-stat--late .equipment-stat__label{color:var(--caution-text)}

/* bill of materials table */
.equipment-bom{margin-top:12px}
.equipment-bom .tbl td{vertical-align:top}
.equipment-item{min-width:220px}
.equipment-link{border:0;background:none;padding:0;min-height:40px;font:600 14px var(--font);color:var(--accent-text);text-align:left;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.equipment-num{width:110px;min-width:96px}
.equipment-money{width:120px;min-width:100px}
.equipment-text{min-width:140px}
.equipment-date{min-width:150px}
.equipment-status-select{min-width:130px;width:auto}
.equipment-late td{background:color-mix(in srgb,var(--caution) 8%,var(--surface))}
.equipment-late-chip{display:inline-flex;align-items:center;gap:6px;margin-top:4px;padding:2px 10px;border-radius:9999px;font-size:12px;font-weight:600;color:var(--caution-text);background:color-mix(in srgb,var(--caution) 14%,var(--surface))}
.equipment-status--delivered{background:color-mix(in srgb,var(--info) 14%,var(--surface));color:var(--info-text)}
.equipment-status--canceled{color:var(--text-faint)}
.equipment-bom .btn+.btn{margin-left:8px}

/* design check */
.equipment-verdict{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 12px;border-radius:9999px;font-weight:600}
.equipment-verdict--ok{background:color-mix(in srgb,var(--info) 14%,var(--surface));color:var(--info-text)}
.equipment-verdict--bad{background:color-mix(in srgb,var(--alert) 12%,var(--surface));color:var(--alert-text)}
.equipment-basis{margin:8px 0}
.equipment-figures{margin:8px 0;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.equipment-pass{display:flex;align-items:center;gap:8px;font-weight:600;color:var(--info-text)}
.equipment-issues{list-style:none;margin:8px 0 0;padding:0}
.equipment-issue{padding:12px 0;border-top:1px solid var(--border)}
.equipment-issue p{margin:6px 0 0}
.equipment-hint{font-weight:600}
.equipment-sev{display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:0 10px;border-radius:9999px;font-size:12px;font-weight:700;flex:none}
.equipment-sev--critical{background:color-mix(in srgb,var(--alert) 16%,var(--surface));color:var(--alert-text)}
.equipment-sev--major{background:color-mix(in srgb,var(--caution) 16%,var(--surface));color:var(--caution-text)}
.equipment-sev--minor{background:color-mix(in srgb,var(--info) 14%,var(--surface));color:var(--info-text)}
.equipment-sev--info{background:var(--wash-2);color:var(--text-dim)}

/* catalog drawer and import dialog */
.equipment-drawer{width:min(680px,calc(100vw - 32px));max-height:min(90vh,900px);overflow:auto}
.equipment-drawer__head{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.equipment-drawer__head p{margin:0}
.equipment-spec{margin-top:16px}
.equipment-spec h3{font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-faint);margin-bottom:6px}
.equipment-dl{display:grid;grid-template-columns:minmax(140px,40%) 1fr;gap:6px 16px;margin:0}
.equipment-dl dt{color:var(--text-dim)}
.equipment-dl dd{margin:0;overflow-wrap:anywhere}
.equipment-notes{margin:6px 0 0;padding-left:20px;color:var(--text-dim)}
.equipment-errors{margin:6px 0 0;padding-left:20px;color:var(--alert-text);font-weight:600}
.equipment-import{width:min(640px,calc(100vw - 32px));max-height:min(90vh,900px);overflow:auto}
.equipment-import p{margin:0}
.equipment-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:150px;padding:20px;border:2px dashed var(--border-strong);border-radius:16px;text-align:center;background:var(--surface-2)}
.equipment-drop .equipment-icon{width:28px;height:28px;color:var(--text-faint)}
.equipment-drop.is-over{border-color:var(--accent-graphic);border-style:solid;background:var(--sel-bg)}
.equipment-files{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.equipment-file{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:40px;padding:4px 0;border-bottom:1px solid var(--border)}
.equipment-file.is-bad{color:var(--alert-text)}
.equipment-file .btn{margin-left:auto}
.equipment-report__item{padding:10px 0;border-bottom:1px solid var(--border)}
.equipment-report__item details{margin-top:6px}
.equipment-report__item summary,.equipment-section summary{cursor:pointer;min-height:40px;display:flex;align-items:center;font-weight:600}
.equipment-picker{min-height:160px}
@media (max-width:640px){.equipment-dl{grid-template-columns:1fr}.equipment-dl dt{font-weight:600}.equipment-stat{min-width:calc(50% - 4px)}.equipment-role-filter{max-width:none;width:100%}}

/* @file src/ui/features/map3d/style.css */
/* map3d feature (src/ui/features/map3d). Colors are tokens only; the three.js materials read the same tokens at runtime. */
.map3d-head{margin-bottom:8px}
.map3d-intro{margin:0 0 16px;max-width:72ch}
.map3d-stage{position:relative;height:clamp(380px,64vh,700px);border-radius:16px;overflow:hidden;background:var(--surface);border:1px solid var(--border);isolation:isolate}
.map3d-canvas{position:absolute;inset:0}
.map3d-canvas canvas{display:block;width:100%;height:100%;touch-action:none;outline:none}
.map3d-canvas canvas:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
.map3d-labels{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.map3d-label{position:absolute;left:0;top:0;font:600 11px/1 var(--font);letter-spacing:.06em;color:var(--text-dim);text-shadow:0 0 2px var(--surface-3),0 0 4px var(--surface-3),0 0 6px var(--surface-3);white-space:nowrap;user-select:none;-webkit-user-select:none;will-change:transform}
.map3d-note{position:absolute;left:12px;top:12px;max-width:min(420px,calc(100% - 24px));margin:0;padding:8px 12px;border-radius:12px;background:var(--glass);border:1px solid var(--border);font-size:13px;pointer-events:none}
.map3d-tools{position:absolute;top:12px;right:12px;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;max-width:calc(100% - 24px)}
.map3d-tool{min-width:40px;padding:0 10px;background:var(--glass);border:1px solid var(--border);color:var(--text);backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%)}
.map3d-tool--text{padding:0 14px}
.map3d-ico{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.map3d-card{position:absolute;left:0;top:0;width:min(320px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;padding:12px 14px;border-radius:16px;background:var(--glass);border:1px solid var(--border);box-shadow:var(--shadow);backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%);color:var(--text);pointer-events:none}
.map3d-card--pinned{pointer-events:auto}
.map3d-card--dock{left:12px;right:12px;top:auto;bottom:12px;width:auto;max-height:55%;transform:none}
.map3d-card__head{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.map3d-card__title{font-size:16px;line-height:1.25;overflow-wrap:anywhere}
.map3d-facts{display:grid;grid-template-columns:auto 1fr;gap:2px 12px;margin:0 0 10px;font-size:13px}
.map3d-facts dt{color:var(--text-faint)}
.map3d-facts dd{margin:0;overflow-wrap:anywhere}
.map3d-wx{display:flex;flex-direction:column;gap:10px;padding-top:10px;border-top:1px solid var(--border)}
.map3d-wx__head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.map3d-wx__label{font-size:13px;font-weight:600}
.map3d-wx p{margin:4px 0 0;font-size:13px}
.map3d-when{font-size:12px;color:var(--text-faint)}
.map3d-alerts{margin:4px 0 0;padding-left:18px;font-size:12px;color:var(--text-dim)}
.map3d-card__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.map3d-msg{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:8px;padding:24px;text-align:center;pointer-events:none}
.map3d-msg a,.map3d-msg button{pointer-events:auto}
.map3d-msg p{margin:0;max-width:56ch}
.map3d-msg__title{font:600 18px var(--font-display)}
.map3d-stage--fallback{height:auto;min-height:220px}
.map3d-stage--fallback .map3d-msg{position:static;padding:32px 24px}
.map3d-legend{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;font-size:13px}
.map3d-legend li{display:inline-flex;align-items:center;gap:8px;min-height:24px}
.map3d-glyph{display:inline-block;flex:none;width:12px;height:12px;background:var(--map3d-c,var(--text-faint))}
.map3d-glyph--circle{border-radius:50%}
.map3d-glyph--triangle{clip-path:polygon(50% 0,100% 100%,0 100%)}
.map3d-glyph--diamond{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.map3d-tone--active{--map3d-c:var(--info)}
.map3d-tone--planning{--map3d-c:var(--accent-graphic)}
.map3d-tone--on_hold{--map3d-c:var(--caution)}
.map3d-tone--complete{--map3d-c:var(--text-dim)}
.map3d-tone--other{--map3d-c:var(--text-faint)}
.map3d-help{margin:8px 0 0;font-size:13px}
.map3d-help summary{display:inline-flex;align-items:center;min-height:40px;font-weight:600;color:var(--accent-text);cursor:pointer}
.map3d-help ul{margin:4px 0 0;padding-left:18px;color:var(--text-dim)}
.map3d-section{margin-top:28px}
.map3d-section>p{margin:6px 0 0}
.map3d-status{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.map3d-table td a{font-weight:600}
.map3d-show{white-space:nowrap}
.map3d-credits{margin-top:28px;font-size:12px}
.map3d-credits p{margin:4px 0}
@media (max-width:640px){
  .map3d-stage{height:min(58vh,520px);min-height:320px}
  .map3d-tools{top:8px;right:8px}
  .map3d-tool,.map3d-show,.map3d-card__actions .btn,.map3d-head .btn{min-height:44px}
  .map3d-tool{min-width:44px}
  .map3d-help summary{min-height:44px}
  .map3d-note{top:auto;bottom:12px}
}
/* Glass needs an opaque fallback: no backdrop-filter, reduced transparency or increased contrast. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){.map3d-tool,.map3d-card,.map3d-note{background:var(--surface)}}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more){.map3d-tool,.map3d-card,.map3d-note{background:var(--surface);backdrop-filter:none;-webkit-backdrop-filter:none}}

/* @file src/ui/features/realtime/style.css */
/* realtime: live widget under the project header. Tokens only. State is always shown in words; the dot shape differs too. */
[data-feature="realtime"]{min-width:0;max-width:100%}
.realtime{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;min-height:40px;min-width:0}
.realtime-state{display:inline-flex;align-items:center;gap:6px;min-height:40px;font-size:13px;font-weight:600;color:var(--text-dim);white-space:nowrap}
.realtime-dot{display:inline-block;flex:none;width:10px;height:10px;border-radius:50%;box-sizing:border-box;background:var(--text-faint)}
.realtime-state[data-state="live"] .realtime-dot{background:var(--info)}
.realtime-state[data-state="live"]{color:var(--info-text)}
.realtime-state[data-state="connecting"] .realtime-dot,.realtime-state[data-state="reconnecting"] .realtime-dot{background:transparent;border:2px solid var(--caution)}
.realtime-state[data-state="reconnecting"]{color:var(--caution-text)}
.realtime-state[data-state="offline"] .realtime-dot{width:12px;height:4px;border-radius:2px;background:var(--text-faint)}
@media (prefers-reduced-motion:no-preference){.realtime-state[data-state="reconnecting"] .realtime-dot{animation:realtime-pulse 1.2s ease-in-out infinite}}
@keyframes realtime-pulse{50%{opacity:.35}}
.realtime-people{display:flex;align-items:center;list-style:none;margin:0;padding:0 0 0 6px}
.realtime-avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;margin-left:-6px;border-radius:50%;border:2px solid var(--surface);background:var(--wash-3);color:var(--text);font-size:12px;font-weight:700;line-height:1}
.realtime-avatar--more{background:var(--surface-3);color:var(--text-dim)}
.realtime-status{flex:1 1 180px;min-width:0;margin:0;font-size:13px;overflow-wrap:anywhere}
/* Kept in the accessibility tree while empty (a live region must exist before it changes), just without width. */
.realtime-status:empty{flex:0 0 0}
.realtime-hints{display:flex;flex-wrap:wrap;gap:4px 12px;flex-basis:100%;list-style:none;margin:0;padding:0;font-size:13px;color:var(--caution-text);overflow-wrap:anywhere}
/* Row and Gantt bar marks ("Editing: <name>") are set through ctx.markTask and styled by core app.css ([data-task-mark]). */

/* @file src/ui/features/safety/style.css */
/* Safety feature styles. Every class starts with .safety-; colors come only from tokens (var(--...)). */
.safety-head{margin-bottom:12px}
.safety-head h1,.safety-head h2{margin:0}
.safety-section{margin-top:24px}
/* Partial hours: some cases sit in months without hours, so the rates leave them out (text first, the bar only repeats it). */
.safety-note{margin:8px 0;padding:8px 12px;border-left:3px solid var(--caution);border-radius:8px;background:color-mix(in srgb,var(--caution) 10%,var(--surface));color:var(--text)}
.safety-section.card{padding:16px}
.safety-section__head{margin-bottom:8px}
.safety-section__head h3,.safety-types-card h3,.safety-chart-card h4{margin:0}
.safety-caption{margin:4px 0 12px}
.safety-disclaimer{font-size:12px;max-width:80ch;margin:16px 0 0}
.safety-empty{padding:12px 0;margin:0;max-width:70ch}
.safety-more{margin-top:12px}
.safety-intro{margin:0}
.safety-filters{margin:4px 0 12px}
.safety-filter{width:auto;min-width:160px}
.safety-textarea{resize:vertical;min-height:80px;font:inherit}

/* metric cards */
.safety-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:12px 0}
.safety-card__label{font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-faint)}
.safety-card__value{font:700 32px/1.1 var(--font-display);margin:6px 0;overflow-wrap:anywhere}
.safety-card__value--missing{font:600 18px/1.3 var(--font);color:var(--text-dim)}
.safety-card__detail{font-size:13px}
.safety-card__help{font-size:12px;margin-top:6px}

/* chart */
.safety-chart-card{margin-top:12px}
.safety-svg{display:block;width:100%;height:auto;max-height:280px}
.safety-grid{stroke:var(--border);stroke-width:1}
.safety-axis{fill:var(--text-dim);font:12px var(--font)}
.safety-line{fill:none;stroke:var(--accent-graphic);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.safety-dot{fill:var(--accent-graphic);stroke:var(--surface);stroke-width:2}
.safety-details{margin-top:12px}
.safety-summary{display:flex;align-items:center;min-height:40px;font-weight:600;color:var(--accent-text);cursor:pointer}

/* icons and chips */
.safety-icon{flex:none}
.safety-icon__line{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.safety-icon__fill{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}
.safety-chip{gap:6px;padding:0 10px 0 8px;white-space:nowrap}
.safety-chip--low,.safety-chip--reported,.safety-chip--open{background:color-mix(in srgb,var(--info) 14%,var(--surface));color:var(--info-text)}
.safety-chip--medium,.safety-chip--investigating{background:color-mix(in srgb,var(--caution) 14%,var(--surface));color:var(--caution-text)}
.safety-chip--high,.safety-chip--overdue{background:color-mix(in srgb,var(--alert) 14%,var(--surface));color:var(--alert-text)}
.safety-chip--critical{background:var(--alert);color:var(--on-alert)}
.safety-chip--closed,.safety-chip--done,.safety-chip--canceled{background:var(--wash-2);color:var(--text-dim)}

/* tables: cells stack into labeled blocks on phones, so nothing scrolls sideways */
.safety-cell-text{max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.safety-cell-act .row{flex-wrap:nowrap}
.safety-types{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.safety-types .chip{height:28px}
.safety-types-card{margin-top:12px}
@media (max-width:720px){
  .safety-stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .safety-stack,.safety-stack tbody,.safety-stack tr,.safety-stack td{display:block}
  .safety-stack tr{border:1px solid var(--border);border-radius:12px;padding:6px 12px;margin-bottom:12px}
  .safety-stack td{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:0;padding:6px 0;text-align:right;overflow-wrap:anywhere}
  .safety-stack td[data-label]::before{content:attr(data-label);flex:none;font-weight:600;color:var(--text-dim);text-align:left}
  .safety-stack td.safety-cell-act{justify-content:flex-end}
  .safety-cell-text{max-width:none;white-space:normal;overflow:visible}
  .safety-card__value{font-size:28px}
}

/* incident detail */
.safety-detail{margin-top:4px}
.safety-detail__title{margin:16px 0 8px}
.safety-detail h4,.safety-actions h4{margin:16px 0 4px}
.safety-facts{display:grid;grid-template-columns:max-content 1fr;gap:6px 16px;margin:12px 0}
.safety-facts dt{color:var(--text-dim);font-weight:600}
.safety-facts dd{margin:0;overflow-wrap:anywhere}
.safety-pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0 12px}
.safety-feed{margin-top:8px}
.safety-action{align-items:flex-start}
.safety-action__main{flex:1 1 280px;min-width:0}
.safety-action__main p{margin:4px 0}
.safety-action__text{margin:6px 0 4px}
.safety-action__btns{flex:0 0 auto}
@media (max-width:640px){
  .safety-facts{grid-template-columns:1fr;gap:2px}
  .safety-facts dd{margin-bottom:8px}
  .safety-action__btns{width:100%}
}
.safety-stack a{display:inline-flex;align-items:center;min-height:40px}
