/* =====================================================================
   Moonworks HQ · app styles
   Follows 01 - design/DESIGN_SPEC.md and station_concept.html.
   Every colour comes from tokens.css (var(--*)).
   ===================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
body { overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
ul { list-style: none; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, summary:focus-visible { box-shadow: var(--focus-ring); }
::selection { background: rgba(49, 168, 255, .35); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: var(--z-toast); padding: 10px 16px; border-radius: var(--radius-pill); background: var(--mw-white); color: var(--mw-navy-900); font-weight: 500; text-decoration: none; transition: top var(--dur-fast); }
.skip-link:focus { top: 12px; }
.muted { color: var(--text-3); }
.small { font-size: var(--fs-small); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.eyebrow { font-family: var(--font-notch); font-size: var(--fs-nano); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-3); }
.notch { font-family: var(--font-notch); }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- App shell ---------- */
.app { position: fixed; inset: 0; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.app.is-bare { grid-template-columns: 1fr; }
.app.is-bare .sidebar, .app.is-bare .tabbar, .app.is-bare .topbar { display: none; }
.main { position: relative; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.view { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: auto; }
.main--station .view { overflow: hidden; }
.page-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.page-bg .mw-grid { opacity: .06; }
.main--station .page-bg { display: none; }
.boot { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--space-md); color: var(--text-3); font-size: var(--fs-small); }
.boot__orb { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-3); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sidebar ---------- */
.sidebar { position: relative; z-index: var(--z-sidebar); display: flex; flex-direction: column; padding: var(--space-ml) var(--space-ms); background: rgba(10, 12, 23, .86); border-right: 1px solid var(--line-1); backdrop-filter: blur(var(--blur-heavy)); -webkit-backdrop-filter: blur(var(--blur-heavy)); overflow: hidden auto; }
html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .86); }
.sidebar::before { content: ""; position: absolute; inset: 0; background-image: var(--grid-image); background-size: var(--grid-cell) var(--grid-cell); opacity: .08; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--space-sm) var(--space-ml); position: relative; text-decoration: none; }
.brand-badge { width: 44px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; flex: none; }
.brand-badge svg { width: 24px; height: auto; fill: var(--text-1); }
.brand-name { font-family: var(--font-headline); font-size: 18px; letter-spacing: -.02em; }
.brand-chip { font-family: var(--font-notch); font-size: var(--fs-nano); letter-spacing: var(--ls-label); text-transform: uppercase; padding: 3px 7px; border-radius: var(--radius-pill); background: var(--status-active-bg); color: var(--accent); }
.demo-badge { position: relative; align-self: flex-start; margin: 0 var(--space-sm) var(--space-sm); display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--radius-pill); background: var(--status-waiting-bg); color: var(--status-waiting); font-family: var(--font-notch); font-size: var(--fs-nano); letter-spacing: var(--ls-label); text-transform: uppercase; white-space: nowrap; }
.demo-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.nav-group { position: relative; margin-top: var(--space-ml); }
.nav-label { font-family: var(--font-notch); font-size: var(--fs-nano); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-4); padding: 0 var(--space-ms) var(--space-sm); }
.nav-item { display: flex; align-items: center; gap: var(--space-ms); height: 36px; padding: 0 var(--space-ms); border-radius: var(--radius-sm); color: var(--text-2); font-size: 14px; text-decoration: none; transition: background var(--dur-fast), color var(--dur-fast); white-space: nowrap; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-3); color: var(--text-1); }
.nav-item.is-active { background: rgba(49, 168, 255, .12); color: var(--text-1); box-shadow: inset 0 0 0 1px rgba(49, 168, 255, .28); }
.nav-item.is-active svg { color: var(--accent); opacity: 1; }
.nav-count { margin-left: auto; font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-4); }
.me { margin-top: auto; position: relative; display: flex; align-items: center; gap: var(--space-ms); padding: var(--space-ms); border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--line-1); width: 100%; text-align: left; }
.me__text { min-width: 0; display: grid; }
.me-name { font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: var(--fs-micro); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle { margin-left: auto; display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-3); flex: none; }
.theme-toggle span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.theme-toggle span.on { background: var(--mw-white); color: var(--mw-navy-900); }
.theme-toggle svg { width: 12px; height: 12px; }
.menu { position: absolute; z-index: var(--z-popover); min-width: 200px; padding: 6px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); backdrop-filter: blur(var(--blur-heavy)); -webkit-backdrop-filter: blur(var(--blur-heavy)); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); text-decoration: none; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface-3); color: var(--text-1); }
.menu svg { width: 16px; height: 16px; }
.me-menu { left: var(--space-ms); right: var(--space-ms); bottom: 84px; }

/* ---------- Top bar ---------- */
.topbar { position: relative; z-index: var(--z-chrome); flex: none; height: var(--topbar-h); display: flex; align-items: center; gap: var(--space-ms); padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line-1); }
.main--station .topbar { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(to bottom, rgba(7, 9, 18, .75), rgba(7, 9, 18, 0)); border-bottom: 0; pointer-events: none; }
.main--station .topbar > * { pointer-events: auto; }
.search { display: flex; align-items: center; gap: var(--space-sm); width: 340px; height: 40px; padding: 0 var(--space-ms) 0 var(--space-md); border-radius: var(--radius-pill); background: var(--surface-glass); border: 1px solid var(--line-2); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); color: var(--text-3); font-size: 14px; text-align: left; }
.search:hover { border-color: var(--line-3); }
.search svg { width: 16px; height: 16px; flex: none; }
.kbd { margin-left: auto; font-family: var(--font-notch); font-size: var(--fs-micro); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-ms); }
.brand-m { display: none; }
.topbar .demo-badge { margin: 0; }
.m-only { display: none; }

/* ---------- Buttons ---------- */
.mw-btn svg { width: 16px; height: 16px; flex: none; }
.mw-btn:disabled { opacity: .5; cursor: not-allowed; }
.mw-btn--danger { background: var(--status-late-bg); color: var(--status-late); border-color: transparent; }
.mw-btn--danger:hover { filter: brightness(1.1); }
.mw-btn.btn-danger { color: var(--status-late); }
.mw-btn.btn-danger:hover, .mw-btn.btn-danger:focus-visible { background: var(--status-late-bg); color: var(--status-late); border-color: transparent; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-glass); border: 1px solid var(--line-2); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); position: relative; color: var(--text-1); flex: none; transition: background var(--dur-fast), border-color var(--dur-fast); }
.icon-btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn--sm { width: 28px; height: 28px; background: var(--surface-3); border: 0; }
.icon-btn--sm svg { width: 12px; height: 12px; }
.dot-badge { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--status-late); box-shadow: 0 0 0 2px var(--mw-navy-900); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-small); text-decoration: none; }
.link-btn:hover { color: var(--text-1); }
.link-btn svg { width: 14px; height: 14px; }

/* ---------- Chips, tags, avatars, bars ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); font-size: var(--fs-micro); font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--text-2); border: 0; }
.chip--sm { height: 22px; padding: 0 8px; font-size: 11px; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; flex: none; }
.chip--late { background: var(--status-late-bg); color: var(--status-late); }
.chip--waiting { background: var(--status-waiting-bg); color: var(--status-waiting); }
.chip--active { background: var(--status-active-bg); color: var(--status-active); }
.chip--launched { background: var(--status-launched-bg); color: var(--status-launched); }
.chip--planned { background: var(--status-planned-bg); color: var(--status-planned); }
.chip--retainer { background: var(--status-retainer-bg); color: var(--status-retainer); }
.chip--neutral { background: var(--surface-3); color: var(--text-2); }
button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1px currentColor; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 500; color: var(--tag); background: color-mix(in srgb, var(--tag) 14%, transparent); white-space: nowrap; }
.av { --s: 28px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; font-family: var(--font-notch); font-size: calc(var(--s) * .38); color: #fff; flex: none; box-shadow: 0 0 0 2px var(--mw-navy-850); background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--mw-blue)) 70%, #0a0c17), var(--c, var(--mw-blue))); object-fit: cover; letter-spacing: 0; }
html[data-theme="light"] .av { box-shadow: 0 0 0 2px #fff; }
.av--empty { background: var(--surface-3); color: var(--text-3); }
.av--more { background: var(--surface-3); color: var(--text-2); }
.av-stack { display: flex; }
.av-stack .av + .av { margin-left: -6px; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar b { display: block; height: 100%; border-radius: 3px; background: var(--status-active); }
.bar b.is-done { background: var(--status-launched); }
.bar b.is-late { background: var(--status-late); }
.bar b.is-waiting { background: var(--status-waiting); }
.bar b.is-active { background: var(--status-active); }
.bar b.is-open { background: repeating-linear-gradient(-45deg, currentColor 0 4px, transparent 4px 8px); opacity: .9; }
.ring { overflow: visible; }
.ring__track { fill: none; stroke: var(--surface-3); stroke-width: 6; }
.ring__value { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset var(--dur-slow) var(--ease-out); }
.ring text { font-family: var(--font-notch); font-size: 13px; fill: var(--text-1); }
.ring--launched .ring__value { stroke: var(--status-launched); }
.ring--active .ring__value { stroke: var(--status-active); }
.ring--late .ring__value { stroke: var(--status-late); }
.ring--waiting .ring__value { stroke: var(--status-waiting); }
.ring--planned .ring__value { stroke: var(--line-2); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.stepper i.is-done { background: var(--status-launched); }
.stepper i.is-active { background: var(--status-active); box-shadow: 0 0 6px var(--status-active); }
.stepper i.is-late { background: var(--status-late); box-shadow: 0 0 6px var(--status-late); }
.stepper i.is-waiting { background: var(--status-waiting); box-shadow: 0 0 6px var(--status-waiting); }
.stepper i.is-planned { background: transparent; border: 1px dashed var(--status-planned); }
.mono { --c: var(--mw-blue); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-headline); font-size: 13px; color: var(--text-1); background: color-mix(in srgb, var(--c) 22%, var(--surface-3)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); flex: none; position: relative; }
.mono--lg { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.mono--logo { width: auto; min-width: 28px; padding: 0 7px; font-size: 0; background: #0b0e1c; border-color: rgba(255,255,255,.14); }
.mono--logo[data-tone="dark"] { background: #fff; border-color: rgba(10,12,23,.14); }
.mono--logo.mono--lg { min-width: 56px; padding: 0 12px; }
.mono-img { display: block; height: auto; width: auto; max-height: 16px; max-width: 64px; object-fit: contain; }
.mono--lg .mono-img { max-height: 30px; max-width: 132px; }
.pop-logo { margin-top: 12px; display: flex; }
.pop-logo + .pop-name { margin-top: 10px; }
.accent-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); flex: none; }

/* ---------- Switch / segmented / select pills ---------- */
.tgl { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; border-radius: var(--radius-pill); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tgl:hover { background: var(--surface-3); }
.sw { width: 30px; height: 18px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background var(--dur-base); flex: none; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: transform var(--dur-base) var(--ease-out), background var(--dur-base); }
.tgl[aria-pressed="true"] { color: var(--text-1); }
.tgl[aria-pressed="true"] .sw { background: var(--accent); border-color: var(--accent); }
.tgl[aria-pressed="true"] .sw::after { transform: translateX(12px); background: #fff; }
.seg { display: inline-flex; padding: 3px; gap: 2px; height: 36px; border-radius: var(--radius-pill); background: var(--surface-3); }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text-1); box-shadow: var(--shadow-1); }
.seg em { font-style: normal; font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-4); }
.pill-select { position: relative; display: inline-flex; align-items: center; height: 36px; border-radius: var(--radius-pill); background: var(--surface-btn-ghost); border: 1px solid var(--line-3); color: var(--text-3); font-size: 13px; }
.pill-select span { padding-left: 14px; white-space: nowrap; }
.pill-select select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; height: 100%; padding: 0 32px 0 6px; color: var(--text-1); font-size: 13px; cursor: pointer; max-width: 180px; }
.pill-select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.pill-select:focus-within { box-shadow: var(--focus-ring); }
.pill-select option { background: var(--mw-navy-800); color: var(--text-1); }
html[data-theme="light"] .pill-select option { background: #fff; }
.search-input { display: flex; align-items: center; gap: 8px; height: 36px; width: 280px; max-width: 100%; padding: 0 14px; border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-3); }
.search-input svg { width: 16px; height: 16px; flex: none; }
.search-input input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text-1); font-size: 14px; }
.search-input:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
/* One focus ring only, on the pill (the global :focus-visible ring was also drawn on the inner field) */
.search-input input:focus, .search-input input:focus-visible { outline: none; box-shadow: none; border-radius: 0; }
.search-input input::placeholder { color: var(--text-3); opacity: 1; }
.search-input input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Pages (data screens) ---------- */
.page { position: relative; padding: var(--space-lg) var(--gutter) var(--space-3xl); max-width: var(--content-max); }
.page--wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--space-md); margin-bottom: var(--space-ml); }
.page-title { font-family: var(--font-headline); font-weight: 400; font-size: var(--fs-h2); line-height: var(--lh-tight); letter-spacing: var(--ls-title); }
.page-sub { color: var(--text-3); font-size: var(--fs-small); margin-top: 6px; }
.page-actions { margin-left: auto; display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.tabs { display: flex; gap: var(--space-lg); border-bottom: 1px solid var(--line-1); margin-bottom: var(--space-ml); overflow-x: auto; }
.tabs a, .tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; color: var(--text-3); font-size: 14px; text-decoration: none; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text-1); }
.tabs .is-active { color: var(--text-1); }
.tabs .is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs em { font-style: normal; font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-4); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); min-height: 48px; }
.card { background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--radius-md); box-shadow: var(--shadow-1), var(--shadow-inset-top); padding: var(--space-ml); min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.card-title { font-family: var(--font-headline); font-weight: 400; font-size: var(--fs-h4); letter-spacing: var(--ls-title); }
.card-head .count { font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-4); }
.card-head .link-btn { margin-left: auto; }
.empty { display: grid; justify-items: center; text-align: center; gap: var(--space-sm); padding: var(--space-2xl) var(--space-lg); color: var(--text-3); }
.empty__title { font-family: var(--font-headline); font-size: var(--fs-h4); color: var(--text-1); }
.empty__body { font-size: var(--fs-small); max-width: 46ch; }
.empty .mw-btn { margin-top: var(--space-sm); }
.empty--sm { padding: var(--space-lg) var(--space-md); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: var(--fs-small); }
.kv dt { color: var(--text-3); font-family: var(--font-notch); font-size: var(--fs-micro); letter-spacing: .02em; padding-top: 2px; }
.kv dd { color: var(--text-1); min-width: 0; overflow-wrap: anywhere; }
.confirm-note { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-notch); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--status-waiting); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { position: sticky; top: 0; z-index: 1; height: 40px; padding: 0 var(--space-md); text-align: left; font-family: var(--font-notch); font-weight: 400; font-size: var(--fs-nano); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-3); background: var(--surface-1); border-bottom: 1px solid var(--line-1); white-space: nowrap; }
.table th button { display: inline-flex; align-items: center; gap: 4px; text-transform: inherit; letter-spacing: inherit; color: inherit; font-size: inherit; }
.table th button[aria-sort] { color: var(--text-1); }
.table td { height: 56px; padding: 0 var(--space-md); border-bottom: 1px solid var(--line-1); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-fast); cursor: pointer; }
.table tbody tr:hover { background: var(--surface-3); }
.table tbody tr:focus-visible { box-shadow: inset 2px 0 0 var(--accent); background: var(--surface-3); border-radius: 0; }
.table .cell-main { display: flex; align-items: center; gap: var(--space-ms); min-width: 0; }
.table .cell-main a { text-decoration: none; font-weight: 500; }
.table .cell-sub { color: var(--text-3); font-size: var(--fs-small); }
.table .notch { font-size: var(--fs-micro); color: var(--text-2); white-space: nowrap; }
.table .is-late { color: var(--status-late); }
.cards-list { display: none; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(296px, 340px); gap: var(--space-md); overflow-x: auto; padding-bottom: var(--space-md); align-items: start; }
.col { background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--radius-md); padding: var(--space-ms); display: flex; flex-direction: column; gap: 10px; min-height: 160px; transition: background var(--dur-fast), border-color var(--dur-fast); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.col-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); }
.col-head h2 { font-family: var(--font-headline); font-weight: 400; font-size: var(--fs-h4); letter-spacing: var(--ls-title); }
.col-head .count { font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-4); }
.col-head .icon-btn--sm { margin-left: auto; }
.col.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface-1)); }
.col.is-collapsed .col-body { display: none; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.col-empty { font-size: var(--fs-small); color: var(--text-4); padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; }
.drop-slot { height: 4px; border-radius: 2px; border: 2px dashed var(--accent); }
.task { position: relative; display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-1); cursor: grab; transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), box-shadow var(--dur-fast); text-align: left; width: 100%; }
.task:hover { border-color: var(--line-3); transform: translateY(-1px); }
.task.is-dragging { opacity: .5; }
.task.is-lifted { box-shadow: var(--shadow-2); transform: rotate(.6deg); }
.task.is-overdue { box-shadow: inset 2px 0 0 var(--status-late); }
.task-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.task-account { font-size: 12px; font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .tag { margin-left: auto; }
.task-title { font-size: 15px; font-weight: 500; color: var(--text-1); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-sub { font-size: var(--fs-small); color: var(--text-3); line-height: 1.35; }
.task-note { font-size: var(--fs-small); line-height: 1.35; padding: 6px 8px; border-radius: 8px; }
.task-note--late { background: var(--status-late-bg); color: var(--status-late); }
.task-note--waiting { background: var(--status-waiting-bg); color: var(--status-waiting); }
.deliverable { display: inline-flex; align-items: center; gap: 6px; justify-self: start; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); font-size: 12px; color: var(--text-2); }
.deliverable svg { width: 12px; height: 12px; }
.task-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.task-foot .due { margin-left: auto; font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-3); white-space: nowrap; }
.task-foot .due.is-late { color: var(--status-late); }
.task-foot .comments { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-3); }
.task-foot .comments svg { width: 13px; height: 13px; }
.task-move { display: none; }

/* ---------- Workload ---------- */
.wl { display: grid; grid-template-columns: 240px repeat(var(--days), minmax(56px, 1fr)) 76px 150px; min-width: 980px; }
.wl > div { border-bottom: 1px solid var(--line-1); }
.wl-head { height: 40px; display: flex; align-items: center; padding: 0 8px; font-family: var(--font-notch); font-size: var(--fs-nano); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.wl-head.is-today { color: var(--accent); }
.wl-head.is-weekstart { border-left: 1px solid var(--line-2); }
.wl-who { display: flex; align-items: center; gap: 10px; padding: 12px var(--space-md); min-height: 64px; }
.wl-who b { font-weight: 500; font-size: 14px; display: block; }
.wl-who div > span { font-size: 12px; color: var(--text-3); }
.wl-day { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 8px 4px; min-height: 64px; }
.wl-day.is-today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.wl-day.is-weekstart { border-left: 1px solid var(--line-2); }
.wl-day.is-over { background: var(--status-late-bg); }
.wl-bar { display: block; height: 10px; border-radius: 3px; background: var(--c); border: 0; width: 100%; cursor: pointer; }
.wl-bar:hover { filter: brightness(1.2); }
.wl-nodate, .wl-sum { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px 12px; font-size: 12px; color: var(--text-2); }
.wl-sum b { font-family: var(--font-notch); font-weight: 400; color: var(--text-1); }
.wl-sum .is-late { color: var(--status-late); }
.wl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-md); margin-top: var(--space-lg); }
.mini-task { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-1); font-size: var(--fs-small); text-decoration: none; }
.mini-task:last-child { border-bottom: 0; }
.mini-task .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.mini-task .d { font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-3); white-space: nowrap; }
.mini-task .d.is-late { color: var(--status-late); }
.popover { position: fixed; z-index: var(--z-popover); width: 300px; max-width: calc(100vw - 32px); padding: var(--space-md); border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); backdrop-filter: blur(var(--blur-heavy)); -webkit-backdrop-filter: blur(var(--blur-heavy)); animation: pop-in var(--dur-slow) var(--ease-out) both; }

/* ---------- Project page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-small); text-decoration: none; margin-bottom: var(--space-ms); }
.back:hover { color: var(--text-1); }
.back svg { width: 14px; height: 14px; }
.proj-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-ml); }
.proj-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.proj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; color: var(--text-3); font-size: var(--fs-small); }
.proj-meta a { color: var(--text-2); }
.overview { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr) 300px; gap: var(--space-lg); align-items: start; }
.stack { display: grid; gap: var(--space-lg); min-width: 0; }
.alert-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-1); font-size: var(--fs-small); }
.alert-item:last-child { border-bottom: 0; }
.alert-item i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); flex: none; }
.alert-item b { display: block; font-weight: 500; color: var(--text-1); }
.alert-item span { color: var(--text-3); }
.rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.ring-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 14px 12px; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--line-1); min-width: 0; text-align: left; cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast); }
.ring-card > span { display: block; width: 100%; min-width: 0; }
.ring-card:hover { transform: translateY(-1px); background: var(--surface-3); }
.ring-card .ring text { font-size: 11px; letter-spacing: -.01em; }
.ring-card:hover { border-color: var(--line-3); }
.ring-card b { display: block; font-weight: 500; font-size: 13.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring-card > span > span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gantt { position: relative; overflow-x: auto; }
.gantt-grid { position: relative; min-width: 460px; padding-bottom: 28px; }
.gantt-axis { display: grid; grid-template-columns: 120px 1fr 40px; height: 32px; align-items: end; }
.gantt-months { position: relative; height: 100%; }
.gantt-months span { position: absolute; bottom: 6px; font-family: var(--font-notch); font-size: var(--fs-nano); letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); transform: translateX(4px); white-space: nowrap; }
.gantt-row { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; height: 52px; border-top: 1px solid var(--line-1); }
.gantt-label { display: flex; flex-direction: column; gap: 2px; padding-right: 10px; min-width: 0; }
.gantt-label .chip { align-self: flex-start; }
.gantt-label small { font-size: 11px; color: var(--text-4); font-family: var(--font-notch); }
.gantt-track { position: relative; height: 100%; background-image: linear-gradient(90deg, var(--line-1) 1px, transparent 1px); background-size: var(--day-w, 20px) 100%; }
.gantt-bar { position: absolute; top: 50%; height: 10px; transform: translateY(-50%); border-radius: 5px; background: color-mix(in srgb, var(--c) 45%, transparent); border: 1px solid var(--c); min-width: 6px; }
.gantt-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--mw-navy-850); }
.gantt-nodate { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-4); font-family: var(--font-notch); }
.gantt-marker { position: absolute; top: 32px; bottom: 28px; width: 0; border-left: 1px solid var(--text-1); pointer-events: none; }
.gantt-marker span { position: absolute; bottom: -24px; left: 0; transform: translateX(-50%); padding: 2px 7px; border-radius: var(--radius-pill); background: var(--mw-white); color: var(--mw-navy-900); font-family: var(--font-notch); font-size: 10px; white-space: nowrap; }
.gantt-marker--today span { bottom: auto; top: -24px; }
.gantt-marker--launch { border-left-color: var(--status-launched); }
.gantt-marker--launch span { background: var(--status-launched); color: #062b19; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.preview-card { padding: 0; overflow: hidden; }
.preview-stage { height: 240px; position: relative; background: radial-gradient(60% 60% at 50% 55%, rgba(49, 168, 255, .16), transparent 70%), var(--mw-navy-950); }
.preview-stage canvas { width: 100%; height: 100%; display: block; }
.preview-info { padding: var(--space-md) var(--space-ml) var(--space-ml); display: grid; gap: 6px; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-1); font-size: var(--fs-small); }
.feed li:last-child { border-bottom: 0; }
.feed p { flex: 1; min-width: 0; color: var(--text-2); }
.feed b { font-weight: 500; color: var(--text-1); }
.feed time { font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-4); white-space: nowrap; }
.crew-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: var(--fs-small); }
.crew-list b { font-weight: 500; display: block; }
.crew-list li > div > span { color: var(--text-3); font-size: 12px; }

/* ---------- Accounts drawer & team ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); }
.crew-card { display: grid; gap: 12px; align-content: start; }
.crew-card .av { --s: 56px; font-size: 20px; }
.crew-card h2 { font-family: var(--font-headline); font-weight: 400; font-size: 20px; letter-spacing: var(--ls-title); }
.crew-card .role { font-size: var(--fs-small); color: var(--text-3); }
.crew-top { display: flex; gap: 14px; align-items: center; }
.crew-top .mw-btn { margin-left: auto; align-self: flex-start; }
.email-row { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: var(--fs-small); color: var(--text-2); }
.email-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.email-row a:hover { text-decoration: underline; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--status-launched); }
.status-dot.is-away::before { background: var(--text-4); }
.drawer-section { margin-bottom: var(--space-lg); }
.drawer-section h3 { font-family: var(--font-notch); font-weight: 400; font-size: var(--fs-nano); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.mission-mini { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-3); text-decoration: none; margin-bottom: 8px; }
.mission-mini:hover { outline: 1px solid var(--line-3); }
.mission-mini b { font-weight: 500; font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.kpi .num { font-family: var(--font-headline); font-size: var(--fs-h2); line-height: 1.1; margin-top: 8px; }
.kpi p { font-size: var(--fs-small); color: var(--text-3); margin-top: 4px; }

/* ---------- Station HUD ---------- */
.station { position: absolute; inset: 0; }
.station-host { position: absolute; inset: 0; }
.station .stage-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.station .stage-canvas:active { cursor: grabbing; }
.station-glow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.hud { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-chrome); }
.hud > * { pointer-events: auto; }
.station-card { position: absolute; top: calc(var(--topbar-h) + 4px); left: var(--gutter); width: 356px; padding: var(--space-md) var(--space-ml); border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--line-2); backdrop-filter: blur(var(--blur-heavy)); -webkit-backdrop-filter: blur(var(--blur-heavy)); box-shadow: var(--shadow-1), var(--shadow-inset-top); }
.station-title { font-family: var(--font-headline); font-weight: 400; font-size: 28px; line-height: var(--lh-tight); letter-spacing: var(--ls-title); margin: 6px 0 4px; }
.station-meta { color: var(--text-2); font-size: var(--fs-small); }
.station-meta b { font-weight: 500; color: var(--text-1); }
.station-card .chips { margin-top: var(--space-ms); }
.station-card .demo-badge { margin: 0 0 0 8px; vertical-align: 2px; }
.ticker { position: relative; display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-ms); padding-top: var(--space-ms); border-top: 1px solid var(--line-1); font-size: var(--fs-small); color: var(--text-2); min-height: 44px; }
.ticker b { color: var(--text-1); font-weight: 500; }
.ticker time { margin-left: auto; font-family: var(--font-notch); font-size: var(--fs-micro); color: var(--text-4); white-space: nowrap; }
.ticker .ticker-line { display: flex; align-items: center; gap: var(--space-sm); width: 100%; animation: fade-in var(--dur-base) var(--ease-out) both; }
.ticker .ticker-line > span:not(.av) { flex: 1; min-width: 0; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.toggles { position: absolute; top: calc(var(--topbar-h) + 4px); right: var(--gutter); display: flex; gap: 6px; padding: 6px; border-radius: var(--radius-pill); background: var(--surface-glass); border: 1px solid var(--line-2); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); }
.map-ctrl { position: absolute; right: var(--gutter); bottom: var(--gutter); display: flex; flex-direction: column; gap: 2px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface-glass); border: 1px solid var(--line-2); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); }
.map-ctrl button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.map-ctrl button:hover { background: var(--surface-3); color: var(--text-1); }
.map-ctrl svg { width: 16px; height: 16px; }
.map-ctrl hr { border: 0; height: 1px; background: var(--line-1); margin: 2px 6px; }
.bottom-center { position: absolute; left: 50%; bottom: var(--gutter); transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-ms); }
.hint { font-size: var(--fs-micro); color: var(--text-3); white-space: nowrap; padding: 0 var(--space-sm); transition: opacity var(--dur-slow); }
.hint.is-gone { opacity: 0; pointer-events: none; }
.locate { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px 0 14px; border-radius: var(--radius-pill); background: var(--surface-btn-ghost); border: 1px solid var(--line-3); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); font-size: 14px; font-weight: 500; white-space: nowrap; }
.locate svg { width: 16px; height: 16px; color: var(--accent); }
.locate:hover { background: var(--surface-3); }
.legend { position: absolute; left: var(--gutter); bottom: var(--gutter); padding: var(--space-ms) var(--space-md); border-radius: var(--radius-md); background: var(--surface-glass); border: 1px solid var(--line-1); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); font-size: var(--fs-micro); color: var(--text-2); }
.legend summary { cursor: pointer; list-style: none; font-family: var(--font-notch); font-size: var(--fs-nano); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-3); }
.legend summary::-webkit-details-marker { display: none; }
.legend[open] summary { margin-bottom: 8px; }
.legend-grid { display: grid; grid-template-columns: auto auto; gap: 6px 18px; }
.legend-grid span { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--text-2); }
.legend-grid i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px var(--c); background: var(--c); }
.legend-grid i.ghost { background: none; border: 1px dashed var(--c); box-shadow: none; border-radius: 2px; }
.mlabel { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); background: rgba(7, 9, 18, .72); border: 1px solid var(--line-2); color: #fbfafc; font-size: 12px; font-weight: 500; white-space: nowrap; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity var(--dur-base); will-change: transform; }
.mlabel i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.mlabel small { font-family: var(--font-notch); font-size: 10px; color: #8f93a3; letter-spacing: .02em; }
.mlabel.is-hq { height: 28px; padding: 0 12px; background: var(--mw-white); color: var(--mw-navy-900); border-color: transparent; font-family: var(--font-headline); font-size: 13px; }
.mlabel.is-ghost { border-style: dashed; border-color: var(--status-planned); color: var(--status-planned); }
.mpct { --c: var(--status-active); position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 10px 5px; border-radius: 12px; background: rgba(5, 7, 15, .8); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 30%, transparent), 0 2px 8px rgba(0, 0, 0, .4); pointer-events: none; white-space: nowrap; will-change: transform; transition: opacity var(--dur-fast, 160ms) ease; }
.mpct b { font-family: var(--font-headline); font-weight: 600; font-size: 18px; line-height: 1; letter-spacing: -.02em; color: #fff; text-shadow: 0 0 6px rgba(255, 255, 255, .45), 0 0 12px var(--c); }
.mpct small { font-family: var(--font-notch); font-weight: 700; font-size: 8.5px; line-height: 1; letter-spacing: .18em; color: var(--c); }
.mpct.is-dim { opacity: .35; }
@media (max-width: 767px) { .mpct { padding: 3px 8px 4px; border-radius: 10px; } .mpct b { font-size: 15px; } .mpct small { font-size: 8px; } }
.mlabel.is-hidden { opacity: 0; }
.mlabel.is-dim { opacity: .35; }
.tooltip { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; display: grid; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12px; box-shadow: var(--shadow-1); white-space: nowrap; }
.tooltip span { color: var(--text-3); }
.pop { position: absolute; top: calc(var(--topbar-h) + 64px); right: var(--gutter); width: 340px; max-height: calc(100% - var(--topbar-h) - 64px - 96px); overflow: auto; scrollbar-width: none; padding: var(--space-md); border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--line-2); backdrop-filter: blur(var(--blur-heavy)); -webkit-backdrop-filter: blur(var(--blur-heavy)); box-shadow: var(--shadow-pop); z-index: var(--z-popover); animation: pop-in var(--dur-slow) var(--ease-out) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.pop-top { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; padding-right: 32px; }
.pop-close { position: absolute; top: 12px; right: 12px; }
.pop-name { font-family: var(--font-headline); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; margin: 10px 0 2px; }
.pop-sub { font-size: var(--fs-small); color: var(--text-3); }
.alert { display: flex; gap: 8px; align-items: flex-start; margin-top: var(--space-ms); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--status-late-bg); color: var(--status-late); font-size: var(--fs-small); line-height: 1.35; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert b { font-weight: 500; }
.phases { margin-top: 14px; display: grid; gap: 8px; }
.phase { display: grid; grid-template-columns: 112px 1fr 34px; align-items: center; gap: 10px; font-size: var(--fs-small); color: var(--text-2); }
.phase em { font-style: normal; font-family: var(--font-notch); font-size: var(--fs-micro); text-align: right; color: var(--text-3); }
.phase.is-current { color: var(--text-1); }
.step { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--line-1); display: grid; gap: 8px; }
.step-row { display: grid; grid-template-columns: 52px 1fr; gap: 8px; font-size: var(--fs-small); }
.step-row > span { color: var(--text-3); font-family: var(--font-notch); font-size: var(--fs-micro); letter-spacing: .02em; padding-top: 1px; text-transform: uppercase; }
.crew-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 14px; }
.crew-row .eyebrow { margin-bottom: 6px; }
.due-col { text-align: right; }
.due-col b { display: block; font-weight: 500; font-size: 14px; }
.pop .mw-btn { width: 100%; margin-top: 14px; height: 42px; }
.station-fallback { position: absolute; inset: 0; overflow: auto; padding: calc(var(--topbar-h) + 220px) var(--gutter) var(--space-2xl); }
.station-empty { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- Dialogs, forms, toasts ---------- */
.dialog { margin: auto; padding: 0; border: 0; background: transparent; color: var(--text-1); max-width: calc(100vw - 32px); width: 560px; max-height: calc(100dvh - 48px); overflow: visible; }
.dialog--wide { width: 836px; }
.dialog::backdrop { background: rgba(7, 9, 18, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dialog__panel { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: pop-in var(--dur-slow) var(--ease-out) both; overflow: hidden; }
html:not([data-theme="light"]) .dialog__panel { background: #151827; }
.dialog__head { display: flex; align-items: center; gap: 12px; padding: var(--space-ml) var(--space-lg) var(--space-ms); }
.dialog__title { font-family: var(--font-headline); font-weight: 400; font-size: var(--fs-h3); letter-spacing: var(--ls-title); flex: 1; min-width: 0; }
.dialog__head .icon-btn { width: 32px; height: 32px; }
.dialog__body { padding: var(--space-sm) var(--space-lg) var(--space-lg); overflow: auto; }
.dialog--drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: 520px; }
.dialog--drawer .dialog__panel { height: 100%; max-height: 100dvh; border-radius: var(--radius-lg) 0 0 var(--radius-lg); animation: drawer-in var(--dur-slow) var(--ease-out) both; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.form--rail .form__grid { grid-template-columns: minmax(0, 1fr) 220px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: 12px; color: var(--text-3); }
.field__hint { font-size: 12px; color: var(--text-4); }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-1); font-size: 14px; }
.field input[type="color"] { padding: 4px; height: 40px; cursor: pointer; }
.field .check input { width: 16px; height: 16px; min-height: 0; padding: 0; border-radius: 4px; flex: none; }
.field textarea { resize: vertical; line-height: 1.4; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; background-repeat: no-repeat; background-position: right 16px center; background-size: 14px 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-opacity='.75' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); }
html[data-theme="light"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230a0c17' stroke-opacity='.7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); }
.field select option { background: var(--mw-navy-800); }
html[data-theme="light"] .field select option { background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.field input[aria-invalid="true"] { border-color: var(--status-late); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--line-2); font-size: 13px; cursor: pointer; }
.check:has(input:checked) { border-color: var(--accent); background: var(--status-active-bg); }
.check input { accent-color: var(--accent); }
.form__error { margin-top: var(--space-md); font-size: 12px; color: var(--status-late); }
.form__actions { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-lg); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); font-size: 14px; animation: pop-in var(--dur-slow) var(--ease-out) both; pointer-events: auto; max-width: calc(100vw - 32px); }
html:not([data-theme="light"]) .toast { background: #1a1d2c; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--status-launched); flex: none; }
.toast--error::before { background: var(--status-late); }
.toast--warn::before { background: var(--status-waiting); }
.toast.is-out { opacity: 0; transition: opacity var(--dur-slow); }
.palette { width: 620px; }
.palette .dialog__head { display: none; }
.palette .dialog__body { padding: 0; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 var(--space-ml); height: 56px; border-bottom: 1px solid var(--line-1); }
.palette-input svg { width: 18px; height: 18px; color: var(--text-3); }
.palette-input input { flex: 1; background: transparent; border: 0; font-size: 16px; color: var(--text-1); }
.palette-results { max-height: 420px; overflow: auto; padding: 8px; }
.palette-group { padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 14px; text-decoration: none; color: var(--text-2); }
.palette-item small { margin-left: auto; color: var(--text-4); font-size: 12px; }
.palette-item[aria-selected="true"], .palette-item:hover { background: var(--surface-3); color: var(--text-1); }
.alerts-list li a { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-1); text-decoration: none; font-size: var(--fs-small); }
.alerts-list li:last-child a { border-bottom: 0; }
.alerts-list i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); flex: none; }
.alerts-list b { display: block; font-weight: 500; }
.alerts-list span { color: var(--text-3); }

/* ---------- Login ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: var(--gutter-mobile); overflow: auto; }
.login .mw-glow { position: fixed; }
.login-card { position: relative; width: 420px; max-width: 100%; padding: var(--space-xl); border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--line-2); backdrop-filter: blur(var(--blur-heavy)); -webkit-backdrop-filter: blur(var(--blur-heavy)); box-shadow: var(--shadow-2), var(--shadow-inset-top); display: grid; gap: var(--space-md); }
.login-card h1 { font-family: var(--font-headline); font-weight: 400; font-size: var(--fs-h2); letter-spacing: var(--ls-title); line-height: var(--lh-tight); }
.login-card p { color: var(--text-2); font-size: var(--fs-small); }
.login-card .mw-btn { width: 100%; height: 44px; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .overview { grid-template-columns: minmax(0, 1fr) 300px; }
  .overview > .stack:first-child { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 1024px) and (min-width: 768px) {
  :root { --sidebar-w: 72px; }
  .sidebar { padding: var(--space-ml) 10px; }
  .brand-name, .brand-chip, .nav-label, .nav-item span, .nav-count, .me__text, .theme-toggle, .sidebar .demo-badge { display: none; }
  .brand { padding: 0 0 var(--space-ml); justify-content: center; }
  .nav-item { justify-content: center; padding: 0; }
  .me { justify-content: center; padding: 8px; }
  .overview { grid-template-columns: 1fr; }
  .topbar .demo-badge.m-only { display: inline-flex; }
}
@media (max-width: 1180px) { .hint { display: none; } }
@media (max-width: 767px) {
  :root { --gutter: var(--gutter-mobile); --topbar-h: 56px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .main--station { padding-bottom: 0; }
  .search { width: auto; flex: 1; }
  .search .kbd, .d-only { display: none !important; }
  .m-only { display: inline-flex; }
  .brand-m { display: flex; align-items: center; text-decoration: none; }
  .topbar .new-mission { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: rgba(7, 9, 18, .88); border-top: 1px solid var(--line-1); backdrop-filter: blur(var(--blur-heavy)); -webkit-backdrop-filter: blur(var(--blur-heavy)); z-index: var(--z-sidebar); }
  html[data-theme="light"] .tabbar { background: rgba(255, 255, 255, .9); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; color: var(--text-3); text-decoration: none; border-radius: var(--radius-sm); }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a.is-active { color: var(--text-1); }
  .tabbar a.is-active svg { color: var(--accent); }
  .page { padding: var(--space-md) var(--gutter) var(--space-2xl); }
  .page-title { font-size: 26px; }
  .page-actions { margin-left: 0; width: 100%; }
  .filters .search-input { width: 100%; }
  .form__grid, .form--rail .form__grid { grid-template-columns: 1fr; }
  .dialog { width: 100%; max-width: 100%; margin: auto 0 0; }
  .dialog__panel { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; }
  .dialog--drawer { width: 100%; height: auto; max-height: 92dvh; margin: auto 0 0; }
  .dialog--drawer .dialog__panel { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; }
  .toasts { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
  /* tables become cards */
  .table-wrap { display: none; }
  .cards-list { display: grid; gap: 10px; }
  .row-card { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--line-2); text-decoration: none; }
  .row-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .row-card-top b { font-weight: 500; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; color: var(--text-3); }
  .board { grid-auto-columns: minmax(84vw, 1fr); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .task-move { display: block; }
  .task-move select { width: 100%; height: 32px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-1); padding: 0 8px; font-size: 12px; }
  .overview { grid-template-columns: 1fr; }
  .proj-head .page-actions { width: auto; }
  .kv { grid-template-columns: 100px 1fr; }
  /* station */
  .station-card { left: var(--gutter); right: var(--gutter); width: auto; padding: 14px var(--space-md); top: calc(var(--topbar-h) + 4px); }
  .station-title { font-size: 22px; margin: 2px 0; }
  .ticker { display: none; }
  .station-card .chips { margin-top: 10px; }
  .toggles { top: auto; right: auto; left: var(--gutter); bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); padding: 4px; }
  .toggles .tgl { height: 30px; font-size: 12px; padding: 0 4px 0 10px; }
  .map-ctrl { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); flex-direction: row; padding: 3px; }
  .map-ctrl button { width: 32px; height: 32px; }
  .map-ctrl .d-only, .map-ctrl hr { display: none; }
  .bottom-center, .legend { display: none; }
  .pop { left: var(--gutter); right: var(--gutter); top: auto; bottom: calc(var(--tabbar-h) + 60px + env(safe-area-inset-bottom)); width: auto; max-height: 62dvh; padding: 14px; }
  .pop:not(.is-expanded) .phases, .pop:not(.is-expanded) .crew-row { display: none; }
  .pop-grip { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line-3); margin: -4px auto 10px; }
  .pop-name { font-size: 22px; }
  .pop .step { margin-top: 10px; padding: 10px; }
  .pop .mw-btn { margin-top: 12px; height: 40px; }
  .station-fallback { padding-top: calc(var(--topbar-h) + 170px); padding-bottom: calc(var(--tabbar-h) + 24px); }
}
@media (min-width: 768px) { .pop-grip { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
}

/* Row delete buttons (Projects, Accounts): always visible, pinned to the right edge */
.cell-del { width: 1%; text-align: right; position: sticky; right: 0; background: var(--bg); z-index: 1; }
thead .cell-del, th:last-child:has(.sr-only) { position: sticky; right: 0; background: var(--bg); z-index: 1; }
.row-del { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--status-late-bg); border: 1px solid transparent; color: var(--status-late); cursor: pointer; flex: none; transition: filter var(--dur-fast), transform var(--dur-fast); }
.row-del svg { width: 16px; height: 16px; }
.row-del:hover, .row-del:focus-visible { filter: brightness(1.25); transform: scale(1.06); }
.row-card-top .row-add { margin-left: auto; }
.row-add { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(49, 168, 255, .14); border: 1px solid transparent; color: var(--accent, #31a8ff); cursor: pointer; flex: none; margin-right: 6px; transition: filter var(--dur-fast), transform var(--dur-fast); }
.row-add svg { width: 16px; height: 16px; }
.row-add:hover, .row-add:focus-visible { filter: brightness(1.25); transform: scale(1.06); }
.cell-del { white-space: nowrap; }
.card-delete { width: 100%; justify-content: center; margin-top: 8px; }

/* Official logo: white on dark (default), black on light */
.brand-logo { display: inline-flex; align-items: center; flex: none; height: 30px; }
.brand-logo .mw-logo { height: 100%; width: auto; display: block; }
.mw-logo--on-light { display: none !important; }
html[data-theme="light"] .mw-logo--on-dark { display: none !important; }
html[data-theme="light"] .mw-logo--on-light { display: block !important; }
.login .brand-logo, .login-card .brand-logo { height: 40px; }

/* Primary CTA = translucent glass pill, like the site's "Get your free website audit" (owner, 20 Oct) */
.mw-btn--primary { background: rgba(255, 255, 255, .07); color: #fff; border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.mw-btn--primary:hover { filter: none; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .5); }
.mw-btn--primary:active { background: rgba(255, 255, 255, .1); }
.mw-btn--primary svg { color: currentColor; }
html[data-theme="light"] .mw-btn--primary { background: rgba(10, 12, 23, .04); color: var(--text-1); border-color: rgba(10, 12, 23, .22); box-shadow: none; }
html[data-theme="light"] .mw-btn--primary:hover { background: rgba(10, 12, 23, .08); border-color: rgba(10, 12, 23, .4); }

/* Presence (20 Oct): green ring on online avatars; real status line on Team */
.av.is-online { box-shadow: 0 0 0 2px var(--mw-navy-850), 0 0 0 3.5px var(--status-launched); }
html[data-theme="light"] .av.is-online { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--status-launched); }
.status-dot.is-online { color: var(--status-launched); }
.status-dot.is-online::before { background: var(--status-launched); box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-launched) 60%, transparent); animation: mw-online 2s ease-out infinite; }
.status-dot.is-offline::before, .status-dot.is-never::before { background: var(--text-4); }
.status-dot.is-never { font-style: italic; }
@keyframes mw-online { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-launched) 55%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .status-dot.is-online::before { animation: none; } }
