:root {
  --mv-bg: #0d0e11;
  --mv-panel: #14151b;
  --mv-panel2: #1a1b23;
  --mv-line: #282a33;
  --mv-line2: #353743;
  --mv-ink: #ecebe7;
  --mv-ink2: #c4c2c8;
  --mv-mut: #8f8e97;
  --mv-rose: #c48b83;
  --mv-violet: #b781e7;
  --mv-glow: rgba(183, 129, 231, .22);
  --mv-avsize: clamp(124px, 16vh, 176px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body[data-team-role="spark"] {
  --mv-rose: #e76fae;
  --mv-violet: #e76fae;
  --mv-glow: rgba(231, 111, 174, .22);
}
body[data-team-role="ledger"] {
  --mv-rose: #57d7a4;
  --mv-violet: #57d7a4;
  --mv-glow: rgba(87, 215, 164, .2);
}
body[data-team-role="riff"] {
  --mv-rose: #b7f24b;
  --mv-violet: #ff4fa3;
  --mv-glow: rgba(183, 242, 75, .18);
}
body[data-team-role="sentry"] {
  --mv-rose: #46d5d0;
  --mv-violet: #46d5d0;
  --mv-glow: rgba(70, 213, 208, .18);
}
/* Roam's approved portrait is emerald with champagne-gold trim, so his accents
   follow the artwork rather than the retired copper brief. */
body[data-team-role="roam"] {
  --mv-rose: #2fc26e;
  --mv-violet: #d8bd7c;
  --mv-glow: rgba(47, 194, 110, .2);
}

body {
  overflow: hidden;
  background: radial-gradient(1200px 700px at 72% 12%, #191322 0%, var(--mv-bg) 55%);
  color: var(--mv-ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--mv-rose); }

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

.mv-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  height: var(--mvh, 100dvh);
}

/* The scrim is only a mobile drawer layer. Keeping it out of layout at desktop
   prevents a stale open-drawer state (for example after a resize or rotation)
   from taking a grid cell and pushing the conversation below the sidebar. */
.mv-scrim { display: none; }

/* ---------- sidebar ---------- */
.mv-side {
  display: flex;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  gap: 10px;
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  border-right: 1px solid var(--mv-line);
  background: rgba(16, 17, 22, .92);
  backdrop-filter: blur(14px);
  z-index: 40;
}

.mv-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  color: var(--mv-mut);
  font-size: 12.5px;
  text-decoration: none;
}
.mv-brand:hover { color: var(--mv-ink); }

.mv-id {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--mv-line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(183, 129, 231, .12), rgba(196, 139, 131, .06));
}

.mv-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, rgba(183, 129, 231, .24), #17121f 68%);
  color: #f3e8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
}
.mv-avatar img { width: 100%; height: 100%; object-fit: contain; }
.mv-avatar span { padding: 4px; text-align: center; }

/* The sidebar roster is the team's navigation, not decoration. Each role has a
   distinct approved accent and its own badge; the active role is unmistakable. */
.mv-team { display: grid; gap: 4px; margin: 2px 0 0; }
.mv-team button {
  --role: #b781e7;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 6px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--mv-ink2);
  text-align: left;
}
.mv-team button[data-role="spark"] { --role: #e76fae; }
.mv-team button[data-role="ledger"] { --role: #57d7a4; }
.mv-team button[data-role="riff"] { --role: #b7f24b; }
.mv-team button[data-role="sentry"] { --role: #46d5d0; }
.mv-team button[data-role="roam"] { --role: #2fc26e; }
.mv-team button:hover { border-color: color-mix(in srgb, var(--role) 38%, transparent); background: rgba(255, 255, 255, .035); }
.mv-team button.active {
  border-color: color-mix(in srgb, var(--role) 52%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--role) 17%, transparent), transparent 85%);
  color: #fff;
}
.mv-team .mv-roleicon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--role) 55%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--role) 12%, transparent);
  color: var(--role);
  font-size: 14px;
  font-weight: 800;
}
.mv-team .mv-roletext { min-width: 0; }
.mv-team .mv-roletext strong { display: block; overflow: hidden; font-size: 12.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.mv-team .mv-roletext small { display: block; overflow: hidden; color: var(--mv-mut); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mv-team .mv-roledot { width: 6px; height: 6px; border-radius: 50%; background: var(--role); box-shadow: 0 0 8px color-mix(in srgb, var(--role) 70%, transparent); }
.mv-team .mv-roledot.working { animation: mv-role-pulse 1.2s ease-in-out infinite; }
@keyframes mv-role-pulse { 50% { opacity: .35; transform: scale(.72); } }

/* A second, always-visible roster on compact screens. The desktop roster lives
   in the sidebar; below 900px that sidebar is a drawer, so this bar makes all
   three roles discoverable without knowing to open the menu first. */
.mv-quickteam { display: none; }
@media (max-width: 900px) {
  .mv-quickteam {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--mv-line);
    background: rgba(13, 14, 17, .92);
  }
  .mv-quickteam button {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 6px;
    padding: 5px 7px;
    border-color: var(--mv-line);
    background: var(--mv-panel);
    border-radius: 9px;
  }
  .mv-quickteam .mv-roledot { display: none; }
  .mv-quickteam .mv-roletext small { display: none; }
  .mv-quickteam .mv-roletext strong { font-size: 11.5px; }
  .mv-quickteam .mv-roleicon { width: 22px; height: 22px; font-size: 11px; }
}

.mv-idtext { min-width: 0; }
.mv-idtext h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.2px;
}
.mv-idtext p {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--mv-mut);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv-new {
  padding: 10px 12px;
  border: 1px solid var(--mv-line2);
  border-radius: 11px;
  background: var(--mv-panel2);
  color: var(--mv-ink);
  text-align: left;
}
.mv-new:hover { border-color: var(--mv-rose); }

.mv-label {
  margin: 8px 6px 0;
  color: var(--mv-mut);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2px;
}

.mv-convs {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 2px;
}

.mv-conv {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--mv-ink2);
  text-align: left;
}
.mv-conv strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mv-conv small { color: var(--mv-mut); font-size: 10.5px; }
.mv-conv:hover { background: var(--mv-panel2); color: var(--mv-ink); }
.mv-conv.active {
  border-color: rgba(196, 139, 131, .32);
  background: linear-gradient(90deg, rgba(183, 129, 231, .13), transparent 80%), var(--mv-panel2);
  color: #fff;
}
.mv-empty { margin: 4px 8px; color: var(--mv-mut); font-size: 12px; }

.mv-sideactions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--mv-line);
}
.mv-sideactions button {
  padding: 7px 4px;
  border: 1px solid var(--mv-line);
  border-radius: 8px;
  background: var(--mv-panel);
  color: var(--mv-ink2);
  font-size: 11px;
}
.mv-sideactions button:hover { border-color: var(--mv-rose); color: #fff; }

.mv-foot {
  margin: 4px 2px 0;
  color: #6e6d76;
  font-size: 10.5px;
  line-height: 1.45;
}

/* ---------- main ---------- */
.mv-main {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.mv-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--mv-line);
  background: rgba(13, 14, 17, .82);
  backdrop-filter: blur(12px);
}

.mv-title { min-width: 0; flex: 1; }
.mv-title strong { display: block; font-size: 15px; letter-spacing: -.2px; }
.mv-title span { display: block; color: var(--mv-mut); font-size: 11px; }

.mv-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--mv-line);
  border-radius: 10px;
  background: var(--mv-panel);
  color: var(--mv-ink2);
  font-size: 17px;
}
.mv-icon:hover { border-color: var(--mv-rose); color: #fff; }
/* Sentry's live collector state, straight from /api/sentry-status. */
#mvsentrystate { margin: 3px 0 0; font-size: 12px; color: var(--mv-ink2); }
#mvsentrystate.mv-live { color: #46d5d0; }
#mvsentrystate.mv-stale { color: #f0b45e; }
#mvatlasstate { margin: 3px 0 0; font-size: 12px; color: var(--mv-ink2); }
#mvatlasstate.mv-live { color: #46d5d0; }
#mvatlasstate.mv-stale { color: #f0b45e; }
/* Atlas paper-order proposal: the five fields the owner approves, plus thumb-sized
   controls. 48px minimum height and 16px text so iOS does not zoom on focus and a
   real tap lands; the buttons are hidden once the decision has been sent. */
.mv-paper {
  max-width: min(560px, 100%);
  margin: 8px 0 2px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-left: 3px solid #6f8cff;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}
.mv-paperhead { margin: 0 0 10px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #9fb0ff; }
.mv-paperrows { margin: 0; display: grid; gap: 6px; }
.mv-paperrows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mv-paperrows dt { margin: 0; font-size: 13px; color: var(--mv-ink2, #a7adba); }
.mv-paperrows dd { margin: 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mv-paperwhy { margin: 10px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--mv-ink2, #a7adba); }
.mv-paperstatus { margin: 10px 0 0; font-size: 13px; line-height: 1.45; white-space: pre-line; }
.mv-paperstatus:empty { display: none; }
.mv-paperactions { display: grid; gap: 8px; margin-top: 12px; }
.mv-paperactions[hidden] { display: none; }
.mv-paperactions button {
  min-height: 48px;
  width: 100%;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mv-paperapprove { border: 0; background: #6f8cff; color: #0b0c10; }
.mv-paperdismiss { border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: var(--mv-ink, #eef0f5); }
.mv-paperactions button:disabled { opacity: .55; cursor: default; }
@media (min-width: 520px) { .mv-paperactions { grid-template-columns: 1fr 1fr; } }
.mv-paperlabel { display: inline-block; margin: 10px 0 0; font-size: 10.5px; letter-spacing: .12em; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); }
.mv-paperlabel.hypo { border-color: rgba(230,180,95,.6); color: #e6b45f; }
.mv-paperlabel.paper { border-color: rgba(87,215,164,.6); color: #57d7a4; }
.mv-paperevidence { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--mv-ink2, #a7adba); }
.mv-paperweak { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: #e6b45f; }
.mv-papersources { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--mv-ink2, #a7adba); }
.mv-papersources a { color: #9fb0ff; }

/* Atlas's research desk: limits, the scan schedule and the result inbox. */
.mv-atlasdesk { max-width: 900px; }
.atlas-desk { display: grid; gap: 14px; }
/* The desk can be much taller than one viewport once an idea carries its tested
   rule, comparable events and metrics. It scrolls inside the app shell instead of
   being clipped by the fixed-height main column, and the chat log yields room. */
.mv-atlasdesk:not([hidden]) { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.mv-main:has(.mv-atlasdesk:not([hidden])) .mv-log { flex: 0 1 auto; max-height: 30%; }
/* The research desk and the chat are independent panels. Each header is a control
   with a labelled Expand/Collapse button, and the panel that stays open takes the
   height the collapsed one gives up. Both open and both collapsed are allowed. */
.atlas-panelhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 20px;
  border-bottom: 1px solid var(--mv-line);
  background: var(--mv-panel);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.atlas-panelhead:focus-visible { outline: 2px solid #6f8cff; outline-offset: -2px; }
.atlas-panelhead h2 { margin: 0; font-size: 16px; font-weight: 600; }
.atlas-panelhead .atlas-kicker { margin: 0 0 2px; }
.atlas-paneltitles { min-width: 0; }
.atlas-panelend { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.atlas-panel-toggle {
  border: 1px solid var(--mv-line);
  border-radius: 999px;
  padding: 5px 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  min-height: 32px;
  cursor: pointer;
}
.atlas-panel-toggle:hover { border-color: #6f8cff; }
.atlas-panel-arrow { font-size: 11px; opacity: .7; }
.atlas-chathead { padding: 8px 20px; }
.atlas-chathead h2 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.atlas-panelhead.closed { border-bottom-color: transparent; }
/* A collapsed panel gives its height to the other one. */
.mv-atlasdesk.atlas-collapsed { display: none !important; }
.mv-main.mv-main.atlas-research-closed .mv-log { flex: 1 1 auto; max-height: none; }
.mv-main.atlas-chat-closed .mv-log,
.mv-main.atlas-chat-closed .mv-suggestions,
.mv-main.atlas-chat-closed .mv-composer { display: none !important; }
@media (max-width: 600px) {
  .atlas-panelhead { padding: 8px 12px; gap: 8px; }
  .atlas-panelhead h2 { font-size: 15px; }
  .atlas-chathead { padding: 6px 12px; }
  .atlas-chathead h2 { font-size: 11px; }
  /* A phone leaves the two panels one short column, so with both open they share
     it evenly instead of the chat taking most of it. Collapsing either one still
     gives the other the whole column. */
  .mv-main:has(.mv-atlasdesk:not([hidden])):not(.atlas-research-closed):not(.atlas-chat-closed) .mv-log {
    flex: 1 1 0;
    max-height: 50%;
  }
  .mv-main:has(.mv-atlasdesk:not([hidden])):not(.atlas-research-closed) .mv-atlasdesk { flex: 1 1 0; }
}
.atlas-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.atlas-kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .64; }
.atlas-head h2 { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.atlas-unread { border: 0; border-radius: 999px; padding: 5px 11px; background: #6f8cff; color: #0b0c10; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.atlas-status { margin: 0; font-size: 12.5px; line-height: 1.5; opacity: .82; }
.atlas-status.bad { color: #e6b45f; opacity: 1; }
.atlas-settings { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.atlas-settings label { display: grid; gap: 4px; font-size: 11px; letter-spacing: .02em; flex: 1 1 150px; min-width: 130px; }
.atlas-settings input { padding: 8px 9px; border-radius: 9px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.24); color: inherit; font: inherit; font-size: 14px; min-width: 0; }
.atlas-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.atlas-actions button { border-radius: 9px; padding: 9px 13px; font: inherit; font-size: 13px; cursor: pointer; min-height: 40px; }
.atlas-primary { border: 0; background: #6f8cff; color: #0b0c10; font-weight: 600; }
.atlas-secondary { border: 1px solid rgba(111,140,255,.65); background: rgba(111,140,255,.14); color: inherit; }
.atlas-quiet { border: 1px solid rgba(255,255,255,.18); background: transparent; color: inherit; }
.atlas-actions button:disabled { opacity: .55; cursor: default; }
.atlas-note { margin: 0; font-size: 12.5px; line-height: 1.5; opacity: .78; }
.atlas-note.bad, .atlas-error { color: #e9a1a1; opacity: 1; }
.atlas-failure { display: grid; gap: 6px; padding: 10px 11px; border: 1px dashed rgba(233,161,161,.45); border-radius: 11px; background: rgba(233,161,161,.06); }
.atlas-failurecode { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.atlas-failurecode .atlas-chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.atlas-failuremeta { margin: 0; font-size: 11.5px; line-height: 1.45; opacity: .66; }
.atlas-inbox { display: grid; gap: 12px; }
.atlas-empty { margin: 0; font-size: 12.5px; opacity: .6; }
.atlas-result { border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px; display: grid; gap: 8px; background: rgba(0,0,0,.16); }
.atlas-resulthead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.atlas-chip { display: inline-block; font-size: 10px; letter-spacing: .12em; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); }
.atlas-chip.historical { border-color: rgba(159,176,255,.6); color: #9fb0ff; }
.atlas-chip.error { border-color: rgba(233,161,161,.6); color: #e9a1a1; }
.atlas-chip.hypo { border-color: rgba(230,180,95,.6); color: #e6b45f; }
.atlas-chip.paper { border-color: rgba(87,215,164,.6); color: #57d7a4; }
.atlas-when { font-size: 11.5px; opacity: .66; }
.atlas-idea { margin: 0; font-size: 15px; }
.atlas-why { margin: 0; font-size: 13px; line-height: 1.5; }
.atlas-skip { margin: 0; font-size: 13px; line-height: 1.5; color: #e6b45f; }
.atlas-metrics { margin: 0; display: grid; gap: 5px; }
.atlas-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.atlas-metrics dt { margin: 0; font-size: 12px; color: var(--mv-ink2, #a7adba); }
.atlas-metrics dd { margin: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.atlas-evidence, .atlas-backtest, .atlas-sources { border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; display: grid; gap: 6px; }
.atlas-verdict { margin: 0; font-size: 11px; letter-spacing: .12em; }
.atlas-verdict.weak { color: #e6b45f; }
.atlas-verdict.mixed { color: #d9c48a; }
.atlas-verdict.supportive { color: #a9d6b8; }
.atlas-subhead { margin: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .62; }
.atlas-sources ul, .atlas-trades { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.atlas-sources li, .atlas-trades li { font-size: 12px; line-height: 1.45; }
.atlas-sources a { color: #9fb0ff; }
.atlas-sources span { opacity: .66; }
.atlas-forward { margin: 0; font-size: 12px; line-height: 1.5; }
.atlas-card .mv-paper { margin: 0; max-width: none; }
/* What the historical trial tested: the rule, the comparable events and the
   separate price-rule note each get their own space, so an event idea can never
   read its price replay as proof the event repeats. */
.atlas-historical { border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; display: grid; gap: 6px; }
.atlas-trial-title { margin: 0; font-size: 13px; font-weight: 600; }
.atlas-rule { margin: 0; font-size: 12px; line-height: 1.5; color: var(--mv-ink2, #a7adba); overflow-wrap: anywhere; }
.atlas-insufficient { margin: 0; font-size: 13px; line-height: 1.5; font-weight: 600; color: #e6b45f; }
.atlas-pricerule { display: grid; gap: 6px; margin-top: 4px; padding: 9px 10px; border: 1px dashed rgba(230,180,95,.45); border-radius: 10px; }
.atlas-pricerule .atlas-chip { color: #e6b45f; border-color: rgba(230,180,95,.5); }
.atlas-events { display: grid; gap: 4px; }
.atlas-events a { color: #9fb0ff; }
.atlas-proposalstate { margin: 0; font-size: 12px; line-height: 1.5; color: #e6b45f; }
.mv-paperhistory { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--mv-ink2, #a7adba); overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .atlas-result { padding: 11px; }
  .atlas-metrics > div { flex-direction: column; gap: 1px; }
  .atlas-metrics dd { text-align: left; }
  .atlas-resulthead { align-items: flex-start; }
}
.mv-menu { display: none; }

/* The companion dock lives in the flow above the composer: it cannot cover
   messages, typing controls, or the mobile navigation drawer. */
/* The companion is a backdrop, not a column: it sits BEHIND the conversation in
   the lower-right of the message area. As a flex item it claimed a full row
   above the composer, so every message lost that height and the input box was
   pushed down for a character nobody could read over. Out of flow it reserves
   no space at all — .mv-log (z-index 1) and .mv-composer (z-index 3) both paint
   above it, and pointer-events stay off so no control is ever blocked. */
.mv-stage {
  position: absolute;
  z-index: 0;
  right: -1%;
  bottom: 158px;
  display: grid;
  width: min(38vw, 300px);
  height: auto;
  aspect-ratio: 3 / 4;
  margin: 0;
  place-items: center;
  pointer-events: none;
  user-select: none;
  opacity: .17;
  transition: opacity .25s ease;
}
.mv-stage[data-look="full"] { opacity: 1; }
.mv-stage[hidden] { display: none; }
.mv-resulttext {
  max-height: 18rem;
  overflow: auto;
  margin: 4px 0;
  padding: 9px 10px;
  border: 1px solid var(--mv-line);
  border-radius: 9px;
  background: rgba(0, 0, 0, .22);
  color: var(--mv-ink2);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mv-stage::before {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mv-glow) 0%, rgba(196, 139, 131, .07) 42%, transparent 70%);
  content: "";
  filter: blur(8px);
}
.mv-stage mini-vyxin {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 32px rgba(183, 129, 231, .22));
}
.mv-stage mini-vyxin[hidden] { display: none; }
.mv-idlepreview {
  display: block;
  width: 100%;
  max-width: 320px;
  object-fit: contain;
  aspect-ratio: 1;
  margin-top: 10px;
  border: 1px solid var(--mv-line);
  border-radius: 12px;
  background: #0d0e11;
}
.mv-idlepreview::backdrop { background: #0d0e11; }

.mv-log {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 6px;
  scroll-behavior: smooth;
}

.mv-row {
  display: flex;
  margin: 0 auto 14px;
  max-width: 860px;
}
.mv-row.user { justify-content: flex-end; }

.mv-bubble {
  max-width: min(82%, 720px);
  padding: 11px 14px;
  border: 1px solid var(--mv-line);
  border-radius: 15px;
  background: rgba(20, 21, 27, .88);
  overflow-wrap: anywhere;
  backdrop-filter: blur(8px);
}
.mv-row.user .mv-bubble {
  border-color: rgba(196, 139, 131, .28);
  border-bottom-right-radius: 5px;
  background: rgba(48, 34, 40, .9);
}
.mv-row.assistant .mv-bubble { border-bottom-left-radius: 5px; }

.mv-author {
  display: block;
  margin-bottom: 3px;
  color: var(--mv-mut);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}
.mv-bubble p { margin: 0 0 8px; }
.mv-bubble p:last-child { margin-bottom: 0; }
.mv-bubble h4 { margin: 10px 0 4px; font-size: 14.5px; }
.mv-bubble ul { margin: 4px 0 8px; padding-left: 20px; }
.mv-bubble code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #24242c;
  font: 12.5px/1.4 ui-monospace, Consolas, monospace;
}
.mv-bubble pre {
  overflow: auto;
  padding: 9px;
  border: 1px solid var(--mv-line);
  border-radius: 8px;
  background: #101117;
}
.mv-bubble a { color: #d9a6f2; }

.mv-caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 2px;
  background: var(--mv-rose);
  vertical-align: -2px;
  animation: mv-blink 1s steps(2, start) infinite;
}
@keyframes mv-blink { 50% { opacity: 0; } }

.mv-note {
  margin: 6px 0 0;
  color: var(--mv-mut);
  font-size: 11.5px;
}

.mv-suggestions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 8px;
}
.mv-suggestions button {
  padding: 6px 10px;
  border: 1px solid var(--mv-line2);
  border-radius: 999px;
  background: rgba(20, 21, 27, .9);
  color: var(--mv-ink2);
  font-size: 12px;
}
.mv-suggestions button:hover { border-color: var(--mv-rose); color: #fff; }

.mv-composer {
  position: relative;
  z-index: 3;
  padding: 8px 20px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--mv-bg) 72%, transparent);
}

.mv-toolrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 860px;
  margin: 0 auto 6px;
}
.mv-toolrow button[hidden] { display: none; }
.mv-toolrow #mvstop { border-color: rgba(224, 111, 125, .55); color: #f0c0c5; }
.mv-toolrow #mvplay { border-color: rgba(183, 129, 231, .65); color: #e2c8f8; }
.mv-toolrow button, .mv-toolrow select {
  padding: 5px 9px;
  border: 1px solid var(--mv-line);
  border-radius: 999px;
  background: var(--mv-panel);
  color: var(--mv-ink2);
  font-size: 11.5px;
}
.mv-toolrow button.on, .mv-toolrow button[aria-pressed="true"] {
  border-color: rgba(183, 129, 231, .6);
  background: rgba(183, 129, 231, .16);
  color: #fff;
}
.mv-hint {
  margin-left: auto;
  overflow: hidden;
  color: #6e6d76;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv-inputrow {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 860px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid var(--mv-line2);
  border-radius: 15px;
  background: rgba(20, 21, 27, .95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
.mv-inputrow:focus-within { border-color: rgba(196, 139, 131, .55); }

.mv-inputrow textarea {
  min-height: 44px;
  max-height: 180px;
  flex: 1;
  resize: none;
  padding: 10px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mv-ink);
  font-size: 15px;
}
.mv-inputrow textarea::placeholder { color: #74737c; }

.mv-round, .mv-send {
  display: grid;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}
.mv-round {
  width: 40px;
  border: 1px solid var(--mv-line2);
  background: var(--mv-panel2);
  font-size: 16px;
}
.mv-round.rec { border-color: #e06f7d; background: rgba(224, 111, 125, .18); }
.mv-send {
  min-width: 64px;
  padding: 0 13px;
  border: 1px solid rgba(196, 139, 131, .5);
  background: linear-gradient(135deg, #b781e7, #9d6bcf);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}
.mv-send:disabled { cursor: default; opacity: .55; }
/* Roam's primary action follows his approved emerald → champagne-gold palette
   instead of the shared violet, so the button agrees with the portrait. */
body[data-team-role="roam"] .mv-send {
  border-color: rgba(216, 189, 124, .55);
  background: linear-gradient(135deg, #2fc26e, #d8bd7c);
}

.mv-error {
  min-height: 18px;
  margin: 0;
  padding: 2px 20px calc(6px + env(safe-area-inset-bottom));
  color: #e9a1a1;
  font-size: 12px;
  text-align: center;
}

/* ---------- image card ---------- */
.mv-imgcard { max-width: min(88%, 640px); }
.mv-imgcard img.mv-result,
.mv-imgcard video.mv-result {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  border-radius: 10px;
}
/* A clip keeps its own black stage so the controls stay legible over any theme. */
.mv-imgcard video.mv-result { background: #000; max-height: 62vh; object-fit: contain; }
.mv-imgacts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.mv-imgacts button, .mv-imgacts a {
  padding: 6px 11px;
  border: 1px solid var(--mv-line2);
  border-radius: 8px;
  background: var(--mv-panel2);
  color: var(--mv-ink);
  font-size: 12px;
  text-decoration: none;
}
.mv-imgacts .primary { border-color: var(--mv-rose); background: rgba(183, 129, 231, .2); }
.mv-imgprogress { margin: 6px 0 0; color: var(--mv-ink2); font-size: 12px; }
.mv-imgprogress.bad { color: #e9a1a1; }

/* ---------- panel ---------- */
.mv-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  display: flex;
  width: min(440px, 100%);
  height: var(--mvh, 100dvh);
  flex-direction: column;
  border-left: 1px solid var(--mv-line2);
  background: #101116;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .45);
}
.mv-panel[hidden] { display: none; }
.mv-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--mv-line);
}
.mv-panel h2 { margin: 0; font-size: 17px; }
.mv-panel > header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--mv-line);
  border-radius: 9px;
  background: var(--mv-panel);
  font-size: 18px;
}
.mv-panelbody {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.mv-copy { margin: 0 0 14px; color: var(--mv-mut); font-size: 12.5px; }
.mv-form { display: grid; gap: 8px; margin-bottom: 18px; }
.mv-form input[type="text"], .mv-form select, .mv-form textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--mv-line2);
  border-radius: 9px;
  background: var(--mv-panel);
  color: var(--mv-ink);
}
.mv-check { display: flex; align-items: flex-start; gap: 7px; color: var(--mv-ink2); font-size: 12px; }
.mv-form .mv-primary {
  justify-self: start;
  padding: 8px 14px;
  border: 1px solid var(--mv-rose);
  border-radius: 9px;
  background: rgba(183, 129, 231, .18);
  color: #fff;
}
.mv-mem, .mv-task {
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--mv-line);
  border-radius: 10px;
  background: var(--mv-panel);
}
.mv-mem p, .mv-task p { margin: 0 0 6px; font-size: 13px; overflow-wrap: anywhere; }
.mv-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.mv-badge {
  padding: 1px 6px;
  border: 1px solid var(--mv-line2);
  border-radius: 999px;
  color: var(--mv-mut);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .8px;
}
.mv-badge.mini { border-color: rgba(183, 129, 231, .5); color: #d7b6f3; }
.mv-badge.shared { border-color: rgba(196, 139, 131, .5); color: #e7bdb7; }
.mv-badges .st { border-color: rgba(140, 200, 160, .45); color: #a9d6b8; }
.mv-memacts { display: flex; flex-wrap: wrap; gap: 5px; }
.mv-memacts button {
  padding: 4px 8px;
  border: 1px solid var(--mv-line2);
  border-radius: 7px;
  background: transparent;
  color: var(--mv-ink2);
  font-size: 11px;
}
.mv-memacts button:hover { border-color: var(--mv-rose); color: #fff; }
.mv-setting { margin: 0 0 18px; padding: 12px; border: 1px solid var(--mv-line); border-radius: 10px; background: var(--mv-panel); }
.mv-setting h3 { margin: 0 0 6px; font-size: 13.5px; }
.mv-setting p { margin: 6px 0 0; color: var(--mv-mut); font-size: 11.5px; }
.mv-setting .mv-field { margin: 7px 0 0; color: var(--mv-ink2); font-size: 12px; }
.mv-setting .mv-field strong { color: var(--mv-ink); font-weight: 650; }
.mv-idea { margin: 0 0 10px; padding: 11px; border: 1px solid var(--mv-line2); border-radius: 10px; background: var(--mv-panel2); }
.mv-idea h3 { margin: 0 0 4px; font-size: 13.5px; color: #fff; }
.mv-idea .mv-field { margin: 5px 0; color: var(--mv-ink2); font-size: 11.5px; line-height: 1.45; }
.mv-idea .mv-field strong { color: var(--mv-ink); }
.mv-idea .mv-memacts { margin-top: 8px; }
.mv-idea.tasked { border-color: rgba(87, 215, 164, .4); }
.mv-research-item { margin: 0 0 10px; padding: 10px; border: 1px solid var(--mv-line); border-radius: 9px; background: var(--mv-panel); }
.mv-research-item p { margin: 4px 0; font-size: 12px; color: var(--mv-ink2); }
.mv-diag { margin: 10px 0 14px; padding: 10px; border: 1px solid rgba(233, 161, 161, .5); border-radius: 10px; background: rgba(233, 161, 161, .06); }
.mv-diaghead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mv-diaghead strong { color: #fff; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.mv-diagstage { padding: 1px 6px; border: 1px solid rgba(233, 161, 161, .45); border-radius: 999px; color: #f0b8b8; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.mv-diagmeta { margin: 6px 0 0; color: var(--mv-ink2); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.mv-diagmeta strong { color: #fff; }
.mv-diagattempt { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(233, 161, 161, .18); }
.mv-diagrow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.mv-diagrow strong { color: #fff; font-size: 11px; }
.mv-diagpre { max-height: 7.5rem; overflow: auto; margin: 5px 0 0; padding: 7px; border: 1px solid var(--mv-line); border-radius: 6px; background: rgba(0, 0, 0, .25); color: var(--mv-ink2); font: 10.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.mv-research-item .mv-badges { margin-bottom: 6px; }
.mv-source { display: block; overflow: hidden; margin: 4px 0 0; color: #d9a6f2; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.mv-briefing { max-height: 16rem; overflow: auto; margin: 6px 0 0; padding: 9px; border: 1px solid var(--mv-line); border-radius: 8px; background: rgba(0, 0, 0, .22); color: var(--mv-ink2); font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.mv-statusline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; color: var(--mv-mut); font-size: 11.5px; }
.mv-statusline .ok { color: #a9d6b8; }
.mv-statusline .bad { color: #e9a1a1; }
.mv-panel .mv-toolrow { max-width: none; margin: 0 0 14px; flex-wrap: wrap; }
.mv-panel .mv-toolrow button { font-size: 10.5px; padding: 4px 8px; }
.mv-setting label { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 12.5px; }
.mv-setting label.mv-range { display: grid; grid-template-columns: 92px minmax(80px, 1fr) 38px; gap: 8px; }
.mv-setting label.mv-range input { width: 100%; accent-color: var(--mv-rose); }
.mv-rangeval { color: var(--mv-mut); font-size: 11px; text-align: right; }
.mv-audionote { min-height: 16px; color: #a9d6b8 !important; }
.mv-audionote.bad { color: #e9a1a1 !important; }
.mv-audiopreview { margin-top: 10px; }
.mv-audiopreview button { font-size: 11.5px; }
.mv-reduced { color: #e7bdb7; }
.mv-budgethead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mv-budgethead h3 { margin: 0; }
.mv-setting .mv-budgetstat { margin: 8px 0 10px; color: var(--mv-ink2); font-size: 11.5px; line-height: 1.45; }
.mv-budgetremaining { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--mv-line); border-radius: 8px; background: rgba(183, 129, 231, .08); color: var(--mv-ink2); font-size: 11.5px; line-height: 1.45; }
.mv-budgetremaining strong { color: #fff; font-weight: 650; }
.mv-budgetremaining .mv-budgetout { color: #e9a1a1; }
.mv-budgetremaining .mv-budgetout strong { color: inherit; }
.mv-budgetremaining .mv-budgetsep { color: var(--mv-mut); }
.mv-budgetremaining.mv-budgetmuted { color: var(--mv-mut); }
.mv-limitgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.mv-limitgrid label { display: grid; gap: 5px; margin: 0; color: var(--mv-mut); font-size: 10.5px; }
.mv-limitgrid input[type="number"] { width: 100%; box-sizing: border-box; padding: 8px 9px; border: 1px solid var(--mv-line2); border-radius: 8px; background: var(--mv-panel); color: var(--mv-ink); font-size: 12px; }
.mv-setting .mv-primary { justify-self: start; padding: 8px 14px; border: 1px solid var(--mv-rose); border-radius: 9px; background: rgba(183, 129, 231, .18); color: #fff; }
@media (max-width: 480px) { .mv-limitgrid { grid-template-columns: 1fr; } }

/* Spark content studio */
.mv-provenance { margin: 0 0 12px; color: var(--mv-mut); font-size: 10.5px; line-height: 1.45; }
.mv-brandbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.mv-brandbar button { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--mv-line2); border-radius: 9px; background: var(--mv-panel2); color: var(--mv-ink); }
.mv-brandbar button.on { border-color: var(--mv-rose); background: rgba(231, 111, 174, .12); }
.mv-brandbar strong { font-size: 11.5px; }
.mv-brandbar small { color: var(--mv-mut); font-size: 10px; }
.mv-branddot { width: 8px; height: 8px; border-radius: 50%; background: #e7c56b; flex: none; }
.mv-studio-picker { display: grid; gap: 10px; margin: 0 0 14px; }
.mv-studio-picker > select { width: 100%; padding: 8px; border: 1px solid var(--mv-line2); border-radius: 8px; background: var(--mv-panel2); color: #fff; font-size: 12px; }
.mv-studio-new summary { cursor: pointer; color: var(--mv-ink2); font-size: 11.5px; padding: 4px 0; }
.mv-studio-new[open] summary { margin-bottom: 8px; }
.mv-studio-new input, .mv-studio-new textarea, .mv-studio-card textarea { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--mv-line2); border-radius: 8px; background: var(--mv-panel2); color: #fff; font: inherit; font-size: 12px; }
.mv-studio-new textarea, .mv-studio-card textarea { resize: vertical; line-height: 1.45; }
.mv-studio-head { margin: 0 0 12px; padding: 12px; border: 1px solid var(--mv-line2); border-radius: 10px; background: var(--mv-panel); }
.mv-studio-head h3 { margin: 0 0 5px; color: #fff; font-size: 14px; }
.mv-studio-head p { margin: 4px 0 0; }
.mv-stagebar { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 5px; }
.mv-stagebar button { padding: 6px 9px; border: 1px solid var(--mv-line2); border-radius: 8px; background: var(--mv-panel2); color: var(--mv-ink2); font-size: 10.5px; }
.mv-stagebar button:disabled { opacity: .42; }
.mv-stagebar button.done { border-color: rgba(87, 215, 164, .45); color: #bff0dc; }
.mv-stagebar button.mv-primary { padding: 6px 12px; background: rgba(231, 111, 174, .16); color: #fff; }
.mv-studio-head .mv-discard { border-color: rgba(233, 161, 161, .45); color: #e9a1a1; }
.mv-studio-card { margin-bottom: 14px; }
.mv-finding, .mv-hook, .mv-beat, .mv-cal { margin: 8px 0; padding: 9px; border: 1px solid var(--mv-line2); border-radius: 9px; background: var(--mv-panel2); }
.mv-finding p, .mv-hook p, .mv-beat p, .mv-cal p { margin: 5px 0; font-size: 11.5px; line-height: 1.5; color: var(--mv-ink2); }
.mv-finding .mv-source, .mv-hook .mv-source { display: inline-block; margin-top: 3px; word-break: break-all; }
.mv-hook.selected { border-color: var(--mv-rose); }
.mv-hook button { margin-top: 6px; }
.mv-caption { margin: 9px 0; padding: 9px; border-left: 2px solid var(--mv-rose); background: rgba(0, 0, 0, .18); }
.mv-caption strong { display: block; color: var(--mv-mut); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.mv-caption p { margin: 4px 0 0; color: #fff; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.mv-check { margin: 7px 0; padding: 8px 9px; border: 1px solid var(--mv-line2); border-left: 3px solid var(--mv-line2); border-radius: 8px; }
.mv-check.ok { border-left-color: #57d7a4; }
.mv-check.bad { border-left-color: #e06f7d; }
.mv-check strong { color: #fff; font-size: 11.5px; }
.mv-check p { margin: 3px 0 0; }
.mv-conn { margin: 8px 0; padding: 8px 0; border-bottom: 1px solid var(--mv-line); }
.mv-conn:last-child { border-bottom: 0; }
.mv-conn strong { display: block; margin: 4px 0 0; color: #fff; font-size: 11.5px; }
.mv-conn p { margin: 2px 0 0; }
.mv-studio-card > button { margin-top: 3px; }
.mv-cal { border-left: 2px solid rgba(183, 129, 231, .45); }
@media (max-width: 480px) { .mv-brandbar button { flex: 1 1 45%; } .mv-stagebar button { flex: 1 1 30%; } }

@media (max-width: 900px) {
  :root { --mv-avsize: 108px; }
  .mv-shell { grid-template-columns: 1fr; }
  .mv-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 88vw);
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  body.drawer-open .mv-side { transform: translateX(0); }
  .mv-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, .5);
  }
  .mv-scrim:not([hidden]) { display: block; }
  .mv-scrim[hidden] { display: none; }
  .mv-menu { display: grid; }
  .mv-stage { right: 10px; bottom: 152px; opacity: .34; }
  .mv-stage[data-look="full"] { opacity: 1; }
  .mv-log { padding: 16px 12px 4px; }
  .mv-composer { padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
  .mv-bubble { max-width: 90%; }
  .mv-hint { display: none; }
}

@media (max-width: 480px) {
  :root { --mv-avsize: 96px; }
  .mv-stage { right: 8px; bottom: 150px; }
  .mv-toolrow button, .mv-toolrow select { font-size: 11px; padding: 4px 8px; }
  .mv-setting label.mv-range { grid-template-columns: 78px minmax(60px, 1fr) 34px; }
  .mv-inputrow textarea { font-size: 16px; }
  .mv-send { min-width: 54px; padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .mv-stage { transition: none; }
  .mv-caret { animation: none; }
  html { scroll-behavior: auto; }
}

/* Poster editor: fields shown under a generated image */
.mv-poster-edit { display: grid; gap: 8px; margin-top: 10px; max-width: 420px; }
.mv-field { display: grid; gap: 4px; font-size: 12px; letter-spacing: .02em; opacity: .9; }
.mv-field input, .mv-field select { padding: 7px 9px; border-radius: 9px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.22); color: inherit; font: inherit; font-size: 13px; }
.mv-field select option { background: #14101a; color: #fff; }

.mv-researchnote { margin: 4px 0 0; font-size: 11.5px; letter-spacing: .02em; opacity: .72; }

.mv-researchnote.warn { color: #e6b45f; opacity: 1; }

/* Tally's tax desk: profiles, monitoring, planning and team ideas. */
.mv-taxdesk { display: grid; gap: 14px; padding: 4px 12px 18px; max-width: 860px; }
.mv-taxdesk[hidden],
.mv-taxdesk [hidden] { display: none !important; }
.tax-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tax-kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .64; }
.tax-head h2 { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.tax-refresh { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: inherit; border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.tax-status { margin: 0; font-size: 12px; opacity: .8; }
.tax-status.bad, .tax-note.bad { color: #e6b45f; opacity: 1; }
.tax-block { border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px; display: grid; gap: 8px; background: rgba(0,0,0,.16); }
.tax-block h3 { margin: 0; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; opacity: .78; }
.tax-note, .tax-meta { margin: 0; font-size: 12px; opacity: .74; line-height: 1.5; }
.tax-empty { margin: 0; font-size: 12.5px; opacity: .6; }
.tax-form { display: grid; gap: 8px; }
.tax-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.tax-form label { display: grid; gap: 4px; font-size: 11px; letter-spacing: .02em; opacity: .9; min-width: 128px; flex: 1 1 150px; }
.tax-form input, .tax-form select { padding: 7px 9px; border-radius: 9px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.24); color: inherit; font: inherit; font-size: 13px; min-width: 0; }
.tax-form select option { background: #14101a; color: #fff; }
.tax-form label.tax-check { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; }
.tax-form label.tax-check input { width: auto; }
.tax-wide { flex: 1 1 100%; }
.tax-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tax-actions button { border: 1px solid rgba(255,255,255,.2); background: rgba(183,129,231,.18); color: inherit; padding: 7px 12px; border-radius: 9px; font: inherit; font-size: 12.5px; cursor: pointer; }
.tax-profiles { display: grid; gap: 8px; }
.tax-profile { border: 1px solid rgba(255,255,255,.1); border-radius: 11px; padding: 9px 10px; }
.tax-profile h4 { margin: 0 0 2px; font-size: 13px; text-transform: capitalize; }
.tax-pill { display: inline-block; margin: 0; font-size: 10.5px; letter-spacing: .12em; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); }
.tax-pill.active { border-color: rgba(87,215,164,.6); color: #57d7a4; }
.tax-pill.failing { border-color: rgba(230,180,95,.7); color: #e6b45f; }
.tax-pill.stale { border-color: rgba(230,180,95,.5); color: #e6b45f; }
.tax-pill.inactive { opacity: .7; }
.tax-sources, .tax-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tax-sources li, .tax-items li { font-size: 12.5px; border-bottom: 1px solid rgba(255,255,255,.06); padding-bottom: 6px; }
.tax-sources span { opacity: .65; margin-left: 4px; }
.tax-items p { margin: 2px 0 0; }
@media (max-width: 640px) {
  .mv-taxdesk { padding: 4px 12px 16px; }
  .tax-form label { flex: 1 1 100%; }
  .tax-head { flex-direction: column; }
}

/* Tax desk editor, alternatives and Mini's digest. */
.tax-grow { flex: 2 1 260px; }
.tax-form textarea { padding: 7px 9px; border-radius: 9px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.24); color: inherit; font: inherit; font-size: 13px; resize: vertical; }
.tax-form code, .tax-meta code { font-size: 11.5px; background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; }
.tax-mini { border: 1px solid rgba(255,255,255,.18); background: transparent; color: inherit; border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 11.5px; cursor: pointer; align-self: flex-end; }
.tax-estimate { margin: 0; font-size: 12px; opacity: .85; }
.tax-estimate.bad { color: #e6b45f; opacity: 1; }
.tax-src { border: 1px dashed rgba(255,255,255,.16); border-radius: 10px; padding: 9px; margin: 4px 0; display: grid; gap: 6px; }
.tax-src-list { margin: 4px 0 0; padding-left: 16px; font-size: 12px; opacity: .82; display: grid; gap: 4px; }
.tax-src-list span { display: block; opacity: .7; }
.tax-alt { border: 1px solid rgba(230,180,95,.35); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.tax-alt ul { margin: 4px 0 0; padding-left: 16px; font-size: 12px; }
.tax-pill.manual { border-color: rgba(140,190,255,.55); color: #9ec5ff; }
.mv-digest .digest-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.mv-digest .digest-item { border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; }
.mv-digest .digest-item:first-child { border-top: 0; padding-top: 0; }
.mv-digest .digest-head { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 12.5px; }
.mv-digest .digest-kind { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; border: 1px solid rgba(255,255,255,.24); }
.mv-digest .digest-kind.idea, .mv-digest .digest-kind.opportunity { border-color: rgba(183,129,231,.6); color: #c9a7f2; }
.mv-digest .digest-kind.conflict { border-color: rgba(230,120,120,.7); color: #ef9b9b; }
.tax-pill.registered { border-color: rgba(140,190,255,.45); color: #9ec5ff; }

/* Roam's travel and ticket desk. Same container rhythm as the tax desk; the
   state chip is the only place a monitoring word is allowed to appear. */
.mv-roamdesk { display: grid; gap: 14px; padding: 4px 12px 18px; max-width: 900px; }
.mv-roamdesk[hidden], .mv-roamdesk [hidden] { display: none !important; }
.roam-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.roam-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.roam-dim { margin: 0; color: #9a99a3; font-size: 12px; line-height: 1.5; }
.roam-bad { margin: 0; color: #e9a1a1; font-size: 12px; }
.roam-state { flex: 0 0 auto; padding: 5px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.roam-state.live { border-color: rgba(87,215,164,.6); color: #57d7a4; }
.roam-state.bad { border-color: rgba(230,180,95,.7); color: #e6b45f; }
.roam-status { margin: 0; color: #9a99a3; font-size: 12px; }
.roam-status.bad { color: #e6b45f; }
.roam-statusbar { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: #9a99a3; }
.roam-statusbar strong { color: #ecebe7; font-weight: 600; }
.roam-card { border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px; display: grid; gap: 9px; background: rgba(0,0,0,.16); }
.roam-card h3 { margin: 0; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; opacity: .78; }
.roam-card summary { cursor: pointer; font-size: 12.5px; font-weight: 600; }
.roam-warn { border-color: rgba(230,180,95,.45); background: rgba(230,180,95,.06); }
.roam-warn ul { margin: 4px 0; padding-left: 18px; font-size: 12px; }
.roam-warn code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }
.roam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; }
.roam-grid label { display: grid; gap: 4px; font-size: 11px; min-width: 0; }
.roam-grid input, .roam-grid select { width: 100%; padding: 7px 9px; border-radius: 9px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.24); color: inherit; font: inherit; font-size: 13px; min-width: 0; }
.roam-grid select option { background: #14101a; color: #fff; }
.roam-grid label.roam-check { display: flex; align-items: center; gap: 7px; }
.roam-grid label.roam-check input { width: auto; }
.roam-wide { grid-column: 1 / -1; }
.roam-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.roam-actions button { border: 1px solid rgba(255,255,255,.2); background: rgba(217,102,63,.16); color: inherit; padding: 6px 11px; border-radius: 9px; font: inherit; font-size: 12px; cursor: pointer; }
.roam-actions button.roam-danger { background: transparent; border-color: rgba(233,161,161,.45); color: #e9a1a1; }
.roam-inline { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #9a99a3; }
.roam-inline select { padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.24); color: inherit; font: inherit; font-size: 12px; }
.roam-list { display: grid; gap: 10px; }
.roam-watch header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.roam-watch header strong { font-size: 14px; }
.roam-src { margin-left: 6px; padding: 1px 6px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.roam-watch-price { text-align: right; }
.roam-watch-price strong { display: block; font-size: 14px; }
.roam-watch-price small { color: #9a99a3; font-size: 10.5px; }
.roam-history table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.roam-history th, .roam-history td { text-align: left; padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.07); vertical-align: top; }
.roam-history th { color: #9a99a3; font-weight: 600; }
.roam-offers, .roam-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.roam-offer { border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 9px; display: grid; gap: 4px; }
.roam-offer-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.roam-offer-title { font-size: 12px; }
.roam-flags { display: flex; flex-wrap: wrap; gap: 5px; }
.roam-flags span { padding: 1px 7px; border: 1px solid rgba(230,180,95,.45); border-radius: 999px; font-size: 9.5px; color: #e6b45f; }
.roam-alerts li { font-size: 12px; padding: 7px 9px; border-left: 2px solid rgba(217,102,63,.7); background: rgba(217,102,63,.07); }
.roam-alerts li.read { opacity: .55; }
.roam-alerts strong { margin-right: 6px; color: #9a99a3; font-size: 10.5px; }
@media (max-width: 640px) {
  .mv-roamdesk { padding: 4px 12px 16px; }
  .roam-head { flex-direction: column; }
}
.mv-draftcard { border: 1px solid var(--mv-line2); border-radius: 14px; padding: 12px; display: grid; gap: 6px; background: rgba(255,255,255,.02); }
.mv-prev { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(4,5,8,.84); padding: 16px; }
.mv-prevcard { width: min(560px,100%); max-height: 92vh; overflow: auto; background: var(--mv-panel); border: 1px solid var(--mv-line2); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.mv-prevtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mv-prevtop strong { font-size: 13px; }
.mv-prevstage { position: relative; width: min(100%,320px); aspect-ratio: 9/16; margin: 0 auto; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg,#1b1024,#0b0d10 55%,#1a0d16); border: 1px solid rgba(255,255,255,.14); }
.mv-prevsafe { position: absolute; inset: 0; padding: 18px 16px 40px; display: grid; align-content: center; gap: 8px; text-align: center; }
.mv-prevkick { font-size: 9.5px; letter-spacing: .18em; color: #e76fae; margin: 0; }
.mv-prevtext { font-size: clamp(20px,4.6vw,30px); line-height: 1.12; font-weight: 800; margin: 0; text-transform: uppercase; letter-spacing: -.01em; }
.mv-prevedit, .mv-prevaudio { font-size: 10.5px; color: #c4c2c8; margin: 0; }
.mv-prevaudio { color: #8f8e97; padding: 4px 6px; border-radius: 7px; }
.mv-prevaudio.on { color: #b6ff00; background: rgba(182,255,0,.08); }
.mv-prevtrack { font-size: 9.5px; color: #8f8e97; margin: 0; }
.mv-prevtc { position: absolute; right: 10px; bottom: 18px; font-size: 9.5px; color: #c4c2c8; font-variant-numeric: tabular-nums; }
.mv-prevbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.12); }
.mv-prevfill { height: 100%; width: 0; background: linear-gradient(90deg,#e76fae,#b6ff00); }
.mv-prevacts { display: flex; gap: 8px; justify-content: center; }

/* Replies can carry pipe tables (a caption per version, side by side). Narrow
   panel: only the header row is dropped; every cell keeps its column name. */
.mv-bubble table.mdtable { width: 100%; margin: 9px 0 12px; border-collapse: collapse; font-size: 13px; line-height: 1.45; table-layout: fixed; }
.mv-bubble th, .mv-bubble td { border: 1px solid var(--mv-line); padding: 8px 10px; vertical-align: top; text-align: left; word-break: break-word; }
.mv-bubble th { background: rgba(255, 255, 255, .04); color: var(--mv-ink); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; }
.mv-bubble td { color: var(--mv-ink2, var(--mv-ink)); }
@media (max-width: 760px) {
  .mv-bubble table.mdtable, .mv-bubble table.mdtable tbody, .mv-bubble table.mdtable tr, .mv-bubble table.mdtable td { display: block; width: auto; }
  .mv-bubble table.mdtable thead { display: none; }
  .mv-bubble table.mdtable td { border-top: 0; }
  .mv-bubble table.mdtable td:before { content: attr(data-col); display: block; margin-bottom: 4px; color: var(--mv-mut); font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
}

/* ---------------- mobile: one agent behind the conversation ----------------
   The separate avatar row is gone below 900px, so the log owns that height.
   The active agent's own transparent pack plays behind it, lower-right, at
   17% opacity, ignoring taps, with a soft overlay and near-opaque bubbles so
   the words stay readable. */
.mv-nameavatar { display: none; }
.mv-chardialog { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; background: rgba(6, 5, 9, .74); }
.mv-chardialog[hidden] { display: none; }
.mv-charpanel { position: relative; width: min(430px, 100%); max-height: 88vh; overflow: auto; padding: 18px 18px 16px; border: 1px solid var(--mv-line2, #2a2532); border-radius: 18px; background: var(--mv-panel, #15121b); text-align: center; }
.mv-charclose { position: absolute; top: 8px; right: 8px; }
.mv-charstage { display: grid; place-items: center; width: min(56vw, 240px); aspect-ratio: 3 / 4; margin: 4px auto 2px; }
.mv-charstage video, .mv-charstage img { width: 100%; height: 100%; object-fit: contain; }
.mv-charpanel h2 { margin: 6px 0 2px; font-size: 17px; }
.mv-charrole { margin: 0 0 8px; color: var(--mv-mut, #a79fb3); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.mv-charnote { margin: 0 0 12px; color: var(--mv-ink2, #cfc8d8); font-size: 12px; line-height: 1.5; }
.mv-charbutton { padding: 9px 14px; border: 1px solid var(--mv-line2, #2a2532); border-radius: 10px; background: rgba(231, 111, 174, .16); color: #fff; font-size: 12.5px; }
@keyframes mv-drift { from { transform: translateY(5px); } to { transform: translateY(-9px); } }

@media (max-width: 900px) {
  .mv-quickteam { display: none !important; }
  .mv-main { position: relative; overflow: hidden; }
  .mv-nameavatar {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 30px; height: 30px; margin-right: 8px; padding: 0; overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--role, #b781e7) 48%, transparent);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--role, #b781e7) 32%, transparent), rgba(12, 10, 16, .92));
  }
  .mv-nameavatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
  .mv-nameavatar span { color: #fff; font-size: 13px; }
  .mv-title { display: flex; align-items: center; min-width: 0; }
  .mv-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mv-stage {
    position: absolute; right: -7%; bottom: 92px; z-index: 0;
    width: min(58vw, 268px); height: auto; aspect-ratio: 3 / 4;
    margin: 0; opacity: .17; pointer-events: none;
    animation: mv-drift 11s ease-in-out infinite alternate;
    transition: opacity .3s ease;
  }
  .mv-stage[data-look="full"] { opacity: .2; }
  .mv-stage::before { opacity: .5; filter: blur(16px); }
  .mv-stage mini-vyxin { width: 100%; height: 100%; filter: drop-shadow(0 20px 46px rgba(0, 0, 0, .55)); }
  .mv-main::after {
    position: absolute; inset: auto 0 0 0; z-index: 0; height: 64%;
    content: ""; pointer-events: none;
    background: linear-gradient(to top, rgba(10, 9, 13, .93) 14%, rgba(10, 9, 13, .58) 56%, transparent);
  }
  .mv-top, .mv-log, .mv-suggestions, .mv-composer, .mv-error { position: relative; z-index: 1; }
  .mv-bubble { background: rgba(20, 21, 27, .96); backdrop-filter: blur(10px); }
  body.mv-kbd .mv-stage { animation-play-state: paused; opacity: .1; }
  body.char-open .mv-stage { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .mv-stage { animation: none !important; opacity: .16; }
  body.mv-kbd .mv-stage { opacity: .1; }
}

/* Reduced motion is honoured twice: by the media query above for a first paint
   with no JS, and by body.mv-reduced, which the page keeps in sync, so the
   background agent and the expanded view agree with the system setting. */
body.mv-reduced .mv-stage { animation: none !important; opacity: .16; }
body.mv-reduced.mv-kbd .mv-stage { opacity: .1; }
body.char-open { overflow: hidden; }
