/* =========================================================================
   Sylar's Work Manager — redesign stylesheet
   Themes via [data-theme], density via [data-density], motion via [data-motion]
   ========================================================================= */

:root {
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar-w: 264px;
  --sidebar-collapsed: 76px;
  --maxw: 1440px;
  /* spacing scale (comfortable default) */
  --pad-card: 22px;
  --gap: 22px;
  --row-min: 56px;
}
[data-density="compact"] {
  --pad-card: 15px;
  --gap: 14px;
  --row-min: 46px;
}

/* ---- Theme: Eclipse (refined dark, indigo) ---- */
[data-theme="eclipse"] {
  --bg: #0e1018;
  --bg-grad: radial-gradient(1100px 620px at 78% -8%, #1b2030 0%, transparent 60%), radial-gradient(900px 500px at -6% 8%, #161a2a 0%, transparent 55%);
  --surface: #161a24;
  --surface-2: #1c212e;
  --surface-3: #232a39;
  --line: rgba(255,255,255,.085);
  --line-strong: rgba(255,255,255,.15);
  --text: #eef1f8;
  --muted: #9aa3b6;
  --faint: #6c7488;
  --primary: #818cf8;
  --primary-strong: #6d78f0;
  --primary-fg: #0c0e1a;
  --primary-soft: rgba(129,140,248,.14);
  --primary-ring: rgba(129,140,248,.38);
  --success: #34d399; --success-soft: rgba(52,211,153,.14);
  --warn: #fbbf24; --warn-soft: rgba(251,191,36,.15);
  --danger: #fb7185; --danger-soft: rgba(251,113,133,.14);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -22px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ---- Theme: Carbon (warm graphite, amber) ---- */
[data-theme="carbon"] {
  --bg: #100f0d;
  --bg-grad: radial-gradient(1100px 620px at 80% -10%, #221d16 0%, transparent 58%), radial-gradient(820px 460px at -4% 6%, #1c1813 0%, transparent 55%);
  --surface: #1a1714;
  --surface-2: #221e1a;
  --surface-3: #2b2620;
  --line: rgba(255,255,255,.075);
  --line-strong: rgba(255,255,255,.14);
  --text: #f3ede2;
  --muted: #a89e8e;
  --faint: #786f60;
  --primary: #f0b357;
  --primary-strong: #e6a23c;
  --primary-fg: #1a1305;
  --primary-soft: rgba(240,179,87,.13);
  --primary-ring: rgba(240,179,87,.38);
  --success: #86d07c; --success-soft: rgba(134,208,124,.13);
  --warn: #f0b357; --warn-soft: rgba(240,179,87,.15);
  --danger: #f08a8a; --danger-soft: rgba(240,138,138,.14);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -22px rgba(0,0,0,.85);
  color-scheme: dark;
}

/* ---- Theme: Daylight (clean light, blue) ---- */
[data-theme="daylight"] {
  --bg: #eef0f4;
  --bg-grad: radial-gradient(1100px 620px at 80% -12%, #dfe6f7 0%, transparent 60%), radial-gradient(800px 460px at -4% 4%, #e6e9f0 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #eaeef4;
  --line: rgba(15,23,42,.10);
  --line-strong: rgba(15,23,42,.18);
  --text: #131722;
  --muted: #5a6477;
  --faint: #8a93a6;
  --primary: #3b6ef6;
  --primary-strong: #2f5fe0;
  --primary-fg: #ffffff;
  --primary-soft: rgba(59,110,246,.10);
  --primary-ring: rgba(59,110,246,.32);
  --success: #15a05a; --success-soft: rgba(21,160,90,.12);
  --warn: #d98316; --warn-soft: rgba(217,131,22,.14);
  --danger: #e0445b; --danger-soft: rgba(224,68,91,.12);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 14px 30px -20px rgba(15,23,42,.30);
  color-scheme: light;
}

/* ---- Theme: Obsidian (true black) ---- */
[data-theme="obsidian"] {
  --bg: #000000;
  --bg-grad: radial-gradient(1100px 620px at 80% -12%, #0a0a14 0%, transparent 60%), radial-gradient(820px 460px at -4% 4%, #07070b 0%, transparent 55%);
  --surface: #08080b;
  --surface-2: #101014;
  --surface-3: #18181d;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.14);
  --text: #f3f4f8;
  --muted: #8b8f9c;
  --faint: #595d6a;
  --primary: #c6f24a;
  --primary-strong: #b6e639;
  --primary-fg: #0a0f00;
  --primary-soft: rgba(198,242,74,.13);
  --primary-ring: rgba(198,242,74,.40);
  --success: #2fe0a0; --success-soft: rgba(47,224,160,.12);
  --warn: #f5c451; --warn-soft: rgba(245,196,81,.13);
  --danger: #ff6585; --danger-soft: rgba(255,101,133,.13);
  --shadow: 0 0 0 1px rgba(255,255,255,.02) inset, 0 24px 50px -28px rgba(0,0,0,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  width: var(--app-w, 100%);
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
#root { min-height: 100%; }
::selection { background: var(--primary-ring); }
a { color: inherit; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

/* =========================== App shell =========================== */
/* Full-height layouts use var(--app-h) (JS-maintained real viewport height that
   accounts for UI-scale zoom) with a 100vh fallback for the no-JS/default case.
   Plain 100vh overflows by the zoom factor when UI scale > 100%. */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  width: 100%;
  min-height: var(--app-h, 100vh);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  transition: grid-template-columns .32s var(--ease);
}
.app.collapsed { grid-template-columns: var(--sidebar-collapsed) 1fr; }

/* ---- Sidebar ---- */
.sidebar {
  position: sticky; top: 0; align-self: start;
  height: var(--app-h, 100vh);
  border-right: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  gap: 6px;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; min-height: 44px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--primary), color-mix(in oklab, var(--primary) 55%, var(--surface-3)));
  color: var(--primary-fg);
  box-shadow: 0 6px 16px -6px var(--primary-ring);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand-text small { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }
.collapsed .brand-text, .collapsed .nav-label, .collapsed .nav-section, .collapsed .side-foot-text { opacity: 0; pointer-events: none; }

.nav-section {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; padding: 16px 10px 6px;
  transition: opacity .2s;
}
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11.5px 12px; border-radius: var(--r-sm);
  color: var(--muted); cursor: pointer; border: none; background: none;
  font: inherit; font-size: 15.5px; font-weight: 550; width: 100%; text-align: left;
  position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-item .nav-label { white-space: nowrap; transition: opacity .2s; }
.nav-item svg { color: var(--faint); transition: color .18s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { color: var(--muted); }
.nav-item.active { background: var(--primary-soft); color: var(--text); font-weight: 650; }
.nav-item.active svg { color: var(--primary); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-badge {
  margin-left: auto; font-size: 11px; font-family: var(--font-mono);
  background: var(--surface-3); color: var(--muted); border-radius: 20px; padding: 1px 8px; min-width: 22px; text-align: center;
}
.collapsed .nav-badge { display: none; }
.nav-spacer { flex: 1; }
.side-foot {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.avatar { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--primary-fg); background: linear-gradient(140deg, var(--primary), color-mix(in oklab, var(--primary) 50%, var(--surface-3))); }
.side-foot-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.foot-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; transition: all .15s var(--ease); flex-shrink: 0; }
.foot-btn:hover { background: var(--surface-3); color: var(--text); }
.collapsed .foot-btn { display: none; }
.side-foot-text b { font-size: 12.5px; }
.side-foot-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Topbar ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
}
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; transition: all .18s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 40px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  transition: all .2s var(--ease);
}
.search:focus-within { border-color: var(--primary-ring); box-shadow: 0 0 0 3px var(--primary-soft); }
.search input { border: none; background: none; outline: none; color: var(--text); font: inherit; font-size: 13.5px; width: 100%; }
.search input::placeholder { color: var(--faint); }
.search kbd {
  font-family: var(--font-mono); font-size: 11px; color: var(--faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; background: var(--surface-2);
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-dot { position: relative; }
.top-dot::after { content: ""; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }

/* ---- Content ---- */
.content { padding: 30px; }
.page { width: min(var(--maxw), 100%); margin: 0 auto; }
[data-motion="on"] .page { animation: pageIn .45s var(--ease); }
@keyframes pageIn { from { transform: translateY(12px); } to { transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: var(--gap); flex-wrap: wrap; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); font-weight: 700; font-family: var(--font-mono); }
.page-title { font-size: 31px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 6px; }
.page-sub { color: var(--muted); font-size: 15px; max-width: 64ch; line-height: 1.5; }

/* =========================== Primitives =========================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--pad-card);
  box-shadow: var(--shadow);
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .5s var(--ease);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.card-head p { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; }
.section-title { font-size: 14px; font-weight: 650; color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: all .18s var(--ease);
}
.btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: 0 8px 20px -10px var(--primary-ring); }
.btn-primary:hover { background: var(--primary-strong); transform: translateY(-1px); box-shadow: 0 12px 24px -10px var(--primary-ring); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-subtle { background: transparent; color: var(--muted); }
.btn-subtle:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 7px; font-size: 11.5px; font-weight: 600; font-family: var(--font-mono);
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line);
}
.badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.pri { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

.tag { font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; position: relative; }
.status-dot.healthy, .status-dot.running, .status-dot.connected { background: var(--success); }
.status-dot.idle, .status-dot.paused { background: var(--faint); }
.status-dot.attention, .status-dot.needs-login, .status-dot.err { background: var(--danger); }
.status-dot.provisioning, .status-dot.warn { background: var(--warn); }
.status-dot.live::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid currentColor;
  color: inherit; background: inherit; animation: ping 1.8s var(--ease) infinite; opacity: 0;
}
.status-dot.healthy.live::after, .status-dot.running.live::after { border-color: var(--success); }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%,100% { transform: scale(2.2); opacity: 0; } }
[data-motion="off"] .status-dot.live::after { display: none; }

/* form controls */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 650; color: var(--muted); }
.input, .select {
  height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); padding: 0 13px; font: inherit; font-size: 14.5px;
  transition: all .18s var(--ease); width: 100%;
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--primary-ring); box-shadow: 0 0 0 3px var(--primary-soft); background: var(--surface); }
.select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.toggle {
  width: 40px; height: 23px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line);
  position: relative; cursor: pointer; flex-shrink: 0; transition: background .22s var(--ease), border-color .22s; padding: 0;
}
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .22s var(--ease), background .22s; }
.toggle.on { background: var(--primary); border-color: transparent; }
.toggle.on::after { transform: translateX(17px); background: var(--primary-fg); }

/* grids */
.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr); gap: var(--gap); }

/* stat card */
.stat { position: relative; overflow: hidden; }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-val { font-size: 36px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-delta { font-size: 11.5px; font-family: var(--font-mono); margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; }
.stat-delta.up { color: var(--success); }
.stat-delta.flat { color: var(--faint); }

/* list rows */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 13px; min-height: var(--row-min);
  padding: 11px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2);
  transition: all .16s var(--ease); cursor: pointer; text-align: left; width: 100%; font: inherit;
}
.row:hover { border-color: var(--line-strong); background: var(--surface-3); transform: translateX(2px); }
.row.sel { border-color: var(--primary-ring); background: var(--primary-soft); }
.row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.row-main b { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.row-main .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.row-sub { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.scroll { max-height: calc(var(--app-h, 100vh) * 0.62); overflow: auto; padding-right: 4px; margin-right: -4px; }

/* checkbox */
.ck { width: 19px; height: 19px; border-radius: 6px; border: 1.6px solid var(--line-strong); display: grid; place-items: center; flex-shrink: 0; transition: all .16s var(--ease); color: transparent; }
.ck.on { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }

/* avatar/repo glyph */
.glyph { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--text); background: var(--surface-3); border: 1px solid var(--line); }

/* activity timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1.5px; background: var(--line); }
.tl-node { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); color: var(--muted); z-index: 1; }
.tl-node.plan { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.tl-node.build { color: var(--success); background: var(--success-soft); border-color: transparent; }
.tl-node.alert { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.tl-node.discord, .tl-node.deploy { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.tl-body { display: flex; flex-direction: column; gap: 3px; }
.tl-body .t { font-size: 13.5px; line-height: 1.45; }
.tl-meta { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); display: flex; gap: 8px; }

/* progress / meter */
.meter { height: 7px; border-radius: 20px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 20px; background: var(--primary); }
.meter.ok > i { background: var(--success); }
.meter.warn > i { background: var(--warn); }

/* sparkline bars */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.spark > i { flex: 1; background: var(--primary-soft); border-radius: 3px 3px 0 0; }
.spark > i.hot { background: var(--primary); }

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 0 14px 12px; }
.tbl td { padding: 13px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr.clk { cursor: pointer; transition: background .15s; }
.tbl tr.clk:hover td { background: var(--surface-2); }
.mono { font-family: var(--font-mono); }

/* log viewer */
.logbox { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; max-height: 360px; overflow: auto; }
.logline { display: flex; gap: 12px; padding: 1px 0; white-space: nowrap; }
[data-motion="on"] .logline { animation: logIn .35s var(--ease); }
@keyframes logIn { from { transform: translateX(-8px); } to { transform: none; } }
.logline .ts { color: var(--faint); }
.logline .svc { color: var(--primary); }
.logline .lvl-info { color: var(--muted); }
.logline .lvl-warn { color: var(--warn); }
.logline .lvl-err { color: var(--danger); }

/* chips row */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* detail drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); z-index: 60; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); z-index: 61;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -30px rgba(0,0,0,.6);
  display: flex; flex-direction: column; animation: slideIn .34s var(--ease);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-body { padding: 22px 24px; overflow: auto; display: flex; flex-direction: column; gap: 22px; }

/* provider/login card */
.prov-logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 15px; flex-shrink: 0; }

/* model route pill */
.route { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.route .rk { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; width: 64px; flex-shrink: 0; }

/* signin */
.signin { min-height: var(--app-h, 100vh); display: grid; place-items: center; padding: 24px; background: var(--bg-grad), var(--bg); }
.signin-card { width: min(420px, 100%); }
[data-motion="on"] .signin-card { animation: pageIn .5s var(--ease); }

/* misc helpers */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 13.5px; }

/* repo creator grid */
.creator-grid { display: grid; grid-template-columns: minmax(240px, 320px) 1fr auto; gap: 16px; align-items: start; }
@media (max-width: 1080px) {
  .creator-grid { grid-template-columns: 1fr; }
  .creator-grid .field:last-child label { display: none; }
}

/* counters */
.count-up { font-variant-numeric: tabular-nums; }

/* responsive */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 70; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .3s var(--ease); }
  .app.mobile-open .sidebar { transform: none; }
  .cols-2 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================================
   Screen-specific styles
   ========================================================================= */

/* nav groups (collapsible) */
.nav-group-head { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 18px 12px 6px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; user-select: none; }
.nav-group-head .nav-section { padding: 0; }
.nav-group-head .chev { color: var(--faint); transition: transform .2s var(--ease); }
.nav-group-head.closed .chev { transform: rotate(-90deg); }
.nav-sessions { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.session-link { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 7px; color: var(--muted); font-size: 13.5px; cursor: pointer; border: none; background: none; font: inherit; width: 100%; text-align: left; transition: background .15s, color .15s; }
.session-link:hover { background: var(--surface-2); color: var(--text); }
.session-link .st { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-edit-row { display: flex; align-items: center; gap: 4px; border-radius: 7px; }
.session-edit-row.active { background: var(--primary-soft); }
.session-edit-row .session-link { min-width: 0; }
.session-edit-row .input { height: 32px; min-width: 0; padding: 5px 8px; font-size: 12px; }
.session-edit-row .icon-btn { width: 28px; height: 28px; flex: 0 0 28px; }
.session-rename { opacity: .65; }
.session-edit-row:hover .session-rename { opacity: 1; }
.collapsed .nav-sessions, .collapsed .nav-group-head .chev { display: none; }

/* status strip */
.statusbar { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 11px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); margin-bottom: var(--gap); }
.statusbar .sep { color: var(--faint); }

/* corner glow on stat cards */
.stat.glow::after { content: ""; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--primary-soft), transparent 70%); pointer-events: none; }

/* SVG chart */
.chart-wrap { position: relative; width: 100%; }
.chart-empty { display: grid; place-items: center; height: 180px; color: var(--muted); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; cursor: pointer; font-family: var(--font-mono); transition: all .15s; }
.seg button.on { background: var(--primary-soft); color: var(--primary); }
.seg button:not(:last-child) { border-right: 1px solid var(--line); }

/* skills usage bars */
.usebar { display: grid; grid-template-columns: 90px 1fr 40px; gap: 10px; align-items: center; font-size: 12.5px; padding: 6px 0; }
.usebar .nm { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usebar .vl { font-family: var(--font-mono); color: var(--muted); text-align: right; }

/* achievement */
.ach { display: flex; align-items: center; gap: 11px; padding: 9px 0; }
.ach .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.ach.on .ic { background: var(--warn-soft); color: var(--warn); }
.ach.off { opacity: .5; }
.ach.off .ic { background: var(--surface-3); color: var(--faint); }

/* ===== Chat ===== */
/* Width follows the Settings → Chat "content width" pref via data-chat-width on <html>. */
.chat-wrap { display: flex; flex-direction: column; height: calc(var(--app-h, 100vh) - 70px - 60px); width: 100%; max-width: var(--chat-maxw, 900px); margin: 0 auto; }
[data-chat-width="wide"] { --chat-maxw: 1200px; }
[data-chat-width="full"] { --chat-maxw: 100%; }
.chat-head { text-align: center; padding: 8px 0 20px; }
.agent-ring { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; position: relative; }
.agent-ring::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--success); }
.agent-ava { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-size: 26px; }
.chat-scroll { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 18px; padding: 8px 4px 20px; }
.msg { display: flex; gap: 12px; max-width: 100%; }
.msg.user { flex-direction: row-reverse; }
.msg-ava { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; font-size: 14px; color: var(--primary-fg); }
.msg-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.msg.user .msg-body { align-items: flex-end; }
.bubble { padding: 13px 16px; border-radius: 14px; font-size: 15px; line-height: 1.6; max-width: 600px; }
.msg.assistant .bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.user .bubble { background: var(--primary-soft); border: 1px solid var(--primary-ring); border-top-right-radius: 4px; }
.msg-meta { font-size: 11px; color: var(--faint); font-family: var(--font-mono); }
.bubble strong { color: var(--text); font-weight: 700; }
.bubble code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.tool-chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.composer { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--primary-ring); box-shadow: 0 0 0 3px var(--primary-soft); }
.composer textarea { width: 100%; border: none; background: none; outline: none; resize: none; color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; min-height: 24px; max-height: 160px; }
.composer textarea::placeholder { color: var(--faint); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.send-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--primary-fg); border: none; cursor: pointer; transition: all .15s; }
.send-btn:hover { background: var(--primary-strong); transform: translateY(-1px); }
.model-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: var(--surface-2); cursor: pointer; }
.model-pill:hover { color: var(--text); border-color: var(--line-strong); }
.chat-model-menu { max-height: min(520px, 70vh); overflow-y: auto; }

/* ===== Files ===== */
.explorer { display: grid; grid-template-columns: 260px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); min-height: 520px; }
.tree { border-right: 1px solid var(--line); padding: 12px; overflow: auto; background: var(--surface-2); }
.tree-row { display: flex; width: 100%; align-items: center; gap: 7px; padding: 5px 8px; border: 0; background: transparent; text-align: left; font: inherit; border-radius: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tree-row:hover { background: var(--surface-3); color: var(--text); }
.tree-row.active { background: var(--primary-soft); color: var(--text); }
.tree-row.file { font-family: var(--font-mono); font-size: 12.5px; }
.code-pane { display: flex; flex-direction: column; min-width: 0; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.code-body { padding: 16px 18px; overflow: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; flex: 1; }
.code-body pre { margin: 0; white-space: pre; }
.gutter { color: var(--faint); user-select: none; display: inline-block; width: 28px; text-align: right; margin-right: 16px; }

/* ===== Terminal ===== */
.term { background: #07070b; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; font-family: var(--font-mono); }
[data-theme="daylight"] .term { background: #0e1118; }
.term-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; }
.term-body { padding: 16px; min-height: 420px; font-size: 13px; line-height: 1.65; color: #d6dae3; overflow: auto; }
.term-body .prompt { color: var(--success); }
.term-body .cmd { color: #f3f4f8; }
.term-body .out { color: #98a0b0; white-space: pre-wrap; }
.term-input { display: flex; align-items: center; gap: 8px; }
.term-input input { flex: 1; background: none; border: none; outline: none; color: #f3f4f8; font: inherit; font-size: 13px; }
.cursor-blink { display: inline-block; width: 8px; height: 15px; background: var(--success); animation: blink 1.1s steps(2) infinite; vertical-align: -2px; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Jobs ===== */
.job-row { display: grid; grid-template-columns: 1fr 130px 90px 80px; gap: 14px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }

/* ===== Kanban ===== */
.kanban-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.btn-count { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--muted); font: 600 10px var(--font-mono); }
.kanban-overview { display: grid; grid-template-columns: repeat(3, auto) minmax(220px, 1fr); align-items: center; gap: 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.kanban-stat { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 6px; min-width: 72px; }
.kanban-stat strong { font-size: 18px; line-height: 1; }
.kanban-stat span { color: var(--muted); font-size: 12px; }
.kanban-stat.attention strong, .kanban-stat.attention span { color: var(--danger); }
.kanban-progress { min-width: 0; }
.kanban-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 11.5px; }
.kanban-progress strong { color: var(--text); font: 600 11px var(--font-mono); }
.kanban-progress-track { height: 5px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.kanban-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kcol { min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); min-height: 220px; display: flex; flex-direction: column; transition: background .15s, border-color .15s; }
.kcol.over { border-color: var(--primary-ring); background: var(--primary-soft); }
.kcol.locked.over { border-color: var(--line); background: var(--surface-2); }
.kcol-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 58px; padding: 10px 11px; border-bottom: 1px solid var(--line); }
.lane-dot { width: 8px; height: 8px; border-radius: 50%; }
.lane-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lane-title b { overflow: hidden; font-size: 12.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.lane-title small { overflow: hidden; color: var(--faint); font-size: 9.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.kcol-head .cnt { min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); color: var(--muted); font: 600 10px var(--font-mono); }
.kcol-head .add { color: var(--faint); cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; }
.kcol-head .add:hover { background: var(--surface-3); color: var(--text); }
.kcol-body { min-width: 0; padding: 9px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kcard { min-width: 0; background: var(--surface); border: 1px solid color-mix(in oklab, var(--agent-color, var(--primary)) 22%, var(--line)); border-radius: 9px; padding: 10px 11px; cursor: grab; transition: transform .12s, box-shadow .12s, border-color .12s; }
.kcard:hover { transform: translateY(-1px); border-color: color-mix(in oklab, var(--agent-color, var(--primary)) 48%, var(--line)); box-shadow: 0 8px 18px -12px rgba(0,0,0,.65); }
.kcard.dragging { opacity: .4; }
.kcard .kt { font-size: 12.5px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.kcard .kf { min-width: 0; display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10.5px; color: var(--faint); }
.kcard .tag { max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { padding: 2px 5px; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.kempty { text-align: center; color: var(--faint); font-size: 11px; padding: 17px 7px; border: 1px dashed var(--line); border-radius: 8px; }

.archive-scrim { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; background: rgba(4, 6, 12, .58); }
.archive-panel { width: min(520px, calc(100vw - 24px)); height: 100%; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -24px 0 60px -34px rgba(0,0,0,.9); animation: archiveIn .22s var(--ease); }
@keyframes archiveIn { from { transform: translateX(24px); opacity: .6; } }
.archive-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.archive-kicker { display: block; margin-bottom: 6px; color: var(--success); font-size: 11px; font-weight: 650; }
.archive-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.archive-head h2 span { color: var(--faint); font: 500 13px var(--font-mono); }
.archive-head p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.archive-search { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; margin: 18px 24px 8px; padding: 0 11px; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--faint); }
.archive-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.archive-search input { min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.archive-search button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer; }
.archive-search button:hover { background: var(--surface-3); color: var(--text); }
.archive-result-count { padding: 0 24px 8px; color: var(--faint); font: 500 10.5px var(--font-mono); }
.archive-list { min-height: 0; overflow-y: auto; padding: 0 16px 24px; }
.archive-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.archive-row:hover { background: var(--surface-2); }
.archive-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.archive-row-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.archive-row-main strong { overflow: hidden; font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.archive-row-main small { overflow: hidden; color: var(--faint); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.archive-row-meta { color: var(--faint); font: 500 9.5px var(--font-mono); white-space: nowrap; }
.archive-empty { padding: 48px 20px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 1240px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .kanban-overview { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .kanban-progress { grid-column: 1 / -1; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .watchdog-overview .card-head { align-items: stretch; flex-direction: column; }
  .watchdog-actions { width: 100%; flex-wrap: wrap; }
  .kanban-actions { justify-content: flex-start; }
  .kanban-overview { grid-template-columns: repeat(3, 1fr); }
  .board { grid-template-columns: 1fr; }
  .kcol { min-height: 0; }
  .archive-head { padding: 20px 18px 16px; }
  .archive-search { margin-inline: 18px; }
  .archive-result-count { padding-inline: 18px; }
  .archive-row { grid-template-columns: minmax(0, 1fr) auto; }
  .archive-row-meta { display: none; }
}

/* ===== Conductor office ===== */
.mission-team-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid color-mix(in oklab, var(--primary) 36%, var(--line)); border-radius: 10px; background: color-mix(in oklab, var(--primary) 6%, var(--surface)); }
.mission-team-note > div { display: flex; flex-direction: column; gap: 3px; }
.mission-team-note strong { font-size: 13px; }
.mission-team-note span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.office { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.org-office { min-height: 720px; padding: 24px; background: radial-gradient(circle at 50% -20%, color-mix(in oklab, var(--primary) 11%, transparent), transparent 42%), var(--surface-2); }
.office-floor-label { display: flex; align-items: center; gap: 7px; color: var(--faint); font: 600 10px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.mission-orchestrator { width: min(430px, 100%); margin: 0 auto 18px; padding: 14px; border: 1px solid color-mix(in oklab, #f97316 55%, var(--line)); border-radius: 12px; background: color-mix(in oklab, #f97316 7%, var(--surface)); }
.mission-orchestrator > .office-zone-kicker { display: block; text-align: center; margin-bottom: 9px; color: #fb923c; }
.office-zones { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.office-zone { min-width: 0; padding: 16px; border: 1px solid color-mix(in oklab, var(--zone-color) 36%, var(--line)); border-radius: 13px; background: color-mix(in oklab, var(--zone-color) 4%, var(--surface)); }
.office-zone-leadership { --zone-color: #8b5cf6; grid-column: span 3; }
.office-zone-product { --zone-color: #3b82f6; grid-column: span 9; }
.office-zone-engineering { --zone-color: #10b981; grid-column: span 8; }
.office-zone-quality { --zone-color: #eab308; grid-column: span 4; }
.office-zone-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 48px; margin-bottom: 14px; }
.office-zone-kicker { color: var(--zone-color, var(--primary)); font: 700 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.office-zone-head p { color: var(--faint); font-size: 11.5px; line-height: 1.35; margin: 4px 0 0; }
.office-zone-agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 11px; }
.office-zone-leadership .office-zone-agents { grid-template-columns: 1fr; }
.office-agent { min-width: 0; min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 13px 10px 10px; color: var(--text); font: inherit; text-align: center; cursor: pointer; border: 1px solid color-mix(in oklab, var(--agent-color) 42%, var(--line)); border-radius: 11px; background: linear-gradient(155deg, color-mix(in oklab, var(--agent-color) 12%, var(--surface-2)), var(--surface)); transition: transform .16s, border-color .16s, box-shadow .16s; }
.office-agent:hover { transform: translateY(-3px); border-color: var(--agent-color); box-shadow: 0 10px 24px -16px var(--agent-color); }
.office-agent:focus-visible { outline: 2px solid var(--agent-color); outline-offset: 2px; }
.office-agent.featured { min-height: 164px; }
.office-agent-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.office-agent-copy strong { color: var(--text); font-size: 12.5px; }
.office-agent-copy small { color: var(--muted); font-size: 10.5px; line-height: 1.25; }
.office-agent-status { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font: 500 9px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.office-agent-status > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.office-agent-status.running { color: var(--success); }

/* ===== Swarm ===== */
.swarm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.agent-card { display: flex; flex-direction: column; gap: 13px; }
.agent-top { display: flex; align-items: center; gap: 12px; }
.agent-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }

/* ===== Skills / MCP / Memory / Profiles ===== */
.skill-card { display: flex; flex-direction: column; gap: 10px; }
.kind-tag { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 5px; font-weight: 600; }
.kind-fact { background: var(--primary-soft); color: var(--primary); }
.kind-preference { background: var(--success-soft); color: var(--success); }
.kind-decision { background: var(--warn-soft); color: var(--warn); }

/* ===== Theme gallery ===== */
.theme-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.theme-card { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 0; overflow: hidden; cursor: pointer; background: var(--surface-2); transition: transform .15s, border-color .15s; text-align: left; }
.theme-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.theme-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.theme-prev { height: 86px; padding: 12px; position: relative; }
.theme-prev .pdot { position: absolute; width: 18px; height: 18px; border-radius: 6px; top: 12px; left: 12px; }
.theme-prev .pbar { position: absolute; height: 5px; border-radius: 4px; }
.theme-meta { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--line); }
.theme-meta b { font-size: 13px; }
.theme-meta .chk { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-fg); }

@media (max-width: 1080px) {
  .swarm-grid { grid-template-columns: repeat(2, 1fr); }
  .office-zone-leadership, .office-zone-product, .office-zone-engineering, .office-zone-quality { grid-column: span 6; }
  .org-office { min-height: 0; }
}
@media (max-width: 720px) {
  .explorer { grid-template-columns: 1fr; }
  .mission-team-note { align-items: flex-start; flex-direction: column; }
  .office-zone-leadership, .office-zone-product, .office-zone-engineering, .office-zone-quality { grid-column: 1 / -1; }
  .office-zone-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-office { padding: 16px; }
}

/* ===== Comprehensive Settings ===== */
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: var(--gap); align-items: start; }
.settings-nav { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 2px; }
.set-navitem { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font: inherit; font-size: 14.5px; font-weight: 550; color: var(--muted); background: none; border: none; cursor: pointer; text-align: left; width: 100%; transition: all .15s var(--ease); }
.set-navitem:hover { background: var(--surface-2); color: var(--text); }
.set-navitem.on { background: var(--primary-soft); color: var(--text); font-weight: 650; }
.set-navitem.on svg { color: var(--primary); }
.set-navitem svg { color: var(--faint); }
.set-section { display: flex; flex-direction: column; gap: var(--gap); }
.set-card-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 18px; }
.set-card-head .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--primary); flex-shrink: 0; border: 1px solid var(--line); }
.set-card-head h2 { font-size: 17px; font-weight: 650; margin: 0; }
.set-card-head p { font-size: 13.5px; color: var(--muted); margin: 3px 0 0; }
.set-field { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.set-field:first-of-type { border-top: none; }
.set-field .lbl b { font-size: 14.5px; font-weight: 600; display: block; }
.set-field .lbl span { font-size: 13px; color: var(--muted); }

/* provider grid */
.prov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.prov-tile { position: relative; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-md); padding: 14px; cursor: pointer; transition: all .15s var(--ease); display: flex; flex-direction: column; gap: 10px; min-height: 92px; }
.prov-tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.prov-tile.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.prov-tile .badge-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; font-family: var(--font-mono); }
.prov-tile b { font-size: 13.5px; }
.prov-tile small { font-size: 11.5px; color: var(--muted); display: block; margin-top: 1px; }
.prov-tile .pstat { position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; }

/* key rows */
.keyrow { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.keyrow:first-of-type { border-top: none; }
.keyrow .badge-logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; font-family: var(--font-mono); flex-shrink: 0; }

/* accent swatches */
.accent-row { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-sw { width: 40px; height: 40px; border-radius: 11px; cursor: pointer; border: 2px solid transparent; position: relative; transition: transform .15s; display: grid; place-items: center; }
.accent-sw:hover { transform: scale(1.08); }
.accent-sw.on { border-color: var(--text); }
.accent-sw .nm { position: absolute; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .set-navitem { width: auto; }
  .prov-grid { grid-template-columns: repeat(2, 1fr); }
  .set-field { grid-template-columns: 1fr; }
}
