/* Armada — command-center design system (Sprint 0) */
:root {
  --bg: #0b0f14; --bg2: #10161d; --panel: #141c25; --panel2: #1a2430;
  --line: #223041; --line2: #2c3d52;
  --text: #e6edf3; --dim: #8ea3b8; --faint: #5c7089;
  --accent: #3b9eff; --accent2: #66b8ff;
  --ok: #2ecc8f; --warn: #f5b83d; --bad: #ff5d6c; --violet: #a78bfa;
  --chip-r: 999px; --r: 10px; --r-lg: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: radial-gradient(1200px 700px at 80% -10%, #12202f 0%, var(--bg) 55%);
  color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}
a { color: var(--accent2); text-decoration: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.nav {
  background: linear-gradient(180deg, #0d141c, #0a0f15); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 16px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #1f6fd6); font-weight: 800; font-size: 15px;
  color: #071320; letter-spacing: .5px;
}
.brand .word { font-weight: 700; letter-spacing: 2.5px; font-size: 15px; }
.brand .sub { font-size: 10px; color: var(--faint); letter-spacing: 1px; }
.nav a.item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--dim); font-weight: 600; font-size: 13px;
}
.nav a.item:hover { background: var(--panel); color: var(--text); }
.nav a.item.active { background: linear-gradient(90deg, rgba(59,158,255,.16), transparent); color: var(--accent2); box-shadow: inset 2px 0 0 var(--accent); }
.nav .spacer { flex: 1; }
.nav .foot { padding: 10px 12px; font-size: 11px; color: var(--faint); border-top: 1px solid var(--line); }

.main { overflow-y: auto; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; background: rgba(11,15,20,.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: .3px; }
.badge-demo {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #1a1204;
  background: linear-gradient(135deg, var(--warn), #ffd579); padding: 5px 12px; border-radius: var(--chip-r);
}
/* signed-in identity + logout (WO-3) */
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox .who { font-size: 12px; color: var(--dim); white-space: nowrap; }
.userbox .who b { color: var(--text); }
.userbox form { margin: 0; }
.userbox .btn { padding: 5px 11px; font-size: 12px; }
.content { padding: 20px 22px 60px; max-width: 1360px; }

/* ---------- primitives ---------- */
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3,1fr); }
.cols-4 { grid-template-columns: repeat(4,1fr); } .cols-6 { grid-template-columns: repeat(6,1fr); }
.panel { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.panel h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: 1.4px; color: var(--dim); text-transform: uppercase; }
.kpi .num { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.kpi .lbl { font-size: 11px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
.kpi.accent .num { color: var(--accent2); } .kpi.ok .num { color: var(--ok); }
.kpi.warn .num { color: var(--warn); } .kpi.violet .num { color: var(--violet); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: var(--chip-r);
  font-size: 11px; font-weight: 700; letter-spacing: .4px; border: 1px solid transparent; white-space: nowrap; }
.chip.ok { background: rgba(46,204,143,.13); color: var(--ok); border-color: rgba(46,204,143,.35); }
.chip.warn { background: rgba(245,184,61,.13); color: var(--warn); border-color: rgba(245,184,61,.35); }
.chip.bad { background: rgba(255,93,108,.13); color: var(--bad); border-color: rgba(255,93,108,.35); }
.chip.info { background: rgba(59,158,255,.13); color: var(--accent2); border-color: rgba(59,158,255,.35); }
.chip.violet { background: rgba(167,139,250,.13); color: var(--violet); border-color: rgba(167,139,250,.35); }
.chip.dim { background: var(--panel2); color: var(--dim); border-color: var(--line2); }
.star { color: var(--warn); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint);
  padding: 8px 10px; border-bottom: 1px solid var(--line2); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: rgba(59,158,255,.04); }
.tbl tr.click { cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-weight: 600; font-size: 13px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #1f6fd6); border: none; color: #06131f; }
.btn.danger { background: rgba(255,93,108,.15); color: var(--bad); border-color: rgba(255,93,108,.4); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea {
  background: #0d141c; border: 1px solid var(--line2); color: var(--text); border-radius: 8px;
  padding: 8px 11px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label.f { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); margin: 10px 0 4px; }

/* feed + timeline */
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.feed .it { display: flex; gap: 10px; padding: 9px 11px; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; animation: pop .25s ease; }
.feed .t { color: var(--faint); font-size: 11px; font-family: var(--mono); white-space: nowrap; }
@keyframes pop { from { transform: translateY(-4px); opacity: 0; } }
.tline { position: relative; margin-left: 8px; padding-left: 22px; }
.tline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 2px; background: var(--line2); }
.tline .ev { position: relative; padding: 8px 0 14px; }
.tline .ev::before { content: ""; position: absolute; left: -22.5px; top: 13px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(59,158,255,.2); }
.tline .ev.impact::before { background: var(--bad); box-shadow: 0 0 0 3px rgba(255,93,108,.2); }
.tline .ev.recovery::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(46,204,143,.2); }

/* score dial */
.dial { position: relative; width: 120px; height: 120px; }
.dial svg { transform: rotate(-90deg); }
.dial .v { position: absolute; inset: 0; display: grid; place-items: center; }
.dial .v .n { font-size: 26px; font-weight: 800; }
.dial .v .b { font-size: 10px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; }

/* drawer + modal */
.drawer { position: fixed; top: 0; right: 0; width: 540px; height: 100vh; z-index: 60;
  background: var(--bg2); border-left: 1px solid var(--line2); box-shadow: var(--shadow);
  transform: translateX(100%); visibility: hidden; pointer-events: none;
  transition: transform .28s ease; overflow-y: auto; padding: 20px; }
.drawer.open { transform: translateX(0); visibility: visible; pointer-events: auto; }
.overlay { position: fixed; inset: 0; background: rgba(4,8,12,.6); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.modal { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; }
.modal.show { display: grid; }
.modal .box { width: 520px; max-width: 94vw; background: var(--bg2); border: 1px solid var(--line2);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); animation: pop .2s ease;
  max-height: 92vh; overflow-y: auto; }
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 90; background: var(--panel2); border: 1px solid var(--accent);
  color: var(--text); padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); animation: pop .25s ease; }
.toast.ok { border-color: var(--ok); }

/* misc */
.muted { color: var(--dim); } .small { font-size: 12px; } .mono { font-family: var(--mono); }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.right { margin-left: auto; }
.empty { text-align: center; color: var(--faint); padding: 40px 10px; }
.empty .big { font-size: 30px; margin-bottom: 8px; }
.setcard { cursor: pointer; }
.setcard:hover { border-color: var(--accent); }
.gapq { font-weight: 600; } .gapf { color: var(--warn); }
.statement-kind { font-family: var(--mono); font-size: 10px; }
.customer-layout { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); }
.grid > *, .main { min-width: 0; }
.journey h2 { margin: 0; font-size: 19px; }
.journey p { min-height: 42px; }
.answer-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.application-panel h2 { font-size: 18px; margin: 10px 0; }
.application-progress { height: 7px; border-radius: 6px; background: var(--line2); overflow: hidden; }
.application-progress > span { display: block; height: 100%; background: var(--accent); }
.application-section { border-top: 1px solid var(--line2); margin-top: 14px; padding-top: 12px; }
.application-section > summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.application-field { min-width: 0; margin: 0; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); }
.application-field .row > b { flex: 1 1 220px; }
.application-field-label { flex: 1 1 230px; font-weight: 600; }
.application-answer-row { display: grid; grid-template-columns: minmax(0, 1fr) 168px; align-items: start; gap: 8px; margin-top: 7px; }
.application-answer-row > select:last-child { font-size: 12px; padding: 9px 7px; }
.application-field-footer { margin-top: 6px; gap: 6px; }
.application-field-footer .btn { padding: 4px 9px; font-size: 12px; }
.application-field-footer > span { flex: 1 1 160px; }
.application-note { margin-top: 5px; }
.application-note > summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.application-note[open] > summary { color: var(--warn); margin-bottom: 5px; }
.application-filterbar { position: sticky; top: -20px; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 7px; padding: 10px 0; background: var(--bg2); }
.application-filterbar > div { grid-column: 1 / -1; }
.application-review-section { margin: 4px 0 2px; font-size: 12px; }
.application-documents { margin: 8px 0 18px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 9px; }
.application-documents h3 { margin-top: 15px; }
.application-documents h4 { margin: 18px 0 7px; }
.application-document { margin: 10px 0; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.application-document.retired { color: var(--dim); }
.application-document p { margin: 7px 0; }
.application-document summary, .application-packets > summary, .application-preparation-form > summary { cursor: pointer; }
.application-hash { display: block; white-space: normal; overflow-wrap: anywhere; font-size: 11px; margin: 8px 0; }
.application-blockers { font-size: 12px; padding-left: 20px; color: var(--warn); }
.application-blockers li { margin: 7px 0; }
.application-upload { min-width: 0; padding: 12px; margin: 18px 0; border: 1px solid var(--line2); border-radius: 8px; }
.application-upload > label, .application-preparation-form > label { display: block; margin: 12px 0 5px; font-size: 12px; }
.application-upload > legend { font-size: 13px; padding: 0 5px; }
.application-upload > .application-confirm, .application-preparation-form > .application-confirm { display: flex; align-items: flex-start; gap: 8px; }
.application-confirm > input { width: auto; flex: 0 0 auto; margin: 2px 0 0; }
.application-upload .btn { margin-top: 8px; }
.application-preparation-form { border-top: 1px solid var(--line2); padding-top: 14px; margin-top: 18px; }
.application-preparation-form > summary { font-weight: 600; }
.application-signing { border-top: 1px solid var(--line2); margin-top: 22px; padding-top: 8px; min-width: 0; }
.application-signing p, .application-signing-dialog p { overflow-wrap: anywhere; }
.application-signing-packet { margin: 15px 0; padding: 14px; border: 1px solid var(--line2); border-radius: 8px; min-width: 0; }
.application-signing summary { cursor: pointer; }
.application-signing-build { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }
.application-signing-build > label, .application-signing-dialog > label { display: block; margin: 13px 0 6px; font-size: 12px; }
.application-signing-dialog > .application-confirm { display: flex; gap: 9px; align-items: flex-start; line-height: 1.5; }
.application-signing-file { border-top: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
.application-signing-error { padding: 9px; border-left: 3px solid var(--warn); color: var(--warn); }
.application-signing .chip { max-width: 100%; white-space: normal; }
.modal .box:has(.application-signing-dialog) { width: 700px; max-height: 90vh; overflow-y: auto; }
@media (max-width: 540px) {
  .application-signing-packet { padding: 10px; }
  .application-signing .row, .application-signing-dialog .row { align-items: stretch; }
  .application-signing .row .btn, .application-signing-dialog .row .btn { white-space: normal; flex: 1 1 160px; }
}
.application-review-warnings > summary, .application-editions > summary { color: var(--dim); cursor: pointer; font-size: 12px; }
.application-field:disabled input, .application-field:disabled select, .application-field:disabled textarea { color: var(--dim); cursor: default; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.application-warnings { padding: 10px; border-left: 3px solid var(--warn); color: var(--warn); }
.application-warnings p { margin: 4px 0; }
.room-progress { display: grid; gap: 18px; width: 100%; min-width: 0; }
.room-application-progress { padding-bottom: 16px; border-bottom: 1px solid var(--line2); }
.room-security-progress .row > div:not(.dial) { flex: 1 1 220px; }
.room-security-progress .dial { flex: 0 0 120px; }
[hidden] { display: none !important; }
.room-setup { display: flex; flex-direction: column; gap: 18px; max-width: 720px; margin: 0 auto; }
.room-session-card { order: 1; }
.room-admin-card { order: 2; }
.room-setup .portraits:empty { display: none; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent2); }
.drawer { max-width: 96vw; }
@media (max-width: 1000px) {
  .cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .customer-layout, .journey-grid { grid-template-columns: minmax(0, 1fr); }
  .userbox .who { white-space: normal; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .nav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .nav .brand, .nav .foot, .nav .spacer { display: none; }
  .nav a.item { padding: 8px; }
  .main { max-height: 100vh; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .content { padding: 14px 12px 50px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .panel { overflow-wrap: anywhere; }
  .tbl th, .tbl td { padding: 8px 5px; }
  .chip { white-space: normal; overflow-wrap: anywhere; }
  .application-answer-row, .application-filterbar { grid-template-columns: minmax(0, 1fr); }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   COMMAND-DECK FX LAYER (bold · cyan/electric-blue)
   ============================================================ */
:root { --cy: #46d4ff; --cy2: #3b9eff; }

/* layered backdrop: gradient base ← generated mesh image ← particles */
body { background: radial-gradient(1400px 800px at 78% -12%, #0f2136 0%, var(--bg) 58%); }
#fxbg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: url("/static/ui/assets/bg-mesh.png") center/cover no-repeat;
  opacity: .34; filter: saturate(1.05);
}
#fxbg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,15,20,.55), rgba(11,15,20,.86) 70%, var(--bg)); }
#fxcanvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.nav, .topbar { background-color: rgba(10, 15, 21, .72); backdrop-filter: blur(12px); }
.panel { background: linear-gradient(180deg, rgba(20,28,37,.86), rgba(16,22,29,.9)); backdrop-filter: blur(6px); }

/* panel entrance */
.panel.fx-in { animation: deckIn .5s cubic-bezier(.2,.8,.25,1) backwards; }
@keyframes deckIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* live elements get a slow animated border sweep */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.panel.live { position: relative; }
.panel.live::before {
  content: ""; position: absolute; inset: -1px; border-radius: var(--r-lg); padding: 1px; z-index: 0;
  background: conic-gradient(from var(--ang), transparent 0 70%, var(--cy) 82%, transparent 94%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: sweep 5s linear infinite;
}
@keyframes sweep { to { --ang: 360deg; } }

/* brand emblem + shimmer badge */
.brand .mark { position: relative; overflow: hidden; box-shadow: 0 0 18px rgba(70,212,255,.35); }
.brand .mark img,
.brand .mark .emblem { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.8); position: absolute; inset: 0; }
/* WO-9: on the app shell and the sign-in page the emblem is a CSS layer rather than an
   <img onerror="this.remove()">. A background image that 404s simply does not paint, so the
   fallback "A" glyph shows through exactly as the inline handler used to arrange — with no
   inline event handler anywhere in the shipped markup. */
.brand .mark .emblem { background: url("/static/ui/assets/emblem.png") center / cover no-repeat; }

/* panels with an ambient video layer */
.videopanel { position: relative; overflow: hidden; }
.videopanel > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; z-index: 0; pointer-events: none; }
.videopanel > *:not(video) { position: relative; z-index: 1; }
.summonwrap { display: grid; place-items: center; padding: 30px 0 10px; }
.summonwrap video { width: min(300px, 60vw); border-radius: 14px; box-shadow: 0 0 44px rgba(70,212,255,.35); }
.badge-demo { position: relative; overflow: hidden; }
.badge-demo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  transform: translateX(-120%); animation: shimmer 4.5s ease-in-out infinite; }
@keyframes shimmer { 12%, 100% { transform: translateX(120%); } }

/* score dial glow */
.dial svg circle:last-child { filter: drop-shadow(0 0 7px currentColor); }
.dial .v .n { text-shadow: 0 0 16px rgba(70,212,255,.45); }

/* extraction feed: materialize */
.feed .it { animation: mat .45s cubic-bezier(.2,.8,.25,1) backwards; }
@keyframes mat { from { opacity: 0; transform: translateY(-6px); filter: blur(4px); } }

/* avatar stage ring */
.stagewrap { position: relative; border-radius: 16px; padding: 2px;
  background: conic-gradient(from var(--ang), rgba(70,212,255,.05), rgba(70,212,255,.5), rgba(59,158,255,.05));
  animation: sweep 9s linear infinite; }
.stagewrap.active { animation-duration: 2.2s; box-shadow: 0 0 34px rgba(70,212,255,.28); }
.stagewrap > .panel { margin: 0; }
.summon { position: absolute; inset: 6px; border-radius: 12px; object-fit: cover;
  width: calc(100% - 12px); height: calc(100% - 12px); opacity: .8; }

/* portrait cards (Interview Room setup) */
.portraits { display: flex; gap: 12px; margin: 12px 0 2px; }
.portrait { flex: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line2);
  position: relative; cursor: pointer; transition: .25s; opacity: .55; }
.portrait img { width: 100%; height: 150px; object-fit: cover; object-position: top; display: block; }
.portrait .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font-size: 12px;
  font-weight: 700; background: linear-gradient(transparent, rgba(5,10,16,.92)); }
.portrait:hover { opacity: .85; transform: translateY(-2px); }
.portrait.sel { opacity: 1; border-color: var(--cy); box-shadow: 0 0 18px rgba(70,212,255,.3); }

/* WO-11 — the Admin Meeting card. Same panel, violet-keyed like every other admin-only
   surface in this theme, so the private lane reads as private at a glance. */
.panel.adminmeet { border-color: rgba(167,139,250,.4);
  background: linear-gradient(180deg, rgba(167,139,250,.08), transparent 60%), var(--panel); }
.panel.adminmeet h3 { color: var(--violet); }

/* WO-12 — the approve card inside the admin room. Warm-keyed rather than violet: this is
   the one panel in that room where a click changes the governed library, so it should not
   read as "just another private-lane surface". */
.panel.libchange { border-color: rgba(245,183,79,.45);
  background: linear-gradient(180deg, rgba(245,183,79,.09), transparent 60%), var(--panel); }
.panel.libchange h3 { color: var(--warn); }
.panel.libchange textarea { width: 100%; }

/* hover lift for cards/rows */
.panel.setcard, .kpi { transition: transform .22s, box-shadow .22s, border-color .22s; }
.panel.setcard:hover, .kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.4), 0 0 0 1px rgba(70,212,255,.25); }

/* learning-loop pipeline */
.pipeline { position: relative; height: 6px; background: var(--line); border-radius: 3px; margin: 14px 4px 6px; overflow: visible; }
.pipeline .dot { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--cy); box-shadow: 0 0 10px var(--cy); animation: travel 3.6s linear infinite; }
.pipeline .dot:nth-child(2) { animation-delay: 1.2s; } .pipeline .dot:nth-child(3) { animation-delay: 2.4s; }
@keyframes travel { from { left: -2%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } to { left: 99%; opacity: 0; } }

/* the approve moment */
.fx-burst { position: fixed; left: 50%; top: 50%; width: 20px; height: 20px; z-index: 95;
  border: 2px solid var(--cy); border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none;
  animation: burst 1s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes burst { to { width: 130vmax; height: 130vmax; opacity: 0; border-width: 1px; } }
body.fx-edge::after { content: ""; position: fixed; inset: 0; z-index: 94; pointer-events: none;
  box-shadow: inset 0 0 120px rgba(70,212,255,.35); animation: edgefade 1.2s forwards; }
@keyframes edgefade { to { opacity: 0; } }

/* route transition */
.content > * { animation: none; }
#view.fx-route { animation: routeIn .32s ease; }
@keyframes routeIn { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  .panel.fx-in, .feed .it, .badge-demo::after, .pipeline .dot, .stagewrap,
  #view.fx-route, .panel.live::before, .modal .box, .toast { animation: none !important; }
  .drawer, .overlay { transition: none; }
}

/* WO-20 — the live meeting DOM never lives in #view: the hash router replaces #view
   wholesale.  The full-room portal uses the same node but mirrors the route-local
   reserve rectangle, so the internal .main scrollport carries the stage with the room. */
:root { --room-stage-height: min(78vh, calc(100vh - 118px)); }
#meeting-dock { display: none; z-index: 40; }
#meeting-dock.meeting-full {
  display: block; position: absolute; top: 0; left: 254px; right: 22px; z-index: 10;
  width: var(--room-stage-width, 0px); height: var(--room-stage-height);
  transform: translate3d(calc(var(--room-stage-x, 254px) - 254px), var(--room-stage-y, 0px), 0);
}
#meeting-dock.meeting-docked {
  display: block; position: fixed; left: 250px; bottom: 20px; width: 330px; transform: none;
  min-height: 126px; padding: 10px; border: 1px solid var(--line2); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), var(--bg2)); box-shadow: var(--shadow);
}
#meeting-container { height: 100%; }
#meeting-container .meeting-stage { height: 100%; }
#meeting-container .meeting-stage > .panel { height: 100%; margin: 0; }
#meeting-container .meeting-stage iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 10px; background: #000; }
#meeting-dock.meeting-full #meeting-container .meeting-stage > .panel { padding: 2px !important; overflow: hidden; }
#meeting-container .meeting-text { display: flex; flex-direction: column; height: 100%; }
#meeting-container .meeting-text .feed { flex: 1; max-height: none; }
#meeting-dock.meeting-docked #meeting-container { height: 48px; overflow: hidden; }
#meeting-dock.meeting-docked #meeting-container iframe { pointer-events: none; }
#meeting-dock.meeting-docked .meeting-stage > .panel { display: grid; place-items: center; padding: 8px; }
#meeting-dock.meeting-docked .meeting-text { display: block; }
#meeting-dock.meeting-docked .meeting-text .feed { max-height: 48px; overflow: hidden; }
#meeting-dock.meeting-docked .meeting-text .row { display: none; }
#meeting-dock-controls { display: none; }
#meeting-dock.meeting-docked #meeting-dock-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
#meeting-dock-controls .meeting-dock-label { flex: 1; min-width: 0; color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The reserve is route-local, but the persistent portal mirrors its rectangle.  Its lower
   z-index also keeps the sticky application header above a departing stage at every scroll. */
.room-live-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.room-meeting-reserve { min-height: var(--room-stage-height); }
.room-live-details { display: grid; gap: 14px; min-width: 0; }


/* WO-21a — private admin-room file handoff. The drop target is a normal delegated control,
   not an inline browser handler, so it coexists safely with the persistent meeting dock. */
.panel.meeting-files { border-color: rgba(167,139,250,.35); }
.panel.meeting-files h3 { color: var(--violet); }
.meeting-dropzone { display: grid; gap: 6px; place-items: center; text-align: center; padding: 18px;
  border: 1px dashed var(--line2); border-radius: 10px; color: var(--text); transition: .16s; }
.meeting-dropzone.dragging { border-color: var(--accent); background: rgba(59,158,255,.1); }
#meeting-file-list .it { padding: 5px 0; border-bottom: 1px solid var(--line); }

/* WO-22: explicit, non-generic terminal reason after Tavus cannot resume a room. */
.room-end-reason { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #9c3f4c; border-radius: 8px; background: #3a1721; color: #ffd7dd; }
.application-spoken-help { margin: 7px 0; padding: 0; border: 0; }
.application-spoken-help > summary { font-size: 12px; color: var(--dim); cursor: pointer; padding: 3px 0; }
.application-spoken-help p { margin: 7px 0; }
.application-batch-bar { display: flex; align-items: center; gap: 14px; padding: 9px 0 14px; }
.application-batch-bar p { flex: 1; margin: 0; }
.application-batch-bar .btn { flex-shrink: 0; }
.room-remit { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
.room-remit legend { padding: 0 5px; font-size: 12px; color: var(--dim); }
.room-remit label, .room-remit-confirm { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.room-remit input, .room-remit-confirm input { width: auto; margin: 2px 0 0; flex-shrink: 0; }
.room-agenda-preview { margin-top: 14px; }
.room-agenda-preview:empty { display: none; }
.room-question-guide { min-width: 0; overflow-wrap: anywhere; }
.room-question-guide summary { cursor: pointer; font-size: 13px; color: var(--dim); }
.room-question-guide h4 { margin: 15px 0 5px; }
.room-question-body { white-space: pre-wrap; margin: 8px 0; line-height: 1.6; }
.room-topic, .room-agenda-item { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.room-topic .small { margin-top: 5px; }
.question-facets, .room-agenda-list { padding-left: 22px; font-size: 13px; line-height: 1.6; }
.question-facets li, .room-agenda-list li { margin: 8px 0; }
.bundle-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.bundle-comparison > div, .bundle-comparison > section { min-width: 0; overflow-wrap: anywhere; }
.drawer:has(.bundle-comparison) { width: min(100%, 980px); }
.bundle-toolbar { position: sticky; top: -20px; z-index: 1; background: var(--bg2); padding: 16px 0; border-bottom: 1px solid var(--line2); }
.bundle-toolbar h2 { margin: 0; font-size: 20px; }
.bundle-toolbar .row { flex-wrap: nowrap; }
.bundle-toolbar [data-close] { flex-shrink: 0; }
.bundle-metadata { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; max-height: 260px; overflow: auto; }
@media (max-width: 720px) {
  #meeting-dock.meeting-docked { left: 12px; right: 12px; width: auto; bottom: 12px; }
  .application-batch-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .bundle-comparison { grid-template-columns: minmax(0, 1fr); }
}
