:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #f0f2ef;
  --ink: #111512;
  --muted: #68706a;
  --line: #dde2dd;
  --accent: #087a52;
  --accent-soft: #e3f3eb;
  --profit: #c93c35;
  --profit-soft: #fae9e7;
  --loss: #18845b;
  --loss-soft: #e1f3eb;
  --warning: #a06408;
  --warning-soft: #fff2d6;
  --info: #2d64b3;
  --shadow: 0 12px 34px rgba(27, 42, 32, 0.08);
  --rail: 184px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(8, 122, 82, 0.22);
  outline-offset: 2px;
}

#app-shell { min-height: 100dvh; }
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  background: #111713;
  color: #f8faf8;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 18px;
  font-weight: 760;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #20c782;
  color: #071b11;
  font-size: 13px;
  font-weight: 850;
}
.rail-nav { display: grid; gap: 5px; margin-top: 42px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: transparent;
  color: #aeb7b0;
  cursor: pointer;
  text-align: left;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: #fff; background: #202a23; }
.nav-item.active { color: #fff; background: #263a2e; }
.rail-action { margin-top: auto; color: #c9d0cb; }

.workspace { margin-left: var(--rail); min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(22px, 4vw, 58px);
  border-bottom: 1px solid rgba(221, 226, 221, 0.85);
  background: rgba(247, 248, 246, 0.92);
  backdrop-filter: blur(18px);
}
.eyebrow, .label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.topbar h1, h2, h3, p { letter-spacing: 0; }
.topbar h1 { margin: 0; font-size: 24px; line-height: 1.15; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.readonly-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #425048;
  font-size: 12px;
  font-weight: 650;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); }
.icon-button svg { width: 18px; height: 18px; }

main { width: min(1320px, 100%); margin: 0 auto; padding: 30px clamp(22px, 4vw, 58px) 68px; }
.view { display: none; }
.view.active { display: block; animation: enter 170ms ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(3px); } }

.alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 6px;
  background: var(--warning-soft);
  color: #744903;
  font-size: 13px;
}
.alert svg { width: 17px; flex: 0 0 auto; margin-top: 1px; }

.portfolio-band { position: relative; margin-bottom: 34px; }
.portfolio-copy { min-height: 112px; }
.hero-value {
  min-height: 58px;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}
.skeleton { color: #a3aaa5; }
.delta { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 14px; font-weight: 680; }
.positive { color: var(--profit); }
.negative { color: var(--loss); }
.neutral { color: var(--muted); }
.range-control { position: absolute; top: 16px; right: 0; }
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 7px;
  background: #e7eae7;
}
.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(26, 38, 30, 0.10); }
.chart-frame { position: relative; width: 100%; }
.chart-frame canvas { display: block; width: 100%; height: 100%; }
.equity-frame { height: 260px; margin: 4px 0 15px; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  min-width: 126px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(17, 21, 18, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }
.account-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}
.account-strip > div { padding: 14px 18px; border-right: 1px solid var(--line); min-width: 0; }
.account-strip > div:first-child { padding-left: 0; }
.account-strip > div:last-child { border-right: 0; }
.account-strip span, .summary-card span { display: block; color: var(--muted); font-size: 12px; }
.account-strip strong, .summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.panel {
  min-width: 0;
  margin: 18px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.two-column > .panel { margin: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.text-button svg { width: 15px; }
.rows { min-height: 70px; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.symbol-tile {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
}
.row h3 { margin: 0; font-size: 14px; }
.row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.row-value { text-align: right; font-variant-numeric: tabular-nums; }
.row-value strong { display: block; font-size: 14px; }
.row-value span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.empty-state { display: grid; place-items: center; color: var(--muted); font-size: 13px; }

.attribution { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.attribution-item { padding: 14px 15px; border-radius: 6px; background: var(--surface-2); }
.attribution-item span { display: block; color: var(--muted); font-size: 12px; }
.attribution-item strong { display: block; margin-top: 7px; font-size: 18px; font-variant-numeric: tabular-nums; }
.evidence-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.evidence-item { display: flex; gap: 10px; align-items: flex-start; }
.evidence-item > i { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--warning); }
.evidence-item > i.ok { background: var(--accent); }
.evidence-item span { display: block; color: var(--muted); font-size: 11px; }
.evidence-item strong { display: block; margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-card { min-height: 96px; padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.summary-card strong { font-size: 20px; }
.summary-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; font-weight: 650; }
th:first-child, td:first-child { padding-left: 0; text-align: left; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr[data-contract] { cursor: pointer; }
tbody tr[data-contract]:hover td { background: #f8faf8; }
.direction-chip { display: inline-flex; min-width: 38px; justify-content: center; padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 750; }
.direction-chip.long { color: var(--profit); background: var(--profit-soft); }
.direction-chip.short { color: var(--loss); background: var(--loss-soft); }
.detail-panel h2 { margin-top: 0; }
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.fact { min-height: 76px; padding: 13px; background: var(--surface); }
.fact span { color: var(--muted); font-size: 11px; }
.fact strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }

.strategy-toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; }
.field { display: grid; gap: 7px; }
.field span { color: var(--muted); font-size: 12px; font-weight: 650; }
.field input, .field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--ink);
}
.field.compact select { min-width: 160px; min-height: 36px; }
.secondary-button, .primary-button, .danger-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}
.secondary-button { border: 1px solid var(--line); background: var(--surface); }
.secondary-button:hover { border-color: #b8c1ba; background: var(--surface-2); }
.secondary-button svg { width: 16px; }
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.danger-button { width: 100%; border: 1px solid #e6b9b5; background: #fff; color: #a42d28; }
.strategy-toolbar > .segmented { margin-left: auto; }
.strategy-hero, .decision-band {
  min-height: 132px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111713;
  color: #fff;
}
.strategy-hero .label, .strategy-hero .subtle { color: #aeb7b0; }
.signal-value { font-size: 34px; font-weight: 800; }
.signal-value.long { color: #ff8a82; }
.signal-value.short { color: #56d79e; }
.subtle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.inline-metrics { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 16px; }
.inline-metric span { display: block; color: #aeb7b0; font-size: 11px; }
.inline-metric strong { display: block; margin-top: 5px; font-size: 16px; font-variant-numeric: tabular-nums; }
.chart-panel { padding-bottom: 15px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11px; }
.legend > span { display: flex; align-items: center; gap: 5px; }
.line-swatch { width: 17px; height: 2px; background: var(--ink); }
.line-swatch.anchor { background: #d99827; }
.signal-swatch { width: 8px; height: 8px; border-radius: 50%; }
.signal-swatch.buy { background: var(--profit); }
.signal-swatch.sell { background: var(--loss); }
.strategy-frame { height: 430px; }
.logic-steps { display: grid; }
.logic-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.logic-step:first-child { border-top: 0; }
.logic-step > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800; }
.logic-step h3 { margin: 0; font-size: 13px; }
.logic-step p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.robustness { display: grid; gap: 11px; }
.check-item { display: flex; gap: 8px; align-items: flex-start; color: #374139; font-size: 12px; line-height: 1.45; }
.check-item svg { width: 16px; color: var(--accent); flex: 0 0 auto; }
.period-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 7px; }
.period-card { padding: 10px; border-radius: 5px; background: var(--surface-2); }
.period-card span { display: block; color: var(--muted); font-size: 10px; }
.period-card strong { display: block; margin-top: 4px; font-size: 13px; }

.decision-band { align-items: flex-start; margin-bottom: 15px; }
.decision-band h2 { margin: 0; font-size: 24px; }
.decision-band p { margin: 7px 0 0; color: #b6beb8; font-size: 13px; line-height: 1.5; }
.decision-badge { padding: 6px 9px; border-radius: 5px; background: #263a2e; color: #a5edca; font-size: 11px; font-weight: 750; }
.risk-bars { display: grid; gap: 11px; }
.risk-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 70px; align-items: center; gap: 10px; font-size: 12px; }
.risk-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.risk-track > i { display: block; height: 100%; background: var(--info); }
.risk-row strong { text-align: right; font-variant-numeric: tabular-nums; }

.agent-view { min-height: calc(100dvh - 186px); padding-bottom: 98px; }
.agent-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.agent-header h2 { margin: 0; font-size: 26px; }
.agent-header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.prompt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.prompt-grid button { min-height: 42px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 12px; }
.prompt-grid button:hover { border-color: #aeb9b0; }
.agent-thread { display: grid; gap: 14px; padding: 8px 0 24px; }
.agent-welcome { min-height: 230px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.agent-welcome svg { width: 30px; height: 30px; color: var(--accent); }
.agent-welcome h3 { margin: 10px 0 3px; color: var(--ink); font-size: 16px; }
.agent-welcome p { margin: 0; max-width: 430px; font-size: 12px; }
.message { max-width: min(760px, 88%); padding: 13px 15px; border-radius: 8px; line-height: 1.6; overflow-wrap: anywhere; }
.message.user { justify-self: end; background: #111713; color: #fff; white-space: pre-wrap; font-size: 13px; }
.message.agent { justify-self: start; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.message.agent h1, .message.agent h2, .message.agent h3 { margin: 1.1em 0 0.45em; font-size: 1.05em; }
.message.agent h1:first-child, .message.agent h2:first-child, .message.agent h3:first-child { margin-top: 0; }
.message.agent p { margin: 0.6em 0; }
.message.agent ul, .message.agent ol { margin: 0.6em 0; padding-left: 1.5em; }
.message.agent code { padding: 2px 4px; border-radius: 3px; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.message.agent pre { overflow-x: auto; padding: 10px; border-radius: 5px; background: #111713; color: #e8eee9; }
.message.agent pre code { padding: 0; background: transparent; }
.message.agent table { margin: 10px 0; font-size: 12px; }
.message.agent blockquote { margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--accent); color: var(--muted); }
.message-meta { margin-top: 7px; color: var(--muted); font-size: 10px; }
.typing { display: inline-flex; gap: 4px; align-items: center; min-width: 54px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #8a928c; animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: 140ms; }
.typing i:nth-child(3) { animation-delay: 280ms; }
@keyframes typing { 0%, 70%, 100% { transform: translateY(0); opacity: 0.45; } 35% { transform: translateY(-4px); opacity: 1; } }
.composer {
  position: fixed;
  z-index: 14;
  left: calc(var(--rail) + 50%);
  bottom: 18px;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - var(--rail) - 60px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid #cfd5d0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 42px rgba(26, 39, 30, 0.16);
  backdrop-filter: blur(18px);
}
.composer textarea { max-height: 140px; resize: none; border: 0; outline: 0; padding: 10px 0; background: transparent; line-height: 1.4; }
.send-button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; }
.send-button:disabled { opacity: 0.45; cursor: default; }
.send-button svg { width: 19px; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(17, 23, 19, 0.48); backdrop-filter: blur(4px); }
.auth-dialog, .sheet-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.23);
}
.auth-dialog form { padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; }
.auth-dialog h2 { margin: 0; font-size: 24px; }
.auth-dialog p { margin: 8px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-dialog .primary-button { width: 100%; margin-top: 7px; }
.form-error { min-height: 18px; margin: 6px 0 !important; color: #ad302b !important; font-size: 12px !important; }
.sheet-dialog { padding: 23px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-header h2 { margin: 0; font-size: 21px; }
.settings-list { margin: 18px 0; border-block: 1px solid var(--line); }
.settings-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 13px; }
.settings-list > div:first-child { border-top: 0; }
.settings-list span { color: var(--muted); }
.settings-list strong { text-align: right; overflow-wrap: anywhere; }
.dialog-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.parameter-form { display: grid; gap: 14px; margin-top: 18px; }
.parameter-form label { display: grid; gap: 6px; }
.parameter-form label > span { display: flex; justify-content: space-between; color: #465049; font-size: 12px; }
.parameter-form input[type="range"] { width: 100%; accent-color: var(--accent); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 15px;
  border-radius: 6px;
  background: #111713;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.bottom-nav { display: none; }

@media (max-width: 980px) {
  :root { --rail: 72px; }
  .rail { width: var(--rail); align-items: center; padding-inline: 11px; }
  .brand > span:last-child, .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .two-column, .strategy-details { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  :root { --rail: 0px; }
  .rail { display: none; }
  .workspace { margin-left: 0; }
  .topbar {
    min-height: 74px;
    padding: max(12px, env(safe-area-inset-top)) 18px 12px;
    align-items: flex-end;
  }
  .topbar h1 { font-size: 22px; }
  .readonly-pill { display: none; }
  main { padding: 21px 16px calc(92px + env(safe-area-inset-bottom)); }
  .portfolio-copy { min-height: 126px; }
  .hero-value { font-size: 42px; }
  .range-control { position: static; margin: 3px 0 8px; }
  .equity-frame { height: 220px; }
  .account-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-strip > div { border-bottom: 1px solid var(--line); }
  .account-strip > div:nth-child(2) { border-right: 0; }
  .account-strip > div:nth-child(3), .account-strip > div:nth-child(4) { border-bottom: 0; }
  .account-strip > div:first-child, .account-strip > div:nth-child(3) { padding-left: 0; }
  .panel { padding: 18px 15px; border-inline: 0; border-radius: 0; margin-inline: -16px; }
  .two-column { gap: 0; }
  .two-column > .panel { margin-inline: -16px; }
  .two-column > .panel + .panel { margin-top: 12px; }
  .attribution, .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { gap: 8px; }
  .summary-card { min-height: 88px; padding: 14px; }
  .summary-card strong { font-size: 17px; }
  .strategy-toolbar { flex-wrap: wrap; }
  .strategy-toolbar > .segmented { order: 3; width: 100%; margin-left: 0; }
  .strategy-toolbar > .segmented button { flex: 1; }
  .field.compact { flex: 1; }
  .field.compact select { min-width: 0; }
  .strategy-hero, .decision-band { flex-direction: column; align-items: stretch; padding: 18px; }
  .inline-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strategy-frame { height: 340px; }
  .chart-panel .section-heading { display: block; }
  .legend { margin-top: 11px; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risk-row { grid-template-columns: 78px minmax(0, 1fr) 60px; }
  .agent-view { min-height: calc(100dvh - 160px); padding-bottom: 88px; }
  .agent-header { align-items: flex-start; }
  .agent-header h2 { font-size: 22px; }
  .agent-header .segmented { flex-direction: column; }
  .prompt-grid { display: flex; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .prompt-grid button { flex: 0 0 112px; }
  .message { max-width: 94%; }
  .composer {
    left: 12px;
    right: 12px;
    bottom: calc(69px + env(safe-area-inset-bottom));
    transform: none;
    width: auto;
  }
  .bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    height: calc(64px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px env(safe-area-inset-bottom);
    border-top: 1px solid rgba(221, 226, 221, 0.9);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
  }
  .bottom-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: #7b837d;
    font-size: 10px;
    cursor: pointer;
  }
  .bottom-nav button.active { color: var(--accent); }
  .bottom-nav svg { width: 20px; height: 20px; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
