/* =============================================================================
   Helm — styles.css
   Helm-specific layout on top of the glass design system. Obeys glass's two
   rules: nothing paints with a raw colour that isn't a token (the ONE exception
   is each project's brand accent, injected per-card as --proj and used ONLY for
   graphic channels — key bars, dots, sparkline strokes — never body text); and
   glass material lives ONLY on the nav rail, the top bar and overlays. All
   content surfaces are opaque (.card / --surface / --raised).
   ============================================================================= */

:root {
  --rail-w: 68px;
  --topbar-h: 56px;
  --content-max: 1320px;
}

/* Inline icons default to 1em and align with text; explicit contexts (rail,
   logo, palette, integrations) override the size below. */
.ico-svg { flex: none; vertical-align: -0.14em; }
.kpi-label .ico-svg { color: var(--accent); }
.panel h3 .ico-svg { color: var(--accent); font-size: 1rem; }
.integration .ico .ico-svg { width: 18px; height: 18px; }
.status-hero .ring .ico-svg { width: 100%; height: 100%; vertical-align: baseline; }

/* ---- App shell -------------------------------------------------------------
   A fixed left icon rail + a top bar over a scrolling content column. */
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- Left icon rail (GLASS chrome) ---------------------------------------- */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-3) 0;
  background: var(--gl-fill);
  -webkit-backdrop-filter: var(--gl-blur);
  backdrop-filter: var(--gl-blur);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.rail-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--sp-2);
  color: var(--accent);
}
.rail-logo svg { width: 30px; height: 30px; display: block; }

.rail-spacer { flex: 1 1 auto; }

.rail-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}
.rail-item svg { width: 20px; height: 20px; }
.rail-item:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.rail-item[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.rail-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--accent);
}
.rail-item:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }

/* Tooltip label on hover (nav-chrome, so glass is allowed). */
.rail-item .rail-tip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(.96);
  transform-origin: left center;
  padding: 4px 10px;
  border-radius: var(--r-1);
  background: var(--gl-fill);
  -webkit-backdrop-filter: var(--gl-blur);
  backdrop-filter: var(--gl-blur);
  border: 1px solid var(--gl-edge);
  box-shadow: var(--gl-shadow);
  color: var(--ink);
  font-size: var(--fs-0);
  font-weight: 550;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  z-index: 60;
}
.rail-item:hover .rail-tip { opacity: 1; transform: translateY(-50%) scale(1); }

/* ---- Content column -------------------------------------------------------- */
.content-col { display: flex; flex-direction: column; min-width: 0; }

/* ---- Top bar (GLASS chrome) ------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--topbar-h);
  padding: var(--sp-2) var(--sp-5);
  background: var(--gl-fill);
  -webkit-backdrop-filter: var(--gl-blur);
  backdrop-filter: var(--gl-blur);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.topbar-title h1 {
  margin: 0;
  font-size: var(--fs-2);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.topbar-title .crumb { font-size: var(--fs-0); color: var(--ink-2); }
.topbar-spacer { flex: 1 1 auto; }
.topbar-tools { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }

/* Fleet summary pill in the top bar. */
.fleet-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--gl-edge);
  background: var(--gl-inner);
  color: var(--ink);
  font-size: var(--fs-0);
  font-weight: 550;
}
.fleet-pill .dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--ok); }
.fleet-pill[data-state="down"] .dot { background: var(--bad); }
.fleet-pill[data-state="degraded"] .dot { background: var(--warn); }

/* ⌘K trigger */
.kbtn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--target-min);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--gl-edge);
  border-radius: var(--r-1);
  background: var(--gl-inner);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-0);
  cursor: pointer;
}
.kbtn:hover { color: var(--ink); border-color: var(--accent); }
kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 8%, var(--surface));
  color: var(--ink-2);
}

/* ---- Main scroll area ------------------------------------------------------ */
.main {
  flex: 1 1 auto;
  overflow: auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-8);
}
.view { max-width: var(--content-max); margin: 0 auto; animation: fade-in var(--t-base) var(--ease); }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head { margin-bottom: var(--sp-5); }
.section-head h2 {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-3);
  line-height: 1.05;
  font-weight: 680;
  letter-spacing: -0.02em;
}
.section-head p { margin: 0; color: var(--ink-2); max-width: 62ch; }
.section-head .head-row { display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap; justify-content: space-between; }

/* Honesty labels. REAL = accent-tinted; SAMPLE = warn-tinted; both explicit. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 6%, var(--surface));
}
.tag-real { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--surface)); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.tag-sample { color: var(--ink); border-color: color-mix(in srgb, var(--warn) 40%, var(--surface)); background: color-mix(in srgb, var(--warn) 20%, var(--surface)); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; opacity: .8; }

/* Data-source / freshness caption beside a metric group. */
.metric-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.metric-meta-note { font-size: var(--fs-0); color: var(--ink-2); }

/* ---- KPI tiles ------------------------------------------------------------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.kpi { display: grid; gap: 6px; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.kpi-label { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink-2); font-size: var(--fs-0); }
.kpi-value { font-family: var(--font-mono); font-size: 1.7rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 0.9rem; color: var(--ink-2); }
.kpi-sub { font-size: var(--fs-0); color: var(--ink-2); }

/* ---- Fleet grid (Overview) ------------------------------------------------- */
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: var(--sp-4); }

.proj-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-4) calc(var(--sp-4) + 3px);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.proj-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--proj, var(--accent));
}
.proj-card:hover { border-color: color-mix(in srgb, var(--proj, var(--accent)) 45%, var(--line)); transform: translateY(-2px); }

.proj-head { display: flex; align-items: center; gap: var(--sp-3); }
.proj-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border-radius: var(--r-1);
  background: color-mix(in srgb, var(--proj, var(--accent)) 20%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--proj, var(--accent)) 40%, var(--surface));
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}
.proj-name { margin: 0; font-size: var(--fs-1); font-weight: 640; line-height: 1.1; }
.proj-tag { font-size: var(--fs-0); color: var(--ink-2); }
.proj-head-end { margin-left: auto; text-align: right; }

/* Status dot + label (colour is NOT the only channel: text label always present). */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-0); font-weight: 600; color: var(--ink); }
.status .dot { width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--ink-3); flex: none; }
.status[data-s="up"] .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.status[data-s="down"] .dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); }
.status[data-s="degraded"] .dot { background: var(--warn); }
.status[data-s="local"] .dot { background: var(--info); }
.status[data-s="unknown"] .dot { background: var(--ink-3); animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.proj-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-0); color: var(--ink-2); }
.proj-meta .m { display: inline-flex; align-items: baseline; gap: 5px; }
.proj-meta .m b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }

.spark { display: block; width: 100%; height: 40px; }
.spark-wrap { margin-top: auto; }
.spark-empty { height: 40px; display: grid; place-items: center; color: var(--ink-3); font-size: var(--fs-0); }

.proj-foot { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.stack-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill-mini { font-size: 0.7rem; padding: 1px 7px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 8%, var(--surface)); border: 1px solid var(--line); color: var(--ink-2); }

.linkA { color: var(--accent); text-decoration: none; font-weight: 550; font-size: var(--fs-0); display: inline-flex; align-items: center; gap: 5px; }
.linkA:hover { text-decoration: underline; }
.linkA svg { width: 13px; height: 13px; }

/* ---- Generic panel / grid helpers ----------------------------------------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: var(--sp-4); }
.panel { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); padding: var(--sp-4); }
.panel-raised { background: var(--raised); }
.panel h3 { margin: 0 0 var(--sp-3); font-size: var(--fs-2); font-weight: 620; display: flex; align-items: center; gap: var(--sp-2); }
.panel .panel-note { color: var(--ink-2); font-size: var(--fs-0); margin: 0 0 var(--sp-3); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.muted { color: var(--ink-2); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.stack-v { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ---- Bar chart (SVG) ------------------------------------------------------- */
.chart { display: block; width: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: var(--fs-0); color: var(--ink-2); margin-top: var(--sp-2); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-legend .lg b { color: var(--ink); }

/* ---- Fleet latency time-series (Overview) ---------------------------------
   A prominent multi-series latency-over-time chart, hand-drawn inline SVG (no
   chart library, CSP-clean). A √ (square-root) y-axis so one cold-starting
   machine can't squash every other service flat. Accent hexes are the allowed
   graphic-channel exception (line strokes only, never text). */
.ts-wrap { overflow-x: auto; }
.ts-chart { display: block; width: 100%; min-width: 540px; height: auto; }
.ts-grid { stroke: var(--line); stroke-width: 1; }
.ts-axis-line { stroke: color-mix(in srgb, var(--ink) 24%, var(--line)); stroke-width: 1; }
.ts-axis { fill: var(--ink-3); font-size: 10px; font-family: var(--font-mono); }
.ts-empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--ink-3); font-size: var(--fs-0); }

/* ---- p95 latency bars: budget reference line ------------------------------- */
.helm-track { position: relative; height: 10px; }
.helm-budget-tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--warn); border-radius: 2px; transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 70%, transparent); }

/* ---- Core Web Vitals threshold bars (Performance) -------------------------
   Each SAMPLE metric reads as a chart: a tinted good / needs / poor track from
   the standard Web Vitals bands, a fill coloured by the value's band, and tick
   marks at the boundaries. The numbers are kept; the SAMPLE tag stays honest. */
.vitals-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; margin-bottom: var(--sp-3); font-size: var(--fs-0); color: var(--ink-2); }
.vitals-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.vitals-legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.vcell { display: flex; flex-direction: column; gap: 4px; min-width: 6rem; }
.vbar { position: relative; height: 13px; border-radius: var(--r-pill); overflow: hidden; border: 1px solid var(--line); }
.vbar-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--r-pill); opacity: 0.9; }
.vbar-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--ink) 40%, transparent); }
.vb-good { background: var(--ok); }
.vb-needs { background: var(--warn); }
.vb-poor { background: var(--bad); }
.vnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-0); font-weight: 600; color: var(--ink); }
.vnum[data-band="good"] { color: var(--ok); }
.vnum[data-band="needs"] { color: var(--warn); }
.vnum[data-band="poor"] { color: var(--bad); }
.vitals-table td { vertical-align: middle; }

/* ---- Deploys timeline ------------------------------------------------------ */
.timeline { position: relative; margin: 0; padding: 0 0 0 var(--sp-5); list-style: none; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 var(--sp-4) 0; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: var(--r-pill); background: var(--surface); border: 2px solid var(--accent); }
.timeline li[data-kind="deploy"]::before { border-color: var(--ok); }
.timeline li[data-kind="build"]::before { border-color: var(--info); }
.tl-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.tl-when { font-family: var(--font-mono); font-size: var(--fs-0); color: var(--ink-2); }
.tl-note { color: var(--ink-2); font-size: var(--fs-0); margin-top: 2px; }

.action-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

/* ---- Ecosystem map --------------------------------------------------------- */
.map-wrap { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); padding: var(--sp-4); overflow-x: auto; }
.map-svg { display: block; width: 100%; min-width: 520px; height: auto; }
.map-node-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font-ui); }
.map-node-sub { fill: var(--ink-2); font-size: 9.5px; font-family: var(--font-ui); }
.map-edge { stroke: var(--line); stroke-width: 1.5; fill: none; }
.map-edge-mcp { stroke: var(--accent); stroke-width: 1.75; stroke-dasharray: 4 4; fill: none; }
/* Nodes are controls (open the project's health detail): pointer + hover ring
   + a visible keyboard focus ring, same affordances as the Overview cards. */
.map-node { cursor: pointer; outline: none; }
.map-node circle:nth-child(2) { transition: stroke-width var(--t-fast) var(--ease), filter var(--t-fast) var(--ease); }
.map-node:hover circle:nth-child(2), .map-node:focus-visible circle:nth-child(2) { stroke-width: 3; filter: brightness(1.15); }
.map-node:focus-visible circle:nth-child(1) { stroke: var(--focus); stroke-width: 3; }

/* ---- Status page ----------------------------------------------------------- */
.status-hero { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-6); border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); margin-bottom: var(--sp-5); }
.status-hero .ring { width: 60px; height: 60px; flex: none; }
.status-hero h2 { margin: 0; font-size: var(--fs-3); }
.status-hero p { margin: 2px 0 0; color: var(--ink-2); }
.status-list { display: grid; gap: var(--sp-2); }
.status-line { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); }
.status-line .nm { font-weight: 600; }
.status-line .end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-0); color: var(--ink-2); }

/* ---- Assistant ------------------------------------------------------------- */
.chat { display: flex; flex-direction: column; gap: var(--sp-3); min-height: 45vh; }
.chat-log { display: flex; flex-direction: column; gap: var(--sp-3); }
.bubble { max-width: 82%; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); font-size: var(--fs-1); line-height: var(--lh-3); }
.bubble.user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--surface)); color: var(--ink); }
.bubble.bot { align-self: flex-start; background: var(--raised); border: 1px solid var(--line); color: var(--ink); }
.bubble.bot .src { display: block; margin-top: var(--sp-2); font-size: var(--fs-0); color: var(--ink-2); }
.chat-input { display: flex; gap: var(--sp-2); }
.chat-input .field { flex: 1; }
.suggests { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.suggest { cursor: pointer; }

/* ---- Command palette (⌘K) overlay (GLASS) --------------------------------- */
.palette-scrim { position: fixed; inset: 0; z-index: var(--z-modal); background: color-mix(in srgb, oklch(0% 0 0) 46%, transparent); display: grid; align-items: start; justify-items: center; padding-top: 12vh; }
.palette {
  width: min(640px, 92vw);
  border-radius: var(--r-3);
  background: var(--gl-fill);
  -webkit-backdrop-filter: var(--gl-blur);
  backdrop-filter: var(--gl-blur);
  border: 1px solid var(--gl-edge);
  box-shadow: var(--gl-shadow);
  overflow: hidden;
  animation: pop var(--t-base) var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.palette-input { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid var(--gl-edge); }
.palette-input svg { width: 18px; height: 18px; color: var(--ink-2); flex: none; }
.palette-input input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font: inherit; font-size: var(--fs-2); }
.palette-input input::placeholder { color: var(--ink-3); }
.palette-list { max-height: 52vh; overflow: auto; padding: var(--sp-2); }
.palette-group { padding: var(--sp-2) var(--sp-3) 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.palette-item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-2) var(--sp-3); border: 1px solid transparent; border-radius: var(--r-1); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.palette-item .pi-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--gl-inner); color: var(--ink-2); flex: none; }
.palette-item .pi-ico svg { width: 15px; height: 15px; }
.palette-item .pi-sub { color: var(--ink-2); font-size: var(--fs-0); margin-left: auto; }
.palette-item[data-active="true"], .palette-item:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); border-color: var(--gl-edge); }
.palette-empty { padding: var(--sp-5); text-align: center; color: var(--ink-2); }

/* ---- Toasts ---------------------------------------------------------------- */
.toast-region { position: fixed; z-index: var(--z-toast); right: var(--sp-5); bottom: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); width: min(26rem, calc(100vw - var(--sp-6))); }
.toast { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px -12px oklch(0% 0 0 / .45); animation: fade-in var(--t-base) var(--ease); }
.toast .t-body { min-width: 0; }
.toast .t-title { font-weight: 620; }
.toast .t-cmd { margin-top: 4px; font-family: var(--font-mono); font-size: var(--fs-0); color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-1); padding: 6px 8px; overflow-x: auto; white-space: pre; }

/* ---- Settings -------------------------------------------------------------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .lab { display: flex; flex-direction: column; gap: 2px; }
.setting-row .lab b { font-weight: 600; }
.setting-row .lab span { font-size: var(--fs-0); color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; }
.seg button { border: none; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-0); padding: 6px 12px; cursor: pointer; min-height: var(--target-min); }
.seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--ink); }

.integration { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); }
.integration .ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-1); background: var(--raised); color: var(--ink-2); flex: none; }

/* ---- Skeleton loading ------------------------------------------------------ */
.skel { border-radius: var(--r-1); background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 6px var(--sp-2);
    border-right: none;
    border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .rail-logo { display: none; }
  .rail-spacer { display: none; }
  .rail-item[aria-current="page"]::before { display: none; }
  .rail-item .rail-tip { display: none; }
  .main { padding: var(--sp-4) var(--sp-4) 84px; }
  .topbar { padding: var(--sp-2) var(--sp-4); }
  .fleet-pill .lbl { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .view, .toast, .palette { animation: none; }
  .status[data-s="unknown"] .dot, .skel { animation: none; }
}
