/* ============================================================================
   Milestone · Use-Case Territory Portal
   Brand system lifted from deck2_prod/theme.css (sage · paper · mac-dense),
   re-flowed for a full-page responsive investor portal.
   ========================================================================== */

:root {
  --paper:#FFFFFF; --bg:#F5F5F7; --surface:#FAFAFC; --surface-2:#F2F2F5; --surface-3:#E9E9EE;
  --hairline:#E2E2E7; --hairline-2:#D6D6DC;
  --text:#1D1D1F; --text-dim:#55555C; --text-faint:#86868B;
  --dark:#1C1C1F; --dark-line:#35353A; --on-dark:#F2F2F4;

  --ac:#4D7C5E; --ac-glow:#6C9A78; --ac-ink:#34583F; --ac-soft:#E7F0EA; --ac-fill:#F3F8F4; --ac-bd:#C3D8CA; --ac-on:#FFFFFF;

  /* domain accent ramp — one hue per top-level domain, muted to sit in the sage system */
  /* functional-division palette — one hue per division (categorical, separated) */
  --d-planning:#4D7C5E; --d-procurement:#C1843A; --d-manufacturing:#7B5AC6; --d-logistics:#3B78B0;
  --d-inventory:#C9A23A; --d-returns:#6E8C3E; --d-risk:#C0504A; --d-network:#2E9E8C; --d-strategy:#A15C86;

  --r-window:16px; --r-card:12px; --r-sm:8px; --r-pill:999px;
  --sh-card:0 1px 2px rgba(20,20,22,.05), 0 6px 18px -8px rgba(20,20,22,.10);
  --sh-lift:0 2px 4px rgba(20,20,22,.06), 0 18px 40px -18px rgba(20,20,22,.22);
  --sh-drawer:0 2px 6px rgba(20,20,22,.08), -40px 0 90px -30px rgba(20,20,22,.30);

  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --mono:'JetBrains Mono',ui-monospace,'SF Mono',monospace;

  --tl-red:#FF5F57; --tl-yellow:#FEBC2E; --tl-green:#28C840;

  --topbar-h:58px; --substrip-h:52px;
}

* { box-sizing:border-box; }
html,body { margin:0; height:100%; }
body {
  background:var(--bg); color:var(--text); font-family:var(--font);
  -webkit-font-smoothing:antialiased; letter-spacing:-0.01em; line-height:1.45;
  display:flex; flex-direction:column; height:100vh; overflow:hidden;
}
.topbar, .substrip, .filterbar { flex:0 0 auto; }
::selection { background:var(--ac-soft); }
button { font-family:inherit; cursor:pointer; }
a { color:inherit; }

/* ---------------------------------------------------------------------------
   TOP BAR
   ------------------------------------------------------------------------- */
.topbar {
  position:sticky; top:0; z-index:40; height:var(--topbar-h);
  display:flex; align-items:center; gap:18px; padding:0 22px;
  background:linear-gradient(180deg,#FBFBFD 0%,var(--surface-2) 100%);
  border-bottom:1px solid var(--hairline);
}
.brand { display:flex; align-items:center; gap:11px; flex:0 0 auto; }
.brand-logo { height:30px; width:auto; display:block; flex:0 0 auto; }
.brand .wm { display:flex; flex-direction:column; line-height:1.1; }
.brand .wm b { font-weight:650; letter-spacing:-0.03em; font-size:15px; }
.brand .wm small { font-family:var(--mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; color:var(--text-faint); }

.nav { display:flex; background:var(--surface-3); border-radius:9px; padding:3px; gap:2px; margin-left:6px; }
.nav button {
  border:none; background:transparent; color:var(--text-dim);
  font-size:12.5px; font-weight:550; letter-spacing:-0.01em;
  padding:6px 15px; border-radius:6px; transition:all .15s;
}
.nav button:hover { color:var(--text); }
.nav button.on { background:var(--paper); color:var(--text); box-shadow:0 1px 2px rgba(20,20,22,.12); }

.topbar .spacer { flex:1; }

.search {
  display:flex; align-items:center; gap:8px; background:var(--paper);
  border:1px solid var(--hairline-2); border-radius:var(--r-pill);
  padding:6px 14px; min-width:230px;
}
.search:focus-within { border-color:var(--ac-bd); box-shadow:0 0 0 3px var(--ac-soft); }
.search svg { flex:0 0 auto; opacity:.5; }
.search input {
  border:none; outline:none; background:transparent; font-family:var(--font);
  font-size:13px; color:var(--text); width:100%; letter-spacing:-0.01em;
}
.search input::placeholder { color:var(--text-faint); }

.tag-round {
  font-family:var(--mono); font-size:9px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd);
  border-radius:var(--r-pill); padding:5px 11px; flex:0 0 auto;
}

/* ---------------------------------------------------------------------------
   SUB-STRIP — stats + context
   ------------------------------------------------------------------------- */
.substrip {
  height:var(--substrip-h); display:flex; align-items:center; gap:26px; padding:0 24px;
  background:var(--paper); border-bottom:1px solid var(--hairline);
  overflow-x:auto; white-space:nowrap;
}
.substrip .stat { display:flex; align-items:baseline; gap:7px; flex:0 0 auto; }
.substrip .stat .n { font-weight:700; font-size:19px; letter-spacing:-0.03em; font-variant-numeric:tabular-nums; }
.substrip .stat .n.ac { color:var(--ac); }
.substrip .stat .l { font-size:11px; color:var(--text-dim); }
.substrip .divider { width:1px; height:22px; background:var(--hairline); flex:0 0 auto; }
.substrip .ctx { font-size:12px; color:var(--text-dim); flex:0 0 auto; }
.substrip .ctx b { color:var(--text); font-weight:600; }
.substrip .ctx .pin { color:var(--ac); font-weight:600; }

/* ---------------------------------------------------------------------------
   MAIN LAYOUT
   ------------------------------------------------------------------------- */
.main { position:relative; flex:1 1 auto; min-height:0; overflow:hidden; }
.view { position:absolute; inset:0; display:none; }
.view.on { display:block; }

/* ---------- TREE VIEW ---------- */
#tree-view { background:
  radial-gradient(circle at 1px 1px, var(--hairline) 1px, transparent 0) 0 0 / 26px 26px, var(--bg); }
#tree-svg { width:100%; height:100%; display:block; cursor:grab; }
#tree-svg:active { cursor:grabbing; }

.tree-toolbar {
  position:absolute; top:14px; left:14px; z-index:6; display:flex; gap:8px; align-items:center;
}
.tree-toolbar .tbtn {
  display:inline-flex; align-items:center; gap:7px;
  background:var(--paper); border:1px solid var(--hairline-2); border-radius:var(--r-pill);
  padding:7px 14px; font-size:12px; font-weight:550; color:var(--text-dim); box-shadow:var(--sh-card);
  transition:all .15s;
}
.tree-toolbar .tbtn:hover { color:var(--text); border-color:var(--ac-bd); }

.tree-legend {
  position:absolute; bottom:14px; left:14px; z-index:6;
  background:var(--paper); border:1px solid var(--hairline); border-radius:var(--r-card);
  padding:11px 14px; box-shadow:var(--sh-card); max-width:min(92vw,640px);
}
.tree-legend .lbl { font-family:var(--mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; color:var(--text-faint); margin-bottom:8px; }
.tree-legend .items { display:flex; flex-wrap:wrap; gap:6px 14px; }
.tree-legend .li { display:inline-flex; align-items:center; gap:7px; font-size:11px; color:var(--text-dim); }
.tree-legend .sw { width:11px; height:11px; border-radius:3px; flex:0 0 auto; }
.tree-legend .sw.round { border-radius:50%; }

/* d3 node + link styling driven partly here */
.link { fill:none; stroke:var(--hairline-2); stroke-width:1.4px; }
.node { cursor:pointer; }
.node .node-box { stroke-width:1.2px; transition:filter .15s; }
.node:hover .node-box { filter:brightness(.97); }
.node text { font-family:var(--font); letter-spacing:-0.01em; -webkit-font-smoothing:antialiased; }
.node .n-label { font-size:12px; }  /* fill set inline per node (SVG CSS beats presentation attrs, so we must NOT set it here) */
.node .n-sub { font-size:9px; fill:var(--text-faint); font-family:var(--mono); letter-spacing:.04em; }
.node .n-count { font-size:9px; fill:var(--text-faint); font-family:var(--mono); }
.node .mf-badge { font-family:var(--mono); font-size:9px; font-weight:600; }
.node.collapsed .node-box { stroke-dasharray:none; }
.node.is-usecase.detailed .node-box { stroke-width:1.6px; }

/* ---------- LIST VIEW ---------- */
#list-view { overflow-y:auto; padding:22px 24px 60px; }
.list-controls { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:20px; }
.filter-group { display:flex; align-items:center; gap:6px; }
.filter-group .fl { font-family:var(--mono); font-size:9.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-faint); margin-right:2px; }
.pill {
  border:1px solid var(--hairline-2); background:var(--paper); color:var(--text-dim);
  border-radius:var(--r-pill); padding:5px 12px; font-size:11.5px; font-weight:500; transition:all .14s;
}
.pill:hover { border-color:var(--ac-bd); color:var(--text); }
.pill.on { background:var(--ac); color:var(--ac-on); border-color:var(--ac); }
.pill .c { font-family:var(--mono); font-size:9.5px; opacity:.7; margin-left:5px; }

.domain-block { margin-bottom:34px; }
.domain-head { display:flex; align-items:center; gap:11px; margin-bottom:14px; }
.domain-head .swatch { width:12px; height:12px; border-radius:4px; flex:0 0 auto; }
.domain-head h3 { font-size:17px; font-weight:650; letter-spacing:-0.02em; margin:0; }
.domain-head .blurb { font-size:12.5px; color:var(--text-dim); margin-left:2px; }
.domain-head .cnt { margin-left:auto; font-family:var(--mono); font-size:10px; color:var(--text-faint); letter-spacing:.06em; }

.card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:14px; }

.uc-card {
  position:relative; background:var(--paper); border:1px solid var(--hairline);
  border-left:3px solid var(--card-ac,var(--ac)); border-radius:var(--r-card);
  box-shadow:var(--sh-card); padding:15px 17px; cursor:pointer;
  transition:box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  display:flex; flex-direction:column;
}
.uc-card:hover { transform:translateY(-2px); box-shadow:var(--sh-lift); }
.uc-card .uc-top { display:flex; align-items:center; gap:8px; margin-bottom:9px; }
.uc-card .mf {
  font-family:var(--mono); font-size:9px; font-weight:600; letter-spacing:.05em;
  color:var(--card-ac,var(--ac-ink)); background:var(--surface-2); border:1px solid var(--hairline);
  border-radius:5px; padding:2px 7px;
}
.uc-card .status {
  margin-left:auto; font-family:var(--mono); font-size:8.5px; letter-spacing:.08em; text-transform:uppercase;
  padding:2px 7px; border-radius:5px;
}
.uc-card .status.detailed { color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd); }
.uc-card .status.mapped { color:var(--text-faint); background:var(--surface-2); border:1px solid var(--hairline); }
.uc-card h4 { font-size:14.5px; font-weight:650; letter-spacing:-0.02em; margin:0 0 6px; line-height:1.25; }
.uc-card .one { font-size:12.5px; color:var(--text-dim); line-height:1.45; margin:0 0 12px; }
.uc-card .foot { display:flex; align-items:center; gap:8px; margin-top:auto; flex-wrap:wrap; }
.uc-card .chip-sm {
  font-family:var(--mono); font-size:9.5px; color:var(--text-dim); background:var(--surface);
  border:1px solid var(--hairline); border-radius:var(--r-pill); padding:3px 9px;
}
.uc-card .chip-sm.soph { color:var(--ac-ink); background:var(--ac-fill); border-color:var(--ac-bd); }
.uc-card .arrow { margin-left:auto; color:var(--text-faint); font-size:15px; }
.uc-card.mapped { border-left-style:dashed; opacity:.94; }

.empty { text-align:center; color:var(--text-faint); font-size:13px; padding:60px 0; }

/* ---------- ABOUT VIEW ---------- */
#about-view { overflow-y:auto; padding:30px 24px 60px; }
.about-wrap { max-width:1040px; margin:0 auto; }
.about-hero h2 { font-size:30px; font-weight:650; letter-spacing:-0.03em; margin:0 0 8px; }
.about-hero p { font-size:15px; color:var(--text-dim); max-width:70ch; margin:0 0 24px; line-height:1.5; }
.about-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.panel { background:var(--paper); border:1px solid var(--hairline); border-radius:var(--r-card); box-shadow:var(--sh-card); padding:18px 20px; }
.panel.wide { grid-column:1/-1; }
.panel .p-lb { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:var(--ac); margin-bottom:14px; display:flex; align-items:center; gap:8px; }
.panel .p-lb .dot { width:7px; height:7px; border-radius:50%; background:var(--ac-glow); }
.step-row { display:flex; gap:13px; padding:11px 0; border-bottom:1px solid var(--hairline); }
.step-row:last-child { border-bottom:none; }
.step-row .x { flex:0 0 auto; width:28px; height:28px; border-radius:8px; background:var(--ac-soft); border:1px solid var(--ac-bd); color:var(--ac-ink); display:inline-flex; align-items:center; justify-content:center; font-family:var(--mono); font-size:12px; font-weight:600; }
.step-row .st b { display:block; font-size:14px; font-weight:650; }
.step-row .st span { display:block; font-size:12.5px; color:var(--text-dim); margin-top:2px; line-height:1.4; }
.gate-row, .soph-row { padding:10px 0; border-bottom:1px solid var(--hairline); }
.gate-row:last-child, .soph-row:last-child { border-bottom:none; }
.gate-row b, .soph-row b { font-size:13.5px; }
.gate-row span, .soph-row span { display:block; font-size:12px; color:var(--text-dim); margin-top:2px; line-height:1.4; }
.soph-row .lv { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:6px; background:var(--dark); color:var(--ac-glow); font-family:var(--mono); font-size:11px; font-weight:600; margin-right:9px; }
.wf-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.wf-table td { padding:8px 6px; border-bottom:1px solid var(--hairline); color:var(--text-dim); }
.wf-table tr:last-child td { border-bottom:none; }
.wf-table .id { font-family:var(--mono); font-size:11px; color:var(--text-faint); width:34px; }
.wf-table .nm { color:var(--text); font-weight:550; }
.wf-table .wedge { font-family:var(--mono); font-size:8.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd); border-radius:5px; padding:2px 7px; }
.principle-list { list-style:none; margin:0; padding:0; }
.principle-list li { position:relative; padding-left:18px; margin:9px 0; font-size:13px; color:var(--text-dim); line-height:1.45; }
.principle-list li::before { content:""; position:absolute; left:0; top:.5em; width:6px; height:6px; border-radius:50%; background:var(--ac-glow); }

/* ---------------------------------------------------------------------------
   DETAIL DRAWER
   ------------------------------------------------------------------------- */
.scrim { position:fixed; inset:0; background:rgba(20,20,22,.28); z-index:50; opacity:0; pointer-events:none; transition:opacity .25s; }
.scrim.on { opacity:1; pointer-events:auto; }
.drawer {
  position:fixed; top:0; right:0; height:100vh; width:min(620px,94vw); z-index:51;
  background:var(--paper); box-shadow:var(--sh-drawer); transform:translateX(100%);
  transition:transform .32s cubic-bezier(.22,.7,.2,1); display:flex; flex-direction:column;
}
.drawer.on { transform:none; }
.drawer-bar {
  flex:0 0 auto; display:flex; align-items:center; gap:12px; padding:14px 20px;
  background:linear-gradient(180deg,#FBFBFD 0%,var(--surface-2) 100%); border-bottom:1px solid var(--hairline);
}
.drawer-bar .lights { display:flex; gap:6px; }
.drawer-bar .lights i { width:11px; height:11px; border-radius:50%; }
.drawer-bar .lights i:nth-child(1){ background:var(--tl-red);} .drawer-bar .lights i:nth-child(2){ background:var(--tl-yellow);} .drawer-bar .lights i:nth-child(3){ background:var(--tl-green);}
.drawer-bar .path { font-family:var(--mono); font-size:10px; letter-spacing:.05em; color:var(--text-faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.drawer-bar .close { margin-left:auto; border:1px solid var(--hairline-2); background:var(--paper); border-radius:8px; width:30px; height:30px; font-size:16px; color:var(--text-dim); display:inline-flex; align-items:center; justify-content:center; }
.drawer-bar .close:hover { color:var(--text); border-color:var(--ac-bd); }
.drawer-body { flex:1; min-height:0; overflow-y:auto; padding:22px 26px 60px; }

.d-head .mf-line { display:flex; align-items:center; gap:9px; margin-bottom:12px; flex-wrap:wrap; }
.d-head .mf-badge2 { font-family:var(--mono); font-size:10px; font-weight:600; color:var(--ac-on); background:var(--card-ac,var(--ac)); border-radius:6px; padding:4px 10px; letter-spacing:.03em; }
.d-head .status2 { font-family:var(--mono); font-size:9px; letter-spacing:.1em; text-transform:uppercase; padding:3px 9px; border-radius:6px; }
.d-head .status2.detailed { color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd); }
.d-head .status2.mapped { color:var(--text-faint); background:var(--surface-2); border:1px solid var(--hairline); }
.d-head h2 { font-size:23px; font-weight:650; letter-spacing:-0.03em; line-height:1.15; margin:0 0 8px; }
.d-head .one2 { font-size:15px; color:var(--text-dim); line-height:1.5; margin:0 0 20px; }

.d-meta-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:22px; }
.d-meta {
  background:var(--surface); border:1px solid var(--hairline); border-radius:10px; padding:12px 14px;
}
.d-meta .k { font-family:var(--mono); font-size:9px; letter-spacing:.12em; text-transform:uppercase; color:var(--text-faint); margin-bottom:6px; }
.d-meta .v { font-size:13px; color:var(--text); line-height:1.4; font-weight:550; }
.d-meta .v small { display:block; font-size:11px; color:var(--text-dim); font-weight:400; margin-top:2px; }
.d-meta.full { grid-column:1/-1; }

.d-sec { margin-bottom:24px; }
.d-sec .sec-lb { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:var(--ac); margin-bottom:11px; display:flex; align-items:center; gap:8px; }
.d-sec .sec-lb .dot { width:6px; height:6px; border-radius:50%; background:var(--ac-glow); }
.d-sec p { font-size:13.5px; color:var(--text-dim); line-height:1.55; margin:0; }
.d-sec p b { color:var(--text); font-weight:600; }

.chip-flow { display:flex; flex-wrap:wrap; gap:7px; }
.chip2 { font-family:var(--mono); font-size:11px; color:var(--text-dim); background:var(--surface-2); border:1px solid var(--hairline); border-radius:6px; padding:4px 10px; }
.chip2.rd { border-left:2px solid var(--text-faint); }
.chip2.wr { border-left:2px solid var(--ac); color:var(--text); }

.d-list { list-style:none; margin:0; padding:0; }
.d-list li { position:relative; padding-left:17px; margin:8px 0; font-size:13px; color:var(--text-dim); line-height:1.5; }
.d-list li::before { content:""; position:absolute; left:0; top:.5em; width:6px; height:6px; border-radius:50%; background:var(--ac-glow); }
.d-list li b { color:var(--text); font-weight:600; }

/* worked example */
.example { background:var(--ac-fill); border:1px solid var(--ac-bd); border-radius:12px; padding:16px 18px; }
.example .setup { font-size:13.5px; color:var(--text); line-height:1.55; margin:0 0 16px; padding-bottom:14px; border-bottom:1px dashed var(--ac-bd); }
.example .setup b { font-weight:650; }
.beats { display:flex; flex-direction:column; gap:0; }
.beat { display:flex; gap:14px; position:relative; padding-bottom:16px; }
.beat:last-child { padding-bottom:0; }
.beat .rail { flex:0 0 auto; display:flex; flex-direction:column; align-items:center; }
.beat .bnum { width:26px; height:26px; border-radius:8px; background:var(--paper); border:1px solid var(--ac-bd); color:var(--ac-ink); font-family:var(--mono); font-size:11px; font-weight:600; display:inline-flex; align-items:center; justify-content:center; z-index:2; }
.beat .line { width:2px; flex:1; background:var(--ac-bd); margin:3px 0; }
.beat:last-child .line { display:none; }
.beat.gate .bnum { background:var(--ac); color:var(--ac-on); border-color:var(--ac); }
.beat .bc { padding-top:2px; }
.beat .bstep { font-family:var(--mono); font-size:9px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-faint); }
.beat .btitle { font-size:14px; font-weight:650; letter-spacing:-0.01em; margin:2px 0 4px; }
.beat.gate .btitle { color:var(--ac); }
.beat .bdetail { font-size:12.5px; color:var(--text-dim); line-height:1.5; }
.beat .bdetail b { color:var(--text); font-weight:600; }

/* speed / value band */
.speedband { display:flex; align-items:center; gap:16px; background:var(--dark); color:var(--on-dark); border-radius:12px; padding:14px 18px; flex-wrap:wrap; }
.speedband .fast { color:var(--ac-glow); font-family:var(--mono); font-size:15px; font-weight:600; }
.speedband .vs { color:var(--text-faint); font-size:11px; }
.speedband .slow { color:#B9B9BF; font-family:var(--mono); font-size:13px; }

.mapped-note { background:var(--surface); border:1px dashed var(--hairline-2); border-radius:12px; padding:18px 20px; font-size:13px; color:var(--text-dim); line-height:1.55; }
.mapped-note b { color:var(--text); }

/* ---------------------------------------------------------------------------
   MISC
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion:reduce){ .drawer,.scrim{ transition:none;} }

/* scrollbars */
.drawer-body::-webkit-scrollbar, #list-view::-webkit-scrollbar, #about-view::-webkit-scrollbar { width:10px; }
.drawer-body::-webkit-scrollbar-thumb, #list-view::-webkit-scrollbar-thumb, #about-view::-webkit-scrollbar-thumb { background:var(--hairline-2); border-radius:6px; border:3px solid var(--paper); }

@media (max-width:720px){
  .about-grid, .d-meta-grid, .d-metrics { grid-template-columns:1fr 1fr; }
  .search { min-width:150px; }
  .brand .wm { display:none; }
}

/* ============================================================================
   v2 additions — nav groups · filter bar · list metrics · table · analytics
   · drawer metrics + moat
   ========================================================================== */

/* nav groups */
.nav-grp { font-family:var(--mono); font-size:8.5px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--text-faint); padding:0 6px 0 8px; align-self:center; }
.nav-sep { width:1px; height:18px; background:var(--hairline-2); margin:0 4px; align-self:center; }
.nav { align-items:center; }

/* ---------- shared FILTER BAR ---------- */
.filterbar { background:var(--paper); border-bottom:1px solid var(--hairline); padding:9px 24px;
  display:flex; flex-direction:column; gap:8px; }
.filterbar[hidden] { display:none; }
.fb-primary, .fb-secondary { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.fb-secondary { padding-top:8px; border-top:1px dashed var(--hairline); }
.fsel { font-family:var(--font); font-size:12px; color:var(--text); background:var(--surface);
  border:1px solid var(--hairline-2); border-radius:8px; padding:6px 26px 6px 11px; cursor:pointer;
  -webkit-appearance:none; appearance:none; letter-spacing:-0.01em;
  background-image:url("data:image/svg+xml,%3Csvg width='8' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2386868B'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; }
.fsel:focus { outline:none; border-color:var(--ac-bd); box-shadow:0 0 0 3px var(--ac-soft); }
.fb-more { font-size:12px; color:var(--text-dim); background:var(--surface); border:1px solid var(--hairline-2);
  border-radius:8px; padding:6px 13px; }
.fb-more.on { background:var(--ac-soft); color:var(--ac-ink); border-color:var(--ac-bd); }
.fb-status { display:flex; align-items:center; gap:14px; }
.fb-count { font-size:12px; color:var(--text-dim); } .fb-count b { color:var(--text); font-weight:650; }
.fb-clear { font-family:var(--mono); font-size:10.5px; color:var(--ac-ink); background:var(--ac-soft);
  border:1px solid var(--ac-bd); border-radius:var(--r-pill); padding:4px 11px; }

/* ---------- LIST additions ---------- */
.list-top { display:flex; justify-content:flex-end; margin-bottom:16px; }
.list-sort { display:flex; align-items:center; gap:8px; }
.list-sort .sort-lb { font-family:var(--mono); font-size:9.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-faint); }
.list-sort select { font-family:var(--font); font-size:12px; color:var(--text); background:var(--paper);
  border:1px solid var(--hairline-2); border-radius:8px; padding:6px 11px; cursor:pointer; }
.uc-card .chip-sm.dl { color:var(--text-dim); }
.uc-metrics { display:flex; gap:14px; margin-top:10px; padding-top:9px; border-top:1px solid var(--hairline);
  font-family:var(--mono); font-size:10.5px; color:var(--text-dim); }
.uc-metrics span { white-space:nowrap; }

/* ---------- TABLE VIEW ---------- */
#table-view { overflow:auto; padding:16px 20px 50px; }
.dtable { border-collapse:collapse; width:100%; font-size:12.5px; min-width:900px; }
.dtable thead th { position:sticky; top:0; z-index:2; background:var(--surface-2);
  font-family:var(--mono); font-size:9.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--text-dim);
  text-align:left; padding:9px 10px; border-bottom:1px solid var(--hairline-2); cursor:pointer; white-space:nowrap; user-select:none; }
.dtable thead th:hover { color:var(--text); }
.dtable thead th.num { text-align:right; }
.dtable thead th i { font-style:normal; color:var(--ac); margin-left:3px; }
.dtable tbody td { padding:9px 10px; border-bottom:1px solid var(--hairline); color:var(--text-dim);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:280px; }
.dtable tbody td.num { text-align:right; font-variant-numeric:tabular-nums; font-family:var(--mono); font-size:11.5px; }
.dtable tbody tr { cursor:pointer; }
.dtable tbody tr:hover td { background:var(--ac-fill); }
.dtable td.c-name { color:var(--text); font-weight:550; max-width:340px; }
.dtable td.c-name .dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:8px; vertical-align:middle; }
.dtable .tmf { font-family:var(--mono); font-size:9px; color:var(--text-faint); }
.dtable td.empty { text-align:center; color:var(--text-faint); padding:40px; }

/* ---------- ANALYTICS VIEW ---------- */
#analytics-view { overflow-y:auto; padding:22px 24px 60px; }
.a-headline { margin-bottom:18px; }
.a-lead { font-size:17px; line-height:1.5; color:var(--text-dim); max-width:80ch; }
.a-lead b { color:var(--text); font-weight:650; }
.a-tiles { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:20px; }
.a-tile { background:var(--paper); border:1px solid var(--hairline); border-radius:var(--r-card); box-shadow:var(--sh-card); padding:14px 16px; }
.a-tile .n { display:block; font-size:30px; font-weight:750; letter-spacing:-0.03em; line-height:1; font-variant-numeric:tabular-nums; }
.a-tile .n.ac { color:var(--ac); }
.a-tile .l { display:block; font-size:11px; color:var(--text-dim); margin-top:6px; line-height:1.3; }
.a-grid { display:grid; grid-template-columns:1.5fr 1fr; grid-auto-rows:auto; gap:16px; }
.a-panel { background:var(--paper); border:1px solid var(--hairline); border-radius:var(--r-card); box-shadow:var(--sh-card); padding:16px 18px; }
.a-panel.a-wide { grid-row:span 2; }
.a-panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.a-panel .p-lb { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:var(--ac);
  display:flex; align-items:center; gap:8px; margin-bottom:0; }
.a-panel .p-lb .dot { width:7px; height:7px; border-radius:50%; background:var(--ac-glow); }
.a-toggle { display:flex; background:var(--surface-3); border-radius:8px; padding:2px; gap:2px; }
.a-toggle button { border:none; background:transparent; font-size:11px; font-weight:550; color:var(--text-dim); padding:5px 10px; border-radius:6px; }
.a-toggle button.on { background:var(--paper); color:var(--text); box-shadow:0 1px 2px rgba(20,20,22,.12); }
.a-toggle.sm { margin-bottom:12px; }
.a-toggle.sm button { font-size:10.5px; padding:4px 9px; }

.quadsvg { width:100%; height:auto; display:block; }
.quadsvg .qdot { cursor:pointer; transition:fill-opacity .12s; }
.quadsvg .qdot:hover { fill-opacity:0.95; }
.quadsvg .qlab { font-family:var(--mono); font-size:10px; fill:var(--text-faint); letter-spacing:.02em; }
.quadsvg .qaxis { font-family:var(--mono); font-size:11px; fill:var(--text-dim); letter-spacing:.03em; }
.quadsvg .qnote { font-family:var(--mono); font-size:9px; fill:var(--text-faint); }

.bars { display:flex; flex-direction:column; gap:7px; }
.bar-row { display:flex; align-items:center; gap:10px; font-size:12px; }
.bar-row .bl { flex:0 0 116px; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar-row .bt { flex:1; height:14px; background:var(--surface-2); border-radius:4px; overflow:hidden; }
.bar-row .bfill { display:block; height:100%; border-radius:4px; }
.bar-row .bn { flex:0 0 auto; font-family:var(--mono); font-size:11px; color:var(--text-dim); font-variant-numeric:tabular-nums; }

.leader { list-style:none; margin:0; padding:0; counter-reset:l; }
.leader li { display:flex; align-items:center; gap:9px; padding:7px 0; border-bottom:1px solid var(--hairline); cursor:pointer; counter-increment:l; }
.leader li:last-child { border-bottom:none; }
.leader li::before { content:counter(l); font-family:var(--mono); font-size:10px; color:var(--text-faint); width:16px; flex:0 0 auto; }
.leader li:hover .lname { color:var(--ac); }
.leader .ld { width:8px; height:8px; border-radius:50%; flex:0 0 auto; }
.leader .lname { font-size:12.5px; color:var(--text); flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.leader .lmeta { font-family:var(--mono); font-size:9.5px; color:var(--text-faint); flex:0 0 auto; }

/* ---------- DRAWER v2: metrics strip + moat + industries ---------- */
.d-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:18px; }
.d-metrics .dm { background:var(--surface); border:1px solid var(--hairline); border-radius:9px; padding:9px 11px; }
.d-metrics .dm-k { display:block; font-family:var(--mono); font-size:8.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-faint); margin-bottom:4px; }
.d-metrics .dm-v { font-size:14px; font-weight:650; color:var(--text); }
.d-metrics .dm-v.ac { color:var(--ac); }
.d-metrics .dm-v.gray { color:var(--text); }
.d-metrics .dm-v i { font-style:normal; font-size:10px; font-weight:400; color:var(--text-faint); margin-left:2px; }
.lv.gray { background:#5A5A62 !important; color:#fff !important; }
.sys-k { font-size:11px; color:var(--text-faint); font-family:var(--mono); letter-spacing:.06em; margin-bottom:6px; }
.d-meta .v.ind { display:flex; flex-wrap:wrap; gap:4px; }
.ichip { font-family:var(--mono); font-size:10px; color:var(--text-dim); background:var(--surface-2); border:1px solid var(--hairline); border-radius:5px; padding:2px 7px; font-weight:400; }
.ichip.pri { color:var(--ac-ink); background:var(--ac-soft); border-color:var(--ac-bd); font-weight:600; }
.moat { font-family:var(--mono); font-size:11px; font-weight:600; padding:2px 8px; border-radius:5px; }
.moat.open { color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd); }
.moat.contested { color:#8E6E1C; background:#F8EFD8; border:1px solid #E6D29E; }
.moat.owned { color:var(--text-faint); background:var(--surface-2); border:1px solid var(--hairline); }
.sec-lb.warn { color:#B4483F; } .sec-lb.warn .dot { background:#B4483F; }
.xlink { font-size:12px; color:var(--ac-ink); background:var(--ac-fill); border:1px solid var(--ac-bd); border-radius:var(--r-pill); padding:5px 12px; }
.xlink:hover { background:var(--ac-soft); }

@media (max-width:900px){ .a-tiles{ grid-template-columns:repeat(2,1fr); } .a-grid{ grid-template-columns:1fr; } .a-panel.a-wide{ grid-row:auto; } }

/* ---------- MARKET view ---------- */
#market-view { overflow-y:auto; padding:30px 24px 60px; }
.mkt-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:4px; }
.mkt-panel { display:flex; flex-direction:column; }
.mkt-head { font-size:16px; font-weight:650; letter-spacing:-0.02em; color:var(--text); line-height:1.35; margin:2px 0 12px; }
.mkt-points { list-style:none; margin:0; padding:0; }
.mkt-points li { display:flex; align-items:baseline; gap:10px; padding:8px 0; border-top:1px solid var(--hairline); }
.mkt-points li:first-child { border-top:none; }
.mp-stat { flex:1; font-size:13px; color:var(--text-dim); line-height:1.45; }
.mp-stat b { color:var(--text); }
.mp-src { flex:0 0 auto; font-family:var(--mono); font-size:9px; letter-spacing:.04em; color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd); border-radius:5px; padding:2px 7px; white-space:nowrap; }
.mkt-disclaimer { margin:20px auto 0; max-width:1040px; font-size:11.5px; color:var(--text-faint); line-height:1.5; font-style:italic; }
@media (max-width:820px){ .mkt-grid { grid-template-columns:1fr; } }

/* ---------- DRAWER: context + valueProp + market ---------- */
.d-context { background:var(--surface); border:1px solid var(--hairline); border-left:3px solid var(--hairline-2); border-radius:10px; padding:13px 15px; margin-bottom:14px; }
.d-context p { font-size:13.5px; color:var(--text-dim); line-height:1.55; margin:0; }
.d-context p b { color:var(--text); font-weight:600; }
.d-list.tight { margin-top:8px; }
.d-list.tight li { margin:5px 0; font-size:12.5px; }
.d-valueprop { display:flex; gap:12px; align-items:flex-start; background:var(--ac-fill); border:1px solid var(--ac-bd); border-radius:10px; padding:12px 15px; margin-bottom:20px; }
.d-valueprop .vp-k { font-family:var(--mono); font-size:9px; letter-spacing:.12em; text-transform:uppercase; color:var(--ac-ink); background:var(--paper); border:1px solid var(--ac-bd); border-radius:5px; padding:3px 8px; flex:0 0 auto; margin-top:2px; }
.d-valueprop p { font-size:14px; color:var(--text); font-weight:600; line-height:1.5; margin:0; }
.d-market { display:flex; flex-direction:column; gap:8px; }
.mk-row { display:flex; gap:12px; align-items:baseline; font-size:12.5px; color:var(--text-dim); line-height:1.5; }
.mk-row .mk-k { flex:0 0 66px; font-family:var(--mono); font-size:9px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-faint); padding-top:2px; }
.mk-row span:last-child b { color:var(--text); }

/* ============================================================================
   v4 — PRIORITY: badges · multi-select industry facet · Priority tab
   ========================================================================== */

/* priority badge (list cards) + wedge tag */
.pbadge { font-family:var(--mono); font-size:9px; font-weight:600; letter-spacing:.03em; border-radius:5px; padding:2px 7px; flex:0 0 auto; }
.pbadge.p1 { color:#fff; background:var(--ac); }
.pbadge.p2 { color:var(--text-dim); background:var(--surface-3); }
.pbadge.p3 { color:var(--text-faint); background:var(--surface-2); border:1px solid var(--hairline); }
.wedge-tag { font-family:var(--mono); font-size:8px; letter-spacing:.07em; text-transform:uppercase; color:var(--ac-ink);
  background:var(--ac-fill); border:1px solid var(--ac-bd); border-radius:4px; padding:1px 5px; flex:0 0 auto; }
.uc-card .uc-top .status { margin-left:auto; }

/* table priority cell */
.dtable .pcell { font-family:var(--mono); font-size:9px; font-weight:600; border-radius:4px; padding:1px 5px; }
.dtable .pcell.p1 { color:#fff; background:var(--ac); }
.dtable .pcell.p2 { color:var(--text-dim); background:var(--surface-3); }
.dtable .pcell.p3 { color:var(--text-faint); background:var(--surface-2); }
.dtable .tw { color:var(--ac); }

/* multi-select checkbox facet */
.ffacet { position:relative; }
.ffacet summary { list-style:none; cursor:pointer; font-size:12px; color:var(--text); background:var(--surface);
  border:1px solid var(--hairline-2); border-radius:8px; padding:6px 11px; display:flex; align-items:center; gap:6px; user-select:none; }
.ffacet summary::-webkit-details-marker { display:none; }
.ffacet summary b { color:var(--ac-ink); }
.ffacet[open] summary, .ffacet summary:hover { border-color:var(--ac-bd); }
.ffacet[open] summary { background:var(--ac-fill); }
.ffacet-caret { color:var(--text-faint); font-size:8px; }
.ffacet-menu { position:absolute; z-index:30; top:calc(100% + 5px); left:0; min-width:220px; max-height:300px; overflow:auto;
  background:var(--paper); border:1px solid var(--hairline-2); border-radius:10px;
  box-shadow:0 10px 30px -6px rgba(20,20,22,.18); padding:6px; }
.fchk { display:flex; align-items:center; gap:9px; font-size:12.5px; color:var(--text-dim); padding:5px 8px; border-radius:6px; cursor:pointer; }
.fchk:hover { background:var(--surface-2); }
.fchk input { accent-color:var(--ac); width:14px; height:14px; flex:0 0 auto; }
.fchk > span:not(.fc-n) { flex:1; }
.fchk .fc-n { font-family:var(--mono); font-size:10px; color:var(--text-faint); }

/* nav hero button */
.nav button.nav-hero { color:var(--ac-ink); font-weight:650; }
.nav button.nav-hero:hover { color:var(--ac-ink); }
.nav button.nav-hero.on { background:var(--ac); color:#fff; box-shadow:0 1px 3px rgba(77,124,94,.45); }

/* ---------- PRIORITY TAB ---------- */
#priority-view { overflow-y:auto; padding:30px 24px 60px; }
#priority-view::-webkit-scrollbar { width:10px; }
#priority-view::-webkit-scrollbar-thumb { background:var(--hairline-2); border-radius:6px; border:3px solid var(--paper); }
.pri-eyebrow { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:var(--ac); margin-bottom:10px; }
.pri-hero h2 { font-size:34px; }
.pri-hero h2 em { color:var(--ac); font-style:italic; }
.pri-stats { display:flex; gap:14px; flex-wrap:wrap; margin:2px 0 4px; }
.ps { flex:1; min-width:158px; background:var(--paper); border:1px solid var(--hairline); border-radius:var(--r-card);
  box-shadow:var(--sh-card); padding:14px 16px; display:flex; align-items:baseline; gap:11px; }
.ps b { font-size:25px; font-weight:700; color:var(--ac-ink); letter-spacing:-0.02em; font-variant-numeric:tabular-nums; flex:0 0 auto; }
.ps span { font-size:11.5px; color:var(--text-dim); line-height:1.35; }
.ps i { font-style:normal; color:var(--text-faint); }

/* whole-field dot plot — every use case on the 0..10 value axis, P1 bar at 8.0 */
.pri-dist { margin:6px 0 2px; }
.pri-dist .p-lb { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:var(--ac); margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.pri-dist .p-lb .dot { width:7px; height:7px; border-radius:50%; background:var(--ac-glow); }
.pri-dist .p-lb b { color:var(--ac-ink); }
.pri-track { position:relative; margin:10px 0 6px; border-left:1px solid var(--hairline); border-bottom:1px solid var(--hairline); }
.pdot { position:absolute; width:8px; height:8px; border-radius:50%; transform:translateX(-50%); cursor:pointer; transition:transform .1s; }
.pdot:hover { transform:translateX(-50%) scale(1.7); z-index:8; }
.pdot.p1 { box-shadow:0 0 0 1.5px var(--paper), 0 1px 3px rgba(20,20,22,.22); }
.pdot.p2 { background:var(--text-faint); opacity:.5; }
.pdot.p3 { background:var(--hairline-2); opacity:.75; }
.pri-line { position:absolute; top:0; bottom:0; width:0; border-left:1.5px dashed var(--ac); }
.pri-line span { position:absolute; top:-3px; left:7px; font-family:var(--mono); font-size:9px; letter-spacing:.05em; text-transform:uppercase;
  color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd); border-radius:4px; padding:1px 6px; white-space:nowrap; }
.pri-axis { display:flex; gap:14px; font-family:var(--mono); font-size:9.5px; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); margin-top:5px; }
.pri-axis span:first-child, .pri-axis span:last-child { color:var(--text-dim); }
.pri-legend { display:flex; gap:20px; flex-wrap:wrap; margin-top:13px; padding-top:13px; border-top:1px solid var(--hairline); }
.pri-legend .li { display:inline-flex; align-items:center; gap:8px; font-size:11.5px; color:var(--text-dim); }
.pri-legend .pdot { position:static; transform:none; opacity:1; }

/* priority controls — segmented tier toggle */
.pri-seg { display:flex; align-items:center; gap:4px; margin:22px 0 14px; }
.pri-seg .seg-lb { font-family:var(--mono); font-size:9px; letter-spacing:.14em; text-transform:uppercase; color:var(--text-faint); margin-right:8px; }
.pri-seg button { font-family:var(--font); font-size:12px; font-weight:550; color:var(--text-dim); background:var(--surface);
  border:1px solid var(--hairline-2); border-radius:8px; padding:6px 13px; cursor:pointer; }
.pri-seg button:hover { border-color:var(--ac-bd); color:var(--text); }
.pri-seg button.on { background:var(--ac); color:#fff; border-color:var(--ac); }
.pri-seg .seg-div { width:1px; height:20px; background:var(--hairline-2); margin:0 5px; }
.pri-xall { font-family:var(--font); font-size:12px; font-weight:600; color:var(--ac-ink); background:var(--ac-fill);
  border:1px solid var(--ac-bd); border-radius:8px; padding:6px 13px; cursor:pointer; }
.pri-xall:hover { background:var(--ac-soft); }
.pri-xall.on { background:var(--ac); color:#fff; border-color:var(--ac); }
.arow-all { border-style:dashed; }
.arow-all .aname { color:var(--ac-ink); font-weight:650; }
.arow-all .arank { color:var(--ac); }
.pri-group { margin-bottom:16px; }
.pri-group-head { display:flex; align-items:center; gap:9px; font-size:13px; font-weight:650; color:var(--text); margin:2px 2px 8px; }
.pri-group-head .pgh-n { margin-left:auto; font-family:var(--mono); font-size:10px; color:var(--text-faint); font-weight:500; }

/* two-pane cascade: areas (left) → priority use cases (right), both always visible */
.pri-cascade { display:grid; grid-template-columns:minmax(270px,350px) 1fr; gap:16px; align-items:start; }
.pri-left { display:flex; flex-direction:column; gap:6px; position:sticky; top:12px; }
.arow { display:flex; align-items:center; gap:11px; width:100%; text-align:left; background:var(--paper);
  border:1px solid var(--hairline); border-radius:var(--r-card); box-shadow:var(--sh-card); padding:11px 13px; cursor:pointer; transition:border-color .12s, background .12s; }
.arow:hover { border-color:var(--ac-bd); }
.arow.on { border-color:var(--ac); background:var(--ac-fill); box-shadow:0 0 0 2px var(--ac-soft); }
.arank { font-family:var(--mono); font-size:12px; font-weight:600; color:var(--text-faint); width:16px; text-align:right; flex:0 0 auto; font-variant-numeric:tabular-nums; }
.aswatch { width:4px; align-self:stretch; min-height:30px; border-radius:3px; flex:0 0 auto; }
.amain { flex:1; min-width:0; }
.aname { font-size:13.5px; font-weight:600; color:var(--text); letter-spacing:-0.01em; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.arow .acounts { margin-top:4px; }
.atag { font-family:var(--mono); font-size:8px; letter-spacing:.07em; text-transform:uppercase; border-radius:4px; padding:2px 6px; font-weight:600; }
.atag.strong { color:#fff; background:var(--ac); }
.atag.expand { color:var(--text-dim); background:var(--surface-3); }
.acounts { display:flex; gap:6px; flex:0 0 auto; }
.pi { font-family:var(--mono); font-size:10px; font-weight:600; border-radius:4px; padding:2px 7px; }
.pi.p1 { color:#fff; background:var(--ac); }
.pi.p2 { color:var(--text-dim); background:var(--surface-3); }
.abest { font-family:var(--mono); font-size:15px; font-weight:700; color:var(--ac-ink); width:30px; text-align:right; flex:0 0 auto; font-variant-numeric:tabular-nums; }

.pri-right { display:flex; flex-direction:column; gap:8px; min-width:0; }
.pri-right-head { padding:0 2px 4px; }
.prh-top { display:flex; align-items:center; gap:10px; }
.prh-sw { width:12px; height:12px; border-radius:4px; flex:0 0 auto; }
.pri-right-head h3 { font-size:19px; font-weight:650; letter-spacing:-0.02em; margin:0; }
.prh-best { margin-left:auto; font-family:var(--mono); font-size:11px; color:var(--text-faint); }
.pri-right-head p { font-size:12.5px; color:var(--text-dim); margin:7px 0 0; line-height:1.5; }
.pri-right-list { display:flex; flex-direction:column; gap:8px; }
.anote { font-size:12px; color:var(--text-dim); background:var(--surface-2); border:1px solid var(--hairline); border-radius:8px; padding:9px 12px; line-height:1.5; }
.starthere { font-family:var(--mono); font-size:8px; letter-spacing:.07em; text-transform:uppercase; color:var(--ac-on); background:var(--ac); border-radius:4px; padding:2px 6px; font-weight:600; }
@media (max-width:820px){ .pri-cascade{ grid-template-columns:1fr; } .pri-left{ position:static; } }
.prow { display:flex; align-items:center; gap:14px; background:var(--paper); border:1px solid var(--hairline);
  border-radius:var(--r-card); box-shadow:var(--sh-card); padding:13px 16px; cursor:pointer; transition:border-color .12s, transform .12s; }
.prow:hover { border-color:var(--ac-bd); transform:translateX(2px); }
.prank { font-family:var(--mono); font-size:13px; font-weight:600; color:var(--text-faint); width:22px; text-align:right;
  flex:0 0 auto; font-variant-numeric:tabular-nums; }
.pswatch { width:4px; align-self:stretch; border-radius:3px; flex:0 0 auto; min-height:34px; }
.pmain { flex:1; min-width:0; }
.pname { font-size:14.5px; font-weight:600; color:var(--text); display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.pdom { font-family:var(--mono); font-size:9.5px; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); font-weight:500; }
.pvp { font-size:12.5px; color:var(--text-dim); margin:4px 0 8px; line-height:1.45; }
.pchips { display:flex; gap:6px; flex-wrap:wrap; }
.pchip { font-family:var(--mono); font-size:10px; color:var(--text-dim); background:var(--surface-2); border:1px solid var(--hairline); border-radius:5px; padding:2px 8px; }
.pchip.moat { color:var(--ac-ink); background:var(--ac-soft); border-color:var(--ac-bd); }
.pchip.dollar { color:var(--ac-ink); background:var(--ac-fill); border-color:var(--ac-bd); font-weight:650; }
.pchip.anchor { color:var(--text-faint); }
.pscore { display:flex; flex-direction:column; align-items:flex-end; gap:5px; width:120px; flex:0 0 auto; }
.pbar { width:100%; height:7px; background:var(--surface-3); border-radius:4px; overflow:hidden; }
.pbar span { display:block; height:100%; border-radius:4px; }
.pnum { font-family:var(--mono); font-size:15px; font-weight:700; color:var(--ac-ink); font-variant-numeric:tabular-nums; }
.pri-note { margin:24px 0 10px; }
.pri-note p { font-size:12.5px; color:var(--text-dim); line-height:1.6; margin:0; }
@media (max-width:760px){ .pscore{ width:78px; } .pri-stats .ps{ min-width:130px; } }

/* ========================================================================== *
   "OPEN" BUTTON — opens the full modal (card/row click still opens the sidebar)
   Shared by list cards + priority rows so the affordance is consistent.
 * ========================================================================== */
.uc-open {
  flex:0 0 auto; font-family:var(--mono); font-size:10px; font-weight:600; letter-spacing:.03em;
  color:var(--card-ac,var(--ac-ink)); background:var(--surface); border:1px solid var(--hairline);
  border-radius:var(--r-pill); padding:4px 11px; cursor:pointer; display:inline-flex; align-items:center; gap:5px;
  transition:border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease; white-space:nowrap;
}
.uc-open:hover { border-color:var(--ac-bd); background:var(--ac-fill); color:var(--ac-ink); box-shadow:var(--sh-card); }
.uc-open .ico { font-size:12px; line-height:1; }
.uc-card .uc-open { margin-left:auto; }     /* right-align in the card foot */
.prow-open { align-self:center; }           /* sits after the score column in a priority row */

/* SIM-AVAILABLE FLAG — small "▶ sim" chip wherever a use case is listed */
.sim-flag {
  font-family:var(--mono); font-size:8.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase;
  color:var(--ac-ink); background:var(--ac-soft); border:1px solid var(--ac-bd); border-radius:5px;
  padding:2px 6px 2px 5px; display:inline-flex; align-items:center; gap:3px; white-space:nowrap; vertical-align:middle;
}
.sim-flag .tri { font-size:7.5px; line-height:1; }
.c-name .sim-flag { margin-left:7px; }

/* ========================================================================== *
   DETAIL MODAL — full view + simulation
 * ========================================================================== */
.modal-scrim { position:fixed; inset:0; background:rgba(20,20,22,.42); z-index:60; opacity:0; pointer-events:none; transition:opacity .22s; }
.modal-scrim.on { opacity:1; pointer-events:auto; }
.modal { position:fixed; inset:0; z-index:61; display:flex; align-items:center; justify-content:center; padding:34px 20px; opacity:0; pointer-events:none; transition:opacity .22s; }
.modal.on { opacity:1; pointer-events:auto; }
.modal-card {
  --card-ac:var(--ac); width:min(880px,96vw); max-height:90vh; background:var(--paper);
  border:1px solid var(--hairline); border-top:3px solid var(--card-ac,var(--ac)); border-radius:16px;
  box-shadow:var(--sh-drawer); display:flex; flex-direction:column; overflow:hidden;
  transform:translateY(14px) scale(.986); transition:transform .28s cubic-bezier(.22,.7,.2,1);
}
.modal.on .modal-card { transform:none; }
.modal-bar {
  flex:0 0 auto; display:flex; align-items:center; gap:12px; padding:14px 22px;
  background:linear-gradient(180deg,#FBFBFD 0%,var(--surface-2) 100%); border-bottom:1px solid var(--hairline);
}
.modal-bar .lights { display:flex; gap:6px; }
.modal-bar .lights i { width:11px; height:11px; border-radius:50%; }
.modal-bar .lights i:nth-child(1){ background:var(--tl-red);} .modal-bar .lights i:nth-child(2){ background:var(--tl-yellow);} .modal-bar .lights i:nth-child(3){ background:var(--tl-green);}
.modal-bar .mbar-path { font-family:var(--mono); font-size:10px; letter-spacing:.05em; color:var(--text-faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.modal-bar .close { margin-left:auto; border:1px solid var(--hairline-2); background:var(--paper); border-radius:8px; width:30px; height:30px; font-size:16px; color:var(--text-dim); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.modal-bar .close:hover { color:var(--text); border-color:var(--ac-bd); }
.modal-body { flex:1; min-height:0; overflow-y:auto; padding:26px 32px 44px; }
body.modal-open { overflow:hidden; }

/* simulation panel */
.sim-panel {
  display:flex; align-items:center; gap:20px; padding:18px 22px; border-radius:13px; margin-bottom:26px;
  border:1px solid var(--ac-bd); background:var(--ac-soft);
}
.sim-panel .sim-copy { flex:1; min-width:0; }
.sim-panel .sim-badge { font-family:var(--mono); font-size:9px; font-weight:700; letter-spacing:.16em; color:var(--ac-on); background:var(--card-ac,var(--ac)); border-radius:5px; padding:3px 9px; }
.sim-panel h3 { font-size:16.5px; font-weight:650; letter-spacing:-0.02em; margin:10px 0 5px; line-height:1.2; }
.sim-panel p { font-size:12.5px; color:var(--text-dim); line-height:1.5; margin:0; }
.sim-launch {
  flex:0 0 auto; font-family:var(--mono); font-size:12px; font-weight:600; letter-spacing:.02em;
  color:var(--ac-on); background:var(--card-ac,var(--ac)); border:none; border-radius:10px;
  padding:12px 20px; cursor:pointer; text-decoration:none; white-space:nowrap;
  transition:filter .15s ease, transform .15s ease;
}
.sim-launch-col { flex:0 0 auto; display:flex; flex-direction:column; gap:8px; min-width:172px; }
.sim-launch-col .sim-launch { width:100%; text-align:center; }
/* multi-variant: one row per industry — domain sentence on the left, one button */
.sim-panel-multi { align-items:flex-start; }
.sim-variant-list { list-style:none; margin:15px 0 0; padding:0; display:flex; flex-direction:column; gap:10px; }
.sim-variant-row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding-top:11px; border-top:1px solid var(--ac-bd); }
.sim-variant-domain { font-size:12.5px; color:var(--text-dim); line-height:1.4; min-width:0; }
.sim-variant-domain b { color:var(--text); font-weight:600; }
.sim-variant-row .sim-launch { padding:9px 16px; }
.sim-launch:hover:not(:disabled) { filter:brightness(1.06); transform:translateY(-1px); }
.sim-launch:disabled { opacity:1; cursor:not-allowed; background:var(--surface-3); color:var(--text-faint); }
.sim-panel.soon { background:var(--surface-2); border-color:var(--hairline-2); border-style:dashed; }
.sim-panel.soon .sim-badge { background:var(--text-faint); color:var(--paper); }

/* links / resources slot */
.link-list { display:flex; flex-direction:column; gap:8px; }
.rlink { font-size:13px; color:var(--ac-ink); text-decoration:none; border-bottom:1px solid transparent; align-self:flex-start; }
.rlink:hover { border-bottom-color:var(--ac-bd); }

.modal-body::-webkit-scrollbar { width:10px; }
.modal-body::-webkit-scrollbar-thumb { background:var(--hairline-2); border-radius:6px; border:3px solid var(--paper); }

@media (prefers-reduced-motion:reduce){ .modal,.modal-scrim,.modal-card{ transition:none;} }
@media (max-width:640px){
  .modal { padding:0; align-items:flex-end; }
  .modal-card { width:100vw; max-height:94vh; border-radius:16px 16px 0 0; }
  .modal-body { padding:22px 20px 40px; }
  .sim-panel { flex-direction:column; align-items:flex-start; gap:14px; }
  .sim-launch { width:100%; text-align:center; }
  .sim-launch-col { width:100%; min-width:0; }
  .sim-variant-row { flex-direction:column; align-items:stretch; gap:9px; }
  .sim-variant-list { width:100%; }
}

/* ==========================================================================
   SIMULATION PLAYER — light agent-flow run trace (theme-consistent)
   ========================================================================== */
#sim-stage{
  --alert:#C0504A; --reason:#7B5AC6; --toolc:#3B78B0; --decide:#B8791F; --gate:#B8791F; --act:#4D7C5E;
  position:fixed; inset:0; z-index:70; display:none; background:var(--bg); color:var(--text); font-family:var(--font);
}
#sim-stage.on{ display:block; animation:simFade .24s ease; }
@keyframes simFade{ from{opacity:0} to{opacity:1} }
.sim-shell{ height:100%; display:flex; flex-direction:column; }

/* topbar */
.sim-topbar{ flex:0 0 auto; display:flex; align-items:center; gap:20px; padding:12px 22px;
  border-bottom:1px solid var(--hairline); background:var(--paper); }
.sim-scn{ display:flex; align-items:center; gap:12px; min-width:0; flex:1; }
.sim-ind{ font-family:var(--mono); font-size:9px; letter-spacing:.1em; text-transform:uppercase; color:var(--ac-ink);
  border:1px solid var(--ac-bd); background:var(--ac-soft); border-radius:6px; padding:5px 9px; white-space:nowrap; }
.sim-scn-x{ min-width:0; }
.sim-hl{ display:block; font-size:14.5px; font-weight:650; letter-spacing:-.02em; line-height:1.15; }
.sim-sub{ display:block; font-size:11.5px; color:var(--text-dim); font-style:normal; line-height:1.35; margin-top:2px;
  overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; }

.sim-clockwrap{ flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; gap:5px; min-width:180px; }
.sim-clock{ font-family:var(--mono); font-size:22px; font-weight:700; letter-spacing:.01em; line-height:1;
  font-variant-numeric:tabular-nums; color:var(--text); }
.sim-deadline{ width:200px; }
.dl-top{ display:flex; justify-content:space-between; font-family:var(--mono); font-size:8.5px; letter-spacing:.06em;
  text-transform:uppercase; color:var(--text-faint); margin-bottom:3px; }
.dl-note{ color:var(--act); font-weight:600; }
.dl-bar{ height:4px; background:var(--surface-3); border-radius:3px; overflow:hidden; }
.dl-fill{ display:block; height:100%; width:0; background:var(--act); border-radius:3px; transition:width .3s ease; }

.sim-ctrls{ flex:0 0 auto; display:flex; align-items:center; gap:9px; }
.sim-play{ width:36px; height:36px; border-radius:10px; border:1px solid var(--hairline-2); background:var(--surface);
  color:var(--text); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; transition:.15s; }
.sim-play:hover{ border-color:var(--ac-bd); background:var(--ac-fill); color:var(--ac-ink); }
.sim-play:disabled{ opacity:.4; cursor:not-allowed; }
.sim-speeds{ display:flex; background:var(--surface); border:1px solid var(--hairline-2); border-radius:9px; overflow:hidden; }
.sim-speeds button{ font-family:var(--mono); font-size:11px; font-weight:600; color:var(--text-dim); background:transparent;
  border:0; padding:8px 10px; cursor:pointer; transition:.12s; }
.sim-speeds button.on{ color:#fff; background:var(--ac); }
.sim-restart,.sim-close{ width:34px; height:34px; border-radius:9px; border:1px solid var(--hairline-2); background:var(--surface);
  color:var(--text-dim); font-size:14px; cursor:pointer; transition:.15s; }
.sim-restart:hover{ color:var(--ac-ink); border-color:var(--ac-bd); }
.sim-close:hover{ color:var(--alert); border-color:var(--alert); }

/* progress */
.sim-progress{ flex:0 0 auto; display:flex; align-items:center; gap:14px; padding:8px 24px; border-bottom:1px solid var(--hairline); background:var(--paper); }
.sim-step{ font-family:var(--mono); font-size:10px; letter-spacing:.06em; text-transform:uppercase; color:var(--text-faint); white-space:nowrap; min-width:88px; }
.sim-prog-bar{ flex:1; height:3px; background:var(--surface-3); border-radius:2px; overflow:hidden; }
.sim-prog-fill{ display:block; height:100%; width:0; background:var(--ac); transition:width .5s ease; }

/* main */
.sim-main{ flex:1; min-height:0; display:grid; grid-template-columns:minmax(300px,0.9fr) minmax(360px,1.2fr) minmax(340px,1.05fr); }
.sim-rail{ border-right:1px solid var(--hairline); padding:18px 16px; overflow-y:auto; background:var(--surface); }
.rail-h{ font-family:var(--mono); font-size:9px; letter-spacing:.12em; text-transform:uppercase; color:var(--text-faint); margin-bottom:12px; }
.rail-list{ display:flex; flex-direction:column; gap:7px; }
.rail-sys{ display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:9px; border:1px solid transparent; opacity:.45; transition:.35s; }
.rail-sys.lit{ opacity:1; background:var(--paper); border-color:var(--hairline); box-shadow:var(--sh-card); }
.rail-sx b{ display:block; font-size:11.5px; font-weight:600; letter-spacing:-.01em; color:var(--text); }
.rail-sx i{ display:block; font-size:9.5px; color:var(--text-faint); font-style:normal; }

/* brand tiles */
.btile{ flex:0 0 auto; width:30px; height:30px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.07); overflow:hidden; }
.btile-mono{ font-family:var(--mono); font-size:11px; font-weight:700; letter-spacing:.02em; }
.btile-wm{ font-family:var(--font); font-weight:800; font-size:11px; color:#fff; letter-spacing:.02em; }

/* stream */
.sim-stream{ overflow-y:auto; padding:24px 30px 90px; scroll-behavior:smooth; }
.sim-stream::-webkit-scrollbar,.sim-rail::-webkit-scrollbar{ width:9px; }
.sim-stream::-webkit-scrollbar-thumb,.sim-rail::-webkit-scrollbar-thumb{ background:var(--hairline-2); border-radius:5px; border:2px solid var(--bg); }

/* --- thin reasoning line (agent thought → response; NOT a block) --- */
.srz{ max-width:720px; margin:0 auto 9px; display:grid; grid-template-columns:26px 1fr; gap:12px;
  opacity:0; transform:translateY(6px); transition:opacity .35s ease, transform .35s ease; }
.srz.in{ opacity:1; transform:none; }
.srz-dot{ width:7px; height:7px; border-radius:50%; background:var(--reason); margin:7px auto 0; box-shadow:0 0 0 3px rgba(124,92,198,.12); flex:0 0 auto; }
.srz-x{ min-width:0; padding:1px 0; }
.srz-say{ font-size:12.5px; color:var(--text-dim); line-height:1.6; margin:0; }
.srz-say .srz-t{ font-family:var(--mono); font-size:9.5px; color:var(--text-faint); margin-right:8px; font-variant-numeric:tabular-nums; }
.srz-say .who{ color:var(--reason); font-weight:650; }
.srz-plan{ margin:7px 0 2px; padding-left:18px; display:grid; gap:3px; }
.srz-plan li{ font-size:11.5px; color:var(--text-dim); line-height:1.4; }
.srz-call{ margin-top:7px; }
.srz-call code{ font-family:var(--mono); font-size:11px; color:var(--toolc); background:var(--surface-2); border:1px solid var(--hairline);
  border-radius:6px; padding:3px 8px; display:inline-block; word-break:break-word; }
.srz-res{ margin-top:6px; font-family:var(--mono); font-size:10.5px; color:var(--text-dim); line-height:1.5; padding-left:10px; border-left:2px solid var(--hairline-2); }

/* --- block (trigger / tool / decision / action / gate / milestone) --- */
.sev{ position:relative; max-width:720px; margin:0 auto 13px; display:grid; grid-template-columns:26px 1fr; gap:12px;
  opacity:0; transform:translateY(12px); transition:opacity .45s ease, transform .45s cubic-bezier(.22,.7,.2,1); }
.sev.in{ opacity:1; transform:none; }
.sev-rail{ display:flex; flex-direction:column; align-items:center; padding-top:6px; }
.sev-dot{ width:11px; height:11px; border-radius:50%; background:var(--toolc); box-shadow:0 0 0 3px rgba(59,120,176,.14); flex:0 0 auto; }
.sev-line{ flex:1; width:2px; margin-top:6px; background:var(--hairline); }
.sev-body{ background:var(--paper); border:1px solid var(--hairline); border-radius:12px; padding:14px 16px; min-width:0; box-shadow:var(--sh-card); }
.sev-head{ display:flex; align-items:center; gap:10px; margin-bottom:9px; flex-wrap:wrap; }
.sev-badge{ font-family:var(--mono); font-size:8.5px; font-weight:700; letter-spacing:.1em; padding:3px 8px; border-radius:5px;
  background:rgba(59,120,176,.12); color:var(--toolc); }
.sev-agent{ font-family:var(--mono); font-size:10.5px; color:var(--reason); font-weight:600; }
.sev-sys{ display:inline-flex; align-items:center; gap:8px; }
.sev-sys .btile{ width:26px; height:26px; border-radius:7px; }
.sev-sys-x b{ display:block; font-size:11px; font-weight:650; line-height:1.1; color:var(--text); }
.sev-sys-x i{ display:block; font-size:9px; color:var(--text-faint); font-style:normal; }
.sev-t{ margin-left:auto; font-family:var(--mono); font-size:10px; color:var(--text-faint); font-variant-numeric:tabular-nums; white-space:nowrap; }
.sev-t i{ font-style:normal; color:var(--text-faint); opacity:.75; margin-left:5px; }
.sev-title{ font-size:14.5px; font-weight:650; letter-spacing:-.02em; line-height:1.25; margin-bottom:2px; color:var(--text); }
.sev-say{ font-size:13px; color:var(--text-dim); line-height:1.6; margin-top:5px; }
.sev-call{ display:flex; align-items:center; gap:9px; margin-top:11px; padding:9px 11px; border-radius:8px;
  background:var(--surface-2); border:1px solid var(--hairline); }
.sev-call-mark{ font-family:var(--mono); font-size:12px; color:var(--toolc); font-weight:700; }
.sev-call code{ font-family:var(--mono); font-size:11.5px; color:var(--text); word-break:break-word; }
.sev-result{ margin-top:9px; font-family:var(--mono); font-size:11px; color:var(--text-dim); line-height:1.55;
  padding-left:11px; border-left:2px solid var(--ac-bd); }
.sev-pills{ display:flex; flex-wrap:wrap; gap:8px; margin-top:11px; }
.sev-pills .pill{ background:var(--surface); border:1px solid var(--hairline); border-radius:8px; padding:6px 10px; }
.sev-pills .pill b{ display:block; font-size:13.5px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }
.sev-pills .pill i{ display:block; font-size:9px; color:var(--text-faint); font-style:normal; letter-spacing:.02em; margin-top:1px; }

/* block type accents */
.sev.t-trigger .sev-dot{ background:var(--alert); box-shadow:0 0 0 3px rgba(192,80,74,.16); animation:sevPulse 1.6s ease infinite; }
.sev.t-trigger .sev-body{ border-color:rgba(192,80,74,.35); }
.sev.t-trigger .sev-badge{ background:rgba(192,80,74,.12); color:var(--alert); }
@keyframes sevPulse{ 0%,100%{ box-shadow:0 0 0 3px rgba(192,80,74,.16);} 50%{ box-shadow:0 0 0 7px rgba(192,80,74,.03);} }
.sev.t-tool .sev-dot{ background:var(--toolc); }
.sev.t-decide .sev-dot{ background:var(--decide); box-shadow:0 0 0 3px rgba(184,121,31,.14); }
.sev.t-decide .sev-badge{ background:rgba(184,121,31,.12); color:var(--decide); }
.sev.t-action .sev-dot{ background:var(--act); box-shadow:0 0 0 3px rgba(77,124,94,.16); }
.sev.t-action .sev-badge{ background:var(--ac-soft); color:var(--ac-ink); }
.sev.t-action .sev-result{ color:var(--ac-ink); border-left-color:var(--ac); }
.sev.t-gate .sev-dot{ background:var(--gate); box-shadow:0 0 0 3px rgba(184,121,31,.16); }
.sev.t-gate .sev-body{ border-color:rgba(184,121,31,.4); }
.sev.t-gate .sev-badge{ background:rgba(184,121,31,.14); color:var(--gate); }
.sev.t-mile .sev-dot{ background:var(--ac); box-shadow:0 0 0 3px rgba(77,124,94,.16); }
.sev.t-mile .sev-body{ border-color:var(--ac-bd); background:var(--ac-fill); }

/* decision options */
.sev-opts{ display:flex; flex-direction:column; gap:8px; margin-top:11px; }
.opt{ display:flex; gap:11px; padding:10px 12px; border-radius:9px; background:var(--surface); border:1px solid var(--hairline); }
.opt.rec{ border-color:var(--ac-bd); background:var(--ac-fill); }
.opt-k{ flex:0 0 auto; width:22px; height:22px; border-radius:6px; background:var(--surface-2); border:1px solid var(--hairline-2);
  font-family:var(--mono); font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; color:var(--text-dim); }
.opt.rec .opt-k{ background:var(--ac); color:#fff; border-color:transparent; }
.opt-x b{ display:block; font-size:12.5px; font-weight:600; color:var(--text); }
.opt-x i{ display:block; font-size:11px; color:var(--text-faint); font-style:normal; margin-top:2px; line-height:1.4; }
.opt-rec{ font-family:var(--mono); font-size:8.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--ac-ink);
  border:1px solid var(--ac-bd); border-radius:4px; padding:1px 5px; margin-left:4px; vertical-align:middle; }

/* slack thread (light) */
.slack{ margin-top:12px; border:1px solid var(--hairline-2); border-radius:10px; overflow:hidden; background:var(--paper); }
.slack-top{ display:flex; align-items:center; gap:5px; padding:9px 12px; font-size:12px; font-weight:650; color:var(--text);
  background:var(--surface-2); border-bottom:1px solid var(--hairline); }
.slack-hash{ color:var(--text-faint); font-weight:700; }
.slack-appr{ margin-left:auto; font-family:var(--mono); font-size:9px; font-weight:500; letter-spacing:.02em; color:var(--text-faint); text-transform:none; }
.slack-feed{ padding:11px 12px; display:flex; flex-direction:column; gap:11px; }
.bubble{ display:flex; gap:10px; opacity:0; transform:translateY(6px); transition:.35s cubic-bezier(.22,.7,.2,1); }
.bubble.in{ opacity:1; transform:none; }
.av{ flex:0 0 auto; width:28px; height:28px; border-radius:7px; display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--mono); font-size:9.5px; font-weight:700; color:#fff; }
.av-bot{ background:linear-gradient(135deg,var(--reason),#5b8cff); }
.bub-x{ min-width:0; }
.bub-h{ display:flex; align-items:center; gap:8px; font-size:12px; font-weight:650; color:var(--text); margin-bottom:3px; }
.bub-t{ font-family:var(--mono); font-size:9px; font-weight:500; color:var(--text-faint); }
.bub-tag{ font-family:var(--mono); font-size:8px; letter-spacing:.05em; text-transform:uppercase; color:var(--gate);
  border:1px solid rgba(184,121,31,.35); border-radius:4px; padding:1px 5px; }
.bub-m{ font-size:12.5px; line-height:1.5; color:var(--text-dim); }
.bubble.hum .bub-m{ color:var(--text); font-weight:500; }
.slack-wait{ display:flex; align-items:center; gap:9px; font-size:11.5px; color:var(--gate); padding:8px 10px;
  background:rgba(184,121,31,.06); border:1px dashed rgba(184,121,31,.3); border-radius:8px; opacity:0; transition:.35s; }
.slack-wait.in{ opacity:1; }
.slack-wait.done{ opacity:.5; border-style:solid; }
.slack-wait .wmin{ font-family:var(--mono); font-weight:700; }
.spin{ width:12px; height:12px; border-radius:50%; border:2px solid rgba(184,121,31,.28); border-top-color:var(--gate); animation:simSpin .8s linear infinite; flex:0 0 auto; }
.slack-wait.done .spin{ animation:none; border-top-color:rgba(184,121,31,.28); }
@keyframes simSpin{ to{ transform:rotate(360deg); } }
.slack-decision{ display:flex; align-items:center; gap:8px; margin-top:2px; font-size:12px; font-weight:650; color:var(--ac-ink);
  padding:8px 11px; background:var(--ac-soft); border:1px solid var(--ac-bd); border-radius:8px; opacity:0; transition:.35s; }
.slack-decision.in{ opacity:1; }
.slack-decision .chk{ width:18px; height:18px; border-radius:50%; background:var(--ac); color:#fff; font-size:11px; font-weight:800;
  display:inline-flex; align-items:center; justify-content:center; }

/* run summary (agent-flow result, not a slide) */
.sim-summary{ max-width:820px; margin:6px auto 0; padding:20px 22px 22px; border-radius:14px;
  background:var(--paper); border:1px solid var(--hairline); box-shadow:var(--sh-card);
  opacity:0; transform:translateY(12px); transition:.45s cubic-bezier(.22,.7,.2,1); }
.sim-summary.in{ opacity:1; transform:none; }
.sum-top{ display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
  padding-bottom:15px; border-bottom:1px solid var(--hairline); margin-bottom:16px; }
.sum-done{ display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:650; color:var(--text); }
.sum-done .d{ width:8px; height:8px; border-radius:50%; background:var(--act); box-shadow:0 0 0 3px rgba(77,124,94,.16); }
.sum-runstats{ display:flex; gap:22px; flex-wrap:wrap; }
.rs{ display:flex; flex-direction:column; }
.rs b{ font-size:17px; font-weight:750; color:var(--text); letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.rs i{ font-family:var(--mono); font-size:9px; letter-spacing:.05em; text-transform:uppercase; color:var(--text-faint); font-style:normal; margin-top:2px; }
.sum-compare{ display:flex; align-items:center; gap:10px; font-size:12px; color:var(--text-dim); margin-bottom:16px; }
.sum-compare b{ color:var(--text); font-weight:650; }
.sum-compare .vs{ font-family:var(--mono); font-size:10px; color:var(--text-faint); }
.sum-lbl{ font-family:var(--mono); font-size:9.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--text-faint); margin-bottom:10px; }
.sum-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px; margin-bottom:18px; }
.sm{ padding:13px 14px; border-radius:11px; border:1px solid var(--hairline); background:var(--surface);
  opacity:0; transform:translateY(8px); transition:opacity .4s ease var(--d), transform .4s ease var(--d); }
.sim-summary.in .sm{ opacity:1; transform:none; }
.sm-val{ display:block; font-size:21px; font-weight:750; letter-spacing:-.02em; color:var(--text); font-variant-numeric:tabular-nums; }
.sm-lbl{ display:block; font-size:12px; font-weight:650; color:var(--text); margin-top:5px; }
.sm-sub{ display:block; font-size:10.5px; color:var(--text-dim); line-height:1.45; margin-top:3px; }
.sum-actions{ display:flex; gap:10px; }
.fin-btn{ font-family:var(--mono); font-size:12px; font-weight:600; padding:11px 18px; border-radius:10px; cursor:pointer; transition:.15s; }
.fin-btn.replay{ background:var(--surface); border:1px solid var(--hairline-2); color:var(--text-dim); }
.fin-btn.replay:hover{ color:var(--ac-ink); border-color:var(--ac-bd); }
.fin-btn.close{ background:var(--ac); border:1px solid var(--ac); color:#fff; }
.fin-btn.close:hover{ filter:brightness(1.06); }

@media (prefers-reduced-motion:reduce){
  #sim-stage.on,.sev,.srz,.bubble,.slack-wait,.slack-decision,.sim-summary,.sm{ animation:none; transition:none; }
  .sev,.srz,.bubble,.sim-summary,.sm{ opacity:1; transform:none; }
  .spin{ animation:none; }
}
@media (max-width:820px){
  .sim-main{ grid-template-columns:1fr; }
  .sim-rail{ display:none; }
}
@media (max-width:640px){
  .sim-topbar{ flex-wrap:wrap; gap:12px; padding:12px 16px; }
  .sim-scn{ order:1; flex:1 1 100%; }
  .sim-clockwrap{ order:2; align-items:flex-start; min-width:0; }
  .sim-ctrls{ order:3; margin-left:auto; }
  .sim-sub{ -webkit-line-clamp:2; }
  .sim-stream{ padding:18px 14px 80px; }
}

/* ==========================================================================
   SIMULATION · MISSION-CONTROL (connection graph + impact band + payloads)
   ========================================================================== */
/* topbar telemetry */
.sim-telem{ display:flex; gap:18px; flex:0 0 auto; }
.tchip{ display:flex; flex-direction:column; gap:2px; }
.tchip i{ font-family:var(--mono); font-size:8px; letter-spacing:.06em; text-transform:uppercase; color:var(--text-faint); font-style:normal; white-space:nowrap; }
.tchip b{ font-family:var(--mono); font-size:12px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }

/* the orchestration stage (left column) */
.orch-stage{ position:relative; display:flex; flex-direction:column; min-height:0; background:var(--paper); border-right:1px solid var(--hairline); }
.orch-svg{ flex:1; min-height:0; width:100%; display:block; }
.orch-console{ flex:0 0 auto; height:58px; overflow:hidden; border-top:1px solid var(--hairline); background:var(--surface); padding:7px 16px; }
.slog{ display:flex; gap:8px; font-family:var(--mono); font-size:9.5px; line-height:1.72; color:var(--text-faint); opacity:.5; }
.slog.new{ opacity:1; color:var(--text-dim); }
.slog-a{ color:var(--ac); font-weight:700; }
.slog-h{ white-space:nowrap; }
.orch-legend{ flex:0 0 auto; display:flex; gap:16px; padding:8px 16px; border-top:1px solid var(--hairline); font-family:var(--mono); font-size:9px; letter-spacing:.03em; color:var(--text-faint); }
.lg{ display:inline-flex; align-items:center; gap:6px; }
.lg::before{ content:""; width:8px; height:8px; border-radius:50%; background:var(--hairline-2); }
.lg.r::before{ background:var(--ac); } .lg.w::before{ background:#B8791F; } .lg.d::before{ background:var(--ac); }
.lg.h::before{ background:#B8791F; } .lg.f::before{ background:var(--alert); }

/* --- graph: edges + packets + chords --- */
.orch-edge{ stroke:var(--ac-bd); stroke-width:1.2; stroke-dasharray:2 4; opacity:.55; fill:none; }
.orch-edge.active{ stroke:var(--ac); stroke-width:2.4; stroke-dasharray:4 6; animation:dashflow 1.1s linear infinite; }
.orch-edge.used{ stroke:var(--ac); stroke-opacity:.5; stroke-width:1.4; stroke-dasharray:none; }
.orch-svg.paused .orch-edge.active{ animation-play-state:paused; }
@keyframes dashflow{ to{ stroke-dashoffset:-10; } }
.chord{ fill:none; stroke:var(--reason); stroke-width:1; opacity:0; transition:opacity .5s; stroke-dasharray:2 4; }
.chord.show{ opacity:.5; } .chord.faded{ opacity:.22; }
.pkt{ fill:var(--ac); } .pkt.write{ fill:#B8791F; }
.pkt-halo{ fill:var(--ac); opacity:.35; } .pkt-halo.write{ fill:#B8791F; }
.unlock-ring{ fill:none; stroke:var(--ac); stroke-width:2; }

/* --- graph: agent core + system nodes --- */
.core-halo{ fill:var(--ac); opacity:.08; }
.core-ring{ fill:#fff; stroke:var(--ac); stroke-width:2.2; }
.core-mark{ font-family:var(--font); font-weight:800; font-size:15px; fill:var(--ac-ink); }
.core-lbl{ font-family:var(--mono); font-size:9px; fill:var(--text-faint); letter-spacing:.04em; }
.orch-core.thinking .core-halo{ animation:corePulse 1.1s ease infinite; }
@keyframes corePulse{ 0%,100%{ opacity:.08; } 50%{ opacity:.24; } }
.node-ring{ fill:#fff; stroke:var(--hairline-2); stroke-width:1.4; transition:stroke .3s; }
.node-face{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
.node-face .btile{ width:30px; height:30px; box-shadow:inset 0 0 0 1px rgba(0,0,0,.06); }
.node-lbl{ font-family:var(--mono); font-size:9px; fill:var(--text-faint); }
.node-state{ opacity:0; transition:opacity .3s; }
.node-dot{ fill:var(--hairline-2); }
.orch-node{ cursor:pointer; }
.orch-node.is-reading .node-ring{ stroke:var(--ac); stroke-width:2.6; }
.orch-node.is-reading .node-dot{ fill:var(--ac); } .orch-node.is-reading .node-state{ opacity:1; }
.orch-node.is-writing .node-ring{ stroke:#B8791F; stroke-width:2.6; }
.orch-node.is-writing .node-dot{ fill:#B8791F; } .orch-node.is-writing .node-state{ opacity:1; }
.orch-node.is-done .node-ring{ stroke:var(--ac); stroke-width:1.8; }
.orch-node.is-done .node-dot{ fill:var(--ac); } .orch-node.is-done .node-state{ opacity:1; }
.orch-node.is-flag .node-ring{ stroke:var(--alert); stroke-width:2; stroke-dasharray:3 3; }
.orch-node.is-flag .node-dot{ fill:var(--alert); } .orch-node.is-flag .node-state{ opacity:1; }
.orch-svg.held .orch-node:not([data-sys="slack"]){ opacity:.5; transition:opacity .4s; }
.orch-svg.held .orch-node[data-sys="slack"] .node-ring{ stroke:#B8791F; stroke-width:2.4; animation:breathe 2s ease-in-out infinite; }
.orch-svg.paused .orch-node .node-ring{ animation-play-state:paused; }
@keyframes breathe{ 0%,100%{ stroke-opacity:1; } 50%{ stroke-opacity:.35; } }
.arc-lbl{ font-family:var(--mono); font-size:9px; fill:var(--text-faint); opacity:.45; letter-spacing:.12em; }
.human-node{ }
.human-av{ stroke:#fff; stroke-width:2; }
.human-init{ font-family:var(--mono); font-size:9px; font-weight:700; fill:#fff; }

/* --- impact band --- */
.band-div{ stroke:var(--hairline); stroke-width:1; }
.band-lbl{ font-family:var(--mono); font-size:9.5px; fill:var(--text-faint); letter-spacing:.12em; }
.tier-lbl{ font-family:var(--mono); font-size:8.5px; fill:var(--text-faint); letter-spacing:.06em; text-transform:uppercase; }
.imp .imp-box{ fill:#fff; stroke:var(--hairline-2); stroke-width:1.2; }
.imp-t{ font-family:var(--font); font-size:9.5px; fill:var(--text-dim); }
.imp-t.hd{ font-weight:650; fill:var(--text); font-size:10px; }
.imp.in-scope .imp-box{ stroke:var(--ac-bd); }
.imp.st-held .imp-box, .imp.st-frozen .imp-box{ fill:var(--ac-fill); stroke:var(--ac-bd); }
.imp.st-routed .imp-box{ fill:var(--ac-soft); stroke:var(--ac-bd); }
.imp.st-notified .imp-box{ fill:var(--ac-soft); stroke:var(--ac); }
.imp.ghost .imp-box{ fill:none; stroke:var(--alert); stroke-dasharray:4 3; }
.imp.ghost .imp-t{ fill:var(--alert); }
.imp.resolved .imp-box{ fill:var(--ac-fill); stroke:var(--ac); stroke-dasharray:none; }
.imp.resolved .imp-t{ fill:var(--text-dim); }
.imp.chosen .imp-box{ fill:var(--ac-soft); stroke:var(--ac); stroke-width:2.4; }
.imp.chosen .imp-t.hd{ fill:var(--ac-ink); }
.imp.muted{ opacity:.42; }
.imp-link.chosen{ stroke:var(--ac); stroke-width:2; opacity:1; stroke-dasharray:none; }
.imp-link{ fill:none; stroke:var(--hairline-2); stroke-width:1.2; }
.imp-link.flow{ stroke:var(--ac-bd); }
.imp-link.sibling{ stroke:var(--reason); stroke-dasharray:3 3; opacity:.7; }
.imp-link.export{ stroke:var(--toolc); stroke-dasharray:2 3; opacity:.7; }
.imp-link.ghost{ stroke:var(--alert); stroke-dasharray:4 3; opacity:.7; }
.imp-note{ font-family:var(--mono); font-size:9px; fill:var(--text-faint); }
.imp-stamp{ font-family:var(--mono); font-size:9px; fill:var(--ac-ink); font-weight:700; }
.cell{ fill:var(--surface-3); transition:fill .25s; }
.cell.crit{ fill:#fff; stroke:#B8791F; stroke-width:1.3; }
.cell.st-held, .cell.st-frozen{ fill:var(--ac-bd); }
.cell.st-routed{ fill:var(--ac-glow); }
.cell.st-notified{ fill:var(--ac); }
.cell.crit.st-notified{ fill:var(--ac); stroke:var(--ac-ink); }

/* --- trace: fill the narrower right column, JSON inspector --- */
.sim-stream .sev, .sim-stream .srz, .sim-stream .sim-summary{ max-width:none; }
.sev.flash .sev-body{ box-shadow:0 0 0 2px var(--ac-bd); }
.sev-io{ margin-top:11px; border:1px solid var(--hairline); border-radius:9px; overflow:hidden; background:var(--paper); }
.io-req{ display:flex; align-items:center; gap:8px; padding:8px 10px; }
.io-verb{ font-family:var(--mono); font-size:9px; font-weight:700; padding:2px 6px; border-radius:4px; flex:0 0 auto; }
.io-verb.get{ color:var(--toolc); background:rgba(59,120,176,.12); }
.io-verb.post{ color:#B8791F; background:rgba(184,121,31,.12); }
.io-path{ font-family:var(--mono); font-size:11px; color:var(--text-dim); word-break:break-all; }
.io-json{ margin:0; padding:9px 12px; font-family:var(--mono); font-size:10.5px; line-height:1.5; color:var(--text-dim); white-space:pre; overflow-x:auto; }
.io-json.req{ background:var(--surface-2); border-top:1px solid var(--hairline); border-bottom:1px solid var(--hairline); }
.io-resp.pending{ padding:9px 11px; border-top:1px solid var(--hairline); }
.io-status{ display:flex; align-items:center; gap:8px; font-family:var(--mono); font-size:10px; color:var(--text-faint); }
.spin-sm{ width:11px; height:11px; border-radius:50%; border:2px solid var(--hairline-2); border-top-color:var(--ac); animation:simSpin .8s linear infinite; display:inline-block; }
.io-rhead{ display:flex; align-items:center; gap:9px; padding:8px 11px; border-top:1px solid var(--hairline); }
.io-code{ font-family:var(--mono); font-size:10px; font-weight:700; padding:2px 7px; border-radius:4px; flex:0 0 auto; }
.io-code.ok{ color:var(--ac-ink); background:var(--ac-soft); }
.io-code.warn{ color:#B8791F; background:rgba(184,121,31,.12); }
.io-ms{ font-family:var(--mono); font-size:10px; color:var(--text-faint); }
.io-id{ margin-left:auto; font-family:var(--mono); font-size:9px; color:var(--text-faint); }
.j-key{ color:var(--toolc); } .j-str{ color:var(--ac-ink); } .j-num{ color:#B8791F; } .j-bool{ color:var(--reason); } .j-null{ color:var(--text-faint); }

@media (prefers-reduced-motion:reduce){
  #sim-stage .orch-edge.active, #sim-stage .spin-sm, #sim-stage .orch-core .core-halo, #sim-stage .orch-node .node-ring{ animation:none; }
}
@media (max-width:1120px){
  .sim-telem{ display:none; }
  .sim-main{ grid-template-columns:1fr; grid-template-rows:46vh 1fr; }
  .orch-stage{ border-right:0; border-bottom:1px solid var(--hairline); }
}

/* ==========================================================================
   SIMULATION · ENTERPRISE MINI-UI MOCK KIT (mocks.js)
   8 self-contained "what the agent just changed" screens. One frame + one
   component vocabulary; only --brand + chrome variant + wordmark chip differ.
   Change animations key off [data-phase="after"] on .mk (JS sets it when the
   stage plays). Evoke brands with colour + chrome, never logos.
   ========================================================================== */
.mk{
  --st-ok:#2E7D50; --st-ok-soft:#E7F1EA; --st-hold:#C0392B; --st-hold-soft:#FBE9E7;
  --st-warn:#C1843A; --st-warn-soft:#F7EEDF; --st-info:#3B78B0; --st-info-soft:#E7F0F7;
  --st-neutral:#86868B; --st-neutral-soft:#F2F2F5;
  --mk-slide:.42s; --mk-stagger:70ms; --mk-ease:cubic-bezier(.22,.61,.36,1); --mk-pop:cubic-bezier(.34,1.56,.64,1);
  --brand:#4D7C5E; --brand-ink:#34583F; --brand-soft:#E7F0EA; --shell:#354A5F;
  width:100%; max-width:392px; background:var(--paper); border:1px solid var(--hairline);
  border-radius:12px; box-shadow:var(--sh-card); overflow:hidden; font-family:var(--font);
  letter-spacing:-.01em; display:flex; flex-direction:column;
}
.sys-lims { --brand:#0E6E8C; --brand-ink:#0A4F66; --brand-soft:#E4F1F5; }
.sys-pasx { --brand:#0A2A6B; --brand-ink:#0A2A6B; --brand-soft:#E7EBF5; --shell:#0A2A6B; }
.sys-sap  { --brand:#0A6ED1; --brand-ink:#0A5AAE; --brand-soft:#E4F0FB; --shell:#354A5F; }
.sys-p44  { --brand:#00B383; --brand-ink:#00966E; --brand-soft:#0A1F2E; --shell:#0E1526; }
.sys-wms  { --brand:#C4123F; --brand-ink:#8E0F2E; --brand-soft:#FBE7EC; }
.sys-tms  { --brand:#8E0F53; --brand-ink:#6E0B40; --brand-soft:#F7E6F0; }
.sys-sfdc { --brand:#00A1E0; --brand-ink:#014486; --brand-soft:#E5F5FC; --shell:#16325C; }
.sys-veeva{ --brand:#E9541F; --brand-ink:#B23A12; --brand-soft:#FCEAE2; }

.mk-head{ flex:0 0 auto; height:40px; display:flex; align-items:center; gap:8px; padding:0 12px;
  background:linear-gradient(180deg,#FBFBFD,var(--surface-2)); border-top:3px solid var(--brand); }
.mk--darkhead .mk-head{ background:var(--shell); border-top:0; }
.mk-chip{ font-family:var(--mono); font-size:10px; font-weight:600; letter-spacing:.03em; color:#fff;
  background:var(--brand); padding:3px 8px; border-radius:5px; white-space:nowrap; }
.mk--darkhead .mk-chip{ background:rgba(255,255,255,.16); }
.mk-title{ font-size:12px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mk-title s{ color:var(--text-faint); text-decoration:none; font-weight:500; }
.mk--darkhead .mk-title{ color:#EAECF2; } .mk--darkhead .mk-title s{ color:#A9B2C4; }
.mk-tools{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.mk-tab{ font-family:var(--mono); font-size:9.5px; color:var(--text-dim); padding:2px 7px; border-radius:5px; background:var(--surface-2); border:1px solid var(--hairline); }
.mk--darkhead .mk-tab{ color:#D7DCE8; background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.14); }
.mk-tab.on{ color:var(--brand-ink); background:var(--brand-soft); border-color:transparent; }
.mk-av{ width:18px; height:18px; border-radius:50%; background:var(--brand-soft); color:var(--brand-ink);
  font-family:var(--mono); font-size:8px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.mk-body{ flex:1; padding:10px 12px; overflow:hidden; position:relative; font-size:11.5px; color:var(--text-dim); }
.mk--darkbody .mk-body{ background:var(--brand-soft); color:#CFE8DF; }
.mk-cap{ flex:0 0 auto; min-height:30px; background:var(--ac-soft); border-top:1px solid var(--ac-bd);
  color:var(--ac-ink); font-size:11px; line-height:1.35; padding:6px 12px; display:flex; align-items:center; gap:8px; }
.mk-cap::before{ content:""; width:7px; height:7px; border-radius:50%; background:var(--ac); flex:0 0 auto; }

/* components */
.mk-sub{ font-family:var(--mono); font-size:9.5px; color:var(--text-faint); margin-bottom:7px; }
.mk--darkbody .mk-sub{ color:#8FB6AA; }
.mk-pill{ display:inline-flex; align-items:center; gap:4px; font-family:var(--mono); font-size:9px; font-weight:600;
  letter-spacing:.03em; text-transform:uppercase; padding:3px 8px; border-radius:999px; border:1px solid; white-space:nowrap; }
.mk-pill.ok{ color:var(--st-ok); background:var(--st-ok-soft); border-color:#BFE0CB; }
.mk-pill.hold{ color:var(--st-hold); background:var(--st-hold-soft); border-color:#EEC4BE; }
.mk-pill.warn{ color:var(--st-warn); background:var(--st-warn-soft); border-color:#E4CDA0; }
.mk-pill.info{ color:var(--st-info); background:var(--st-info-soft); border-color:#C4D6E6; }
.mk-pill.neutral{ color:var(--st-neutral); background:var(--st-neutral-soft); border-color:var(--hairline); }
.mk-pill .dot{ width:6px; height:6px; border-radius:50%; background:currentColor; }
.mk-flip{ position:relative; display:inline-flex; }
.mk-flip .after{ position:absolute; left:0; top:0; opacity:0; }
.mk-row{ display:grid; align-items:center; gap:8px; padding:6px 4px; border-bottom:1px solid var(--hairline); border-left:3px solid transparent; }
.mk--darkbody .mk-row{ border-color:rgba(255,255,255,.08); }
.mk-row .num{ font-family:var(--mono); font-size:11px; font-variant-numeric:tabular-nums; text-align:right; color:var(--text); }
.mk--darkbody .mk-row .num{ color:#E7F6F0; }
.mk-row .lot{ font-family:var(--mono); font-size:10.5px; color:var(--text-dim); }
.mk-row.is-new{ opacity:0; }
.mk-badge{ display:inline-flex; align-items:center; gap:4px; font-family:var(--mono); font-size:10px; font-weight:600;
  padding:2px 8px; border-radius:999px; background:var(--brand-soft); color:var(--brand-ink); border:1px solid var(--brand); }
.mk--darkbody .mk-badge{ background:rgba(0,229,164,.12); border-color:rgba(0,229,164,.4); color:#00E0A4; }
.mk-badge .n{ font-variant-numeric:tabular-nums; }
.mk-badge.warn{ background:var(--st-warn-soft); color:var(--st-warn); border-color:#E4CDA0; }
.mk-rec{ display:flex; gap:10px; align-items:center; margin-bottom:8px; }
.mk-rec .obj{ width:30px; height:30px; border-radius:7px; background:var(--brand); color:#fff; display:grid; place-items:center; flex:0 0 auto; }
.mk-rec .meta b{ display:block; font-size:12.5px; color:var(--text); font-weight:650; }
.mk-rec .meta s{ display:block; font-family:var(--mono); font-size:9.5px; color:var(--text-faint); text-decoration:none; margin-top:1px; }
.mk-kv{ display:grid; grid-template-columns:104px 1fr; gap:3px 8px; font-size:10.5px; }
.mk-kv dt{ color:var(--text-faint); } .mk-kv dd{ margin:0; color:var(--text-dim); font-family:var(--mono); font-size:10px; }
.mk-flag{ display:inline-flex; align-items:center; gap:3px; font-family:var(--mono); font-size:8px; font-weight:700;
  letter-spacing:.05em; text-transform:uppercase; padding:2px 6px; border-radius:4px; color:var(--st-warn);
  background:var(--st-warn-soft); border:1px solid #E4CDA0; }
.mk-flag svg{ width:9px; height:9px; }
.mk-toggle{ width:34px; height:18px; border-radius:999px; background:var(--surface-3); position:relative; flex:0 0 auto; transition:background .3s var(--mk-ease); }
.mk--darkbody .mk-toggle{ background:rgba(255,255,255,.14); }
.mk-toggle .knob{ position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:transform .3s var(--mk-pop); }
.mk-lockicon{ display:inline-flex; opacity:0; color:var(--st-hold); }
.mk-more{ font-family:var(--mono); font-size:9.5px; color:var(--text-faint); padding:5px 4px; opacity:0; }
.mk-node{ display:inline-flex; flex-direction:column; align-items:center; gap:3px; }
.mk-nodebox{ border:1px solid var(--hairline-2); border-radius:7px; padding:5px 8px; background:var(--paper); font-family:var(--mono); font-size:10px; color:var(--text); white-space:nowrap; }
.mk--darkhead.sys-pasx .mk-nodebox{ background:#fff; }

/* animation recipes */
@media (prefers-reduced-motion:no-preference){
  [data-phase="after"] .mk-flash{ animation:mkFlash 1.2s var(--mk-ease); }
  [data-phase="after"] .mk-ring{ animation:mkRing .9s 2; }
  [data-phase="after"] .mk-flip .before{ animation:mkPillOut .28s forwards; }
  [data-phase="after"] .mk-flip .after{ animation:mkPillIn .3s .18s both var(--mk-pop); }
  [data-phase="after"] .mk-row.is-new{ animation:mkSlideIn var(--mk-slide) var(--mk-ease) both; animation-delay:calc(var(--i,0) * var(--mk-stagger)); }
  [data-phase="after"] .mk-more{ animation:mkFade .4s .5s forwards; }
  [data-phase="after"] .mk-lockicon{ animation:mkLockIn .3s calc(var(--i,0) * var(--mk-stagger) + .12s) both var(--mk-pop); }
  [data-phase="after"] .mk-badge.pop{ animation:mkPop .3s .9s var(--mk-pop); }
  [data-phase="after"] .mk-draw{ animation:mkDraw .5s var(--mk-ease) forwards; }
  [data-phase="after"] .mk-toggle.will-on{ background:var(--brand); }
  [data-phase="after"] .mk-toggle.will-on .knob{ transform:translateX(16px); }
}
[data-phase="after"] .mk-flip .before{ opacity:0; }
[data-phase="after"] .mk-flip .after{ opacity:1; position:relative; }
[data-phase="after"] .mk-row.is-new{ opacity:1; }
[data-phase="after"] .mk-more{ opacity:1; }
[data-phase="after"] .mk-lockicon{ opacity:1; }
[data-phase="after"] .mk-row.will-lock{ border-left-color:var(--st-hold); background:color-mix(in srgb,var(--st-hold-soft) 55%,transparent); }
[data-phase="after"] .mk-row.will-new{ border-left-color:var(--brand); }
[data-phase="after"] .mk-draw{ stroke-dashoffset:0; }
@keyframes mkFlash{ 0%{background:transparent} 14%{background:color-mix(in srgb,var(--brand) 18%,transparent)} 100%{background:transparent} }
@keyframes mkRing{ 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--brand) 40%,transparent)} 100%{box-shadow:0 0 0 7px transparent} }
@keyframes mkSlideIn{ from{opacity:0; transform:translateX(-10px)} to{opacity:1; transform:none} }
@keyframes mkPillOut{ to{opacity:0; transform:translateY(-4px)} }
@keyframes mkPillIn{ from{opacity:0; transform:translateY(4px) scale(.9)} to{opacity:1; transform:none} }
@keyframes mkPop{ 0%,100%{transform:scale(1)} 50%{transform:scale(1.16)} }
@keyframes mkLockIn{ from{opacity:0; transform:scale(.6) rotate(-12deg)} to{opacity:1; transform:none} }
@keyframes mkDraw{ to{stroke-dashoffset:0} }
@keyframes mkFade{ to{opacity:1} }

/* ==========================================================================
   SIMULATION · RIGHT PANE = collapsible per-stage "what happened" blocks
   ========================================================================== */
.sim-stream{ display:flex; flex-direction:column; gap:9px; }
.stage{ background:var(--paper); border:1px solid var(--hairline); border-radius:var(--r-card);
  box-shadow:var(--sh-card); overflow:hidden; transition:border-color .18s, box-shadow .18s;
  opacity:0; transform:translateY(8px); }
.stage.in{ opacity:1; transform:none; transition:opacity .4s ease, transform .4s cubic-bezier(.22,.7,.2,1); }
.stage-chip{ width:100%; display:grid; align-items:center; gap:10px;
  grid-template-columns:16px 26px auto 1fr auto 14px; padding:10px 13px; background:transparent; border:0; text-align:left; cursor:pointer; }
.chip-tick{ width:9px; height:9px; border-radius:50%; background:var(--hairline-2); }
.chip-ico .btile{ width:24px; height:24px; border-radius:7px; }
.chip-ico.mf{ width:24px; height:24px; border-radius:7px; display:inline-flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--ac),#7B5AC6); color:#fff; font-family:var(--mono); font-size:9px; font-weight:700; }
.chip-what{ font-size:12.5px; font-weight:650; color:var(--text); letter-spacing:-.01em; white-space:nowrap; }
.chip-delta{ font-family:var(--mono); font-size:10.5px; color:var(--text-dim); justify-self:end; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px; }
.chip-time{ font-family:var(--mono); font-size:10px; color:var(--text-faint); font-variant-numeric:tabular-nums; }
.chip-caret{ width:0; height:0; border-left:5px solid var(--text-faint); border-top:4px solid transparent; border-bottom:4px solid transparent; transition:transform .2s ease; }
.stage:not(.is-open){ background:var(--surface); }
.stage:not(.is-open) .chip-tick{ background:var(--ac); }
.stage:not(.is-open):hover{ border-color:var(--ac-bd); }
.stage.is-open{ border-color:var(--ac-bd); box-shadow:0 0 0 2px var(--ac-soft), var(--sh-card); border-left:3px solid var(--type-ac,var(--toolc)); }
.stage.is-open .chip-caret{ transform:rotate(90deg); }
.stage.is-open .chip-delta{ color:var(--ac-ink); }
.stage.is-live .chip-tick{ background:var(--type-ac,var(--gate)); animation:sevPulse 1.6s ease infinite; }
.stage[data-type="trigger"]{ --type-ac:var(--alert); }
.stage[data-type="reasoning"],.stage[data-type="decision"]{ --type-ac:var(--reason); }
.stage[data-type="tool"]{ --type-ac:var(--toolc); }
.stage[data-type="gate"]{ --type-ac:var(--gate); }
.stage[data-type="action"]{ --type-ac:var(--act); }
.stage[data-type="milestone"]{ --type-ac:var(--ac); }
.stage-body{ display:grid; grid-template-rows:0fr; transition:grid-template-rows .34s cubic-bezier(.22,.7,.2,1); }
.stage.is-open .stage-body{ grid-template-rows:1fr; }
.stage-inner{ overflow:hidden; min-height:0; padding:0 14px; opacity:0; transform:translateY(-4px); transition:opacity .2s ease .06s, transform .24s ease .06s; }
.stage.is-open .stage-inner{ opacity:1; transform:none; padding-bottom:15px; }
.stage:not(.is-open) .stage-body{ transition-duration:.26s; }
.stage-mock{ margin:12px 0 4px; display:flex; justify-content:center; }
.stage-mock:empty{ display:none; margin:0; }
.stage-mock.gate{ display:block; }
.stage-say{ font-size:13px; color:var(--text-dim); line-height:1.6; margin:12px 0 0; }
.stage-plan{ margin:10px 0 2px; padding-left:20px; display:grid; gap:3px; }
.stage-plan li{ font-size:12px; color:var(--text-dim); line-height:1.45; }
.stage-inner .sev-opts{ margin-top:12px; }
.stage-inner .sev-pills{ margin-top:12px; }
.stage-logs{ margin-top:13px; border-top:1px solid var(--hairline); }
.stage-logs summary{ list-style:none; cursor:pointer; display:flex; align-items:center; gap:9px; padding:9px 2px 4px; font-family:var(--mono); font-size:10px; letter-spacing:.04em; text-transform:uppercase; color:var(--text-faint); }
.stage-logs summary::-webkit-details-marker{ display:none; }
.stage-logs summary::before{ content:"›"; transition:transform .2s; display:inline-block; }
.stage-logs[open] summary::before{ transform:rotate(90deg); }
.lg-lead{ }
.lg-tag{ margin-left:auto; font-family:var(--mono); font-size:9px; padding:2px 7px; border-radius:4px; text-transform:none; letter-spacing:0; background:var(--surface-2); color:var(--text-faint); }
.lg-tag.ok{ color:var(--ac-ink); background:var(--ac-soft); } .lg-tag.warn{ color:#B8791F; background:rgba(184,121,31,.12); }
.lg-inner{ padding-bottom:6px; }
.lg-inner .sev-io{ margin-top:6px; }
.stage-mock .slack{ margin-top:0; }
@media (prefers-reduced-motion:reduce){
  .stage, .stage-inner{ transition:none; opacity:1; transform:none; }
  .stage-body{ transition:none; }
}
@media (max-width:640px){ .sim-stream{ padding:14px; } .stage-mock .mk, .stage-mock{ max-width:100%; } }

/* ==========================================================================
   SIMULATION · HORIZONTAL WORKFLOW graph (process ribbons + Milestone bar)
   ========================================================================== */
.orch-edge.active{ opacity:1; }
.orch-edge.used{ opacity:.5; stroke-dasharray:none; }
.g-flow .flow-ribbon{ fill:none; stroke:var(--hairline-2); stroke-width:6; stroke-linecap:round; opacity:.5; }
.g-flow .flow-ribbon.sec{ stroke-width:2.5; stroke-dasharray:3 5; opacity:.36; }
.flow-cap{ font-family:var(--mono); font-size:8.5px; letter-spacing:.1em; fill:var(--text-faint); opacity:.6; }
.bar-halo{ fill:var(--ac); opacity:.08; }
.bar-body{ fill:#fff; stroke:var(--ac); stroke-width:2; }
.bar-mf{ fill:#fff; stroke:var(--ac); stroke-width:2.2; }
.bar-lbl{ font-family:var(--font); font-weight:750; font-size:14px; fill:var(--ac-ink); letter-spacing:-.01em; }
.bar-sub{ font-family:var(--mono); font-size:8.5px; fill:var(--text-faint); letter-spacing:.04em; }
.orch-core.thinking .bar-halo{ animation:corePulse 1.1s ease infinite; }

/* ==========================================================================
   SIMULATION · 3-COLUMN layout  (col1 graph · col2 core trace · col3 system view)
   Undo accordion: core trace never collapses; the software UI + logs live in
   the collapsible right column.
   ========================================================================== */
.sim-stream{ display:block; }                 /* core trace = normal scroll (not the accordion flex) */

.sim-inspect{ display:flex; flex-direction:column; min-height:0; border-left:1px solid var(--hairline); background:var(--surface); }
.insp-bar{ flex:0 0 auto; display:flex; align-items:center; gap:10px; padding:11px 14px; border-bottom:1px solid var(--hairline); background:var(--paper); }
.insp-toggle{ width:26px; height:26px; border-radius:7px; border:1px solid var(--hairline-2); background:var(--surface); color:var(--text-dim); cursor:pointer; font-size:12px; flex:0 0 auto; }
.insp-toggle:hover{ color:var(--ac-ink); border-color:var(--ac-bd); }
.insp-head{ display:flex; flex-direction:column; min-width:0; }
.insp-lbl{ font-family:var(--mono); font-size:8.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-faint); }
.insp-sys{ font-size:12.5px; font-weight:650; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.insp-what{ flex:0 0 auto; padding:8px 15px; font-size:11.5px; color:var(--text-dim); border-bottom:1px solid var(--hairline); background:var(--paper); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.insp-what:empty{ display:none; }
.insp-body{ flex:1; min-height:0; overflow-y:auto; padding:16px 15px 40px; display:flex; flex-direction:column; gap:15px; }
.insp-mock{ display:flex; justify-content:center; }
.insp-empty{ font-family:var(--mono); font-size:10.5px; color:var(--text-faint); padding:22px 10px; text-align:center; border:1px dashed var(--hairline-2); border-radius:10px; width:100%; }
.insp-loglbl{ font-family:var(--mono); font-size:9px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-faint); margin-bottom:8px; }
.insp-logs .sev-io{ margin-top:0; }
.insp-reveal{ display:none; }
.insp-body::-webkit-scrollbar{ width:9px; } .insp-body::-webkit-scrollbar-thumb{ background:var(--hairline-2); border-radius:5px; border:2px solid var(--surface); }

/* collapsed sideways -> a thin vertical tab */
.sim-main.insp-collapsed{ grid-template-columns:minmax(300px,0.9fr) 1.5fr 38px; }
.sim-inspect.collapsed .insp-bar, .sim-inspect.collapsed .insp-what, .sim-inspect.collapsed .insp-body{ display:none; }
.sim-inspect.collapsed{ background:var(--paper); align-items:center; }
.sim-inspect.collapsed .insp-reveal{ display:flex; align-items:center; gap:6px; writing-mode:vertical-rl; transform:rotate(180deg); margin-top:16px; padding:12px 6px; border:0; background:transparent; color:var(--text-dim); font-family:var(--mono); font-size:10px; letter-spacing:.08em; text-transform:uppercase; cursor:pointer; }
.sim-inspect.collapsed .insp-reveal:hover{ color:var(--ac-ink); }

/* core "open screen" affordance */
.sev-open{ margin-top:11px; font-family:var(--mono); font-size:10.5px; font-weight:600; color:var(--ac-ink);
  background:var(--ac-fill); border:1px solid var(--ac-bd); border-radius:8px; padding:6px 11px; cursor:pointer; transition:background .15s; }
.sev-open:hover{ background:var(--ac-soft); }

@media (max-width:1120px){
  .sim-main{ grid-template-columns:1fr; grid-template-rows:40vh auto auto; }
  .sim-main.insp-collapsed{ grid-template-columns:1fr; }
  .orch-stage{ border-right:0; border-bottom:1px solid var(--hairline); }
  .sim-inspect{ border-left:0; border-top:1px solid var(--hairline); }
}

/* ==========================================================================
   SIMULATION · POLISH — bigger left-graph text/icons + refined buttons
   ========================================================================== */
/* -- left graph: bump fonts + node tiles so they fill the ~1/3 column -- */
.node-lbl{ font-size:13.5px; fill:var(--text-dim); font-weight:500; }
.node-face .btile{ width:100%; height:100%; border-radius:50%; box-shadow:none; }
.node-face .btile-mono{ font-size:16px; } .node-face .btile-wm{ font-size:15px; }
.node-face .btile svg{ width:66%; height:66%; }
.node-dot{ } .orch-node .node-state{ }
.core-mark{ font-size:20px; }
.bar-lbl{ font-size:18px; } .bar-sub{ font-size:11.5px; }
.flow-cap{ font-size:13px; opacity:.7; }
.band-lbl{ font-size:14px; }
.tier-lbl{ font-size:11.5px; }
.imp-t{ font-size:12.5px; } .imp-t.hd{ font-size:14px; }
.imp-note{ font-size:12.5px; } .imp-stamp{ font-size:12.5px; }
.orch-console{ height:74px; padding:9px 16px; }
.slog{ font-size:11px; line-height:1.85; }
.orch-legend{ font-size:11px; padding:10px 16px; }
.orch-legend .lg::before{ width:9px; height:9px; }
.pkt-halo{ opacity:.4; }

/* -- center: cleaner call line + "open view" button -- */
.sev-call{ padding:8px 11px; }
.sev-path{ font-family:var(--mono); font-size:11.5px; color:var(--text-dim); word-break:break-all; }
.sev-call .io-verb{ flex:0 0 auto; }
.sev-open{ display:inline-flex; align-items:center; gap:9px; margin-top:13px; padding:7px 13px 7px 8px; border-radius:10px;
  background:var(--paper); border:1px solid var(--hairline-2); color:var(--text); font-family:var(--font); font-size:12.5px; font-weight:600;
  cursor:pointer; transition:border-color .15s, background .15s, box-shadow .15s; box-shadow:var(--sh-card); }
.sev-open:hover{ border-color:var(--ac-bd); background:var(--ac-fill); box-shadow:var(--sh-lift); }
.sev-open .so-ic{ display:inline-flex; }
.sev-open .so-ic .btile{ width:22px; height:22px; border-radius:6px; box-shadow:inset 0 0 0 1px rgba(0,0,0,.06); }
.sev-open .so-tx{ letter-spacing:-.01em; }
.sev-open .so-ar{ color:var(--ac); transition:transform .15s; }
.sev-open:hover .so-ar{ transform:translateX(3px); }

/* -- right inspector: refined header + collapse controls -- */
.insp-bar{ padding:12px 15px; }
.insp-lbl{ display:inline-flex; align-items:center; font-size:9px; }
.insp-live{ width:7px; height:7px; border-radius:50%; background:var(--act); margin-right:6px; box-shadow:0 0 0 3px rgba(77,124,94,.14); animation:livePulse 1.8s ease infinite; }
@keyframes livePulse{ 0%,100%{ box-shadow:0 0 0 3px rgba(77,124,94,.14);} 50%{ box-shadow:0 0 0 5px rgba(77,124,94,.04);} }
.insp-sys{ font-size:13.5px; margin-top:1px; }
.insp-toggle{ width:30px; height:30px; border-radius:8px; border:1px solid var(--hairline-2); background:var(--surface); color:var(--text-dim);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; transition:.15s; margin-left:auto; }
.insp-toggle:hover{ color:var(--ac-ink); border-color:var(--ac-bd); background:var(--ac-fill); }
.insp-what{ font-size:12px; font-style:normal; color:var(--text-dim); padding:9px 15px; }
.insp-loglbl{ font-size:9.5px; }
.sim-inspect.collapsed .insp-reveal{ gap:8px; color:var(--text-dim); }
.sim-inspect.collapsed .insp-reveal svg{ transform:rotate(180deg); }
.sim-inspect.collapsed .insp-reveal span{ letter-spacing:.1em; }

/* ============================ ORG MEMORY (Milestone green — memory is Milestone's own software) ============================ */
/* trace cards (col 2) */
.sev.t-memory .sev-dot, .sev.t-learn .sev-dot{ background:var(--ac); box-shadow:0 0 0 3px rgba(77,124,94,.16); }
.sev.t-memory .sev-body, .sev.t-learn .sev-body{ border-color:var(--ac-bd); }
.sev.t-memory .sev-badge, .sev.t-learn .sev-badge{ background:var(--ac-soft); color:var(--ac-ink); }
.sev.t-memory .sev-agent, .sev.t-learn .sev-agent{ color:var(--ac-ink); }
.mem-hits{ display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.mem-hit{ display:flex; align-items:center; gap:9px; padding:7px 10px; border-radius:8px; background:var(--surface); border:1px solid var(--hairline); }
.mem-hit-b{ font-size:12px; font-weight:600; color:var(--text); }
.mem-hit-when{ font-family:var(--mono); font-size:9px; color:var(--text-faint); }
.mem-hit-sim{ margin-left:auto; font-family:var(--mono); font-size:11px; font-weight:700; color:var(--ac-ink); font-variant-numeric:tabular-nums; }
.mem-cline{ margin-top:9px; font-size:12px; color:var(--text-dim); }
.mem-cline b{ color:var(--ac-ink); font-variant-numeric:tabular-nums; }
.mem-belief-line{ margin-top:9px; font-size:12px; color:var(--text-dim); line-height:1.5; padding-left:11px; border-left:2px solid var(--ac-bd); }
.mem-belief-line i{ display:block; font-family:var(--mono); font-size:8.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-faint); font-style:normal; margin-bottom:2px; }
.mem-acl-line{ margin-top:8px; font-family:var(--mono); font-size:10px; color:var(--text-faint); }
.sev-open .mem-ic{ display:inline-flex; align-items:center; }
.sev-open .mem-ic img{ height:15px; width:auto; display:block; }

/* Memory Hub screen (mock frame .sys-memory) */
.mk.sys-memory .mk-head{ background:linear-gradient(135deg,var(--ac-ink),var(--ac)); color:#fff; }
.mk.sys-memory .mk-title{ color:#fff; }
.mem-brand{ display:inline-flex; align-items:center; }
.mem-brand .mem-logo{ height:16px; width:auto; display:block; }
.mem-gov{ font-family:var(--mono); font-size:8.5px; letter-spacing:.02em; color:#EAF3EC; background:rgba(255,255,255,.16); border-radius:5px; padding:3px 7px; }
.mem-aclbar{ display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:8px; background:var(--ac-fill); border:1px solid var(--ac-bd); margin-bottom:10px; }
.mem-aclbar .mem-lock{ width:14px; height:14px; color:var(--ac-ink); flex:0 0 auto; }
.mem-aclbar b{ font-size:11px; color:var(--text); }
.mem-aclbar .mem-sub{ margin-left:auto; font-family:var(--mono); font-size:8.5px; color:var(--text-faint); text-align:right; }
.mem-graph{ width:100%; height:auto; display:block; margin:2px 0 8px; }
.mem-edge{ stroke:var(--hairline-2); stroke-width:1.4; opacity:.5; transition:stroke .5s ease, opacity .5s ease; }
.mk[data-phase="after"] .mem-edge{ stroke:var(--ac); opacity:.85; }
.mem-n circle{ fill:var(--surface-2); stroke:var(--hairline-2); stroke-width:1.5; transition:fill .5s ease, stroke .5s ease; }
.mem-n text{ font-family:var(--mono); font-size:8px; fill:var(--text-faint); text-anchor:middle; }
.mem-n.cur circle{ fill:var(--ac); stroke:var(--ac); }
.mem-n.cur text{ fill:var(--text); font-weight:700; }
.mk[data-phase="after"] .mem-n.match circle{ fill:var(--ac-soft); stroke:var(--ac); }
.mk[data-phase="after"] .mem-n.match text{ fill:var(--ac-ink); }
.mem-n.new{ opacity:0; transition:opacity .5s ease .2s; }
.mem-n.new circle{ fill:var(--ac); stroke:var(--ac); }
.mem-n.new text{ fill:var(--text); font-weight:700; }
.mk[data-phase="after"] .mem-n.new{ opacity:1; }
.mem-conf{ display:flex; align-items:center; gap:9px; margin:2px 0 10px; }
.mem-conf-l{ font-family:var(--mono); font-size:9px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint); }
.mem-conf-bar{ position:relative; flex:1; height:7px; border-radius:4px; background:var(--surface-3); overflow:hidden; }
.mem-conf-from{ position:absolute; inset:0 auto 0 0; height:100%; background:var(--hairline-2); }
.mem-conf-fill{ position:absolute; inset:0 auto 0 0; height:100%; width:0; background:linear-gradient(90deg,var(--ac-glow),var(--ac)); transition:width .9s cubic-bezier(.22,.7,.2,1); }
.mk[data-phase="after"] .mem-conf-fill{ width:var(--w,90%); }
.mem-conf-v{ font-family:var(--mono); font-size:10px; font-weight:700; color:var(--ac-ink); font-variant-numeric:tabular-nums; white-space:nowrap; }
.mem-matchlist{ display:flex; flex-direction:column; gap:7px; }
.mem-match{ padding:8px 10px; border-radius:8px; background:var(--surface); border:1px solid var(--hairline); opacity:0; transform:translateY(6px); transition:.4s cubic-bezier(.22,.7,.2,1); transition-delay:calc(var(--i,0)*.12s); }
.mk[data-phase="after"] .mem-match{ opacity:1; transform:none; }
.mem-match-h{ display:flex; align-items:center; gap:8px; }
.mem-match-h b{ font-size:11.5px; color:var(--text); }
.mem-sim{ margin-left:auto; font-family:var(--mono); font-size:10.5px; font-weight:700; color:var(--ac-ink); }
.mem-when{ font-size:10px; color:var(--text-faint); margin-top:2px; line-height:1.4; }
.mem-chips{ display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.mem-chip{ font-family:var(--mono); font-size:8px; color:var(--text-dim); background:var(--surface-2); border:1px solid var(--hairline); border-radius:4px; padding:1px 5px; }
.mem-belief{ position:relative; margin-top:2px; font-size:11.5px; line-height:1.45; color:var(--text); padding:9px 10px; border-radius:8px; background:var(--ac-fill); border:1px solid var(--ac-bd); }
.mem-newbadge{ font-family:var(--mono); font-size:7.5px; font-weight:700; letter-spacing:.08em; color:#fff; background:var(--ac); border-radius:4px; padding:1px 5px; margin-right:6px; vertical-align:middle; }
.mem-ents{ display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.mem-ent{ font-family:var(--mono); font-size:8.5px; color:var(--text-dim); background:var(--surface); border:1px solid var(--hairline); border-radius:5px; padding:2px 7px; }
.mem-stamp{ margin-top:9px; font-family:var(--mono); font-size:9px; color:var(--text-faint); }

/* Confirm popup (human-in-the-loop write) */
.sim-confirm{ position:absolute; inset:0; z-index:40; display:flex; align-items:center; justify-content:center; padding:24px;
  background:rgba(20,28,22,.30); opacity:0; transition:opacity .3s ease; }
.sim-confirm.in{ opacity:1; }
.sconf-card{ width:min(440px,92%); background:var(--paper); border:1px solid var(--ac-bd); border-radius:16px; padding:20px 22px;
  box-shadow:0 24px 60px rgba(20,28,22,.28); transform:translateY(10px) scale(.98); transition:transform .3s cubic-bezier(.22,.7,.2,1); }
.sim-confirm.in .sconf-card{ transform:none; }
.sconf-h{ display:flex; align-items:center; gap:10px; font-size:15px; font-weight:650; color:var(--text); margin-bottom:12px; }
.sconf-mark{ width:32px; height:32px; border-radius:9px; display:grid; place-items:center; background:linear-gradient(135deg,var(--ac-ink),var(--ac)); flex:0 0 auto; overflow:hidden; }
.sconf-mark img{ width:22px; height:22px; object-fit:contain; }
.sconf-belief{ font-size:13px; line-height:1.55; color:var(--text-dim); padding:11px 13px; border-radius:10px; background:var(--ac-fill); border:1px solid var(--ac-bd); }
.sconf-meta{ display:flex; flex-wrap:wrap; gap:6px; margin-top:11px; }
.sconf-meta span{ font-family:var(--mono); font-size:9px; color:var(--text-dim); background:var(--surface-2); border:1px solid var(--hairline); border-radius:5px; padding:3px 8px; }
.sconf-meta .sconf-resid{ color:var(--ac-ink); border-color:var(--ac-bd); background:var(--ac-fill); }
.sconf-ask{ display:flex; align-items:center; gap:8px; margin-top:12px; font-size:11px; color:var(--text-faint); }
.sconf-ask .spin{ border-color:rgba(77,124,94,.25); border-top-color:var(--ac); }
.sconf-btns{ display:flex; gap:9px; margin-top:16px; }
.sconf-store{ flex:1; padding:10px; border-radius:10px; border:1px solid transparent; background:var(--ac); color:#fff; font-size:12.5px; font-weight:650; cursor:pointer; transition:.15s; }
.sconf-store:hover{ filter:brightness(1.07); }
.sconf-skip{ padding:10px 16px; border-radius:10px; border:1px solid var(--hairline-2); background:var(--paper); color:var(--text-dim); font-size:12.5px; cursor:pointer; transition:.15s; }
.sconf-skip:hover{ background:var(--surface-2); }

/* left column: Milestone Memory analytics panel */
.orch-mem{ flex:0 0 auto; border-top:1px solid var(--hairline); background:var(--paper); padding:10px 14px; }
.orch-mem-h{ display:flex; align-items:center; gap:8px; margin-bottom:9px; }
.orch-mem-logo{ height:15px; width:auto; display:block; }
.orch-mem-t{ font-size:11px; font-weight:700; letter-spacing:-.01em; color:var(--ac-ink); }
.orch-mem-live{ margin-left:auto; display:inline-flex; align-items:center; gap:5px; font-family:var(--mono); font-size:8.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--text-faint); }
.orch-mem-live .d{ width:6px; height:6px; border-radius:50%; background:var(--hairline-2); transition:.3s; }
.orch-mem.active .orch-mem-live .d{ background:var(--ac); box-shadow:0 0 0 3px rgba(77,124,94,.16); }
.orch-mem-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.oms{ background:var(--surface); border:1px solid var(--hairline); border-radius:8px; padding:7px 6px; text-align:center; transition:border-color .3s; }
.orch-mem.active .oms{ border-color:var(--ac-bd); }
.oms b{ display:block; font-size:15px; font-weight:750; color:var(--ac-ink); font-variant-numeric:tabular-nums; line-height:1.1; }
.oms i{ display:block; font-size:8px; color:var(--text-faint); font-style:normal; letter-spacing:.02em; margin-top:2px; }
.orch-mem-log{ margin-top:8px; font-family:var(--mono); font-size:9px; color:var(--text-faint); transition:color .3s; }
.orch-mem.active .orch-mem-log{ color:var(--ac-ink); }

/* left graph column: collapsible (mirror of the right inspector) */
.orch-toggle{ position:absolute; top:10px; left:10px; z-index:6; width:26px; height:26px; border-radius:7px;
  border:1px solid var(--hairline-2); background:var(--surface); color:var(--text-dim); cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:.15s; }
.orch-toggle svg{ transform:rotate(180deg); }
.orch-toggle:hover{ color:var(--ac-ink); border-color:var(--ac-bd); background:var(--ac-fill); }
.orch-reveal{ display:none; }
.orch-stage.collapsed{ align-items:center; overflow:hidden; }
.orch-stage.collapsed > .orch-svg, .orch-stage.collapsed > .orch-mem, .orch-stage.collapsed > .orch-console, .orch-stage.collapsed > .orch-legend, .orch-stage.collapsed > .orch-toggle{ display:none; }
.orch-stage.collapsed .orch-reveal{ display:flex; align-items:center; gap:8px; writing-mode:vertical-rl; transform:rotate(180deg);
  margin-top:16px; padding:12px 6px; border:0; background:transparent; color:var(--text-dim);
  font-family:var(--mono); font-size:10px; letter-spacing:.1em; text-transform:uppercase; cursor:pointer; }
.orch-stage.collapsed .orch-reveal:hover{ color:var(--ac-ink); }
.sim-main.orch-collapsed{ grid-template-columns:38px 1fr 1fr; }
.sim-main.orch-collapsed.insp-collapsed{ grid-template-columns:38px 1fr 38px; }

/* clearer split: two outlined blocks (no background fill) */
.band-block{ fill:none; stroke:var(--hairline-2); stroke-width:3; }
.band-lbl{ font-weight:600; }

@media (max-width:1120px){ .sim-main.orch-collapsed{ grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce){ .sim-confirm, .sconf-card, .mem-edge, .mem-n, .mem-conf-fill, .mem-match{ transition:none; } }

/* ==========================================================================
   Simulation · real-world wall clock (bottom-right HUD)
   Advances near-real-time during agent work, FAST-FORWARDS through the hours/
   days a human gate takes (digits race + amber glow via .ff). Driven by sim.js
   tweenWall(); pointer-events:none so it never blocks the graph/inspector.
   ========================================================================== */
.sim-shell{ position:relative; }
.sim-wallclock{
  position:absolute; right:16px; bottom:14px; z-index:40;
  display:flex; flex-direction:column; align-items:flex-end; gap:1px;
  padding:9px 13px 8px; border-radius:13px;
  background:rgba(13,19,31,.92); color:#EAF2FF;
  box-shadow:0 10px 30px rgba(0,0,0,.34); border:1px solid rgba(255,255,255,.06);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  font-family:var(--mono); pointer-events:none; min-width:138px;
}
.sim-wallclock .wc-top{ display:flex; align-items:center; gap:10px; width:100%; justify-content:space-between; }
.sim-wallclock .wc-day{ font-size:9.5px; letter-spacing:.13em; text-transform:uppercase; color:#7FD1A8; font-weight:600; }
.sim-wallclock .wc-ff{ font-size:8.5px; letter-spacing:.08em; text-transform:uppercase; color:#FFB24D; opacity:0; transform:translateX(4px); transition:opacity .18s, transform .18s; }
.sim-wallclock.ff .wc-ff{ opacity:1; transform:none; animation:wc-ffpulse .7s ease-in-out infinite; }
.sim-wallclock .wc-date{ font-size:10.5px; color:#9DB2CE; margin-top:3px; }
.sim-wallclock .wc-time{ font-size:24px; font-weight:600; letter-spacing:.03em; font-variant-numeric:tabular-nums; line-height:1.04; margin-top:1px; transition:color .2s, text-shadow .2s; }
.sim-wallclock.ff .wc-time{ color:#FFCF8A; text-shadow:0 0 15px rgba(255,178,77,.5); }
.sim-wallclock .wc-lbl{ font-size:8px; letter-spacing:.07em; text-transform:uppercase; color:#63748F; margin-top:4px; }
@keyframes wc-ffpulse{ 0%,100%{opacity:.55} 50%{opacity:1} }
@media (prefers-reduced-motion:reduce){ .sim-wallclock.ff .wc-ff{ animation:none } }

/* ==========================================================================
   Simulation · pre-step "working" spinner + status line (in the agent trace)
   Shows for ~0.6-0.9s before each step's card lands; label comes from sim.js
   thinkLabel() (analyzing / querying SAP / calling the contracts expert agent…).
   ========================================================================== */
.sim-think{ display:flex; align-items:center; gap:9px; padding:3px 0 3px 3px; margin:1px 0;
  opacity:0; transform:translateY(3px); transition:opacity .22s ease, transform .22s ease; }
.sim-think.in{ opacity:1; transform:none; }
.sim-think .think-ic{ flex:0 0 auto; width:15px; height:15px; display:grid; place-items:center; }
.sim-think .think-spin{ width:12px; height:12px; border-radius:50%;
  border:2px solid var(--hairline-2,#d7dce3); border-top-color:var(--ac,#4D7C5E);
  animation:think-rot .68s linear infinite; }
.sim-think .think-say{ font-size:12px; font-style:italic; letter-spacing:.01em; color:var(--text-faint,#8a94a3); }
@keyframes think-rot{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){ .sim-think{ display:none; } }

/* persisted "working" line: spinner -> static check breadcrumb (stays in the trace) */
.sim-think .think-check{ display:none; color:var(--ac,#4D7C5E); font-size:12px; font-weight:700; line-height:1; }
.sim-think.done .think-spin{ display:none; }
.sim-think.done .think-check{ display:inline-block; }
.sim-think.done{ opacity:.5; }
.sim-think.done .think-say{ font-style:normal; }

/* ============================================================ *
   PRIORITY · Decision map — 2-D semantic dot graph (tabbed)
 * ============================================================ */
/* collapsible landscape */
.pri-collapse{ margin-top:16px }
.pri-collapse-head{ width:100%; display:flex; align-items:center; gap:13px; text-align:left; cursor:pointer;
  background:linear-gradient(180deg,var(--paper),var(--surface)); border:1px solid var(--hairline);
  border-radius:14px; padding:13px 16px; transition:border-color .15s, box-shadow .15s }
.pri-collapse-head:hover{ border-color:var(--brand); box-shadow:0 8px 22px -14px rgba(20,30,40,.28) }
.pri-collapse-head.open{ border-radius:14px 14px 0 0; box-shadow:none }
.pch-chev{ color:var(--brand); font-size:13px; transition:transform .2s ease; flex:0 0 auto; line-height:1 }
.pri-collapse-head.open .pch-chev{ transform:rotate(90deg) }
.pch-main{ display:flex; flex-direction:column; gap:3px; flex:1; min-width:0 }
.pch-title{ font-weight:700; font-size:16px; letter-spacing:-.01em; color:var(--text); margin-bottom:1px }
.pch-sub{ font-size:12.5px; line-height:1.5; color:var(--text-dim) }
.pch-sub b{ color:var(--text); font-weight:650 }
.pch-pri .pri-k{ display:inline-block; font-weight:700; color:var(--brand); letter-spacing:.02em; margin-right:2px }
.pch-pri{ color:var(--text) }
.pch-dim{ color:var(--text-faint); font-size:12px }
.pch-toggle{ font-size:11px; font-weight:700; color:var(--brand); text-transform:uppercase;
  letter-spacing:.08em; flex:0 0 auto; padding:5px 10px; border:1px solid var(--hairline); border-radius:8px }
.pri-collapse-head:hover .pch-toggle{ border-color:var(--brand) }
.pri-collapse-body{ border:1px solid var(--hairline); border-top:0; border-radius:0 0 14px 14px;
  padding:4px 14px 14px; background:var(--surface) }
.pri-collapse-body[hidden]{ display:none }
.pri-viz{ margin-top:10px }
.pri-viztabs{ display:flex; align-items:center; gap:2px; border-bottom:1px solid var(--hairline); margin-bottom:12px }
.pri-viztabs .pvt{ min-width:154px; text-align:center; padding:10px 16px; border:0; background:transparent;
  color:var(--text-dim); font:600 13.5px/1 inherit; cursor:pointer; position:relative; transition:color .15s }
.pri-viztabs .pvt:hover{ color:var(--brand-ink) }
.pri-viztabs .pvt.on{ color:var(--brand-ink); font-weight:700 }
.pri-viztabs .pvt.on::after{ content:""; position:absolute; left:12px; right:12px; bottom:-1px; height:3px;
  background:var(--brand); border-radius:3px 3px 0 0 }
.pri-viztabs .pvt-hint{ flex:1; text-align:right; color:var(--text-faint); font-size:12px; padding-right:2px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.pri-vizpane[hidden]{ display:none }
.pri-semmap{ --sem-field:#9AA2AE; max-width:760px; margin:6px auto 0; padding:18px 14px 10px;
  border:1px solid var(--hairline); border-radius:18px;
  background:radial-gradient(120% 90% at 50% 8%, var(--paper) 0%, var(--surface) 62%, var(--surface-2,#F2F2F5) 100%);
  box-shadow:0 1px 2px rgba(20,30,40,.04), 0 14px 34px -18px rgba(20,30,40,.16); overflow:hidden }
.pri-semmap svg{ width:100%; height:auto; display:block; overflow:visible }
.semarea{ fill:none; stroke-opacity:.75; stroke-width:.05; stroke-linejoin:round; stroke-linecap:round }
.semarea.pri{ stroke-opacity:1; stroke-width:.08 }
.semlabel{ text-anchor:middle; font-weight:700; letter-spacing:.1em; opacity:.7;
  paint-order:stroke; stroke:var(--paper); stroke-width:.13 }
.semlabel.pri{ opacity:.95 }
.sdot{ cursor:pointer; transition:transform .12s ease, filter .12s; transform-box:fill-box; transform-origin:center }
.sdot.core{ stroke:var(--paper); stroke-width:.09 }
.sdot:hover{ transform:scale(1.45); filter:brightness(1.05) }
.score-ring{ fill:none; stroke:#4D7C5E; stroke-width:.06; opacity:.9 }
.pri-semlegend{ display:flex; gap:16px; flex-wrap:wrap; justify-content:center; margin-top:10px;
  color:var(--text-dim); font-size:12px }
.pri-semlegend .li{ display:inline-flex; align-items:center; gap:6px }
.pri-semlegend .li.muted{ color:var(--text-faint) }
.pri-semlegend .sdot{ width:9px; height:9px; border-radius:50%; background:var(--sem-field); display:inline-block }
.pri-semlegend .sdot.core{ background:var(--brand); box-shadow:0 0 0 2px rgba(77,124,94,.28) }
.semtip{ position:fixed; z-index:120; pointer-events:none; max-width:250px; background:#141C25; color:#fff;
  border-radius:10px; padding:9px 11px; font-size:12.5px; line-height:1.4; opacity:0; transform:translateY(3px);
  transition:opacity .12s, transform .12s; box-shadow:0 10px 30px rgba(0,0,0,.28) }
.semtip.on{ opacity:1; transform:none }
.semtip .tt-t{ font-weight:700; margin-bottom:2px }
.semtip .tt-m{ color:#9FB0C0; font-size:11px }
.semtip .tt-d{ margin-top:5px }
