/* Layan.ai — Agents page: wisps, panel, states, anatomy, handoffs */

/* ---------- constellation field ---------- */
.field {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; display: flex; align-items: flex-start;
  padding-top: clamp(88px, 9vw, 112px);
}
.field-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; cursor: crosshair; touch-action: none; }
.field-canvas.is-over { cursor: pointer; }
.field-grid { z-index: 0; mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 10%, transparent 70%); }
.field-copy {
  position: relative; z-index: 1; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4);
  max-width: 520px; margin-left: max(var(--gutter), calc((100% - var(--container)) / 2));
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.field-copy > * { pointer-events: auto; }
.field-title { font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4rem); font-weight: 500; letter-spacing: -0.035em; text-wrap: balance; }
.field-copy .hero-sub { font-size: var(--fs-md); max-width: 44ch; }
.field-hint { font-size: var(--fs-sm); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.field-hint::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); animation: pulse 1.6s infinite; --pill-c: var(--signal); }
.field.has-selection .field-copy { opacity: 0; transform: translateX(-24px); pointer-events: none; }
.field.has-selection .field-copy > * { pointer-events: none; }

/* hover label follows the wisp */
.wisp-label {
  position: absolute; z-index: 2; left: 0; top: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 8px; border-radius: 4px 12px 12px 12px;
  font-size: var(--fs-xs); font-weight: 500; color: var(--paper);
  background: rgba(7, 20, 51, 0.85); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px); opacity: 0; transform: translate(14px, 14px) scale(0.96);
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.wisp-label.is-on { opacity: 1; transform: translate(14px, 14px) scale(1); }
.wisp-label-dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h, 214) 95% 70%); box-shadow: 0 0 10px hsl(var(--h, 214) 95% 70%); }
.wisp-label-state { color: var(--muted); font-weight: 400; }

/* dock: one chip per wisp, always reachable by keyboard */
.field-dock {
  position: absolute; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  padding: 6px; border-radius: var(--r-pill); border: 1px solid var(--line); background: rgba(7, 20, 51, 0.7); backdrop-filter: blur(10px);
  max-width: calc(100% - 32px);
}
.dock-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 8px;
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 500; color: var(--frost);
  transition: background var(--t-fast), color var(--t-fast);
}
.dock-chip:hover { background: rgba(170, 206, 253, 0.08); color: var(--paper); }
.dock-chip.is-on { background: rgba(96, 157, 252, 0.18); color: var(--paper); }
.dock-chip .pa-orb { width: 12px; height: 12px; }
.dock-chip.is-waiting .pa-orb { box-shadow: 0 0 0 2px var(--warn), 0 0 10px hsl(var(--h) 95% 70%); }

/* ---------- agent panel (rim-lit glass) ---------- */
.panel-agent {
  position: absolute; z-index: 3; top: 50%; right: max(var(--gutter), calc((100% - var(--container)) / 2));
  width: min(400px, calc(100% - 2 * var(--gutter))); /* keep in sync with treeSpan() in js/wisps.js (400 here, 370 at 901-1180px) */
  height: min(540px, calc(100vh - 160px));
  transform: translate(28px, -50%); opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  border-radius: 22px; padding: 1px;
}
.panel-agent[hidden] { display: none; }
.panel-agent.is-in { opacity: 1; transform: translate(0, -50%); }
.panel-rim {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: conic-gradient(from var(--rim-angle, 0deg), transparent 0 60%, hsl(var(--h, 214) 95% 70%) 78%, #fff 82%, hsl(var(--h, 214) 95% 70%) 86%, transparent 100%);
  animation: rim 5s linear infinite;
  filter: drop-shadow(0 0 14px hsl(var(--h, 214) 95% 65% / 0.6));
}
@property --rim-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes rim { to { --rim-angle: 360deg; } }
.panel-inner {
  position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; gap: 12px;
  border-radius: 21px; padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(9, 22, 58, 0.92), rgba(4, 12, 34, 0.96));
  border: 1px solid rgba(170, 206, 253, 0.16);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(228, 241, 255, 0.06);
  backdrop-filter: blur(18px);
}
.panel-inner::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at 20% 0%, hsl(var(--h, 214) 90% 60% / 0.22), transparent 60%);
}
.pa-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pa-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pa-id h2 { font-size: var(--fs-lg); font-weight: 600; }
.pa-objective { font-size: var(--fs-xs); color: var(--muted); max-width: 34ch; }
.pa-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pa-close { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--frost); border: 1px solid var(--line); transition: background var(--t-fast), color var(--t-fast); }
.pa-close:hover { background: rgba(170, 206, 253, 0.08); color: var(--paper); }

/* the orb: CSS twin of the canvas wisp, used in chips, panel, spec, flow */
.pa-orb {
  --h: 214; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: radial-gradient(circle at 40% 35%, #fff 0, hsl(var(--h) 95% 78%) 18%, hsl(var(--h) 90% 55%) 45%, hsl(var(--h) 80% 30% / 0.2) 70%, transparent 72%);
  box-shadow: 0 0 22px hsl(var(--h) 95% 65% / 0.7), 0 0 60px -10px hsl(var(--h) 95% 60% / 0.6);
  animation: breathe 3.2s ease-in-out infinite;
}
.pa-orb::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid hsl(var(--h) 95% 70% / 0.35); animation: ring 3.2s ease-out infinite; }
.pa-orb.is-thinking { animation-duration: 0.9s; }
.pa-orb.is-thinking::after { animation-duration: 0.9s; }
.pa-orb.is-waiting { box-shadow: 0 0 0 3px var(--warn), 0 0 22px hsl(var(--h) 95% 65% / 0.7); }
.pa-orb.is-paused { filter: grayscale(1) brightness(0.6); animation: none; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes ring { from { transform: scale(0.9); opacity: 0.7; } to { transform: scale(1.5); opacity: 0; } }

/* the panel is narrower now (400px), so the six tabs scroll sideways inside the panel instead of spilling past its edge */
.pa-tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: rgba(2, 9, 31, 0.55); border: 1px solid var(--line); align-self: flex-start; max-width: 100%; flex-shrink: 0; overflow-x: auto; scrollbar-width: none; }
.pa-tabs::-webkit-scrollbar { display: none; }
.pa-tab { font-size: var(--fs-xs); font-weight: 500; color: var(--frost); padding: 6px 10px; border-radius: 7px; white-space: nowrap; flex-shrink: 0; transition: background var(--t-fast), color var(--t-fast); }
.pa-tab.is-on { background: rgba(96, 157, 252, 0.18); color: var(--paper); }
.pa-view { display: none; flex: 1; min-height: 0; flex-direction: column; gap: 10px; }
.pa-view.is-on { display: flex; }

/* talk: the thread is a proper scroll region (thin scrollbar, contained overscroll, fade at the top, stable gutter) with a jump button when new replies land off-screen */
.pa-thread-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pa-thread {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: auto;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; scrollbar-gutter: stable;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 6px 6px 0;
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 4px), transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 4px), transparent 100%);
}
.pa-thread::-webkit-scrollbar { width: 6px; }
.pa-thread::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.pa-thread::-webkit-scrollbar-thumb:hover { background: var(--frost); }
.pa-jump {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--paper); color: var(--abyss); font-size: var(--fs-xs); font-weight: 500;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(2, 9, 31, 0.1); animation: rise 240ms var(--ease-out) both;
}
.pa-jump[hidden] { display: none; }
.pa-msg-agent .pa-msg-body { min-width: 0; }
.pa-text { overflow-wrap: anywhere; }
.pa-text.is-streaming::after { content: ""; display: inline-block; width: 6px; height: 14px; margin-left: 2px; vertical-align: -2px; border-radius: 1px; background: hsl(var(--h, 214) 95% 70%); animation: blink 0.9s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
.pa-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.03em; color: var(--muted); }
.pa-meta .ev { vertical-align: 0; }
.pa-msg { max-width: 92%; font-size: var(--fs-sm); line-height: 1.5; animation: rise 300ms var(--ease-out) both; }
.pa-msg-user { align-self: flex-end; background: var(--cobalt); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; }
.pa-msg-agent { align-self: flex-start; display: grid; grid-template-columns: 18px 1fr; gap: 10px; color: var(--paper-2); }
.pa-msg-agent .pa-orb { width: 18px; height: 18px; margin-top: 3px; }
.pa-msg-agent .pa-orb::after { inset: -3px; }
.pa-msg-body { display: grid; gap: 6px; }
.pa-msg-body .ev { vertical-align: 1px; }
.pa-step { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pa-step::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--h, 214) 95% 70%); }
.pa-step.is-done::before { background: var(--ok); }
.pa-step time { margin-left: auto; font-family: var(--font-mono); font-size: 0.62rem; }
.pa-gate { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid rgba(242, 184, 75, 0.45); background: rgba(242, 184, 75, 0.08); color: var(--paper-2); font-size: var(--fs-sm); }
.pa-gate b { color: var(--warn); font-weight: 500; }
.pa-gate-actions { display: flex; gap: 6px; }
.pa-gate-actions .btn { height: 28px; padding: 0 10px; font-size: var(--fs-xs); }
.pa-suggest { display: flex; gap: 6px; flex-wrap: wrap; }
.pa-suggest button { font-size: var(--fs-xs); color: var(--frost); padding: 5px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); background: rgba(2, 9, 31, 0.4); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.pa-suggest button:hover { background: rgba(96, 157, 252, 0.12); color: var(--paper); border-color: var(--line-strong); }
.pa-compose { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: rgba(228, 241, 255, 0.96); color: var(--abyss); box-shadow: 0 0 0 1px rgba(228, 241, 255, 0.3), 0 18px 50px -20px hsl(var(--h, 214) 95% 65% / 0.6); }
.pa-compose input { flex: 1; border: 0; background: none; outline: none; font: inherit; font-size: var(--fs-sm); color: var(--abyss); min-width: 0; }
.pa-compose input::placeholder { color: #4A5E86; }
.pa-compose .prompt-send { width: 34px; height: 34px; border-radius: 10px; }

/* contract */
.contract { margin: 0; display: grid; gap: 8px; overflow-y: auto; font-size: var(--fs-sm); }
.contract > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.contract > div:last-child { border-bottom: 0; }
.contract dt { color: var(--muted); font-size: var(--fs-xs); padding-top: 2px; }
.contract dd { margin: 0; color: var(--paper-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.scope, .tool { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.04em; padding: 3px 7px; border-radius: 4px; }
.scope { background: rgba(96, 157, 252, 0.12); color: var(--frost); border: 1px solid rgba(96, 157, 252, 0.3); }
.scope-off { opacity: 0.4; text-decoration: line-through; }
.tool { background: rgba(170, 206, 253, 0.06); color: var(--paper-2); border: 1px solid var(--line); }

/* trace */
.trace { margin: 0; display: grid; gap: 2px; overflow-y: auto; font-size: var(--fs-sm); }
.trace li { display: grid; grid-template-columns: 14px 1fr auto; text-align: left; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--paper-2); animation: rise 300ms var(--ease-out) both; }
.trace li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h, 214) 95% 70%); box-shadow: 0 0 8px hsl(var(--h, 214) 95% 70%); align-self: center; }
.trace li.is-gate::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.trace li.is-fail::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.trace li b { font-weight: 500; color: var(--paper); }
.trace li small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.trace time { font-family: var(--font-mono); font-size: 0.64rem; color: var(--muted); }

.pa-text { white-space: pre-line; }
@media (max-width: 1180px) and (min-width: 901px) { .panel-agent { width: min(370px, calc(100% - 2 * var(--gutter))); } }
@media (max-width: 900px) {
  .field { min-height: 100vh; padding-bottom: 96px; }
  .field-copy { max-width: 100%; }
  .panel-agent { position: fixed; inset: auto 0 0 0; top: auto; width: 100%; height: min(68vh, 540px); transform: translateY(24px); border-radius: 22px 22px 0 0; right: auto; }
  .panel-agent.is-in { transform: translateY(0); }
  .panel-inner { border-radius: 21px 21px 0 0; }
  .field.has-selection .field-dock { opacity: 0; pointer-events: none; }
}

/* ---------- states: a quiet legend, not a second hero ---------- */
.states { padding: var(--s-7) 0; border-top: 1px solid var(--line); }
.states .section-head { margin-bottom: var(--s-5); }
.states .section-head h2 { font-size: var(--fs-xl); }
.states .lede { font-size: var(--fs-sm); color: var(--muted); }
.state-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.state { margin: 0; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(7, 20, 51, 0.35); overflow: hidden; display: grid; }
.state canvas { width: 100%; height: auto; display: block; aspect-ratio: 220 / 120; opacity: 0.85; }
.state figcaption { padding: 8px 12px 10px; display: grid; gap: 2px; font-size: 0.7rem; color: var(--muted); }
.state figcaption b { color: var(--paper-2); font-size: var(--fs-xs); font-weight: 500; }
@media (max-width: 1100px) { .state-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .state-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- anatomy ---------- */
.anatomy { padding: var(--s-9) 0; border-top: 1px solid var(--line); }
.anatomy-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: var(--s-8); align-items: start; }
.spec { border-radius: var(--r-xl); border: 1px solid var(--line-strong); background: rgba(7, 20, 51, 0.7); padding: 20px; box-shadow: var(--shadow-panel), 0 0 120px -50px hsl(262 95% 65% / 0.6); display: grid; gap: 14px; }
.spec-head { display: flex; align-items: center; gap: 12px; }
.spec-head > div { display: grid; gap: 2px; font-size: var(--fs-md); flex: 1; }
.spec-head .muted { font-size: var(--fs-xs); }
.spec .contract { overflow: visible; }
@media (max-width: 900px) { .anatomy-grid { grid-template-columns: 1fr; } }

/* ---------- handoffs ---------- */
.handoffs { padding: var(--s-9) 0; border-top: 1px solid var(--line); }
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: rgba(2, 9, 31, 0.5); margin-bottom: var(--s-6); }
.flow-node { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: var(--r-pill); background: rgba(96, 157, 252, 0.08); border: 1px solid rgba(96, 157, 252, 0.25); font-size: var(--fs-sm); font-weight: 500; }
.flow-node .pa-orb { --h: inherit; width: 24px; height: 24px; }
.flow-node .pa-orb::after { inset: -4px; }
.flow-gate { background: rgba(242, 184, 75, 0.1); border-color: rgba(242, 184, 75, 0.5); color: var(--warn); }
.gate-ring { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--warn); box-shadow: 0 0 12px rgba(242, 184, 75, 0.6); animation: pulse 1.6s infinite; --pill-c: var(--warn); }
.flow-arrow { width: 28px; height: 1px; background: var(--signal); position: relative; opacity: 0.7; }
.flow-arrow::after { content: ""; position: absolute; right: -1px; top: -3px; border: 3.5px solid transparent; border-left-color: var(--signal); }
.handoffs .cta-actions { justify-content: flex-start; }

/* ---------- hierarchy tab, builder ---------- */
.tree-block { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tree-block:last-child { border-bottom: 0; }
.tree-label { font-size: var(--fs-xs); color: var(--muted); }
.tree-note { font-size: var(--fs-xs); color: var(--muted); }
.field-select, .field-input { width: 100%; font: inherit; font-size: var(--fs-sm); color: var(--paper); background: rgba(2, 9, 31, 0.6); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 8px 10px; outline: none; transition: border-color var(--t-fast); }
.field-select:focus, .field-input:focus { border-color: var(--signal); }
.field-select option { background: var(--ink); color: var(--paper); }
textarea.field-input { resize: vertical; min-height: 56px; }
.tree-children { display: grid; gap: 4px; }
.tree-children li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); padding: 6px 8px; border-radius: var(--r-sm); background: rgba(170, 206, 253, 0.05); }
.tree-children li .pa-orb { width: 14px; height: 14px; }
.tree-children li .pa-orb::after { inset: -3px; }
.tree-children li button { margin-left: auto; font-size: var(--fs-xs); color: var(--frost); }
.tree-children li button:hover { color: var(--paper); }
.tree-children .empty { color: var(--muted); font-size: var(--fs-xs); background: none; }
.tree-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.tree-danger { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); }
.tree-danger[hidden] { display: none; }
.panel-build .panel-inner { gap: 10px; }
.build-form { margin: 0; }
.build-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 10px; padding-right: 4px; align-content: start; }
.build-row { display: grid; gap: 5px; }
.build-row > label, .build-row-2 label { font-size: var(--fs-xs); color: var(--muted); }
.build-row-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
.build-row-2 > div { display: grid; gap: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 4px; color: var(--frost); background: rgba(170, 206, 253, 0.06); border: 1px solid var(--line); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.chips button.is-on { background: rgba(96, 157, 252, 0.2); color: var(--paper); border-color: rgba(96, 157, 252, 0.5); }
.chips button.is-gate { color: var(--warn); border-color: rgba(242, 184, 75, 0.35); }
.chips button.is-gate.is-on { background: rgba(242, 184, 75, 0.18); color: var(--warn); border-color: var(--warn); }
.hues { display: flex; gap: 6px; }
.hue { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: hsl(var(--h) 90% 60%); box-shadow: 0 0 10px hsl(var(--h) 90% 60% / 0.6); transition: transform var(--t-fast), border-color var(--t-fast); }
.hue.is-on { border-color: var(--paper); transform: scale(1.12); }
.build-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--fs-xs); }
.dock-new { color: var(--paper); background: rgba(96, 157, 252, 0.14); border: 1px solid rgba(96, 157, 252, 0.35); }
.dock-new:hover { background: var(--cobalt); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; padding: 10px 16px; border-radius: var(--r-pill); background: var(--paper); color: var(--abyss); font-size: var(--fs-sm); font-weight: 500; box-shadow: 0 20px 50px -20px rgba(0,0,0,0.8); transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out); pointer-events: none; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- impact ---------- */
.impact { display: grid; gap: 12px; overflow-y: auto; }
.impact h4 { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; margin: 0 0 4px; }
.impact-note { font-size: var(--fs-xs); color: var(--muted); }
.meter-row { display: grid; grid-template-columns: 96px 1fr 60px; gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--paper-2); }
.meter-row .meter { height: 6px; border-radius: 3px; background: rgba(170, 206, 253, 0.12); overflow: hidden; }
.meter-row .meter span { display: block; height: 100%; width: var(--p); border-radius: 3px; background: var(--signal); }
.meter-row[data-level="3"] .meter span { background: var(--warn); }
.meter-row[data-level="0"] { opacity: 0.5; }
.overlap { display: grid; gap: 6px; }
.overlap li { display: flex; gap: 8px; align-items: center; font-size: var(--fs-xs); padding: 6px 8px; border-radius: var(--r-sm); background: rgba(242, 184, 75, 0.08); border: 1px solid rgba(242, 184, 75, 0.35); color: var(--paper-2); }
.overlap li.ok { background: rgba(61, 220, 151, 0.08); border-color: rgba(61, 220, 151, 0.35); }
.overlap li .pa-orb { width: 12px; height: 12px; }
.aud { display: grid; gap: 6px; }
.aud-row { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--paper-2); }
.aud-row .seg { display: flex; gap: 2px; padding: 2px; border-radius: 6px; background: rgba(2, 9, 31, 0.55); border: 1px solid var(--line); }
.aud-row .seg button { flex: 1; font-size: 0.66rem; padding: 4px 0; border-radius: 4px; color: var(--frost); }
.aud-row .seg button.is-on { background: rgba(96, 157, 252, 0.2); color: var(--paper); }
.aud-row .seg button.is-on[data-l="3"] { background: rgba(242, 184, 75, 0.2); color: var(--warn); }
.build-warn { color: var(--warn); }

/* ---------- usage tab ---------- */
.usage { display: grid; gap: 12px; align-content: start; overflow-y: auto; min-height: 0; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.usage-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.usage-card { padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(2, 9, 31, 0.45); display: grid; gap: 2px; min-width: 0; }
.usage-card b { font-size: var(--fs-lg); font-weight: 600; color: var(--paper); font-variant-numeric: tabular-nums; }
.usage-card span { font-size: var(--fs-xs); color: var(--muted); }
.usage-card.is-high b { color: var(--warn); }
.usage h4 { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; }
.usage-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(170, 206, 253, 0.1); }
.usage-bar span { display: block; height: 100%; }
.usage-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: var(--fs-xs); color: var(--paper-2); }
.usage-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.usage-sec-system { background: var(--signal); } .usage-sec-memory { background: var(--ev-assumed); } .usage-sec-history { background: var(--ev-inferred); } .usage-sec-message { background: var(--ok); }
.usage-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 36px; align-items: end; }
.usage-hours span { display: block; min-height: 2px; border-radius: 2px 2px 0 0; background: hsl(var(--h, 214) 95% 70% / 0.75); }
.usage-list { display: grid; gap: 4px; }
.usage-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: var(--fs-xs); padding: 6px 8px; border-radius: var(--r-sm); background: rgba(170, 206, 253, 0.05); color: var(--paper-2); }
.usage-list li .mono { color: var(--muted); }
.usage-tips { display: grid; gap: 6px; }
.usage-tips li { font-size: var(--fs-xs); line-height: 1.45; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid rgba(242, 184, 75, 0.35); background: rgba(242, 184, 75, 0.08); color: var(--paper-2); }
.usage-tips li.ok { border-color: rgba(61, 220, 151, 0.35); background: rgba(61, 220, 151, 0.08); }
.usage-foot { font-size: var(--fs-xs); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.usage-foot .live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 1.6s infinite; --pill-c: var(--ok); }
.usage-empty { font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
@media (max-width: 600px) { .usage-cards { grid-template-columns: repeat(2, 1fr); } }
