/* Wingmen console — sibling of the KLEO Operating Desk (planner.kleogrp.com).
   Palette + type matched to the planner's live tokens: Inter, warm glass,
   clay accent. Light + dark. */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800&family=Barlow+Condensed:wght@600;700&family=IBM+Plex+Mono:wght@500;600&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  /* palette — light (default): cool neutral gray + KLEO clay accent */
  --bg-1: #eceff3;
  --bg-2: #f8f9fb;
  --ink: #11151c;
  --muted: #5d6674;
  --faint: #8d96a4;
  --primary: #e66f4b;
  --primary-ink: #ffffff;
  --accent: #e66f4b;
  --danger: #bf3434;
  --success: #23845a;
  --glass: rgba(250, 251, 253, 0.92);
  --glass-strong: #ffffff;
  --glass-border: #d9dee6;
  --glass-shadow: 0 10px 30px -24px rgba(17, 21, 28, 0.42);
  --hairline: #e3e7ed;
  --chip: #eef1f5;
  --card: #ffffff;
  /* sidebar icon tints */
  --c-home: #c4552f;
  --c-approve: #2e8f5b;
  --c-chat: #2f6fb3;
  --c-board: #7c53c4;
  --c-files: #b8862c;
}

:root[data-theme="dark"] {
  --bg-1: #080b10;
  --bg-2: #0d1118;
  --ink: #f0f2f5;
  --muted: #a6adba;
  --faint: #727c8c;
  --primary: #ee7651;
  --primary-ink: #ffffff;
  --accent: #f0835f;
  --danger: #f06d6d;
  --success: #47bd82;
  --glass: rgba(16, 21, 29, 0.96);
  --glass-strong: #171d27;
  --glass-border: #29313e;
  --glass-shadow: 0 18px 42px -30px rgba(0,0,0,.9);
  --hairline: #252d39;
  --chip: #1b222d;
  --card: #141a23;
  --c-home: #e8916f;
  --c-approve: #5fc48d;
  --c-chat: #7db4e8;
  --c-board: #b79aea;
  --c-files: #e0b45f;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg-1);
  overflow: hidden;
}
h1, h2, h3, .brand { font-family: "Archivo", "Inter", -apple-system, "SF Pro Display", sans-serif; letter-spacing: -0.025em; }
.sub { color: var(--muted); font-size: 13px; }
[hidden] { display: none !important; }

/* clean single-tone backdrop behind the glass, matching the planner's gradient */
#bg {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(145deg, var(--bg-1) 0%, var(--bg-2) 68%);
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* lighter glass for small surfaces (tiles, cards, strips) */
.glass-lite {
  background: var(--card);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid var(--glass-border);
}

/* slim translucent scrollbars so inner panels stay glassy */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 20%, transparent);
  border: 3px solid transparent; background-clip: padding-box; border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 32%, transparent); border: 3px solid transparent; background-clip: padding-box; }

/* pills + buttons */
.pill { min-height: 34px; border: 1px solid transparent; border-radius: 9px; padding: 7px 14px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.pill.primary {
  background: linear-gradient(180deg, color-mix(in srgb, #fff 22%, var(--primary)), var(--primary));
  color: #fff;
  box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--primary) 72%, transparent);
}
.pill.primary:hover { filter: brightness(1.05); }
.pill.ghost { background: var(--chip); border-color: var(--glass-border); color: var(--ink); }
.pill.ghost:hover { background: var(--hairline); }
.pill:disabled { opacity: 0.5; cursor: default; }
/* mic button: pulse red while dictating */
#mic-btn.mic-on { color: #d24646; animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.icon-btn { border: 1px solid var(--glass-border); background: var(--chip); color: var(--ink); min-width: 34px; height: 34px; border-radius: 9px; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.icon-btn:hover { background: var(--hairline); }

/* top bar */
#topbar {
  position: fixed; top: 8px; left: 8px; right: 8px; height: 72px; z-index: 5;
  display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 14px;
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: 0.01em; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--accent); }
/* theme-specific logo sits straight on the bar — no badge (each version is made
   for its background: dark ink on light theme, light ink on dark theme) */
.brand-logo { height: 86px; width: auto; max-width: 260px; object-fit: contain; display: block; }
.brand-fallback { font-weight: 700; font-size: 20px; }
.spacer { flex: 1; }

/* shell = sidebar + main, under the floating top bar */
#shell { position: fixed; inset: 88px 8px 8px 8px; display: flex; gap: 10px; }

#sidebar { width: 196px; border-radius: 14px; padding: 11px 9px; display: flex; flex-direction: column; }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px; width: 100%;
  border: 1px solid transparent; background: transparent; font: inherit; font-size: 13px; font-weight: 650;
  color: var(--muted); padding: 7px 8px; border-radius: 10px; cursor: pointer; text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: var(--chip); color: var(--ink); }
.nav-item.active {
  background: var(--glass-strong); color: var(--ink); border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
/* each view gets its own softly tinted icon chip — friendlier, scannable */
.nav-ico {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  background: var(--chip); color: var(--muted);
  transition: background .15s, color .15s, transform .15s;
}
.nav-ico svg { width: 17px; height: 17px; }
.nav-item[data-view] .nav-ico { background: var(--chip); color: var(--muted); }
.nav-item.active[data-view] .nav-ico { background: var(--primary); color: #fff; }

/* files view */
#files-drop { border: 2px dashed var(--hairline); border-radius: 16px; padding: 26px; text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 16px; transition: border-color .15s, background .15s; }
#files-drop.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }
#files-list { display: flex; flex-direction: column; gap: 10px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; padding: 12px 16px; }
.file-info { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: var(--muted); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.file-actions .pill { text-decoration: none; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; }
.nav-item.active .nav-badge { background: var(--accent); color: #fff; }
.side-foot { font-size: 11px; color: var(--faint); padding: 8px 12px; }

#main { flex: 1; min-width: 0; overflow: hidden; }
.view { height: 100%; overflow-y: auto; padding-right: 4px; }

/* ---------- home ---------- */
.page-head { margin: 1px 4px 13px; }
.page-eyebrow { display: block; margin-bottom: 3px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; font-weight: 600; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }
#greeting { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; }
#greeting em { font-style: normal; font-weight: 700; }
#greeting-sub { margin-top: 4px; font-size: 12px; }
.date-stamp { display: inline-block; margin-left: 11px; padding-left: 11px; border-left: 1px solid var(--hairline); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; font-weight: 600; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
#greeting-sub b { color: var(--ink); }
#greeting-sub .hot { color: var(--danger); font-weight: 600; }

/* Today line — the planner tie-in, one row under the greeting */
#today-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px 18px; padding: 9px 12px; margin: 0 4px 12px;
  border-radius: 10px; background: var(--card); border: 1px solid var(--glass-border); font-size: 12px;
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
}
#today-line .tl-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
#today-line .tl-item { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); min-width: 0; }
#today-line .tl-item i { font-style: normal; opacity: .8; }
#today-line .tl-type { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; font-weight: 600; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
#today-line .tl-item b { font-weight: 700; }
#today-line .tl-muted { color: var(--muted); }
#today-line .tl-loc { color: var(--faint); }
#today-line .tl-sep { color: var(--faint); }
#today-line .tl-more { color: var(--accent); font-weight: 600; }

#stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.tile {
  min-height: 58px; border-radius: 10px; padding: 10px 13px; background: var(--card); border: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 10px;
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset;
}
.tile .n { font-family: "Archivo", sans-serif; font-size: 24px; font-weight: 700; line-height: 1; }
.tile .l { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; font-weight: 600; color: var(--muted); margin-top: 0; text-transform: uppercase; letter-spacing: 0.05em; }
.tile.hot .n { color: var(--accent); }
.tile.alert .n { color: var(--danger); }
.tile.spend { position: relative; cursor: pointer; }
.tile.spend:hover { border-color: var(--accent); }
.spend-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 12px; box-shadow: var(--glass-shadow); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.spend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 6px; }
.spend-row .avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.spend-row b { margin-left: auto; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.spend-row.sub { color: var(--muted); }

#home-panels { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 10px; }
.crew-panel { grid-column: 1 / -1; }
.panel { border-radius: 12px; padding: 14px 16px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.panel-title { margin: 0; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink); }
.panel-kicker { margin-top: 4px; color: var(--faint); font-size: 11px; }
.feed { list-style: none; display: flex; flex-direction: column; max-height: 330px; overflow-y: auto; }
.feed li { padding: 10px 1px; border-bottom: 1px solid var(--hairline); font-size: 12px; }
.feed li:last-child { border-bottom: 0; }
.feed .feed-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.feed .who { color: var(--accent); font-weight: 700; }
.feed .when { color: var(--faint); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; white-space: nowrap; }
.feed .feed-act { color: var(--ink); margin-top: 3px; line-height: 1.38; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed li.wa-new .feed-act { color: var(--ink); }
.wa-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.feed .feed-task { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* crew cards — image-forward: the full picture up top (a rounded square, not a
   circle), name/status below */
#crew-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.crew-card {
  position: relative; text-align: left; background: var(--card); border: 1px solid var(--glass-border);
  min-width: 0; min-height: 104px; border-radius: 11px; padding: 0; overflow: hidden; cursor: pointer; font: inherit; color: var(--ink);
  display: grid; grid-template-columns: 72px minmax(0, 1fr); transition: border-color .15s, transform .15s, box-shadow .15s;
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
}
.crew-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--glass-shadow); }
/* the picture: full card width, square, uncropped fill, no circle */
.crew-card .avatar.lg { width: 72px; height: 100%; min-height: 104px; aspect-ratio: auto; border-radius: 0; font-size: 30px; }
.crew-card .avatar.lg img { object-position: center 31%; }
.crew-card .cc-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; justify-content: center; padding: 10px 11px; }
.crew-card .cc-name { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 14px; text-transform: capitalize; }
.crew-card .cc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted); }
.crew-card .cc-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; margin-top: 4px; }
.crew-card .cc-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.crew-card .cc-line { font-size: 10px; color: var(--muted); line-height: 1.35; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-card .cc-more { color: var(--faint); font-weight: 600; }
.rest-toggle { position: absolute; top: 7px; right: 7px; z-index: 2; font-size: 11px; color: #fff; line-height: 1; padding: 3px 5px; border-radius: 6px; background: rgba(0,0,0,0.52); backdrop-filter: blur(4px); }
.rest-toggle:hover { background: rgba(0,0,0,0.55); }

/* status accents */
.crew-card.st-waiting { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-border)); }
.crew-card.st-waiting .cc-status { color: var(--accent); }
.crew-card.st-waiting .cc-status .dot { background: var(--accent); }
.crew-card.st-working .cc-status { color: var(--success); }
.crew-card.st-working .cc-status .dot { background: var(--success); }
.crew-card.st-idle .cc-status { color: var(--muted); }
.crew-card.st-asleep { opacity: 0.72; }
.crew-card.st-asleep .cc-status { color: var(--faint); }
/* ---------- avatar motion (the moving parts) ----------
   A slow Ken Burns drift on the picture itself — the crew looks alive without
   the heartbeat ring around the face. Working wingmen breathe a touch faster;
   asleep ones hold still. The status dot pulses, not the portrait. */
@keyframes kenburns {
  0%   { transform: scale(1.04) translate(0, 0); }
  50%  { transform: scale(1.09) translate(-1.5%, -1.5%); }
  100% { transform: scale(1.05) translate(1.5%, 0.5%); }
}
@keyframes dotpulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.6; }
}
.crew-card .avatar.lg img { animation: kenburns 22s ease-in-out infinite alternate; will-change: transform; }
.crew-card.st-working .avatar.lg img { animation-duration: 13s; }
.crew-card.st-waiting .avatar.lg img { animation-duration: 18s; }
.crew-card.st-working .cc-status .dot,
.crew-card.st-waiting .cc-status .dot { animation: dotpulse 2.4s ease-in-out infinite; }
.crew-card.st-waiting .cc-status { text-decoration: underline dotted; text-underline-offset: 3px; }
.crew-card.st-asleep .avatar.lg img { animation: none; }
.crew-card.st-asleep .avatar.lg { filter: grayscale(0.4) brightness(0.94); }

@media (prefers-reduced-motion: reduce) {
  .crew-card .avatar.lg img,
  .crew-card .cc-status .dot { animation: none !important; }
}

/* ---------- "Your move" strip ---------- */
#your-move { margin: 1px 0 10px; }
#your-move > .panel-title { margin: 0 4px 8px; color: var(--accent); }
#your-move-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ym-card {
  min-width: 0; min-height: 96px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--glass-border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.ym-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glass-shadow); }
.ym-plan { border-left-color: var(--primary); }
.ym-review { border-left-color: var(--success); }
.ym-blocked { border-left-color: var(--danger); }
.ym-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ym-blocked .ym-tag { color: var(--danger); }
.ym-label { font-size: 12px; font-weight: 650; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ym-foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.ym-foot .avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.ym-who { color: var(--accent); font-weight: 600; }
.ym-when { margin-left: auto; color: var(--faint); }

/* a draft you deep-linked to from "Your move" flashes so you find it */
.draft.flash { animation: draftflash 1.6s ease-out; }
@keyframes draftflash {
  0%   { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* avatar */
.avatar {
  position: relative; width: 44px; height: 44px; border-radius: 26%; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  font-family: "Archivo", sans-serif; font-weight: 700; font-size: 16px; text-transform: uppercase;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crew-card .avatar.lg video { object-position: center 28%; }
.crew-card.st-asleep .avatar.lg video { filter: grayscale(0.4) brightness(0.94); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

/* ---------- approvals inbox ---------- */
#inbox-list { display: flex; flex-direction: column; gap: 14px; }
.draft { border-radius: 18px; padding: 18px 20px; }
.draft-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.draft-head h3 { font-size: 17px; font-weight: 700; }
.draft-chips { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.chip { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--chip); border-radius: 6px; padding: 3px 8px; }
.chip.risk-high, .chip.risk-critical { color: #fff; background: var(--danger); }
.chip.risk-medium { color: #fff; background: var(--accent); }
.draft-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; font-size: 12px; color: var(--muted); }
.draft-meta .who { color: var(--accent); font-weight: 600; }
.draft-meta .dot { color: var(--faint); }
.draft-meta .avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.draft-body { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.5; color: var(--ink); background: var(--chip); border-radius: 12px; padding: 12px 14px; max-height: 260px; overflow-y: auto; }
.draft-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pill.danger { background: var(--danger); color: #fff; }
.draft-reason { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.draft-reason textarea { resize: none; font: inherit; font-size: 13px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--card); color: var(--ink); }
.draft-reason textarea:focus { outline: none; border-color: var(--danger); }
.draft-reason-actions { display: flex; justify-content: flex-end; gap: 8px; }
.empty { border-radius: 18px; padding: 48px 24px; text-align: center; }
.empty-mark { font-size: 34px; color: var(--accent); margin-bottom: 10px; }
.empty p { font-size: 15px; font-weight: 600; }
.empty p.sub { font-weight: 400; margin-top: 4px; }

/* ---------- chat ---------- */
#chat-wrap { display: flex; gap: 12px; height: 100%; }
#agent-rail { width: 220px; border-radius: 18px; padding: 8px; overflow-y: auto; }
#agent-list { display: flex; flex-direction: column; gap: 3px; }
.agent-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.agent-btn:hover { background: var(--chip); }
.agent-btn.active { background: var(--primary); color: var(--primary-ink); }
.agent-btn.active .agent-role { color: color-mix(in srgb, var(--primary-ink) 70%, transparent); }
.agent-name { font-weight: 600; font-size: 14px; text-transform: capitalize; }
.agent-role { font-size: 11px; color: var(--muted); line-height: 1.2; }

#chat { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; border-radius: 18px; padding: 0; overflow: hidden; }
#chat.drag-over::after {
  content: "Drop a file here for this wingman";
  position: absolute; inset: 10px; z-index: 6; display: grid; place-items: center; text-align: center;
  background: color-mix(in srgb, var(--accent) 10%, var(--glass-strong));
  border: 2px dashed var(--accent); border-radius: 16px;
  color: var(--accent); font-weight: 700; font-size: 15px; pointer-events: none;
}
.crew-card.drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
#chat-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.chat-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar.chat { width: 60px; height: 60px; border-radius: 22%; font-size: 22px; flex-shrink: 0; }
#chat-title { font-size: 18px; text-transform: capitalize; }
#messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72ch; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; line-height: 1.45; font-size: 14px; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; background: var(--card); border: 1px solid var(--glass-border); border-bottom-left-radius: 4px; }
.msg.tool { align-self: flex-start; background: transparent; padding: 0 14px; color: var(--muted); font-size: 12px; }
.msg.error { align-self: stretch; background: rgba(220,38,38,0.10); border: 1px solid var(--danger); color: var(--danger); font-size: 13px; }
.msg.hint { align-self: center; color: var(--muted); font-size: 12px; }
#composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--hairline); }
#attach-btn { flex: 0 0 auto; }
#input { flex: 1; resize: none; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--card); color: var(--ink); }
#input:focus { outline: none; border-color: var(--primary); }

/* header live status */
.chat-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; margin: 2px 0; color: var(--muted); }
.chat-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.chat-status.st-working { color: #16a34a; } .chat-status.st-working .dot { background: #16a34a; animation: dotpulse 2.4s ease-in-out infinite; }
.chat-status.st-waiting { color: var(--accent); } .chat-status.st-waiting .dot { background: var(--accent); animation: dotpulse 2.4s ease-in-out infinite; }
.chat-status.st-asleep { color: var(--faint); } .chat-status.st-asleep .dot { background: var(--faint); }

/* rail status dots */
.rail-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); vertical-align: middle; margin-left: 3px; }
.rail-dot.st-working { background: #16a34a; } .rail-dot.st-waiting { background: var(--accent); } .rail-dot.st-idle { background: var(--faint); } .rail-dot.st-asleep { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }

/* message rows with per-message avatars */
.msg-row { display: flex; gap: 8px; max-width: 100%; }
.msg-row.agent-row { justify-content: flex-start; align-items: flex-start; }
.msg-row.user-row { justify-content: flex-end; }
.msg-face { width: 28px; height: 28px; flex: 0 0 auto; font-size: 11px; }
.msg-row .msg { max-width: 68ch; }
.msg.agent { line-height: 1.5; }
.msg.agent p { margin: 0 0 8px; } .msg.agent > :last-child { margin-bottom: 0; }
.msg.agent h4 { font-size: 14px; margin: 10px 0 4px; }
.msg.agent ul, .msg.agent ol { margin: 4px 0 8px; padding-left: 20px; }
.msg.agent li { margin: 2px 0; }
.msg.agent code { background: var(--chip); border-radius: 5px; padding: 1px 5px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; }
.msg.agent pre { background: var(--chip); border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 6px 0; }
.msg.agent pre code { background: none; padding: 0; }
.msg.agent a { color: var(--accent); }
.msg-row.past { opacity: 0.62; }
.chat-divider { align-self: center; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 4px 0 8px; }

/* morning brief card */
#brief-card { margin-bottom: 12px; }
#brief-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: transparent; cursor: pointer; color: var(--ink); font: inherit; padding: 0; }
#brief-toggle .panel-title { margin: 0; }
#brief-caret { color: var(--muted); font-size: 12px; }
#brief-body { margin-top: 12px; font-size: 14px; line-height: 1.5; }
#brief-body h4 { font-size: 14px; margin: 10px 0 4px; }
#brief-body ul, #brief-body ol { margin: 4px 0 8px; padding-left: 20px; }

/* empty-state starters */
.chat-empty { max-width: 460px; margin: auto; text-align: center; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chat-empty-face .avatar { width: 64px; height: 64px; border-radius: 22%; }
.chat-empty-title { font-size: 16px; margin-top: 8px; }
.chat-empty-title b { text-transform: capitalize; }
.starters { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; width: 100%; }
.starter { font: inherit; font-size: 13px; text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color .15s, transform .15s; }
.starter:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- board ---------- */
#view-board { display: flex; flex-direction: column; }
#board-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
#board-refresh { margin-left: auto; }
#board { flex: 1; display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 6px; }
.column { flex: 0 0 250px; border-radius: 16px; padding: 6px; display: flex; flex-direction: column; max-height: 100%; background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.column.dragover { border-color: var(--primary); }
.column h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px 6px; display: flex; justify-content: space-between; }
.column .col-count { color: var(--ink); background: var(--chip); border-radius: 10px; padding: 0 7px; font-size: 11px; }
.column-cards { padding: 4px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 20px; }
.card { background: var(--card); border: 1px solid var(--glass-border); border-left: 3px solid var(--faint); border-radius: 12px; padding: 9px 11px; cursor: grab; }
.card:hover { border-color: var(--primary); }
.card.dragging { opacity: 0.4; }
.card.p-high { border-left-color: var(--accent); }
.card.p-medium { border-left-color: var(--primary); }
.card.p-low { border-left-color: var(--faint); }
.card .card-id { font-size: 11px; color: var(--muted); }
.card .card-title { font-size: 13px; line-height: 1.35; margin: 2px 0 8px; }
.card .card-meta { display: flex; align-items: center; gap: 6px; }
.card .card-project { font-size: 10px; color: var(--muted); background: var(--chip); border-radius: 6px; padding: 1px 6px; }

/* ---------- modals ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(10,10,20,0.4); display: grid; place-items: center; z-index: 20; }
#modal, #intake { position: relative; width: min(640px, 92vw); max-height: 84vh; overflow-y: auto; border-radius: 18px; padding: 22px 24px; }
#intake { width: min(520px, 92vw); }
#modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; }
#modal h2, #intake h2 { font-size: 17px; margin-bottom: 4px; padding-right: 20px; }
#modal .kv { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0; font-size: 13px; color: var(--muted); }
#modal .kv b { color: var(--ink); font-weight: 600; }
#modal .section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 16px 0 6px; }
#modal .body-text, #modal .plan-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
#modal .plan-text { background: var(--card); border: 1px solid var(--glass-border); border-radius: 10px; padding: 10px 12px; }
#modal .log { list-style: none; font-size: 12px; }
#modal .log li { padding: 5px 0; border-bottom: 1px solid var(--hairline); }
#modal .log .log-when { color: var(--faint); }
#intake textarea { width: 100%; margin-top: 12px; resize: vertical; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--card); color: var(--ink); }
#intake textarea:focus { outline: none; border-color: var(--primary); }
#intake-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#intake-status { margin-top: 10px; }

/* toast */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: color-mix(in srgb, var(--ink) 86%, transparent); color: var(--bg-1);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 40; box-shadow: var(--glass-shadow);
}
#toast.error { background: var(--danger); color: #fff; }

@media (max-width: 720px) {
  #topbar { height: 62px; }
  .brand-logo { height: 56px; max-width: 150px; }
  #shell { inset: 76px 8px 8px; gap: 8px; }
  #home-panels { grid-template-columns: 1fr; }
  .crew-panel { grid-column: auto; }
  #sidebar { width: 56px; padding: 8px 6px; }
  .nav-item { justify-content: center; gap: 0; font-size: 0; padding: 7px 5px; }
  .nav-badge { position: absolute; top: 2px; right: 1px; }
  .side-foot { display: none; }
  #your-move-row, #crew-grid { grid-template-columns: 1fr; }
  #stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-stamp { display: block; margin: 5px 0 0; padding: 0; border: 0; }
  #today-line { align-items: flex-start; }
  #today-line .tl-item { width: 100%; }
  #today-line .tl-focus { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 5px 8px; }
  #today-line .tl-focus .tl-type { grid-row: 1 / span 4; }
  #today-line .tl-focus .tl-task,
  #today-line .tl-focus .tl-more { grid-column: 2; }
  #today-line .tl-focus .tl-sep { display: none; }
  .panel-kicker { display: none; }
}

@media (min-width: 721px) and (max-width: 1180px) {
  #crew-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #your-move-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  #home-panels { grid-template-columns: 1fr; }
  .crew-panel { grid-column: auto; }
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===========================================================================
   Flight operations desk — the command surface is organized around decisions,
   live operating status, and clear ownership rather than equal-weight cards.
   ========================================================================== */

:root {
  --bg-1: #e7edef;
  --bg-2: #f2f5f5;
  --ink: #10252b;
  --muted: #5f7277;
  --faint: #8a9a9e;
  --primary: #ff6b35;
  --primary-ink: #ffffff;
  --accent: #ff6b35;
  --danger: #d84b45;
  --success: #168261;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --glass-border: #d7e0e2;
  --glass-shadow: 0 18px 46px -34px rgba(16, 37, 43, .55);
  --hairline: #e1e8e9;
  --chip: #edf2f3;
  --card: #ffffff;
  --nav: #0b2931;
  --nav-soft: #123740;
  --hero: #c9dfe0;
  --hero-ink: #102a31;
  --teal: #367d7d;
}

:root[data-theme="dark"] {
  --bg-1: #07161b;
  --bg-2: #0b2026;
  --ink: #edf6f5;
  --muted: #a5b7b8;
  --faint: #71878a;
  --primary: #ff7745;
  --primary-ink: #ffffff;
  --accent: #ff855b;
  --danger: #f1706b;
  --success: #4fc69a;
  --glass: #10262d;
  --glass-strong: #163139;
  --glass-border: #29454d;
  --glass-shadow: 0 22px 48px -34px rgba(0, 0, 0, .95);
  --hairline: #274149;
  --chip: #18363e;
  --card: #10272e;
  --nav: #061e25;
  --nav-soft: #12343c;
  --hero: #1b424b;
  --hero-ink: #f0f8f7;
  --teal: #72b6b2;
}

body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-1);
}

h1, h2, h3, .brand { font-family: "Archivo", "Manrope", sans-serif; }

#bg {
  background:
    radial-gradient(circle at 76% 4%, color-mix(in srgb, var(--hero) 42%, transparent) 0, transparent 34%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.glass,
.glass-lite {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.pill,
.icon-btn {
  border-radius: 10px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
}

.pill.primary {
  background: var(--primary);
  box-shadow: 0 10px 24px -15px color-mix(in srgb, var(--primary) 80%, transparent);
}

.pill.ghost,
.icon-btn {
  background: var(--chip);
  border-color: var(--glass-border);
}

#shell {
  inset: 12px;
  gap: 14px;
}

#sidebar {
  width: 170px;
  flex: 0 0 170px;
  padding: 0 10px 12px;
  border: 0;
  border-radius: 18px;
  background: var(--nav);
  box-shadow: 0 22px 54px -36px rgba(1, 17, 22, .95);
}

#sidebar .brand {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 14px;
}

#sidebar .brand-logo {
  height: 58px;
  width: auto;
  max-width: 64px;
  border-radius: 14px;
}

#nav { gap: 7px; }

.nav-item {
  min-height: 46px;
  gap: 10px;
  padding: 8px 9px;
  border: 0;
  border-radius: 11px;
  color: #a9bec1;
  font-size: 13px;
}

.nav-item:hover {
  background: rgba(255,255,255,.065);
  color: #ffffff;
}

.nav-item.active {
  background: var(--nav-soft);
  color: #ffffff;
  border: 0;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item[data-view] .nav-ico,
.nav-item.active[data-view] .nav-ico {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,.08);
  color: currentColor;
}

.nav-item.active[data-view] .nav-ico {
  background: var(--primary);
  color: #ffffff;
}

.nav-badge {
  background: var(--primary);
  color: #ffffff;
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 11px 2px;
  color: #739095;
  font-size: 9px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.side-foot strong { color: #d8e7e7; font-size: 10px; }

#topbar {
  top: 12px;
  left: 196px;
  right: 12px;
  height: 66px;
  padding: 0 14px 0 18px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.topbar-context {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.topbar-context span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.topbar-context strong {
  font-size: 13px;
  color: var(--ink);
}

#main {
  padding-top: 80px;
}

.view {
  padding: 0 2px 22px 0;
}

.page-head.home-hero {
  position: relative;
  min-height: 116px;
  display: flex;
  align-items: center;
  margin: 0 0 0;
  padding: 22px 26px 31px;
  overflow: hidden;
  border-radius: 19px;
  background: var(--hero);
  color: var(--hero-ink);
}

.home-hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 9px;
  background: var(--primary);
}

.home-hero .page-eyebrow {
  color: color-mix(in srgb, var(--hero-ink) 64%, var(--teal));
  margin-bottom: 6px;
}

#greeting {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -.045em;
  color: var(--hero-ink);
}

#greeting-sub {
  margin-top: 7px;
  color: color-mix(in srgb, var(--hero-ink) 74%, transparent);
  font-size: 12px;
}

#greeting-sub b { color: var(--hero-ink); }

.date-stamp {
  border-color: color-mix(in srgb, var(--hero-ink) 22%, transparent);
  color: color-mix(in srgb, var(--hero-ink) 58%, transparent);
}

#today-line {
  position: relative;
  z-index: 2;
  min-height: 48px;
  margin: -17px 17px 16px;
  padding: 11px 15px;
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 0 18px 34px -28px rgba(16, 37, 43, .7);
}

#today-line .tl-label,
#today-line .tl-type {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}

.home-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, .8fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  border-radius: 16px;
  padding: 17px 18px;
}

.panel-heading {
  margin-bottom: 12px;
}

.panel-title {
  font-family: "Barlow Condensed", "Archivo", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ink);
}

.panel-kicker {
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
}

#your-move {
  margin: 0;
  min-height: 0;
  padding: 19px 20px 12px;
}

#your-move > .panel-title { margin: 0; }

#your-move-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border-top: 1px solid var(--hairline);
}

.ym-card {
  width: 100%;
  min-height: 61px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 155px;
  align-items: center;
  gap: 12px;
  padding: 10px 4px 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-left: 4px solid var(--primary);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ym-card:hover {
  transform: none;
  border-color: var(--hairline);
  border-left-color: var(--primary);
  background: color-mix(in srgb, var(--chip) 72%, transparent);
  box-shadow: none;
}

.ym-review,
.ym-review:hover { border-left-color: var(--success); }
.ym-blocked,
.ym-blocked:hover { border-left-color: var(--danger); }

.ym-tag {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 10px;
  letter-spacing: .08em;
}

.ym-review .ym-tag {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.ym-label {
  display: block;
  -webkit-line-clamp: initial;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.32;
}

.ym-foot {
  justify-content: flex-end;
  color: var(--muted);
}

.ym-foot .avatar.sm { width: 26px; height: 26px; }
.ym-when { margin-left: 4px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 8px; }

.ops-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ops-panel {
  padding: 18px;
  border-radius: 16px;
  background: var(--nav);
  color: #ffffff;
  box-shadow: 0 20px 44px -34px rgba(1, 17, 22, .9);
}

.ops-panel .panel-title { color: #ffffff; }
.ops-panel .panel-kicker { color: #7f9ba0; }

.ops-panel #stat-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.1);
}

.ops-panel .tile {
  min-height: 60px;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: #0f333c;
  color: #ffffff;
  box-shadow: none;
}

.ops-panel .tile .n {
  color: #ffffff;
  font-family: "Archivo", sans-serif;
  font-size: 31px;
}

.ops-panel .tile .l {
  max-width: 84px;
  color: #89a2a6;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  line-height: 1.1;
  text-align: right;
}

.ops-panel .tile.hot .n { color: var(--primary); }
.ops-panel .tile.alert .n { color: #ff8a84; }

.crew-panel {
  grid-column: auto;
  padding: 14px;
}

#crew-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.crew-card {
  min-height: 62px;
  grid-template-columns: 58px minmax(0, 1fr);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 85%, var(--chip));
}

.crew-card .avatar.lg {
  width: 58px;
  height: 62px;
  min-height: 62px;
}

.crew-card .avatar.lg img {
  display: block;
  object-fit: cover;
  object-position: center 24%;
  animation: none !important;
  transform: none !important;
  will-change: auto;
}

.crew-card .avatar.lg:has(img) .initials,
.crew-card .avatar.lg:has(video) .initials {
  visibility: hidden;
}

.crew-card .cc-body {
  padding: 7px 8px;
}

.crew-card .cc-name { font-size: 12px; }
.crew-card .cc-title { font-size: 8px; }
.crew-card .cc-status { margin-top: 2px; font-size: 8px; }
.crew-card .cc-line { display: none; }
.crew-card.st-asleep { opacity: .8; }
.rest-toggle { top: 5px; right: 5px; opacity: .38; }
.crew-card:hover .rest-toggle { opacity: 1; }

#brief-card { margin: 0 0 14px; }

#home-panels {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 14px;
}

#home-panels .panel {
  min-height: 292px;
}

.feed { max-height: 235px; }
.feed li { padding: 11px 2px; }
.feed .feed-act { -webkit-line-clamp: 2; }
.feed .when { font-size: 8px; }

#view-inbox > .page-head,
#view-files > .page-head {
  margin: 0 0 18px;
  padding: 4px 2px;
}

#agent-rail,
#chat,
.column,
.draft,
.file-row,
#files-drop {
  border-radius: 14px;
}

@media (max-width: 1100px) {
  .home-command-grid { grid-template-columns: 1fr; }
  .ops-column { display: grid; grid-template-columns: minmax(250px, .68fr) minmax(0, 1.32fr); align-items: start; }
  #crew-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  #sidebar { width: 70px; flex-basis: 70px; padding: 0 7px 10px; }
  #sidebar .brand { height: 70px; margin-bottom: 10px; }
  #sidebar .brand-logo { height: 76px; max-width: 70px; }
  .nav-item { justify-content: center; padding: 8px 6px; }
  .nav-label { display: none; }
  .nav-badge { position: absolute; top: 3px; right: 3px; }
  .side-foot { align-items: center; padding: 8px 0 2px; }
  .side-foot span { display: none; }
  #topbar { left: 96px; }
  .home-command-grid { grid-template-columns: 1fr; }
  #home-panels { grid-template-columns: 1fr; }
  .ops-column { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  #shell { inset: 8px; gap: 8px; }
  #sidebar { width: 56px; flex-basis: 56px; border-radius: 14px; }
  #sidebar .brand { height: 58px; }
  #sidebar .brand-logo { height: 62px; max-width: 56px; }
  #topbar { top: 8px; left: 72px; right: 8px; height: 58px; border-radius: 13px; }
  #topbar .topbar-context,
  #update-btn { display: none; }
  #main { padding-top: 70px; }
  .view { padding-bottom: 14px; }
  .page-head.home-hero { min-height: 122px; padding: 18px 17px 30px; border-radius: 15px; }
  #greeting { font-size: 30px; line-height: 1.03; }
  #greeting-sub { line-height: 1.35; }
  #today-line { margin: -15px 8px 12px; padding: 11px 12px; }
  .home-command-grid { gap: 10px; }
  .panel { padding: 14px; border-radius: 13px; }
  #your-move { padding: 15px 13px 7px; }
  .ym-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 7px 9px;
    padding: 11px 4px 11px 8px;
  }
  .ym-foot { grid-column: 1 / -1; justify-content: flex-start; padding-left: 81px; }
  .ym-when { margin-left: auto; }
  .ops-panel #stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #crew-grid { grid-template-columns: 1fr; }
  #home-panels .panel { min-height: auto; }
  .feed { max-height: 300px; }
}

/* ==========================================================================
   Liquid formation — the Wingmen are the primary operating surface. The sky
   is a real image asset; translucent layers stay quiet enough for daily use.
   ========================================================================== */

:root {
  --bg-1: #dbe7e8;
  --bg-2: #edf3f3;
  --ink: #132a32;
  --muted: #536a72;
  --faint: #758a91;
  --primary: #ff7448;
  --accent: #e7633d;
  --success: #2c9a7a;
  --glass: rgba(242, 249, 249, .62);
  --glass-strong: rgba(250, 253, 253, .78);
  --glass-border: rgba(255, 255, 255, .58);
  --glass-shadow: 0 22px 58px -34px rgba(5, 24, 34, .62), inset 0 1px 0 rgba(255, 255, 255, .62);
  --hairline: rgba(16, 42, 51, .11);
  --chip: rgba(236, 244, 245, .68);
  --card: rgba(250, 253, 253, .74);
  --nav: rgba(8, 30, 39, .72);
  --nav-soft: rgba(98, 144, 151, .18);
  --hero: rgba(13, 42, 54, .58);
  --hero-ink: #f6fbfb;
}

:root[data-theme="dark"] {
  --bg-1: #07151e;
  --bg-2: #0a202a;
  --ink: #f2f8f8;
  --muted: #a9bdc1;
  --faint: #789198;
  --primary: #ff7a4f;
  --accent: #ff8d67;
  --success: #58c5a0;
  --glass: rgba(10, 31, 40, .58);
  --glass-strong: rgba(12, 37, 47, .76);
  --glass-border: rgba(202, 230, 234, .16);
  --glass-shadow: 0 26px 66px -38px rgba(0, 0, 0, .92), inset 0 1px 0 rgba(255, 255, 255, .09);
  --hairline: rgba(215, 236, 239, .11);
  --chip: rgba(40, 69, 77, .54);
  --card: rgba(12, 37, 47, .72);
  --nav: rgba(5, 24, 33, .76);
  --nav-soft: rgba(98, 144, 151, .18);
  --hero: rgba(8, 29, 40, .64);
  --hero-ink: #f6fbfb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Manrope", "Segoe UI", sans-serif;
}

h1, h2, h3, .brand {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Archivo", sans-serif;
}

#bg {
  background-image: url('/flight-dawn-v1.png');
  background-size: cover;
  background-position: center center;
  filter: saturate(.78) brightness(.94);
  transform: scale(1.015);
}

:root[data-theme="dark"] #bg {
  filter: saturate(.7) brightness(.48);
}

.glass,
.glass-lite {
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  backdrop-filter: blur(28px) saturate(145%);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

#shell {
  gap: 12px;
}

#sidebar {
  width: 80px;
  flex-basis: 80px;
  padding: 0 8px 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 24px;
  background: var(--nav);
  -webkit-backdrop-filter: blur(30px) saturate(135%);
  backdrop-filter: blur(30px) saturate(135%);
  box-shadow: 0 24px 70px -38px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .11);
}

#sidebar .brand {
  height: 76px;
  margin-bottom: 12px;
}

#sidebar .brand-logo {
  height: 54px;
  max-width: 58px;
  border-radius: 12px;
}

.nav-item {
  position: relative;
  justify-content: center;
  min-height: 49px;
  padding: 7px;
  border-radius: 15px;
}

.nav-label { display: none; }

.nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.nav-item[data-view] .nav-ico,
.nav-item.active[data-view] .nav-ico {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.nav-badge {
  position: absolute;
  top: 3px;
  right: 3px;
}

.side-foot {
  align-items: center;
  padding-inline: 0;
}

.side-foot span { display: none; }

#topbar {
  left: 104px;
  height: 66px;
  border-radius: 21px;
  background: rgba(246, 251, 251, .62);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  box-shadow: 0 20px 58px -38px rgba(5, 24, 34, .66), inset 0 1px 0 rgba(255, 255, 255, .78);
}

:root[data-theme="dark"] #topbar {
  background: rgba(9, 31, 41, .62);
}

.pill,
.icon-btn {
  border-radius: 14px;
}

.pill.ghost,
.icon-btn {
  background: rgba(240, 247, 248, .48);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

:root[data-theme="dark"] .pill.ghost,
:root[data-theme="dark"] .icon-btn {
  background: rgba(54, 82, 89, .38);
}

#main {
  padding-top: 80px;
}

.page-head.home-hero {
  min-height: 128px;
  padding: 23px 28px 35px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 26px;
  background: var(--hero);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
  box-shadow: 0 28px 68px -42px rgba(3, 20, 28, .88), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.home-hero::after {
  top: 17px;
  right: 15px;
  bottom: 17px;
  width: 4px;
  border-radius: 999px;
  background: var(--primary);
}

.home-hero .page-eyebrow,
#greeting-sub,
.date-stamp {
  color: rgba(235, 247, 248, .72);
}

#greeting {
  color: var(--hero-ink);
  font-size: 39px;
  font-weight: 720;
  letter-spacing: -.046em;
}

#greeting-sub b { color: #ffffff; }

#today-line {
  min-height: 52px;
  margin: -19px 18px 17px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(246, 251, 251, .66);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 22px 55px -40px rgba(4, 25, 34, .85), inset 0 1px 0 rgba(255, 255, 255, .76);
}

:root[data-theme="dark"] #today-line {
  background: rgba(10, 33, 43, .72);
}

.panel.formation-panel {
  position: relative;
  margin: 0 0 17px;
  padding: 20px;
  overflow: hidden;
  border-color: rgba(255, 255, 255, .22);
  border-radius: 28px;
  background: rgba(8, 28, 39, .56);
  color: #f5fbfb;
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  backdrop-filter: blur(30px) saturate(140%);
  box-shadow: 0 32px 78px -46px rgba(0, 0, 0, .96), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.formation-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.formation-kicker {
  display: block;
  margin-bottom: 4px;
  color: rgba(225, 241, 243, .62);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.formation-panel .panel-title {
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Archivo", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.025em;
  text-transform: none;
}

.formation-panel .panel-kicker {
  color: rgba(224, 240, 242, .66);
  font-size: 10px;
}

.formation-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(237, 247, 248, .08);
  color: rgba(240, 249, 249, .82);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.formation-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #54d5a6;
  box-shadow: 0 0 0 4px rgba(84, 213, 166, .11);
}

.formation-panel #crew-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.formation-panel .crew-card {
  min-height: clamp(148px, 9.5vw, 184px);
  display: grid;
  grid-template-columns: 52% minmax(0, 1fr);
  grid-template-rows: 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 18px;
  background: rgba(238, 247, 248, .09);
  color: #f6fbfb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.formation-panel .crew-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, .34);
  background: rgba(238, 247, 248, .14);
  box-shadow: 0 18px 38px -24px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.formation-panel .crew-card.st-waiting {
  border-color: rgba(255, 135, 91, .62);
  box-shadow: inset 0 0 0 1px rgba(255, 135, 91, .12);
}

.formation-panel .crew-card .avatar.lg {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.formation-panel .crew-card .avatar.lg img,
.formation-panel .crew-card .avatar.lg video {
  object-position: center 35%;
}

.formation-panel .crew-card .cc-body {
  min-height: 0;
  justify-content: flex-start;
  gap: 2px;
  padding: 10px;
}

/* The title wraps in full, never truncated. */
.formation-panel .crew-card .cc-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}

.formation-panel .crew-card .cc-name {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}

.formation-panel .crew-card .cc-title {
  color: rgba(226, 241, 243, .66);
  font-size: 11px;
}

/* Status pins to the bottom of the box so every card's state lines up. */
.formation-panel .crew-card .cc-status {
  margin-top: auto;
  padding-top: 5px;
  font-size: 11px;
}

.formation-panel .crew-card .cc-line {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(231, 243, 244, .72);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.formation-panel .crew-card.st-idle .cc-status { color: rgba(225, 239, 241, .58); }
.formation-panel .crew-card.st-waiting .cc-status { color: #ff9a74; }
.formation-panel .crew-card.st-working .cc-status { color: #6edab3; }

.formation-panel .rest-toggle {
  top: 7px;
  right: auto;
  left: 7px;
  z-index: 3;
  width: auto;
  height: auto;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  background: rgba(5, 22, 30, .52);
  color: rgba(244, 250, 250, .76);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  opacity: .78;
}

.home-command-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, .55fr);
  align-items: stretch;
}

.ops-column {
  display: flex;
  height: 100%;
}

.ops-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, .19);
  border-radius: 22px;
  background: rgba(8, 30, 40, .66);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
  box-shadow: 0 26px 62px -42px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.ops-panel #stat-tiles {
  flex: 1;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  border-radius: 16px;
  background: rgba(255, 255, 255, .1);
}

.ops-panel .tile {
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: rgba(236, 247, 248, .07);
}

.ops-panel .tile .l {
  max-width: none;
  text-align: center;
}

.home-hero > div {
  position: relative;
  z-index: 1;
}

.hero-brand {
  position: absolute;
  top: 50%;
  right: 48px;
  width: clamp(280px, 27vw, 420px);
  max-height: 140px;
  object-fit: contain;
  object-position: right center;
  opacity: .92;
  transform: translateY(-50%);
  filter: drop-shadow(0 16px 25px rgba(2, 14, 20, .34));
}

.panel {
  border-radius: 22px;
}

#your-move {
  border-radius: 22px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  backdrop-filter: blur(28px) saturate(145%);
}

#home-panels .panel {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  backdrop-filter: blur(28px) saturate(145%);
}

@media (max-width: 1120px) {
  .formation-panel #crew-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-command-grid { grid-template-columns: 1fr; }
  .ops-panel #stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  #topbar { left: 96px; }
  .hero-brand { display: none; }
  .formation-panel #crew-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .formation-panel .crew-card { min-height: 170px; grid-template-columns: 1fr; grid-template-rows: 112px minmax(0, 1fr); }
  .formation-panel .crew-card .avatar.lg { height: 112px; min-height: 112px; }
  .formation-panel .rest-toggle { right: 7px; left: auto; }
  .ops-panel #stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  #topbar { left: 72px; }
  .panel.formation-panel { padding: 14px; border-radius: 20px; }
  .formation-heading { position: relative; display: block; padding-top: 1px; }
  .formation-state { position: absolute; top: 0; right: 0; padding: 6px 8px; font-size: 8px; }
  .formation-panel .panel-title { font-size: 18px; white-space: nowrap; }
  .formation-panel .panel-kicker { max-width: 145px; }
  .formation-panel #crew-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .formation-panel .crew-card { min-height: 145px; grid-template-columns: 1fr; grid-template-rows: 82px minmax(0, 1fr); border-radius: 15px; }
  .formation-panel .crew-card .avatar.lg { height: 82px; min-height: 82px; }
  .formation-panel .crew-card .cc-body { padding: 7px 8px; }
  .formation-panel .crew-card .cc-title,
  .formation-panel .crew-card .cc-line { display: none; }
}

/* Compact rail labels stay visible beneath their icons. */
#sidebar {
  z-index: 30;
  overflow: hidden;
}

.nav-item {
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 6px 3px;
}

.nav-item[data-view] .nav-ico,
.nav-item.active[data-view] .nav-ico {
  width: 29px;
  height: 29px;
}

.nav-label {
  position: static;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .015em;
  line-height: 1;
  opacity: 1;
  pointer-events: none;
  transform: none;
  transition: none;
  white-space: nowrap;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

@media (max-width: 640px) {
  .nav-item {
    min-height: 50px;
    gap: 2px;
    padding: 4px 2px;
  }

  .nav-item[data-view] .nav-ico,
  .nav-item.active[data-view] .nav-ico {
    width: 26px;
    height: 26px;
  }

  .nav-label { font-size: 7px; }
}
