/* ═══ Mimesis — the governed instrument ══════════════════════════════════════
   Not a chat widget: a governed console. Reference craft — Linear's restraint,
   Raycast's polish, a high-end terminal's soul. Boldness is spent in ONE place:
   cyan is reserved for the GOVERNED LAYER (live routing, the gate, focus) — never
   sprayed on every surface. Display face for identity, mono for the machine
   readouts, Inter for prose. WCAG 2.2 AA held against the surfaces below. */

:root {
  color-scheme:dark;   /* default (graphite + all dark schemes); Daybreak overrides to light */
  /* neutral ramp — cool graphite with a navy breath (layered, never one flat fill) */
  --bg-canvas:#070a12; --surface:#0e1322; --surface-raised:#141b2e; --surface-active:#1b2440;
  --surface-hair:rgba(255,255,255,.05);
  /* text */
  --text:#f2f5fe; --text-secondary:#b9c2db; --text-muted:#818da9; --text-faint:#5c6a86;
  /* borders */
  --border:#1f2840; --border-strong:#2d3858; --border-light:#161d30;
  /* accent — the ONE bold color: the governed soul + live routing */
  --accent:#35d6ff; --accent-dim:#1fb8e6; --accent-press:#13a6d6;
  --accent-subtle:rgba(53,214,255,.10); --accent-line:rgba(53,214,255,.30); --accent-text:#93e6ff;
  --accent-glow:0 0 0 1px rgba(53,214,255,.35), 0 12px 32px -12px rgba(53,214,255,.5);
  /* intent */
  --amber:#f5b942; --amber-subtle:rgba(245,185,66,.12); --amber-text:#f6c96f; --amber-line:rgba(245,185,66,.38);
  --green:#3fd496; --green-text:#74e9af; --red:#ff7a7a; --red-text:#ff9b9b; --red-subtle:rgba(255,122,122,.12);
  /* type */
  --font-display:'Space Grotesk','Inter',system-ui,sans-serif;
  --font-body:'Inter',system-ui,-apple-system,sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  /* geometry + elevation */
  --radius:14px; --radius-sm:10px; --radius-xs:7px;
  --elev-1:inset 0 1px 0 var(--surface-hair), 0 2px 8px -3px rgba(0,0,0,.55);
  --elev-2:inset 0 1px 0 var(--surface-hair), 0 16px 40px -16px rgba(0,0,0,.72);
}

/* ══ THEME LAYER ══════════════════════════════════════════════════════════════
   Operator-selectable schemes. Each reassigns the NEUTRAL token values (surfaces,
   text, borders, elevation, ambient) — components never change. The governed accent
   (cyan) is the ONE constant across every scheme: governance must stay recognizable
   whichever face is on. Light mode re-tunes accent-TEXT + intents + elevations to
   hold the WCAG 2.2 AA contrast floor (design-baseline §3). Default (graphite) lives
   in :root above, so no override is needed for it. */

/* Obsidian — true-black OLED. Same cool identity, maximum depth. */
[data-theme="obsidian"] {
  --bg-canvas:#000000; --surface:#070a10; --surface-raised:#0d1017; --surface-active:#171b24;
  --surface-hair:rgba(255,255,255,.06);
  --text:#f4f6fb; --text-secondary:#b4bccd; --text-muted:#7c8699; --text-faint:#565f70;
  --border:#1b1f28; --border-strong:#2a2f3a; --border-light:#111419;
  --elev-1:inset 0 1px 0 var(--surface-hair), 0 2px 10px -3px rgba(0,0,0,.8);
  --elev-2:inset 0 1px 0 var(--surface-hair), 0 18px 46px -16px rgba(0,0,0,.9);
}
[data-theme="obsidian"] body::before {
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(53,214,255,.06), transparent 60%),
    radial-gradient(760px 620px at 90% 112%, rgba(53,214,255,.03), transparent 54%); }

/* Umber — warm-neutral dark. Cyan governance pops against warm ground. */
[data-theme="umber"] {
  --bg-canvas:#100c09; --surface:#1a1511; --surface-raised:#231c16; --surface-active:#2e251d;
  --surface-hair:rgba(255,244,232,.05);
  --text:#f8f3ed; --text-secondary:#d8cabb; --text-muted:#a08f7e; --text-faint:#726356;
  --border:#2f261e; --border-strong:#41352a; --border-light:#221b14;
  --elev-1:inset 0 1px 0 var(--surface-hair), 0 2px 8px -3px rgba(0,0,0,.6);
  --elev-2:inset 0 1px 0 var(--surface-hair), 0 16px 40px -16px rgba(0,0,0,.72);
}
[data-theme="umber"] body::before {
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(245,185,66,.06), transparent 60%),
    radial-gradient(760px 620px at 90% 112%, rgba(53,214,255,.03), transparent 56%); }

/* Daybreak — light. Neutrals invert; accent FILL stays cyan (dark text on it), but
   accent-TEXT, intents, and elevations re-tune for contrast on a light ground. */
[data-theme="daybreak"] {
  color-scheme:light;
  --bg-canvas:#f3f6fb; --surface:#ffffff; --surface-raised:#ffffff; --surface-active:#eef1f8;
  --surface-hair:rgba(16,22,40,.04);
  --text:#101726; --text-secondary:#3b4458; --text-muted:#5d6678; --text-faint:#8a92a4;
  --border:#dce1ec; --border-strong:#c4cbd9; --border-light:#e9edf4;
  --accent-text:#0b6e8c; --accent-line:rgba(11,110,140,.32); --accent-subtle:rgba(53,214,255,.14);
  --accent-glow:0 0 0 1px rgba(53,214,255,.45), 0 8px 24px -10px rgba(53,214,255,.4);
  --amber-text:#8a5d00; --amber-line:rgba(138,93,0,.4); --amber-subtle:rgba(245,185,66,.16);
  --green-text:#0d7a4a; --red-text:#c0392b; --red-subtle:rgba(192,57,43,.1);
  --elev-1:0 1px 2px rgba(16,22,40,.06), 0 1px 3px rgba(16,22,40,.05);
  --elev-2:0 10px 30px -10px rgba(16,22,40,.2), 0 2px 6px rgba(16,22,40,.08);
}
[data-theme="daybreak"] body::before {
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(53,214,255,.06), transparent 64%),
    radial-gradient(760px 620px at 90% 112%, rgba(53,214,255,.03), transparent 58%); }

/* the instrument is "on" — a subtle live glow, never flat */
body::before { content:''; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(53,214,255,.07), transparent 62%),
    radial-gradient(760px 620px at 90% 112%, rgba(53,214,255,.035), transparent 56%); }

/* ══ the application shell: persistent left rail + main surface ══ */
.mim-shell { display:grid; grid-template-columns:244px 1fr auto; height:100vh; }
.mim-sidebar { display:flex; flex-direction:column; gap:4px; padding:18px 14px; border-right:1px solid var(--border-light);
  background:linear-gradient(180deg, rgba(20,27,46,.5), rgba(10,15,26,.2)); min-width:0; }
.mim-brand { display:flex; align-items:center; gap:11px; padding:6px 8px 16px; text-decoration:none; min-width:0; }
.mim-mark { flex:0 0 auto; width:34px; height:34px; border-radius:10px; background:#eef2ff; display:grid; place-items:center;
  box-shadow:var(--elev-1), 0 0 0 1px rgba(255,255,255,.06); overflow:hidden; }
.mim-mark img { display:block; width:30px; height:30px; object-fit:contain; }
.mim-wordmark { font-family:var(--font-display); font-size:22px; font-weight:600; letter-spacing:-.015em; color:var(--text); line-height:1; }

/* nav */
.mim-nav { display:flex; flex-direction:column; gap:2px; }
.mim-nav-item { display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:10px; color:var(--text-muted);
  text-decoration:none; font-size:14.5px; font-weight:500; letter-spacing:-.005em; transition:background .14s, color .14s; position:relative; }
.mim-nav-item .mim-ni { flex:0 0 auto; color:var(--text-muted); transition:color .14s; }
.mim-nav-item:hover { background:var(--surface-raised); color:var(--text-secondary); }
.mim-nav-item:hover .mim-ni { color:var(--text-secondary); }
.mim-nav-item[aria-current="page"] { background:var(--surface-active); color:var(--text); }
.mim-nav-item[aria-current="page"] .mim-ni { color:var(--accent); }
.mim-nav-item[aria-current="page"]::before { content:''; position:absolute; left:-14px; top:9px; bottom:9px; width:3px; border-radius:0 3px 3px 0; background:var(--accent); box-shadow:0 0 10px var(--accent); }
.mim-nav-badge { margin-left:auto; min-width:19px; height:19px; padding:0 5px; border-radius:10px; background:var(--amber); color:#1a1205;
  font-family:var(--font-mono); font-size:11px; font-weight:600; display:grid; place-items:center; box-shadow:0 0 10px var(--amber-line); }
.mim-nav-badge[hidden] { display:none; }   /* the attribute must beat display:grid — else an empty amber dot shows at 0 pending (same gotcha as .mim-danger-zone[hidden]) */

/* sidebar footer: the governed rail — always on, every view */
.mim-side-foot { margin-top:auto; padding:14px 10px 4px; border-top:1px solid var(--border-light); }
.mim-rail { display:flex; flex-direction:column; align-items:flex-start; gap:7px; font-family:var(--font-mono); font-size:11px; letter-spacing:.01em; color:var(--text-muted); }
.mim-rail-item { display:flex; align-items:center; gap:6px; }
.mim-rail-dot { width:6px; height:6px; border-radius:50%; background:var(--green); box-shadow:0 0 9px var(--green); flex:0 0 auto; }
.mim-rail-via { color:var(--accent-text); }
.mim-rail-via b { font-weight:500; }

/* main surface */
.mim-main { overflow-y:auto; display:flex; flex-direction:column; scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
.mim-main::-webkit-scrollbar{ width:10px; } .mim-main::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:9px; border:3px solid transparent; background-clip:content-box; }
.mim-view { max-width:860px; width:100%; margin:0 auto; padding:40px 40px 64px; }

@media (max-width:820px){
  .mim-shell { grid-template-columns:68px 1fr auto; }
  .mim-brand .mim-wordmark, .mim-nav-item span:not(.mim-nav-badge), .mim-rail-via { display:none; }
  .mim-nav-item { justify-content:center; padding:11px 0; }
  .mim-view, .mim-chatview { padding-left:20px; padding-right:20px; }
}

/* ── shared view primitives ── */
.mim-page-head { margin:0 0 24px; }
.mim-page-head-row { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.mim-eyebrow { font-family:var(--font-mono); font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--accent-text); opacity:.8; margin:0 0 10px; }
.mim-page-h { font-family:var(--font-display); font-size:clamp(26px,3.4vw,33px); font-weight:600; letter-spacing:-.02em; color:var(--text); margin:0; line-height:1.1; }
.mim-page-sub { color:var(--text-secondary); font-size:15px; line-height:1.55; margin:11px 0 0; max-width:58ch; }
.mim-section-h { font-family:var(--font-display); font-size:14px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:var(--text-muted); margin:30px 0 13px; }
.mim-card { background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--elev-1); }
.mim-empty { text-align:center; padding:48px 24px; border:1px dashed var(--border-strong); border-radius:var(--radius); background:rgba(14,19,34,.4); }
.mim-empty-l { font-family:var(--font-display); font-size:16.5px; color:var(--text); margin:0 0 6px; }
.mim-empty-h { color:var(--text-muted); font-size:14px; line-height:1.55; margin:0 auto; max-width:46ch; }
.mim-loading { display:flex; align-items:center; gap:10px; color:var(--text-muted); font-size:14px; padding:26px 2px; }
.mim-spin { width:15px; height:15px; border-radius:50%; border:2px solid var(--border-strong); border-top-color:var(--accent); animation:mim-spin .8s linear infinite; }
@keyframes mim-spin { to { transform:rotate(360deg); } }
.mim-stamp { font-family:var(--font-mono); font-size:11px; color:var(--text-faint); margin:18px 0 0; }

/* buttons */
.mim-btn { min-height:40px; padding:0 16px; border-radius:11px; border:1px solid var(--border-strong); background:var(--surface-active);
  color:var(--text); font:inherit; font-weight:500; font-size:14px; cursor:pointer; transition:transform .14s, border-color .14s, box-shadow .14s, background .14s; white-space:nowrap; }
.mim-btn:hover { transform:translateY(-1px); }
.mim-btn:disabled { opacity:.55; cursor:default; transform:none; }
.mim-btn-primary { background:linear-gradient(160deg,var(--accent),var(--accent-press)); color:#06131b; border-color:var(--accent-dim); font-weight:600; }
.mim-btn-primary:hover { box-shadow:var(--accent-glow); }
.mim-btn-ghost { background:transparent; }
.mim-btn-ghost:hover { border-color:var(--accent-line); color:var(--accent-text); }
.mim-btn-danger { background:var(--red-subtle); border-color:var(--red-text); color:var(--red-text); }
.mim-btn-danger:hover { background:rgba(255,122,122,.18); }

/* stat row (home + report) */
.mim-stat-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin:0 0 8px; }
.mim-stat { background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--radius); padding:15px 16px; display:flex; flex-direction:column; gap:3px; text-decoration:none; box-shadow:var(--elev-1); }
.mim-stat-link { transition:border-color .14s, transform .14s; } .mim-stat-link:hover { border-color:var(--accent-line); transform:translateY(-1px); }
.mim-stat-v { font-family:var(--font-display); font-size:26px; font-weight:600; letter-spacing:-.01em; color:var(--text); line-height:1; }
.mim-stat-l { font-size:13px; font-weight:500; color:var(--text-secondary); margin-top:4px; }
.mim-stat-s { font-size:11.5px; color:var(--text-muted); line-height:1.4; }
.mim-stat-ok .mim-stat-v { color:var(--green-text); }
.mim-stat-warn { border-color:var(--amber-line); } .mim-stat-warn .mim-stat-v { color:var(--amber-text); }

/* home */
.mim-home-top { margin:0 0 22px; }
.mim-home-h { font-family:var(--font-display); font-size:clamp(28px,4vw,38px); font-weight:600; letter-spacing:-.025em; color:var(--text); margin:0; line-height:1.05; }
.mim-ask { display:flex; gap:10px; align-items:center; margin:0 0 26px; }
.mim-ask-input { flex:1 1 auto; background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:var(--radius); padding:15px 18px; font:inherit; font-size:15.5px; box-shadow:var(--elev-1); transition:border-color .16s, box-shadow .16s; }
.mim-ask-input::placeholder { color:var(--text-muted); }
.mim-ask-input:focus { outline:none; border-color:var(--accent-dim); box-shadow:var(--accent-glow); }
.mim-cap-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:13px; }
.mim-cap { display:flex; flex-direction:column; gap:9px; padding:18px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface-raised); text-decoration:none; box-shadow:var(--elev-1); transition:border-color .15s, transform .15s, background .15s; }
.mim-cap:hover { border-color:var(--accent-line); transform:translateY(-2px); background:var(--surface-active); }
.mim-cap-ic { width:38px; height:38px; border-radius:10px; display:grid; place-items:center; background:var(--accent-subtle); color:var(--accent); }
.mim-cap-t { font-family:var(--font-display); font-size:16px; font-weight:600; color:var(--text); }
.mim-cap-b { font-size:13.5px; color:var(--text-muted); line-height:1.5; }

/* chat view inside the shell */
.mim-chatview { display:flex; flex-direction:column; height:100%; max-width:820px; width:100%; margin:0 auto; padding:0 40px; }
.mim-chat-top { display:flex; align-items:center; justify-content:space-between; padding:12px 2px; border-bottom:1px solid var(--border-light); }
.mim-chat-title { font-family:var(--font-display); font-weight:600; font-size:15px; color:var(--text); }
.mim-chat-gov { display:inline-flex; align-items:center; gap:6px; background:var(--surface-raised); border:1px solid var(--border); border-radius:9px; padding:6px 11px; color:var(--text-secondary); cursor:pointer; font:inherit; font-size:12.5px; transition:border-color .14s, color .14s; }
.mim-chat-gov:hover { border-color:var(--accent-line); color:var(--accent-text); }
.mim-chat-gov .mim-ni { width:15px; height:15px; }

/* app-level side panel (Artifacts pattern): docks right of main on EVERY surface */
.mim-panel { width:min(420px, 40vw); display:flex; flex-direction:column; min-width:0; height:100vh; border-left:1px solid var(--border); background:var(--surface); animation:mim-panel-in .2s cubic-bezier(.2,0,0,1); }
.mim-panel[hidden] { display:none; }
.mim-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 6px 14px 18px; border-bottom:1px solid var(--border); flex:0 0 auto; }
.mim-panel-title { font-family:var(--font-display); font-weight:600; font-size:15px; color:var(--text); }
.mim-panel-close { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:16px; line-height:1; padding:6px 12px; border-radius:8px; }
.mim-panel-close:hover { background:var(--surface-active); color:var(--text); }
.mim-panel-body { flex:1 1 auto; overflow-y:auto; padding:18px; }
.mim-panel-eyebrow { font-family:var(--font-mono); font-size:10px; text-transform:uppercase; letter-spacing:.1em; color:var(--text-muted); margin:0 0 6px; }
.mim-panel-subh { font-family:var(--font-display); font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin:22px 0 11px; }
.mim-task-panel-goal { font-family:var(--font-display); font-size:17px; font-weight:600; color:var(--text); line-height:1.3; margin:0 0 14px; }
.mim-task-panel-result { font-size:14px; color:var(--text-secondary); line-height:1.6; }
.mim-task-panel-pr { margin-top:16px; }
@keyframes mim-panel-in { from { opacity:0; transform:translateX(14px); } to { opacity:1; transform:none; } }
@media (max-width:860px) { .mim-panel { position:fixed; inset:0; width:auto; z-index:1300; } }

/* finished task card: calm summary; the detail opens in the panel */
.mim-task-result-trunc { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.mim-task-actions { display:flex; align-items:center; gap:16px; margin-top:13px; }
.mim-task-actions .mim-task-view { margin-left:auto; }

/* memory */
.mim-teach { display:flex; gap:10px; margin:0 0 22px; }
.mim-teach-input { flex:1 1 auto; background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:var(--radius); padding:13px 16px; font:inherit; font-size:15px; box-shadow:var(--elev-1); }
.mim-teach-input::placeholder { color:var(--text-muted); }
.mim-teach-input:focus { outline:none; border-color:var(--accent-dim); box-shadow:var(--accent-glow); }
.mim-facts-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px; }
.mim-fact-t { font-size:14.5px; color:var(--text); line-height:1.5; margin:0 0 9px; }
.mim-fact-m { font-family:var(--font-mono); font-size:10.5px; color:var(--text-muted); margin:0; text-transform:lowercase; }
/* learns-you: observed facts (learned by listening) carry their evidence + a one-tap forget */
.mim-mem-actions { display:flex; align-items:center; gap:12px; margin:0 0 24px; flex-wrap:wrap; }
.mim-mem-actions-hint { font-size:12.5px; color:var(--text-muted); }
.mim-mem-sec { margin-bottom:26px; }
.mim-mem-badge { font-family:var(--font-mono); font-size:10.5px; font-weight:500; text-transform:none; letter-spacing:0; color:var(--text-muted); margin-left:8px; }
.mim-mem-note { font-size:13px; color:var(--text-muted); line-height:1.55; margin:-6px 0 14px; max-width:68ch; }
.mim-fact { position:relative; }
.mim-fact-obs { border-left:3px solid var(--accent); }
.mim-fact-t { padding-right:22px; }
.mim-fact-ev { font-size:12.5px; color:var(--text-muted); line-height:1.5; margin:0; font-style:italic; border-top:1px solid var(--border-light); padding-top:8px; }
.mim-fact-x { position:absolute; top:9px; right:9px; width:24px; height:24px; border:none; background:none; color:var(--text-faint); cursor:pointer; border-radius:7px; font-size:12px; line-height:1; opacity:.45; transition:opacity .14s, background .14s, color .14s; }
.mim-fact:hover .mim-fact-x { opacity:1; }
.mim-fact-x:hover { background:var(--red-subtle); color:var(--red-text); }

/* opportunities */
.mim-opp-list { display:flex; flex-direction:column; gap:11px; }
.mim-opp-top { display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.mim-opp-tag { font-family:var(--font-mono); font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:.09em; padding:3px 9px; border-radius:6px; }
.mim-opp-opportunity { color:var(--green-text); background:rgba(63,212,150,.12); border:1px solid rgba(63,212,150,.3); }
.mim-opp-kill { color:var(--red-text); background:var(--red-subtle); border:1px solid rgba(255,122,122,.3); }
.mim-opp-prod { font-family:var(--font-mono); font-size:11.5px; color:var(--text-muted); }
.mim-opp-h { font-size:15px; color:var(--text); line-height:1.5; margin:0; }

/* capabilities — the governed action layer */
.mim-cap-tool { margin-bottom:10px; }
.mim-cap-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.mim-cap-row-main { min-width:0; }
.mim-cap-name { font-family:var(--font-mono); font-size:13.5px; color:var(--text); margin:0 0 4px; word-break:break-word; }
.mim-cap-desc { font-size:13px; color:var(--text-muted); margin:0; line-height:1.45; }
.mim-cap-risk { flex:0 0 auto; font-family:var(--font-mono); font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:.07em; padding:4px 9px; border-radius:7px; border:1px solid var(--border-strong); white-space:nowrap; }
.mim-cap-risk-read { color:var(--green-text); background:rgba(63,212,150,.12); border-color:rgba(63,212,150,.3); }
.mim-cap-risk-rev { color:var(--accent-text); background:var(--accent-subtle); border-color:var(--accent-line); }
.mim-cap-risk-cons { color:var(--amber-text); background:var(--amber-subtle); border-color:var(--amber-line); }
.mim-cap-risk-proh { color:var(--red-text); background:var(--red-subtle); border-color:rgba(255,122,122,.3); }
.mim-cap-connect { margin-top:18px; }
.mim-cap-connect code { font-family:var(--font-mono); font-size:12px; color:var(--accent-text); background:var(--accent-subtle); padding:1px 6px; border-radius:5px; }

/* ── research (the first typed capability — retrieve → converge) ── */
.mim-research-form { display:flex; gap:11px; margin:4px 0 8px; }
.mim-research-input { flex:1 1 auto; background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:var(--radius); padding:15px 18px; font:inherit; font-size:15.5px; box-shadow:var(--elev-1); transition:border-color .16s, box-shadow .16s; }
.mim-research-input::placeholder { color:var(--text-muted); }
.mim-research-input:focus { outline:none; border-color:var(--accent-dim); box-shadow:var(--accent-glow); }
.mim-research-input:disabled { opacity:.55; cursor:not-allowed; }
.mim-research-live { display:flex; align-items:center; gap:8px; font-family:var(--font-mono); font-size:11.5px; color:var(--text-muted); margin:0 0 10px; }
.mim-research-dot { width:7px; height:7px; border-radius:50%; background:var(--green-text); box-shadow:0 0 0 3px rgba(63,212,150,.15); }
.mim-research-ans { margin-top:4px; }
.mim-research-answer { font-size:15px; line-height:1.66; color:var(--text); }
.mim-research-via { margin-top:12px; padding-top:11px; border-top:1px solid var(--border); font-family:var(--font-mono); font-size:11px; color:var(--text-muted); }
.mim-research-via b { color:var(--accent-text); font-weight:500; }
.mim-research-srcs { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:11px; }
.mim-research-src { display:flex; gap:11px; background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--radius); padding:13px 15px; box-shadow:var(--elev-1); }
.mim-research-n { flex:0 0 auto; font-family:var(--font-mono); font-size:12px; color:var(--accent-text); }
.mim-research-sbody { min-width:0; }
.mim-research-snip { font-size:13px; color:var(--text-muted); margin:5px 0 0; line-height:1.5; }
.mim-research-err { color:var(--red-text); font-size:14px; margin:0; }

/* devices */
.mim-dev-list { display:flex; flex-direction:column; gap:11px; }
.mim-dev-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.mim-dev-name { font-family:var(--font-display); font-size:15.5px; font-weight:500; color:var(--text); margin:0 0 4px; }
.mim-dev-m { font-family:var(--font-mono); font-size:11px; color:var(--text-muted); margin:0; }

/* settings */
.mim-set-t { font-family:var(--font-display); font-size:15.5px; font-weight:600; color:var(--text); margin:0 0 6px; }
.mim-set-b { font-size:14px; color:var(--text-secondary); line-height:1.6; margin:0; max-width:62ch; }
.mim-set-actions { display:flex; gap:11px; flex-wrap:wrap; }
.mim-danger-zone { margin-top:16px; padding:17px 19px; border:1px solid var(--red-text); border-radius:var(--radius); background:var(--red-subtle); display:flex; flex-direction:column; gap:12px; align-items:flex-start; }
.mim-danger-zone[hidden] { display:none; }   /* the attribute must win over display:flex (else confirms show by default) */
.mim-danger-zone .mim-set-b { color:var(--text); }

/* ── theme picker (Settings · auth) — a tiny faux-UI preview; the cyan dot is the constant governed accent ── */
.mim-theme-row { display:flex; flex-wrap:wrap; gap:10px; }
.mim-theme-sw { display:flex; flex-direction:column; align-items:flex-start; gap:7px; padding:10px; width:120px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); cursor:pointer; font:inherit; text-align:left; transition:border-color .14s, transform .14s, box-shadow .14s; }
.mim-theme-sw:hover { transform:translateY(-1px); border-color:var(--accent-line); }
.mim-theme-sw:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mim-theme-sw.is-on { border-color:var(--accent-dim); box-shadow:var(--accent-glow); }
.mim-theme-chip { position:relative; width:100%; height:40px; border-radius:8px; border:1px solid var(--surface-hair); overflow:hidden; display:block; }
.mim-theme-dot { position:absolute; top:8px; left:9px; width:9px; height:9px; border-radius:50%; background:var(--accent); box-shadow:0 0 8px var(--accent-line); }
.mim-theme-bar { position:absolute; left:9px; right:22px; bottom:9px; height:5px; border-radius:3px; opacity:.5; }
.mim-theme-lbl { font-size:13px; font-weight:600; color:var(--text); }
.mim-theme-note { font-size:11px; color:var(--text-muted); }
.mim-theme-sw.is-on .mim-theme-lbl { color:var(--accent-text); }
.mim-auth-theme { margin-top:18px; padding-top:16px; border-top:1px solid var(--border-light); }
.mim-auth-theme-l { display:block; font-size:12px; font-weight:500; letter-spacing:.02em; color:var(--text-secondary); margin-bottom:10px; }
.mim-auth-theme .mim-theme-row { gap:8px; }
.mim-auth-theme .mim-theme-sw { width:98px; padding:8px; }
.mim-auth-theme .mim-theme-chip { height:30px; }
@media (prefers-reduced-motion: reduce) { .mim-theme-sw { transition:none; } }

/* autonomy */
.mim-auton-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 22px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface-raised); box-shadow:var(--elev-1); margin-bottom:14px; }
.mim-auton-hero.is-on { border-color:var(--accent-line); background:linear-gradient(160deg, rgba(53,214,255,.07), var(--surface-raised)); }
.mim-auton-state { display:flex; align-items:center; gap:14px; min-width:0; }
.mim-auton-pulse { width:11px; height:11px; border-radius:50%; background:var(--text-muted); flex:0 0 auto; }
.mim-auton-hero.is-on .mim-auton-pulse { background:var(--accent); animation:mim-pulse 1.9s infinite; }
@keyframes mim-pulse { 0%{box-shadow:0 0 0 0 rgba(53,214,255,.5)} 70%{box-shadow:0 0 0 11px rgba(53,214,255,0)} 100%{box-shadow:0 0 0 0 rgba(53,214,255,0)} }
.mim-auton-t { font-family:var(--font-display); font-size:17px; font-weight:600; color:var(--text); margin:0 0 3px; }
.mim-auton-s { font-size:13.5px; color:var(--text-muted); margin:0; line-height:1.45; }
.mim-auton-gov { margin-bottom:16px; }
.mim-auton-exec { font-family:var(--font-mono); font-size:11px; color:var(--accent-text); align-self:center; }
/* the switch */
.mim-switch { width:54px; height:31px; border-radius:16px; background:var(--surface-active); border:1px solid var(--border-strong); position:relative; cursor:pointer; transition:background .18s, border-color .18s; flex:0 0 auto; padding:0; }
.mim-switch-knob { position:absolute; top:3px; left:3px; width:23px; height:23px; border-radius:50%; background:var(--text-muted); transition:transform .2s cubic-bezier(.4,1.3,.5,1), background .18s; }
.mim-switch.is-on { background:linear-gradient(160deg,var(--accent),var(--accent-press)); border-color:var(--accent-dim); box-shadow:var(--accent-glow); }
.mim-switch.is-on .mim-switch-knob { transform:translateX(23px); background:#06131b; }
.mim-switch:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mim-switch:disabled { opacity:.6; cursor:default; }
@media (prefers-reduced-motion: reduce) { .mim-auton-hero.is-on .mim-auton-pulse { animation:none; } .mim-switch-knob { transition:none; } }
/* tasks — autonomous execution trace */
.mim-task { margin-bottom:12px; }
.mim-task.is-running { border-color:var(--accent-line); background:linear-gradient(160deg, rgba(53,214,255,.06), var(--surface-raised)); }
.mim-task.is-await { border-color:var(--amber-line); } .mim-task.is-err { border-color:var(--red-text); }
.mim-task-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.mim-task-badge { font-family:var(--font-mono); font-size:10.5px; font-weight:500; text-transform:uppercase; letter-spacing:.09em; color:var(--accent-text); }
.mim-task.is-await .mim-task-badge { color:var(--amber-text); } .mim-task.is-err .mim-task-badge { color:var(--red-text); }
.mim-task-goal { font-family:var(--font-display); font-size:16px; font-weight:600; color:var(--text); margin:0 0 12px; line-height:1.35; }
.mim-steps { display:flex; flex-direction:column; gap:3px; margin:0 0 10px; border-left:2px solid var(--border); padding-left:12px; }
.mim-step { display:flex; align-items:baseline; gap:9px; font-size:13px; color:var(--text-secondary); line-height:1.5; }
.mim-step-n { font-family:var(--font-mono); font-size:10px; color:var(--text-faint); min-width:16px; }
.mim-step-ic { font-size:12px; }
.mim-step-tool { font-family:var(--font-mono); font-size:11.5px; color:var(--accent-text); min-width:92px; }
.mim-step-line { color:var(--text-muted); word-break:break-word; }
.mim-task-result { font-size:14px; color:var(--text); line-height:1.55; margin:4px 0 10px; }
.mim-task-approve { display:inline-block; text-decoration:none; }

/* autonomy MODE: governed vs unencumbered */
.mim-mode-warn-card { border-color:var(--red-text); background:var(--red-subtle); }
.mim-seg { display:inline-flex; gap:0; margin:0 0 4px; border:1px solid var(--border-strong); border-radius:11px; overflow:hidden; }
.mim-seg-btn { padding:9px 18px; background:var(--surface); color:var(--text-muted); border:none; border-right:1px solid var(--border-strong); font:inherit; font-size:14px; font-weight:500; cursor:pointer; transition:background .14s, color .14s; }
.mim-seg-btn:last-child { border-right:none; }
.mim-seg-btn:hover { color:var(--text); }
.mim-seg-btn.is-on { background:var(--surface-active); color:var(--text); }
.mim-seg-danger.is-on { background:var(--red-subtle); color:var(--red-text); }

/* ══ awareness — the sense of NOW ══ */
.mim-aware-hero { display:flex; align-items:center; gap:14px; padding:18px 20px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface-raised); box-shadow:var(--elev-1); margin-bottom:8px; }
.mim-aware-hero.is-on { border-color:var(--accent-line); background:linear-gradient(160deg, rgba(53,214,255,.07), var(--surface-raised)); }
.mim-aware-pulse { width:11px; height:11px; border-radius:50%; background:var(--text-muted); flex:0 0 auto; }
.mim-aware-hero.is-on .mim-aware-pulse, .mim-aware-pulse.is-live { background:var(--accent); animation:mim-pulse 1.9s infinite; }
.mim-aware-state { font-family:var(--font-display); font-size:16px; font-weight:600; color:var(--text); margin:0 0 3px; }
.mim-aware-sub { font-size:13px; color:var(--text-muted); margin:0; line-height:1.45; }
.mim-aware-reach { font-size:12px; color:var(--accent-text); margin:6px 0 0; line-height:1.45; opacity:.9; }
.mim-notice-held { font-size:12px; color:var(--text-faint); font-style:italic; margin:0 0 10px; }
/* the Situation model — three human-language cards */
.mim-sit-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; }
.mim-sit { display:flex; flex-direction:column; }
.mim-sit-h { font-family:var(--font-display); font-size:13.5px; font-weight:600; letter-spacing:.01em; color:var(--accent-text); margin:0 0 11px; }
.mim-sit-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.mim-sit-li { display:flex; align-items:baseline; gap:9px; font-size:13.5px; color:var(--text-secondary); line-height:1.5; }
.mim-sit-li.is-warn { color:var(--amber-text); }
.mim-sit-dot { flex:0 0 auto; width:5px; height:5px; border-radius:50%; background:var(--accent-line); margin-top:7px; }
.mim-sit-li.is-warn .mim-sit-dot { background:var(--amber); box-shadow:0 0 8px var(--amber-line); }
.mim-sit-empty { font-size:13px; color:var(--text-muted); line-height:1.5; margin:0; }
/* the Noticings feed — what I decided mattered, and why (the watchable part) */
.mim-notice-list { display:flex; flex-direction:column; gap:11px; }
.mim-notice { background:var(--surface-raised); border:1px solid var(--border); border-left:3px solid var(--border-strong); border-radius:var(--radius); padding:15px 17px; box-shadow:var(--elev-1); }
.mim-notice-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:9px; }
.mim-notice-tag { font-family:var(--font-mono); font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:.09em; padding:3px 9px; border-radius:6px; border:1px solid var(--border-strong); color:var(--text-muted); }
.mim-notice-propose { color:var(--accent-text); background:var(--accent-subtle); border-color:var(--accent-line); }
.mim-notice-reach { color:#06131b; background:linear-gradient(160deg,var(--accent),var(--accent-press)); border-color:var(--accent-dim); }
.mim-notice-surface { color:var(--amber-text); background:var(--amber-subtle); border-color:var(--amber-line); }
.mim-notice-remember { color:var(--text-muted); }
.mim-notice-propose ~ .mim-notice-when, .mim-notice-when { font-family:var(--font-mono); font-size:10.5px; color:var(--text-faint); margin-left:auto; }
.mim-notice-tuned { font-family:var(--font-mono); font-size:9.5px; font-weight:500; text-transform:uppercase; letter-spacing:.08em; color:var(--accent-text); background:var(--accent-subtle); border:1px solid var(--accent-line); padding:2px 7px; border-radius:6px; }
.mim-learn-ev { font-family:var(--font-mono); font-size:11px; color:var(--text-faint); }
.mim-notice-h { font-size:15px; font-weight:500; color:var(--text); margin:0 0 4px; line-height:1.45; }
.mim-notice-d { font-size:13.5px; color:var(--text-secondary); margin:0 0 7px; line-height:1.5; }
.mim-notice-why { font-size:12.5px; color:var(--text-muted); font-style:italic; margin:0 0 7px; line-height:1.45; }
.mim-notice-out { font-size:13px; color:var(--accent-text); margin:0 0 10px; line-height:1.45; }
.mim-notice-fb { display:flex; align-items:center; gap:9px; flex-wrap:wrap; padding-top:11px; border-top:1px solid var(--border-light); }
.mim-notice-fb-q { font-size:12px; color:var(--text-muted); margin-right:2px; }
.mim-notice-fb-btn { background:transparent; border:1px solid var(--border-strong); color:var(--text-secondary); padding:5px 13px; border-radius:9px; font:inherit; font-size:12.5px; cursor:pointer; transition:border-color .14s, color .14s; }
.mim-notice-fb-btn:hover { border-color:var(--accent-line); color:var(--accent-text); }
.mim-notice-fb-btn:disabled { opacity:.5; cursor:default; }
.mim-notice-fb-btn:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mim-notice-fb-done { font-size:12.5px; color:var(--green-text); }
@media (prefers-reduced-motion: reduce) { .mim-aware-hero.is-on .mim-aware-pulse, .mim-aware-pulse.is-live { animation:none; } }

/* ── scrolling chat ── */
.mim-chat { flex:1 1 auto; overflow-y:auto; padding:26px 2px 8px; display:flex; flex-direction:column; gap:16px; scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
.mim-chat::-webkit-scrollbar{ width:9px; } .mim-chat::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:9px; border:3px solid transparent; background-clip:content-box; }

/* ── message bubbles — accent reserved for the GOVERNED soul, not the operator ── */
.mim-b { max-width:78%; padding:13px 16px; border-radius:var(--radius); line-height:1.62; font-size:15px; box-shadow:var(--elev-1); }
.mim-b-body { word-wrap:break-word; }
/* rendered markdown inside a bubble — real prose, not a wall of asterisks */
.mim-b-body > :first-child { margin-top:0; }
.mim-b-body > :last-child { margin-bottom:0; }
.mim-p { margin:0 0 9px; }
.mim-b-body strong { font-weight:600; color:var(--text); }
.mim-b-body em { font-style:italic; }
.mim-mh { font-family:var(--font-display); font-weight:600; letter-spacing:-.01em; line-height:1.3; color:var(--text); margin:15px 0 7px; font-size:16px; }
.mim-ul, .mim-ol { margin:0 0 9px; padding-left:20px; }
.mim-ul li, .mim-ol li { margin:2px 0; }
.mim-ul { list-style:none; padding-left:16px; }
.mim-ul li { position:relative; }
.mim-ul li::before { content:''; position:absolute; left:-13px; top:.68em; width:4px; height:4px; border-radius:50%; background:var(--accent-line); }
.mim-hr { border:none; border-top:1px solid var(--border); margin:13px 0; }
.mim-ic { font-family:var(--font-mono); font-size:.88em; color:var(--accent-text); background:var(--accent-subtle); padding:1px 5px; border-radius:5px; }
.mim-code { font-family:var(--font-mono); font-size:12.5px; line-height:1.55; color:var(--text-secondary); background:var(--bg-canvas);
  border:1px solid var(--border); border-radius:var(--radius-sm); padding:11px 13px; margin:0 0 10px; overflow-x:auto; }
.mim-code code { background:none; padding:0; color:inherit; }
.mim-link { color:var(--accent-text); text-decoration:underline; text-underline-offset:2px; }
.mim-link:hover { color:var(--accent); }
.mim-b-you { align-self:flex-end; background:var(--surface-active); color:var(--text); border:1px solid var(--border-strong); border-bottom-right-radius:5px; }
.mim-b-ai { align-self:flex-start; background:var(--surface-raised); color:var(--text); border:1px solid var(--border); border-bottom-left-radius:5px; position:relative; padding-left:18px; }
.mim-b-ai::before { content:''; position:absolute; left:0; top:13px; bottom:13px; width:2px; border-radius:2px; background:var(--accent-line); }  /* the governed hairline */
.mim-b-degraded { background:var(--surface); border-color:var(--amber-line); color:var(--text-secondary); }
.mim-b-degraded::before { background:var(--amber-line); }
.mim-b-belowfloor { border-color:var(--amber-line); }
.mim-b-belowfloor::before { background:var(--amber-line) !important; }
.mim-belowfloor { margin-top:10px; padding:11px 13px; border-radius:var(--radius-sm); background:var(--amber-subtle); border:1px solid var(--amber-line);
  color:var(--amber-text); font-size:12.5px; line-height:1.5; }
.mim-bf-head { font-weight:500; }
.mim-bf-why { margin:8px 0 10px; padding:0 0 0 16px; display:flex; flex-direction:column; gap:5px; }
.mim-bf-why li { line-height:1.5; }
.mim-bf-why b { color:var(--text); font-weight:600; }
.mim-bf-raise { background:var(--amber-text); color:#1a1205; border:none; border-radius:8px; padding:6px 12px; font:inherit; font-size:12px; font-weight:600; cursor:pointer; transition:filter .14s; }
.mim-bf-raise:hover { filter:brightness(1.08); }
.mim-via { margin-top:9px; font-family:var(--font-mono); font-size:10.5px; font-weight:500; letter-spacing:.02em; text-transform:lowercase; color:var(--accent-text); opacity:.82; }
.mim-origin { align-self:flex-end; margin:0 4px -8px; font-family:var(--font-mono); font-size:10.5px; color:var(--text-muted); }

/* live deliberation stages (streamed) — a mono instrument line with a cyan pulse */
.mim-typing { display:flex; gap:6px; align-items:center; width:auto; background:var(--surface-raised); border:1px solid var(--border); }
.mim-typing span { width:6px; height:6px; border-radius:50%; background:var(--accent); animation:mim-blink 1.2s infinite ease-in-out both; }
.mim-typing span:nth-child(2){ animation-delay:.18s } .mim-typing span:nth-child(3){ animation-delay:.36s }
@keyframes mim-blink { 0%,80%,100%{opacity:.3;transform:translateY(0)} 40%{opacity:1;transform:translateY(-3px)} }
.mim-typing-stage { font-family:var(--font-mono); font-style:normal; color:var(--accent-text); font-size:12.5px; margin-left:8px; opacity:.9; }

/* ── welcome / empty state — a real hero ── */
.mim-welcome { margin:auto 0; padding:4px 2px; }
.mim-welcome-eyebrow { font-family:var(--font-mono); font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--accent-text); opacity:.8; margin:0 0 14px; }
.mim-welcome-h { font-family:var(--font-display); font-size:clamp(26px,4vw,34px); font-weight:600; letter-spacing:-.02em; line-height:1.14; color:var(--text); margin:0 0 12px; max-width:18ch; }
.mim-welcome-d { color:var(--text-secondary); font-size:15.5px; line-height:1.6; margin:0 0 24px; max-width:56ch; }
.mim-suggest { display:flex; flex-wrap:wrap; gap:10px; }
.mim-chip { background:var(--surface-raised); border:1px solid var(--border); color:var(--text-secondary);
  padding:10px 15px; border-radius:11px; font-size:13.5px; cursor:pointer; box-shadow:var(--elev-1);
  transition:border-color .16s, color .16s, background .16s, transform .16s; }
.mim-chip:hover { border-color:var(--accent-line); color:var(--text); background:var(--surface-active); transform:translateY(-1px); }
.mim-chip:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* ── composer — an instrument, not a form ── */
.mim-composer { display:flex; gap:10px; align-items:flex-end; padding:14px 0 22px; border-top:1px solid var(--border-light); }
.mim-input { flex:1 1 auto; resize:none; background:var(--surface); color:var(--text); border:1px solid var(--border);
  border-radius:var(--radius); padding:13px 16px; font:inherit; font-size:15px; line-height:1.5; max-height:170px; box-shadow:var(--elev-1);
  transition:border-color .16s, box-shadow .16s; }
.mim-input::placeholder { color:var(--text-muted); }
.mim-input:focus { outline:none; border-color:var(--accent-dim); box-shadow:var(--accent-glow); }
.mim-send { flex:0 0 auto; width:46px; height:46px; display:grid; place-items:center; border:1px solid var(--accent-dim); border-radius:13px; cursor:pointer;
  background:linear-gradient(160deg,var(--accent),var(--accent-press)); color:#06131b; transition:box-shadow .16s, transform .16s, filter .16s; }
.mim-send svg { display:block; }
.mim-send:hover { box-shadow:var(--accent-glow); transform:translateY(-1px); }
.mim-send:active { transform:translateY(0); filter:brightness(.95); }
.mim-send:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mim-send:disabled { opacity:.5; cursor:default; box-shadow:none; transform:none; }
/* voice push-to-talk mic (secondary to send; pulses cyan while listening) */
.mim-mic { flex:0 0 auto; width:46px; height:46px; display:grid; place-items:center; border:1px solid var(--border-strong); border-radius:13px; cursor:pointer; background:var(--surface-active); color:var(--text-secondary); transition:border-color .16s, color .16s, transform .16s, background .16s; }
.mim-mic:hover { border-color:var(--accent-line); color:var(--accent-text); transform:translateY(-1px); }
.mim-mic:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mim-mic.is-live { border-color:var(--accent-dim); color:#06131b; background:linear-gradient(160deg,var(--accent),var(--accent-press)); box-shadow:var(--accent-glow); animation:mim-pulse 1.4s infinite; }
.mim-mic[hidden] { display:none; }
@media (prefers-reduced-motion: reduce) { .mim-mic.is-live { animation:none; } }

/* ── the gate card: the signature — a governed instrument halting ── */
.mim-gate { align-self:stretch; background:linear-gradient(180deg,var(--surface-raised),var(--surface)); border:1px solid var(--amber-line);
  border-left:3px solid var(--amber); border-radius:var(--radius); padding:17px 19px; margin:2px 0; box-shadow:var(--elev-2); }
.mim-gate-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.mim-gate-badge { font-family:var(--font-mono); font-size:10.5px; font-weight:500; text-transform:uppercase; letter-spacing:.11em; color:var(--amber-text);
  display:flex; align-items:center; gap:8px; }
.mim-gate-badge::before { content:''; width:7px; height:7px; border-radius:50%; background:var(--amber); box-shadow:0 0 9px var(--amber); }
.mim-gate-risk { font-family:var(--font-mono); font-size:10.5px; font-weight:500; text-transform:uppercase; letter-spacing:.09em; color:var(--text-muted);
  border:1px solid var(--border-strong); padding:2px 8px; border-radius:6px; }
.mim-gate-action { font-family:var(--font-mono); font-size:13px; line-height:1.55; color:var(--text);
  background:var(--bg-canvas); border:1px solid var(--border); border-radius:var(--radius-sm); padding:11px 13px; word-break:break-word; }
.mim-gate-why { font-size:13px; color:var(--accent-text); margin:11px 0 0; line-height:1.5; font-style:italic; }
.mim-gate-note { font-size:13.5px; color:var(--text-secondary); margin:12px 0 15px; line-height:1.5; }
.mim-gate-link { color:var(--accent-text); text-decoration:underline; word-break:break-all; }
.mim-gate-link:hover { color:var(--accent); }
.mim-gate-actions { display:flex; gap:10px; }
.mim-gate-btn { min-height:40px; padding:0 18px; border-radius:11px; border:1px solid var(--border-strong);
  background:var(--surface-active); color:var(--text); font:inherit; font-weight:500; font-size:14px; cursor:pointer;
  transition:background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.mim-gate-btn:hover { transform:translateY(-1px); }
.mim-gate-approve { background:linear-gradient(160deg,var(--accent),var(--accent-press)); color:#06131b; border-color:var(--accent-dim); font-weight:600; }
.mim-gate-approve:hover { box-shadow:var(--accent-glow); }
.mim-gate-redirect:hover { border-color:var(--accent-line); color:var(--accent-text); }
.mim-gate-reject:hover { border-color:var(--red-text); color:var(--red-text); }
.mim-gate-btn:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mim-gate-btn:disabled { opacity:.5; cursor:default; box-shadow:none; transform:none; }
.mim-gate.is-approved { border-color:var(--accent-line); border-left-color:var(--accent); }
.mim-gate.is-rejected { border-left-color:var(--text-muted); opacity:.72; }
.mim-gate-redirect-row { display:flex; gap:8px; margin-top:13px; }
.mim-gate-redirect-row[hidden] { display:none; }
.mim-gate-redirect-input { flex:1 1 auto; background:var(--surface); color:var(--text); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:9px 12px; font:inherit; font-size:14px; }
.mim-gate-redirect-input::placeholder { color:var(--text-muted); }
.mim-gate-redirect-input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-subtle); }
.mim-gate-redirect-send { flex:0 0 auto; min-height:38px; }

/* ══ TERMINAL — the governed console. Mono, streamed, the gate as a first-class citizen. Fully
   token-driven so it themes across every scheme (incl. Daybreak light). --term-accent tints to the
   active lab; the GATE + governed dot keep the constant cyan. ══ */
.mim-term { --term-accent:var(--accent); display:flex; flex-direction:column; height:100%; min-height:0; max-width:1040px; width:100%; margin:0 auto; padding:0 clamp(16px,3vw,40px); font-family:var(--font-mono); }
.mim-term-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; padding:22px 2px 10px; display:flex; flex-direction:column; gap:3px; scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
.mim-term-scroll::-webkit-scrollbar{ width:9px; } .mim-term-scroll::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:9px; border:3px solid transparent; background-clip:content-box; }
.mim-tl { font-size:13px; line-height:1.65; white-space:pre-wrap; word-break:break-word; color:var(--text-secondary); }
.mim-tl-in { color:var(--text); display:flex; gap:9px; margin-top:7px; }
.mim-tl-in .mim-tl-ps { color:var(--term-accent); font-weight:600; flex:0 0 auto; }
.mim-tl-sys { color:var(--text-muted); }
.mim-tl-live .mim-tl-cur { color:var(--term-accent); animation:mim-term-blink 1s steps(2) infinite; }
.mim-tl-out { color:var(--text); margin:4px 0 9px; padding-left:12px; border-left:2px solid var(--accent-line); }
.mim-tl-body { font-family:var(--font-mono); }
.mim-tl-body > :first-child { margin-top:0; } .mim-tl-body > :last-child { margin-bottom:0; }
.mim-tl-body .mim-p { margin:0 0 7px; } .mim-tl-body .mim-mh { font-size:14px; margin:11px 0 6px; } .mim-tl-body .mim-code { font-size:12px; }
.mim-tl-via { display:block; margin-top:5px; font-size:10.5px; color:var(--accent-text); opacity:.75; text-transform:lowercase; }
.mim-tl-degraded, .mim-tl-belowfloor { border-left-color:var(--amber-line); }
.mim-tl-below { margin-top:7px; padding:9px 11px; border:1px solid var(--amber-line); background:var(--amber-subtle); border-radius:var(--radius-sm); color:var(--amber-text); font-size:12px; line-height:1.55; }
.mim-tl-below b { color:var(--text); }
@keyframes mim-term-blink { 50%{opacity:.25} }
/* boot banner */
.mim-term-banner { border:1px solid var(--border); border-radius:var(--radius); background:linear-gradient(180deg,var(--surface-raised),var(--surface)); padding:16px 18px; margin:6px 0 14px; box-shadow:var(--elev-1); }
.mim-tb-mark { display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.mim-tb-mark .mim-mark { width:26px; height:26px; } .mim-tb-mark .mim-mark img { width:22px; height:22px; }
.mim-tb-word { font-family:var(--font-display); font-weight:700; font-size:16px; letter-spacing:.08em; color:var(--text); }
.mim-tb-ver { font-size:10.5px; text-transform:uppercase; letter-spacing:.14em; color:var(--term-accent); border:1px solid var(--accent-line); border-radius:5px; padding:2px 7px; }
.mim-tb-con { font-size:12px; color:var(--text-secondary); line-height:1.6; }
.mim-tb-hint { font-size:11.5px; color:var(--text-muted); margin-top:8px; }
.mim-tb-hint b, .mim-tb-ver { font-weight:500; } .mim-tb-hint b { color:var(--accent-text); }
/* the gate, as a terminal citizen — the hero */
.mim-tl-gate { margin:8px 0; }
.mim-tg { border:1px solid var(--amber-line); border-left:3px solid var(--amber); border-radius:var(--radius-sm); background:var(--surface-raised); padding:13px 15px; box-shadow:var(--elev-1); }
.mim-tg-top { display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.mim-tg-badge { font-size:11px; font-weight:600; letter-spacing:.08em; color:var(--amber-text); }
.mim-tg-risk { font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); border:1px solid var(--border-strong); border-radius:5px; padding:2px 7px; }
.mim-tg-act { font-size:13px; color:var(--text); background:var(--bg-canvas); border:1px solid var(--border); border-radius:var(--radius-sm); padding:9px 11px; }
.mim-tg-why { font-size:12px; color:var(--accent-text); margin-top:8px; font-style:italic; }
.mim-tg-note { font-size:12.5px; color:var(--text-secondary); margin:9px 0 11px; }
.mim-tg-acts { display:flex; gap:8px; flex-wrap:wrap; }
.mim-tg-btn { font-family:var(--font-mono); font-size:12.5px; padding:7px 13px; border-radius:8px; border:1px solid var(--border-strong); background:var(--surface-active); color:var(--text); cursor:pointer; transition:border-color .14s, box-shadow .14s, transform .14s; }
.mim-tg-btn:hover { transform:translateY(-1px); } .mim-tg-btn:disabled { opacity:.5; cursor:default; transform:none; }
.mim-tg-approve { background:linear-gradient(160deg,var(--accent),var(--accent-press)); color:#06131b; border-color:var(--accent-dim); font-weight:600; }
.mim-tg-approve:hover { box-shadow:var(--accent-glow); }
.mim-tg-stop:hover { border-color:var(--red-text); color:var(--red-text); }
.mim-tg-hint { font-size:11px; color:var(--text-faint); margin-top:9px; }
/* prompt + honest status strip */
.mim-term-prompt { display:flex; align-items:center; gap:10px; padding:12px 2px; border-top:1px solid var(--border-light); }
.mim-term-ps1 { color:var(--term-accent); font-weight:600; font-size:13px; flex:0 0 auto; white-space:nowrap; }
.mim-term-input { flex:1 1 auto; background:none; border:none; outline:none; color:var(--text); font:inherit; font-size:13px; caret-color:var(--term-accent); padding:4px 0; }
.mim-term-input::placeholder { color:var(--text-faint); }
.mim-term-status { display:flex; align-items:center; gap:8px; padding:0 2px 16px; font-size:11px; color:var(--text-muted); }
.mim-term-dot { width:6px; height:6px; border-radius:50%; background:var(--green); box-shadow:0 0 8px var(--green); flex:0 0 auto; }
.mim-term-sep { color:var(--text-faint); } #mim-term-model { color:var(--accent-text); }
@media (prefers-reduced-motion: reduce){ .mim-tl-live .mim-tl-cur { animation:none; } .mim-tg-btn { transition:none; } }

/* ── first-run / auth panel ── */
.mim-auth { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.mim-auth-card { width:100%; max-width:452px; background:linear-gradient(180deg,var(--surface-raised),var(--surface)); border:1px solid var(--border);
  border-radius:18px; padding:32px 30px; box-shadow:var(--elev-2); }
.mim-auth-mark { display:flex; align-items:center; gap:11px; margin-bottom:20px; }
.mim-auth-mark .mim-wordmark { font-size:23px; }
.mim-auth-h { font-family:var(--font-display); font-size:23px; font-weight:600; letter-spacing:-.015em; color:var(--text); margin:0 0 9px; line-height:1.22; }
.mim-auth-d { color:var(--text-secondary); font-size:14.5px; line-height:1.6; margin:0 0 22px; max-width:50ch; }
.mim-auth-d code { font-family:var(--font-mono); font-size:12.5px; color:var(--accent-text); background:var(--accent-subtle); padding:1px 6px; border-radius:5px; }
.mim-auth-form { display:flex; flex-direction:column; gap:10px; }
.mim-auth-label { font-size:12.5px; font-weight:500; letter-spacing:.02em; color:var(--text-secondary); }
.mim-auth-input { background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 14px; font:inherit; font-size:15px; box-shadow:var(--elev-1); }
.mim-auth-input::placeholder { color:var(--text-muted); }
.mim-auth-input:focus { outline:none; border-color:var(--accent-dim); box-shadow:var(--accent-glow); }
.mim-auth-btn { min-height:46px; margin-top:4px; border:1px solid var(--accent-dim); border-radius:12px;
  background:linear-gradient(160deg,var(--accent),var(--accent-press)); color:#06131b; font:inherit; font-weight:600; font-size:15px; cursor:pointer;
  transition:box-shadow .16s, transform .16s; }
.mim-auth-btn:hover { box-shadow:var(--accent-glow); transform:translateY(-1px); }
.mim-auth-btn:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mim-auth-err { min-height:18px; margin:10px 0 0; font-size:13px; color:var(--red-text); }
.mim-auth-foot { margin:20px 0 0; padding-top:17px; border-top:1px solid var(--border-light); font-size:12.5px; line-height:1.55; color:var(--text-muted); }

/* ── toast ── */
.mim-toast { position:fixed; left:50%; bottom:28px; transform:translate(-50%,16px); background:var(--surface-raised);
  color:var(--text); border:1px solid var(--border-strong); padding:11px 18px; border-radius:11px; font-size:14px;
  opacity:0; transition:opacity .25s, transform .25s; z-index:1500; max-width:80vw; box-shadow:var(--elev-2); }
.mim-toast.is-in { opacity:1; transform:translate(-50%,0); }
.mim-toast-success { border-color:var(--green-text); } .mim-toast-error { border-color:var(--red-text); }

.mim-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ── Governed (the witness surface) ─────────────────────────────────────────── */
.mim-gov-pill { font-family:var(--font-mono); font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:.08em; padding:3px 9px; border-radius:6px; white-space:nowrap; flex:0 0 auto; }
.mim-gov-pill-ok { color:var(--green-text); background:rgba(63,212,150,.12); border:1px solid rgba(63,212,150,.34); }
.mim-gov-pill-warn { color:var(--amber-text); background:var(--amber-subtle); border:1px solid var(--amber-line); }
.mim-gov-pill-gap { color:var(--red-text); background:var(--red-subtle); border:1px solid rgba(255,122,122,.34); }

/* calm, glanceable: one promise + one proof. Depth lives in collapsed <details> below. */
.mim-view-narrow { max-width:760px; margin-inline:auto; }
.mim-gov-hero { text-align:center; padding:32px 26px 26px; background:linear-gradient(180deg, var(--accent-subtle), var(--surface-raised) 72%); border:1px solid var(--accent-line); }
.mim-gov-promise { font-family:var(--font-display); font-size:clamp(23px, 3.6vw, 31px); font-weight:600; line-height:1.24; letter-spacing:-.01em; color:var(--text); margin:0 auto 13px; max-width:19ch; }
.mim-gov-promise-sub { font-size:15px; color:var(--text-secondary); line-height:1.6; margin:0 auto 22px; max-width:52ch; }
.mim-gov-hero-cta { display:flex; flex-direction:column; align-items:center; gap:9px; }
.mim-gov-hero-cta .mim-btn { min-width:168px; }
.mim-gov-hero-hint { font-size:12.5px; color:var(--text-muted); }

.mim-gov-status { display:flex; align-items:flex-start; gap:9px; font-size:13px; color:var(--text-muted); line-height:1.55; margin:16px 4px 26px; }
.mim-gov-status-dot { width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 8px var(--green); flex:0 0 auto; margin-top:5px; }

.mim-gov-details { border:1px solid var(--border); border-radius:var(--radius); background:var(--surface-raised); box-shadow:var(--elev-1); margin-bottom:12px; overflow:hidden; }
.mim-gov-details > summary { cursor:pointer; list-style:none; padding:16px 18px; display:flex; align-items:center; gap:12px; font-family:var(--font-display); font-size:15px; font-weight:600; color:var(--text); transition:background .14s; }
.mim-gov-details > summary::-webkit-details-marker { display:none; }
.mim-gov-details > summary::after { content:'⌄'; color:var(--text-muted); font-size:15px; margin-left:12px; transition:transform .18s; flex:0 0 auto; }
.mim-gov-details[open] > summary::after { transform:rotate(180deg); }
.mim-gov-details > summary:hover { background:var(--surface-active); }
.mim-gov-details[open] > summary { border-bottom:1px solid var(--border); }
.mim-gov-sum-label { flex:1 1 auto; }
.mim-gov-sum-count { font-family:var(--font-mono); font-size:11px; font-weight:500; color:var(--text-muted); flex:0 0 auto; }
.mim-gov-details > :not(summary) { margin-left:18px; margin-right:18px; }
.mim-gov-details > :nth-child(2) { margin-top:16px; }
.mim-gov-details > :last-child { margin-bottom:18px; }
.mim-gov-self-line { font-size:15px; color:var(--accent-text); line-height:1.55; }
.mim-gov-note-sp { margin-top:20px !important; }

.mim-gov-dims { display:grid; gap:10px; }
.mim-gov-dim { background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--elev-1); }
.mim-gov-dim-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mim-gov-dim-name { font-family:var(--font-display); font-size:15.5px; font-weight:600; color:var(--text); }
.mim-gov-dim-aim { font-size:13.5px; color:var(--text-secondary); line-height:1.55; margin:7px 0 0; }
.mim-gov-gaps { margin:9px 0 0; padding:0 0 0 18px; }
.mim-gov-gaps li { font-size:13px; color:var(--text-muted); line-height:1.5; margin:3px 0; }

.mim-gov-prove-out { margin-top:18px; display:grid; gap:9px; text-align:left; }
.mim-gov-trial { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--surface); animation:mim-gov-in .22s cubic-bezier(.2,0,0,1); }
.mim-gov-trial.is-good { border-color:rgba(63,212,150,.4); }
.mim-gov-trial.is-bad { border-color:var(--red-text); background:var(--red-subtle); }
.mim-gov-trial-ic { font-size:17px; line-height:1.3; flex:0 0 auto; }
.mim-gov-trial.is-good .mim-gov-trial-ic { color:var(--green-text); }
.mim-gov-trial-body { font-size:14px; color:var(--text); line-height:1.5; }
.mim-gov-trial-kind { color:var(--text-muted); font-size:12.5px; }
.mim-gov-trial-verdict { color:var(--text-secondary); font-size:13.5px; }
.mim-gov-trial-sum { font-size:13.5px; color:var(--accent-text); line-height:1.6; margin:4px 2px 0; font-style:italic; }
.mim-gov-trial-sum b { font-style:normal; color:var(--text); font-weight:600; }
.mim-gov-sum-sub { display:block; margin-top:5px; font-size:12.5px; font-style:normal; color:var(--text-muted); line-height:1.55; }
@keyframes mim-gov-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.mim-gov-count { font-family:var(--font-mono); font-size:11px; font-weight:500; text-transform:none; letter-spacing:0; color:var(--green-text); margin-left:8px; }
.mim-gov-note { font-size:13.5px; color:var(--text-muted); line-height:1.6; margin:0 0 13px; max-width:72ch; }
.mim-gov-conds { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:10px; }
.mim-gov-cond { background:var(--surface-raised); border:1px solid var(--border); border-left:3px solid var(--border-strong); border-radius:var(--radius); padding:13px 15px; box-shadow:var(--elev-1); }
.mim-gov-cond-built { border-left-color:var(--green); }
.mim-gov-cond-partial { border-left-color:var(--amber); }
.mim-gov-cond-gap { border-left-color:var(--red); }
.mim-gov-cond-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.mim-gov-cond-name { font-size:14.5px; font-weight:600; color:var(--text); line-height:1.3; }
.mim-gov-cond-plain { font-size:13px; color:var(--text-muted); line-height:1.55; margin:8px 0 0; }

.mim-gov-backlog { display:grid; gap:9px; }
.mim-gov-bl-item { background:var(--surface-raised); border:1px solid var(--border); border-radius:var(--radius); padding:13px 15px; box-shadow:var(--elev-1); }
.mim-gov-bl-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mim-gov-bl-title { font-size:14.5px; font-weight:600; color:var(--text); line-height:1.35; }
.mim-gov-bl-why { font-size:13px; color:var(--text-muted); line-height:1.55; margin:6px 0 0; }
.mim-gov-bl-tag { font-family:var(--font-mono); font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:.07em; padding:4px 9px; border-radius:7px; white-space:nowrap; flex:0 0 auto; color:var(--amber-text); background:var(--amber-subtle); border:1px solid var(--amber-line); }
.mim-gov-bl-tag-ok { color:var(--green-text); background:rgba(63,212,150,.12); border-color:rgba(63,212,150,.34); }

/* ── Assistant-first shell: collapsed "More" nav group + conversation-first Home ── */
.mim-nav-more { margin-top:2px; }
.mim-nav-more > summary { list-style:none; }
.mim-nav-more > summary::-webkit-details-marker { display:none; }
.mim-nav-more-sum { cursor:pointer; }
.mim-nav-more-lbl { flex:1 1 auto; }
.mim-nav-more-chev { color:var(--text-faint); font-size:13px; transition:transform .18s; flex:0 0 auto; }
.mim-nav-more[open] .mim-nav-more-chev { transform:rotate(180deg); }
.mim-nav-more-items { margin-top:2px; display:flex; flex-direction:column; gap:2px; }
.mim-side-foot .mim-nav-item { margin-bottom:12px; }

.mim-home2 { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:74vh; text-align:center; padding:40px 24px; }
.mim-home2-center { width:100%; max-width:620px; }
.mim-home2-h { font-family:var(--font-display); font-size:clamp(26px, 4vw, 37px); font-weight:600; letter-spacing:-.02em; line-height:1.16; color:var(--text); margin:10px 0 28px; }
.mim-ask-lg .mim-ask-input { font-size:17px; padding:18px 20px; }
.mim-home2-chips { display:flex; flex-wrap:wrap; gap:9px; justify-content:center; margin-top:18px; }
.mim-home2-status { margin-top:30px; font-size:13px; line-height:1.5; }
.mim-home2-calm { color:var(--text-muted); }
.mim-home2-alert { color:var(--amber-text); text-decoration:none; font-weight:500; }
.mim-home2-alert:hover { text-decoration:underline; }

/* THE GASP — Mimesis recalls you before you type. Real memory, played back live. */
.mim-recall { margin:4px auto 24px; max-width:560px; text-align:left; }
.mim-recall-lead { display:flex; align-items:center; gap:9px; font-family:var(--font-mono); font-size:11.5px; letter-spacing:.04em; color:var(--accent-text); text-transform:lowercase; margin:0 0 12px; }
.mim-recall-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); animation:mim-pulse 1.9s infinite; flex:0 0 auto; }
.mim-recall-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.mim-recall-fact { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 15px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface-raised); box-shadow:var(--elev-1);
  opacity:0; transform:translateY(8px); transition:opacity .18s cubic-bezier(.2,0,0,1), transform .18s cubic-bezier(.2,0,0,1); }
.mim-recall-fact.is-in { opacity:1; transform:none; }
.mim-recall-fact-t { color:var(--text); font-size:14.5px; line-height:1.45; }
.mim-recall-tag { font-family:var(--font-mono); font-size:10px; letter-spacing:.02em; text-transform:lowercase; color:var(--text-faint); white-space:nowrap; flex:0 0 auto; padding:3px 9px; border-radius:20px; border:1px solid var(--border-light); }
.mim-recall-tag-obs { color:var(--accent-text); border-color:var(--accent-line); }
.mim-recall-teach { display:flex; gap:9px; margin:0 0 9px; }
.mim-recall-teach .mim-ask-input { flex:1 1 auto; font-size:14.5px; padding:12px 15px; }
.mim-recall-hint { font-size:12.5px; color:var(--text-muted); line-height:1.5; margin:0 0 12px; }
@media (prefers-reduced-motion: reduce) { .mim-recall-fact { transition:none; opacity:1; transform:none; } .mim-recall-dot { animation:none; } }

@media (max-width:640px) { .mim-app { padding:0 16px; } .mim-b { max-width:90%; } .mim-wordmark { font-size:22px; } .mim-gov-conds { grid-template-columns:1fr; } }
@media (prefers-reduced-motion: reduce) {
  .mim-typing span { animation:none; }
  .mim-gov-trial { animation:none; }
  .mim-panel { animation:none; }
  .mim-chatview { transition:none; }
  .mim-chip, .mim-send, .mim-input, .mim-toast, .mim-auth-btn, .mim-auth-input, .mim-gate-btn, .mim-gate-redirect-input { transition:none !important; }
  .mim-trace-chev, .mim-tr-explore { transition:none !important; }
}

/* ══ reasoning trace — the governed deliberation, REFERENCED not narrowed (cyan = the governed layer) ══
   The reply converges to one recommendation; this keeps the territory it crossed open to pull on.
   Collapsed by default (calm first); expands to approaches weighed + the critique + what it carried. */
.mim-trace { margin:9px 0 2px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); overflow:hidden; }
.mim-trace[open] { border-color:var(--accent-line); }
.mim-trace-sum { display:flex; align-items:center; gap:9px; padding:8px 11px; cursor:pointer; list-style:none; font-family:var(--font-mono); font-size:11.5px; color:var(--text-muted); -webkit-user-select:none; user-select:none; }
.mim-trace-sum::-webkit-details-marker { display:none; }
.mim-trace-sum:hover { color:var(--accent-text); }
.mim-trace-sum:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; border-radius:var(--radius-xs); }
.mim-trace-glyph { flex:0 0 auto; width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 8px var(--accent-line); }
.mim-trace-sumtxt { flex:1 1 auto; letter-spacing:.01em; }
.mim-trace-chev { flex:0 0 auto; opacity:.7; transition:transform .16s; }
.mim-trace[open] .mim-trace-chev { transform:rotate(180deg); }
.mim-trace-body { padding:3px 12px 13px; border-top:1px solid var(--border-light); }
.mim-tr-sec { margin-top:13px; }
.mim-tr-sec-h { font-family:var(--font-mono); font-size:10.5px; letter-spacing:.11em; text-transform:uppercase; color:var(--accent-text); opacity:.85; margin-bottom:7px; }
.mim-tr-line { font-size:13px; line-height:1.5; color:var(--text-secondary); margin:0; }
.mim-tr-ok { color:var(--green-text); font-weight:600; margin-right:3px; }
.mim-tr-mem { color:var(--text-muted); font-size:12.5px; }
.mim-tr-appr { padding:9px 11px; border:1px solid var(--border); border-radius:var(--radius-xs); margin-bottom:7px; background:var(--surface-raised); }
.mim-tr-appr.is-chosen { border-color:var(--accent-line); background:linear-gradient(160deg, rgba(53,214,255,.06), var(--surface-raised)); }
.mim-tr-appr-top { display:flex; align-items:center; gap:8px; }
.mim-tr-lbl { font-family:var(--font-display); font-size:13px; font-weight:600; color:var(--text); }
.mim-tr-chose { font-family:var(--font-mono); font-size:10px; text-transform:uppercase; letter-spacing:.07em; font-weight:600; color:#06131b; background:var(--accent); padding:2px 7px; border-radius:20px; }
.mim-tr-spacer { flex:1 1 auto; }
.mim-tr-bar { width:70px; height:5px; border-radius:3px; background:var(--border-strong); overflow:hidden; }
.mim-tr-bar-fill { display:block; height:100%; background:linear-gradient(90deg,var(--accent-dim),var(--accent)); }
.mim-tr-score { font-family:var(--font-mono); font-size:11px; color:var(--accent-text); min-width:20px; text-align:right; }
.mim-tr-why { font-size:12.5px; line-height:1.5; color:var(--text-muted); margin:7px 0 0; }
.mim-tr-read { margin-top:8px; }
.mim-tr-read > summary { font-family:var(--font-mono); font-size:11px; color:var(--accent-text); cursor:pointer; list-style:none; opacity:.9; }
.mim-tr-read > summary:hover { opacity:1; }
.mim-tr-read > summary::-webkit-details-marker { display:none; }
.mim-tr-read-body { margin-top:8px; padding:9px 12px; border-left:2px solid var(--accent-line); background:var(--bg-canvas); border-radius:0 var(--radius-xs) var(--radius-xs) 0; font-size:13px; }
.mim-tr-read-body .mim-p:first-child { margin-top:0; }
.mim-tr-explore { margin-top:10px; font-family:var(--font-body); font-size:12.5px; font-weight:600; color:var(--accent-text); background:var(--accent-subtle); border:1px solid var(--accent-line); border-radius:var(--radius-xs); padding:6px 11px; cursor:pointer; transition:background .14s, border-color .14s; }
.mim-tr-explore:hover { background:rgba(53,214,255,.16); border-color:var(--accent-dim); }
.mim-tr-finds { margin:0; padding-left:18px; font-size:12.5px; line-height:1.55; color:var(--text-secondary); }
.mim-tr-finds b { color:var(--text); font-weight:600; }
