:root {
  /* Premium Cyber Trading Floor — design tokens */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --bg: #03060c;
  --bg-elevated: #0a1020;
  --ink: #f4f7ff;
  --muted: #b8c4de;
  --muted-soft: #8b9bb8;
  --line: rgba(148, 180, 255, 0.14);
  --line-strong: rgba(100, 210, 255, 0.42);
  --glass: rgba(10, 16, 32, 0.72);
  --glass-strong: rgba(8, 12, 26, 0.9);
  --glass-shine: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    transparent 70%
  );
  --accent: #5ce1ff;
  --accent-dim: #6ea1ff;
  --accent-2: #7c8cff;
  --indigo: #6366f1;
  --good: #3dffa8;
  --bad: #ff6b88;
  --warn: #ffc857;
  --purple: #b8a6ff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.12), 0 24px 64px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 8px 16px rgba(0, 0, 0, 0.2), 0 32px 72px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(92, 225, 255, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 160ms;
  --dur-med: 220ms;
  --dur-slow: 380ms;
  /* Game UI kit contract */
  --ui-frame: 1px;
  --ui-corner: 10px;
  --ui-glow: 0 0 0 1px rgba(92, 225, 255, 0.14), 0 0 28px rgba(92, 225, 255, 0.1);
  --ui-pressed: inset 0 2px 10px rgba(0, 0, 0, 0.4);
  --ico-stroke: 1.75;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1, "ss01" 1;
}
::selection {
  background: rgba(92, 225, 255, 0.28);
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid rgba(92, 225, 255, 0.75);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .bg-hero { animation: none !important; }
}

.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-hero {
  position: absolute; inset: -8%;
  background:
    linear-gradient(180deg, rgba(5,7,13,0.35), rgba(5,7,13,0.88)),
    url("/static/assets/hero-bg.jpg") center / cover no-repeat;
  filter: saturate(1.1) contrast(1.05);
  transform: scale(1.04);
  animation: drift 28s ease-in-out infinite alternate;
}
.bg-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(110,161,255,0.18), transparent 55%),
    radial-gradient(800px 420px at 90% 10%, rgba(69,224,200,0.1), transparent 50%),
    radial-gradient(circle at 50% 120%, rgba(181,156,255,0.08), transparent 45%),
    linear-gradient(180deg, transparent, rgba(5,7,13,0.85));
}
.bg-noise {
  position: absolute; inset: 0; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.glass {
  position: relative;
  background: var(--glass);
  background-image: var(--glass-shine);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  transition:
    border-color var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out),
    filter var(--dur-fast) ease;
}
.panel.glass:hover:not(.floor-stage),
.kpi.glass:hover,
.card-item:hover,
.proposal-card:hover,
.holding-card:hover {
  border-color: rgba(92, 225, 255, 0.28);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.floor-stage.glass:hover {
  border-color: rgba(92, 225, 255, 0.22);
  box-shadow: var(--shadow-lift);
  transform: none;
}
.card-item,
.proposal-card,
.holding-card,
.cap-card {
  transition:
    border-color var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out);
}
.nav.glass {
  animation: rise 0.55s cubic-bezier(.16,1,.3,1) both;
}
.menu-bar.glass {
  animation: rise 0.6s cubic-bezier(.16,1,.3,1) 0.04s both;
}

.nav {
  display: grid;
  grid-template-columns: 1.1fr auto 1.2fr;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 24px;
  margin-bottom: 16px;
}
.nav-brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mark {
  width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800;
  background: linear-gradient(145deg, #7db0ff, #45e0c8);
  color: #041018;
  box-shadow: 0 10px 30px rgba(110,161,255,0.35);
}
.nav-title { font-weight: 750; font-size: 1.05rem; letter-spacing: -0.02em; }
.nav-sub { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }

.nav-session {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 5px rgba(147,160,189,0.12);
}
.pulse.live {
  background: var(--good);
  box-shadow: 0 0 0 5px rgba(62,229,154,0.16);
  animation: pulse 1.8s ease-in-out infinite;
}
.pulse.research {
  background: var(--purple);
  box-shadow: 0 0 0 5px rgba(181,156,255,0.16);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}
.nav-session-label { font-size: 0.88rem; font-weight: 650; }
.nav-session-meta { color: var(--muted); font-size: 0.72rem; }

.nav-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* Buttons: same geometry in all states — only glow / inset / brightness (game-ui contract) */
.btn {
  position: relative;
  overflow: hidden;
  border: var(--ui-frame) solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: 600 0.86rem/1 var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: none;
  transform: translateY(0) scale(1);
  transition:
    border-color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    box-shadow var(--dur-med) var(--ease-out),
    filter var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}
.btn:hover {
  border-color: var(--line-strong);
  background: rgba(92, 225, 255, 0.1);
  box-shadow: var(--ui-glow);
  filter: brightness(1.06);
  transform: translateY(-1px) scale(1.02);
}
.btn:active {
  border-color: rgba(92, 225, 255, 0.35);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: var(--ui-pressed);
  filter: brightness(0.94);
  transform: translateY(0) scale(0.98);
}
.btn:disabled { opacity: 0.5; cursor: wait; filter: none; box-shadow: none; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #5ce1ff 0%, #6ea1ff 45%, #6366f1 100%);
  border-color: transparent;
  color: #041018;
  box-shadow: 0 12px 28px rgba(92, 225, 255, 0.22);
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 16px 36px rgba(92, 225, 255, 0.32);
  background: linear-gradient(135deg, #5ce1ff 0%, #6ea1ff 45%, #6366f1 100%);
}
.btn-primary:active {
  filter: brightness(0.94);
  box-shadow: var(--ui-pressed);
}
.btn-shine {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: shine 4.5s ease-in-out infinite;
}
@keyframes shine {
  0%, 60%, 100% { transform: translateX(-120%); }
  75% { transform: translateX(120%); }
}
.ws-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: lowercase;
}
.ws-chip.online { color: var(--good); border-color: rgba(62,229,154,0.35); background: rgba(62,229,154,0.08); }
.ws-chip.offline { color: var(--muted); }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

/* Win rates strip — always under KPIs */
.winrate-strip {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
}
.winrate-strip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.winrate-title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.winrate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.winrate-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(110,161,255,0.08), rgba(0,0,0,0.12));
  min-width: 0;
}
.winrate-card.is-empty {
  opacity: 0.72;
}
.winrate-card.is-good .winrate-value { color: var(--good); }
.winrate-card.is-mid .winrate-value { color: var(--warn); }
.winrate-card.is-bad .winrate-value { color: var(--bad); }
.winrate-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.winrate-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}
.winrate-foot {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}
.winrate-panel {
  margin-bottom: 14px;
}
.winrate-panel .winrate-grid {
  margin-top: 4px;
}
.kpi {
  border-radius: 18px;
  padding: 14px 15px;
  min-height: 104px;
  position: relative;
  transition:
    border-color .18s ease,
    box-shadow .2s ease,
    filter .15s ease;
}
.kpi:hover {
  border-color: rgba(110,161,255,0.35);
  box-shadow: var(--ui-glow);
  filter: brightness(1.04);
}
.kpi:active {
  box-shadow: var(--ui-pressed);
  filter: brightness(0.97);
}

/* —— Game UI kit: panels / corners / bars / icon set —— */
.hud-panel {
  position: relative;
  border-width: var(--ui-frame);
}
.hud-corners,
.frame-corners {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 2;
}
.hud-corners::before,
.hud-corners::after,
.frame-corners::before,
.frame-corners::after {
  content: "";
  position: absolute;
  width: var(--ui-corner);
  height: var(--ui-corner);
  border-color: rgba(126, 176, 255, 0.55);
  border-style: solid;
  border-width: 0;
}
.hud-corners::before,
.frame-corners::before {
  top: 6px; left: 6px;
  border-top-width: 2px;
  border-left-width: 2px;
}
.hud-corners::after,
.frame-corners::after {
  top: 6px; right: 6px;
  border-top-width: 2px;
  border-right-width: 2px;
}
.hud-panel > .hud-corners {
  /* bottom corners via box-shadow on pseudo children isn't enough — use gradient mask */
  background:
    linear-gradient(var(--accent), var(--accent)) bottom 6px left 6px / var(--ui-corner) 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom 6px left 6px / 2px var(--ui-corner) no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom 6px right 6px / var(--ui-corner) 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom 6px right 6px / 2px var(--ui-corner) no-repeat;
  opacity: 0.45;
}
.hud-inset {
  position: relative;
  border: var(--ui-frame) solid rgba(126,176,255,0.2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}
.hud-chip {
  border-width: var(--ui-frame);
}
.hud-bar {
  margin-top: 8px;
}
.hud-bar-track {
  height: 6px;
  border-radius: 999px;
  border: 1px solid rgba(126,176,255,0.22);
  background: rgba(0,0,0,0.35);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}
.hud-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3ac9b5, #6ea1ff 70%, #a8d0ff);
  box-shadow: 0 0 10px rgba(94,235,212,0.35);
  transition: width .45s cubic-bezier(.16,1,.3,1);
  min-width: 0;
}

/* Matched raster icon pack — same tile, stroke, weight (game-ui set) */
.ui-ico-img {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}
.menu-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(126,176,255,0.12);
  transition: box-shadow .15s ease, filter .15s ease;
}
.menu-tab:hover .menu-ico {
  box-shadow: 0 0 0 1px rgba(126,176,255,0.4), 0 0 14px rgba(110,161,255,0.25);
  filter: brightness(1.08);
}
.menu-tab.active .menu-ico {
  box-shadow: 0 0 0 1px rgba(94,235,212,0.5), 0 0 16px rgba(94,235,212,0.22);
  filter: brightness(1.05);
}
.menu-tab:active .menu-ico {
  filter: brightness(0.92);
}
.kpi-label {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.kpi-value {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.kpi-value.sm { font-size: 1.05rem; }
.kpi-foot { margin-top: 6px; color: var(--muted); font-size: 0.74rem; }

.floor-stage {
  border-radius: 28px;
  padding: 14px;
  margin-bottom: 14px;
  overflow: hidden;
}
.stage-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 4px 6px 12px;
}
.stage-head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.stage-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; max-width: 72ch; }
.stage-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.tag.accent { color: var(--accent-2); border-color: rgba(69,224,200,0.28); }

.stage-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 420px;
  background: #070b14;
}
/* —— Game room stage —— */
.stage-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px;
  align-items: stretch;
}
.stage-frame.game-frame {
  min-height: 460px;
  background:
    radial-gradient(800px 320px at 50% 20%, rgba(110,161,255,0.14), transparent 60%),
    radial-gradient(600px 280px at 80% 70%, rgba(94,235,212,0.08), transparent 55%),
    radial-gradient(400px 200px at 20% 80%, rgba(196,176,255,0.06), transparent 50%),
    #070b14;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 20px 60px rgba(0,0,0,0.35);
  box-shadow: inset 0 0 80px rgba(0,0,0,0.45);
}
#room {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  cursor: default;
  touch-action: manipulation;
}
.stage-glow {
  position: absolute; inset: auto 0 0 0; height: 28%;
  background: linear-gradient(180deg, transparent, rgba(5,7,13,0.5));
  pointer-events: none; z-index: 1;
}
.room-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.35);
  border-radius: inherit;
}
.agent-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 4px 2px;
}
.legend-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: var(--ui-frame) solid var(--line);
  background: rgba(0,0,0,0.18);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease, filter .15s ease;
}
.legend-chip:hover, .legend-chip:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--c, var(--accent)) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 25%, transparent),
    0 0 16px color-mix(in srgb, var(--c, var(--accent)) 20%, transparent);
  filter: brightness(1.06);
}
.legend-chip:active {
  box-shadow: var(--ui-pressed);
  filter: brightness(0.94);
}
.legend-chip b { font-weight: 700; color: var(--c, var(--accent)); }
.legend-role {
  opacity: 0.65;
  font-size: 0.68rem;
  margin-left: 2px;
}
.agent-inspect {
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.agent-inspect::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px 140px at 100% 0%, rgba(110,161,255,0.12), transparent 60%);
  pointer-events: none;
}
.inspect-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  position: relative;
  z-index: 1;
}
.inspect-orb {
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff8, var(--accent), #0b1220);
  box-shadow: 0 0 28px rgba(110,161,255,0.35);
  animation: orb-pulse 2.4s ease-in-out infinite;
  margin-bottom: 6px;
}
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(110,161,255,0.3); }
  50% { transform: scale(1.06); box-shadow: 0 0 36px rgba(94,235,212,0.35); }
}
.muted-soft { color: var(--muted-soft); font-size: 0.72rem; }
.inspect-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.inspect-body.inspect-enter {
  animation: inspect-pop 0.4s cubic-bezier(.16,1,.3,1) both;
}
@keyframes inspect-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.inspect-top { display: flex; gap: 12px; align-items: center; }
.inspect-avatar {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.2rem; color: #041018;
  background: linear-gradient(145deg, var(--inspect-c, #7db0ff), #45e0c8);
  box-shadow: 0 10px 28px rgba(110,161,255,0.35);
  flex-shrink: 0;
}
.inspect-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.inspect-role { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.inspect-status {
  display: inline-flex; align-self: flex-start;
  font-size: 0.7rem; font-weight: 750; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(78,240,168,0.35);
  color: var(--good);
  background: rgba(78,240,168,0.08);
}
.inspect-status[data-state="working"] {
  color: var(--good);
  border-color: rgba(78,240,168,0.45);
}
.inspect-status[data-state="speaking"] {
  color: var(--warn);
  border-color: rgba(255,209,102,0.4);
  background: rgba(255,209,102,0.1);
}
.inspect-status[data-state="walking"] {
  color: var(--accent);
  border-color: rgba(110,161,255,0.4);
  background: rgba(110,161,255,0.1);
}
.inspect-section { display: flex; flex-direction: column; gap: 6px; }
.inspect-label {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.inspect-msg, .inspect-focus {
  margin: 0; color: var(--ink); font-size: 0.9rem; line-height: 1.5;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
  min-height: 2.8em;
}
.inspect-focus { color: var(--muted); font-size: 0.84rem; min-height: 0; }
.inspect-desk {
  font-family: var(--mono); font-size: 0.75rem; color: var(--accent-2);
}
.inspect-news {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  overflow: auto;
}
.inspect-news-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  font-size: 0.8rem;
  line-height: 1.35;
}
.inspect-news-item a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.inspect-news-item a:hover { color: var(--accent); }
.inspect-news-item .news-meta { display: block; margin-top: 4px; }
.inspect-news-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted-soft);
  line-height: 1.4;
}
.inspect-actions { margin-top: auto; }
.bg-orbs {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(320px 220px at 12% 30%, rgba(110,161,255,0.08), transparent 70%),
    radial-gradient(280px 200px at 88% 60%, rgba(94,235,212,0.06), transparent 70%),
    radial-gradient(240px 180px at 50% 90%, rgba(196,176,255,0.05), transparent 70%);
  animation: orbs-drift 18s ease-in-out infinite alternate;
}
@keyframes orbs-drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(-1%, -1.5%, 0) scale(1.04); }
}

.main-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 14px;
}
.col { display: flex; flex-direction: column; gap: 14px; }

/* Floor tab: decisions full-width; thesis + activity side-by-side, shared bottom */
.floor-desk-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.floor-decisions {
  width: 100%;
}
.floor-bottom-row {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 14px;
  align-items: stretch;
}
.floor-thesis-panel,
.floor-activity-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Tall enough for thesis paragraph + graded idea cards */
  max-height: min(96vh, 1100px);
  min-height: min(72vh, 720px);
}
.floor-thesis-panel .panel-head,
.floor-activity-panel .panel-head {
  flex: 0 0 auto;
}
.floor-thesis-panel .thesis {
  flex: 0 0 auto;
}
.floor-thesis-panel .desk-intel {
  flex: 0 0 auto;
}
.floor-ideas.stack.compact {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.floor-feed.feed,
#page-floor #feed.feed {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.panel {
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0; /* grid children: prevent overflow clip of inner scroll areas */
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 12px;
}
.panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.chip {
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}
.chip.warn { color: var(--warn); border-color: rgba(255,200,87,0.3); }
.text-btn {
  border: 0; background: transparent; color: var(--accent);
  font: 600 0.8rem var(--font); cursor: pointer;
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(148,163,199,0.1);
  font-variant-numeric: tabular-nums;
}
th {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
}
.mono { font-family: var(--mono); font-size: 0.82rem; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

.stack, .feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
  overflow-x: hidden;
  padding-right: 4px;
  min-height: 0; /* flex/grid children can scroll instead of clipping */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.stack.compact { max-height: 260px; }
.feed { max-height: 320px; }

.card-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 13px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  transition:
    border-color .22s ease,
    transform .24s cubic-bezier(.16,1,.3,1),
    box-shadow .24s ease,
    background .2s ease;
}
.card-item:hover {
  border-color: rgba(110,161,255,0.32);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.card-item h4 { margin: 0 0 6px; font-size: 0.92rem; letter-spacing: -0.01em; }
.card-item p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.card-item .meta { margin-top: 8px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.row-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn-yes {
  background: rgba(62,229,154,0.12);
  border: 1px solid rgba(62,229,154,0.35);
  color: var(--good);
  border-radius: 10px;
  padding: 8px 12px;
  font: 650 0.8rem var(--font);
  cursor: pointer;
}
.btn-no {
  background: rgba(255,107,126,0.1);
  border: 1px solid rgba(255,107,126,0.32);
  color: var(--bad);
  border-radius: 10px;
  padding: 8px 12px;
  font: 650 0.8rem var(--font);
  cursor: pointer;
}
.badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--warn);
  vertical-align: middle;
}
.badge.proposed { color: var(--warn); }
.badge.approved, .badge.filled { color: var(--good); }
.badge.rejected, .badge.failed { color: var(--bad); }

/* Working thesis ideas — confidence + deep dive */
.idea-card .idea-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.idea-card .idea-head h4 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.idea-card .idea-deep-dive-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(240, 196, 80, 0.45);
  background: linear-gradient(180deg, rgba(240, 196, 80, 0.18), rgba(240, 196, 80, 0.08));
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}
.idea-card .idea-deep-dive-btn:hover:not(:disabled) {
  border-color: rgba(240, 196, 80, 0.75);
  background: linear-gradient(180deg, rgba(240, 196, 80, 0.28), rgba(240, 196, 80, 0.12));
}
.idea-card .idea-deep-dive-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.badge.conf-badge {
  color: var(--warn);
  border-color: rgba(255, 200, 87, 0.45);
  background: rgba(255, 200, 87, 0.12);
  transition: box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-fast) ease;
}
.badge.conf-badge.conf-very-high {
  color: #ffe08a;
  border-color: rgba(255, 224, 138, 0.75);
  background: rgba(255, 200, 87, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 200, 87, 0.2), 0 0 16px rgba(255, 200, 87, 0.35);
}
.badge.conf-badge.conf-high {
  color: var(--warn);
  border-color: rgba(255, 200, 87, 0.55);
  box-shadow: 0 0 12px rgba(255, 200, 87, 0.18);
}
.badge.conf-badge.conf-med {
  color: #c9b27a;
  border-color: rgba(201, 178, 122, 0.35);
  background: rgba(201, 178, 122, 0.08);
}
.badge.conf-badge.conf-low {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}
.idea-dive-status {
  margin-top: 8px;
}
.idea-dive-status .badge.dive-running {
  color: var(--accent);
  border-color: rgba(110, 161, 255, 0.45);
}
.idea-dive-status .badge.dive-done {
  color: var(--good);
  border-color: rgba(69, 224, 200, 0.4);
}
.idea-dive-status .badge.dive-error {
  color: var(--bad);
}
.idea-dive-memo {
  margin: 6px 0 0 !important;
  font-size: 0.82rem !important;
  color: var(--ink) !important;
  opacity: 0.88;
}

/* Desk intel: calibration + gate + dead-money policy */
.desk-intel {
  margin: 0 0 12px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(110, 161, 255, 0.18);
  background: linear-gradient(135deg, rgba(110,161,255,0.08), rgba(240,196,80,0.05));
}
.desk-intel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.desk-intel-blurb {
  margin: 0 0 10px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.portfolio-desk-intel {
  margin-bottom: 14px;
}
.stage-sub.tight {
  margin: 0 0 10px;
  font-size: 0.8rem;
}
.empty-state.tight {
  margin: 0;
  font-size: 0.8rem;
}

.calib-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.calib-bucket {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.calib-name {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 6px;
}
.calib-bucket.conf-very-high .calib-name { color: #f5d76e; }
.calib-bucket.conf-high .calib-name { color: var(--warn); }
.calib-bucket.conf-med .calib-name { color: #c9b27a; }
.calib-bucket.conf-low .calib-name { color: var(--muted); }
.calib-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.45;
}
.calib-stat strong {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Idea score bars */
.idea-card.idea-eligible {
  border-color: rgba(245, 215, 110, 0.35);
  box-shadow: 0 0 0 1px rgba(245, 215, 110, 0.08);
}
.idea-score {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.idea-score-empty {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}
.idea-score-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.idea-composite {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.idea-composite small {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.idea-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}
.src-chip {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.src-chip.src-rh {
  color: var(--accent);
  border-color: rgba(110, 161, 255, 0.4);
  background: rgba(110, 161, 255, 0.1);
}
.src-chip.src-news {
  color: var(--good);
  border-color: rgba(69, 224, 200, 0.35);
  background: rgba(69, 224, 200, 0.08);
}
.src-chip.src-social {
  color: #e8a0ff;
  border-color: rgba(232, 160, 255, 0.35);
  background: rgba(232, 160, 255, 0.08);
}
.src-chip.src-none {
  opacity: 0.7;
}
.src-count {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  margin-left: 2px;
}
.score-meter {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 8px;
}
.score-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(110,161,255,0.7), rgba(245,215,110,0.85));
  min-width: 2px;
}
.score-comps {
  display: grid;
  gap: 4px;
}
.score-comp {
  display: grid;
  grid-template-columns: 88px 1fr 48px;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}
.score-comp-lab {
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
}
.score-comp-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.score-comp-fill {
  display: block;
  height: 100%;
  background: rgba(110, 161, 255, 0.65);
  border-radius: inherit;
}
.score-comp-n {
  text-align: right;
  text-transform: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.85;
}
.idea-reject {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--warn);
}
.badge.gate-badge {
  margin-left: 4px;
  font-size: 0.6rem;
}
.badge.gate-ok {
  color: #f5d76e;
  border-color: rgba(245, 215, 110, 0.55);
  background: rgba(245, 215, 110, 0.14);
}
.badge.gate-no {
  color: var(--muted);
  border-color: var(--line);
}
.badge.score-mini {
  color: var(--accent);
  border-color: rgba(110, 161, 255, 0.35);
  margin-left: 4px;
}
.badge.kind-badge {
  margin-left: 4px;
  color: var(--muted);
  border-color: var(--line);
  text-transform: none;
  letter-spacing: 0.02em;
}
.badge.kind-badge.kind-dead_money_trim,
.badge.kind-badge.kind-dead_money_exit {
  color: #f0a060;
  border-color: rgba(240, 160, 96, 0.45);
  background: rgba(240, 160, 96, 0.1);
}
.badge.kind-badge.kind-deep_dive {
  color: var(--accent);
  border-color: rgba(110, 161, 255, 0.4);
}
.badge.dm-badge {
  margin-left: 4px;
  color: #f0a060;
  border-color: rgba(240, 160, 96, 0.5);
  background: rgba(240, 160, 96, 0.12);
  text-transform: none;
  letter-spacing: 0.02em;
}
.dead-money-flag {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.78rem;
  color: #f0c090;
}
.dm-detail { opacity: 0.9; }
.dm-rotate {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
}
.card-item.plan-dead,
.holding-card.holding-dead {
  border-color: rgba(240, 160, 96, 0.35);
}
.plan-block.dead-money-block {
  border-color: rgba(240, 160, 96, 0.28);
  background: rgba(240, 160, 96, 0.06);
}
.plan-block.dead-money-block h5 {
  color: #f0a060;
}
.proposal-title .badge {
  vertical-align: middle;
  font-size: 0.58rem;
  padding: 2px 6px;
}

.thesis {
  margin: 0 0 12px;
  padding: 14px 15px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 0.9rem;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(110,161,255,0.12), rgba(69,224,200,0.06));
  border: 1px solid rgba(110,161,255,0.2);
}

.feed-item .who {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 4px;
}

.footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.74rem;
}

.reveal {
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.reveal.d1 { animation-delay: .05s; }
.reveal.d2 { animation-delay: .1s; }
.reveal.d3 { animation-delay: .15s; }
.reveal.d4 { animation-delay: .2s; }
.reveal.d5 { animation-delay: .25s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* scrollbars */
.stack::-webkit-scrollbar, .feed::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.stack::-webkit-scrollbar-thumb, .feed::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb {
  background: rgba(147,160,189,0.25); border-radius: 999px;
}

/* —— Menu bar / tabs —— */
.menu-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.menu-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: var(--ui-frame) solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 8px 12px 8px 8px;
  font: 650 0.88rem/1 var(--font);
  cursor: pointer;
  /* geometry frozen — only color/glow (game-ui states) */
  transition:
    background .15s ease,
    color .15s ease,
    border-color .15s ease,
    box-shadow .18s ease,
    filter .15s ease;
}
.menu-tab:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.05);
  border-color: rgba(126,176,255,0.2);
  box-shadow: var(--ui-glow);
  filter: brightness(1.05);
}
.menu-tab:active {
  background: rgba(0,0,0,0.25);
  box-shadow: var(--ui-pressed);
  filter: brightness(0.95);
}
.menu-tab.active {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(110,161,255,0.22), rgba(69,224,200,0.12));
  border-color: rgba(110,161,255,0.4);
  box-shadow: 0 0 0 1px rgba(110,161,255,0.12), 0 10px 28px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
  filter: none;
}
.menu-spacer { flex: 1; }
.menu-hint {
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0 10px;
}

.tab-page { display: none; }
.tab-page.active {
  display: block;
  animation: page-in var(--dur-slow) var(--ease-out) both;
}
.tab-page[hidden] { display: none !important; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px) scale(0.994); filter: blur(1.5px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tab-page.active { animation: none; }
}

/* Floor 2.5D / 3D host — premium game room frame */
.floor-canvas-host {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% 22%, rgba(60, 100, 180, 0.22), transparent 65%),
    radial-gradient(ellipse 50% 40% at 15% 70%, rgba(92, 225, 255, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 40% at 85% 65%, rgba(99, 102, 241, 0.07), transparent 50%),
    linear-gradient(180deg, #0a1428 0%, #060c18 55%, #04080f 100%);
  box-shadow:
    inset 0 1px 0 rgba(160, 200, 255, 0.08),
    inset 0 0 60px rgba(0, 0, 0, 0.35);
}
.floor-canvas-host canvas.floor-2d {
  display: block;
  width: 100% !important;
  height: auto !important;
  border-radius: inherit;
}
.floor-canvas-host canvas.floor-3d {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 420px;
  border-radius: inherit;
}
.floor-canvas-host.is-3d canvas.floor-2d {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  inset: 0;
}
.floor-mode-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  font: 600 0.65rem/1 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(92, 225, 255, 0.28);
  background: rgba(6, 10, 20, 0.82);
  color: var(--accent-2, #5ce1ff);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(92, 225, 255, 0.12);
}

.page-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-radius: 22px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.page-hero h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.eyebrow {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.meta-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
}
.meta-pill.mono { font-family: var(--mono); font-size: 0.72rem; }

.stack.tall, .feed.tall { max-height: 480px; }
.feed.compact, .stack.compact { max-height: 240px; }

/* History: sticky scrollable runs list — no blank stretch under the list */
.history-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.35fr);
  gap: 14px;
  align-items: start;
}
.history-list-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  min-height: 320px;
  overflow: hidden;
}
.history-list-panel > .panel-head {
  flex: 0 0 auto;
}
.history-list.stack,
.history-list.stack.tall {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none; /* fill panel; panel already viewport-capped */
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}
.history-list .card-item {
  cursor: pointer;
  flex: 0 0 auto;
  padding: 10px 12px;
}
.history-list .card-item h4 {
  font-size: 0.86rem;
  margin-bottom: 4px;
}
.history-list .card-item p {
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-list .card-item.active {
  border-color: rgba(110,161,255,0.45);
  background: linear-gradient(180deg, rgba(110,161,255,0.12), rgba(255,255,255,0.02));
  box-shadow: inset 3px 0 0 var(--accent);
}
.history-detail-panel {
  min-width: 0;
  overflow: visible;
}
.history-detail-panel .thesis {
  max-height: none;
  overflow: visible;
}
.history-detail-panel .detail-grid .stack,
.history-detail-panel .detail-grid .feed {
  max-height: min(280px, 36vh);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
  min-width: 0;
}
.detail-grid > div { min-width: 0; }
.subhead {
  margin: 14px 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.body-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.55;
  opacity: 0.92;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.holding-card {
  border-radius: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.25);
  transition: transform .18s ease, border-color .18s ease;
}
.holding-card:hover {
  transform: translateY(-2px);
  border-color: rgba(110,161,255,0.3);
}
.holding-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.holding-sym {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.holding-sleeve {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}
.holding-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.18);
}
.stat-label {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
}
.stat-value {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
}
.plan-block {
  border-radius: 14px;
  padding: 12px 13px;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
}
.plan-block h5 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.plan-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
.plan-block.exit-plan {
  border-color: rgba(255, 209, 102, 0.22);
  background: linear-gradient(180deg, rgba(255,209,102,0.06), rgba(255,255,255,0.02));
}
.plan-block.exit-plan h5 { color: var(--warn); }
.exit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-2);
}
.exit-invalidate {
  margin-top: 8px !important;
  font-size: 0.8rem !important;
}
.action-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.action-badge.hold { color: var(--accent); border-color: rgba(110,161,255,0.35); }
.action-badge.trim, .action-badge.exit { color: var(--warn); border-color: rgba(255,200,87,0.35); }
.action-badge.add { color: var(--good); border-color: rgba(62,229,154,0.35); }
.action-badge.watch { color: var(--purple); border-color: rgba(181,156,255,0.35); }

.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 22px 16px;
  text-align: center;
  line-height: 1.55;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(148, 180, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}
.loading-state {
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 20px;
}
.loading-state::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(92, 225, 255, 0.22);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .loading-state::before { animation: none; }
}

/* —— Proposals tab —— */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  background: rgba(255, 209, 102, 0.2);
  color: var(--warn);
  border: 1px solid rgba(255, 209, 102, 0.4);
}
.tab-badge[hidden] { display: none !important; }

.props-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  margin-bottom: 14px;
}
.filter-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font: 650 0.84rem/1 var(--font);
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip:hover { color: var(--ink); border-color: rgba(126,176,255,0.4); }
.filter-chip.active {
  color: #041018;
  background: linear-gradient(135deg, #7eb0ff, #5eebd4);
  border-color: transparent;
}

.proposals-queue {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.proposal-card {
  border-radius: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.2);
  transition: transform .18s ease, border-color .18s ease, opacity .25s ease;
}
.proposal-card:hover { border-color: rgba(126,176,255,0.35); }
.proposal-card.is-open {
  border-color: rgba(255, 209, 102, 0.35);
  background:
    linear-gradient(135deg, rgba(255,209,102,0.08), transparent 40%),
    var(--glass);
}
.proposal-card.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
}
.proposal-card.is-approved {
  border-color: rgba(78, 240, 168, 0.28);
  opacity: 0.85;
}
.proposal-card.is-rejected {
  border-color: rgba(255, 123, 140, 0.25);
  opacity: 0.75;
}
.proposal-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.proposal-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}
.proposal-side {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 8px;
  margin-right: 8px;
  vertical-align: middle;
}
.proposal-side.buy {
  color: var(--good);
  background: rgba(78, 240, 168, 0.12);
  border: 1px solid rgba(78, 240, 168, 0.3);
}
.proposal-side.sell {
  color: var(--warn);
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.3);
}
.proposal-size {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.proposal-body {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0 0 8px;
  opacity: 0.95;
}
.proposal-risk {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 12px;
}
.proposal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.8rem;
  color: var(--muted-soft);
  font-family: var(--mono);
  margin-bottom: 14px;
}
.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-yes, .btn-no {
  min-width: 120px;
  padding: 12px 18px;
  border-radius: 12px;
  font: 700 0.9rem/1 var(--font);
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn-yes:hover, .btn-no:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 18px rgba(126,176,255,0.15);
}
.btn-yes:active, .btn-no:active {
  filter: brightness(0.92);
  box-shadow: var(--ui-pressed);
}
.btn-yes:disabled, .btn-no:disabled { opacity: 0.5; cursor: wait; filter: none; box-shadow: none; }
.btn-yes {
  background: rgba(78, 240, 168, 0.16);
  border: 1px solid rgba(78, 240, 168, 0.45);
  color: var(--good);
}
.btn-no {
  background: rgba(255, 123, 140, 0.12);
  border: 1px solid rgba(255, 123, 140, 0.4);
  color: var(--bad);
}
.status-pill {
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.status-pill.proposed { color: var(--warn); border-color: rgba(255,209,102,0.4); }
.status-pill.approved { color: var(--good); border-color: rgba(78,240,168,0.4); }
.status-pill.rejected { color: var(--bad); border-color: rgba(255,123,140,0.4); }
.warn-pill {
  color: var(--warn) !important;
  border-color: rgba(255,209,102,0.4) !important;
  background: rgba(255,209,102,0.08) !important;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid rgba(126,176,255,0.35);
  color: var(--ink);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: rise 0.3s ease both;
}
.toast.ok { border-color: rgba(78,240,168,0.45); }
.toast.err { border-color: rgba(255,123,140,0.45); }

.body-text { color: var(--ink); opacity: 0.95; }
.plan-block p { color: var(--muted); }
.thesis {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .nav { grid-template-columns: 1fr; }
  .nav-actions { justify-content: flex-start; }
  .history-layout { grid-template-columns: 1fr; }
  .history-list-panel {
    position: relative;
    top: auto;
    max-height: min(55vh, 520px);
  }
  .portfolio-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { width: calc(100% - 16px); padding: 10px 0 36px; }
  .nav {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
  }
  .nav-brand .nav-sub { display: none; }
  .nav-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .nav-actions .btn-primary { grid-column: 1 / -1; }
  .nav-actions .ws-chip { grid-column: 1 / -1; text-align: center; }
  .menu-bar {
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .menu-tab {
    flex: 0 0 auto;
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .menu-hint { display: none; }
  .kpi-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .winrate-grid {
    grid-template-columns: 1fr 1fr;
  }
  .winrate-strip-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .winrate-value { font-size: 1.3rem; }
  .kpi {
    min-height: 88px;
    padding: 12px;
    border-radius: 14px;
  }
  .kpi-value { font-size: 1.05rem; }
  .main-grid { grid-template-columns: 1fr; gap: 10px; }
  .floor-bottom-row { grid-template-columns: 1fr; }
  .floor-thesis-panel,
  .floor-activity-panel {
    max-height: min(85vh, 900px);
    min-height: min(58vh, 560px);
  }
  .stage-frame { min-height: 260px; border-radius: 14px; }
  .stage-head { flex-direction: column; }
  .page-hero {
    flex-direction: column;
    padding: 14px;
    border-radius: 16px;
  }
  .page-hero h2 { font-size: 1.15rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .history-layout { grid-template-columns: 1fr; }
  .history-list-panel {
    position: relative;
    top: auto;
    max-height: min(50vh, 440px);
    min-height: 240px;
  }
  .holding-stats { grid-template-columns: 1fr 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .proposal-card { padding: 14px; border-radius: 16px; }
  .proposal-title { font-size: 1.05rem; }
  .proposal-actions { flex-direction: column; }
  .btn-yes, .btn-no { width: 100%; min-width: 0; }
  .footer { flex-direction: column; gap: 6px; font-size: 0.7rem; }
  .stack.tall, .feed.tall { max-height: 360px; }
  .history-list.stack.tall { max-height: none; }
  .table-wrap { font-size: 0.8rem; }
  th, td { padding: 8px 6px; }
  .toast { left: 12px; right: 12px; bottom: 12px; }
}
@media (max-width: 420px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .mark { width: 40px; height: 40px; font-size: 18px; }
  .nav-title { font-size: 0.95rem; }
}

/* —— News / Voice / Stack pages —— */
.breaking-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 90, 90, 0.28);
  background: linear-gradient(90deg, rgba(255, 70, 70, 0.12), rgba(255,255,255,0.02) 40%);
}
.breaking-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff8f8f;
  border-right: 1px solid rgba(255, 90, 90, 0.2);
  background: rgba(255, 60, 60, 0.08);
}
.breaking-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.5);
  animation: break-pulse 1.4s ease-out infinite;
}
@keyframes break-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}
.breaking-track {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: thin;
}
.breaking-item {
  flex: 0 0 auto;
  max-width: 320px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, transform 0.15s;
}
.breaking-item:hover {
  border-color: rgba(255, 120, 120, 0.45);
  transform: translateY(-1px);
}
.breaking-sym {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: #ff9b9b;
  letter-spacing: 0.04em;
}
.breaking-title {
  font-weight: 650;
  font-size: 0.84rem;
  line-height: 1.35;
}
.breaking-src {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted-soft);
}
.news-layout, .voice-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 14px;
}
.news-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.news-item.is-breaking {
  border-color: rgba(255, 100, 100, 0.28);
  background: rgba(255, 70, 70, 0.04);
}
.news-item a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.4;
}
.news-item a:hover { color: var(--accent); }
.news-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted-soft);
}
.news-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff9b9b;
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
}
.news-syms {
  color: var(--accent);
}
.provider-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
}
.provider-card .on { color: var(--good); }
.provider-card .off { color: var(--muted); }
.provider-card .slot { color: var(--warn); }
.sources-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}
.source-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.source-chip {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  transition: transform .18s ease, border-color .18s ease, color .18s ease;
}
.source-chip.live {
  color: var(--accent-2);
  border-color: rgba(94,235,212,0.28);
  background: rgba(94,235,212,0.06);
}
.source-chip:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: rgba(110,161,255,0.4);
}

.voice-console {
  text-align: center;
  padding: 28px 20px;
}
.voice-ring {
  width: 120px; height: 120px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,0.12), transparent 50%),
    linear-gradient(145deg, rgba(110,161,255,0.25), rgba(94,235,212,0.15));
  border: 1px solid rgba(110,161,255,0.35);
  box-shadow: 0 0 0 8px rgba(110,161,255,0.06), 0 20px 50px rgba(0,0,0,0.35);
  animation: voice-glow 3s ease-in-out infinite;
}
.voice-ring.live {
  border-color: rgba(78,240,168,0.5);
  animation: voice-glow-live 1.2s ease-in-out infinite;
}
@keyframes voice-glow {
  0%, 100% { box-shadow: 0 0 0 8px rgba(110,161,255,0.06), 0 20px 50px rgba(0,0,0,0.35); }
  50% { box-shadow: 0 0 0 14px rgba(110,161,255,0.1), 0 24px 60px rgba(110,161,255,0.15); }
}
@keyframes voice-glow-live {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.voice-core {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.6rem;
  background: linear-gradient(145deg, #7eb0ff, #5eebd4);
  color: #041018;
  font-weight: 800;
}
.voice-desk-number {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 8px 0 4px;
  color: var(--accent-2);
}
.voice-level {
  width: min(220px, 70%);
  height: 6px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.voice-level span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5eebd4, #7eb0ff);
  transition: width .08s linear;
}
.voice-transcript {
  text-align: left;
  max-height: 160px;
  overflow: auto;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  min-height: 48px;
}
.voice-transcript .line { margin: 0 0 6px; }
.voice-transcript .who {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 6px;
}
.voice-transcript .who.you { color: var(--accent-2); }
.voice-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin: 16px 0;
}
.voice-brief {
  text-align: left;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 280px;
  overflow: auto;
}
.howto-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}
.howto-list strong { color: var(--ink); }

.caps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cap-card {
  border-radius: 18px;
  padding: 16px;
  transition: transform .18s ease, border-color .18s ease;
}
.cap-card:hover {
  transform: translateY(-2px);
  border-color: rgba(110,161,255,0.3);
}
.cap-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.cap-state {
  margin-top: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.cap-state.ok { color: var(--good); }
.cap-state.warn { color: var(--warn); }
.cap-state.bad { color: var(--bad); }
.cap-state.muted { color: var(--muted); }
.cap-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tool-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}
.tool-tag.trade { color: var(--good); border-color: rgba(78,240,168,0.3); }
.tool-tag.option { color: var(--purple); border-color: rgba(196,176,255,0.3); }
.tool-tag.read { color: var(--accent); border-color: rgba(110,161,255,0.25); }

@media (max-width: 1180px) {
  .stage-layout { grid-template-columns: 1fr; }
  .agent-inspect { min-height: auto; }
  .news-layout, .voice-layout { grid-template-columns: 1fr; }
  .caps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .stage-frame.game-frame { min-height: 300px; }
  .caps-grid { grid-template-columns: 1fr; }
  .legend-role { display: none; }
}
