/* MiloDeck — brand system derived from the Flow Software Solutions identity (black · gold · graphite). */
:root {
  --gold: #F5B800; --gold-strong: #D99E00; --gold-soft: rgba(245, 184, 0, .14); --gold-ink: #7A5A00;
  --ink: #0B0B0C;
  --bg: #F6F6F4; --surface: #FFFFFF; --surface-2: #FAFAF8; --surface-3: #F1F1EE; --hover: #F3F3F0;
  --border: #E6E6E1; --border-strong: #D6D6D0;
  --text: #151515; --text-2: #4A4A48; --muted: #7C7C78; --faint: #A5A5A0;
  --blue: #2F80ED; --green: #1F8A5B; --green-soft: rgba(31,138,91,.12); --red: #D93A3F; --red-soft: rgba(217,58,63,.10); --orange: #E07B24; --orange-soft: rgba(224,123,36,.12); --purple: #8E4EC6; --blue-soft: rgba(47,128,237,.10);
  --side-bg: #0D0D0F; --side-text: #B9B9BE; --side-hover: #1A1A1E; --side-active: #222226; --side-border: #1F1F23;
  --shadow-1: 0 1px 2px rgba(16,16,16,.05); --shadow-2: 0 6px 24px rgba(16,16,16,.08), 0 1px 3px rgba(16,16,16,.06); --shadow-3: 0 18px 60px rgba(0,0,0,.22);
  --radius: 10px; --radius-sm: 7px; --radius-lg: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', 'Inter', system-ui, sans-serif;
  --side-w: 236px; --top-h: 58px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0B0C; --surface: #141416; --surface-2: #18181B; --surface-3: #1E1E22; --hover: #1C1C20;
  --border: #26262B; --border-strong: #33333A;
  --text: #EDEDEE; --text-2: #C4C4C8; --muted: #8E8E95; --faint: #5E5E66;
  --gold-soft: rgba(245, 184, 0, .13); --gold-ink: #F5C842;
  --green-soft: rgba(48,164,108,.16); --red-soft: rgba(229,72,77,.15); --orange-soft: rgba(242,153,74,.15); --blue-soft: rgba(47,128,237,.16);
  --side-bg: #080809; --side-hover: #151518; --side-active: #1C1C20; --side-border: #18181B;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 28px rgba(0,0,0,.45); --shadow-3: 0 24px 70px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
::selection { background: var(--gold-soft); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.app.collapsed { --side-w: 64px; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; border-right: 1px solid var(--side-border); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; height: var(--top-h); }
.brand img { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 2px 7px rgba(245,184,0,.35)); }
.brand .wm { font-family: var(--font-display); font-weight: 900; letter-spacing: .06em; color: #fff; font-size: 15px; line-height: 1; white-space: nowrap; }
.brand .wm small { display: block; font-family: var(--font); font-weight: 600; letter-spacing: .13em; font-size: 8px; color: var(--gold); margin-top: 4px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; font-weight: 500; font-size: 13.5px; color: var(--side-text); position: relative; white-space: nowrap; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav a svg { flex: none; opacity: .9; }
.nav a.active svg { color: var(--gold); opacity: 1; }
.nav .count { margin-left: auto; background: var(--gold); color: #111; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.nav .sep { height: 1px; background: var(--side-border); margin: 10px 4px; }
.nav .label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6A6A70; padding: 10px 10px 4px; font-weight: 600; }
.side-foot { padding: 10px; border-top: 1px solid var(--side-border); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.side-user:hover { background: var(--side-hover); }
.side-user .nm { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .rl { font-size: 11px; color: #7C7C82; text-transform: capitalize; }
.collapse-btn { background: none; border: 0; color: #6A6A70; padding: 6px; border-radius: 6px; margin-left: auto; }
.collapse-btn:hover { color: #fff; background: var(--side-hover); }
.app.collapsed .brand .wm, .app.collapsed .nav a span, .app.collapsed .nav .count, .app.collapsed .nav .label, .app.collapsed .side-user .who { display: none; }
.app.collapsed .nav a { justify-content: center; padding: 9px; }
.app.collapsed .brand { justify-content: center; padding: 14px 8px; }
.app.collapsed .collapse-btn { margin: 0 auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 22px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.search-trigger { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; color: var(--muted); cursor: text; font-size: 13.5px; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd, kbd { margin-left: auto; font-family: var(--font); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.menu-btn { display: none; }
.content { padding: 24px 28px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 16px; background: var(--red-soft); color: var(--red); font-weight: 600; font-size: 12.5px; border: 0; }
.timer-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h2.sec, .sec-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 0; display: flex; align-items: center; gap: 8px; }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sec-head .more { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.sec-head .more:hover { color: var(--text); }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #26262A; }
:root[data-theme="dark"] .btn.primary { background: var(--gold); color: #111; border-color: var(--gold); }
:root[data-theme="dark"] .btn.primary:hover { background: #FFC927; }
.btn.gold { background: var(--gold); color: #111; border-color: var(--gold); }
.btn.gold:hover { background: #FFC61A; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.success { background: var(--green); color: #fff; border-color: var(--green); }
.btn.success:hover { filter: brightness(1.08); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 10px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.icon-btn { background: none; border: 0; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .badge { position: absolute; top: 4px; right: 3px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--bg); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .lbl { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s; font-size: 13.5px; }
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input.sm, .select.sm { height: 30px; font-size: 12.5px; }
.row { display: flex; gap: 12px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--gold-strong); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--gold-strong); }
.switch input:checked + span::after { transform: translateX(16px); }
input[type=range] { accent-color: var(--gold-strong); width: 100%; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 11px; border-radius: 6px; font-weight: 600; font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.panel.pad { padding: 18px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-body { padding: 14px 18px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.layout-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.layout-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 20px; overflow: hidden; }
.kpi { padding: 14px 16px; border-right: 1px solid var(--border); display: block; transition: background .12s; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi:hover { background: var(--hover); }
.kpi .v { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.alert .v { color: var(--red); }
.kpi.warn .v { color: var(--orange); }
.kpi.gold .v { color: var(--gold-strong); }
:root[data-theme="dark"] .kpi.gold .v { color: var(--gold); }
.kpi.good .v { color: var(--green); }

/* Brief */
.brief { position: relative; overflow: hidden; background: var(--ink); color: #E9E9EA; border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 20px; border: 1px solid #1d1d20; }
.brief::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(245,184,0,.28), transparent 65%); pointer-events: none; }
.brief .t { font-family: var(--font-display); font-weight: 900; letter-spacing: .08em; font-size: 13px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.brief ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.brief li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.5; color: #D6D6D8; }
.brief li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 2px; background: var(--gold); }
.brief .ai-text { white-space: pre-line; font-size: 14px; line-height: 1.6; margin-top: 10px; color: #E4E4E6; }
.brief .btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.brief .btn:hover { background: rgba(255,255,255,.12); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1; user-select: none; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .arrow { color: var(--gold-strong); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .group-row td { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); padding: 7px 12px; }
.tbl .title-cell { font-weight: 500; max-width: 420px; }
.tbl .title-cell .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.cell-btn { background: none; border: 0; padding: 3px 6px; margin: -3px -6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.cell-btn:hover { background: var(--hover); }

/* Pills & chips */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.pill .d { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.orange { background: var(--orange-soft); color: var(--orange); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; padding: 0 8px; height: 22px; border-radius: 11px; }
.health::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.health.on_track { color: var(--green); background: var(--green-soft); }
.health.attention { color: #B58900; background: var(--gold-soft); }
:root[data-theme="dark"] .health.attention { color: var(--gold); }
.health.at_risk { color: var(--orange); background: var(--orange-soft); }
.health.blocked { color: var(--red); background: var(--red-soft); }
.health.done, .health.paused { color: var(--muted); background: var(--surface-3); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.prio svg { flex: none; }
.due { font-size: 12.5px; white-space: nowrap; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.due.over { color: var(--red); font-weight: 600; }
.due.today { color: var(--orange); font-weight: 600; }
.due.soon { color: #B58900; }
:root[data-theme="dark"] .due.soon { color: var(--gold); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
.pbar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.pbar > i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.pbar.green > i { background: var(--green); }
.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.progress-cell .pbar { flex: 1; }
.progress-cell span { font-size: 12px; color: var(--muted); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* Avatars */
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; letter-spacing: .02em; user-select: none; box-shadow: 0 0 0 2px var(--surface); }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -7px; }
.person { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.person .ellipsis { font-size: 13px; }

/* Lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; }
.li.click:hover { background: var(--surface-2); }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold-strong); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.empty .t { color: var(--text); font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.empty.sm { padding: 18px; font-size: 13px; }
.status-dot-btn { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); background: none; flex: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.status-dot-btn:hover { border-color: var(--gold); }

/* Activity */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .msg { flex: 1; min-width: 0; line-height: 1.45; }
.feed-item .when { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.feed-item .proj { font-size: 11.5px; color: var(--muted); }

/* Workload */
.wl-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.wl-row:last-child { border-bottom: 0; }
.wl-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; position: relative; }
.wl-bar i { display: block; height: 100%; border-radius: 5px; }
.wl-bar::after { content: ''; position: absolute; left: 62.5%; top: -2px; bottom: -2px; width: 1px; background: var(--border-strong); }
.wl-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.load-light i { background: #8FC7A9; } .load-balanced i { background: var(--green); } .load-heavy i { background: var(--orange); } .load-overloaded i { background: var(--red); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; transition: border-color .12s, box-shadow .12s; display: block; min-width: 0; }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.proj-color { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* Stage stepper */
.stepper { display: flex; align-items: stretch; gap: 4px; margin: 4px 0 0; }
.step { flex: 1; min-width: 0; padding: 8px 10px 9px; border-radius: 8px; background: var(--surface-3); position: relative; }
.step .n { font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.step .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.step.done { background: var(--green-soft); } .step.done .n { color: var(--green); }
.step.active { background: var(--ink); } .step.active .n { color: var(--gold); } .step.active .s { color: #ddd; }
:root[data-theme="dark"] .step.active { background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(245,184,0,.35); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on { color: var(--text); border-bottom-color: var(--gold); }
.tabs .n { font-size: 11px; background: var(--surface-3); border-radius: 8px; padding: 0 6px; color: var(--text-2); }

/* Toolbar & filters */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.filter-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 7px; border: 1px dashed var(--border-strong); background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.filter-btn.set { border-style: solid; background: var(--gold-soft); border-color: rgba(245,184,0,.45); color: var(--gold-ink); }
.filter-btn:hover { border-color: var(--gold); }
.search-in { position: relative; }
.search-in svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-in .input { padding-left: 30px; height: 30px; font-size: 13px; width: 220px; }

/* Board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 280px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.col-head .n { color: var(--muted); font-weight: 600; font-size: 12px; }
.col-body { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; flex: 1; }
.col.drop { outline: 2px dashed var(--gold); outline-offset: -2px; background: var(--gold-soft); }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; cursor: grab; box-shadow: var(--shadow-1); transition: box-shadow .12s, border-color .12s; }
.tcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.tcard.dragging { opacity: .45; }
.tcard .ttl { font-weight: 550; font-size: 13.5px; line-height: 1.35; margin: 4px 0 8px; word-break: break-word; }
.tcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tcard .meta .grow { flex: 1; }
.tcard .proj { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tcard .flag { font-size: 11px; font-weight: 700; color: var(--red); }

/* Overlays */
.overlay { position: fixed; inset: 0; background: rgba(10,10,12,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-3); width: 100%; max-width: 560px; max-height: 84vh; display: flex; flex-direction: column; animation: rise .15s ease-out; }
.modal.lg { max-width: 820px; } .modal.xl { max-width: 1040px; } .modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; font-family: var(--font-display); }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; align-items: center; }
.modal-foot .left { margin-right: auto; }
.drawer-wrap { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: flex-end; background: rgba(10,10,12,.28); animation: fade .1s; }
.drawer { width: min(860px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide .16s ease-out; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border); min-height: 54px; }
.drawer-body { flex: 1; overflow-y: auto; }
.popover { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2); padding: 5px; min-width: 190px; max-width: 320px; max-height: 360px; overflow-y: auto; animation: rise .1s ease-out; }
.popover .pi { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border-radius: 7px; border: 0; background: none; text-align: left; font-size: 13px; color: var(--text); }
.popover .pi:hover, .popover .pi.hl { background: var(--hover); }
.popover .pi.on { font-weight: 600; }
.popover .pi.on::after { content: '✓'; margin-left: auto; color: var(--gold-strong); }
.popover .pi.danger { color: var(--red); }
.popover .ph { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 7px 9px 3px; }
.popover .psep { height: 1px; background: var(--border); margin: 4px 2px; }
.popover .psearch { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 8px 9px; outline: none; background: transparent; margin-bottom: 4px; font-size: 13px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 10px; animation: rise .15s; pointer-events: auto; max-width: 90vw; }
.toast.error { background: var(--red); }
.toast.success .ic { color: var(--gold); }
.toast a { color: var(--gold); font-weight: 600; }

/* Command palette */
.palette { max-width: 640px; }
.palette .pin { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette .pin input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; }
.palette .res { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette .grp { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; }
.palette .it { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; min-width: 0; }
.palette .it .s { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.palette .it.hl { background: var(--gold-soft); }
.palette .foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }

/* Task drawer internals */
.td-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; min-height: 100%; }
.td-main { padding: 18px 22px 40px; min-width: 0; }
.td-side { border-left: 1px solid var(--border); padding: 16px; background: var(--surface-2); }
.td-title { font-size: 21px; font-weight: 700; font-family: var(--font-display); line-height: 1.25; margin: 2px 0 10px; outline: none; border-radius: 6px; padding: 2px 4px; margin-left: -4px; word-break: break-word; }
.td-title[contenteditable="true"]:hover { background: var(--hover); }
.td-title[contenteditable="true"]:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--gold-soft); }
.prop { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 32px; font-size: 13px; }
.prop > .k { color: var(--muted); font-size: 12.5px; }
.prop > .val { min-width: 0; }
.prop .cell-btn { margin: 0 -6px; }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 11px 13px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.5; }
.banner .ic { flex: none; margin-top: 1px; }
.banner.gold { background: var(--gold-soft); color: var(--text); border: 1px solid rgba(245,184,0,.35); }
.banner.red { background: var(--red-soft); border: 1px solid rgba(217,58,63,.25); }
.banner.orange { background: var(--orange-soft); border: 1px solid rgba(224,123,36,.25); }
.banner.blue { background: var(--blue-soft); border: 1px solid rgba(47,128,237,.2); }
.banner.green { background: var(--green-soft); border: 1px solid rgba(31,138,91,.25); }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.review-box { border: 1px solid rgba(245,184,0,.45); background: var(--gold-soft); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.review-box .ttl { font-weight: 700; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.review-box .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.td-sec { margin-top: 22px; }
.td-sec > .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.td-sec > .hd h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 700; }
.td-sec > .hd .act { margin-left: auto; display: flex; gap: 4px; }
.desc { white-space: pre-wrap; line-height: 1.6; font-size: 14px; color: var(--text); border-radius: 8px; padding: 6px 8px; margin: 0 -8px; min-height: 36px; word-break: break-word; }
.desc.editable:hover { background: var(--hover); cursor: text; }
.desc a { color: var(--blue); text-decoration: underline; }
.cl-item { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 7px; margin: 0 -6px; }
.cl-item:hover { background: var(--hover); }
.cl-item.done .tx { text-decoration: line-through; color: var(--muted); }
.cl-item .tx { flex: 1; font-size: 13.5px; }
.cl-item .rm { opacity: 0; }
.cl-item:hover .rm { opacity: 1; }
.inline-add { display: flex; gap: 6px; margin-top: 6px; }
.inline-add .input { height: 32px; }
.dep { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.dep .grow { flex: 1; min-width: 0; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; background: var(--surface); min-width: 0; }
.att .ic { width: 30px; height: 30px; border-radius: 7px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-2); }
.att .ic.vault { background: var(--gold-soft); color: var(--gold-ink); }
.att .grow { flex: 1; min-width: 0; }
.att .nm { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.att .mt { font-size: 11.5px; color: var(--muted); }
.thumb { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex: none; }
.timeline-u { position: relative; padding-left: 22px; }
.timeline-u::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.u-item { position: relative; margin-bottom: 16px; }
.u-item::before { content: ''; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--surface); }
.u-item.ann::before { background: var(--ink); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--gold); }
.u-item .hd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.u-item .hd b { color: var(--text); font-weight: 600; }
.u-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; font-size: 13.5px; line-height: 1.55; }
.u-card .row2 { display: grid; grid-template-columns: 86px 1fr; gap: 8px; padding: 3px 0; }
.u-card .row2 .k { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.u-card .row2 .v { white-space: pre-wrap; word-break: break-word; }
.u-card .row2.blk .k { color: var(--red); }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .bd { flex: 1; min-width: 0; }
.comment .hd { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment .hd b { color: var(--text); }
.comment .tx { white-space: pre-wrap; word-break: break-word; margin-top: 3px; font-size: 13.5px; line-height: 1.55; }
.comment .tx .mention { color: var(--gold-ink); background: var(--gold-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.comment .ops { display: flex; gap: 4px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.comment .ops button.l { background: none; border: 0; font-size: 12px; color: var(--muted); padding: 2px 4px; border-radius: 5px; }
.comment .ops button.l:hover { color: var(--text); background: var(--hover); }
.react { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; }
.react.mine { border-color: rgba(245,184,0,.6); background: var(--gold-soft); }
.replies { margin-left: 34px; margin-top: 10px; }
.composer { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 8px; }
.composer:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.composer textarea { border: 0; outline: none; background: none; width: 100%; min-height: 54px; resize: vertical; padding: 4px 6px; font-size: 13.5px; line-height: 1.5; }
.composer .bar { display: flex; align-items: center; gap: 6px; }
.composer .bar .grow { flex: 1; }
.review-hist { border-left: 3px solid var(--border); padding: 6px 0 6px 12px; margin-bottom: 12px; }
.review-hist.approved { border-color: var(--green); }
.review-hist.revision { border-color: var(--orange); }
.review-hist.pending { border-color: var(--gold); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal .dow { padding: 8px 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal .day { min-height: 118px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.other { background: var(--surface-2); }
.cal .day.other .dn { color: var(--faint); }
.cal .dn { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; display: flex; align-items: center; justify-content: space-between; }
.cal .day.today .dn span { background: var(--gold); color: #111; border-radius: 10px; padding: 0 7px; }
.cal .ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: var(--surface-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--border-strong); font-weight: 500; }
.cal .ev:hover { filter: brightness(.96); }
.cal .ev.done { opacity: .5; text-decoration: line-through; }
.cal .ev.ms { background: var(--gold-soft); border-left-color: var(--gold); font-weight: 600; }
.cal .ev.launch { background: var(--ink); color: var(--gold); border-left-color: var(--gold); font-weight: 700; }
.cal .ev.over { background: var(--red-soft); border-left-color: var(--red); }
.cal.week .day { min-height: 60vh; }
.cal .more { font-size: 11px; color: var(--muted); padding: 0 4px; cursor: pointer; }

/* Timeline (gantt) */
.gantt { border: 1px solid var(--border); border-radius: 12px; overflow: auto; background: var(--surface); }
.gantt-inner { position: relative; min-width: 900px; }
.g-head { display: flex; position: sticky; top: 0; background: var(--surface-2); z-index: 2; border-bottom: 1px solid var(--border); }
.g-label { width: 260px; flex: none; padding: 7px 12px; font-size: 12.5px; border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface); position: sticky; left: 0; z-index: 1; }
.g-head .g-label { background: var(--surface-2); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.g-days { position: relative; flex: 1; }
.g-row { display: flex; border-bottom: 1px solid var(--border); min-height: 34px; }
.g-row.stage .g-label { font-weight: 700; background: var(--surface-2); }
.g-row.stage { background: var(--surface-2); }
.g-bar { position: absolute; top: 8px; height: 18px; border-radius: 5px; background: var(--gold); cursor: pointer; font-size: 11px; color: #111; padding: 0 6px; line-height: 18px; white-space: nowrap; overflow: hidden; font-weight: 600; min-width: 6px; }
.g-bar.done { background: var(--green); color: #fff; }
.g-bar.over { background: var(--red); color: #fff; }
.g-bar.blocked { background: repeating-linear-gradient(45deg, var(--red), var(--red) 6px, #f16b6f 6px, #f16b6f 12px); color: #fff; }
.g-ms { position: absolute; top: 9px; width: 14px; height: 14px; transform: rotate(45deg); background: var(--ink); border: 2px solid var(--gold); cursor: pointer; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1; opacity: .7; }
.g-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); font-size: 10.5px; color: var(--muted); padding: 7px 4px; white-space: nowrap; }

/* Charts */
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.chart-bars .grp { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.chart-bars .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart-bars .bar { width: 40%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.chart-bars .lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 140px 1fr 70px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 12px; background: var(--surface-3); border-radius: 6px; overflow: hidden; display: flex; }
.hbar .track i { display: block; height: 100%; }
.hbar .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12.5px; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-art { background: #0A0A0B; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ''; position: absolute; width: 720px; height: 720px; right: -260px; bottom: -300px; background: radial-gradient(circle, rgba(245,184,0,.22), transparent 62%); }
.auth-art .logo { display: flex; align-items: center; gap: 14px; position: relative; }
.auth-art .logo img { width: 66px; height: 66px; filter: drop-shadow(0 4px 14px rgba(245,184,0,.35)); }
.auth-art .logo .wm { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing: .06em; line-height: 1; }
.auth-art .logo .wm small { display: block; font-family: var(--font); font-size: 10px; letter-spacing: .2em; color: var(--gold); margin-top: 6px; font-weight: 600; }
.auth-art h2 { font-family: var(--font-display); font-size: 44px; line-height: 1.05; font-weight: 900; margin: 0 0 18px; letter-spacing: -.01em; position: relative; }
.auth-art h2 em { font-style: normal; color: var(--gold); }
.auth-art p { color: #A9A9AE; font-size: 15px; max-width: 460px; line-height: 1.6; position: relative; }
.auth-art .method { display: flex; gap: 8px; position: relative; flex-wrap: wrap; }
.auth-art .method span { font-family: var(--font-display); font-weight: 800; letter-spacing: .14em; font-size: 12px; padding: 8px 12px; border: 1px solid #2A2A2E; border-radius: 8px; color: #D8D8DA; }
.auth-art .method span:nth-child(odd) { color: var(--gold); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: var(--font-display); font-weight: 800; font-size: 26px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.auth-card .btn.lg { width: 100%; }
.auth-card .auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 20px; }
.auth-card .auth-back:hover { color: var(--text); }
.auth-card .alt { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-card .alt a { color: var(--text); font-weight: 600; }
.form-error { background: var(--red-soft); color: var(--red); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; font-weight: 500; }
.form-note { background: var(--gold-soft); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--hover) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.loading-page { display: flex; flex-direction: column; gap: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile bottom bar */
.mbar { display: none; }
.scrim { display: none; }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-right: 0; }
  .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--border); }
  .layout-2 { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
  .layout-2, .layout-2e, .layout-3 { grid-template-columns: minmax(0, 1fr); }
  .brief ul { grid-template-columns: 1fr; }
  .td-grid { grid-template-columns: 1fr; }
  .td-side { border-left: 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 262px; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 25; }
  .app.collapsed { --side-w: 236px; }
  .collapse-btn { display: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 6px; }
  .search-trigger kbd, .search-trigger .lbl-full { display: none; }
  .search-trigger { max-width: none; }
  .top-actions .hide-m { display: none; }
  .content { padding: 16px 16px 90px; }
  .page-head h1 { font-size: 21px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-right: 1px solid var(--border) !important; border-bottom: 1px solid var(--border); }
  .kpi:nth-child(2n) { border-right: 0 !important; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .wl-row { grid-template-columns: 1fr; gap: 6px; }
  .wl-stats { justify-content: flex-start; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; min-height: auto; }
  .auth-art h2 { font-size: 30px; margin-top: 24px; }
  .auth-art .method, .auth-art p { display: none; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 16px 16px 0 0; max-width: none !important; }
  .drawer { width: 100%; }
  .td-main { padding: 14px 16px 90px; }
  .td-side { grid-template-columns: 1fr; }
  /* Typing on a phone. 16px is the threshold below which mobile browsers zoom the page in the
     moment a field is focused, which is what makes a form feel like it is fighting you; the taller
     target is easier to hit with a thumb. */
  .input, .select, .textarea { font-size: 16px; height: 42px; }
  .input.sm, .select.sm { font-size: 16px; height: 36px; }
  .textarea { height: auto; }
  input, textarea, select { scroll-margin-bottom: 110px; scroll-margin-top: 80px; }
  /* While the on-screen keyboard is up, the fixed bar would sit on top of what you are typing. */
  body.kb .mbar, body.kb .milo-launcher { display: none; }
  .mbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px; background: var(--surface); border-top: 1px solid var(--border); z-index: 40; justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom); }
  .mbar a, .mbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); background: none; border: 0; position: relative; min-width: 56px; }
  .mbar a.active { color: var(--text); }
  .mbar a.active svg { color: var(--gold-strong); }
  .mbar .plus { width: 46px; height: 46px; border-radius: 14px; background: var(--ink); color: var(--gold); justify-content: center; margin-top: -18px; box-shadow: var(--shadow-2); }
  .mbar .badge { position: absolute; top: -4px; right: 12px; background: var(--red); color: #fff; font-size: 9.5px; border-radius: 8px; padding: 0 5px; }
  .tbl.responsive thead { display: none; }
  .tbl.responsive tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .tbl.responsive td { border: 0; padding: 0; }
  .tbl.responsive td.title-cell { grid-column: 1 / -1; max-width: none; }
  .tbl.responsive td.hide-m { display: none; }
  .tbl.responsive tr.group-row { display: block; }
  .search-in .input { width: 100%; }
  .search-in { flex: 1; }
  .col { flex-basis: 84vw; }
  .brief { padding: 16px; }
}
@media print { .sidebar, .topbar, .mbar { display: none; } .app { display: block; } }
/* Chart palette (validated: CVD-separated, lightness-banded per theme) */
:root { --chart-a: #3E63DD; --chart-b: #D99E00; }
:root[data-theme="dark"] { --chart-a: #4F74E0; --chart-b: #B58600; }
.chart-bars .bar { margin: 0 1px; }
.chart-bars .bar .val { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hbar .track i + i { margin-left: 2px; }
.bar-hit { cursor: default; }
.topbar .menu-btn { display: none; }
@media (max-width: 860px) { .topbar .menu-btn { display: inline-flex; } }
.td-side input[type=range] { width: 100%; min-width: 0; display: block; }
.ov-u .timeline-u::before { display: none; }

/* ---------- Hierarchy: bulk bar, lists board, checklists ---------- */
.bulk-bar { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; padding: 8px 10px 8px 16px; border-radius: 12px; box-shadow: var(--shadow-3); flex-wrap: wrap; max-width: calc(100vw - 24px); animation: rise .15s; }
.bulk-bar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.bulk-bar .btn:hover { background: rgba(255,255,255,.16); }
.bulk-bar .sep { width: 1px; height: 20px; background: rgba(255,255,255,.2); margin: 0 4px; }
.row-check { width: 16px; height: 16px; accent-color: var(--gold-strong); cursor: pointer; }
tr.selected td { background: var(--gold-soft) !important; }
.lists { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: 62vh; }
.list-col { flex: 0 0 290px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); transition: opacity .12s; }
.list-col.dragging { opacity: .4; }
.list-col.col-drop-before { box-shadow: -4px 0 0 var(--gold); }
.list-col.col-drop-after { box-shadow: 4px 0 0 var(--gold); }
.list-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 8px 12px; cursor: grab; }
.list-head .nm { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-head .n { color: var(--muted); font-size: 12px; font-weight: 600; }
.list-body { padding: 2px 8px 6px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 30px; flex: 1; }
.list-foot { padding: 4px 8px 10px; }
.add-card { width: 100%; justify-content: flex-start; color: var(--muted); background: transparent; border-color: transparent; }
.add-card:hover { background: var(--hover); color: var(--text); }
.add-list { flex: 0 0 270px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: transparent; height: 46px; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.add-list:hover { border-color: var(--gold); color: var(--text); }
.drop-line { height: 3px; border-radius: 2px; background: var(--gold); margin: -2px 2px; }
.tcard .bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.tcard .bar i { display: block; height: 100%; background: var(--gold); }
.tcard .upd { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); display: inline-block; }
.tcard .sel { position: absolute; top: 8px; right: 8px; display: none; }
.tcard { position: relative; }
.tcard:hover .sel, .tcard.picked .sel { display: block; }
.tcard.picked { box-shadow: 0 0 0 2px var(--gold); }
.cl-block { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 10px; margin-bottom: 10px; background: var(--surface); }
.cl-block.drag-over { border-color: var(--gold); background: var(--gold-soft); }
.cl-block.dragging { opacity: .45; }
.cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: grab; }
.cl-head .ttl { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; }
.cl-head .pc { font-size: 11.5px; color: var(--muted); }
.cl-item { cursor: grab; }
.cl-item.dragging { opacity: .4; }
.cl-item .meta { display: flex; gap: 6px; align-items: center; }
.cl-item .desc-line { font-size: 12px; color: var(--muted); }
.grip { color: var(--faint); cursor: grab; display: inline-flex; }
.sidebar .proj-link { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 14px; border-radius: 7px; font-size: 13px; color: var(--side-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .proj-link:hover { background: var(--side-hover); color: #fff; }
.sidebar .proj-link.active { background: var(--side-active); color: #fff; }
.sidebar .proj-link .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.app.collapsed .proj-link { display: none; }
.nav .label { display: flex; align-items: center; }
.nav .label button { margin-left: auto; background: none; border: 0; color: #6A6A70; padding: 0 4px; border-radius: 4px; }
.nav .label button:hover { color: #fff; }
.attn { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.attn:last-child { border-bottom: 0; }
.attn:hover { background: var(--surface-2); }
.attn .ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.attn .ico.red { background: var(--red-soft); color: var(--red); } .attn .ico.orange { background: var(--orange-soft); color: var(--orange); } .attn .ico.gold { background: var(--gold-soft); color: var(--gold-strong); }
.kpis.k8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
@media (max-width: 1280px) { .kpis.k8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.k8 .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--border); } .kpis.k8 .kpi:nth-child(4) { border-right: 0; } }
@media (max-width: 860px) { .kpis.k8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .list-col { flex-basis: 84vw; } .bulk-bar { bottom: 74px; } }

/* ================= Board-first UI (Trello-style layout, Flow black & gold) ================= */
.content.bleed { padding: 0; max-width: none; }
.tboard { --list-bg: rgba(255,255,255,.92); --list-ink: #17171A; --chrome: rgba(255,255,255,.14); --chrome-hover: rgba(255,255,255,.24);
  min-height: calc(100vh - var(--top-h)); display: flex; flex-direction: column; background: var(--board-grad, linear-gradient(150deg,#0C0C0F 0%,#17171C 55%,#2A2112 100%)); color: #fff; }
:root[data-theme="dark"] .tboard { --list-bg: rgba(20,20,23,.92); --list-ink: #EDEDEE; }
[data-bg="midnight"] { --board-grad: linear-gradient(150deg,#0C0C0F 0%,#17171C 55%,#2A2112 100%); }
[data-bg="gold"]     { --board-grad: linear-gradient(150deg,#2A2100 0%,#5A4500 55%,#8A6B00 100%); }
[data-bg="ocean"]    { --board-grad: linear-gradient(150deg,#06263A 0%,#0B4560 55%,#116A86 100%); }
[data-bg="forest"]   { --board-grad: linear-gradient(150deg,#082418 0%,#0E4A31 55%,#136B44 100%); }
[data-bg="plum"]     { --board-grad: linear-gradient(150deg,#200E2E 0%,#3E1955 55%,#5C2A78 100%); }
[data-bg="ember"]    { --board-grad: linear-gradient(150deg,#2E0D04 0%,#66230D 55%,#8F3A17 100%); }
[data-bg="slate"]    { --board-grad: linear-gradient(150deg,#14171A 0%,#2A3036 55%,#414A54 100%); }
[data-bg="sky"]      { --board-grad: linear-gradient(150deg,#0B2740 0%,#1C5480 55%,#2F7DB4 100%); }

/* --- board header bar --- */
.board-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(0,0,0,.28); backdrop-filter: blur(6px); flex-wrap: wrap; position: sticky; top: 0; z-index: 8; }
.board-bar h1 { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -.01em; color: #fff; padding: 4px 8px; border-radius: 7px; cursor: text; }
.board-bar h1:hover { background: var(--chrome); }
.board-bar .bb-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: var(--chrome); color: #fff; font-weight: 600; font-size: 13px; }
.board-bar .bb-btn:hover { background: var(--chrome-hover); }
.board-bar .bb-btn.on { background: #fff; color: #17171A; }
.board-bar .bb-btn.icon { width: 32px; padding: 0; justify-content: center; }
.board-bar .bb-btn.star.on { background: var(--gold); color: #111; }
.board-bar .chip { background: var(--chrome); color: #fff; border: 0; }
.board-bar .sep { width: 1px; height: 22px; background: rgba(255,255,255,.25); margin: 0 4px; }
.board-bar .right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.board-bar .views { display: flex; gap: 2px; background: rgba(0,0,0,.2); border-radius: 8px; padding: 2px; }
.board-bar .faces { display: flex; align-items: center; }
.board-bar .faces .av { margin-left: -6px; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.board-bar .faces .av:first-child { margin-left: 0; }

/* --- lists --- */
.board-canvas { flex: 1; display: flex; align-items: flex-start; gap: 10px; padding: 14px; overflow-x: auto; overflow-y: hidden; }
.tlist { flex: 0 0 286px; max-height: calc(100vh - var(--top-h) - 82px); background: var(--list-bg); color: var(--list-ink); border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tlist.dragging { opacity: .4; }
.tlist.col-drop-before { box-shadow: -4px 0 0 var(--gold), 0 1px 3px rgba(0,0,0,.25); }
.tlist.col-drop-after { box-shadow: 4px 0 0 var(--gold), 0 1px 3px rgba(0,0,0,.25); }
.tlist-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 6px 12px; cursor: grab; }
.tlist-head .nm { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 4px; border-radius: 5px; }
.tlist-head .nm:hover { background: rgba(0,0,0,.06); }
:root[data-theme="dark"] .tlist-head .nm:hover { background: rgba(255,255,255,.08); }
.tlist-head .n { font-size: 12px; font-weight: 600; opacity: .6; }
.tlist-head .icon-btn { width: 28px; height: 28px; color: inherit; }
.tlist-head input.rename { width: 100%; font: inherit; font-weight: 700; border: 2px solid var(--gold); border-radius: 6px; padding: 2px 6px; background: #fff; color: #17171A; }
.tlist-cards { padding: 0 8px 4px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 8px; flex: 1; }
.tlist-foot { padding: 6px 8px 8px; }
.tlist-foot .add-card { width: 100%; justify-content: flex-start; background: transparent; border: 0; color: inherit; opacity: .75; height: 32px; border-radius: 7px; }
.tlist-foot .add-card:hover { background: rgba(0,0,0,.07); opacity: 1; }
:root[data-theme="dark"] .tlist-foot .add-card:hover { background: rgba(255,255,255,.09); }
.tlist-add { flex: 0 0 286px; border: 0; border-radius: 12px; background: rgba(255,255,255,.18); color: #fff; height: 42px; font-weight: 600; display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 14px; backdrop-filter: blur(4px); }
.tlist-add:hover { background: rgba(255,255,255,.28); }
.tlist .composer { background: #fff; color: #17171A; border-radius: 9px; padding: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
:root[data-theme="dark"] .tlist .composer { background: #1B1B1F; color: #EDEDEE; }
.tlist .composer textarea { width: 100%; border: 0; resize: none; outline: none; background: transparent; font: inherit; min-height: 54px; }

/* --- cards on a board --- */
.tboard .tcard { background: #fff; color: #17171A; border: 0; border-radius: 9px; padding: 0; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.22); }
:root[data-theme="dark"] .tboard .tcard { background: #1B1B1F; color: #EDEDEE; }
.tboard .tcard:hover { box-shadow: 0 0 0 2px var(--gold); }
.tboard .tcard .pad { padding: 8px 10px 9px; }
.tboard .tcard .ttl { margin: 2px 0 6px; font-weight: 500; font-size: 13.5px; }
.card-cover { height: 32px; }
.lbls { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; }
/* Card labels are the coloured chips — scoped to [data-c] so they don't swallow `.lbl`, which is
   also the plain text label used for section headings ("Due today", "Notes", "Actions"). */
.lbl[data-c] { height: 16px; min-width: 40px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #fff; display: inline-flex; align-items: center; padding: 0 7px; letter-spacing: .01em; }
.lbl[data-c].lg { height: 32px; min-width: 56px; border-radius: 6px; font-size: 12.5px; }
.lbl[data-c="gold"], .card-cover[data-c="gold"] { background: #D99E00; }
.lbl[data-c="green"], .card-cover[data-c="green"] { background: #1F8A5B; }
.lbl[data-c="blue"], .card-cover[data-c="blue"] { background: #2F80ED; }
.lbl[data-c="purple"], .card-cover[data-c="purple"] { background: #8E4EC6; }
.lbl[data-c="orange"], .card-cover[data-c="orange"] { background: #E07B24; }
.lbl[data-c="red"], .card-cover[data-c="red"] { background: #D93A3F; }
.lbl[data-c="teal"], .card-cover[data-c="teal"] { background: #12A594; }
.lbl[data-c="pink"], .card-cover[data-c="pink"] { background: #D6409F; }
.lbl[data-c="grey"], .card-cover[data-c="grey"] { background: #6B6B72; }
.badges { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 11.5px; opacity: .8; }
.badges .b { display: inline-flex; align-items: center; gap: 4px; }
.badges .b.due { padding: 1px 6px; border-radius: 5px; }
.badges .b.due.soon { background: var(--gold-soft); color: var(--gold-ink); opacity: 1; }
.badges .b.due.late { background: var(--red-soft); color: var(--red); font-weight: 700; opacity: 1; }
.badges .b.done { background: var(--green-soft); color: var(--green); opacity: 1; }

/* --- board side menu --- */
.board-menu { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw; background: var(--surface); color: var(--text); border-left: 1px solid var(--border); box-shadow: var(--shadow-3); z-index: 60; display: flex; flex-direction: column; animation: slidein .16s ease; }
@keyframes slidein { from { transform: translateX(20px); opacity: .4; } }
.board-menu .hd { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.board-menu .bd { padding: 12px 14px 30px; overflow-y: auto; flex: 1; }
.bgpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bgpick button { height: 46px; border-radius: 8px; border: 2px solid transparent; }
.bgpick button.on { border-color: var(--gold); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatches button { height: 30px; border-radius: 6px; border: 2px solid transparent; }
.swatches button.on { border-color: var(--text); }

/* --- Trello-style card back --- */
.cardback .cb-cover { height: 110px; margin: -18px -18px 14px; border-radius: 14px 14px 0 0; }
.cardback .cb-head { display: flex; gap: 10px; align-items: flex-start; }
.cardback h2 { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin: 0 0 2px; line-height: 1.25; }
.cardback .in-list { color: var(--muted); font-size: 12.5px; }
.cardback .add-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.cardback .cb-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cardback .cb-grid .f .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
@media (max-width: 860px) {
  .board-canvas { padding: 10px; }
  .tlist, .tlist-add { flex-basis: 84vw; }
  .board-bar { padding: 8px 10px; }
  .board-bar .views { order: 3; width: 100%; overflow-x: auto; }
}
.nav .label.sm { font-size: 9.5px; padding: 8px 10px 2px; opacity: .8; }
.proj-link .star { margin-left: auto; color: var(--gold); display: flex; }
.app.collapsed .proj-link .star { display: none; }
.tlist-cards { overflow-x: hidden; }
.tboard .tcard { min-width: 0; max-width: 100%; }
.tboard .tcard .badges { row-gap: 4px; }
.tboard .tcard .chip { font-size: 10.5px; height: 18px; }

/* Card back — centred like a Trello card, not a side drawer */
.drawer-wrap { justify-content: center; align-items: center; padding: 34px 16px; overflow: hidden; background: rgba(10,10,12,.5); }
.drawer { width: min(860px, 100%); height: auto; max-height: calc(100vh - 80px); border: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 14px; overflow: hidden; animation: cbin .14s ease-out; }
@keyframes cbin { from { transform: translateY(10px); opacity: .5; } }
.drawer-head { background: var(--surface-2); }
.add-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.add-row .btn { background: var(--surface-3); border-color: transparent; }
.add-row .btn:hover { background: var(--hover); border-color: var(--border); }
.cell-btn .lbl[data-c] { margin-right: 4px; }
@media (max-width: 860px) {
  .drawer-wrap { padding: 0; }
  .drawer { width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
}

/* Board tiles (the "Boards" page) */
.btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.bgsw { display: block; height: 100%; border-radius: 6px; background: var(--board-grad, #1a1a1f); }
.btile { position: relative; min-height: 116px; border-radius: 12px; padding: 12px 14px; color: #fff; display: flex; flex-direction: column; background: var(--board-grad, #1a1a1f); box-shadow: var(--shadow-1); overflow: hidden; border: 0; text-align: left; }
.btile:hover { filter: brightness(1.12); }
.btile .nm { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; line-height: 1.25; padding-right: 26px; }
.btile .sub { font-size: 12px; opacity: .8; margin-top: 2px; }
.btile .foot { margin-top: auto; display: flex; gap: 10px; align-items: center; font-size: 12px; opacity: .92; }
.btile .foot .late { color: #FFB4B4; font-weight: 700; }
.btile .foot .pct { font-weight: 700; }
.btile .star { position: absolute; top: 8px; right: 8px; background: none; border: 0; color: rgba(255,255,255,.55); padding: 4px; border-radius: 6px; }
.btile .star:hover { color: #fff; background: rgba(255,255,255,.18); }
.btile .star.on { color: var(--gold); }
.btile.new { background: var(--surface-3); color: var(--text-2); font-weight: 600; align-items: center; justify-content: center; flex-direction: row; gap: 8px; min-height: 116px; }
.btile.new:hover { background: var(--hover); filter: none; }
/* Board bar on the other board views (table, timeline, files…) */
.tboard.flat { min-height: 0; border-radius: 0; margin: -24px -28px 0; }
.tboard.flat .board-bar { position: static; }
@media (max-width: 860px) { .tboard.flat { margin: -16px -12px 0; } }

/* Quick-edit pencil, collapsed lists, card limits */
.tboard .tcard { position: relative; }
.quick-edit { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: rgba(255,255,255,.9); color: #4A4A48; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .quick-edit { background: rgba(30,30,34,.95); color: #C4C4C8; }
.tcard:hover .quick-edit { display: inline-flex; }
.quick-edit:hover { background: var(--gold); color: #111; }
.tlist-head .n.over { color: var(--red); font-weight: 800; }
.tlist-head .fold { width: 24px; height: 24px; opacity: .6; }
.tlist-head .fold:hover { opacity: 1; }
.tlist.folded { flex-basis: 52px; }
.tlist.folded .tlist-cards, .tlist.folded .tlist-foot, .tlist.folded [data-addtop], .tlist.folded [data-listmenu] { display: none; }
.tlist.folded .tlist-head { flex-direction: column; height: 220px; gap: 10px; padding: 10px 6px; }
.tlist.folded .tlist-head .nm { writing-mode: vertical-rl; text-align: left; max-height: 160px; }
.top-composer { padding: 6px 0 2px; }
.cb-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cb-actions .btn { justify-content: flex-start; }
/* On a board the select box sits top-left so it never collides with the quick-edit pencil */
.tboard .tcard .row-check.sel { position: absolute; top: 7px; left: 7px; opacity: 0; transition: opacity .12s; z-index: 2; }
.tboard .tcard:hover .row-check.sel, .tboard .tcard.picked .row-check.sel { opacity: 1; }
.tboard .tcard.picked { box-shadow: 0 0 0 2px var(--gold); }
.tboard .tcard:hover .pad { padding-left: 26px; }
.tboard .tcard.picked .pad { padding-left: 26px; }
.cal .ev.booking { background: var(--gold-soft); color: var(--gold-ink); font-weight: 600; }

/* ---------- Public booking pages ---------- */
.book-wrap { min-height: 100vh; background: linear-gradient(150deg, #0C0C0F 0%, #17171C 55%, #2A2112 100%); padding: 40px 16px 24px; display: flex; flex-direction: column; align-items: center; }
.book-card { width: min(940px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-3); padding: 26px 28px; }
.book-foot { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.6); font-size: 12px; margin-top: 16px; }
.book-foot img { opacity: .9; }
.book-host { display: flex; gap: 14px; align-items: flex-start; }
.book-host .who { font-family: var(--font-display); font-weight: 800; font-size: 19px; }
.book-types { display: flex; flex-direction: column; gap: 8px; }
.book-type { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.book-type:hover { border-color: var(--gold); background: var(--hover); }
.book-type .dot { width: 8px; min-width: 8px; height: 38px; border-radius: 4px; }
.book-grid { display: grid; grid-template-columns: 280px 1fr; gap: 26px; }
.book-side { border-right: 1px solid var(--border); padding-right: 22px; }
.book-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.book-cal .dw { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; padding-bottom: 4px; }
.book-cal .d { height: 38px; border-radius: 9px; border: 0; background: var(--surface-3); font-weight: 600; font-size: 13.5px; }
.book-cal .d.free { background: var(--gold-soft); color: var(--gold-ink); }
.book-cal .d.free:hover { background: var(--gold); color: #111; }
.book-cal .d.none { opacity: .35; cursor: not-allowed; }
.book-cal .d.on { background: var(--ink); color: #fff; }
.book-slots { margin-top: 18px; max-height: 320px; overflow-y: auto; }
.book-slots .slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.book-slots .slot { height: 40px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 13.5px; }
.book-slots .slot:hover { border-color: var(--gold); background: var(--gold-soft); }
.book-tick { width: 62px; height: 62px; margin: 0 auto; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
@media (max-width: 760px) {
  .book-grid { grid-template-columns: 1fr; }
  .book-side { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; }
  .book-card { padding: 18px 16px; }
}

/* ---------- Calendar (day / week grid) ---------- */
.cal-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; margin: 0 0 10px; }
.cal-grid { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: auto; max-height: calc(100vh - 230px); }
.cal-gutter { flex: 0 0 62px; border-right: 1px solid var(--border); background: var(--surface-2); position: sticky; left: 0; z-index: 3; }
.cal-gutter .cal-colhead { background: var(--surface-2); }
.cal-gutter .h { height: var(--hour); position: relative; }
.cal-gutter .h span { position: absolute; top: -7px; right: 8px; font-size: 11px; color: var(--muted); }
.cal-col { flex: 1 1 0; min-width: 150px; border-right: 1px solid var(--border); }
.cal-col:last-child { border-right: 0; }
.cal-col.today { background: color-mix(in srgb, var(--gold-soft) 45%, transparent); }
.cal-colhead { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; font-size: 13px; }
.cal-colhead .n { background: var(--gold); color: #111; border-radius: 10px; padding: 0 7px; font-weight: 700; }
.cal-allday { height: 46px; padding: 4px 6px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.cal-due { font-size: 11.5px; display: flex; align-items: center; gap: 5px; padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-due i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.cal-due.over { background: var(--red-soft); color: var(--red); font-weight: 600; }
.cal-due.launch { background: var(--gold-soft); color: var(--gold-ink); font-weight: 600; }
.cal-due.ms { background: var(--blue-soft); color: var(--blue); }
.cal-body { position: relative; }
.cal-body .slot { height: var(--hour); border-bottom: 1px dashed var(--border); cursor: copy; }
.cal-body .slot:hover { background: var(--hover); }
.cal-body .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 4; }
.cal-body .now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.cal-ev { position: absolute; left: 4px; right: 6px; border-radius: 7px; padding: 4px 7px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; color: #fff; z-index: 2; box-shadow: var(--shadow-1); }
.cal-ev b { font-weight: 700; margin-right: 4px; }
.cal-ev .s { display: block; opacity: .85; font-size: 11px; }
.cal-ev.dragging { opacity: .45; }
.c-gold { background: #D99E00; } .c-green { background: #1F8A5B; } .c-blue { background: #2F80ED; }
.c-purple { background: #8E4EC6; } .c-orange { background: #E07B24; } .c-red { background: #D93A3F; }
.c-teal { background: #12A594; } .c-pink { background: #D6409F; } .c-grey { background: #6B6B72; }
.agenda-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; }
.agenda-row:hover { color: var(--gold-ink); }
.agenda-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cal.month .dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal.month .dow span { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; }
.cal.month .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal.month .cell { min-height: 108px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; cursor: pointer; }
.cal.month .cell.dim { opacity: .5; }
.cal.month .cell.today { border-color: var(--gold); }
.cal.month .cell .d { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal.month .ev { font-size: 11px; border-radius: 4px; padding: 1px 5px; margin-bottom: 2px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal.month .ev.due { background: var(--surface-3); color: var(--text-2); }
.cal.month .ev.due.over { background: var(--red-soft); color: var(--red); }
.cal.month .more { font-size: 10.5px; color: var(--muted); }
@media (max-width: 860px) {
  .cal-grid { max-height: none; }
  .cal-col { min-width: 82vw; }
  .cal.month .cell { min-height: 76px; }
}

/* ---------- Today ---------- */
.today-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.today-head h1 { font-family: var(--font-display); font-size: 27px; font-weight: 800; margin: 4px 0 2px; }
.today-head .sub { color: var(--text-2); font-size: 14px; }
.today-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.timeline { padding: 4px 0 2px; }
.tl-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.tl-row:last-child { border-bottom: 0; }
.tl-row.past { opacity: .5; }
.tl-row .t { width: 72px; flex: none; font-weight: 700; font-size: 13px; color: var(--text-2); }
.tl-row .bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.tl-row .ttl { font-weight: 600; font-size: 14px; }
.tl-row .s { font-size: 12px; color: var(--muted); }

/* ---------- Workspace switcher (sidebar) ---------- */
.wsw { display: flex; align-items: center; gap: 8px; width: calc(100% - 24px); margin: 0 12px 10px; padding: 8px 10px; background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; color: rgba(255, 255, 255, .92); cursor: pointer; text-align: left; font: inherit; }
.wsw:hover { background: rgba(245, 184, 0, .10); border-color: rgba(245, 184, 0, .35); }
.wsw .nm { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.wsw .rl { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: rgba(255, 255, 255, .55); white-space: nowrap; }
.app.collapsed .wsw svg { margin: 0; }
.wsw svg { flex: none; opacity: .55; color: rgba(255, 255, 255, .9); }
.app.collapsed .wsw { width: 40px; margin: 0 auto 10px; justify-content: center; padding: 8px 0; }
.app.collapsed .wsw .nm, .app.collapsed .wsw .rl { display: none; }

/* ---------- Email confirmation reminder ---------- */
.verify-bar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13px; background: rgba(245, 184, 0, .12);
  border-bottom: 1px solid rgba(245, 184, 0, .35); color: var(--text); }
.verify-bar svg { flex: none; color: var(--gold); }
.verify-bar span { flex: 1; min-width: 0; }
@media (max-width: 720px) { .verify-bar { font-size: 12px; padding: 8px 12px; } }

/* ---------- Plain text button (auth screens) ---------- */
.btn-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { color: var(--gold); }

/* ---------- Key/value grid (workspace summary) ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-bottom: 12px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-child(even) { font-weight: 600; text-align: right; }

/* ═══════════════ Daily chores ═══════════════ */
.chore-row.is-done .t { text-decoration: line-through; opacity: .55; }
.chore-tick { width: 24px; height: 24px; min-width: 24px; border-radius: 7px; border: 2px solid var(--border-strong, var(--border)); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; transition: background .15s, border-color .15s, transform .12s; }
.chore-tick:hover { border-color: var(--gold-strong); transform: scale(1.06); }
.chore-tick.on { background: var(--green); border-color: var(--green); }
.daypick input:checked + span { background: var(--gold-strong); color: #15100A; border-color: transparent; }
.daypick span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 30px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; user-select: none; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.kpi .n { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.kpi .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chore-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.chore-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chore-chart .bars { position: relative; width: 100%; max-width: 34px; flex: 1; display: flex; align-items: flex-end; }
.chore-chart .due { position: absolute; inset: auto 0 0; background: var(--border); border-radius: 5px 5px 0 0; }
.chore-chart .done { position: absolute; inset: auto 0 0; background: linear-gradient(180deg, var(--gold), var(--gold-strong)); border-radius: 5px 5px 0 0; }
.chore-chart .d { font-size: 10.5px; color: var(--muted); }

/* ═══════════════ Milo — the assistant conversation ═══════════════ */
.mi { display: grid; grid-template-columns: 260px 1fr; gap: 18px; height: calc(100vh - var(--top-h) - 36px); min-height: 520px; }
.mi-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.mi-threads { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.mi-th { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.mi-th:hover { background: var(--surface-2); }
.mi-th.on { background: var(--surface-2); border-color: var(--border); }
.mi-th .t { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-th .s { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mi-th .icon-btn { opacity: 0; width: 24px; height: 24px; }
.mi-th:hover .icon-btn { opacity: 1; }
.mi-note { display: flex; gap: 9px; font-size: 11.5px; line-height: 1.5; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 11px; }
.mi-note svg { flex: none; color: var(--gold-strong); margin-top: 1px; }

.mi-main { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.mi-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.mi-head h1 { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 20px; margin: 0; }
.mi-head h1 svg { color: var(--gold-strong); }
.mi-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.mi-stream { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }

.mi-msg { max-width: 760px; }
.mi-msg.me { align-self: flex-end; }
.mi-msg.me .b { background: var(--gold-strong); color: #15100A; border-radius: 14px 14px 4px 14px; padding: 10px 14px; font-size: 14.5px; line-height: 1.55; font-weight: 500; }
.mi-msg.milo .who { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.mi-msg.milo .who svg { color: var(--gold-strong); }
.mi-msg.milo .b { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 12px 15px; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }

.mi-plan { margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); }
.mi-plan .hd { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.mi-plan .hd svg { color: var(--gold-strong); }
.mi-act { display: flex; gap: 11px; align-items: flex-start; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 7px; cursor: pointer; }
.mi-act:hover { border-color: var(--gold-strong); }
.mi-act input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--gold-strong); flex: none; }
.mi-act .body { flex: 1; min-width: 0; }
.mi-act .s { display: block; font-size: 14px; line-height: 1.45; }
.mi-act .meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.mi-act .meta .ty { text-transform: capitalize; }
.mi-act.risk-low .r { color: var(--green); }
.mi-act.risk-medium .r { color: var(--gold-strong); }
.mi-act.risk-high { border-color: rgba(217, 58, 63, .45); }
.mi-act.risk-high .r { color: var(--red); }
.mi-plan .acts { display: flex; gap: 8px; margin-top: 10px; }
.mi-done { margin-top: 9px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.mi-done .ok, .mi-done .no { display: flex; align-items: center; gap: 7px; }
.mi-done .ok { color: var(--green); }
.mi-done .no { color: var(--red); }

.mi-welcome { margin: auto; text-align: center; max-width: 560px; padding: 20px; }
.mi-welcome .ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 16px;
  background: linear-gradient(140deg, rgba(245,184,0,.22), rgba(245,184,0,.06)); border: 1px solid rgba(245,184,0,.3); color: var(--gold-strong); }
.mi-welcome h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 8px; }
.mi-welcome p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; }
.mi-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mi-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s, transform .15s; }
.mi-chip:hover { border-color: var(--gold-strong); transform: translateY(-1px); }
.mi-chip svg { color: var(--gold-strong); }

.mi-compose { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.mi-compose textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 14.5px;
  background: var(--surface); color: var(--text); max-height: 160px; line-height: 1.5; }
.mi-compose textarea:focus { outline: none; border-color: var(--gold-strong); box-shadow: 0 0 0 3px rgba(245, 184, 0, .18); }

@media (max-width: 1000px) {
  .mi { grid-template-columns: 1fr; height: auto; }
  .mi-side { order: 2; }
  .mi-threads { max-height: 220px; }
  .mi-main { min-height: 70vh; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════ Little Milo — the assistant's character ═══════════════ */
.lm { width: var(--lm-size, 96px); height: var(--lm-size, 96px); position: relative; flex: none; user-select: none; }
.lm-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.lm .lm-body { transform-origin: 60px 100px; animation: lm-bob 4.2s ease-in-out infinite; }
.lm .lm-glow { opacity: .35; transition: opacity .3s; }
.lm .lm-pupil { transform: translate(var(--lm-eye-x, 0), var(--lm-eye-y, 0)); transition: transform .25s ease-out; }
.lm .lm-lids { transform: translateY(-26px); transition: transform .09s ease-in; }
.lm .lm-mouth, .lm .lm-dots, .lm .lm-zzz, .lm .lm-rings { opacity: 0; }
.lm .lm-bulb { animation: lm-bulb 3.4s ease-in-out infinite; transform-origin: 60px 9px; }
@keyframes lm-bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-4px) } }
@keyframes lm-bulb { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }

/* blink */
.lm.lm-blink .lm-lids { transform: translateY(0); }

/* listening — rings out, antenna bright, a slight lean in */
.lm-listening .lm-rings { opacity: 1; }
.lm-listening .lm-rings circle { transform-origin: 60px 62px; animation: lm-ring 1.9s ease-out infinite; }
.lm-listening .lm-rings circle:nth-child(2) { animation-delay: .95s; }
.lm-listening .lm-bulb { animation: lm-bulb-fast .7s ease-in-out infinite; }
.lm-listening .lm-body { animation: lm-lean 2.6s ease-in-out infinite; }
.lm-listening .lm-glow { opacity: .8; }
@keyframes lm-ring { 0% { transform: scale(.55); opacity: .75 } 100% { transform: scale(1.12); opacity: 0 } }
@keyframes lm-bulb-fast { 0%, 100% { opacity: .5; r: 5 } 50% { opacity: 1; r: 6 } }
@keyframes lm-lean { 0%, 100% { transform: rotate(-1.5deg) translateY(-1px) } 50% { transform: rotate(1.5deg) translateY(-4px) } }

/* thinking — three dots, eyes up */
.lm-thinking .lm-smile { opacity: 0; }
.lm-thinking .lm-dots { opacity: 1; }
.lm-thinking .lm-dots circle { animation: lm-dot 1.05s ease-in-out infinite; }
.lm-thinking .lm-dots circle:nth-child(2) { animation-delay: .14s; }
.lm-thinking .lm-dots circle:nth-child(3) { animation-delay: .28s; }
.lm-thinking .lm-pupil { transform: translate(0, -2.5px); }
@keyframes lm-dot { 0%, 100% { transform: translateY(0); opacity: .45 } 50% { transform: translateY(-4px); opacity: 1 } }

/* talking — the mouth works while a reply is read out */
.lm-talking .lm-smile { opacity: 0; }
.lm-talking .lm-mouth { opacity: 1; transform-origin: 60px 77px; animation: lm-talk .28s ease-in-out infinite alternate; }
@keyframes lm-talk { from { transform: scaleY(.35) } to { transform: scaleY(1) } }

/* happy — a hop after something is applied */
.lm-happy .lm-body { animation: lm-hop .6s ease-in-out 2; }
.lm-happy .lm-smile { stroke-width: 5; }
@keyframes lm-hop { 0%, 100% { transform: translateY(0) } 35% { transform: translateY(-9px) } 60% { transform: translateY(0) } }

/* sleeping */
.lm-sleeping .lm-lids { transform: translateY(0); }
.lm-sleeping .lm-zzz { opacity: 1; animation: lm-zzz 3s ease-in-out infinite; }
.lm-sleeping .lm-body { animation: lm-bob 6s ease-in-out infinite; }
.lm-sleeping .lm-glow { opacity: .15; }
@keyframes lm-zzz { 0%, 100% { transform: translateY(0); opacity: .4 } 50% { transform: translateY(-5px); opacity: .9 } }

@media (prefers-reduced-motion: reduce) {
  .lm .lm-body, .lm .lm-bulb, .lm .lm-rings circle, .lm .lm-dots circle, .lm .lm-mouth, .lm .lm-zzz { animation: none !important; }
}

/* ── Milo's greeting card ── */
.lm-hello { display: flex; align-items: center; gap: 16px; }
.lm-hello .bubble { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px; font-size: 14.5px; line-height: 1.55; }
.lm-hello .bubble::before { content: ''; position: absolute; left: -7px; top: 22px; width: 12px; height: 12px; background: var(--surface-2);
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.lm-hello .bubble b { color: var(--gold-strong); }
.lm-hello .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ── Dictation ── */
.mic-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: all .18s; position: relative; }
.mic-btn:hover { border-color: var(--gold-strong); color: var(--gold-strong); }
.mic-btn[disabled] { opacity: .45; cursor: not-allowed; }
.mic-btn.on { background: var(--red); border-color: var(--red); color: #fff; }
.mic-btn.on::after { content: ''; position: absolute; inset: -5px; border-radius: 15px; border: 2px solid var(--red); opacity: .6; animation: mic-pulse 1.5s ease-out infinite; }
@keyframes mic-pulse { 0% { transform: scale(.9); opacity: .7 } 100% { transform: scale(1.25); opacity: 0 } }
.mi-listening { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--border); background: rgba(217, 58, 63, .07); font-size: 13px; }
.mi-listening .wave { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.mi-listening .wave i { width: 3px; background: var(--red); border-radius: 2px; animation: wave 1s ease-in-out infinite; }
.mi-listening .wave i:nth-child(1) { height: 7px; animation-delay: 0s }
.mi-listening .wave i:nth-child(2) { height: 14px; animation-delay: .12s }
.mi-listening .wave i:nth-child(3) { height: 10px; animation-delay: .24s }
.mi-listening .wave i:nth-child(4) { height: 16px; animation-delay: .36s }
.mi-listening .wave i:nth-child(5) { height: 8px; animation-delay: .48s }
@keyframes wave { 0%, 100% { transform: scaleY(.4) } 50% { transform: scaleY(1) } }
.mi-compose textarea.dictating { border-color: var(--red); box-shadow: 0 0 0 3px rgba(217, 58, 63, .15); }
.interim { opacity: .6; font-style: italic; }

/* ── the floating helper ── */
.lm-launch { position: fixed; right: 22px; bottom: 22px; z-index: 45; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .45);
  cursor: pointer; font: inherit; font-weight: 650; font-size: 13.5px; color: var(--text); transition: transform .2s, box-shadow .2s; }
.lm-launch:hover { transform: translateY(-2px); box-shadow: 0 20px 50px -14px rgba(0, 0, 0, .55); }
.lm-launch .lm { --lm-size: 36px; }
@media (max-width: 860px) { .lm-launch { bottom: 76px; right: 14px; padding: 8px; } .lm-launch span { display: none; } }

/* ── speak toggle on a reply ── */
.mi-speak { opacity: 0; width: 26px; height: 26px; }
.mi-msg.milo:hover .mi-speak, .mi-speak.on { opacity: 1; }
.mi-speak.on { color: var(--gold-strong); }
.mi-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 16px 12px; border-top: 1px solid transparent; font-size: 11.5px; line-height: 1.5; }
.mi-foot svg { flex: none; color: var(--gold-strong); }
.mi-foot .check { gap: 5px; }
.check.tiny { font-size: 11.5px; }
.check.tiny input { width: 13px; height: 13px; accent-color: var(--gold-strong); }
.lm-quick { display: flex; flex-direction: column; gap: 12px; }
.lm-quick .row1 { display: flex; gap: 14px; align-items: flex-start; }
.lm-quick textarea { width: 100%; min-height: 86px; resize: vertical; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  font: inherit; font-size: 14.5px; background: var(--surface); color: var(--text); line-height: 1.5; }
.lm-quick textarea:focus { outline: none; border-color: var(--gold-strong); box-shadow: 0 0 0 3px rgba(245, 184, 0, .18); }
.lm-quick .tools { display: flex; align-items: center; gap: 10px; }
.lm-quick .hint { font-size: 11.5px; color: var(--muted); flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   Onboarding and the AI workforce
   ═══════════════════════════════════════════════════════════════════════════ */
.ob { max-width: 920px; margin: 0 auto; padding: 8px 0 60px; }
.ob-head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.ob-head img { border-radius: 9px; }
.ob-head b { display: block; font-size: 15px; letter-spacing: .02em; }
.ob-head span { display: block; font-size: 12.5px; color: var(--muted); }
.ob-steps { display: flex; gap: 8px; margin-bottom: 30px; }
.ob-step { flex: 1; display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: var(--surface); }
.ob-step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-2); color: var(--muted); flex: none; }
.ob-step.on { border-color: var(--gold); color: var(--text); box-shadow: 0 0 0 3px var(--gold-soft); }
.ob-step.on .n { background: var(--gold); color: #1A1407; }
.ob-step.done .n { background: var(--green, #1F8A5B); color: #fff; }
.ob h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -.02em; }
.ob-lead { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 24px; max-width: 70ch; }
.ob-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ob-card { text-align: left; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; display: block; }
.ob-card:hover { transform: translateY(-2px); border-color: var(--gold-soft); }
.ob-card.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.ob-card .ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-strong); margin-bottom: 11px; }
.ob-card b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.ob-card small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.ob-card .boards { display: block; margin-top: 9px; font-size: 11px; color: var(--faint, var(--muted)); opacity: .75; }
.ob-form { display: grid; gap: 16px; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ob-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; cursor: pointer; color: var(--muted); }
.ob-chip.on { border-color: var(--gold); background: var(--gold-soft); color: var(--text); font-weight: 600; }
.ob-tones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ob-tone { text-align: left; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; }
.ob-tone.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.ob-tone b { display: block; font-size: 13.5px; }
.ob-tone small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ob-roster { display: grid; gap: 10px; }
.ob-emp { display: flex; gap: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.ob-emp .av { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); flex: none; }
.ob-emp .tx { flex: 1; min-width: 0; }
.ob-emp .tx b { font-size: 14.5px; }
.ob-emp .role { font-size: 12px; color: var(--muted); margin-left: 8px; }
.ob-emp .tx p { margin: 5px 0 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.ob-emp ul { list-style: none; margin: 9px 0 0; padding: 0; display: grid; gap: 4px; }
.ob-emp li { font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.ob-emp li svg { color: var(--gold-strong); flex: none; }
.ob-emp .pill { align-self: flex-start; }
.ob-note { display: flex; gap: 11px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--gold-soft); border-radius: 12px; background: var(--gold-soft); font-size: 13px; line-height: 1.55; }
.ob-note svg { color: var(--gold-strong); flex: none; margin-top: 2px; }
.ob-foot { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }

.wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.wf-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 16px; display: flex; flex-direction: column; transition: border-color .18s, transform .18s; }
.wf-card:hover { transform: translateY(-2px); border-color: var(--gold-soft); }
.wf-card.off { opacity: .55; }
.wf-top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.wf-av { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); flex: none; }
.wf-av.sm { width: 28px; height: 28px; border-radius: 8px; }
.wf-top b { display: block; font-size: 15px; }
.wf-role { display: block; font-size: 12px; color: var(--muted); }
.wf-sum { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.wf-does { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 5px; }
.wf-does li { display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--muted); }
.wf-does svg { color: var(--gold-strong); flex: none; }
.wf-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.wf-foot .pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.wf-foot .pill svg { color: var(--gold-strong); }

@media (max-width: 860px) {
  .ob-grid, .ob-tones { grid-template-columns: 1fr 1fr; }
  .ob-steps { gap: 5px; }
  .ob-step span:last-child { display: none; }
  .ob-step { justify-content: center; }
}
@media (max-width: 560px) {
  .ob-grid, .ob-tones { grid-template-columns: 1fr; }
  .wf-grid { grid-template-columns: 1fr; }
}
