:root {
  color-scheme: dark;
  --page: #0f172a;
  --card: #1e293b;
  --input: #020617;
  --line: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --orange: #f97316;
  --slate: #94a3b8;
  --green: #10b981;
  --red: #f43f5e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  background: var(--page);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 15% 0%, #172554 0, var(--page) 34rem); color: var(--text); }
body[data-mode="simulation"] { background: radial-gradient(circle at 15% 0%, #312e81 0, var(--page) 34rem); }
body[data-mode="account"] .simulation-only,
body[data-mode="simulation"] .account-only { display: none !important; }
button, input, select { min-height: 44px; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; }
.hidden { display: none !important; }
.shell { width: min(100%, 1360px); margin: 0 auto; padding: 18px 24px 48px; }

.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.topbar h1 { margin: 1px 0 4px; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.15; }
.eyebrow, .section-kicker { margin: 0; color: #60a5fa; font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
.subtitle { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; color: #cbd5e1; font-size: .84rem; }
.scope-badge, .state-badge, .draft-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid #475569; border-radius: 999px; color: #cbd5e1; background: #0f172a; font-size: .68rem; font-weight: 900; }
.state-badge { border-color: #059669; color: #a7f3d0; }
.state-badge[data-state="disconnected"], .state-badge[data-state="checking"] { border-color: #60a5fa; color: #bfdbfe; }
.state-badge[data-state="uninitialized"] { border-color: #f59e0b; color: #fde68a; }
.state-badge[data-state="unauthorized"], .state-badge[data-state="error"] { border-color: #f43f5e; color: #fecdd3; }
.draft-badge { border-color: #64748b; color: #e2e8f0; }
.mode-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #020617; }
.mode-nav a { min-height: 44px; display: grid; place-items: center; padding: 0 18px; border-radius: 6px; color: var(--muted); font-weight: 850; text-decoration: none; }
.mode-nav a[aria-current="page"] { color: white; background: #1d4ed8; }
body[data-mode="simulation"] .mode-nav a[aria-current="page"] { background: #6d28d9; }

.mode-banner { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 16px; padding: 9px 14px; border: 1px solid #2563eb; border-radius: 10px; background: #172554; color: #dbeafe; }
.mode-banner > span { flex: 1; font-size: .78rem; }
.mode-banner > .info-icon { flex: 0 0 22px; width: 22px; min-height: 22px; display: grid; place-items: center; border: 1px solid #60a5fa; border-radius: 50%; color: #bfdbfe; font: 900 .72rem ui-monospace, monospace; }
.simulation-banner { border-color: #7c3aed; background: #2e1065; }
.connection-settings { position: relative; flex: 0 0 auto; }
.connection-settings summary { min-height: 44px; display: grid; place-items: center; cursor: pointer; color: #bfdbfe; font-size: .75rem; font-weight: 800; }
.connection-settings[open] { width: min(100%, 360px); padding: 10px; border: 1px solid #475569; border-radius: 8px; background: #0f172a; }
.connection-settings small { color: var(--muted); font-size: .68rem; }

.saved-strip { min-height: 110px; margin-bottom: 24px; padding: 14px 16px; border: 1px solid #047857; border-radius: 12px; background: linear-gradient(110deg, #052e2b, var(--card)); box-shadow: 0 12px 30px #0003; }
.saved-strip-title { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.saved-strip h2 { margin: 0; font-size: .95rem; }
.saved-values { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid #1f4e49; border-radius: 8px; background: #1f4e49; }
.saved-values div { min-width: 0; padding: 9px 10px; background: #0b2526; }
.saved-values dt { color: #86a9a5; font-size: .66rem; }
.saved-values dd { margin: 5px 0 0; color: #ecfdf5; font: 800 .8rem ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.save-status { margin-top: 8px; color: #a7f3d0; font-size: .72rem; }
.account-setup-guide { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid #2563eb; border-radius: 8px; color: #dbeafe; background: #172554; }
.account-setup-guide > div { display: grid; gap: 3px; }
.account-setup-guide strong { font-size: .76rem; }
.account-setup-guide span { color: #bfdbfe; font-size: .7rem; line-height: 1.5; }
.text-link { color: #93c5fd; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.saved-actions { margin-top: 10px; }
.management-actions { margin-top: 8px; border-top: 1px solid #1f4e49; }
.management-actions summary { min-height: 44px; display: flex; align-items: center; width: max-content; cursor: pointer; color: #86a9a5; font-size: .72rem; font-weight: 850; }
.management-actions[open] { padding-bottom: 2px; }
.management-actions[data-state="attention"] summary { color: #fde68a; }
.management-actions .needs-attention:not(:disabled) { border-color: var(--amber); color: #1c1917; background: var(--amber); box-shadow: 0 0 0 3px #f59e0b26; }

.workspace { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 568px); grid-template-areas: "input action" "market defense"; align-items: start; gap: 24px; }
.action-panel { grid-area: action; }
.input-panel { grid-area: input; }
.market-panel { grid-area: market; }
.defense-panel { grid-area: defense; }
.panel { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 16px 36px #0003; }
.panel h2 { margin: 2px 0 0; font-size: 1.05rem; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.hint { margin: 5px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }

.field { display: grid; align-content: start; gap: 6px; min-width: 0; color: #cbd5e1; font-size: .76rem; font-weight: 750; }
.field small { color: var(--muted); font-size: .67rem; font-weight: 500; line-height: 1.45; }
.field input, .field select, select, input { width: 100%; min-height: 44px; padding: 8px 11px; border: 1px solid #64748b; border-radius: 6px; outline: 0; color: var(--text); background: var(--input); font-variant-numeric: tabular-nums; }
input::placeholder { color: #64748b; opacity: 1; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #3b82f633; }
.field input[readonly] { border-style: dashed; color: #a7f3d0; background: #071b20; }
.field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px #f43f5e24; }
.field-error, .inline-error { color: #fecdd3; font-size: .72rem; font-weight: 700; }
.danger-label { color: #fecdd3; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.compact-field { min-width: 130px; }
.button { min-height: 44px; padding: 8px 14px; border: 1px solid #2563eb; border-radius: 6px; color: white; background: #2563eb; font-weight: 850; }
.button:hover:not(:disabled) { filter: brightness(1.12); }
.button.secondary { border-color: #475569; background: #0f172a; }
.button.quiet { border-color: transparent; color: #bfdbfe; background: transparent; }
.simulation-button { border-color: #7c3aed; background: #7c3aed; }
.inline-actions, .action-buttons, .dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar { display: flex; align-items: end; gap: 8px; }
.status-panel { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin-bottom: 12px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #0f172a; }
.status-pill { min-height: 28px; display: grid; place-items: center; padding: 4px 9px; border-radius: 999px; color: #cbd5e1; background: #334155; font-size: .68rem; font-weight: 900; }
.status-pill[data-state="success"] { color: #d1fae5; background: #065f46; }
.status-pill[data-state="loading"] { color: #dbeafe; background: #1e40af; }
.status-pill[data-state="error"], .status-pill[data-state="timeout"] { color: #ffe4e6; background: #9f1239; }
.data-meta { color: var(--muted); font-size: .7rem; line-height: 1.45; overflow-wrap: anywhere; }

.action { position: relative; padding: 20px; border: 1px solid #64748b; border-left: 4px solid var(--slate); border-radius: 12px; background: #111827; }
.action[data-tone="buy"] { border-left-color: var(--blue); background: #172554; }
.action[data-tone="sell"] { border-left-color: var(--amber); background: #2a1c08; }
.action[data-tone="hold"] { border-left-color: var(--slate); background: #111827; }
.action[data-tone="limit"], .action[data-tone="error"] { border-left-color: var(--red); background: #32121b; }
.action-label { color: #e2e8f0; font-size: .8rem; font-weight: 900; letter-spacing: .03em; }
.action-value { margin: 8px 0 10px; color: white; font: 900 clamp(2.5rem, 5vw, 3rem) ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1; font-variant-numeric: tabular-nums; }
.action[data-tone="buy"] .action-value { color: #bfdbfe; }
.action[data-tone="sell"] .action-value { color: #fde68a; }
.action[data-tone="limit"] .action-value, .action[data-tone="error"] .action-value { color: #fecdd3; }
.action-message { margin: 0; color: #cbd5e1; font-size: .8rem; line-height: 1.5; }
.action-facts { display: grid; gap: 5px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #475569; }
.action-facts p { display: grid; grid-template-columns: 50px 1fr; gap: 8px; margin: 0; color: #cbd5e1; font-size: .72rem; line-height: 1.45; }
.action-facts span { color: #93c5fd; font-weight: 900; letter-spacing: .08em; }
.action-buttons { margin-top: 10px; }
.action-buttons .button { flex: 1 1 140px; }

.rows { display: grid; }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #334155; font-size: .76rem; }
.row:last-child { border-bottom: 0; }
.row span:first-child { color: var(--muted); }
.row output { max-width: 52%; text-align: right; font: 800 .78rem ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.subhead { margin: 15px 0 3px; color: var(--blue); font-size: .7rem; font-weight: 900; letter-spacing: .05em; }
.blue-head { color: var(--blue); }
.green-head { color: var(--green); }
.amber-head { color: var(--amber); }
.signal-used-row, .emphasis-row { border-top: 1px solid #475569; }
.signal-used-row output, .emphasis-row output { color: #bfdbfe; }
.recognized-row span:first-child, .recognized-row output { color: #a7f3d0; font-weight: 900; }
.carry-box { display: grid; gap: 6px; margin-top: 12px; padding: 10px; border: 1px solid #475569; border-radius: 8px; background: #0f172a; }
.carry-box small { color: var(--muted); font-size: .68rem; }
.defense-card { padding: 13px; border: 1px solid #047857; border-radius: 10px; background: #062925; }
.defense-card .row { border-color: #155e55; }
.defense-card output { color: #d1fae5; }
.max-frame { display: grid; gap: 6px; margin-top: 10px; padding: 12px; border: 1px solid var(--green); border-radius: 8px; background: #022c22; }
.max-frame span { color: #a7f3d0; font-size: .75rem; font-weight: 900; }
.max-frame output { color: #6ee7b7; font: 900 1.6rem ui-monospace, monospace; }
.defense-details { margin-top: 12px; }
.defense-details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: #cbd5e1; font-size: .78rem; font-weight: 850; }
.policy { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--blue); background: #0f172a; color: #cbd5e1; font-size: .74rem; line-height: 1.55; }
.policy.safety-note { border-left-color: var(--amber); background: #281c08; color: #fde7ba; }

.controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.settings-box { min-width: 0; }
.lock-notice { margin: 0 0 12px; padding: 9px; border-left: 3px solid var(--amber); color: #fde68a; background: #2a1c08; font-size: .72rem; }
.chart-scope-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #0f172a; }
.range-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.range-toggle button { min-width: 48px; min-height: 44px; padding: 5px 9px; border: 1px solid #475569; border-radius: 6px; color: #cbd5e1; background: #1e293b; font-size: .74rem; font-weight: 850; }
.range-toggle button[aria-pressed="true"] { border: 2px solid var(--blue); color: white; background: #1d4ed8; box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #60a5fa; }
.scope-copy { display: grid; gap: 3px; text-align: right; }
.scope-copy strong { color: #dbeafe; font-size: .72rem; }
.scope-copy span { color: #6ee7b7; font-size: .67rem; font-weight: 800; }
.chart-wrap { position: relative; height: 400px; min-height: 300px; overflow: hidden; touch-action: none; border: 1px solid var(--line); border-radius: 9px; background: #020617; }
#qqqChart { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; color: var(--muted); text-align: center; pointer-events: none; }
.chart-help { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: .68rem; }
.market-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.metric { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #0f172a; }
.metric .label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .67rem; }
.metric strong { display: block; font: 850 clamp(.92rem, 2vw, 1.25rem) ui-monospace, monospace; overflow-wrap: anywhere; }
.metric.positive strong { color: #6ee7b7; }
.metric.negative strong { color: #fda4af; }
.signal-selector { margin: 14px 0 0; padding: 12px; border: 1px solid #475569; border-radius: 9px; background: #0f172a; }
.signal-selector legend { padding: 0 7px; font-size: .78rem; font-weight: 900; }
.signal-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.signal-mode-option { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px; cursor: pointer; }
.signal-mode-option input { width: 20px; min-height: 20px; accent-color: var(--blue); }
.signal-choice-content { min-height: 58px; display: grid; gap: 3px; padding: 9px; border: 1px solid #475569; border-radius: 6px; background: #1e293b; }
.signal-choice-content strong { font-size: .76rem; }
.signal-choice-content small, #signalModeHelp { color: var(--muted); font-size: .66rem; }
.signal-mode-option input:checked + .signal-choice-content { border: 2px solid var(--blue); background: #172554; }
.signal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.signal-card { min-width: 0; padding: 10px; border: 1px solid #475569; border-radius: 8px; background: #0f172a; }
.signal-card-head { display: flex; justify-content: space-between; gap: 6px; }
.signal-card-head span { color: #cbd5e1; font-size: .67rem; font-weight: 800; }
.signal-card-head strong { color: #93c5fd; font-size: .6rem; }
.signal-card output { display: block; margin: 8px 0 4px; font: 900 1.18rem ui-monospace, monospace; }
.signal-card p { margin: 0; color: var(--muted); font-size: .62rem; line-height: 1.4; }
.signal-card[data-status="confirmed"] { border-color: var(--blue); }
.signal-card[data-status="provisional"] { border-color: var(--amber); }
.signal-card[data-signal-state="positive"] output { color: #6ee7b7; }
.signal-card[data-signal-state="negative"] output { color: #fda4af; }
.signal-card[data-signal-state="missing"] { border-color: var(--red); }
.benchmarks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.benchmark { min-height: 44px; padding: 5px 10px; border: 1px solid #64748b; border-radius: 999px; color: #e2e8f0; background: #0f172a; font-size: .72rem; }
.benchmark[aria-pressed="false"][data-severity="amber"] { border-color: #a16207; color: #fde68a; }
.benchmark[aria-pressed="false"][data-severity="orange"] { border-color: var(--orange); color: #fed7aa; }
.benchmark[aria-pressed="false"][data-severity="rose"] { border-color: var(--red); color: #fecdd3; }
.benchmark[aria-pressed="false"][data-severity="neutral"] { color: #cbd5e1; }
.benchmark[aria-pressed="true"] { border-width: 2px; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px currentColor; }
.benchmark-note { margin-top: 12px; }
.warning-list { color: #fde68a; font-size: .72rem; }

.conflict-panel { margin-bottom: 18px; padding: 16px; border: 1px solid var(--red); border-radius: 10px; background: #32121b; }
.conflict-panel h2 { margin: 0; font-size: 1rem; }
.conflict-panel p { color: #fecdd3; font-size: .78rem; }
.conflict-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.conflict-compare div { display: grid; gap: 5px; padding: 10px; border: 1px solid #9f1239; border-radius: 7px; background: #1f1016; font-size: .74rem; }
.conflict-compare output { color: #ffe4e6; font: 700 .74rem ui-monospace, monospace; white-space: pre-wrap; }

.compact-action { position: fixed; z-index: 20; top: 0; left: 50%; width: min(100%, 720px); min-height: 48px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 8px 16px; transform: translateX(-50%); border: 1px solid #475569; border-top: 0; border-radius: 0 0 8px 8px; color: white; background: #0f172aee; box-shadow: 0 8px 24px #0007; text-decoration: none; backdrop-filter: blur(10px); }
.compact-action span { color: #cbd5e1; font-size: .7rem; font-weight: 800; }
.compact-action strong { font: 900 .95rem ui-monospace, monospace; }

dialog { width: min(calc(100% - 32px), 620px); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 1px solid #475569; border-radius: 12px; color: var(--text); background: var(--card); box-shadow: 0 28px 80px #000a; }
dialog::backdrop { background: #020617cc; backdrop-filter: blur(3px); }
.dialog-card { display: grid; gap: 14px; padding: 22px; }
.dialog-card h2, .dialog-card p { margin: 0; }
.dialog-card > p { color: #cbd5e1; font-size: .8rem; line-height: 1.5; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.icon-button { width: 44px; min-height: 44px; border: 1px solid #475569; border-radius: 6px; color: white; background: #0f172a; font-size: 1.3rem; }
.event-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 11px; border: 1px solid #475569; border-radius: 8px; }
.event-options legend { padding: 0 6px; font-size: .76rem; font-weight: 850; }
.event-options label { min-height: 58px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 9px; padding: 9px; cursor: pointer; border: 1px solid #475569; border-radius: 8px; background: #0f172a; font-size: .78rem; }
.event-options label:has(input:checked) { border-color: #60a5fa; background: #172554; box-shadow: 0 0 0 2px #3b82f626; }
.confirm-row { min-height: 44px; display: flex; align-items: center; gap: 9px; font-size: .78rem; }
.event-options input, .confirm-row input { width: 20px; min-height: 20px; accent-color: var(--blue); }
.recommendation-badge { grid-column: 3; width: max-content; padding: 2px 6px; border: 1px solid #60a5fa; border-radius: 999px; color: #bfdbfe; background: transparent; font-size: .6rem; font-weight: 850; white-space: nowrap; }
.event-summary { display: grid; gap: 6px; padding: 10px; border: 1px solid #475569; border-radius: 8px; background: #0f172a; font-size: .74rem; }
.event-summary p { display: grid; gap: 4px; }
.event-summary span { color: var(--muted); }
.initial-anchor-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--amber); border-radius: 8px; background: #2a1c08; }
.initial-anchor-panel h3, .initial-anchor-panel p { margin: 0; }
.initial-anchor-panel h3 { color: #fde68a; font-size: .86rem; }
.initial-anchor-panel p { color: #fed7aa; font-size: .72rem; line-height: 1.5; }
.dialog-actions { justify-content: flex-end; }
#confirmEvent[data-tone="buy"] { border-color: #2563eb; background: #2563eb; }
#confirmEvent[data-tone="repay"] { border-color: var(--amber); color: #1c1917; background: var(--amber); }
#confirmEvent[data-tone="hold"] { border-color: #64748b; background: #475569; }
#confirmEvent[data-tone="manual"], #confirmEvent[data-tone="neutral"] { border-color: #64748b; background: #334155; }
.simulation-list { display: grid; gap: 7px; max-height: 280px; overflow: auto; }
.simulation-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border: 1px solid #475569; border-radius: 8px; background: #0f172a; }
.simulation-item strong, .simulation-item small { display: block; }
.simulation-item small { margin-top: 4px; color: var(--muted); font-size: .65rem; }
.simulation-item-actions { display: flex; gap: 5px; }
.simulation-item button { min-height: 44px; }
.toast { position: fixed; z-index: 50; right: 18px; bottom: 18px; max-width: min(420px, calc(100% - 36px)); padding: 12px 15px; border: 1px solid #059669; border-radius: 8px; color: #d1fae5; background: #064e3b; box-shadow: 0 12px 32px #0008; font-size: .78rem; }

@media (max-width: 1023px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "action" "input" "market" "defense"; }
  .saved-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .shell { padding: 12px 16px 42px; }
  .topbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .mode-nav a { flex: 1; }
  .mode-banner { align-items: stretch; flex-direction: column; }
  .mode-banner .inline-actions { width: 100%; }
  .mode-banner .button { flex: 1; }
  .connection-settings[open] { width: 100%; }
  .saved-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-setup-guide { align-items: flex-start; flex-direction: column; }
  .workspace { gap: 16px; }
  .panel { padding: 16px; }
  .panel-head { flex-direction: column; }
  .input-grid, .controls, .market-summary, .signal-mode-options, .signal-summary, .conflict-compare, .event-options { grid-template-columns: 1fr; }
  .toolbar { width: 100%; align-items: stretch; flex-direction: column; }
  .chart-scope-toolbar { align-items: stretch; flex-direction: column; }
  .range-toggle button { flex: 1 1 calc(20% - 6px); min-width: 46px; }
  .scope-copy { text-align: left; }
  .chart-wrap { height: 330px; }
  .chart-help { display: block; }
  .chart-help span { display: block; margin-top: 4px; }
  .row { align-items: flex-start; }
  .action-value { font-size: clamp(2.25rem, 12vw, 3rem); }
  .dialog-card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
