:root {
  --bg: #f2ede2;
  --bg-strong: #e6d5b8;
  --ink: #1c2a1d;
  --accent: #a63a24;
  --accent-soft: #d96f43;
  --panel: rgba(255, 250, 242, 0.88);
  --line: rgba(28, 42, 29, 0.12);
  --shadow: 0 24px 80px rgba(75, 49, 27, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.55), transparent 28%),
    linear-gradient(135deg, var(--bg) 0%, #f7f4ee 36%, var(--bg-strong) 100%);
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(166,58,36,0.08) 1px, transparent 1px),
    linear-gradient(rgba(28,42,29,0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
  pointer-events: none;
}

.layout { width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 40px; }
.login-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(480px, 100%);
}
.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.login-message {
  margin: 14px 0 0;
  color: rgba(28, 42, 29, 0.72);
}
.hero { padding: 20px 20px 12px; animation: rise 500ms ease-out both; }
.hero-topline {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: start;
}
.hero-meta {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.24em; color: var(--accent); font-size: 0.8rem; }
.session-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
}
.hero-logout {
  padding-inline: 14px;
}
.session-started {
  color: rgba(28, 42, 29, 0.72);
  font-size: 0.9rem;
}
h1, h2 { margin-top: 0; }
h1 {
  max-width: 24ch;
  font-size: clamp(1.45rem, 2.6vw, 2.3rem);
  line-height: 1.06;
  margin: 8px 0 8px;
}
.subtitle { max-width: 68ch; font-size: 1rem; margin: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.compact-actions { margin-top: 12px; }
.sector-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.compliance-controls {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.compliance-ai-row {
  display: grid;
  grid-template-columns: fit-content(320px) fit-content(220px);
  gap: 12px;
  margin-top: 12px;
  justify-content: start;
  align-items: end;
}
.compliance-input-group {
  display: grid;
  gap: 6px;
}
.compliance-input-group label {
  font-size: 0.86rem;
  color: rgba(28, 42, 29, 0.72);
}
.compliance-input-group input,
.compliance-input-group select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.agent-mode-switch-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.switch {
  position: relative;
  display: inline-flex;
  width: 56px;
  height: 32px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(28, 42, 29, 0.18);
  border: 1px solid rgba(28, 42, 29, 0.12);
  transition: background 160ms ease, border-color 160ms ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fffaf2;
  box-shadow: 0 4px 12px rgba(28, 42, 29, 0.18);
  transition: transform 160ms ease;
}
.switch input:checked + .switch-slider {
  background: rgba(31, 95, 74, 0.8);
  border-color: rgba(31, 95, 74, 0.5);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(24px);
}
.switch input:focus-visible + .switch-slider {
  outline: 2px solid rgba(166,58,36,0.4);
  outline-offset: 2px;
}
.switch input:disabled + .switch-slider {
  opacity: 0.45;
}
.switch-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}
.danger-note {
  margin: 10px 0 0;
  color: #8f2d1d;
  font-size: 0.9rem;
  line-height: 1.45;
}

button {
  border: none;
  background: var(--accent);
  color: white;
  padding: 11px 16px;
  font-size: 0.96rem;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, background 160ms ease;
}

button:hover { transform: translateY(-1px); background: var(--accent-soft); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); box-shadow: none; }
button.danger {
  border-color: rgba(143, 45, 29, 0.35);
  color: #8f2d1d;
  background: rgba(166, 58, 36, 0.08);
}
button.danger:hover {
  background: rgba(166, 58, 36, 0.16);
  color: #7b2417;
}
button.danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.run-toggle {
  position: relative;
}
.run-toggle.active {
  background: #1f5f4a;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.18), 0 18px 40px rgba(31, 95, 74, 0.22);
  transform: translateY(1px);
}
.run-toggle.active:hover {
  background: #28745c;
}
.run-toggle.pending {
  background: #8a6714;
  box-shadow: 0 18px 40px rgba(138, 103, 20, 0.22);
}
.run-toggle.pending:hover {
  background: #a57c18;
}
.sector-toggle {
  background: rgba(255, 250, 242, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.sector-toggle.active {
  background: var(--ink);
  color: white;
}
.sector-toggle:not(.active) {
  opacity: 0.56;
}
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lower { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 600ms ease-out both;
}

.metric {
  position: relative;
  z-index: 3;
}

.headline-strip {
  padding-block: 16px;
  position: relative;
  z-index: 1;
}

.headline-news-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.headline-news-item,
.headline-news-empty {
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.headline-news-item {
  display: grid;
  gap: 8px;
}

.headline-news-item strong {
  line-height: 1.3;
}

.headline-news-item p,
.headline-news-empty {
  margin: 0;
  color: rgba(28, 42, 29, 0.72);
  font-size: 0.92rem;
}

.headline-news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(28, 42, 29, 0.62);
}

.headline-symbol {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(166,58,36,0.1);
  color: var(--accent);
  font-weight: 700;
}

.metric p { margin: 0; font-size: clamp(1.5rem, 2vw, 2rem); }
.wide { grid-column: span 2; }
.full { grid-column: 1 / -1; }
.decision-spotlight {
  overflow: visible;
  position: relative;
  z-index: 4;
}
.decision-spotlight::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(166,58,36,0.18), transparent 65%);
  pointer-events: none;
}
.decision-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: center;
}
.decision-layout.with-positions {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  align-items: stretch;
}
.decision-main {
  display: grid;
  gap: 18px;
}
.badge-stack {
  display: grid;
  gap: 8px;
  justify-items: end;
}
.decision-headline {
  font-size: clamp(1.2rem, 2vw, 2rem);
  line-height: 1.05;
  margin: 0 0 8px;
}
.decision-meta {
  margin: 0;
  color: rgba(28, 42, 29, 0.72);
}
.manual-trade-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.52);
}
.manual-trade-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.manual-trade-group {
  display: grid;
  gap: 6px;
}
.manual-trade-group label {
  font-size: 0.86rem;
  color: rgba(28, 42, 29, 0.72);
}
.manual-trade-group select,
.manual-trade-group input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.78);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.manual-trade-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.agent-vote-cloud {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  min-height: 140px;
}
.vote-chip {
  position: relative;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  animation: floatIn 420ms ease both;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}
.vote-chip.buy { background: rgba(31,95,74,0.14); color: #1f5f4a; }
.vote-chip.sell { background: rgba(166,58,36,0.14); color: #a63a24; }
.vote-chip.hold { background: rgba(53,92,154,0.12); color: #355c9a; }
.vote-chip strong { display: block; }
.vote-chip span { display: block; margin-top: 4px; opacity: 0.78; font-size: 0.82rem; }
.vote-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(280px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(28, 42, 29, 0.96);
  color: #fff8ef;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 30;
}
.vote-chip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(28, 42, 29, 0.96);
  opacity: 0;
  transition: opacity 140ms ease;
}
.vote-chip:hover::after,
.vote-chip:hover::before {
  opacity: 1;
}
.position-spotlight {
  background: rgba(255,255,255,0.42);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.compact-header h3 {
  margin: 0;
  font-size: 1rem;
}
.position-spotlight-list {
  display: grid;
  gap: 10px;
}
.position-spotlight-empty {
  color: rgba(28, 42, 29, 0.65);
  font-size: 0.94rem;
}
.position-pill {
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  display: grid;
  gap: 8px;
}
.position-pill.gain {
  background: rgba(31,95,74,0.11);
}
.position-pill.loss {
  background: rgba(166,58,36,0.11);
}
.position-pill.flat {
  background: rgba(53,92,154,0.09);
}
.position-pill-head,
.position-pill-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.position-pill-head strong {
  font-size: 0.98rem;
}
.position-pill-meta {
  color: rgba(28, 42, 29, 0.72);
  font-size: 0.86rem;
}
.position-pill-pnl {
  font-weight: 700;
}
.top-five-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.rank-card {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.rank-card strong { display: block; font-size: 1rem; margin-bottom: 6px; }
.rank-card .rank-meta { color: rgba(28, 42, 29, 0.74); font-size: 0.85rem; }
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.heatmap-cell {
  border-radius: 18px;
  padding: 14px 12px;
  min-height: 92px;
  border: 1px solid var(--line);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.heatmap-cell.buy { background: linear-gradient(160deg, #1f5f4a, #56a07d); }
.heatmap-cell.sell { background: linear-gradient(160deg, #8f2d1d, #d96f43); }
.heatmap-cell.hold { background: linear-gradient(160deg, #355c9a, #7a9ad1); }
.heatmap-cell strong { display: block; font-size: 1rem; }
.heatmap-cell small { opacity: 0.9; }
.roundtable-debate {
  display: grid;
  gap: 12px;
}
.roundtable-history {
  display: grid;
  gap: 12px;
}
.roundtable-history-item {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.58);
  padding: 12px 14px;
}
.roundtable-history-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
.roundtable-history-item[open] summary {
  margin-bottom: 12px;
}
.roundtable-card,
.roundtable-empty {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
  padding: 14px;
}
.roundtable-card {
  display: grid;
  gap: 12px;
}
.roundtable-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.roundtable-head strong {
  display: block;
  font-size: 1.02rem;
}
.roundtable-action {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.roundtable-action.buy {
  background: rgba(31,95,74,0.12);
  color: #1f5f4a;
}
.roundtable-action.sell {
  background: rgba(166,58,36,0.12);
  color: #8f2d1d;
}
.roundtable-action.hold {
  background: rgba(53,92,154,0.12);
  color: #355c9a;
}
.roundtable-score {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}
.roundtable-score span {
  font-weight: 700;
}
.roundtable-score small,
.roundtable-summary,
.roundtable-vote small,
.roundtable-empty {
  color: rgba(28, 42, 29, 0.72);
}
.roundtable-reason {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(194, 139, 34, 0.10);
  color: #7c6015;
  border: 1px solid rgba(194, 139, 34, 0.18);
  line-height: 1.4;
}
.roundtable-reason.active {
  background: rgba(31,95,74,0.10);
  color: #1f5f4a;
  border-color: rgba(31,95,74,0.18);
}
.roundtable-reason.warning {
  background: rgba(166,58,36,0.10);
  color: #8f2d1d;
  border-color: rgba(166,58,36,0.18);
}
.roundtable-summary {
  margin: 0;
  line-height: 1.45;
}
.roundtable-agent-changes {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(53, 92, 154, 0.08);
  border: 1px solid rgba(53, 92, 154, 0.14);
  color: rgba(28, 42, 29, 0.82);
}
.roundtable-agent-changes strong {
  color: var(--ink);
}
.roundtable-agent-changes small {
  color: rgba(28, 42, 29, 0.72);
  line-height: 1.4;
}
.roundtable-votes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.roundtable-vote {
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  display: grid;
  gap: 6px;
}
.roundtable-vote.buy {
  background: rgba(31,95,74,0.11);
}
.roundtable-vote.sell {
  background: rgba(166,58,36,0.11);
}
.roundtable-vote.hold {
  background: rgba(53,92,154,0.08);
}
.roundtable-vote strong,
.roundtable-vote span {
  display: block;
}
.roundtable-vote span {
  font-size: 0.84rem;
  font-weight: 700;
}
.roundtable-vote small {
  line-height: 1.35;
}
.card-header { display: flex; justify-content: space-between; align-items: center; }
.card-header h2,
.card-header h3,
.metric h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tag { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: rgba(166,58,36,0.1); color: var(--accent); }
.tag.neutral {
  background: rgba(194, 139, 34, 0.12);
  color: #8a6714;
}
.status-tag.running {
  background: rgba(31, 95, 74, 0.14);
  color: #1f5f4a;
}
.status-tag.stopped {
  background: rgba(53, 92, 154, 0.12);
  color: #355c9a;
}
.status-tag.warning {
  background: rgba(166, 58, 36, 0.14);
  color: #8f2d1d;
}
.status-tag.neutral {
  background: rgba(194, 139, 34, 0.12);
  color: #8a6714;
}
.info-tip {
  position: relative;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(28, 42, 29, 0.18);
  background: rgba(255,255,255,0.72);
  color: var(--ink);
  box-shadow: none;
  font-size: 0.8rem;
  line-height: 1;
}
.info-tip:hover {
  background: rgba(255,255,255,0.92);
}
.info-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(280px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(28, 42, 29, 0.96);
  color: #fff8ef;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 40;
}
.info-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(28, 42, 29, 0.96);
  opacity: 0;
  transition: opacity 140ms ease;
}
.info-tip:hover::after,
.info-tip:hover::before,
.info-tip:focus-visible::after,
.info-tip:focus-visible::before {
  opacity: 1;
}
.info-tip:focus-visible {
  outline: 2px solid rgba(166,58,36,0.4);
  outline-offset: 2px;
}
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: "Courier New", monospace; line-height: 1.45; }
.decision-details summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}
.decision-details summary::-webkit-details-marker { display: none; }
.decision-details[open] summary {
  margin-bottom: 16px;
}
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.55); }
#equityChart { width: 100%; height: 220px; background: rgba(255,255,255,0.45); border-radius: 18px; }
#marketChart { width: 100%; height: 220px; background: rgba(255,255,255,0.45); border-radius: 18px; margin-bottom: 14px; }
.market-overview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.chart-axis { stroke: rgba(28, 42, 29, 0.34); stroke-width: 1.2; }
.chart-grid { stroke: rgba(28, 42, 29, 0.08); stroke-width: 1; stroke-dasharray: 4 6; }
.chart-label { fill: rgba(28, 42, 29, 0.65); font-size: 11px; font-family: Georgia, "Times New Roman", serif; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; }
.chart-base { fill: none; stroke: rgba(28, 42, 29, 0.18); stroke-width: 1; stroke-dasharray: 6 6; }
.chart-line-alt-0 { fill: none; stroke: #a63a24; stroke-width: 2.5; }
.chart-line-alt-1 { fill: none; stroke: #1f5f4a; stroke-width: 2.5; }
.chart-line-alt-2 { fill: none; stroke: #c28b22; stroke-width: 2.5; }
.chart-line-alt-3 { fill: none; stroke: #355c9a; stroke-width: 2.5; }
.chart-line-alt-4 { fill: none; stroke: #7d4aa8; stroke-width: 2.5; }
.chart-line-alt-5 { fill: none; stroke: #008b8b; stroke-width: 2.5; }
.market-list { grid-template-columns: repeat(2, 1fr); }
.market-item { display: grid; gap: 8px; }
.market-item-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.market-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 12px;
}
.market-item-meta {
  color: rgba(28, 42, 29, 0.74);
  font-size: 0.92rem;
  line-height: 1.4;
}
.provider-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.provider-pill {
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
  display: grid;
  gap: 4px;
}
.provider-pill strong {
  font-size: 0.95rem;
}
.provider-pill span,
.provider-pill small {
  color: rgba(28, 42, 29, 0.72);
}
.market-toggle-item {
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}
.market-toggle-item:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.72);
}
.market-toggle-item.hidden {
  opacity: 0.48;
}
.market-toggle-item.hidden .market-item-head span:last-child {
  text-decoration: line-through;
}
.metric small { display: block; margin-top: 6px; color: rgba(28, 42, 29, 0.65); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 960px) {
  .layout { width: min(100% - 24px, 1280px); padding: 20px 0 32px; }
  .hero-topline { grid-template-columns: 1fr; }
  .hero-meta { justify-content: flex-start; }
  .session-strip { justify-content: flex-start; }
  .grid, .lower { grid-template-columns: 1fr 1fr; }
  .wide { grid-column: span 2; }
  .full { grid-column: 1 / -1; }
  .headline-news-list { grid-template-columns: 1fr 1fr; }
  .compliance-controls { grid-template-columns: 1fr 1fr; }
  .compliance-ai-row { grid-template-columns: 1fr 1fr; }
  .decision-layout { grid-template-columns: 1fr; }
  .decision-layout.with-positions { grid-template-columns: 1fr; }
  .manual-trade-row { grid-template-columns: 1fr; }
  .provider-summary { grid-template-columns: 1fr 1fr; }
  .agent-vote-cloud,
  .top-five-grid,
  .heatmap-grid,
  .roundtable-votes { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .layout { width: min(100% - 16px, 1280px); padding: 14px 0 28px; }
  .hero { padding: 12px 4px 10px; }
  h1 { font-size: clamp(1.25rem, 7vw, 1.65rem); max-width: none; }
  .subtitle { font-size: 0.94rem; }
  .actions,
  .sector-controls,
  .compact-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  button,
  .sector-toggle {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    font-size: 0.95rem;
  }
  .grid, .lower, .wide, .full { grid-template-columns: 1fr; grid-column: span 1; }
  .card { padding: 16px; border-radius: 22px; }
  .card-header {
    gap: 10px;
    align-items: flex-start;
  }
  .card-header h2,
  .card-header h3,
  .metric h2 {
    flex-wrap: wrap;
  }
  .tag { font-size: 0.82rem; }
  .metric p { font-size: 1.55rem; }
  .market-list { grid-template-columns: 1fr; }
  .headline-news-list { grid-template-columns: 1fr; }
  .compliance-controls { grid-template-columns: 1fr; }
  .compliance-ai-row { grid-template-columns: 1fr; }
  .provider-summary { grid-template-columns: 1fr; }
  .market-overview-actions { display: grid; grid-template-columns: 1fr; }
  .agent-vote-cloud,
  .top-five-grid,
  .heatmap-grid,
  .roundtable-votes { grid-template-columns: 1fr; }
  #equityChart,
  #marketChart { height: 190px; }
  .list li { padding: 10px; }
  .decision-headline { font-size: 1.1rem; }
}

@media (max-width: 420px) {
  .layout { width: min(100% - 12px, 1280px); }
  .hero { padding-inline: 0; }
  .eyebrow { font-size: 0.72rem; }
  .session-started { font-size: 0.82rem; }
  .card { padding: 14px; }
}
