@import url("fonts.css");

:root {
  --bg-base: #080b14;
  --bg-surface: #0d1117;
  --bg-card: #111827;
  --bg-card-hover: #162032;
  --bg-input: #1c2333;
  --bg-sidebar: #0a0e1a;
  --bg-topbar: #0a0e1a;

  --gold-primary: #d4af37;
  --gold-light: #f0d060;
  --gold-dim: #8b7322;
  --gold-glow: rgba(212, 175, 55, 0.15);
  --gold-glow-strong: rgba(212, 175, 55, 0.35);
  --gold-grid: rgba(212, 175, 55, 0.06);
  --gold-wash: rgba(212, 175, 55, 0.08);
  --gold-wash-subtle: rgba(212, 175, 55, 0.025);

  --color-positive: #ef4444;
  --color-positive-bg: rgba(239, 68, 68, 0.1);
  --color-positive-border: rgba(239, 68, 68, 0.3);
  --color-positive-border-strong: rgba(239, 68, 68, 0.55);
  --color-positive-fill: rgba(239, 68, 68, 0.32);
  --color-positive-fill-muted: rgba(239, 68, 68, 0.16);
  --color-positive-pulse: rgba(239, 68, 68, 0.4);
  --color-positive-pulse-clear: rgba(239, 68, 68, 0);
  --color-positive-dark: #7f1d1d;
  --color-negative: #10b981;
  --color-negative-bg: rgba(16, 185, 129, 0.1);
  --color-negative-border: rgba(16, 185, 129, 0.3);
  --color-negative-fill: rgba(16, 185, 129, 0.32);
  --color-negative-fill-muted: rgba(16, 185, 129, 0.16);
  --color-negative-border-strong: rgba(16, 185, 129, 0.55);
  --color-negative-dark: #065f46;
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-warning-border: rgba(245, 158, 11, 0.3);
  --color-warning-glow: rgba(245, 158, 11, 0.12);
  --color-warning-dark: #78350f;
  --color-shared-bg: rgba(234, 179, 8, 0.12);
  --color-shared-text: #eab308;
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.1);
  --system-success: #2fd6a2;
  --system-danger: #ff6878;
  --status-connected: #10b981;
  --status-connected-bg: rgba(16, 185, 129, 0.1);
  --status-connected-border: rgba(16, 185, 129, 0.35);
  --status-trading: #7dd3fc;
  --status-trading-dot: #38bdf8;
  --status-trading-bg: rgba(56, 189, 248, 0.09);
  --status-trading-border: rgba(56, 189, 248, 0.34);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.1);
  --status-danger-border: rgba(239, 68, 68, 0.35);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #7f8da3;
  --text-inverse: #0d1117;
  --text-gold: #d4af37;

  --border-default: #1e293b;
  --border-subtle: #162032;
  --border-gold: rgba(212, 175, 55, 0.4);
  --border-active: #d4af37;

  --font-display: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-ui: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Roboto Mono", Consolas, monospace;

  /* Product type scale: caption / body / section / page. */
  --type-caption: 0.857rem;
  --type-body: 1rem;
  --type-section: 1.214rem;
  --type-page: 1.714rem;
  --type-kpi: 1.286rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-card: none;
  --shadow-card-gold: none;
  --shadow-glow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
  --shadow-modal: 0 25px 60px rgba(0, 0, 0, 0.7);
  --bg-input-soft: rgba(28, 35, 51, 0.55);
  --bg-input-softer: rgba(28, 35, 51, 0.42);
  --signal-glow-buy: rgba(239, 68, 68, 0.12);
  --signal-glow-sell: rgba(16, 185, 129, 0.12);
  --signal-glow-hold: rgba(245, 158, 11, 0.12);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* Restrained dark scrollbars for dense workspaces and modal panels. */
  --scrollbar-track: rgba(8, 11, 20, 0.72);
  --scrollbar-thumb: #334155;
  --scrollbar-thumb-hover: #526277;
  --scrollbar-thumb-active: var(--gold-dim);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  min-width: 36px;
  min-height: 36px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-active);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

html,
body {
  height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

.hidden {
  display: none !important;
}

.num,
.price,
.balance,
.equity,
.pnl,
[class*="price"],
[class*="balance"],
[class*="equity"],
[class*="pnl"],
[class*="stat-value"],
[class*="stat-val"],
.spread-value,
.change-val,
.change-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.brand-icon {
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px var(--gold-primary));
}

.brand-name {
  font-family: var(--font-display);
  color: var(--gold-primary);
  font-weight: 700;
  letter-spacing: 0;
}

.app-layout {
  display: grid;
  grid-template-rows: 56px 1fr;
  grid-template-columns: 220px 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
  background: var(--bg-base);
}

.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-6);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  min-width: 168px;
}

.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--gold-primary);
  color: var(--text-inverse);
  font-weight: 700;
  transform: translateY(calc(-100% - var(--space-4)));
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

.brand-copy {
  display: grid;
  gap: 2px;
  line-height: 1;
}

.brand-name {
  font-size: 16px;
  line-height: 1;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 500;
}

.topbar-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 280px;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-connected {
  color: var(--status-connected);
  background: var(--status-connected-bg);
  border-color: var(--status-connected-border);
}

.status-connected .badge-dot {
  background: var(--status-connected);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35);
  animation: pulse-dot-green 2s ease-in-out infinite;
}

.status-trade-active {
  color: var(--status-trading);
  background: var(--status-trading-bg);
  border-color: var(--status-trading-border);
}

.status-trade-active .badge-dot {
  background: var(--status-trading-dot);
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.28);
  animation: pulse-dot-trading 2s ease-in-out infinite;
}

.status-danger .badge-dot {
  background: var(--status-danger);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot-trading {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
  50% { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12); }
}

.status-danger {
  color: var(--status-danger);
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
}

.status-permission {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
  border-color: color-mix(in srgb, var(--text-secondary) 34%, transparent);
}

.status-permission .badge-dot {
  background: var(--text-primary);
}

.status-active {
  color: var(--gold-primary);
  background: var(--gold-wash);
  border-color: var(--border-gold);
}

.status-active .badge-dot {
  background: var(--gold-primary);
  box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.35);
  animation: pulse-dot-gold 2s ease-in-out infinite;
}

.status-running {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.status-running .badge-dot {
  background: #10b981;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
  animation: pulse-dot-green 1s ease-in-out infinite;
}

.auto-runtime-control.clickable-badge {
  appearance: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: left;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.auto-runtime-control:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

.auto-runtime-copy {
  min-width: 0;
}

.auto-runtime-control .badge-text {
  display: block;
  overflow: hidden;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.auto-runtime-stage,
.auto-runtime-percent,
.auto-runtime-track {
  display: none;
}

.auto-runtime-control.is-progress {
  --auto-progress-scale: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 7px;
  width: clamp(218px, 21vw, 270px);
  max-width: 270px;
  min-height: 26px;
  padding: 3px 10px 5px;
  border-radius: var(--radius-pill);
  color: var(--gold-primary);
  background: var(--gold-wash);
  border-color: var(--border-gold);
}

.auto-runtime-control.is-progress .badge-dot {
  width: 6px;
  height: 6px;
  background: var(--gold-primary);
  box-shadow: none;
  animation: none;
}

.auto-runtime-control.is-progress .auto-runtime-copy {
  display: block;
  min-width: 0;
}

.auto-runtime-control.is-progress .badge-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-primary);
}

.auto-runtime-control.is-progress .auto-runtime-stage {
  display: none;
}

.auto-runtime-control.is-progress .auto-runtime-percent {
  display: block;
  align-self: center;
  color: var(--gold-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.auto-runtime-control.is-progress .auto-runtime-track {
  display: block;
  position: absolute;
  right: 11px;
  bottom: 2px;
  left: 11px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold-primary) 16%, transparent);
}

.auto-runtime-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-primary);
  transform: scaleX(var(--auto-progress-scale));
  transform-origin: left center;
  transition: transform 900ms linear;
}

.auto-runtime-control.is-complete {
  color: var(--status-connected);
  background: var(--status-connected-bg);
  border-color: var(--status-connected-border);
}

.auto-runtime-control.is-complete .badge-dot,
.auto-runtime-control.is-complete .auto-runtime-fill {
  background: #10b981;
}

.auto-runtime-control.is-complete .badge-text,
.auto-runtime-control.is-complete .auto-runtime-percent {
  color: var(--status-connected);
}

.auto-runtime-control.is-error {
  background: color-mix(in srgb, var(--status-danger) 10%, var(--bg-input));
  border-color: color-mix(in srgb, var(--status-danger) 48%, var(--border-default));
}

.auto-runtime-control.is-error .badge-dot {
  background: var(--status-danger);
}

.auto-runtime-control.is-progress.clickable-badge::after {
  display: none;
}

.auto-runtime-control.is-progress:hover {
  background: color-mix(in srgb, var(--gold-primary) 11%, var(--bg-topbar));
}

.auto-runtime-control.is-error .auto-runtime-fill {
  background: var(--status-danger);
}

@media (prefers-reduced-motion: reduce) {
  .auto-runtime-control,
  .auto-runtime-fill { transition-duration: 0ms; }
}

/* Period review workspace: content-first daily/monthly review flow. */
#review-memory .period-review-layout { grid-template-columns: minmax(286px, 330px) minmax(0, 1fr); gap: 14px; }
#review-memory .review-queue { padding: 0; overflow: hidden; }
#review-memory .review-queue-heading { padding: 18px 18px 12px; }
#review-memory .review-period-tabs,
#review-memory .review-status-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 14px 8px; border: 1px solid rgba(148,163,184,.12); border-radius: 10px; background: rgba(8,15,26,.66); }
#review-memory .review-period-tabs button,
#review-memory .review-status-tabs button { min-height: 34px; flex: 1; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
#review-memory .review-period-tabs button:hover,
#review-memory .review-status-tabs button:hover { color: var(--text-primary); background: rgba(148,163,184,.08); }
#review-memory .review-period-tabs button.active,
#review-memory .review-status-tabs button.active { color: var(--gold); background: rgba(234,190,55,.12); box-shadow: inset 0 0 0 1px rgba(234,190,55,.22); }
#review-memory .review-list { max-height: calc(100vh - 365px); min-height: 420px; padding: 6px 10px 12px; overflow-y: auto; }
.review-unread-dot { position: absolute; top: 13px; left: 7px; width: 6px; height: 6px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.09); }
#review-memory .review-period-tabs button span { display: inline-flex; min-width: 18px; justify-content: center; margin-left: 3px; color: var(--text-secondary); font-size: 10px; font-variant-numeric: tabular-nums; }
#review-memory .review-detail { min-width: 0; padding: 20px; }
.period-review-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid rgba(148,163,184,.12); }
.period-review-detail-header h2 { margin: 8px 0 4px; font-size: 25px; letter-spacing: -.02em; }
.period-review-detail-header p { margin: 0; color: var(--text-muted); font-size: 13px; }
.period-review-detail-header .period-review-period-scope { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--text-secondary); font-size: 12px; }
.period-review-header-state { display: flex; align-items: center; gap: 9px; }
.period-review-type { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 9px; border-radius: 999px; color: #7dd3fc; background: rgba(14,165,233,.1); font-size: 12px; font-weight: 700; }
.period-review-type.monthly { color: var(--gold); background: rgba(234,190,55,.11); }
.period-review-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 16px 0 12px; border: 1px solid rgba(148,163,184,.13); border-radius: 12px; overflow: hidden; background: rgba(8,15,26,.42); }
.period-review-metrics > div { min-width: 0; padding: 15px 16px; border-left: 1px solid rgba(148,163,184,.11); }
.period-review-metrics > div:first-child { border-left: 0; }
.period-review-metrics span,.period-review-metrics small { display: block; color: var(--text-muted); font-size: 11px; }
.period-review-metrics strong { display: block; margin: 5px 0 4px; color: var(--text-primary); font-size: 19px; }
.period-review-metrics .positive strong { color: #34d399; }
.period-review-metrics .negative strong { color: #fb7185; }
.period-review-source { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding: 10px 12px; border: 1px solid rgba(52,211,153,.2); border-radius: 10px; color: #6ee7b7; background: rgba(16,185,129,.055); }
.period-review-source.warning { border-color: rgba(251,191,36,.2); color: #fcd34d; background: rgba(251,191,36,.055); }
.period-review-source div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.period-review-source strong { font-size: 12px; }
.period-review-source span { color: var(--text-muted); font-size: 12px; }
.period-review-progress { margin: 15px 0 12px; padding: 15px 16px; border: 1px solid rgba(234,190,55,.18); border-radius: 12px; background: linear-gradient(120deg,rgba(234,190,55,.065),rgba(15,24,39,.72)); }
.period-review-progress > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.period-review-progress h3 { margin: 3px 0 0; font-size: 16px; }
.period-review-attempt { padding: 4px 8px; border: 1px solid rgba(148,163,184,.14); border-radius: 999px; color: var(--text-secondary); background: rgba(8,15,26,.44); font-size: 11px; font-variant-numeric: tabular-nums; }
.period-review-stage-track { position: relative; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 16px 0 13px; }
.period-review-stage-track::before { content:""; position:absolute; top: 11px; right: 8%; left: 8%; height: 1px; background: rgba(148,163,184,.18); }
.period-review-stage-track > div { position: relative; display: grid; justify-items: center; gap: 5px; color: var(--text-muted); }
.period-review-stage-track > div > span { z-index: 1; width: 23px; height: 23px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(148,163,184,.2); border-radius: 50%; background: #0e1726; font-size: 10px; font-weight: 700; }
.period-review-stage-track > div small { font-size: 10px; }
.period-review-stage-track > div.done,.period-review-stage-track > div.active { color: #fde68a; }
.period-review-stage-track > div.done > span,.period-review-stage-track > div.active > span { border-color: rgba(234,190,55,.45); color: #111827; background: var(--gold); }
.period-review-stage-track > div.active > span { box-shadow: 0 0 0 4px rgba(234,190,55,.08); }
.period-review-live-line { display: flex; align-items: center; gap: 8px; min-height: 27px; color: var(--text-secondary); }
.period-review-live-line strong { font-size: 12px; }
.period-review-live-line small { margin-left: auto; color: var(--text-muted); font-size: 10px; }
.period-review-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.period-review-progress:not(.is-failed):not(.is-retry_wait) .period-review-live-dot { animation: review-status-pulse 1.8s ease-in-out infinite; }
.period-review-live-line.danger { color: #fda4af; }
.period-review-live-line.danger .period-review-live-dot { background: #fb7185; }
.period-review-inline-error { display: flex; align-items: flex-start; gap: 8px; margin-top: 9px; padding: 9px 10px; border-radius: 8px; color: #fda4af; background: rgba(244,63,94,.07); font-size: 11px; line-height: 1.5; }
.period-review-log { margin-top: 10px; border-top: 1px solid rgba(148,163,184,.11); }
.period-review-log summary { display: flex; align-items: center; gap: 6px; padding-top: 10px; color: var(--text-secondary); font-size: 11px; cursor: pointer; }
.period-review-log summary span { min-width: 18px; padding: 1px 5px; border-radius: 999px; color: var(--text-muted); background: rgba(148,163,184,.09); text-align: center; }
.period-review-log ol { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.period-review-log li { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 10px; color: var(--text-secondary); font-size: 11px; }
.period-review-log time { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.period-review-log li > span { display: grid; gap: 2px; }
.period-review-log li small { color: var(--text-muted); line-height: 1.45; }
.period-review-log li.error > span { color: #fda4af; }
@keyframes review-status-pulse { 0%,100% { opacity:.45; transform:scale(.9); } 50% { opacity:1; transform:scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .period-review-live-dot { animation:none !important; } }
.period-review-editor { padding: 17px; border: 1px solid rgba(148,163,184,.13); border-radius: 13px; background: rgba(15,24,39,.66); }
.period-review-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.period-review-section-heading h3 { margin: 3px 0 0; font-size: 17px; }
.period-review-section-heading > span { color: var(--text-muted); font-size: 11px; }
.period-review-decision-row { display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 12px; margin-top: 12px; }
.confidence-input { display: flex; align-items: center; gap: 8px; }
.confidence-input input { flex: 1; min-width: 0; }
.confidence-input small { white-space: nowrap; }
.period-review-edit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.period-review-evidence-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.period-review-evidence-card { min-width: 0; padding: 14px; border: 1px solid rgba(148,163,184,.12); border-radius: 11px; background: rgba(8,15,26,.38); }
.period-review-evidence-card header { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); }
.period-review-evidence-card header strong { flex: 1; font-size: 13px; }
.period-review-evidence-card header span { min-width: 22px; padding: 2px 6px; border-radius: 999px; color: var(--gold); background: rgba(234,190,55,.1); font-size: 11px; text-align: center; }
.period-review-evidence-card ul { display: grid; gap: 7px; margin: 11px 0 0; padding: 0; list-style: none; }
.period-review-evidence-card li { padding-left: 12px; color: var(--text-secondary); font-size: 12px; line-height: 1.55; position: relative; }
.period-review-evidence-card li::before { content: ""; position: absolute; top: .65em; left: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.period-review-evidence-card p { margin: 11px 0 0; color: var(--text-muted); font-size: 12px; }
.memory-tier-tabs { display: flex; gap: 5px; width: fit-content; margin: 14px 0 4px; padding: 4px; border: 1px solid rgba(148,163,184,.13); border-radius: 10px; background: rgba(8,15,26,.55); }
.memory-tier-tabs button { min-height: 34px; padding: 6px 13px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.memory-tier-tabs button:hover { color: var(--text-primary); background: rgba(148,163,184,.07); }
.memory-tier-tabs button.active { color: var(--gold); background: rgba(234,190,55,.11); box-shadow: inset 0 0 0 1px rgba(234,190,55,.2); }
.personal-memory-card.memory-tier-summary { border-color: rgba(96,165,250,.18); background: linear-gradient(135deg,rgba(37,99,235,.055),rgba(15,24,39,.72)); }

@media (max-width: 1100px) {
  #review-memory .period-review-layout { grid-template-columns: 280px minmax(0,1fr); }
  .period-review-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .period-review-metrics > div:nth-child(3) { border-left: 0; border-top: 1px solid rgba(148,163,184,.11); }
  .period-review-metrics > div:nth-child(4) { border-top: 1px solid rgba(148,163,184,.11); }
}
@media (max-width: 820px) {
  #review-memory .period-review-layout { grid-template-columns: 1fr; }
  #review-memory .review-list { max-height: 360px; min-height: 0; }
  .period-review-edit-grid,.period-review-evidence-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  #review-memory .review-detail { padding: 14px; }
  .period-review-detail-header { flex-direction: column; }
  .period-review-metrics,.period-review-decision-row { grid-template-columns: 1fr; }
  .period-review-metrics > div { border-left: 0; border-top: 1px solid rgba(148,163,184,.11); }
  .period-review-metrics > div:first-child { border-top: 0; }
}

@keyframes pulse-dot-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-success {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.08);
  border-color: rgba(229, 62, 62, 0.25);
}

.status-success .badge-dot {
  background: #e53e3e;
  box-shadow: 0 0 4px rgba(229, 62, 62, 0.4);
}

.status-warning {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.status-warning .badge-dot {
  background: var(--color-warning);
}

.status-neutral {
  color: var(--text-secondary);
  background: var(--bg-input);
  border-color: var(--border-default);
}

.status-neutral .badge-dot {
  background: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.topbar-time {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  line-height: initial;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  white-space: nowrap;
  user-select: none;
  box-shadow: none;
}

.topbar-time i {
  color: var(--gold-primary);
  flex-shrink: 0;
  opacity: 0.85;
}

.topbar-time #mt5ServerTime {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-primary);
  letter-spacing: 0.04em;
}

.topbar-time span:last-child {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--gold-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateY(-5px);
}

.sidebar {
  grid-area: sidebar;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
}

.nav-group {
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.nav-group-label {
  display: block;
  padding: var(--space-2) var(--space-3) var(--space-1);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 2px;
  padding: 9px var(--space-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.nav-item svg {
  flex: 0 0 auto;
}

.nav-item-label { min-width: 0; flex: 1; }
.nav-attention-badge { min-width: 22px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border: 1px solid rgba(234,190,55,.32); border-radius: 999px; color: #fde68a; background: rgba(234,190,55,.14); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.nav-failure-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #fb7185; box-shadow: 0 0 0 3px rgba(251,113,133,.1); }

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.nav-item.active {
  background: var(--gold-glow);
  color: var(--gold-primary);
  border-color: rgba(212, 175, 55, .24);
  font-weight: 700;
}

.nav-item.active svg {
  stroke: var(--gold-primary);
}

.main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-6);
  background:
    linear-gradient(180deg, var(--gold-wash-subtle), transparent 190px),
    var(--bg-surface);
}

.tab-panel {
  display: none;
  min-width: 0;
}

.tab-panel.active {
  display: block;
}

/* Inference workspace V2: conclusion first, configuration on demand. */
.inference-header-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.calm-analysis-grid { max-width:1440px; }
.analysis-result-card { overflow:hidden; }
.manual-inference-dialog { width:min(720px,calc(100vw - 32px)); max-height:min(820px,calc(100vh - 32px)); overflow:auto; }
.manual-inference-dialog .order-confirm-head > div { display:flex; flex-direction:column; gap:4px; }
.manual-inference-dialog .order-confirm-head small { color:var(--text-secondary); font-size:12px; font-weight:400; }
.manual-inference-body { display:grid; gap:20px; padding:20px 24px 8px; }
.manual-inference-status { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid color-mix(in srgb,var(--gold-primary) 35%,var(--border-default)); border-radius:12px; background:color-mix(in srgb,var(--gold-primary) 6%,var(--bg-card)); }
.manual-inference-status.is-background { border-color:color-mix(in srgb,var(--status-connected) 40%,var(--border-default)); background:var(--status-connected-bg); }
.manual-inference-status.is-error { border-color:var(--status-danger-border); background:var(--status-danger-bg); }
.manual-inference-status.is-complete { border-color:color-mix(in srgb,var(--status-connected) 40%,var(--border-default)); background:var(--status-connected-bg); }
.manual-inference-status > div { display:flex; flex-direction:column; gap:3px; }
.manual-inference-status small { color:var(--text-secondary); line-height:1.45; }
.manual-inference-status .status-state-mark { width:20px; height:20px; flex:0 0 auto; border:2px solid currentColor; border-radius:50%; }
.status-spinner { width:20px; height:20px; flex:0 0 auto; border:2px solid color-mix(in srgb,var(--gold-primary) 24%,transparent); border-top-color:var(--gold-primary); border-radius:50%; animation:inference-spin .8s linear infinite; }
@keyframes inference-spin { to { transform:rotate(360deg); } }

.execution-advice-hero { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:13px; margin:16px 0 12px; padding:16px; border:1px solid var(--border-default); border-radius:14px; background:var(--bg-input-soft); }
.execution-advice-hero.review { border-color:color-mix(in srgb,var(--gold-primary) 45%,var(--border-default)); background:color-mix(in srgb,var(--gold-primary) 7%,var(--bg-input-soft)); }
.execution-advice-hero.rejected,.execution-advice-hero.failed,.execution-advice-hero.expired { border-color:color-mix(in srgb,var(--status-danger) 45%,var(--border-default)); background:var(--status-danger-bg); }
.execution-advice-hero.skipped { border-color:var(--color-warning-border); background:var(--color-warning-bg); }
.execution-advice-hero.cancelled { border-color:color-mix(in srgb,var(--status-connected) 40%,var(--border-default)); background:var(--status-connected-bg); }
.execution-advice-hero.executed,.execution-advice-hero.pending { border-color:color-mix(in srgb,var(--status-connected) 40%,var(--border-default)); background:var(--status-connected-bg); }
.execution-advice-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:11px; color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 13%,transparent); }
.execution-advice-hero > div:nth-child(2) { display:flex; flex-direction:column; gap:3px; min-width:0; }
.execution-advice-hero span { color:var(--text-secondary); font-size:12px; }
.execution-advice-hero strong { color:var(--text-primary); font-size:18px; line-height:1.3; }
.execution-advice-hero p { margin:0; color:var(--text-secondary); font-size:13px; line-height:1.5; }
.signal-pending-actions { margin:0 0 12px; padding:14px 16px; border:1px solid color-mix(in srgb,var(--gold-primary) 28%,var(--border-default)); border-radius:14px; background:color-mix(in srgb,var(--gold-primary) 5%,var(--bg-input-soft)); }
.signal-pending-actions .analysis-section-title { margin:0 0 10px; }
.signal-pending-actions .analysis-section-title span { margin-left:auto; color:var(--text-tertiary); font-size:12px; font-weight:500; }
.signal-pending-action-list { display:grid; gap:8px; }
.signal-pending-action { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start; gap:9px; padding:10px 11px; border:1px solid var(--border-default); border-radius:10px; background:var(--bg-surface); color:var(--gold-primary); }
.signal-pending-action.failed { color:var(--status-danger); border-color:color-mix(in srgb,var(--status-danger) 28%,var(--border-default)); background:var(--status-danger-bg); }
.signal-pending-action > i { margin-top:1px; }
.signal-pending-action strong { display:block; color:var(--text-primary); font-size:13px; line-height:1.4; }
.signal-pending-action p { margin:3px 0 0; color:var(--text-secondary); font-size:12px; line-height:1.5; }
.signal-management-actions { margin:0 0 12px; padding:14px 16px; border:1px solid color-mix(in srgb,var(--brand-gold) 30%,var(--border-default)); border-radius:14px; background:color-mix(in srgb,var(--brand-gold) 5%,var(--bg-input-soft)); }
.signal-management-actions .analysis-section-title { margin:0 0 10px; }
.signal-management-actions .analysis-section-title span { margin-left:auto; color:var(--text-tertiary); font-size:12px; font-weight:500; }
.signal-management-action-list { display:grid; gap:8px; }
.signal-management-action { display:grid; gap:8px; padding:11px 12px; border:1px solid var(--border-default); border-radius:10px; background:var(--bg-surface); }
.signal-management-action.confirmation_completed { border-color:color-mix(in srgb,var(--status-connected) 38%,var(--border-default)); background:var(--status-connected-bg); }
.signal-management-action.confirmation_reset,.signal-management-action.invalid_reset { border-color:color-mix(in srgb,var(--color-warning) 35%,var(--border-default)); background:var(--color-warning-bg); }
.signal-management-action-head { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.signal-management-action-head strong { color:var(--text-primary); font-size:13px; line-height:1.4; }
.signal-management-action-head .management-state { margin-left:auto; }
.signal-management-action-meta { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:6px 10px; color:var(--text-secondary); font-size:12px; }
.signal-management-action-meta span { color:var(--text-muted); }
.signal-management-action-meta b { min-width:0; color:var(--text-primary); font-size:13px; overflow-wrap:anywhere; }
.signal-management-action-meta .management-state { justify-self:start; }
.signal-management-action p { margin:0; color:var(--text-secondary); font-size:13px; line-height:1.5; text-wrap:pretty; }
.decision-summary { display:grid; grid-template-columns:94px minmax(0,1fr); gap:12px; align-items:start; margin-bottom:12px; padding:14px 16px; border-radius:12px; background:color-mix(in srgb,var(--bg-input-soft) 82%,transparent); }
.decision-summary span { color:var(--text-secondary); font-size:12px; padding-top:3px; }
.decision-summary strong { color:var(--text-primary); font-size:15px; line-height:1.55; }
.direction-bias { display:grid; gap:8px; margin-bottom:12px; padding:12px 14px; border:1px solid var(--border-subtle); border-radius:12px; background:color-mix(in srgb,var(--bg-input-soft) 72%,transparent); }
.direction-bias-head,.direction-bias-values { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.direction-bias-head strong { color:var(--text-primary); font-size:13px; }
.direction-bias-head span { color:var(--text-muted); font-size:11px; }
.direction-bias-values { font-size:13px; font-weight:700; }
.direction-bias-values .bullish { color:var(--color-positive); }
.direction-bias-values .bearish { color:var(--color-negative); }
.direction-bias-track { display:flex; overflow:hidden; height:6px; border-radius:999px; background:var(--border-subtle); }
.direction-bias-track i { display:block; height:100%; }
.direction-bias-track .bullish { background:var(--color-positive); }
.direction-bias-track .bearish { background:var(--color-negative); }
.candidate-entry-reference { display:grid; gap:10px; margin-bottom:12px; padding:13px 15px; border:1px solid color-mix(in srgb,var(--brand-gold) 30%,var(--border-subtle)); border-radius:12px; background:color-mix(in srgb,var(--brand-gold) 5%,var(--bg-input-soft)); }
.candidate-entry-reference-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.candidate-entry-reference-head span { display:flex; align-items:center; gap:7px; color:var(--brand-gold); font-size:13px; font-weight:700; }
.candidate-entry-reference-head strong { color:var(--text-secondary); font-size:12px; }
.candidate-entry-reference > div:nth-child(2) { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.candidate-entry-reference > div:nth-child(2) > span { display:grid; gap:3px; padding:9px 11px; border-radius:9px; background:color-mix(in srgb,var(--bg-card) 72%,transparent); }
.candidate-entry-reference small { color:var(--text-muted); font-size:11px; }
.candidate-entry-reference b { color:var(--text-primary); font-size:14px; }
.candidate-entry-reference p { margin:0; color:var(--text-muted); font-size:11px; line-height:1.5; }
.execution-prices { grid-template-columns:repeat(4,minmax(0,1fr)); }
.execution-targets { grid-template-columns:minmax(118px,.72fr) minmax(118px,.72fr) minmax(178px,1fr) minmax(300px,1.7fr); gap:0; overflow:hidden; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-input-soft); }
.execution-targets > div { display:flex; min-height:92px; flex-direction:column; justify-content:center; padding:14px 16px; border:0; border-left:1px solid var(--border-subtle); border-radius:0; background:transparent; }
.execution-targets > div:first-child { border-left:0; }
.execution-targets > div > span { margin-bottom:7px; color:var(--text-secondary); font-size:11px; letter-spacing:.02em; }
.execution-targets > div > strong { font-size:17px; font-variant-numeric:tabular-nums; }
.execution-price-item > small { margin-top:6px; color:var(--text-muted); font-size:10px; font-weight:600; font-variant-numeric:tabular-nums; }
.execution-target-primary { position:relative; background:color-mix(in srgb,var(--gold-primary) 6%,transparent) !important; }
.execution-target-primary::before { position:absolute; inset:12px auto 12px 0; width:2px; border-radius:2px; background:var(--gold-primary); content:""; }
.execution-target-primary > strong { color:var(--gold-primary); font-size:19px !important; }
.execution-target-primary small { margin-top:6px; color:var(--text-secondary); font-size:10px; font-weight:700; }
.take-profit-candidates { padding-right:12px !important; }
.execution-targets .take-profit-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.take-profit-heading small { display:inline-flex; align-items:center; gap:5px; color:var(--text-muted); font-size:9px; font-weight:600; letter-spacing:0; white-space:nowrap; }
.take-profit-heading i { width:5px; height:5px; border-radius:50%; background:var(--gold-primary); }
.take-profit-candidates > div { display:grid; grid-template-columns:repeat(3,minmax(72px,1fr)); gap:6px; }
.take-profit-chip { position:relative; display:flex !important; min-width:0; min-height:48px; flex-direction:column; justify-content:center; gap:3px; margin:0 !important; padding:7px 9px; border:1px solid transparent; border-radius:var(--radius-sm); background:color-mix(in srgb,var(--bg-input) 78%,transparent); }
.take-profit-chip b { color:var(--text-muted); font-family:var(--font-sans); font-size:9px; letter-spacing:.04em; }
.signal-detail-grid .take-profit-chip strong { overflow:hidden; color:var(--text-secondary); font-family:var(--font-mono); font-size:12px; font-variant-numeric:tabular-nums; overflow-wrap:normal; text-overflow:ellipsis; white-space:nowrap; }
.take-profit-chip.recommended::after { position:absolute; top:8px; right:8px; width:5px; height:5px; border-radius:50%; background:var(--gold-primary); content:""; }
.take-profit-chip.selected { border-color:color-mix(in srgb,var(--gold-primary) 45%,transparent); background:color-mix(in srgb,var(--gold-primary) 9%,var(--bg-input)); }
.take-profit-chip.selected b,.signal-detail-grid .take-profit-chip.selected strong { color:var(--text-primary); }
.decision-evidence-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.decision-evidence-grid > section { min-height:116px; padding:14px 2px; border-top:1px solid var(--border-default); background:transparent; }
.decision-evidence-grid ul { display:grid; gap:7px; margin:10px 0 0; padding-left:18px; color:var(--text-primary); font-size:13px; line-height:1.5; }
.analysis-experience-usage { display:grid; gap:9px; margin-top:12px; padding:13px 14px; border:1px solid color-mix(in srgb,var(--gold-primary) 28%,var(--border-default)); border-radius:12px; background:color-mix(in srgb,var(--gold-primary) 5%,var(--bg-input-soft)); }
.analysis-experience-usage .analysis-section-title { display:flex; align-items:center; gap:7px; }
.analysis-experience-usage .analysis-section-title > span { margin-left:auto; color:var(--text-muted); font-size:11px; font-weight:500; }
.experience-usage-stats { display:flex; flex-wrap:wrap; gap:8px; }
.experience-usage-stats > span { padding:5px 8px; border:1px solid var(--border-subtle); border-radius:7px; color:var(--text-secondary); background:var(--bg-panel); font-size:11px; }
.experience-usage-stats > span.used { border-color:color-mix(in srgb,var(--color-positive) 35%,var(--border-subtle)); color:var(--color-positive); }
.experience-usage-stats strong { color:inherit; font-family:var(--font-mono); }
.experience-used-list { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.experience-used-list > span { margin-right:2px; color:var(--text-muted); font-size:11px; }
.experience-used-list > strong { padding:4px 7px; border:1px solid color-mix(in srgb,var(--color-positive) 28%,var(--border-subtle)); border-radius:7px; color:var(--color-positive); background:color-mix(in srgb,var(--color-positive) 6%,transparent); font-size:11px; font-weight:650; }
.analysis-experience-usage p { margin:0; color:var(--text-secondary); font-size:12px; line-height:1.55; }
.decision-empty { margin:10px 0 0; color:var(--text-muted); font-size:13px; }
.decision-conditions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.decision-conditions > div { display:flex; flex-direction:column; gap:5px; padding:12px 14px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-input-soft); }
.decision-conditions span { color:var(--text-secondary); font-size:12px; }
.decision-conditions strong { color:var(--text-primary); font-size:13px; line-height:1.5; }
.analysis-history-panel { max-width:none; }

@media (max-width: 760px) {
  .inference-header-actions { width:100%; }
  .inference-header-actions .btn { flex:1; }
  .execution-advice-hero { grid-template-columns:auto minmax(0,1fr); }
  .execution-advice-hero > .analysis-direction-badge { grid-column:2; justify-self:start; }
  .execution-prices,.decision-evidence-grid,.decision-conditions { grid-template-columns:1fr 1fr; }
  .execution-targets { grid-template-columns:1fr 1fr; }
  .execution-targets > div:nth-child(3) { border-left:0; border-top:1px solid var(--border-subtle); }
  .execution-targets > div:nth-child(4) { border-top:1px solid var(--border-subtle); }
  .decision-summary { grid-template-columns:1fr; gap:4px; }
}
@media (max-width: 480px) {
  .manual-inference-dialog { width:calc(100vw - 16px); max-height:calc(100vh - 16px); }
  .execution-prices,.decision-evidence-grid,.decision-conditions { grid-template-columns:1fr; }
  .execution-targets { grid-template-columns:1fr; }
  .execution-targets > div { min-height:72px; border-top:1px solid var(--border-subtle); border-left:0; }
  .execution-targets > div:first-child { border-top:0; }
}
@media (prefers-reduced-motion: reduce) { .status-spinner { animation-duration:1.8s; } }

.model-strategy-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 1440px;
  margin: 0 auto;
}

.model-strategy-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 18px 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 96%, var(--gold-primary)), var(--bg-card));
  box-shadow: 0 16px 40px rgba(2, 6, 23, .18);
}

.model-strategy-header h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.model-strategy-header p {
  max-width: 68ch;
  margin-top: 6px;
  color: var(--text-secondary);
}

.page-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
}

.model-strategy-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--bg-input-soft);
  border-radius: var(--radius-md);
}

.model-strategy-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.model-strategy-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.model-strategy-tab:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

.model-strategy-tab.active {
  color: var(--text-inverse);
  background: var(--gold-primary);
  font-weight: 700;
}

.model-strategy-panel {
  display: none;
  min-width: 0;
}

.model-strategy-panel.active {
  display: block;
}

.strategy-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.model-strategy-toolbar {
  align-items: center;
  padding: 2px 2px 0;
}

.model-strategy-toolbar h1 {
  font-size: 20px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.catalog-summary {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .model-strategy-header {
    align-items: stretch;
    flex-direction: column;
  }

  .model-strategy-tabs,
  .model-strategy-tab {
    width: 100%;
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 55fr 45fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "account account"
    "quote signal"
    "positions positions";
  gap: var(--space-5);
}

.page-context-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.dashboard-quick-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.grid-area-account {
  grid-area: account;
  animation-delay: 0.05s;
}

.grid-area-quote {
  grid-area: quote;
  display: flex;
  flex-direction: column;
  animation-delay: 0.1s;
}

.grid-area-quote > .card-header {
  min-height: 53px;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.grid-area-signal {
  grid-area: signal;
  align-self: start;
  animation-delay: 0.15s;
}

.grid-area-positions {
  grid-area: positions;
  animation-delay: 0.2s;
}

.card {
  min-width: 0;
  padding: var(--space-5) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: none;
  transition:
    border-color var(--transition-normal),
    background var(--transition-normal),
    box-shadow var(--transition-normal);
  animation: none;
}

.card:hover {
  border-color: var(--border-default);
}

.card-gold {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-card-gold);
}

.content-card {
  max-width: 1480px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.card-title {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.card-title span {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.btn,
.icon-btn,
.card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 34px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn {
  padding: 0 var(--space-4);
}

.icon-btn {
  padding: 6px 12px;
}

.topbar-account-link {
  width: auto;
  min-width: 76px;
  padding-inline: 12px;
  text-decoration: none;
}

.topbar-account-link i {
  color: var(--gold-primary);
}

#refreshAllBtn {
  width: 36px;
  padding: 0;
}

.card-action-btn {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.btn:hover,
.icon-btn:hover,
.card-action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.btn:active,
.icon-btn:active,
.card-action-btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: var(--text-inverse);
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: none;
}

.btn-primary:hover {
  color: var(--text-inverse);
  background: var(--gold-light);
}

.btn-success {
  color: var(--text-primary);
  background: var(--color-positive-bg);
  border-color: var(--color-positive-border);
}

.btn-success:hover {
  color: var(--color-positive);
  border-color: var(--color-positive);
}

.btn-danger {
  color: var(--text-inverse);
  background: var(--status-danger);
  border-color: var(--status-danger);
}

.btn-danger:hover {
  color: var(--text-inverse);
  background: #dc2626;
}

.btn-buy {
  color: #fff;
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border-color: var(--color-positive-border-strong);
}

.btn-buy:hover {
  color: #fff;
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px var(--color-positive-bg);
}

.btn-sell {
  color: #fff;
  background: linear-gradient(180deg, #10b981, #047857);
  border-color: var(--color-negative-border-strong);
}

.btn-sell:hover {
  color: #fff;
  border-color: #6ee7b7;
  box-shadow: 0 0 0 3px var(--color-negative-bg);
}

.btn.small {
  min-height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.icon-btn-danger:hover {
  color: var(--status-danger);
  background: var(--status-danger-bg);
  border-color: var(--status-danger);
}

label {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

select {
  cursor: pointer;
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.account-stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.account-primary-stats {
  max-width: 920px;
}

.account-more-details {
  margin-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.account-more-details summary {
  width: fit-content;
  padding-top: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.account-more-details summary:hover,
.account-more-details summary:focus-visible {
  color: var(--gold-light);
}

.account-secondary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.account-secondary-stats > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input-softer);
}

.account-secondary-stats span,
.account-secondary-stats small {
  color: var(--text-muted);
  font-size: 11px;
}

.account-secondary-stats strong {
  margin-left: auto;
  color: var(--text-primary);
}

.stat-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 var(--space-5);
}

.stat-item:first-child {
  padding-left: 0;
}

.stat-item:last-child {
  padding-right: 0;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-default);
  flex-shrink: 0;
}

.stat-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.stat-value {
  color: var(--text-primary);
  font-size: clamp(16px, 1.55vw, 20px);
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-unit {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.pnl.positive,
.profit,
.pnl-positive {
  color: var(--color-positive) !important;
}

.pnl.negative,
.loss,
.pnl-negative {
  color: var(--color-negative) !important;
}

.pnl.zero {
  color: var(--text-muted) !important;
}

.instrument-select {
  max-width: 245px;
  min-height: 30px;
  padding: 4px 8px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.quote-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  min-height: 114px;
}

.quote-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.quote-side-ask {
  align-items: flex-end;
  text-align: right;
}

.quote-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.quote-side-hint {
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.7;
}

.quote-price {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: clamp(29px, 3.1vw, 38px);
  font-weight: 800;
  line-height: 1;
}

.quote-change {
  height: 18px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 18px;
}

.quote-change.hidden {
  display: block !important;
  visibility: hidden;
}

.quote-change.up {
  color: var(--color-positive);
}

.quote-change.down {
  color: var(--color-negative);
}

.quote-spread-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 110px;
}

.spread-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-5);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.spread-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.spread-value {
  color: var(--gold-primary);
  font-size: 18px;
  font-weight: 700;
}

.quote-change-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 34px;
  color: var(--text-muted);
}

.change-val {
  font-size: 13px;
  font-weight: 800;
}

.change-pct {
  font-size: 11px;
  font-weight: 700;
}

.change-val.muted,
.change-pct.muted {
  color: var(--text-muted);
  font-weight: 700;
}

.change-val.pnl-positive,
.change-pct.pnl-positive {
  color: var(--color-positive);
}

.change-val.pnl-negative,
.change-pct.pnl-negative {
  color: var(--color-negative);
}

.quote-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
}

.quote-divider {
  color: var(--border-default);
}

.quote-footer .num {
  color: var(--text-secondary);
}

/* K-line chart */
.kline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0 var(--space-2);
  margin-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.kline-periods {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}
.kline-period-btn {
  min-height: 32px;
  background: transparent;
  border: 1px solid var(--border-subtle, #1e293b);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-mono);
}
.kline-more-periods {
  display: flex;
  align-items: center;
  margin-left: 3px;
}
.kline-more-periods summary {
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.kline-more-periods summary::-webkit-details-marker { display: none; }
.kline-more-periods[open] summary { color: var(--text-primary); border-color: var(--border-default); }
.kline-more-periods > div { display: inline-flex; gap: 2px; margin-left: 3px; }
.kline-period-btn:hover {
  color: var(--text-secondary, #e2e8f0);
  border-color: var(--border-default, #2d3748);
}
.kline-period-btn.active {
  background: var(--gold-primary, #d4af37);
  color: #000;
  border-color: var(--gold-primary, #d4af37);
}
.kline-last-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary, #e2e8f0);
}
.kline-chart-container {
  position: relative;
  flex: 1 1 320px;
  width: 100%;
  height: clamp(280px, 34vh, 380px);
  min-height: 280px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
}
.kline-position-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 172px;
  max-width: min(260px, calc(100% - 16px));
  padding: 7px 9px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-card) 96%, black);
  color: var(--text-primary);
  pointer-events: none;
}
.kline-position-tooltip[hidden] { display: none; }
.kline-position-tooltip-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.kline-position-tooltip-row + .kline-position-tooltip-row { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-subtle); }
.kline-position-tooltip-row strong,
.kline-position-tooltip-row span { font-size: 12px; line-height: 1.4; }
.kline-position-tooltip-row small { grid-column: 1 / -1; color: var(--text-secondary); font-size: 10px; line-height: 1.45; }
.kline-position-tooltip-row.is-buy strong { color: var(--color-positive); }
.kline-position-tooltip-row.is-sell strong { color: var(--color-negative); }
.kline-chart-container a[href*="tradingview"],
.kline-chart-container #tv-attr-logo {
  display: none !important;
}

@media (min-width: 1181px) {
  .grid-area-signal {
    align-self: stretch;
  }

  .kline-chart-container {
    flex: 0 0 clamp(208px, 20vh, 224px);
    height: clamp(208px, 20vh, 224px);
    min-height: 208px;
  }
}

/* Market status dot */
.market-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-top: 3px;
}
.market-dot-open { background: var(--gold-primary); box-shadow: 0 0 6px rgba(212,175,55,0.4); animation: pulse-dot-gold 2s ease-in-out infinite; }
.market-dot-closed { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); animation: pulse-dot-red 2s ease-in-out infinite; }
.market-dot-closeonly { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); animation: pulse-dot-amber 2s ease-in-out infinite; }
.market-dot-unknown { background: #4a5568; }
.market-status-text { font-size: 11px; }
.market-status-text-open { color: var(--gold-primary); }
.market-status-text-closed { color: #ef4444; }
.market-status-text-closeonly { color: #f59e0b; }
.market-status-text-unknown { color: #4a5568; }

/* Market status topbar badge */
#marketStatus.status-active { color: var(--gold-primary); background: var(--gold-wash); border-color: var(--border-gold); }
#marketStatus.status-active .badge-dot { background: var(--gold-primary); box-shadow: 0 0 4px rgba(212,175,55,0.4); animation: pulse-dot-gold 2s ease-in-out infinite; }
#marketStatus.status-warning { color: #f59e0b; background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); }
#marketStatus.status-warning .badge-dot { background: #f59e0b; animation: pulse-dot-amber 2s ease-in-out infinite; }
#marketStatus.status-neutral { color: #ef4444; background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
#marketStatus.status-neutral .badge-dot { background: #ef4444; animation: pulse-dot-red 2s ease-in-out infinite; }

.card-signal {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--signal-border, var(--color-warning)) 42%, var(--border-default));
  box-shadow: none;
  transition:
    border-color var(--transition-slow),
    background var(--transition-normal);
}

.card-signal::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--signal-border, var(--color-warning));
  content: "";
  opacity: .75;
}

.signal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.signal-expired-mask {
  position: absolute;
  inset: 68px var(--space-5) var(--space-5);
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  background: rgba(8, 11, 20, 0.92);
  color: var(--color-warning);
  text-align: center;
  backdrop-filter: blur(3px);
}

.signal-expired-mask p {
  max-width: 260px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.card-signal[data-status="expired"] .signal-expired-mask {
  display: flex;
}

.card-signal[data-status="expired"] {
  border-color: var(--color-warning-border);
}

.card-signal[data-status="expired"] .signal-body {
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

.signal-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.signal-heading-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--bg-input-soft);
  color: var(--signal-border, var(--color-warning));
}

.signal-heading-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.signal-heading-copy strong {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.signal-heading-copy small {
  color: var(--text-secondary);
  font-size: 11px;
}

.signal-detail-action {
  flex: 0 0 auto;
}

.signal-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  min-width: 0;
}

.signal-monitor-sync,
.signal-monitor-exit,
.signal-monitor-details {
  display: none;
}

.signal-monitor-action,
.signal-monitor-exit {
  min-height: 36px;
}

.signal-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: var(--status-connected);
  background: var(--status-connected-bg);
  border: 1px solid var(--status-connected-border);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
}

.signal-live-badge .badge-dot {
  width: 5px;
  height: 5px;
  background: var(--status-connected);
  animation: pulse-dot-green 2s ease-in-out infinite;
}

.signal-live-badge.expired {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.signal-live-badge.expired .badge-dot {
  background: var(--color-warning);
  animation: none;
}

.signal-live-badge.executed {
  color: var(--text-secondary);
  background: var(--bg-input-soft);
  border-color: var(--border-default);
}

.signal-live-badge.executed .badge-dot {
  background: var(--text-muted);
  animation: none;
}

.signal-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

.signal-decision-panel {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-input-softer);
}

.signal-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.signal-symbol {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
}

.signal-tf-badge {
  padding: 2px 7px;
  color: var(--gold-primary);
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.signal-tf-badge.close-badge {
  color: var(--color-info, #63b3ed);
  background: rgba(99, 179, 237, 0.1);
  border-color: rgba(99, 179, 237, 0.3);
}

.signal-direction-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.signal-direction-copy {
  min-width: 0;
}

.signal-section-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 11px;
}

.signal-direction-main {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.signal-direction {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
}

.signal-direction-text {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  white-space: nowrap;
}

.signal-direction.buy,
.signal-direction-text.buy,
.buy {
  color: var(--color-positive);
}

.signal-direction.sell,
.signal-direction-text.sell,
.sell {
  color: var(--color-negative);
}

.signal-direction.hold,
.signal-direction-text.hold,
.hold {
  color: var(--color-warning);
}

.signal-confidence-block {
  display: flex;
  width: min(138px, 40%);
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.signal-confidence-label {
  color: var(--text-muted);
  font-size: 11px;
}

.signal-confidence-value {
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 800;
}

.signal-confidence-block .signal-bar-track {
  width: 100%;
}

.signal-execution-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(86px, .7fr));
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: rgba(8, 11, 20, .34);
}

.signal-execution-copy,
.signal-compact-metric {
  min-width: 0;
  padding: var(--space-3) var(--space-4);
}

.signal-execution-copy {
  border-right: 1px solid var(--border-subtle);
}

.signal-execution-copy span,
.signal-compact-metric span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.signal-execution-copy strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}

.signal-execution-copy p {
  max-width: 42ch;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-compact-metric + .signal-compact-metric {
  border-left: 1px solid var(--border-subtle);
}

.signal-compact-metric strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-execution-state.ready,
.signal-execution-state.review,
.signal-execution-state.pending,
.signal-execution-state.observe,
.signal-execution-state.expired {
  color: var(--color-warning);
}

.signal-execution-state.executed {
  color: var(--status-connected);
}

.signal-execution-state.rejected,
.signal-execution-state.failed {
  color: var(--status-danger);
}

.signal-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--border-default);
}

.signal-price-item {
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input-softer);
}

.signal-price-item.primary {
  background: var(--gold-wash);
}

.signal-price-item span {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.signal-price-item strong {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-price-item strong.buy {
  color: var(--color-positive);
}

.signal-price-item strong.sell {
  color: var(--color-negative);
}

.signal-price-item strong.hold,
.signal-price-item strong.warning {
  color: var(--color-warning);
}

.signal-bar-track {
  height: 4px;
  overflow: hidden;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
}

.signal-bar-fill {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gold-primary);
  transform: scaleX(var(--signal-confidence-scale, 0));
  transform-origin: left center;
  transition: transform var(--transition-slow);
}

.card-signal[data-direction="buy"] .signal-bar-fill {
  background: var(--color-positive);
}

.card-signal[data-direction="sell"] .signal-bar-fill {
  background: var(--color-negative);
}

.card-signal[data-direction="hold"] .signal-bar-fill {
  background: var(--color-warning);
}

.signal-generated-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-1);
  padding: var(--space-3) 2px 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
}

.signal-generated-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.signal-generated-meta strong {
  margin-left: auto;
  color: var(--text-primary);
  font-size: 11px;
}

/* Latest AI advice — dedicated second-screen monitor mode */
.signal-monitor-fallback-active {
  overflow: hidden !important;
}

.signal-monitor-fallback-active .main {
  overflow: hidden !important;
}

.card-signal.is-signal-monitor:not(:fullscreen) {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.card-signal:is(:fullscreen, .is-signal-monitor) {
  display: flex;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  flex-direction: column;
  padding: clamp(16px, 1.5vw, 24px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: var(--bg-base);
  box-shadow: none;
  animation: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.card-signal:is(:fullscreen, .is-signal-monitor)::backdrop {
  background: var(--bg-base);
}

.card-signal:is(:fullscreen, .is-signal-monitor)::before {
  position: fixed;
  z-index: 20;
  height: 3px;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-card-header {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 56px;
  margin: calc(clamp(16px, 1.5vw, 24px) * -1) calc(clamp(16px, 1.5vw, 24px) * -1) var(--space-3);
  padding: 10px clamp(16px, 1.5vw, 24px);
  border-bottom-color: var(--border-default);
  background: color-mix(in srgb, var(--bg-base) 94%, transparent);
  backdrop-filter: blur(12px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-heading-icon {
  width: 42px;
  height: 42px;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-heading-copy strong {
  font-size: clamp(17px, 1.25vw, 22px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-heading-copy small {
  font-size: 12px;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-detail-action,
.card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-action {
  display: none;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-sync,
.card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-exit {
  display: inline-flex;
  align-items: center;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-sync {
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--status-connected-border);
  border-radius: var(--radius-pill);
  background: var(--status-connected-bg);
  color: var(--status-connected);
  font-size: 12px;
  font-weight: 800;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-sync svg {
  animation: pulse-dot-green 2s ease-in-out infinite;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-exit {
  min-height: 42px;
  padding-inline: 14px;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-body {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 0;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-decision-panel {
  grid-column: span 7;
  min-height: 132px;
  padding: clamp(14px, 1.25vw, 20px);
  border: 1px solid color-mix(in srgb, var(--signal-border) 32%, var(--border-default));
  background: color-mix(in srgb, var(--signal-border) 7%, var(--bg-card));
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-meta-row {
  margin-bottom: var(--space-2);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-symbol {
  font-size: clamp(24px, 2vw, 34px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-tf-badge {
  padding: 4px 9px;
  font-size: 12px;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-direction-text {
  font-size: clamp(36px, 3vw, 50px);
  letter-spacing: -.035em;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-direction {
  font-size: clamp(16px, 1.3vw, 21px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-confidence-block {
  width: min(230px, 36%);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-confidence-value {
  font-size: clamp(30px, 2.6vw, 44px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-bar-track {
  height: 7px;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-execution-strip {
  grid-column: span 5;
  grid-template-columns: 1fr 1fr;
  min-height: 132px;
  align-content: stretch;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-execution-copy {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-execution-copy,
.card-signal:is(:fullscreen, .is-signal-monitor) .signal-compact-metric {
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-execution-copy strong {
  font-size: clamp(20px, 1.7vw, 28px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-execution-copy p {
  max-width: none;
  overflow: visible;
  font-size: 13px;
  line-height: 1.5;
  text-overflow: clip;
  white-space: normal;
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-compact-metric strong {
  font-size: clamp(18px, 1.5vw, 24px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-price-grid {
  grid-column: span 9;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-price-item {
  display: flex;
  min-height: 64px;
  justify-content: center;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-price-item strong {
  font-size: clamp(20px, 1.7vw, 28px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-generated-meta {
  grid-column: span 3;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-input-softer);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-generated-meta strong {
  font-size: clamp(16px, 1.3vw, 21px);
}

.card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-details {
  display: grid;
  min-height: auto;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .7fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
  align-items: start;
  overflow: visible;
}

.signal-monitor-main,
.signal-monitor-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  padding-right: 0;
  overflow: visible;
}

.monitor-surface {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.monitor-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.monitor-section-heading span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.monitor-section-heading small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.signal-monitor-summary > strong {
  display: block;
  color: var(--text-primary);
  font-size: clamp(18px, 1.35vw, 24px);
  line-height: 1.45;
}

.signal-monitor-summary .direction-bias {
  margin-top: var(--space-4);
}

.signal-monitor-evidence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.signal-monitor-evidence ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.signal-monitor-evidence .risk .monitor-section-heading {
  color: var(--color-warning);
}

.signal-monitor-conditions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--border-default);
}

.signal-monitor-conditions > div {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
}

.signal-monitor-conditions span,
.signal-monitor-order-grid span,
.signal-monitor-meta span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.signal-monitor-conditions strong {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.55;
}

.signal-monitor-narrative {
  min-height: 220px;
}

.signal-monitor-narrative > div:last-child {
  max-height: none;
  padding-right: 0;
  overflow: visible;
}

.signal-monitor-narrative strong {
  display: block;
  margin: var(--space-3) 0 var(--space-2);
  color: var(--gold-primary);
  font-size: 13px;
}

.signal-monitor-narrative p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.signal-monitor-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  overflow: hidden;
  background: var(--border-default);
  gap: 1px;
}

.signal-monitor-order-card {
  padding: var(--space-4);
}

.signal-monitor-order-card .signal-monitor-order-grid {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.signal-monitor-order-grid > div {
  min-height: 84px;
  padding: var(--space-4);
  background: var(--bg-card);
}

.signal-monitor-order-grid strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: clamp(16px, 1.25vw, 20px);
}

.signal-monitor-order-grid small {
  display: block;
  margin-top: 4px;
  color: var(--gold-primary);
  font-size: 10px;
}

.signal-monitor-order-grid .monitor-risk-value {
  color: var(--color-negative);
}

.signal-monitor-order-grid .target {
  color: var(--color-positive);
}

.signal-monitor-targets > div:last-child {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.signal-monitor-targets > div:last-child > span {
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input-softer);
}

.signal-monitor-targets > div:last-child > span.recommended {
  border-color: var(--border-gold);
}

.signal-monitor-targets > div:last-child > span.selected {
  background: var(--gold-wash);
}

.signal-monitor-targets small,
.signal-monitor-targets strong {
  display: block;
}

.signal-monitor-targets small {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.signal-monitor-targets strong {
  color: var(--text-primary);
  font-size: 14px;
}

.signal-monitor-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--border-default);
}

.signal-monitor-meta > div {
  min-width: 0;
  min-height: 72px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: var(--bg-card);
}

.signal-monitor-meta > div:last-child {
  padding-bottom: var(--space-3);
}

.signal-monitor-meta strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 14px;
}

.signal-monitor-empty {
  display: grid;
  min-height: 42vh;
  place-items: center;
  align-content: center;
  gap: var(--space-3);
  color: var(--text-muted);
  text-align: center;
}

.signal-monitor-empty strong {
  color: var(--text-primary);
  font-size: 20px;
}

.card-signal:is(:fullscreen, .is-signal-monitor)[data-status="expired"] .signal-expired-mask {
  position: static;
  display: flex;
  min-height: 58px;
  flex-direction: row;
  justify-content: flex-start;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  text-align: left;
}

.card-signal:is(:fullscreen, .is-signal-monitor)[data-status="expired"] .signal-expired-mask svg {
  width: 20px;
  height: 20px;
}

.card-signal:is(:fullscreen, .is-signal-monitor)[data-status="expired"] .signal-expired-mask p {
  max-width: none;
  margin-right: auto;
}

.card-signal:is(:fullscreen, .is-signal-monitor)[data-status="expired"] .signal-body {
  opacity: 1;
  pointer-events: auto;
  user-select: auto;
}

.card-signal:is(:fullscreen, .is-signal-monitor).signal-monitor-updated {
  animation: signal-monitor-update 700ms ease-out;
}

@keyframes signal-monitor-update {
  0% { box-shadow: inset 0 0 0 2px var(--signal-border), inset 0 0 70px color-mix(in srgb, var(--signal-border) 16%, transparent); }
  100% { box-shadow: inset 0 0 0 0 transparent, inset 0 0 0 transparent; }
}

@media (max-width: 1440px) {
  .signal-monitor-action span {
    display: none;
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-action span,
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-exit span {
    display: inline;
  }
}

@media (max-width: 1180px) {
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-details {
    grid-template-columns: 1fr;
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-body,
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-rail,
  .signal-monitor-evidence,
  .signal-monitor-conditions {
    grid-template-columns: 1fr;
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-decision-panel,
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-execution-strip,
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-price-grid,
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-generated-meta {
    grid-column: 1;
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-header-left .signal-heading-copy small,
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-sync span {
    display: none;
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) {
    padding: var(--space-3);
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-card-header {
    margin: calc(var(--space-3) * -1) calc(var(--space-3) * -1) var(--space-3);
    padding: 8px var(--space-3);
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-direction-row {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-3);
  }

  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-confidence-block {
    width: 100%;
  }

  .signal-monitor-meta {
    grid-template-columns: 1fr;
  }
}

.positions-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 118px;
  padding: var(--space-6) 0;
}

.empty-icon {
  color: var(--text-muted);
  opacity: 0.45;
}

.empty-title {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.empty-sub {
  color: var(--text-muted);
  font-size: 12px;
  opacity: 0.65;
}

.positions-table-wrap,
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-card);
}

.positions-table,
.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.positions-table th,
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.positions-table td,
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}

.positions-table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: 0;
}

.positions-table tr:hover td,
.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.empty-row td {
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-ui);
}

.dir-buy,
.tag.buy {
  color: var(--color-positive);
  font-weight: 800;
}

.dir-sell,
.tag.sell {
  color: var(--color-negative);
  font-weight: 800;
}

.dir-unknown {
  color: var(--text-muted);
  font-weight: 700;
}

.dir-close,
.tag.close {
  color: var(--color-info, #63b3ed);
  font-weight: 800;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  font-size: 12px;
  font-weight: 800;
}

/* AI 持仓管理：与交易员工作区共用紧凑、可审计的信息层级。 */
.position-management-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: var(--space-3);
  min-width: 0;
}

.position-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: linear-gradient(115deg, color-mix(in srgb, var(--gold-primary) 7%, var(--bg-card)), var(--bg-card) 58%);
}

.position-management-head h2 {
  margin: 3px 0 2px;
  color: var(--text-primary);
  font-size: var(--type-section);
}

.position-management-head p,
.position-management-toolbar p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.position-management-head-actions,
.management-live-status,
.position-management-toolbar,
.position-management-toolbar label,
.position-management-toolbar p {
  display: flex;
  align-items: center;
}

.position-management-head-actions {
  gap: var(--space-2);
  flex: 0 0 auto;
}

.management-live-status {
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-input) 72%, transparent);
  font-size: 11px;
  white-space: nowrap;
}

.management-live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.management-live-status.live {
  color: var(--status-connected);
  border-color: var(--status-connected-border);
  background: var(--status-connected-bg);
}

.management-live-status.live i {
  background: var(--status-connected);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-connected) 14%, transparent);
}

.position-management-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.position-management-settings {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(440px, 1.45fr);
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.management-settings-copy strong,
.management-settings-copy small {
  display: block;
}

.management-settings-copy strong { color: var(--text-primary); font-size: 13px; }
.management-settings-copy small { margin-top: 3px; color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
.management-settings-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: var(--space-2); align-items: end; }
.management-settings-form label { display: grid; gap: 5px; }
.management-settings-form label > span { color: var(--text-secondary); font-size: 10px; }
.management-settings-form select,
.management-settings-form input { width: 100%; min-height: 34px; padding: 0 9px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); color: var(--text-primary); background: var(--bg-input); font: inherit; }
.management-settings-form select:focus-visible,
.management-settings-form input:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 1px; }
.position-management-toolbar {
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  padding: 7px var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-input-soft);
}

.position-management-toolbar label {
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.position-management-toolbar p {
  gap: 7px;
  color: var(--color-warning);
  text-align: right;
}

.position-management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
  gap: var(--space-3);
  align-items: start;
  min-width: 0;
}

.position-management-list-card,
.position-management-detail {
  min-width: 0;
  padding: var(--space-3);
}

.position-management-table {
  min-width: 850px;
}

.position-management-table td {
  vertical-align: middle;
  font-family: var(--font-ui);
}

.management-group-cell {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.management-group-cell strong {
  color: var(--text-primary);
  font-size: 13px;
}

.management-group-cell small {
  overflow: hidden;
  max-width: 190px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-state,
.management-action,
.management-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: var(--bg-input-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.management-state.confirmed,
.management-state.completed {
  color: var(--status-connected);
  border-color: var(--status-connected-border);
  background: var(--status-connected-bg);
}

.management-state.candidate,
.management-action.exit,
.management-action.cancel {
  color: var(--color-warning);
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}

.management-state.failed,
.management-state.expired {
  color: var(--status-danger);
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.management-mode.shadow {
  color: var(--color-info);
  border-color: color-mix(in srgb, var(--color-info) 36%, var(--border-default));
  background: var(--color-info-bg);
}

.management-detail-btn {
  min-width: 44px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.management-detail-btn:hover,
.management-detail-btn:focus-visible,
.position-management-table tr.selected td {
  color: var(--text-primary);
  border-color: var(--border-gold);
  background: var(--gold-wash);
}

.management-detail-btn:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

.position-management-detail {
  position: sticky;
  top: var(--space-3);
  display: grid;
  gap: var(--space-3);
}

.position-management-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 220px;
  place-content: center;
  color: var(--text-muted);
  text-align: center;
}

.position-management-empty strong {
  color: var(--text-primary);
}

.position-management-empty span {
  max-width: 260px;
  font-size: 12px;
  line-height: 1.55;
}

.management-detail-head,
.management-detail-section header,
.management-timeline li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.management-detail-head {
  justify-content: space-between;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.management-detail-head h3 {
  margin: 3px 0 1px;
  color: var(--text-primary);
  font-size: 16px;
}

.management-detail-head p,
.management-detail-section p,
.management-detail-section li {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.management-detail-section {
  display: grid;
  gap: 8px;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-input-softer);
}

.management-target-summary {
  display: grid;
  gap: 10px;
  padding: var(--space-3);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  background: var(--gold-wash);
}

.management-target-summary > header,
.management-target-summary > header > div {
  display: flex;
  align-items: center;
}

.management-target-summary > header {
  justify-content: space-between;
  gap: var(--space-2);
}

.management-target-summary > header > div {
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.management-target-summary > header span:first-child {
  color: var(--text-secondary);
  font-size: 11px;
}

.management-target-summary > header strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
}

.management-detail-section header {
  justify-content: space-between;
}

.management-detail-section h4 {
  color: var(--text-primary);
  font-size: 12px;
}

.management-detail-section header > div > p {
  margin-top: 2px;
  font-size: 11px;
}

.management-detail-section > small {
  color: var(--text-muted);
  font-size: 10px;
}

.management-confirmation-meter {
  overflow: hidden;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
}

.management-confirmation-meter i {
  display: block;
  width: var(--confirmation-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--gold-primary);
  transition: width var(--transition-fast);
}

.management-confirmation-list {
  display: grid;
  gap: 8px;
  list-style: none;
}

.management-confirmation-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.management-confirmation-index {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--color-warning-border);
  border-radius: 50%;
  color: var(--color-warning);
  background: var(--color-warning-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.management-confirmation-row > div {
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.management-confirmation-row:last-child > div {
  padding-bottom: 0;
  border-bottom: 0;
}

.management-confirmation-row header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.management-confirmation-row header strong {
  color: var(--text-primary);
  font-size: 11px;
}

.management-confirmation-row time,
.management-confirmation-row small,
.management-confirmation-empty {
  color: var(--text-muted);
  font-size: 10px;
}

.management-confirmation-row p {
  margin: 3px 0;
}

.management-confirmation-row.invalid .management-confirmation-index {
  border-color: var(--status-danger-border);
  color: var(--status-danger);
  background: var(--status-danger-bg);
}

.management-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--border-subtle);
}

.management-detail-grid div {
  padding: 8px 10px;
  background: var(--bg-card);
}

.management-detail-grid span,
.management-detail-grid strong {
  display: block;
}

.management-detail-grid span {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.management-detail-grid strong {
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.management-timeline {
  display: grid;
  gap: 9px;
  list-style: none;
}

.management-timeline li {
  position: relative;
  padding-left: 15px;
}

.management-timeline li::before {
  position: absolute;
  top: 6px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
  content: "";
}

.management-timeline time {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.management-timeline time > span {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--gold-wash);
  color: var(--gold-primary);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .02em;
}

@media (max-width: 1180px) {
  .position-management-layout { grid-template-columns: 1fr; }
  .position-management-detail { position: static; }
  .position-management-settings { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .position-management-head,
  .position-management-toolbar { align-items: stretch; flex-direction: column; }
  .position-management-head-actions { justify-content: space-between; }
  .position-management-toolbar p { text-align: left; }
  .position-management-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-settings-form { grid-template-columns: 1fr; }
  .management-settings-form label:first-child { grid-column: auto; }
  .management-settings-form button { width: 100%; }
  .position-management-detail { padding: var(--space-2); }
  .management-detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .management-detail-btn,
  .management-confirmation-meter i { transition: none; }
}

.tag.hold {
  color: var(--color-warning);
}

.tag.close {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.close-price-link {
  color: #f59e0b !important;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.close-price-link:hover {
  text-decoration: underline;
}

.remark-cell {
  color: var(--text-muted);
  font-size: 12px;
}

.close-highlight {
  display: inline;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.32);
  padding: 2px 6px;
  margin: 2px 0;
  border-radius: 0 4px 4px 0;
  color: #f59e0b;
  font-weight: 600;
}

.close-remark-tag {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  color: #f59e0b;
  font-weight: 500;
}

.history-protection-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.history-protection-value small {
  padding: 1px 4px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 4px;
  background: rgba(45, 212, 191, 0.08);
  color: #5eead4;
  font-size: 10px;
  font-weight: 600;
}

.close-detail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.close-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.close-detail-ticket {
  font-weight: 700;
  color: #f59e0b;
  font-family: monospace;
}

.close-detail-status {
  margin-right: 4px;
}

.close-detail-row em {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  margin-left: 4px;
}

/* CLOSE signal analysis table */
.close-analysis-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}
.close-analysis-table thead th {
  text-align: left;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.close-analysis-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  vertical-align: middle;
}
.close-analysis-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.close-analysis-table .close-action {
  color: #ef4444;
  font-weight: 600;
}
.close-analysis-table .hold-action {
  color: #22c55e;
  font-weight: 600;
}
.close-analysis-table .confidence-high {
  color: #ef4444;
  font-weight: 600;
}
.close-analysis-table .confidence-mid {
  color: #f59e0b;
  font-weight: 600;
}
.close-analysis-table .confidence-low {
  color: rgba(255, 255, 255, 0.5);
}
.close-analysis-table .action-col {
  min-width: 90px;
}
.close-analysis-table .confidence-col {
  min-width: 80px;
}
.close-analysis-table .close-ticket-link {
  color: var(--accent-primary, #f0b90b);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.close-analysis-table .close-ticket-link:hover {
  color: var(--accent-hover, #fcd535);
  text-decoration: underline;
}

/* Order row highlight animation */
@keyframes order-highlight-flash {
  0%   { background: rgba(240, 185, 11, 0.35); }
  50%  { background: rgba(240, 185, 11, 0.18); }
  100% { background: transparent; }
}
.order-highlight {
  animation: order-highlight-flash 2.5s ease-out;
}

/* History profit chart */
.history-scope-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.kline-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-secondary) 86%, transparent);
  font-size: 11px;
  white-space: nowrap;
}

.kline-source-badge.is-platform { color: #7dd3fc; border-color: rgba(56, 189, 248, .35); }
.kline-source-badge.is-fallback { color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.history-scope-bar .filter-field,
.history-range-dates {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 0 0 auto;
  width: auto;
}
.history-scope-bar > .filter-field { flex-direction: row; }
.history-scope-bar .filter-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.history-scope-bar .filter-select,
.history-scope-bar .filter-date {
  min-height: 30px;
  padding: 4px 9px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color-scheme: dark;
}
.history-scope-bar .filter-select { width: 150px; }
.history-scope-bar .filter-date { width: 132px; }
.history-scope-bar .filter-date:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.history-scope-bar .field-help {
  flex: 1 1 260px;
  margin: 0;
}
.history-chart-wrap {
  position: relative;
  padding: var(--space-2) 0 var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-2);
}
.history-chart-wrap canvas {
  width: 100% !important;
  max-height: 160px;
}
.chart-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  padding: var(--space-2) 0;
}
.chart-stats-row {
  display: flex;
  gap: var(--space-4);
}
.chart-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chart-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.chart-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.chart-stat-value.positive { color: var(--color-positive); }
.chart-stat-value.negative { color: var(--color-negative); }
.chart-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.chart-date-input {
  background: var(--bg-input, #1c2333);
  border: 1px solid var(--border-default, #1e293b);
  border-radius: 6px;
  color: var(--text-secondary, #e2e8f0);
  font-size: 12px;
  padding: 5px 8px;
  width: 120px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.2s;
}
.chart-date-input:focus {
  border-color: var(--gold-primary, #d4af37);
}
.chart-date-sep {
  color: var(--text-muted, #4a5568);
  font-size: 11px;
}
.chart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.chart-btn-apply {
  background: var(--gold-primary, #d4af37);
  color: #000;
}
.chart-btn-apply:hover {
  background: var(--gold-light, #e8c54a);
  box-shadow: 0 0 8px rgba(212,175,55,0.3);
}
.chart-btn-reset {
  background: transparent;
  border: 1px solid var(--border-default, #1e293b);
  color: var(--text-muted, #4a5568);
}
.chart-btn-reset:hover {
  border-color: var(--text-muted, #4a5568);
  color: var(--text-secondary, #e2e8f0);
}

/* History filter bar */
.history-filter-bar {
  padding: var(--space-3) 0;
  gap: var(--space-3);
}
.history-filter-bar .filter-field {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.history-filter-bar .filter-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}
.history-filter-bar .filter-date {
  width: auto;
  min-width: 126px;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  color-scheme: dark;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.history-filter-bar .filter-date:hover {
  border-color: var(--gold-dim);
}
.history-filter-bar .filter-date:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.history-filter-bar .filter-date::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.5) hue-rotate(10deg);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.history-filter-bar .filter-date::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.history-filter-bar .filter-range-sep {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
}
.history-filter-bar .filter-select {
  min-width: 90px;
  min-height: 30px;
  padding: 4px 28px 4px 9px;
  font-size: 12px;
  color: var(--text-primary);
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.history-filter-bar .filter-select:hover {
  border-color: var(--gold-dim);
}
.history-filter-bar .filter-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.history-filter-bar .filter-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}
.btn-filter-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-inverse);
  background: var(--gold-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-filter-action:hover {
  background: var(--gold-light);
  box-shadow: 0 0 12px var(--gold-glow-strong);
}
.btn-filter-action:active {
  background: var(--gold-dim);
}
.btn-filter-action svg {
  opacity: 0.85;
}
.btn-filter-reset {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.btn-filter-reset:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.date-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
}

.time-cell {
  white-space: nowrap;
}

.table-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.filter-select {
  width: auto;
  min-width: 118px;
  min-height: 30px;
  padding: 4px 28px 4px 9px;
  color: var(--text-secondary);
  font-size: 12px;
}

.record-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.conf-mini {
  display: flex;
  align-items: center;
  gap: 7px;
}

.conf-mini-track {
  display: block;
  width: 52px;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
}

.conf-mini-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-primary));
}

.conf-mini.conf-high .conf-mini-fill {
  background: linear-gradient(90deg, var(--color-positive-dark), var(--color-positive));
}

.conf-mini.conf-low .conf-mini-fill {
  background: linear-gradient(90deg, var(--color-warning-dark), var(--color-warning));
}

.tp-cell {
  color: var(--text-secondary);
}

.tp-cell .tp3-val {
  color: var(--text-muted);
}

.comment-cell {
  max-width: 220px;
}

.comment-ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  min-height: 32px;
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 12px;
}

.pager-info {
  font-family: var(--font-mono);
}

.pager-btn {
  min-height: 28px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pager-btn:hover {
  color: var(--gold-primary);
  border-color: var(--border-gold);
}

.pager-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.row-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.row-status.live {
  color: var(--status-connected);
  background: var(--status-connected-bg);
  border: 1px solid var(--status-connected-border);
}

.row-status.expired {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
}

.row-status.executed {
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: var(--space-4);
}

.config-section {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-input-softer);
}

.config-section-title {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.model-sharing-toggle { display: block; margin-bottom: var(--space-4); }
.model-sharing-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.model-sharing-row > span { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-subtle); transition: .2s; }
.slider.round { border-radius: 22px; }
.slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; transition: .2s; border-radius: 50%; }
input:checked + .slider { background: var(--gold-primary); }
input:checked + .slider::before { transform: translateX(18px); }

.unit-field {
  position: relative;
  display: block;
}

.unit-field input {
  padding-right: 38px;
}

.input-unit {
  position: absolute;
  right: 11px;
  top: 50%;
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-50%);
}

.config-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-2);
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.check-row input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--gold-primary);
}

.auto-execute-row {
  display: grid;
  gap: var(--space-2);
}

.auto-execute-row .check-row {
  min-height: 44px;
}

.auto-execute-warning {
  display: none;
  padding: 9px 10px;
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.auto-execute-row:has(#enableAutoTrade:checked) .auto-execute-warning {
  display: block;
}

.prompt-box {
  margin-top: var(--space-2);
}

#systemPrompt {
  min-height: 250px;
  padding: 13px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  letter-spacing: 0;
}

.inline-status {
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: 13px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 450px minmax(0, 1fr);
  gap: var(--space-5);
}

.trading-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: var(--space-5);
}

.trading-grid > .card:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.trading-grid > .card:nth-child(2) { grid-column: 2; grid-row: 1; }
.trading-grid > .card:nth-child(3) { grid-column: 2; grid-row: 2; }

.account-snapshot-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: var(--space-3);
  align-items: stretch;
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.account-snapshot-row div {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input-soft);
}

.account-snapshot-row span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.account-snapshot-row strong {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeframe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.timeframe-grid label {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 46px;
  padding: 0 var(--space-2);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.timeframe-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tf-card-code {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.tf-card-name {
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
}

.timeframe-grid label:hover,
.timeframe-grid label:has(input:checked) {
  border-color: var(--gold-primary);
  background: var(--gold-wash);
}

.timeframe-grid label:has(input:checked) .tf-card-code {
  color: var(--gold-primary);
}

.latency-box,
.history-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.history-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: var(--space-4);
}

.latency-box div,
.history-stats div {
  min-height: 58px;
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.latency-box span,
.history-stats span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.latency-box strong,
.history-stats strong {
  color: var(--text-primary);
  font-size: 16px;
}

.history-stats div.zero-value {
  background: var(--bg-input-softer);
  border-color: var(--border-subtle);
}

.history-stats div.zero-value span,
.history-stats div.zero-value strong {
  color: var(--text-muted);
  font-weight: 600;
}

.analysis-result {
  min-height: 360px;
}

.analysis-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
}

.analysis-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input-soft);
  border-radius: 3px;
  overflow: hidden;
}

.analysis-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
  border-radius: 3px;
  transition: transform 0.5s ease;
}

.analysis-progress-text {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12px;
  color: var(--text-muted);
}

.muted-block {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  background: var(--bg-input-soft);
  color: var(--text-muted);
}

.signal-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.signal-detail-grid > div {
  min-width: 0;
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.signal-detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.signal-detail-grid strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.analysis-text {
  position: relative;
  padding: var(--space-4);
  background: var(--bg-input-softer);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-wrap;
}

.analysis-text.collapsed {
  max-height: 180px;
  overflow: hidden;
}

.analysis-text.collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 54px;
  background: linear-gradient(180deg, transparent, var(--bg-input-softer));
  pointer-events: none;
}

.analysis-text strong {
  color: var(--gold-primary);
}

.analysis-expand-row {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-2);
}

.btn-expand-analysis {
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-expand-analysis:hover {
  color: var(--gold-light);
}

.analysis-result-card {
  display: flex;
  flex-direction: column;
  min-height: 620px;
}

.analysis-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.analysis-summary-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.analysis-symbol {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
}

.analysis-time {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.analysis-direction-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-width: max-content;
  min-height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

.analysis-direction-badge.buy {
  color: var(--color-positive);
  border-color: var(--color-positive-border);
}

.analysis-direction-badge.sell {
  color: var(--color-negative);
  border-color: var(--color-negative-border-strong);
}

.analysis-direction-badge.hold {
  color: var(--color-warning);
  border-color: var(--color-warning-border);
}

.analysis-direction-badge.close {
  color: var(--color-info, #63b3ed);
  border-color: rgba(99, 179, 237, 0.4);
  background: rgba(99, 179, 237, 0.08);
}

.analysis-status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.analysis-status-strip div {
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.analysis-status-strip span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.analysis-status-strip strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input-soft);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
}

.status-tag.live {
  color: var(--status-connected);
  background: var(--status-connected-bg);
  border-color: var(--status-connected-border);
}

.status-tag.expired {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.status-tag.executed {
  color: var(--text-secondary);
  background: var(--bg-input);
  border-color: var(--border-default);
}

.analysis-section {
  margin-top: var(--space-4);
}

.analysis-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.analysis-history-panel {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.analysis-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.analysis-history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  max-height: 381px;
  overflow: auto;
  padding-right: var(--space-1);
}

.analysis-history-item {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-input-soft);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.analysis-history-item:hover,
.analysis-history-item.active {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.analysis-history-item:active {
  transform: translateY(1px);
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.history-item-symbol {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-dir {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.history-item-dir.close {
  color: var(--color-info, #63b3ed);
}

.history-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.history-item-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-empty {
  grid-column: 1 / -1;
  padding: var(--space-4);
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}

.history-sentinel {
  grid-column: 1 / -1;
  padding: var(--space-3);
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
  transition: background var(--transition-fast);
}

.data-table tr[data-analysis-id] {
  cursor: pointer;
}

.two-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0 0 0;
}

.trade-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.trading-quote-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.trading-quote-row div {
  min-width: 0;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input-softer);
}

.trading-quote-row span {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.trading-quote-row strong {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-button-row .btn {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.trade-button-row .btn > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.order-btn-price {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.order-type-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: var(--space-3) 0;
}

.order-type-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.order-type-btns {
  display: flex;
  gap: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  width: fit-content;
}

.order-type-btn {
  padding: 7px 17.5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm) - 1px);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.order-type-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.order-type-btn.active {
  color: var(--text-inverse);
  background: var(--gold-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.pending-price-hint {
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
  margin: var(--space-1) 0;
}

.signal-pending-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.15);
  margin: var(--space-2) 0;
}

.signal-pending-info div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.signal-pending-info span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.signal-pending-info strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  font-family: var(--font-mono);
}

.pending-ticket-link {
  color: var(--gold-primary);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 600;
}

.pending-ticket-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

.audit-row.row-error td {
  background: rgba(239, 68, 68, 0.055);
}

.audit-row.row-rejected td {
  background: rgba(245, 158, 11, 0.045);
}

.audit-row.row-skipped td {
  background: rgba(148, 163, 184, 0.035);
}

.order-type-btn[hidden] {
  display: none;
}

.audit-row.row-needs_confirmation td {
  background: rgba(59, 130, 246, 0.045);
}

.audit-row:hover td {
  background: var(--bg-card-hover);
}

.action-badge,
.audit-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.action-badge.manual {
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
}

.action-badge.ai {
  color: var(--gold-primary);
  background: var(--gold-wash);
  border: 1px solid var(--border-gold);
}

.audit-status.success {
  color: var(--status-connected);
  background: var(--status-connected-bg);
  border: 1px solid var(--status-connected-border);
}

.audit-status.error {
  color: var(--status-danger);
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
}

.audit-status.rejected {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
}

.audit-status.skipped {
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
}

.audit-status.needs_confirmation {
  color: var(--color-info);
  background: var(--color-info-bg);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.audit-result-cell {
  max-width: 430px;
}

.audit-result-text {
  display: flex;
  align-items: center;
  min-height: 40px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.audit-result-text.expanded {
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.audit-workspace {
  max-width: 1380px;
}

.audit-page-head .btn {
  min-height: 40px;
}

.audit-insight-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.audit-records-card {
  overflow: hidden;
  padding: 0;
  border-color: var(--calm-border);
  background: var(--calm-surface);
}

.audit-records-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--calm-border);
}

.audit-records-head h2 {
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 17px;
}

.audit-records-head p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.audit-records-head .record-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.audit-filter-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--calm-border);
  background: color-mix(in srgb, var(--bg-input) 45%, transparent);
}

.audit-filter-toolbar label {
  display: grid;
  min-width: 150px;
  gap: 5px;
}

.audit-filter-toolbar label > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.audit-filter-toolbar .filter-select {
  min-height: 38px;
}

.audit-table-wrap {
  border: 0;
  border-radius: 0;
}

.audit-table th:nth-child(1) { width: 142px; }
.audit-table th:nth-child(2) { width: 150px; }
.audit-table th:nth-child(3) { width: 100px; }
.audit-table th:nth-child(4) { width: 112px; }
.audit-table td:nth-child(5),
.audit-table td:nth-child(6) {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-records-card > .pager {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--calm-border);
}

.order-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(8, 11, 20, 0.78);
  backdrop-filter: blur(5px);
}

.order-confirm-dialog {
  width: min(520px, calc(100vw - 40px));
  padding: var(--space-5);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: var(--shadow-modal);
}

.order-confirm-head,
.order-confirm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.order-confirm-head {
  margin-bottom: var(--space-4);
}

.order-confirm-head strong {
  color: var(--text-primary);
  font-size: 16px;
}

#orderConfirmClose {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.order-confirm-body {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
  font-size: 13px;
}

.order-confirm-body div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

#genericConfirmBody .confirm-message {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

#genericConfirmBody .confirm-impact-list {
  display: grid;
  margin: var(--space-2) 0;
  border-top: 1px solid var(--border-subtle);
}

#genericConfirmBody .confirm-impact-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: 10px 0;
}

#genericConfirmBody .confirm-impact-row dt {
  color: var(--text-muted);
  font-size: 12px;
}

#genericConfirmBody .confirm-impact-row dd {
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  text-align: right;
}

#genericConfirmBody .confirm-impact-row.danger dd {
  color: var(--color-negative);
}

#genericConfirmBody .confirm-impact-row.warning dd {
  color: var(--color-warning);
}

#genericConfirmBody .confirm-impact-row.risk-high dd {
  color: #fda4af;
}

#genericConfirmBody .confirm-text-check {
  display: grid;
  gap: 8px;
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--color-negative) 38%, var(--border-default));
  border-radius: var(--radius-sm);
  background: var(--color-negative-bg);
}

#genericConfirmBody .confirm-text-check label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

#genericConfirmBody .confirm-text-check code {
  overflow-wrap: anywhere;
  color: var(--color-negative);
  font-family: var(--font-mono);
  font-size: 12px;
}

#genericConfirmBody .confirm-text-check input {
  width: 100%;
}

#genericConfirmBody .confirm-text-check small {
  color: var(--text-muted);
  font-size: 11px;
}

.order-confirm-body .confirm-risk-section {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input-soft);
}

.confirm-risk-title {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.confirm-risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.order-confirm-body .confirm-risk-grid div {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
}

.confirm-risk-grid span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.confirm-risk-warning {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  font-size: 12px;
  font-weight: 800;
}

.confirm-risk-warning.blocking {
  color: var(--status-danger);
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
}

.order-confirm-body strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.order-confirm-actions {
  justify-content: flex-end;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: grid;
  gap: var(--space-2);
}

.toast {
  width: min(420px, calc(100vw - 36px));
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-color: color-mix(in srgb, var(--color-info) 48%, var(--border-default));
  border-radius: 8px;
  box-shadow: var(--shadow-modal);
  color: var(--text-primary);
  font-size: 13px;
}

.toast.success {
  border-color: color-mix(in srgb, var(--status-connected) 48%, var(--border-default));
}

.toast.warning {
  border-color: color-mix(in srgb, var(--color-warning) 48%, var(--border-default));
}

.toast.error {
  border-color: color-mix(in srgb, var(--status-danger) 48%, var(--border-default));
}

.toast.signal-notification {
  position: fixed;
  right: 18px;
  top: 68px;
  bottom: auto;
  width: min(360px, calc(100vw - 36px));
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--gold-primary);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.15);
  z-index: 1001;
  animation: notifSlideIn 0.3s ease-out;
}

.toast.signal-notification:hover {
  border-color: var(--gold-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.25);
}

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.notif-header {
  font-size: 12px;
  color: var(--gold-primary);
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.notif-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notif-symbol {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.notif-dir {
  font-size: 11px;
}

.notif-tf {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
}

.notif-conf {
  font-size: 12px;
  color: var(--gold-primary);
  font-weight: 600;
  margin-left: auto;
}

.form-error {
  min-height: 20px;
  color: var(--status-danger);
  font-size: 13px;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--color-positive-pulse);
  }
  50% {
    box-shadow: 0 0 0 5px var(--color-positive-pulse-clear);
  }
}

@keyframes pulse-dot-green {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-dot-gold {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.32);
  }
  50% {
    opacity: 0.82;
    box-shadow: 0 0 0 5px rgba(212, 175, 55, 0);
  }
}

@keyframes pulse-dot-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
  }
}

@keyframes pulse-dot-amber {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0);
  }
}

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

@keyframes price-flash-up {
  0% {
    color: var(--text-primary);
  }
  30% {
    color: var(--color-positive);
    background: var(--color-positive-bg);
  }
  100% {
    color: var(--text-primary);
    background: transparent;
  }
}

@keyframes price-flash-down {
  0% {
    color: var(--text-primary);
  }
  30% {
    color: var(--color-negative);
    background: var(--color-negative-bg);
  }
  100% {
    color: var(--text-primary);
    background: transparent;
  }
}

.price-flash-up {
  animation: price-flash-up 0.8s ease;
}

.price-flash-down {
  animation: price-flash-down 0.8s ease;
}

/* Unified AI configuration workspace */
.workspace-page { display:flex; flex-direction:column; gap:var(--space-5); max-width:1440px; margin:0 auto; }
.workspace-header { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-5); padding:2px 0 var(--space-2); }
.workspace-header h1 { font-size:24px; line-height:1.25; font-weight:700; letter-spacing:-.02em; text-wrap:balance; }
.workspace-header p,.section-heading p { color:var(--text-secondary); margin-top:6px; max-width:72ch; text-wrap:pretty; }
.workspace-panel { background:var(--bg-card); border:1px solid var(--border-default); border-radius:var(--radius-lg); padding:var(--space-5); }
.workspace-list { display:flex; flex-direction:column; gap:var(--space-3); }
.section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-4); margin-bottom:var(--space-4); }
.section-heading h2 { font-size:17px; line-height:1.35; }
.source-notice,.strategy-source-row,.admin-boundary-note { display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); padding:12px 14px; border:1px solid var(--border-gold); border-radius:var(--radius-md); background:var(--gold-wash); color:var(--text-secondary); }
.source-notice strong,.strategy-source-row strong,.admin-boundary-note strong { color:var(--text-primary); }
.strategy-source-row { margin:0; }
.strategy-source-row > div { display:flex; align-items:center; gap:10px; }
.strategy-source-row > div > div { display:grid; gap:2px; }
.strategy-source-row .source-icon { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:var(--radius-sm); background:rgba(212,175,55,.12); color:var(--gold-primary); }
.strategy-source-row span { font-size:12px; }
.strategy-catalog { display:flex; flex-direction:column; gap:12px; padding:0; }
.settings-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:var(--space-4); }
.settings-grid.compact { margin-top:var(--space-4); }
.settings-grid label { display:flex; flex-direction:column; gap:7px; color:var(--text-secondary); font-size:13px; }
.settings-grid input,.settings-grid select { width:100%; }
.form-actions { display:flex; gap:var(--space-3); margin-top:var(--space-5); }
.policy-switches { display:flex; flex-wrap:wrap; gap:10px; }
.policy-switches label,.inline-switch { display:flex; align-items:center; gap:8px; min-height:38px; padding:0 12px; border-radius:var(--radius-md); background:var(--bg-input-soft); color:var(--text-secondary); }
.policy-switches input,.inline-switch input { width:auto; }
.rollout-health-summary { margin-top:14px; padding-top:12px; border-top:1px solid var(--border-default); }
.workspace-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); padding:14px 16px; background:var(--bg-card); border:1px solid var(--border-default); border-radius:var(--radius-md); }
.workspace-row:hover { border-color:#334155; background:var(--bg-card-hover); }
.workspace-row-main { min-width:0; display:flex; flex-direction:column; gap:5px; }
.workspace-row-title { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-weight:650; }
.workspace-row-meta { display:flex; flex-wrap:wrap; gap:8px 14px; color:var(--text-secondary); font-size:12px; }
.workspace-row-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.form-modal-open { overflow:hidden; }
body.form-modal-open .content-card { animation:none !important; transform:none !important; }
.form-modal { position:fixed; z-index:1000; inset:0; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(2,6,23,.68); backdrop-filter:blur(8px); }
.form-modal.hidden { display:none; }
.form-modal-dialog { width:min(100%,760px); max-height:calc(100dvh - 48px); margin:0; overflow:auto; padding:18px; border-color:color-mix(in srgb,var(--border-default) 72%,var(--gold-primary)); box-shadow:var(--shadow-modal); outline:none; overscroll-behavior:contain; }
.form-modal-dialog:focus-visible { box-shadow:var(--shadow-modal),0 0 0 2px var(--gold-primary); }
.strategy-editor-dialog { width:min(100%,1180px); }
.subscription-editor-dialog {
  width:min(100%,780px);
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-gutter:stable;
}
.form-modal-dialog > .section-heading { position:sticky; z-index:4; top:-18px; margin:-18px -18px 16px; padding:16px 18px 12px; border-bottom:1px solid var(--border-default); background:color-mix(in srgb,var(--bg-card) 96%,transparent); backdrop-filter:blur(10px); }
.form-modal-dialog > .section-heading h2 { margin:0; }
.form-modal-dialog > .section-heading p { margin-top:4px; }
.form-modal-actions { position:sticky; z-index:3; bottom:-18px; justify-content:flex-end; margin:16px -18px -18px; padding:12px 18px; border-top:1px solid var(--border-default); background:color-mix(in srgb,var(--bg-card) 96%,transparent); backdrop-filter:blur(10px); }
.position-row-actions-cell { white-space:nowrap; }
.position-row-actions-cell .btn + .btn { margin-left:6px; }
.position-protection-edit { border-color:color-mix(in srgb,var(--gold-primary) 42%,var(--border-default)); color:var(--gold-light); }
.position-protection-dialog { width:min(100%,780px); overflow-x:hidden; scrollbar-gutter:stable; }
.position-protection-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.position-protection-heading .icon-btn { flex:0 0 auto; }
.position-protection-section { margin-top:12px; padding:16px; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-input-softer); }
.position-protection-overview { border-color:color-mix(in srgb,var(--gold-primary) 30%,var(--border-default)); background:color-mix(in srgb,var(--gold-primary) 4%,var(--bg-input-softer)); }
.position-protection-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.position-protection-section-head > div { display:flex; align-items:center; gap:8px; min-width:0; }
.position-protection-section-head h3 { color:var(--text-primary); font-size:14px; line-height:1.35; }
.position-protection-section-head > span { color:var(--text-muted); font-size:11px; }
.position-protection-step { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border:1px solid color-mix(in srgb,var(--gold-primary) 44%,transparent); border-radius:8px; background:var(--gold-wash); color:var(--gold-primary); font-family:var(--font-mono); font-size:10px; font-weight:800; }
.position-protection-live { display:inline-flex; align-items:center; gap:5px; min-height:26px; padding:0 8px; border:1px solid var(--status-connected-border); border-radius:var(--radius-pill); background:var(--status-connected-bg); color:var(--status-connected) !important; font-weight:700; white-space:nowrap; }
.position-protection-summary { display:grid; gap:10px; }
.position-protection-identity { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; min-width:0; padding:13px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-card); }
.position-protection-identity > div { min-width:0; }
.position-protection-identity strong,.position-protection-identity small { display:block; overflow-wrap:anywhere; }
.position-protection-identity strong { color:var(--text-primary); font-size:17px; line-height:1.3; }
.position-protection-identity small { margin-top:4px; color:var(--text-muted); font-size:11px; }
.position-protection-direction { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:0 10px; border:1px solid; border-radius:var(--radius-pill); font-size:12px; font-weight:800; }
.position-protection-direction.is-buy { border-color:var(--status-connected-border); background:var(--status-connected-bg); color:var(--status-connected); }
.position-protection-direction.is-sell { border-color:var(--status-danger-border); background:var(--status-danger-bg); color:var(--status-danger); }
.position-protection-connection { display:inline-flex; align-items:center; gap:6px; min-height:28px; color:var(--text-secondary); font-size:11px; font-weight:700; white-space:nowrap; }
.position-protection-connection i { width:7px; height:7px; border-radius:50%; background:currentColor; }
.position-protection-connection.is-online { color:var(--status-connected); }
.position-protection-connection.is-offline { color:var(--status-danger); }
.position-protection-facts,.position-protection-impact { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.position-protection-facts > div,.position-protection-impact > div { min-width:0; padding:12px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-card); }
.position-protection-facts span,.position-protection-impact span { display:block; margin-bottom:4px; color:var(--text-muted); font-size:12px; }
.position-protection-facts strong,.position-protection-impact strong { display:block; overflow-wrap:anywhere; color:var(--text-primary); font-size:14px; line-height:1.45; }
.position-protection-price-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.position-protection-field,.position-protection-reason { display:flex; flex-direction:column; gap:7px; color:var(--text-secondary); font-size:12px; }
.position-protection-field > span { display:flex; align-items:center; gap:7px; color:var(--text-primary); font-size:12px; font-weight:750; }
.position-protection-field > span b { display:inline-flex; align-items:center; min-height:20px; padding:0 6px; border-radius:5px; background:var(--bg-input); color:var(--text-muted); font-family:var(--font-mono); font-size:10px; }
.position-protection-input { position:relative; display:flex; align-items:center; }
.position-protection-input > svg { position:absolute; z-index:1; left:13px; color:var(--text-muted); pointer-events:none; }
.position-protection-input input { width:100%; min-height:46px; padding:0 76px 0 41px; font-size:14px; }
.position-protection-input em { position:absolute; right:10px; display:inline-flex; align-items:center; min-height:24px; padding:0 7px; border:1px solid var(--border-subtle); border-radius:var(--radius-pill); background:var(--bg-input-soft); color:var(--text-muted); font-size:10px; font-style:normal; font-weight:800; pointer-events:none; }
.position-protection-input em.is-changed { border-color:color-mix(in srgb,var(--gold-primary) 38%,var(--border-default)); background:var(--gold-wash); color:var(--gold-primary); }
.position-protection-field:has(input:focus-visible) .position-protection-input > svg { color:var(--gold-primary); }
.position-protection-field small,.position-protection-reason small { color:var(--text-muted); font-size:11px; line-height:1.5; }
.position-protection-field-error { color:var(--status-danger) !important; font-weight:700; }
.position-protection-field input[aria-invalid="true"],.position-protection-reason textarea[aria-invalid="true"] { border-color:var(--status-danger-border); box-shadow:0 0 0 1px color-mix(in srgb,var(--status-danger) 24%,transparent); }
.position-protection-change-summary { display:grid; grid-template-columns:20px minmax(0,1fr); align-items:start; gap:8px; min-height:40px; margin-top:12px; padding:10px 12px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-card); color:var(--text-secondary); font-size:11px; line-height:1.55; }
.position-protection-change-summary > svg { margin-top:1px; color:var(--text-muted); }
.position-protection-change-summary strong { color:var(--text-primary); }
.position-protection-change-summary.has-changes { border-color:color-mix(in srgb,var(--gold-primary) 34%,var(--border-default)); background:var(--gold-wash); }
.position-protection-change-summary.has-changes > svg { color:var(--gold-primary); }
.position-protection-sync-option { position:relative; display:flex; align-items:center; gap:12px; min-width:0; min-height:68px; padding:12px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-card); cursor:pointer; transition:border-color var(--transition-fast),background var(--transition-fast); }
.position-protection-sync-option:hover { border-color:color-mix(in srgb,var(--gold-primary) 32%,var(--border-default)); background:var(--bg-card-hover); }
.position-protection-sync-option input { position:absolute; width:1px; height:1px; opacity:0; }
.position-protection-switch { position:relative; flex:0 0 42px; width:42px; height:24px; border:1px solid var(--border-default); border-radius:var(--radius-pill); background:var(--bg-input); transition:background var(--transition-fast),border-color var(--transition-fast); }
.position-protection-switch i { position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:var(--text-muted); transition:transform var(--transition-fast),background var(--transition-fast); }
.position-protection-sync-option input:checked + .position-protection-switch { border-color:var(--gold-primary); background:var(--gold-wash); }
.position-protection-sync-option input:checked + .position-protection-switch i { transform:translateX(18px); background:var(--gold-primary); }
.position-protection-sync-option input:disabled + .position-protection-switch { opacity:.46; }
.position-protection-sync-option > span:last-child { display:grid; flex:1 1 auto; min-width:0; gap:4px; }
.position-protection-sync-option strong { color:var(--text-primary); font-size:13px; }
.position-protection-sync-option small { color:var(--text-muted); font-size:11px; line-height:1.5; }
.position-protection-sync-option:has(input:checked) { border-color:color-mix(in srgb,var(--gold-primary) 48%,var(--border-default)); background:var(--gold-wash); }
.position-protection-sync-option:has(input:focus-visible) { outline:2px solid var(--gold-primary); outline-offset:2px; }
.position-protection-sync-option:has(input:disabled) { cursor:not-allowed; opacity:.68; }
.position-protection-scope-badge { display:inline-flex; align-items:center; min-height:24px; padding:0 8px; border:1px solid var(--border-default); border-radius:var(--radius-pill); color:var(--text-secondary) !important; font-weight:750; }
.position-protection-impact { margin-top:12px; }
.terminal-time-pending { color:var(--text-muted); font-size:12px; white-space:normal; }
.position-protection-reason textarea { width:100%; min-height:92px; resize:vertical; line-height:1.6; }
.position-protection-error { margin-bottom:12px; padding:11px 13px; border:1px solid var(--status-danger-border); border-radius:var(--radius-sm); background:var(--status-danger-bg); color:var(--status-danger); font-size:12px; line-height:1.5; }
.position-protection-progress-card { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,42%); align-items:center; gap:24px; padding:16px; border:1px solid color-mix(in srgb,var(--gold-primary) 34%,var(--border-default)); border-radius:var(--radius-md); background:var(--bg-input-softer); }
.position-protection-progress-card h3 { margin:3px 0 4px; color:var(--text-primary); font-size:16px; }
.position-protection-progress-card p { color:var(--text-secondary); font-size:12px; }
.position-protection-progress-card progress { width:100%; height:9px; overflow:hidden; border:0; border-radius:var(--radius-pill); background:var(--border-default); accent-color:var(--gold-primary); }
.position-protection-progress-card progress::-webkit-progress-bar { border-radius:var(--radius-pill); background:var(--border-default); }
.position-protection-progress-card progress::-webkit-progress-value { border-radius:var(--radius-pill); background:linear-gradient(90deg,var(--gold-dim),var(--gold-light)); transition:width var(--transition-normal); }
.position-protection-progress-card progress::-moz-progress-bar { border-radius:var(--radius-pill); background:var(--gold-primary); }
.position-protection-results { max-height:340px; margin-top:12px; border:1px solid var(--border-default); border-radius:var(--radius-md); }
.position-protection-target-status { display:inline-flex; align-items:center; min-height:24px; padding:0 8px; border:1px solid var(--border-default); border-radius:var(--radius-pill); color:var(--text-secondary); font-size:11px; font-weight:700; }
.position-protection-target-status.succeeded { border-color:var(--status-connected-border); background:var(--status-connected-bg); color:var(--status-connected); }
.position-protection-target-status.failed { border-color:var(--status-danger-border); background:var(--status-danger-bg); color:var(--status-danger); }
.position-protection-target-status.skipped { border-color:var(--color-warning-border); background:var(--color-warning-bg); color:var(--color-warning); }
.position-protection-target-status.running { border-color:color-mix(in srgb,var(--color-info) 45%,transparent); background:var(--color-info-bg); color:var(--color-info); }
.position-protection-actions { align-items:center; }
.position-protection-actions > span { margin-right:auto; color:var(--text-muted); font-size:11px; line-height:1.4; }
.position-protection-actions #positionProtectionRetry { margin-right:auto; }
.strategy-card { position:relative; overflow:hidden; padding:16px; border:1px solid var(--border-default); border-radius:var(--radius-lg); background:var(--bg-card); box-shadow:0 10px 28px rgba(2,6,23,.14); }
.strategy-card::before { position:absolute; inset:0 auto 0 0; width:3px; content:""; background:var(--gold-primary); opacity:.78; }
.strategy-card.is-private::before { background:#60a5fa; }
.strategy-card:hover { border-color:color-mix(in srgb,var(--border-default) 45%,var(--gold-primary)); }
.strategy-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.strategy-card-header > div:first-child { min-width:0; display:grid; gap:6px; }
.strategy-card-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; flex:0 0 auto; }
.strategy-card-actions .btn { min-height:34px; }
.strategy-specs { display:grid; grid-template-columns:repeat(3,minmax(150px,1fr)); gap:8px; margin-top:8px; }
.strategy-specs > span { min-width:0; padding:9px 10px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-input-soft); }
.strategy-specs small,.strategy-specs strong { display:block; }
.strategy-specs small { margin-bottom:4px; color:var(--text-muted); font-size:11px; }
.strategy-specs strong { color:var(--text-primary); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.strategy-subscriptions { margin-top:12px; overflow:hidden; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--bg-input-softer); }
.strategy-subscriptions-head { display:flex; align-items:center; justify-content:space-between; min-height:36px; padding:0 11px; border-bottom:1px solid var(--border-subtle); color:var(--text-secondary); }
.strategy-subscriptions-head span { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:700; }
.strategy-subscriptions-head small { color:var(--text-muted); }
.subscription-row { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:54px; padding:8px 10px; }
.subscription-row + .subscription-row { border-top:1px solid var(--border-subtle); }
.subscription-row-info { min-width:0; display:flex; align-items:baseline; flex-wrap:wrap; gap:5px 10px; }
.subscription-row-info strong { color:var(--text-primary); font-size:12px; }
.subscription-row-info span { color:var(--text-muted); font-size:11px; }
.subscription-row-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.btn-danger-ghost { border:1px solid transparent; background:transparent; color:var(--color-negative); }
.btn-danger-ghost:hover { border-color:color-mix(in srgb,var(--color-negative) 35%,transparent); background:var(--color-negative-bg); }
.settings-grid label.is-readonly select { color:var(--text-muted); background:var(--bg-input-softer); cursor:not-allowed; }
.settings-grid label.is-readonly .field-help { color:var(--text-secondary); }
.model-profile-card { border-color:color-mix(in srgb,var(--gold-primary) 32%,var(--border-default)); }
.strategy-editor-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.strategy-form-section { min-width:0; margin:0; padding:14px; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-input-softer); }
.strategy-form-section:first-child,.strategy-form-section:last-child { grid-column:1 / -1; }
.strategy-form-section legend { display:flex; align-items:center; gap:9px; padding:0 8px; color:var(--text-primary); font-size:14px; font-weight:750; }
.strategy-form-section > p { margin:-2px 0 10px; color:var(--text-secondary); font-size:12px; line-height:1.5; }
.section-step { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:var(--gold-wash); color:var(--gold-primary); font-family:var(--font-mono); font-size:11px; }
.market-plan-grid { overflow:hidden; border:1px solid var(--border-default); border-radius:var(--radius-md); }
.market-plan-head,.market-plan-row { display:grid; grid-template-columns:48px minmax(58px,.7fr) minmax(92px,1fr) 58px; align-items:center; gap:8px; min-height:42px; padding:0 10px; }
.market-plan-head { min-height:38px; background:var(--bg-input); color:var(--text-muted); font-size:11px; font-weight:700; }
.market-plan-row { border-top:1px solid var(--border-subtle); background:var(--bg-card); cursor:pointer; }
.market-plan-row:hover { background:var(--bg-card-hover); }
.market-plan-row input[type="number"] { min-height:34px; }
.market-plan-row input[type="checkbox"],.market-plan-row input[type="radio"] { width:18px; height:18px; justify-self:center; }
.strategy-capability-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:10px; }
.strategy-capability-toggle { display:flex; align-items:flex-start; gap:10px; min-height:72px; margin:0; padding:11px 12px; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-input); cursor:pointer; transition:border-color .18s ease,background-color .18s ease; }
.strategy-capability-toggle:hover { border-color:var(--accent-primary); background:var(--bg-card-hover); }
.strategy-capability-toggle:focus-within { outline:2px solid var(--accent-primary); outline-offset:2px; }
.strategy-capability-toggle:has(input:checked) { border-color:var(--border-gold); background:var(--gold-wash); }
.strategy-capability-toggle input { width:19px; height:19px; margin-top:2px; flex:0 0 auto; }
.strategy-capability-toggle span { display:grid; gap:4px; }
.strategy-capability-toggle small { color:var(--text-secondary); line-height:1.5; }
.strategy-capability-toggle strong { color:var(--text-primary); font-size:14px; }
.strategy-capability-toggle small { color:var(--text-muted); line-height:1.55; }
.model-load-error { display:flex; align-items:center; gap:12px; min-height:78px; }
.model-load-error > div { display:grid; gap:4px; min-width:0; flex:1; }
.model-load-error strong { color:var(--text-primary); }
.model-load-error small { color:var(--text-secondary); line-height:1.45; }
.model-load-error-icon { display:grid; place-items:center; width:36px; height:36px; flex:0 0 auto; border-radius:var(--radius-md); background:var(--status-danger-bg); color:var(--status-danger); }
.entry-method-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.entry-method-grid label { display:flex; align-items:flex-start; gap:9px; min-height:70px; padding:10px; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-card); cursor:pointer; transition:border-color var(--transition-fast),background-color var(--transition-fast); }
.entry-method-grid label:hover,.entry-method-grid label:has(input:checked) { border-color:var(--gold-primary); background:var(--gold-wash); }
.entry-method-grid input { width:18px; height:18px; margin-top:2px; }
.entry-method-grid span,.entry-method-grid strong,.entry-method-grid small { display:block; }
.entry-method-grid strong { color:var(--text-primary); font-size:13px; }
.entry-method-grid small { margin-top:5px; color:var(--text-secondary); font-size:11px; line-height:1.5; }
.subscription-editor-heading { align-items:center; }
.subscription-editor-heading .icon-btn { flex:0 0 auto; }
.subscription-editor-content { display:grid; gap:12px; }
.subscription-editor-section { min-width:0; padding:16px; border:1px solid var(--border-default); border-radius:var(--radius-lg); background:var(--bg-input-softer); }
.subscription-primary-section { border-color:color-mix(in srgb,var(--gold-primary) 38%,var(--border-default)); background:linear-gradient(135deg,color-mix(in srgb,var(--gold-wash) 58%,var(--bg-input-softer)),var(--bg-input-softer) 60%); }
.subscription-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; }
.subscription-section-heading > div { display:flex; align-items:flex-start; gap:10px; min-width:0; }
.subscription-section-heading h3 { margin:0; color:var(--text-primary); font-size:14px; line-height:1.4; }
.subscription-section-heading p { margin:3px 0 0; color:var(--text-secondary); font-size:12px; line-height:1.5; }
.subscription-section-index { display:grid; place-items:center; width:28px; height:28px; flex:0 0 auto; border:1px solid var(--border-gold); border-radius:9px; background:var(--gold-wash); color:var(--gold-primary); font-family:var(--font-mono); font-size:10px; font-weight:800; }
.subscription-context-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.subscription-core-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,1fr); align-items:stretch; gap:12px; margin-top:12px; }
.subscription-field,.subscription-symbol-field,.subscription-account-field { position:relative; display:flex; flex-direction:column; gap:7px; color:var(--text-secondary); font-size:13px; }
.subscription-field select,.subscription-symbol-field select { width:100%; min-height:44px; }
.subscription-editor-dialog .field-help { color:var(--text-secondary); font-size:12px; line-height:1.5; }
.subscription-account-display { display:flex; align-items:center; gap:10px; min-height:44px; padding:8px 12px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:color-mix(in srgb,var(--bg-card) 82%,transparent); }
.subscription-account-display > svg { flex:0 0 auto; color:var(--status-connected); }
.subscription-account-display > div { display:grid; gap:2px; min-width:0; }
.subscription-account-display strong { overflow:hidden; color:var(--text-primary); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.subscription-account-display small { overflow:hidden; color:var(--text-secondary); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.subscription-strategy-summary { display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:82px; margin-top:12px; padding:12px 14px; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:color-mix(in srgb,var(--bg-card) 86%,transparent); }
.subscription-strategy-summary > div { min-width:0; }
.subscription-strategy-summary > div > strong { margin-left:8px; color:var(--text-primary); font-size:13px; }
.subscription-strategy-summary p { max-width:56ch; margin:6px 0 0; color:var(--text-secondary); font-size:11px; line-height:1.5; }
.subscription-strategy-summary dl { display:flex; gap:8px; margin:0; flex:0 0 auto; }
.subscription-strategy-summary dl > div { min-width:84px; padding:8px 10px; border-left:1px solid var(--border-subtle); }
.subscription-strategy-summary dt { color:var(--text-muted); font-size:10px; }
.subscription-strategy-summary dd { margin:4px 0 0; color:var(--text-primary); font-family:var(--font-mono); font-size:12px; font-weight:700; }
.subscription-primary-toggle { position:relative; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:10px; min-height:72px; padding:11px 13px; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-card); cursor:pointer; transition:border-color var(--transition-fast),background-color var(--transition-fast); }
.subscription-primary-toggle:hover { border-color:color-mix(in srgb,var(--gold-primary) 55%,var(--border-default)); }
.subscription-primary-toggle:has(input:checked) { border-color:var(--border-gold); background:var(--gold-wash); }
.subscription-primary-toggle:has(input:focus-visible) { outline:2px solid var(--gold-primary); outline-offset:2px; }
.subscription-primary-toggle > input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.subscription-primary-toggle > span:last-child { display:grid; gap:3px; }
.subscription-primary-toggle strong { color:var(--text-primary); font-size:13px; }
.subscription-primary-toggle small { color:var(--text-secondary); font-size:11px; line-height:1.45; }
.subscription-toggle-track { position:relative; width:42px; height:24px; flex:0 0 auto; border:1px solid var(--border-default); border-radius:var(--radius-pill); background:var(--bg-input); transition:border-color var(--transition-fast),background-color var(--transition-fast); }
.subscription-toggle-track > span { position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:var(--text-muted); box-shadow:0 1px 4px rgba(0,0,0,.35); transition:transform var(--transition-fast),background-color var(--transition-fast); }
.subscription-primary-toggle input:checked + .subscription-toggle-track { border-color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 35%,var(--bg-input)); }
.subscription-primary-toggle input:checked + .subscription-toggle-track > span { background:var(--gold-light); transform:translateX(18px); }
.subscription-advanced-settings { overflow:hidden; border:1px solid var(--border-default); border-radius:var(--radius-lg); background:var(--bg-input-softer); }
.subscription-advanced-settings > summary { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; align-items:center; gap:10px; min-height:62px; padding:10px 14px; color:var(--text-primary); cursor:pointer; list-style:none; transition:background-color var(--transition-fast),border-color var(--transition-fast); }
.subscription-advanced-settings > summary::-webkit-details-marker { display:none; }
.subscription-advanced-settings > summary:hover { background:var(--bg-card-hover); }
.subscription-advanced-settings > summary:focus-visible { outline:2px solid var(--gold-primary); outline-offset:-2px; }
.subscription-advanced-settings > summary > span:nth-child(2) { display:grid; gap:3px; }
.subscription-advanced-settings > summary strong { font-size:13px; }
.subscription-advanced-settings > summary small { color:var(--text-secondary); font-size:12px; }
.subscription-advanced-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:var(--gold-wash); color:var(--gold-primary); }
.subscription-advanced-hint { color:var(--text-secondary); font-size:11px; }
.subscription-advanced-chevron { color:var(--text-muted); transition:transform .18s ease; }
.subscription-advanced-settings[open] .subscription-advanced-chevron { transform:rotate(180deg); }
.subscription-advanced-content { display:grid; gap:10px; padding:0 12px 12px; border-top:1px solid var(--border-subtle); }
.subscription-advanced-settings[open] .subscription-advanced-content { animation:schedule-settings-in .18s ease-out; }
.subscription-advanced-section { padding:13px; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--bg-card); }
.subscription-advanced-section:first-child { margin-top:12px; }
.subscription-advanced-section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:11px; }
.subscription-advanced-section-heading > div { display:grid; gap:3px; }
.subscription-advanced-section-heading strong { color:var(--text-primary); font-size:13px; }
.subscription-advanced-section-heading small { color:var(--text-secondary); font-size:11px; line-height:1.45; }
.subscription-advanced-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.readonly-setting { min-height:72px; display:grid; align-content:center; gap:4px; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); }
.readonly-setting > span,.readonly-setting > small { color:var(--text-muted); }
.readonly-setting > strong { color:var(--text-primary); }
.multi-select-dropdown { position:relative; width:100%; }
.multi-select-dropdown summary { display:flex; align-items:center; min-height:44px; padding:0 36px 0 12px; overflow:hidden; border:1px solid var(--border-default); border-radius:var(--radius-sm); background:var(--bg-input); color:var(--text-primary); cursor:pointer; list-style:none; text-overflow:ellipsis; white-space:nowrap; }
.multi-select-dropdown summary::-webkit-details-marker { display:none; }
.multi-select-dropdown summary::after { content:""; position:absolute; right:14px; width:7px; height:7px; border-right:1.5px solid var(--text-muted); border-bottom:1.5px solid var(--text-muted); transform:rotate(45deg); transition:transform .18s ease; }
.multi-select-dropdown[open] summary { border-color:var(--gold-primary); }
.multi-select-dropdown[open] summary::after { transform:rotate(225deg); }
.multi-select-options { position:absolute; z-index:30; top:calc(100% + 6px); left:0; right:0; max-height:240px; overflow:auto; padding:6px; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--bg-card); box-shadow:var(--shadow-modal); }
.multi-select-option { display:flex; align-items:center; gap:9px; min-height:40px; padding:7px 9px; border-radius:var(--radius-sm); color:var(--text-primary); cursor:pointer; }
.multi-select-option:hover { background:var(--bg-card-hover); }
.multi-select-option input { width:18px; height:18px; flex:0 0 auto; }
.multi-select-option span { display:flex; align-items:baseline; gap:6px; }
.multi-select-option small { color:var(--text-muted); }
.multi-select-option.all-option { margin-bottom:4px; border-bottom:1px solid var(--border-subtle); border-radius:var(--radius-sm) var(--radius-sm) 0 0; }
.inline-check-card,.inline-check { display:flex; flex-direction:row; align-items:center; gap:9px; cursor:pointer; }
.inline-check-card { min-width:240px; padding:9px 11px; border:1px solid var(--border-default); border-radius:var(--radius-sm); background:var(--bg-card); }
.inline-check-card:has(input:checked) { border-color:var(--gold-primary); background:var(--gold-wash); }
.inline-check-card input,.inline-check input,.weekday-options input { width:18px; height:18px; min-height:18px; flex:0 0 auto; accent-color:var(--gold-primary); }
.inline-check-card > span { display:grid; gap:2px; }
.inline-check-card strong { color:var(--text-primary); font-size:13px; }
.inline-check-card small { color:var(--text-muted); font-size:11px; line-height:1.4; }
.subscription-schedule-settings { display:grid; gap:14px; margin-top:11px; padding:12px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-input-softer); }
.subscription-schedule-settings:not(.hidden) { animation:schedule-settings-in .18s ease-out; }
@keyframes schedule-settings-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.schedule-field { display:grid; gap:8px; color:var(--text-secondary); font-size:12px; }
.schedule-field-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.weekday-options { display:flex; flex-wrap:wrap; gap:7px; }
.weekday-options label { display:flex; flex-direction:row; align-items:center; justify-content:center; gap:6px; min-width:54px; min-height:38px; padding:0 9px; border:1px solid var(--border-default); border-radius:var(--radius-sm); background:var(--bg-input-soft); color:var(--text-secondary); cursor:pointer; }
.weekday-options label:has(input:checked) { border-color:var(--gold-primary); background:var(--gold-wash); color:var(--text-primary); }
.schedule-window-list { display:grid; gap:7px; }
.schedule-window-row { display:grid; grid-template-columns:minmax(120px,1fr) auto minmax(120px,1fr) 36px; align-items:end; gap:8px; }
.schedule-window-row label { display:grid; gap:5px; }
.schedule-window-row label span { color:var(--text-muted); font-size:10px; }
.schedule-window-separator { align-self:center; padding-top:17px; color:var(--text-muted); }
.schedule-window-row .btn { align-self:end; width:36px; min-height:40px; padding:0; }
.schedule-options-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.schedule-options-grid label { display:grid; gap:6px; color:var(--text-secondary); font-size:12px; }
.subscription-editor-actions { align-items:center; }
.subscription-editor-actions > span { margin-right:auto; color:var(--text-muted); font-size:11px; }
.subscription-editor-actions .btn { min-width:126px; min-height:44px; }
.subscription-editor-actions .btn[aria-busy="true"] { cursor:wait; }
.manual-inference-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:18px; }
.manual-inference-header h1 { margin-top:3px; font-size:24px; }
.manual-inference-header p { max-width:68ch; margin-top:6px; color:var(--text-secondary); line-height:1.6; }
.eyebrow { color:var(--gold-primary); font-family:var(--font-mono); font-size:10px; font-weight:800; letter-spacing:.14em; }
.manual-run-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.manual-run-fields label { display:flex; flex-direction:column; gap:7px; }
.manual-run-fields select { min-height:46px; border-radius:var(--radius-md); font-size:13px; }
.strategy-run-summary { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:16px 0; padding:16px; border:1px solid var(--border-default); border-radius:var(--radius-lg); background:var(--bg-input-soft); }
.strategy-run-summary > div { min-width:0; padding:0; background:transparent; }
.strategy-run-summary span,.strategy-run-summary strong { display:block; }
.strategy-run-summary span { display:flex; align-items:center; gap:6px; color:var(--text-muted); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; } .strategy-run-summary span i { width:14px; height:14px; opacity:0.6; }
.strategy-run-summary strong { margin-top:6px; color:var(--text-primary); font-size:13px; line-height:1.6; overflow-wrap:anywhere; font-weight:500; }
.strategy-run-summary.empty { display:flex; flex-direction:column; gap:6px; padding:20px; background:var(--bg-input-soft); color:var(--text-secondary); border-radius:var(--radius-lg); border:1px dashed var(--border-default); }
.strategy-run-summary.empty strong { margin:0; color:var(--text-primary); font-size:14px; }
.model-compare-select { padding:14px 16px; border:1px solid var(--border-default); border-radius:var(--radius-lg); background:var(--bg-input-soft); }
.model-compare-header { display:flex; align-items:center; gap:8px; margin-bottom:12px; color:var(--text-secondary); font-size:13px; }
.model-compare-header strong { color:var(--text-primary); font-size:13px; }
.model-compare-header small { margin-left:auto; color:var(--text-muted); font-size:11px; }
.model-compare-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:8px; }
.model-compare-grid label { display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--border-default); border-radius:var(--radius-md); background:rgba(8,13,23,0.5); cursor:pointer; transition:border-color 160ms ease,background 160ms ease; }
.model-compare-grid label:has(input:checked) { border-color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 8%,var(--bg-input)); }
.model-compare-grid label:hover { border-color:color-mix(in srgb,var(--text-muted) 50%,var(--border-default)); }
.model-compare-grid input[type="checkbox"] { width:14px; height:14px; accent-color:var(--gold-primary); }
.model-compare-grid label span { font-size:12px; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.model-compare-grid label small { margin-left:auto; color:var(--text-muted); font-size:10px; flex-shrink:0; }
.model-compare-hint { margin-top:8px; font-size:11px; color:var(--text-muted); }
.model-compare-hint.active { color:var(--gold-primary); font-weight:600; }
.manual-auto-execute { display:grid; grid-template-columns:1fr 1fr; min-height:44px; padding:4px; border:1px solid var(--border-default); border-radius:var(--radius-pill); background:rgba(8,13,23,0.75); cursor:pointer; }
.manual-auto-execute:has(input:checked) { border-color:var(--status-danger); background:var(--status-danger-bg); }

.manual-auto-execute span { display:flex; align-items:center; justify-content:center; padding:0 12px; border-radius:var(--radius-pill); color:var(--text-muted); font-size:12px; font-weight:600; transition:all 160ms ease; }
.manual-auto-execute strong { color:var(--text-primary); }
.manual-auto-execute small { margin-top:5px; color:var(--text-secondary); line-height:1.5; }
.inline-alert { display:flex; align-items:flex-start; gap:9px; margin-top:10px; padding:10px 12px; border-radius:var(--radius-sm); font-size:12px; line-height:1.55; }
.inline-alert.danger { border:1px solid var(--status-danger); background:var(--status-danger-bg); color:#fecdd3; }
.status-chip { display:inline-flex; align-items:center; min-height:24px; padding:2px 8px; border-radius:var(--radius-pill); background:var(--bg-input); color:var(--text-secondary); font-size:12px; font-weight:600; }
.status-chip.success { background:var(--status-connected-bg); color:var(--status-connected); }
.status-chip.warning { background:var(--color-warning-bg); color:var(--color-warning); }
.status-chip.info { background:var(--color-info-bg); color:#7db2ff; }
.status-chip.danger { background:var(--status-danger-bg); color:#fb7185; }
.workspace-skeleton { height:78px; border-radius:var(--radius-md); background:linear-gradient(90deg,var(--bg-card) 25%,var(--bg-card-hover) 45%,var(--bg-card) 65%); background-size:220% 100%; animation:workspace-shimmer 1.4s linear infinite; }
@keyframes workspace-shimmer { to { background-position:-220% 0; } }
.empty-state { min-height:96px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; color:var(--text-secondary); text-align:center; }
.risk-legend { display:flex; flex-wrap:wrap; gap:12px 18px; color:var(--text-secondary); font-size:12px; }
.risk-legend span { display:flex; align-items:center; gap:7px; }
.legend-dot { width:8px; height:8px; border-radius:50%; background:var(--text-muted); }
.legend-dot.user { background:#60a5fa; }.legend-dot.platform { background:var(--gold-primary); }.legend-dot.effective { background:var(--status-connected); }.legend-dot.pending { background:var(--color-warning); }
.risk-value-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:1px; overflow:hidden; border-radius:var(--radius-md); background:var(--border-default); }
.risk-value { min-height:76px; padding:12px; background:var(--bg-input-soft); }
.risk-value span { display:block; color:var(--text-secondary); font-size:12px; }.risk-value strong { display:block; margin-top:6px; font-family:var(--font-mono); font-size:14px; }
.risk-user-editor { margin-top:16px; padding-top:14px; border-top:1px solid var(--border-default); }
.risk-user-editor summary { color:var(--text-primary); font-weight:600; cursor:pointer; }
.risk-user-editor .field-help { display:block; margin-top:7px; }
.risk-scope-legend { display:flex; flex-wrap:wrap; gap:14px; margin-bottom:14px; color:var(--text-secondary); font-size:12px; }
.risk-scope-legend span { display:flex; align-items:center; gap:7px; }
.risk-scope-legend i { width:8px; height:8px; border-radius:50%; }
.legend-user { background:#60a5fa; }.legend-platform { background:var(--gold-primary); }.legend-effective { background:var(--status-connected); }
.risk-workspace { gap:12px; }
.risk-workspace .workspace-panel { padding:14px; }
.risk-policy-group + .risk-policy-group { margin-top:12px; }
.risk-policy-group h3 { margin:0 0 8px; color:var(--text-primary); font-size:13px; }
.risk-rule-table { overflow:hidden; border:1px solid var(--border-default); border-radius:var(--radius-md); }
.risk-rule-row { display:grid; grid-template-columns:minmax(145px,1.1fr) minmax(120px,.85fr) minmax(140px,.95fr) minmax(90px,.6fr); align-items:center; gap:8px; min-height:46px; padding:6px 10px; border-top:1px solid var(--border-subtle); background:var(--bg-card); }
.risk-rule-row:first-child { border-top:0; }
.risk-rule-head { min-height:36px; background:var(--bg-input); color:var(--text-muted); font-size:11px; font-weight:700; }
.risk-rule-name strong,.risk-rule-name small { display:block; }
.risk-rule-name strong { color:var(--text-primary); font-size:12px; }.risk-rule-name small { margin-top:3px; color:var(--text-muted); font-family:var(--font-mono); font-size:10px; }
.risk-rule-row input { width:100%; min-height:34px; }
.risk-inherited,.risk-boundary { color:var(--text-secondary); font-size:11px; line-height:1.45; }
.risk-effective { color:var(--status-connected); font-family:var(--font-mono); font-size:13px; }
.risk-save-bar { position:sticky; bottom:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:14px -14px -14px; padding:10px 14px; border-top:1px solid var(--border-default); border-radius:0 0 var(--radius-lg) var(--radius-lg); background:color-mix(in srgb,var(--bg-card) 92%,transparent); backdrop-filter:blur(10px); }
.risk-save-bar p { margin:0; color:var(--text-secondary); font-size:12px; }
.execution-reason { width:fit-content; max-width:100%; padding:5px 8px; border-radius:var(--radius-sm); background:var(--status-danger-bg); color:#fda4af; font-family:var(--font-mono); font-size:11px; overflow-wrap:anywhere; }
.metric-table { overflow:auto; }
.review-status-tabs { display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--border-default); }
.review-status-tabs button { padding:9px 12px; border:0; border-bottom:2px solid transparent; background:transparent; color:var(--text-secondary); cursor:pointer; white-space:nowrap; }
.review-status-tabs button.active { border-bottom-color:var(--gold-primary); color:var(--text-primary); }
.review-layout { display:grid; grid-template-columns:minmax(300px,.8fr) minmax(420px,1.2fr); gap:var(--space-4); align-items:start; }
.review-detail { position:sticky; top:0; max-height:calc(100vh - 155px); overflow:auto; }
.review-evidence { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:14px 0; }
.review-evidence > div { padding:10px; background:var(--bg-input-soft); border-radius:var(--radius-sm); }
.review-evidence span { display:block; color:var(--text-secondary); font-size:12px; }.review-evidence strong { display:block; margin-top:4px; overflow-wrap:anywhere; }
.review-editor { min-height:220px; resize:vertical; font-family:var(--font-ui); line-height:1.65; }
.memory-section { margin-top:var(--space-2); }
.admin-boundary-note { justify-content:flex-start; }
.admin-boundary-note > div { display:flex; flex-direction:column; gap:3px; }
.risk-rollout-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.risk-rollout-row { min-width:0; padding:10px 12px; }
.risk-rollout-row select { min-width:128px; }
.internal-rule-code { color:var(--text-muted); font-family:var(--font-mono); font-size:10px; }

@media (max-width:1280px) {
  .risk-rollout-list { grid-template-columns:1fr; }
}

@media (max-width:1100px) {
  .strategy-editor-sections { grid-template-columns:1fr; }
  .strategy-form-section:first-child,.strategy-form-section:last-child { grid-column:auto; }
}

@media (max-width:900px) {
  .workspace-header,.section-heading { align-items:stretch; flex-direction:column; }
  .position-protection-heading { align-items:flex-start; flex-direction:row; }
  .review-layout { grid-template-columns:1fr; }
  .review-detail { position:static; max-height:none; }
  .entry-method-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .strategy-specs { grid-template-columns:1fr; }
  .strategy-card-header { align-items:stretch; flex-direction:column; }
  .strategy-card-actions { justify-content:flex-start; }
}

@media (max-width:760px) {
  .strategy-capability-grid { grid-template-columns:1fr; }
  .risk-rule-head { display:none; }
  .risk-rule-row { grid-template-columns:1fr 1fr; gap:8px 12px; padding:12px; }
  .risk-rule-name { grid-column:1 / -1; }
  .risk-rule-row > span:nth-child(2)::before,.risk-boundary::before,.risk-effective::before { display:block; margin-bottom:4px; color:var(--text-muted); font-family:var(--font-ui); font-size:10px; font-weight:500; }
  .risk-rule-row > span:nth-child(2)::before { content:"我的设置"; }.risk-boundary::before { content:"平台边界"; }.risk-effective::before { content:"最终生效"; }
  .risk-save-bar { align-items:stretch; flex-direction:column; }
  .subscription-context-grid,.subscription-core-grid,.subscription-advanced-grid { grid-template-columns:1fr; }
  .subscription-strategy-summary { align-items:stretch; flex-direction:column; }
  .subscription-strategy-summary dl { width:100%; }
  .subscription-strategy-summary dl > div { flex:1; }
  .position-protection-price-grid { grid-template-columns:1fr; }
  .position-protection-facts,.position-protection-impact { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .form-modal { align-items:stretch; padding:0; }
  .form-modal-dialog,.strategy-editor-dialog,.subscription-editor-dialog { width:100%; max-height:100dvh; min-height:100dvh; overflow:auto; border:0; border-radius:0; }
  .position-protection-dialog { overflow-x:hidden; overflow-y:auto; }
  .form-modal-dialog > .section-heading { top:-18px; }
  .workspace-panel { padding:var(--space-4); }
  .workspace-row { align-items:stretch; flex-direction:column; }
  .workspace-row-actions { justify-content:flex-start; }
  .review-evidence { grid-template-columns:1fr; }
  .manual-inference-header { flex-direction:column; }
  .manual-run-fields,.strategy-run-summary,.entry-method-grid { grid-template-columns:1fr; }
  .market-plan-head,.market-plan-row { grid-template-columns:42px 52px minmax(92px,1fr) 52px; gap:7px; padding:0 8px; }
  .strategy-form-section { padding:14px 10px; }
  .toolbar-actions { align-items:stretch; flex-direction:column; }
  .catalog-summary { white-space:normal; }
  .subscription-row { align-items:stretch; flex-direction:column; }
  .subscription-row-actions { justify-content:flex-end; }
  .inline-check-card { min-width:0; }
  .schedule-options-grid { grid-template-columns:1fr; }
  .schedule-window-row { grid-template-columns:1fr auto 1fr 36px; }
  .subscription-editor-section { padding:14px 12px; border-radius:var(--radius-md); }
  .subscription-section-heading { align-items:flex-start; }
  .subscription-section-heading .status-chip { max-width:150px; text-align:center; white-space:normal; }
  .subscription-advanced-settings > summary { grid-template-columns:auto minmax(0,1fr) auto; }
  .subscription-advanced-hint { display:none; }
  .subscription-advanced-section-heading { align-items:flex-start; flex-direction:column; }
  .subscription-editor-actions { align-items:stretch; flex-direction:column; }
  .subscription-editor-actions > span { margin-right:0; }
  .subscription-editor-actions .btn { width:100%; }
  .position-protection-section { padding:14px 12px; }
  .position-protection-section-head { align-items:flex-start; }
  .position-protection-live { max-width:150px; white-space:normal; }
  .position-protection-identity { grid-template-columns:auto minmax(0,1fr); }
  .position-protection-connection { grid-column:2; }
  .position-protection-input input { min-height:48px; font-size:16px; }
  .position-protection-sync-option { min-height:76px; }
  .position-protection-actions { align-items:stretch; flex-wrap:wrap; }
  .position-protection-actions > span { width:100%; margin-right:0; text-align:center; }
  .position-protection-actions .btn { flex:1; min-height:46px; }
  .position-protection-actions #positionProtectionRetry { flex:1 0 100%; margin-right:0; }
}

@media (prefers-reduced-motion: reduce) {
  .form-modal,.form-modal-dialog { scroll-behavior:auto; transition:none; }
  .workspace-skeleton { animation:none; }
  .subscription-schedule-settings:not(.hidden),.subscription-advanced-settings[open] .subscription-advanced-content { animation:none; }
  .subscription-advanced-chevron,.subscription-toggle-track,.subscription-toggle-track > span { transition:none; }
  .position-protection-sync-option,.position-protection-switch,.position-protection-switch i { transition:none; }
  .badge-dot,
  .price-flash-up,
  .price-flash-down,
  .toast,
  .card-signal:is(:fullscreen, .is-signal-monitor).signal-monitor-updated,
  .card-signal:is(:fullscreen, .is-signal-monitor) .signal-monitor-sync svg {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinning svg {
  animation: spin 0.8s linear infinite;
}

@media (max-width: 1180px) {
  .topbar-context-status #mt5Server {
    display: none;
  }

  .app-layout {
    grid-template-columns: 188px 1fr;
  }

  .dashboard-grid,
  .analysis-grid,
  .trading-grid {
    grid-template-columns: 1fr;
  }

  .trading-grid > .card:nth-child(1) { grid-column: auto; grid-row: auto; }
  .trading-grid > .card:nth-child(2) { grid-column: auto; grid-row: auto; }
  .trading-grid > .card:nth-child(3) { grid-column: auto; grid-row: auto; }


  .account-snapshot-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-areas:
      "account"
      "quote"
      "signal"
      "positions";
  }

  .account-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .stat-divider {
    display: none;
  }

  .stat-item {
    padding: 0;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-layout {
    height: auto;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "topbar"
      "sidebar"
      "main";
    overflow: visible;
  }

  .topbar {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100vw;
    min-height: 56px;
    padding: var(--space-3);
  }

  .topbar-brand {
    min-width: 0;
  }

  .topbar-badges {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
  }

  .topbar-primary-status,
  .topbar-context-status {
    flex: 0 0 auto;
  }

  .topbar-context-status {
    padding-left: 0;
    border-left: 0;
  }

  .sidebar {
    flex-direction: row;
    min-width: 0;
    max-width: 100vw;
    overflow-x: auto;
    padding: var(--space-2);
  }

  .nav-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
  }

  .nav-group-label {
    display: none;
  }

  .nav-item {
    min-width: 92px;
    justify-content: center;
  }

  .main {
    width: 100%;
    max-width: 100vw;
    overflow: visible;
    padding: var(--space-3);
  }

  .card {
    padding: var(--space-4);
  }

  .quote-main,
  .signal-direction-row,
  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .signal-card-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .signal-detail-action {
    margin-left: 42px;
  }

  .signal-direction-row {
    align-items: stretch;
  }

  .signal-confidence-block {
    width: 100%;
    align-items: flex-start;
  }

  .signal-execution-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-execution-copy {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .quote-side-ask {
    align-items: flex-start;
    text-align: left;
  }

  .quote-spread-col {
    justify-content: flex-start;
  }

  .config-grid,
  .history-stats,
  .signal-detail-grid,
  .analysis-status-strip,
  .analysis-history-list,
  .account-stats-row,
  .latency-box,
  .two-fields {
    grid-template-columns: 1fr;
  }
}

/* Clickable badge */
.clickable-badge {
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Glow underline on hover */
.clickable-badge::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  transform: translateX(-50%);
  transition: opacity 0.3s ease;
  opacity: 0.6;
}
.clickable-badge:hover::after {
  width: 80%;
}
.clickable-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.3);
  filter: brightness(1.15);
}
.clickable-badge:active {
  transform: translateY(0) scale(0.97);
  filter: brightness(0.95);
}
/* Connected state glow */
.clickable-badge.status-connected:hover {
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(16, 185, 129, 0.5);
}
/* Danger (trade active) glow */
.clickable-badge.status-danger:hover {
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}
/* Active (auto analyze) glow */
.clickable-badge.status-active:hover {
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(212, 175, 55, 0.5);
}
/* Neutral hover highlight */
.clickable-badge.status-neutral:hover {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: var(--border-emphasis, rgba(255, 255, 255, 0.15));
  color: var(--text-primary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-out {
  animation: fadeOut 0.3s ease forwards;
  pointer-events: none;
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ MT5 Bridge Download Modal ============ */
.bridge-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.bridge-overlay.hidden { display: none; }
.bridge-dialog {
  width: 480px;
  max-width: 94vw;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease;
}
.bridge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 15px;
}
.bridge-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bridge-intro p {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
}
.bridge-intro p + p { margin-top: 4px; }
.bridge-note {
  color: var(--text-muted) !important;
  font-size: 12px !important;
}
.bridge-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bridge-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--text-primary);
}
.bridge-option-card:hover {
  border-color: var(--gold-primary);
  background: rgba(234, 179, 8, 0.05);
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.1);
}
.bridge-option-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(234, 179, 8, 0.08);
  color: var(--gold-primary);
  flex-shrink: 0;
}
.bridge-option-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bridge-option-info strong {
  font-size: 14px;
  font-weight: 600;
}
.bridge-option-info span {
  font-size: 12px;
  color: var(--text-secondary);
}
.bridge-option-info small {
  font-size: 11px;
  color: var(--text-muted);
}
.bridge-option-card i:last-child {
  color: var(--gold-primary);
  flex-shrink: 0;
}

/* Professional bridge status and runtime controls. */
.bridge-overlay {
  padding: 16px;
  background: rgba(3, 6, 12, 0.76);
  backdrop-filter: blur(8px);
}
.bridge-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: min(820px, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--border-default) 78%, var(--gold-primary));
  background: var(--bg-card);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.46);
  animation: bridgeDialogIn 0.2s cubic-bezier(.16, 1, .3, 1);
}
.bridge-head {
  min-height: 86px;
  padding: 18px 24px;
  font-size: 17px;
  background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-input));
}
.bridge-head-identity { min-width: 0; display: flex; align-items: center; gap: 13px; }
.bridge-head-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border: 1px solid color-mix(in srgb, var(--gold-primary) 38%, var(--border-default));
  border-radius: 12px;
  color: var(--gold-primary);
  background: color-mix(in srgb, var(--gold-primary) 9%, var(--bg-input));
}
.bridge-head-copy { min-width: 0; display: grid; gap: 2px; }
.bridge-head-copy > span { color: var(--gold-primary); font-size: 11px; font-weight: 700; }
.bridge-head-copy > strong { color: var(--text-primary); font-size: 18px; line-height: 1.3; }
.bridge-head-copy > p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.bridge-close-button { width: 44px; height: 44px; flex: 0 0 44px; }
.bridge-body {
  min-height: 0;
  padding: 22px 24px;
  gap: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.bridge-status-summary,
.bridge-metrics,
.bridge-terminal-section,
.bridge-pause-confirmation,
.bridge-control-details { flex: 0 0 auto; }
.bridge-status-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 17px 18px;
  border: 1px solid color-mix(in srgb, var(--border-default) 78%, var(--status-connected));
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, var(--status-connected-bg));
}
.bridge-status-summary[data-state="connected"] { border-color: color-mix(in srgb, var(--status-connected) 42%, var(--border-default)); }
.bridge-status-summary[data-state="paused"] { border-color: color-mix(in srgb, var(--color-warning) 38%, var(--border-default)); }
.bridge-status-summary[data-state="reconnecting"] { border-color: color-mix(in srgb, var(--color-warning) 38%, var(--border-default)); }
.bridge-status-summary[data-state="offline"],
.bridge-status-summary[data-state="error"] { border-color: color-mix(in srgb, var(--status-danger) 38%, var(--border-default)); }
.bridge-status-summary[data-state="error"] .bridge-live-indicator > span { background: var(--status-danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-danger) 12%, transparent); animation: none; }
.bridge-status-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  border: 1px solid var(--color-warning-border);
  border-radius: 13px;
  color: var(--color-warning);
  background: var(--color-warning-bg);
}
.bridge-status-icon.is-connected { color: var(--status-connected); border-color: var(--status-connected-border); background: var(--status-connected-bg); }
.bridge-status-icon.is-paused { color: var(--text-secondary); border-color: var(--border-emphasis); background: var(--bg-input); }
.bridge-status-icon.is-offline { color: var(--status-danger); border-color: var(--status-danger-border); background: var(--status-danger-bg); }
.bridge-status-icon.is-reconnecting { color: var(--color-warning); border-color: var(--color-warning-border); background: var(--color-warning-bg); }
.bridge-status-icon.is-loading svg { animation: bridgeSpin 0.9s linear infinite; }
.bridge-status-copy { min-width: 0; flex: 1; }
.bridge-status-label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.bridge-status-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.bridge-status-title-row strong { color: var(--text-primary); font-size: 16px; line-height: 1.35; }
.bridge-status-copy p { max-width: 58ch; margin: 5px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.bridge-state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: var(--bg-input);
  font-size: 11px;
  font-weight: 700;
}
.bridge-state-chip.is-enabled { color: var(--status-connected); border-color: var(--status-connected-border); background: var(--status-connected-bg); }
.bridge-state-chip.is-paused { color: var(--color-warning); border-color: var(--color-warning-border); background: var(--color-warning-bg); }
.bridge-live-indicator { display: inline-flex; align-items: center; gap: 7px; align-self: start; color: var(--text-muted); }
.bridge-live-indicator > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-connected);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-connected) 12%, transparent);
  animation: bridgeLivePulse 2s ease-out infinite;
}
.bridge-live-indicator small { font-size: 11px; white-space: nowrap; }
.bridge-metrics {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-input) 46%, var(--bg-card));
}
.bridge-metric { min-width: 0; padding: 14px 15px; }
.bridge-metric + .bridge-metric { border-left: 1px solid var(--border-default); }
.bridge-metric dt { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-muted); font-size: 11px; }
.bridge-metric dt svg { color: var(--text-secondary); }
.bridge-metric small { display: block; color: var(--text-muted); font-size: 10px; }
.bridge-metric dd {
  display: block;
  margin: 7px 0 3px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bridge-terminal-section { display: flex; flex-direction: column; gap: 10px; }
.bridge-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bridge-section-heading > div { min-width: 0; display: grid; gap: 3px; }
.bridge-section-heading strong { color: var(--text-primary); font-size: 13px; }
.bridge-section-heading > div > span { color: var(--text-muted); font-size: 11px; }
.bridge-terminal-count {
  padding: 4px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: var(--bg-input);
  font-size: 11px;
  white-space: nowrap;
}
.bridge-terminal-list { display: grid; gap: 8px; }
.bridge-terminal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 11px 13px;
  border: 1px solid var(--border-default);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-elevated) 84%, var(--bg-input));
}
.bridge-terminal-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.bridge-terminal-marker {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border: 1px solid var(--status-connected-border);
  border-radius: 10px;
  color: var(--status-connected);
  background: var(--status-connected-bg);
}
.bridge-terminal-copy { min-width: 0; }
.bridge-terminal-copy strong, .bridge-terminal-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bridge-terminal-copy strong { color: var(--text-primary); font-size: 13px; }
.bridge-terminal-copy span { margin-top: 3px; color: var(--text-secondary); font-size: 12px; }
.bridge-terminal-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--status-connected-border);
  border-radius: var(--radius-pill);
  color: var(--status-connected);
  background: var(--status-connected-bg);
  font-size: 11px;
  white-space: nowrap;
}
.bridge-terminal-sync::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.bridge-terminal-sync.is-syncing { color: var(--color-warning); border-color: var(--color-warning-border); background: var(--color-warning-bg); }
.bridge-terminal-empty {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--border-default);
  border-radius: 11px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-input) 34%, transparent);
  font-size: 12px;
  text-align: center;
}
.bridge-terminal-empty [data-lucide="loader-circle"] { animation: bridgeSpin .9s linear infinite; }
.bridge-pause-confirmation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--color-warning-border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--color-warning-bg) 88%, var(--bg-card));
}
.bridge-pause-confirmation.hidden { display: none; }
.bridge-pause-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--color-warning); background: var(--color-warning-bg); }
.bridge-pause-copy { min-width: 0; }
.bridge-pause-copy strong, .bridge-pause-copy span { display: block; }
.bridge-pause-copy strong { color: var(--color-warning); font-size: 13px; }
.bridge-pause-copy span { margin-top: 3px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.bridge-confirm-actions, .bridge-control-actions, .bridge-control-secondary { display: flex; align-items: center; gap: 8px; }
.bridge-control-actions { justify-content: space-between; }
.bridge-control-actions .btn { min-height: 44px; }
.bridge-control-actions .btn[aria-busy="true"] svg { animation: bridgeSpin .8s linear infinite; }
.bridge-control-actions #bridgeRuntimeToggle { min-width: 144px; }
.bridge-control-actions #bridgeRuntimeToggle.is-pause {
  color: var(--color-warning);
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}
.bridge-control-actions #bridgeRuntimeToggle.is-pause:hover { border-color: var(--color-warning); }
.btn-danger-soft { color: var(--status-danger); border-color: var(--status-danger-border); background: var(--status-danger-bg); }
.btn-danger-soft:hover { color: #fecaca; border-color: var(--status-danger); background: var(--status-danger-bg); }
.bridge-control-details { border-top: 1px solid var(--border-default); padding-top: 12px; }
.bridge-control-details summary { min-height: 40px; display: flex; align-items: center; gap: 7px; width: fit-content; color: var(--text-secondary); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.bridge-control-details summary::-webkit-details-marker { display: none; }
.bridge-control-details summary:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 4px; border-radius: 4px; }
.bridge-control-details summary > svg:first-child { color: var(--gold-primary); }
.bridge-details-chevron { transition: transform 0.18s ease; }
.bridge-control-details[open] .bridge-details-chevron { transform: rotate(180deg); }
.bridge-control-help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-top: 11px; }
.bridge-control-help-grid p { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin: 0; padding: 10px 11px; border-radius: 9px; color: var(--text-muted); background: var(--bg-input-soft); font-size: 11px; line-height: 1.55; }
.bridge-control-help-grid p > svg { margin-top: 2px; color: var(--text-secondary); }
.bridge-control-help-grid strong { display: block; margin-bottom: 2px; color: var(--text-secondary); font-size: 12px; }
.bridge-install-hint { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.bridge-install-hint svg { flex: 0 0 auto; color: var(--gold-primary); }
.bridge-control-footer { padding: 14px 24px 16px; border-top: 1px solid var(--border-default); background: color-mix(in srgb, var(--bg-card) 94%, var(--bg-input)); }
.bridge-control-footer > p { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.bridge-control-footer > p svg { flex: 0 0 auto; color: var(--status-connected); }

@keyframes bridgeSpin { to { transform: rotate(360deg); } }
@keyframes bridgeLivePulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-connected) 12%, transparent); }
  50% { box-shadow: 0 0 0 7px transparent; }
}
@keyframes bridgeDialogIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 680px) {
  .bridge-overlay { align-items: flex-end; padding: 8px; }
  .bridge-dialog { width: 100%; max-height: calc(100dvh - 16px); border-radius: 16px 16px 10px 10px; }
  .bridge-head { min-height: 76px; padding: 15px 16px; }
  .bridge-head-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .bridge-head-copy > p { display: none; }
  .bridge-body { padding: 16px; gap: 16px; }
  .bridge-status-summary { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .bridge-live-indicator { display: none; }
  .bridge-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bridge-metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--border-default); }
  .bridge-metric:nth-child(4) { border-top: 1px solid var(--border-default); }
  .bridge-control-help-grid { grid-template-columns: 1fr; }
  .bridge-pause-confirmation { grid-template-columns: auto minmax(0, 1fr); }
  .bridge-confirm-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .bridge-control-footer { padding: 12px 16px max(14px, env(safe-area-inset-bottom)); }
  .bridge-control-actions { align-items: stretch; flex-direction: column-reverse; }
  .bridge-control-secondary { display: grid; grid-template-columns: 1fr 1fr; }
  .bridge-control-actions #bridgeRuntimeToggle { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bridge-overlay, .bridge-dialog { animation: none; }
  .bridge-status-icon.is-loading svg, .bridge-live-indicator > span { animation: none; }
  .bridge-details-chevron { transition: none; }
}

/* ===== Membership access lobby ===== */
.pro-overlay {
  position:fixed;
  inset:0;
  z-index:99999;
  overflow:auto;
  color:var(--text-primary,var(--text-1));
  background:
    radial-gradient(circle at 18% 12%,rgba(210,173,75,.1),transparent 30%),
    radial-gradient(circle at 86% 88%,rgba(42,94,126,.08),transparent 34%),
    var(--bg-base,#080b10);
}
.pro-overlay.hidden { display:none; }
.membership-access-lobby { min-height:100dvh; }
.membership-access-lobby::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.18; background-image:linear-gradient(rgba(255,255,255,.022) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.022) 1px,transparent 1px); background-size:72px 72px; mask-image:linear-gradient(to bottom,black,transparent 82%); }
.membership-gate-topbar { position:relative; z-index:1; min-height:72px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:0 clamp(20px,4vw,64px); border-bottom:1px solid var(--border-subtle); background:color-mix(in srgb,var(--bg-base) 91%,transparent); backdrop-filter:blur(16px); }
.membership-gate-brand { display:inline-flex; align-items:center; gap:11px; color:inherit; text-decoration:none; }
.membership-gate-brand > span { width:40px; height:40px; display:grid; place-items:center; border:1px solid color-mix(in srgb,var(--gold-primary) 34%,var(--border-default)); border-radius:11px; color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 10%,transparent); }
.membership-gate-brand svg { width:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.membership-gate-brand strong,.membership-gate-brand small { display:block; }
.membership-gate-brand strong { font-size:15px; font-weight:750; letter-spacing:.01em; }
.membership-gate-brand small { margin-top:2px; color:var(--text-muted); font-size:11px; }
.membership-gate-top-actions { display:flex; align-items:center; gap:8px; }
.membership-gate-home,.membership-gate-logout { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid var(--border-default); border-radius:10px; padding:0 13px; color:var(--text-secondary); background:color-mix(in srgb,var(--bg-card) 92%,transparent); font-size:13px; font-weight:650; text-decoration:none; cursor:pointer; transition:border-color .18s ease,color .18s ease,background-color .18s ease; }
.membership-gate-home:hover,.membership-gate-logout:hover { border-color:color-mix(in srgb,var(--text-muted) 48%,var(--border-default)); color:var(--text-primary); background:var(--bg-card-hover); }
.membership-gate-home:focus-visible,.membership-gate-logout:focus-visible,.membership-gate-primary:focus-visible,.membership-gate-secondary:focus-visible { outline:2px solid var(--gold-primary); outline-offset:3px; }
.membership-gate-home svg,.membership-gate-logout svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.membership-gate-layout { position:relative; z-index:1; width:min(1200px,calc(100% - 40px)); min-height:calc(100dvh - 72px); display:grid; grid-template-columns:minmax(0,1.05fr) minmax(390px,.95fr); align-items:center; gap:20px; margin:0 auto; padding:32px 0; }
.membership-gate-card,.membership-plan-panel { border:1px solid var(--border-default); border-radius:20px; background:color-mix(in srgb,var(--bg-card) 96%,transparent); box-shadow:0 28px 80px rgba(0,0,0,.26),inset 0 1px rgba(255,255,255,.03); }
.membership-gate-card { padding:clamp(30px,3.6vw,46px); }
.membership-gate-status { width:max-content; min-height:36px; display:inline-flex; align-items:center; gap:9px; margin-bottom:24px; padding:0 12px; border:1px solid var(--border-default); border-radius:999px; color:var(--text-secondary); background:var(--bg-input); font-size:12px; font-weight:700; }
.membership-gate-status i { width:8px; height:8px; border-radius:50%; background:var(--gold-primary); box-shadow:0 0 0 5px color-mix(in srgb,var(--gold-primary) 10%,transparent); }
.membership-access-lobby.is-expired .membership-gate-status { border-color:color-mix(in srgb,var(--color-warning) 28%,var(--border-default)); color:var(--color-warning); }
.membership-access-lobby.is-expired .membership-gate-status i { background:var(--color-warning); box-shadow:0 0 0 4px color-mix(in srgb,var(--color-warning) 9%,transparent); }
.membership-gate-hero { display:grid; grid-template-columns:64px minmax(0,1fr); align-items:start; gap:18px; }
.membership-gate-icon { width:64px; height:64px; display:grid; place-items:center; border:1px solid color-mix(in srgb,var(--gold-primary) 30%,var(--border-default)); border-radius:17px; color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 9%,var(--bg-card)); }
.membership-gate-icon svg { width:29px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.membership-gate-eyebrow { margin:0 0 8px; color:var(--gold-primary); font-size:12px; font-weight:800; letter-spacing:.09em; }
.membership-gate-card h1 { max-width:18ch; margin:0; color:var(--text-primary); font-size:clamp(32px,3.3vw,44px); line-height:1.16; letter-spacing:-.035em; text-wrap:balance; }
.membership-gate-description { max-width:58ch; margin:14px 0 0; color:var(--text-secondary); font-size:15px; line-height:1.72; }
.membership-account-summary { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(142px,.9fr) minmax(100px,.62fr); align-items:stretch; gap:0; margin-top:28px; border:1px solid var(--border-default); border-radius:14px; background:var(--bg-input); overflow:hidden; }
.membership-account-identity,.membership-account-fact { min-width:0; min-height:78px; display:flex; align-items:center; padding:14px 16px; }
.membership-account-identity { gap:12px; }
.membership-account-fact { flex-direction:column; align-items:flex-start; justify-content:center; border-left:1px solid var(--border-default); }
.membership-account-avatar { width:46px; height:46px; flex:0 0 auto; display:grid; place-items:center; border-radius:11px; color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 11%,var(--bg-card)); font-size:17px; font-weight:800; }
.membership-account-summary small,.membership-account-summary strong { display:block; }
.membership-account-summary small { color:var(--text-muted); font-size:12px; line-height:1.3; }
.membership-account-summary strong { max-width:100%; margin-top:4px; color:var(--text-primary); font-size:14px; line-height:1.35; }
.membership-account-identity strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.membership-account-fact strong { overflow:visible; white-space:normal; }
#membershipGateAccess { color:var(--gold-light); }
.membership-access-lobby.is-expired #membershipGateAccess { color:var(--color-warning); }
.membership-retention-note { display:flex; align-items:flex-start; gap:12px; margin-top:12px; padding:14px 15px; border:1px solid color-mix(in srgb,var(--status-connected) 22%,var(--border-subtle)); border-radius:12px; background:color-mix(in srgb,var(--status-connected) 5%,var(--bg-card)); }
.membership-retention-note svg { width:20px; flex:0 0 auto; margin-top:1px; color:var(--status-connected); fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.membership-retention-note strong,.membership-retention-note small { display:block; }
.membership-retention-note strong { color:var(--text-primary); font-size:13px; }
.membership-retention-note small { margin-top:3px; color:var(--text-secondary); font-size:12px; line-height:1.55; }
.membership-gate-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:24px; }
.membership-gate-primary,.membership-gate-secondary { min-height:50px; display:inline-flex; align-items:center; justify-content:center; gap:8px; border-radius:10px; padding:0 20px; font-size:14px; font-weight:800; text-decoration:none; transition:background-color .18s ease,border-color .18s ease,color .18s ease,filter .18s ease; }
.membership-gate-primary { min-width:178px; color:#171307; background:linear-gradient(180deg,var(--gold-light),var(--gold-primary)); box-shadow:0 12px 26px color-mix(in srgb,var(--gold-primary) 15%,transparent); }
.membership-gate-primary:hover { filter:brightness(1.06); }
.membership-gate-primary svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.membership-gate-secondary { border:1px solid var(--border-default); color:var(--text-secondary); background:var(--bg-card); }
.membership-gate-secondary:hover { border-color:color-mix(in srgb,var(--text-muted) 48%,var(--border-default)); color:var(--text-primary); background:var(--bg-card-hover); }
.membership-gate-action-note { margin:10px 2px 0; color:var(--text-muted); font-size:12px; line-height:1.5; }
.membership-plan-panel { padding:clamp(24px,3vw,32px); }
.membership-plan-panel > header { padding:2px 2px 22px; }
.membership-plan-panel h2 { margin:0; color:var(--text-primary); font-size:25px; line-height:1.28; letter-spacing:-.025em; }
.membership-plan-panel > header > p:last-child { max-width:48ch; margin:9px 0 0; color:var(--text-secondary); font-size:14px; line-height:1.65; }
.membership-plan-option { position:relative; padding:20px; border:1px solid var(--border-default); border-radius:14px; background:var(--bg-input); }
.membership-plan-option + .membership-plan-option { margin-top:12px; }
.membership-plan-option.is-primary { border-color:color-mix(in srgb,var(--gold-primary) 34%,var(--border-default)); background:color-mix(in srgb,var(--gold-primary) 5%,var(--bg-input)); }
.membership-plan-option.is-current-plan { border-color:color-mix(in srgb,var(--color-warning) 55%,var(--border-default)); box-shadow:0 0 0 1px color-mix(in srgb,var(--color-warning) 18%,transparent); }
.membership-plan-heading { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:12px; }
.membership-plan-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:11px; color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 10%,var(--bg-card)); }
.membership-plan-icon svg { width:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.membership-plan-heading small,.membership-plan-heading strong { display:block; }
.membership-plan-heading small { color:var(--text-muted); font-size:12px; }
.membership-plan-heading strong { margin-top:2px; color:var(--text-primary); font-size:15px; line-height:1.35; }
.membership-plan-tag { min-height:28px; display:inline-flex; align-items:center; padding:0 9px; border:1px solid var(--border-default); border-radius:999px; color:var(--text-secondary); font-size:11px; font-weight:800; white-space:nowrap; }
.membership-plan-option.is-primary .membership-plan-tag { border-color:color-mix(in srgb,var(--gold-primary) 28%,var(--border-default)); color:var(--gold-primary); background:color-mix(in srgb,var(--gold-primary) 7%,transparent); }
.membership-plan-option.is-current-plan .membership-plan-tag { border-color:color-mix(in srgb,var(--color-warning) 38%,var(--border-default)); color:var(--color-warning); background:color-mix(in srgb,var(--color-warning) 8%,transparent); }
.membership-plan-summary { margin:13px 0 0; color:var(--text-secondary); font-size:13px; line-height:1.55; }
.membership-plan-option ul { display:grid; gap:10px; margin:15px 0 0; padding:15px 0 0; border-top:1px solid var(--border-subtle); color:var(--text-secondary); font-size:13px; line-height:1.5; list-style:none; }
.membership-plan-option li { display:grid; grid-template-columns:18px minmax(0,1fr); align-items:start; gap:9px; }
.membership-plan-option li svg { width:18px; height:18px; margin-top:1px; color:var(--status-connected); fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.membership-plan-option li.is-limited { color:var(--text-muted); }
.membership-plan-option li.is-limited svg { color:var(--text-muted); }
.membership-plan-footnote { margin:16px 2px 0; color:var(--text-muted); font-size:12px; line-height:1.6; }
.membership-plan-footnote strong { color:var(--text-secondary); font-weight:750; }
@media (max-width:900px) {
  .membership-gate-layout { width:min(760px,calc(100% - 32px)); grid-template-columns:1fr; align-items:start; padding:24px 0 32px; }
  .membership-gate-card h1 { max-width:22ch; }
}
@media (max-width:560px) {
  .membership-gate-topbar { min-height:64px; padding:0 14px; }
  .membership-gate-brand small { display:none; }
  .membership-gate-home { display:none; }
  .membership-gate-logout { width:42px; padding:0; justify-content:center; font-size:0; }
  .membership-gate-logout svg { width:17px; }
  .membership-gate-layout { width:calc(100% - 24px); min-height:calc(100dvh - 64px); padding:12px 0 20px; }
  .membership-gate-card,.membership-plan-panel { border-radius:15px; }
  .membership-gate-card { padding:24px 18px; }
  .membership-gate-status { margin-bottom:20px; }
  .membership-gate-hero { grid-template-columns:1fr; gap:14px; }
  .membership-gate-icon { width:52px; height:52px; border-radius:14px; }
  .membership-gate-icon svg { width:24px; }
  .membership-gate-card h1 { max-width:none; font-size:31px; }
  .membership-gate-description { font-size:16px; line-height:1.65; }
  .membership-account-summary { grid-template-columns:1fr 1fr; }
  .membership-account-identity { grid-column:1 / -1; min-height:72px; }
  .membership-account-fact { min-height:68px; border-top:1px solid var(--border-default); border-left:0; }
  .membership-account-fact + .membership-account-fact { border-left:1px solid var(--border-default); }
  .membership-gate-actions { display:grid; grid-template-columns:1fr; }
  .membership-gate-primary,.membership-gate-secondary { width:100%; min-height:48px; }
  .membership-plan-panel { padding:22px 18px; }
  .membership-plan-panel h2 { font-size:23px; }
  .membership-plan-panel > header > p:last-child { font-size:15px; }
  .membership-plan-option { padding:17px 15px; }
  .membership-plan-heading { grid-template-columns:40px minmax(0,1fr); }
  .membership-plan-icon { width:40px; height:40px; }
  .membership-plan-tag { grid-column:2; width:max-content; }
  .membership-plan-summary,.membership-plan-option ul { font-size:14px; }
}

@media (prefers-reduced-motion:reduce) {
  .membership-gate-home,.membership-gate-logout,.membership-gate-primary,.membership-gate-secondary { transition:none; }
}


/* Signal link in position/history tables */
a.signal-link {
  color: #d4a017;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
a.signal-link:hover {
  color: #f0c040;
  text-decoration: underline;
}

/* Searchable symbol selector */
.sym-selector{position:relative;display:inline-block}
.sym-selector .sym-input{background:rgba(255,255,255,.05);border:1px solid rgba(212,160,23,.25);border-radius:6px;color:var(--text-primary,#fff);padding:4px 8px;font-size:12px;width:100px;outline:none;transition:border-color .2s}
.sym-selector .sym-input:focus{border-color:var(--gold-primary,#d4a017)}
.sym-selector .sym-input:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}
.sym-selector .sym-dropdown{display:none;position:absolute;top:100%;left:0;z-index:999;min-width:140px;max-height:240px;overflow-y:auto;background:rgba(22,27,34,.97);border:1px solid rgba(212,160,23,.3);border-radius:6px;margin-top:2px;backdrop-filter:blur(12px)}
.sym-selector .sym-dropdown.open{display:block}
.sym-selector .sym-option{padding:6px 10px;cursor:pointer;font-size:12px;color:var(--text-secondary,#ccc);transition:background .15s}
.sym-selector .sym-option:hover,.sym-selector .sym-option.active{background:rgba(212,160,23,.15);color:var(--gold-primary,#d4a017)}
.sym-selector .sym-empty{padding:6px 10px;font-size:11px;color:var(--text-muted,#666)}

/* Config Sub-Tabs */
.admin-badge{display:inline-block;padding:2px 8px;font-size:10px;background:rgba(212,160,23,.15);color:var(--gold-primary,#d4a017);border-radius:4px;margin-left:8px;font-weight:500}
.check-row{display:flex;flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap}
.settings-grid label.check-row,.settings-grid label.multi-select-option{flex-direction:row;align-items:center}
.check-row .field-help{width:100%;margin-top:2px}
#useManualConfigWrap{margin-top:8px;padding:10px;background:rgba(212,160,23,.05);border-radius:6px;border:1px solid rgba(212,160,23,.15)}

/* ===== 需求反馈 ===== */
.nav-group-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.04); }

/* ===== Sidebar 观摩提示 ===== */
.sidebar-observe-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin: 4px 10px 6px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(234, 179, 8, 0.24);
}
.sidebar-observe-hint.hidden { display: none; }
.sidebar-observe-hint a {
  color: #fbbf24;
  text-decoration: underline;
}
.sidebar-observe-hint a:hover { color: #facc15; }

.feedback-form { display: flex; flex-direction: column; gap: 16px; }
.feedback-type-group { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-type-option { cursor: pointer; }
.feedback-type-option input { display: none; }
.feedback-type-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  color: var(--text-muted); font-size: .82rem;
  transition: all .2s; user-select: none;
}
.feedback-type-option input:checked + .feedback-type-chip {
  background: rgba(212,175,55,.1); border-color: rgba(212,175,55,.35);
  color: var(--gold-primary);
}
.feedback-type-chip:hover { border-color: rgba(255,255,255,.15); }

.feedback-actions { display: flex; align-items: center; gap: 16px; }
.feedback-hint { font-size: .75rem; color: var(--text-muted); opacity: .7; }

.feedback-success {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-radius: 8px; background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2);
  color: #22c55e; font-weight: 500;
}
.feedback-success.hidden { display: none; }

.field-error { display: none; color: #ef4444; font-size: 12px; margin-top: 4px; }
.field-error.visible { display: block; }
#errType { margin-bottom: 8px; }

.feedback-history-list { max-height: 360px; overflow-y: auto; }
.feedback-history-item {
  padding: 12px; border-bottom: 1px solid rgba(255,255,255,.04);
  display: flex; flex-direction: column; gap: 4px;
}
.feedback-history-item:last-child { border-bottom: none; }
.feedback-history-item .fh-meta { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--text-muted); }
.feedback-history-item .fh-type { font-size: .7rem; padding: 1px 7px; border-radius: 4px; }
.feedback-history-item .fh-type.feature { background: rgba(212,175,55,.12); color: var(--gold-primary); }
.feedback-history-item .fh-type.bug { background: rgba(239,68,68,.12); color: #ef4444; }
.feedback-history-item .fh-type.trading { background: rgba(59,130,246,.12); color: #3b82f6; }
.feedback-history-item .fh-type.course { background: rgba(34,197,94,.12); color: #22c55e; }
.feedback-history-item .fh-type.other { background: rgba(255,255,255,.06); color: var(--text-muted); }
.feedback-history-item .fh-title { font-weight: 500; font-size: .88rem; }
.feedback-history-item .fh-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-subtitle { font-size: .78rem; color: var(--text-muted); margin-left: auto; opacity: .7; }

/* Guide / User Manual */
.guide-content h1, .guide-content h2, .guide-content h3 {
  color: var(--gold-primary);
  margin: 24px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-primary);
  font-size: 1.1rem;
}
.guide-content h3:first-child {
  margin-top: 0;
}
.guide-content p {
  margin: 8px 0;
  line-height: 1.8;
}
.guide-content ul, .guide-content ol {
  margin: 8px 0;
  padding-left: 24px;
}
.guide-content li {
  margin: 4px 0;
  line-height: 1.7;
}
.guide-content strong {
  color: var(--text-primary);
}
.guide-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9rem;
}
.guide-content table th {
  background: var(--bg-input-soft);
  border-bottom: 1px solid var(--border-default);
  padding: 10px;
  font-weight: bold;
  text-align: left;
}
.guide-content table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-default);
}
.guide-content table tr:hover {
  background: rgba(255,255,255,0.02);
}
.guide-content blockquote {
  border-left: 3px solid var(--gold-primary);
  padding: 10px 16px;
  margin: 12px 0;
  background: rgba(212,175,55,0.05);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}
.guide-content code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* --- Changelog Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-overlay .modal {
  background: var(--bg-card, #111827);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 16px;
  width: 480px;
  max-width: 92vw;
  padding: 28px;
  transform: translateY(12px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}
.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

/* Membership expiry reminder */
.membership-expiry-overlay {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 15, .68);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease-out;
}
.membership-expiry-overlay.active { opacity: 1; pointer-events: auto; }
.membership-expiry-dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--gold-primary) 30%, var(--border-default));
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-modal);
  transform: translateY(10px) scale(.985);
  transition: transform .22s ease-out;
}
.membership-expiry-overlay.active .membership-expiry-dialog { transform: translateY(0) scale(1); }
.membership-expiry-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.membership-expiry-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.membership-expiry-close:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold-primary) 45%, transparent); outline-offset: 2px; }
.membership-expiry-close svg,
.membership-expiry-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.membership-expiry-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  background: var(--gold-wash-subtle);
  color: var(--gold-light);
}
.membership-expiry-eyebrow { margin: 0 0 6px; color: var(--gold-light); font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.membership-expiry-dialog h2 { margin: 0 44px 10px 0; font-size: clamp(22px, 5vw, 28px); line-height: 1.25; }
.membership-expiry-dialog > p:not(.membership-expiry-eyebrow):not(.membership-expiry-note) { margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.7; }
.membership-expiry-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.membership-expiry-facts span { min-width: 0; padding: 13px 14px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-input-soft); }
.membership-expiry-facts small,
.membership-expiry-facts strong { display: block; }
.membership-expiry-facts small { margin-bottom: 4px; color: var(--text-muted); font-size: 12px; }
.membership-expiry-facts strong { overflow-wrap: anywhere; font-size: 14px; }
.membership-expiry-actions { display: flex; gap: 10px; }
.membership-expiry-actions .btn { min-height: 44px; }
.membership-expiry-renew { flex: 1; }
.membership-expiry-note { margin: 15px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 520px) {
  .membership-expiry-overlay { align-items: end; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
  .membership-expiry-dialog { padding: 24px 20px 20px; }
  .membership-expiry-facts { grid-template-columns: 1fr; }
  .membership-expiry-actions { flex-direction: column; }
  .membership-expiry-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .membership-expiry-overlay,
  .membership-expiry-dialog { transition: none; }
}

/* 观摩模式保留真实控件状态，但明确锁定交易提交操作。 */
.ai-observer-mode .observer-action-panel.is-readonly {
  position: relative;
  border-color: color-mix(in srgb, var(--text-muted) 25%, var(--border-default));
}

.ai-observer-mode .observer-action-panel.is-readonly::after {
  content: "观摩模式 · 仅查看";
  position: absolute;
  top: 13px;
  right: 88px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-card) 82%, var(--text-muted));
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
}

.ai-observer-mode .observer-action-panel.is-readonly :is(#buyBtn, #sellBtn) {
  cursor: not-allowed;
}

@media (max-width: 680px) {
  .ai-observer-mode .observer-action-panel.is-readonly::after {
    position: static;
    display: inline-flex;
    margin: 0 12px 10px;
  }
}

/* ===== Crypto Payment: Chain Selector Modal ===== */
.crypto-chain-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}
.crypto-chain-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: min(480px, calc(100vw - 32px));
  box-shadow: var(--shadow-modal);
}
.crypto-chain-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}
.crypto-chain-head strong {
  font-size: 16px;
  color: var(--text-primary);
}
.crypto-chain-body {
  padding: 16px 20px 20px;
}
.crypto-chain-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crypto-chain-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface);
}
.crypto-chain-card:hover {
  border-color: var(--gold-primary);
  background: var(--bg-card-hover);
}
.crypto-chain-card.selected {
  border-color: var(--gold-primary);
  background: var(--gold-glow);
  box-shadow: 0 0 0 1px var(--gold-primary);
}
.crypto-chain-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}
.crypto-chain-info {
  flex: 1;
  min-width: 0;
}
.crypto-chain-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}
.crypto-chain-network {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.crypto-chain-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.crypto-chain-card.selected .crypto-chain-check {
  border-color: var(--gold-primary);
  background: var(--gold-primary);
  color: var(--text-inverse);
}
.crypto-chain-confirm-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.crypto-chain-confirm-row .btn {
  flex: 1;
}

/* ===== Crypto Payment: Payment Page ===== */
.crypto-payment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease;
}
.crypto-payment-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
}
.crypto-payment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}
.crypto-payment-head strong {
  font-size: 16px;
  color: var(--text-primary);
}
.crypto-payment-body {
  padding: 20px;
  overflow-y: auto;
}
.crypto-payment-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.crypto-payment-chain-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.crypto-payment-qr-wrap {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
}
.crypto-payment-qr {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.crypto-payment-qr-fallback {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}
.crypto-payment-amount-section {
  text-align: center;
  width: 100%;
}
.crypto-payment-amount-label,
.crypto-payment-address-label,
.crypto-payment-countdown-label,
.crypto-payment-status-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.crypto-payment-amount-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-primary);
  font-family: var(--font-mono);
}
.crypto-payment-amount-usd {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.crypto-payment-address-section {
  width: 100%;
  text-align: center;
}
.crypto-payment-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
}
.crypto-payment-address {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
  text-align: left;
  line-height: 1.5;
  background: none;
  border: none;
  padding: 0;
}
.crypto-payment-copy-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
  background: var(--gold-glow);
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.crypto-payment-copy-btn:hover {
  background: var(--gold-glow-strong);
}
.crypto-payment-address-warning {
  font-size: 11px;
  color: var(--color-warning);
  margin-top: 8px;
}
.crypto-payment-countdown-section {
  text-align: center;
  width: 100%;
}
.crypto-payment-countdown-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: 2px;
}
.crypto-payment-countdown-value.warning {
  color: var(--color-warning);
}
.crypto-payment-countdown-value.expired {
  color: var(--color-positive);
}
.crypto-payment-status-section {
  text-align: center;
  width: 100%;
}
.crypto-payment-status-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.crypto-payment-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.crypto-payment-status-dot.pending {
  background: var(--color-warning);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.crypto-payment-status-dot.confirming {
  background: var(--color-info);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.crypto-payment-status-dot.success {
  background: var(--status-connected);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.crypto-payment-confirm-info {
  font-size: 12px;
  color: var(--color-info);
  margin-top: 6px;
}
.crypto-payment-actions {
  width: 100%;
  margin-top: 4px;
}
.crypto-payment-done-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.crypto-payment-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

#model-strategy,
#ai-analyze,
#risk-center,
#review-memory,
#audit {
  --calm-surface: rgba(17, 24, 39, 0.78);
  --calm-surface-strong: #121b2b;
  --calm-border: rgba(71, 85, 105, 0.34);
  --calm-muted: #9aa9bd;
}

.calm-page-header {
  align-items: center;
  padding: 0 0 4px;
}

/* Model strategy: a stable three-level hierarchy — page, section tabs, work area. */
.model-strategy-header.calm-page-header {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 14px;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.model-strategy-header .model-strategy-heading {
  min-width: 0;
}

.model-strategy-header .model-strategy-tabs {
  display: flex;
  width: 100%;
  gap: 22px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--calm-border);
  border-radius: 0;
  background: transparent;
}

.model-strategy-header .model-strategy-tab {
  position: relative;
  min-height: 44px;
  padding: 0 2px;
  border-radius: 0;
  color: var(--calm-muted);
  font-weight: 600;
}

.model-strategy-header .model-strategy-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  content: "";
  transition: background-color 160ms ease;
}

.model-strategy-header .model-strategy-tab:hover {
  background: transparent;
  color: var(--text-primary);
}

.model-strategy-header .model-strategy-tab.active {
  background: transparent;
  color: #f5d85d;
  font-weight: 700;
}

.model-strategy-header .model-strategy-tab.active::after {
  background: var(--gold-primary);
}

.calm-page-header h1 {
  margin-top: 3px;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.035em;
}

.calm-page-header p {
  max-width: 62ch;
  margin-top: 5px;
  color: var(--calm-muted);
  font-size: 13px;
  line-height: 1.6;
}

.page-eyebrow {
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow,
.section-kicker {
  color: var(--gold-primary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
}

.section-kicker.danger {
  color: #fb7185;
}

.compact-section-header {
  align-items: center;
  padding-bottom: 0;
}

.compact-section-header h2 {
  font-size: 17px;
  letter-spacing: -.015em;
}

.model-strategy-shell,
.inference-workspace,
.workspace-page {
  width: min(100%, 1380px);
  margin-inline: auto;
}

.model-strategy-shell,
.inference-workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.model-strategy-panel .workspace-page,
.strategy-workspace {
  gap: 16px;
}

.strategy-command-panel {
  overflow: hidden;
  padding: 0;
  border-color: var(--calm-border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(17, 24, 39, .9), rgba(11, 18, 30, .82));
  box-shadow: none;
}

.analyst-view-tabs {
  margin-top: -2px;
}

.analyst-view-panel {
  min-width: 0;
}

.topbar-primary-status,
.topbar-context-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.topbar-context-status {
  padding-left: var(--space-2);
  border-left: 1px solid var(--border-default);
}

.topbar-context-status .status-badge {
  padding-inline: 7px;
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
}

.observer-channel-switcher {
  position: relative;
  flex: 0 0 auto;
  width: clamp(190px, 16vw, 226px);
}

.observer-channel-trigger {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 5px 10px 5px 6px;
  border: 1px solid color-mix(in srgb, var(--border-default) 82%, #64748b);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-input) 86%, transparent);
  color: var(--text-primary);
  font-family: var(--font-ui);
  text-align: left;
  touch-action: manipulation;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.observer-channel-trigger:hover,
.observer-channel-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--gold-primary) 44%, var(--border-default));
  background: var(--bg-input);
}

.observer-channel-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold-light) 68%, transparent);
  outline-offset: 2px;
}

.observer-channel-trigger:disabled {
  cursor: wait;
  opacity: .62;
}

.observer-channel-trigger-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(212,175,55,.18);
  border-radius: 9px;
  background: rgba(212,175,55,.08);
  color: var(--gold-primary);
}

.observer-channel-trigger-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.observer-channel-trigger-copy small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.observer-channel-trigger-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.observer-channel-chevron {
  color: var(--text-muted);
  transition: transform 180ms ease, color 160ms ease;
}

.observer-channel-trigger[aria-expanded="true"] .observer-channel-chevron {
  color: var(--gold-primary);
  transform: rotate(180deg);
}

.observer-channel-menu {
  position: absolute;
  z-index: 220;
  top: calc(100% + 8px);
  right: 0;
  width: max(100%, 256px);
  max-height: min(320px, calc(100dvh - 96px));
  overflow: auto;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--border-default) 76%, #64748b);
  border-radius: 12px;
  background: #101827;
  box-shadow: 0 18px 44px rgba(0,0,0,.42), 0 2px 8px rgba(0,0,0,.26);
  transform-origin: top right;
  animation: observer-menu-in 160ms cubic-bezier(.16,1,.3,1);
}

.observer-channel-option {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-ui);
  text-align: left;
  touch-action: manipulation;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.observer-channel-option:hover,
.observer-channel-option:focus-visible {
  border-color: #526277;
  outline: none;
  background: rgba(148,163,184,.08);
}

.observer-channel-option:focus-visible {
  box-shadow: 0 0 0 2px rgba(100,116,139,.2);
}

.observer-channel-option.is-selected {
  border-color: rgba(212,175,55,.2);
  background: rgba(212,175,55,.08);
}

.observer-channel-option-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.observer-channel-option-status.is-online { background: var(--status-connected); }
.observer-channel-option-status.is-offline { background: var(--status-warning); }

.observer-channel-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.observer-channel-option-copy strong,
.observer-channel-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.observer-channel-option-copy strong { font-size: 13px; font-weight: 650; }
.observer-channel-option-copy small { color: var(--text-muted); font-size: 10px; font-weight: 500; }
.observer-channel-option-check { color: transparent; }
.observer-channel-option.is-selected .observer-channel-option-check { color: var(--gold-primary); }

@keyframes observer-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .observer-channel-menu { animation: none; }
  .observer-channel-chevron { transition: none; }
}

.analyst-view-panel[hidden] {
  display: none;
}

.analyst-records-card {
  overflow: hidden;
  border-color: var(--calm-border);
  background: var(--calm-surface);
}

.analyst-records-card > .card-header > div {
  display: grid;
  gap: 4px;
}

.analyst-records-card > .card-header small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.analyst-records-toolbar {
  min-height: 52px;
  padding-inline: var(--space-4);
}

.trading-workspace {
  gap: 18px;
}

.trading-workspace .account-snapshot-row {
  margin-bottom: 0;
}

.trading-view-tabs {
  align-self: flex-start;
}

.trading-workspace .trading-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.trading-workspace .trading-grid > .card {
  grid-column: auto;
  grid-row: auto;
  margin: 0;
}

.trading-workspace .trading-grid > .card[hidden] {
  display: none;
}

.trading-manual-panel {
  width: min(100%, 760px);
}

.strategy-control-header {
  min-height: 86px;
  padding: 15px 18px 14px;
  border-bottom: 1px solid var(--calm-border);
}

.strategy-control-header .section-kicker {
  display: block;
  margin-bottom: 3px;
}

.strategy-control-header h2 {
  font-size: 18px;
  line-height: 1.35;
}

.strategy-control-header p {
  margin-top: 3px;
  color: var(--calm-muted);
  font-size: 12px;
}

.strategy-control-header .toolbar-actions {
  gap: 12px;
}

.strategy-control-header .btn-primary {
  min-height: 40px;
  padding-inline: 15px;
  box-shadow: none;
}

.strategy-summary-panel {
  display: grid;
  grid-template-columns: minmax(150px, .65fr) minmax(150px, .65fr) minmax(300px, 1.7fr);
  min-width: 0;
}

.strategy-summary-item,
.strategy-model-summary {
  position: relative;
  min-width: 0;
  min-height: 78px;
  padding: 13px 17px;
  border-left: 1px solid var(--calm-border);
}

.strategy-summary-item:first-child {
  border-left: 0;
}

.strategy-summary-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.strategy-summary-item > span,
.strategy-model-summary span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.strategy-summary-item > strong {
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.strategy-summary-item > small {
  color: var(--text-muted);
  font-size: 10px;
}

.strategy-summary-item.is-running::after {
  position: absolute;
  inset: 13px auto 13px 0;
  width: 2px;
  border-radius: 2px;
  background: var(--gold-primary);
  content: "";
}

.strategy-model-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.strategy-model-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(245, 216, 93, .18);
  border-radius: 10px;
  background: rgba(245, 216, 93, .07);
  color: #f5d85d;
}

.strategy-model-summary > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.strategy-model-summary strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-model-summary .text-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  white-space: nowrap;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--calm-border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(17, 24, 39, .92), rgba(13, 20, 33, .88));
  box-shadow: 0 12px 35px rgba(2, 6, 23, .14);
}

.insight-item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 16px 18px;
  border-left: 1px solid var(--calm-border);
}

.insight-item:first-child {
  border-left: 0;
}

.insight-item > span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.insight-item > strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-item > small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-item.primary::after,
.insight-item.success::after,
.insight-item.warning::after,
.insight-item.danger::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--gold-primary);
  content: "";
}

.insight-item.success::after { background: #34d399; }
.insight-item.warning::after { background: #fbbf24; }
.insight-item.danger::after { background: #fb7185; }
.insight-item.success > strong { color: #6ee7b7; }
.insight-item.warning > strong { color: #fcd34d; }
.insight-item.danger > strong { color: #fda4af; }

.insight-item.action .text-action {
  align-self: flex-start;
  margin-top: 2px;
}

.compact-notice {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}

.workspace-filter-bar,
.workspace-subtabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--calm-border);
  border-radius: 10px;
  background: rgba(9, 14, 25, .66);
}

.filter-pill,
.workspace-subtabs button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.filter-pill:hover,
.workspace-subtabs button:hover {
  background: rgba(30, 41, 59, .66);
  color: var(--text-primary);
}

.filter-pill.active,
.workspace-subtabs button.active {
  background: rgba(212, 175, 55, .13);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .26);
  color: #f1d56d;
}

.workspace-subpanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.workspace-subpanel[hidden] {
  display: none;
}

.strategy-catalog,
#modelProfilesList {
  gap: 12px;
}

.strategy-card {
  padding: 17px 18px 0;
  border-color: var(--calm-border);
  background: var(--calm-surface);
  box-shadow: 0 10px 30px rgba(2, 6, 23, .16);
}

.strategy-card::before {
  width: 2px;
  opacity: .65;
}

.strategy-card-header {
  align-items: center;
}

.strategy-card-description {
  max-width: 72ch;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.strategy-essentials {
  display: grid;
  grid-template-columns: 1.15fr .8fr 1fr .85fr;
  gap: 8px;
  margin-top: 14px;
}

.strategy-essentials > span {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(51, 65, 85, .44);
  border-radius: 9px;
  background: rgba(9, 14, 25, .38);
}

.strategy-essentials small,
.strategy-essentials strong {
  display: block;
}

.strategy-essentials small {
  color: var(--text-muted);
  font-size: 10px;
}

.strategy-essentials strong {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-essentials .running {
  border-color: rgba(52, 211, 153, .25);
  background: rgba(16, 185, 129, .06);
}

.strategy-essentials .running strong {
  color: #6ee7b7;
}

.strategy-details {
  margin: 14px -18px 0;
  border-top: 1px solid var(--calm-border);
}

.strategy-details > summary,
.quiet-disclosure > summary,
.risk-policy-group > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
}

.strategy-details > summary::-webkit-details-marker,
.quiet-disclosure > summary::-webkit-details-marker,
.risk-policy-group > summary::-webkit-details-marker {
  display: none;
}

.strategy-details[open] > summary svg,
.quiet-disclosure[open] > summary > svg,
.risk-policy-group[open] > summary > svg {
  transform: rotate(180deg);
}

.strategy-details summary svg,
.quiet-disclosure summary > svg,
.risk-policy-group summary > svg {
  flex: 0 0 auto;
  transition: transform 180ms ease;
}

.strategy-details-body {
  padding: 0 18px 16px;
}

.strategy-specs {
  margin-top: 0;
}

.quiet-empty {
  padding: 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.model-profile-card {
  align-items: center;
  padding: 14px 16px;
  border-color: var(--calm-border);
  background: var(--calm-surface);
}

.model-primary-meta {
  margin-top: 5px;
}

.row-details {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 11px;
}

.row-details summary {
  width: max-content;
  cursor: pointer;
}

.row-details[open] .workspace-row-meta {
  margin-top: 7px;
}

.text-action {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e8c957;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.text-action:hover {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inference-command-card {
  padding: 17px 18px;
  border-color: var(--calm-border);
  background: linear-gradient(135deg, rgba(18, 27, 43, .96), rgba(12, 19, 32, .94));
}

.inference-command-card .card-header > div,
.analysis-result-card .card-header > div {
  display: grid;
  gap: 3px;
}

.inference-command-card .card-header small,
.analysis-result-card .card-header small {
  color: var(--text-muted);
  font-size: 11px;
}

.manual-run-fields {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, .72fr);
  gap: 16px;
}

.execution-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--calm-border);
}

.execution-mode-row > div {
  display: grid;
  gap: 2px;
}

.execution-mode-row > div small {
  color: var(--text-muted);
  font-size: 11px;
}

.manual-auto-execute {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 360px;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--calm-border);
  border-radius: 9px;
  background: rgba(8, 13, 23, .75);
  cursor: pointer;
}

.manual-auto-execute input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.manual-auto-execute input:not(:checked) ~ .safe {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.15);
}

.manual-auto-execute input:checked ~ .live {
  background: rgba(239, 68, 68, 0.2);
  color: #fda4af;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.15);
}

.calm-analysis-grid {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  grid-template-areas: "history main";
  align-items: start;
  gap: var(--space-4);
}

.analysis-result-card {
  grid-area: main;
  min-height: 360px;
  padding: 18px;
  border-color: var(--calm-border);
  background: var(--calm-surface);
}

.analysis-result.is-loading {
  pointer-events: none;
}

.analysis-detail-loading {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-secondary);
}

.analysis-detail-loading > div {
  display: grid;
  gap: 5px;
}

.analysis-detail-loading strong { color: var(--text-primary); font-size: 15px; }
.analysis-detail-loading span:last-child { font-size: 12px; }

.analysis-detail-loading-mark {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
  animation: analysis-detail-pulse 1.2s ease-in-out infinite;
}

@keyframes analysis-detail-pulse {
  50% { opacity: .45; transform: scale(.82); }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-detail-loading-mark { animation: none; }
}

.inference-chart-panel {
  margin-top: var(--space-4);
  overflow: hidden;
  border: 1px solid var(--calm-border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 17, 29, .76), rgba(12, 20, 34, .9));
}

.inference-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px 16px 10px;
}

.inference-chart-header > div {
  display: grid;
  gap: 4px;
}

.inference-chart-header .analysis-section-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text-primary);
}

.inference-chart-header small {
  color: var(--text-muted);
  font-size: 11px;
}

.chart-icon-btn {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--calm-border);
  border-radius: 9px;
  background: var(--bg-input-soft);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.chart-icon-btn:hover,
.chart-icon-btn:focus-visible {
  border-color: rgba(232, 201, 87, .58);
  outline: none;
  background: rgba(232, 201, 87, .08);
  color: var(--gold-light);
}

.inference-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 12px;
}

.inference-timeframe-tabs,
.inference-layer-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inference-timeframe-tabs button,
.inference-layer-tabs button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.inference-timeframe-tabs {
  padding: 3px;
  border: 1px solid var(--calm-border);
  border-radius: 10px;
  background: rgba(8, 13, 23, .72);
}

.inference-timeframe-tabs button.active {
  border-color: rgba(232, 201, 87, .35);
  background: rgba(232, 201, 87, .12);
  color: var(--gold-light);
}

.inference-layer-tabs button {
  border-color: var(--calm-border);
  background: rgba(16, 25, 41, .66);
}

.inference-layer-tabs button.active {
  border-color: rgba(97, 168, 255, .34);
  background: rgba(97, 168, 255, .1);
  color: #a9ceff;
}

.inference-timeframe-tabs button:focus-visible,
.inference-layer-tabs button:focus-visible {
  outline: 2px solid rgba(232, 201, 87, .7);
  outline-offset: 2px;
}

.inference-chart-stage {
  position: relative;
  min-height: 340px;
  border-top: 1px solid rgba(148, 163, 184, .1);
  border-bottom: 1px solid rgba(148, 163, 184, .1);
  background: rgba(5, 10, 19, .36);
}

.inference-kline-chart {
  width: 100%;
  height: 340px;
}

.inference-kline-chart #tv-attr-logo,
.inference-kline-chart a[href*="tradingview"] {
  display: none !important;
}

.inference-chart-cursor {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 6px;
  background: rgba(8, 13, 23, .82);
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.inference-chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 40px;
  padding: 8px 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 11px;
}

.inference-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inference-chart-legend .is-warning { color: #d7b96a; }

.inference-chart-legend i { display: inline-block; flex: 0 0 auto; }
.legend-line { width: 16px; height: 2px; border-radius: 2px; }
.legend-line.segment { background: #e8c957; }
.legend-line.levels { border-top: 1px dashed #61a8ff; }
.legend-box { width: 14px; height: 8px; border: 1px dashed #7c8da8; border-radius: 2px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.divergence { background: #ff6b76; }
.legend-dot.entry { background: #61a8ff; }

.inference-chart-table {
  border-top: 1px solid rgba(148, 163, 184, .08);
}

.inference-chart-table summary {
  padding: 10px 16px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
}

.inference-chart-table .table-wrap { max-height: 240px; overflow: auto; padding: 0 16px 14px; }
.inference-chart-table table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.inference-chart-table th,
.inference-chart-table td { padding: 7px 8px; border-bottom: 1px solid rgba(148, 163, 184, .08); text-align: right; }
.inference-chart-table th:first-child,
.inference-chart-table td:first-child { text-align: left; }

.inference-chart-panel.is-empty {
  padding: 0;
  background: rgba(12, 20, 34, .55);
}

.inference-chart-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 16px;
  color: var(--text-muted);
}

.inference-chart-empty div { display: grid; gap: 4px; }
.inference-chart-empty strong { color: var(--text-secondary); font-size: 13px; }
.inference-chart-empty span,
.inference-chart-error { color: var(--text-muted); font-size: 11px; }
.inference-chart-error { display: grid; height: 100%; place-items: center; }

.inference-chart-panel:fullscreen {
  display: flex;
  padding: 20px;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: #080e18;
}

.inference-chart-panel:fullscreen .inference-chart-stage { flex: 1; min-height: 0; }
.inference-chart-panel:fullscreen .inference-kline-chart { height: 100%; min-height: 420px; }
.inference-chart-panel:fullscreen .inference-chart-table { display: none; }

@media (max-width: 760px) {
  .inference-chart-header,
  .inference-chart-toolbar { align-items: flex-start; }
  .inference-chart-toolbar { flex-direction: column; }
  .inference-layer-tabs { width: 100%; }
  .inference-layer-tabs button { flex: 1 1 auto; }
  .inference-chart-stage,
  .inference-kline-chart { min-height: 300px; height: 300px; }
  .inference-chart-cursor { right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.quiet-disclosure {
  overflow: hidden;
  padding: 0 !important;
  border-color: var(--calm-border);
  background: var(--calm-surface);
}

.quiet-disclosure > summary > span,
.risk-policy-group > summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiet-disclosure > summary small,
.risk-policy-group > summary small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.quiet-disclosure-body {
  padding: 0 16px 16px;
}

.analysis-history-panel {
  grid-area: history;
  position: sticky;
  top: var(--space-4);
  min-width: 0;
  margin: 0;
  padding: var(--space-4);
  border-color: var(--calm-border);
  background: var(--calm-surface);
}

.analysis-history-panel .analysis-history-head {
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.analysis-history-panel .analysis-history-head > div {
  display: grid;
  gap: var(--space-1);
}

.analysis-history-panel .analysis-history-head .card-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.analysis-history-panel .analysis-history-head small {
  color: var(--text-muted);
  font-size: 11px;
}

.history-status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: var(--space-3);
}

.history-status-strip > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--calm-border);
  border-radius: 10px;
  background: var(--bg-input-soft);
}

.history-status-strip span { color: var(--text-muted); font-size: 11px; }
.history-status-strip strong { overflow: hidden; color: var(--text-primary); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.analysis-history-panel .analysis-history-list {
  gap: var(--space-2);
  max-height: min(640px, calc(100vh - 260px));
  padding-right: var(--space-1);
}

.analysis-history-panel .analysis-history-item {
  gap: var(--space-1);
  padding: var(--space-3);
}

.analysis-history-panel .history-item-text {
  display: none;
}

.analysis-history-panel .history-item-meta {
  gap: var(--space-2);
}

@media (max-width: 980px) {
  .calm-analysis-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "history";
  }

  .analysis-history-panel {
    position: static;
  }

  .analysis-history-panel .analysis-history-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-height: 360px;
  }
}

.risk-overview-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  gap: 10px;
}

.risk-overview-strip .insight-item {
  min-height: 82px;
  overflow: hidden;
  border: 1px solid var(--calm-border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(17, 24, 39, .92), rgba(13, 20, 33, .88));
}

.risk-overview-strip .insight-item:first-child,
.risk-overview-strip .insight-item:nth-child(n) {
  border-left: 1px solid var(--calm-border);
}

.risk-status-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-color: var(--calm-border);
  background: var(--calm-surface);
}

.risk-status-card.is-alert {
  border-color: rgba(244, 63, 94, .28);
}

.risk-status-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: rgba(16, 185, 129, .09);
  color: #6ee7b7;
}

.risk-status-card.is-alert .risk-status-icon {
  background: rgba(244, 63, 94, .1);
  color: #fda4af;
}

.risk-status-main p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.risk-rule-account {
  padding: 16px;
}

.risk-policy-groups {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.risk-policy-group {
  overflow: hidden;
  border: 1px solid var(--calm-border);
  border-radius: 10px;
  background: rgba(9, 14, 25, .42);
}

.risk-policy-group > summary {
  padding: 0 13px;
}

.risk-policy-group > summary span {
  justify-content: space-between;
  width: 100%;
}

.risk-policy-group > summary .risk-group-summary {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.risk-group-level {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.risk-group-level.steady { border-color: var(--status-connected-border); color: #6ee7b7; }
.risk-group-level.standard { border-color: var(--border-gold); color: var(--gold-light); }
.risk-group-level.elevated { border-color: var(--color-warning-border); color: #fbbf24; }
.risk-group-level.high,
.risk-group-level.critical,
.risk-group-level.invalid { border-color: var(--color-positive-border); color: #fda4af; }

.risk-policy-group .risk-rule-table {
  border: 0;
  border-top: 1px solid var(--calm-border);
  border-radius: 0;
}

.risk-rule-row {
  min-height: 50px;
  background: rgba(15, 23, 42, .38);
}

.risk-rule-row.risk-preference-row {
  row-gap: 10px;
}

.risk-preference-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(300px, 1.2fr);
  gap: 8px 16px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-input-soft);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.risk-preference-preview.steady { border-color: var(--status-connected-border); background: var(--status-connected-bg); }
.risk-preference-preview.standard { border-color: var(--border-gold); background: var(--gold-wash-subtle); }
.risk-preference-preview.elevated { border-color: var(--color-warning-border); background: var(--color-warning-bg); }
.risk-preference-preview.high,
.risk-preference-preview.critical,
.risk-preference-preview.invalid { border-color: var(--color-positive-border); background: var(--color-positive-bg); }

.risk-preference-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.risk-preference-heading > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.risk-preference-heading strong {
  color: var(--text-primary);
  font-size: 13px;
}

.risk-preference-heading small,
.risk-preference-preview > p {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.risk-preference-heading > b {
  flex: 0 0 auto;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.risk-preference-preview.steady .risk-preference-heading > b { color: #6ee7b7; }
.risk-preference-preview.standard .risk-preference-heading > b { color: var(--gold-light); }
.risk-preference-preview.elevated .risk-preference-heading > b { color: #fbbf24; }
.risk-preference-preview.high .risk-preference-heading > b,
.risk-preference-preview.critical .risk-preference-heading > b,
.risk-preference-preview.invalid .risk-preference-heading > b { color: #fda4af; }

.risk-tier-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: rgba(8, 11, 20, .32);
}

.risk-tier-impact > span {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-left: 1px solid var(--border-subtle);
}

.risk-tier-impact > span:first-child { border-left: 0; }
.risk-tier-impact em { overflow: hidden; color: var(--text-secondary); font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.risk-tier-impact strong { color: var(--text-primary); font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.risk-preference-preview > p { grid-column: 1 / -1; margin: 0; }

.risk-overview-level.elevated { border-color: var(--color-warning-border) !important; }
.risk-overview-level.high,
.risk-overview-level.critical,
.risk-overview-level.invalid { border-color: var(--color-positive-border) !important; }
.risk-overview-level.elevated > strong { color: #fbbf24; }
.risk-overview-level.high > strong,
.risk-overview-level.critical > strong,
.risk-overview-level.invalid > strong { color: #fda4af; }

.risk-rule-name small {
  display: block;
  max-width: 34rem;
  margin-top: 4px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.45;
}

.review-insight-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-job-counts {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.review-job-counts em {
  color: var(--text-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.strategy-count-pair {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.strategy-count-pair em {
  color: var(--text-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.risk-input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-input);
}

.risk-input-with-unit:focus-within {
  border-color: rgba(241, 213, 109, .7);
  box-shadow: 0 0 0 2px rgba(241, 213, 109, .12);
}

.risk-input-with-unit input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
}

.risk-input-with-unit em {
  display: inline-flex;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-left: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.review-memory-workspace {
  gap: 16px;
}

.review-status-tabs {
  width: max-content;
  max-width: 100%;
  margin-bottom: 2px;
  border: 0;
  border-radius: 9px;
  background: rgba(9, 14, 25, .46);
}

.review-status-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
}

.review-status-tabs button.active {
  border: 0;
  background: rgba(212, 175, 55, .12);
  color: #f1d56d;
}

.review-layout {
  grid-template-columns: minmax(280px, .68fr) minmax(520px, 1.32fr);
  gap: 14px;
}

.review-case-button {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 76px;
  align-items: center;
  text-align: left;
}

.review-case-leading,
.memory-card-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: rgba(212, 175, 55, .08);
  color: #e8c957;
}

.review-case-button.selected {
  border-color: rgba(212, 175, 55, .42);
  background: rgba(212, 175, 55, .07);
}

.review-detail {
  top: 16px;
  padding: 18px;
}

.review-highlight {
  display: grid;
  gap: 2px;
  margin: 13px 0;
  padding: 13px 14px;
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: 10px;
  background: rgba(212, 175, 55, .055);
}

.review-highlight span,
.review-highlight small {
  color: var(--text-muted);
  font-size: 11px;
}

.review-highlight strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.review-structured-form {
  display: grid;
  gap: 12px;
}

.review-structured-form > label,
.review-form-columns label {
  display: grid;
  gap: 6px;
}

.review-form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.review-issues {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 9px;
  background: rgba(245, 158, 11, .055);
}

.review-issues > span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.review-issues p {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text-primary);
  font-size: 12px;
}

.review-issues.is-clear {
  border-color: rgba(16, 185, 129, .22);
  background: rgba(16, 185, 129, .05);
}

.review-evidence-disclosure {
  margin-top: 14px;
  border: 1px solid var(--calm-border);
  border-radius: 10px;
}

.review-editor.compact {
  min-height: 180px;
  font-size: 11px;
}

.review-actions {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  margin: 16px -18px -18px;
  padding: 12px 18px;
  border-top: 1px solid var(--calm-border);
  background: rgba(17, 24, 39, .96);
  backdrop-filter: blur(10px);
}

.memory-card {
  align-items: flex-start;
}

.memory-lesson {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.65;
}

.settings-disclosure {
  margin-top: 12px;
}

.setting-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setting-switches label {
  min-height: 64px;
  align-items: flex-start;
  padding: 11px 12px;
}

.setting-switches label > span {
  display: grid;
  gap: 2px;
}

.setting-switches label small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.admin-boundary-note {
  padding: 10px 13px;
}

.danger-zone {
  border-color: rgba(244, 63, 94, .25);
  background: linear-gradient(135deg, rgba(68, 18, 31, .2), rgba(17, 24, 39, .82));
}

.panel-section-heading {
  margin-bottom: 12px;
}

.risk-rollout-row {
  align-items: center;
  padding: 13px 14px;
}

#model-strategy .btn,
#ai-analyze .btn,
#risk-center .btn,
#review-memory .btn {
  min-height: 40px;
}

#model-strategy .btn-sm,
#ai-analyze .btn-sm,
#risk-center .btn-sm,
#review-memory .btn-sm {
  min-height: 34px;
}

#model-strategy :focus-visible,
#ai-analyze :focus-visible,
#risk-center :focus-visible,
#review-memory :focus-visible {
  outline: 2px solid #f1d56d;
  outline-offset: 2px;
}

/* Review workstation: compact queue + readable, task-focused editor. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.review-layout {
  grid-template-columns: minmax(286px, 316px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.review-queue {
  position: sticky;
  top: 16px;
  padding: 0;
  overflow: hidden;
  background: rgba(13, 20, 34, .78);
}

.review-queue-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 17px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .1);
}

.review-queue-heading h2,
.review-detail-header h2,
.review-form-heading h3 {
  margin: 0;
  color: var(--text-primary);
}

.review-queue-heading h2 { margin-top: 2px; font-size: 16px; }
.review-section-kicker { color: #d6b84d; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.review-queue-hint { padding-bottom: 2px; color: var(--text-muted); font-size: 10px; white-space: nowrap; }

.review-queue .review-status-tabs {
  width: 100%;
  margin: 0;
  padding: 10px 10px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: none;
}

.review-queue .review-status-tabs::-webkit-scrollbar { display: none; }
.review-queue .review-status-tabs button { min-height: 34px; padding: 6px 9px; font-size: 11px; }

.review-list {
  gap: 8px;
  padding: 0 10px 10px;
}

.review-list-loading { display: grid; gap: 8px; }
.review-stream-status {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
.review-stream-status .text-action { min-height: 34px; padding: 0 8px; color: var(--gold-light); }
.review-stream-status.is-loading { color: var(--text-secondary); }
.review-stream-status.is-error { flex-wrap: wrap; color: #fda4af; }
.review-stream-status.is-complete { border-top: 1px solid rgba(148, 163, 184, .1); }

#review-memory .review-case-button {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  width: 100%;
  height: auto;
  min-height: 104px;
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 12px 10px;
  overflow: visible;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 11px;
  background: rgba(20, 30, 49, .66);
  color: var(--text-primary);
  text-align: left;
  box-shadow: none;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.risk-system-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(56, 189, 248, .18);
  border-radius: 8px;
  background: rgba(56, 189, 248, .045);
  color: #7dd3fc;
}

.risk-system-note span {
  display: grid;
  gap: 3px;
}

.risk-system-note strong { color: var(--text-primary); font-size: 11px; }
.risk-system-note small { color: var(--text-secondary); font-size: 10px; line-height: 1.45; }

#review-memory .review-case-button.is-unread { background: rgba(19, 39, 58, .78); }

#review-memory .review-case-button:hover {
  border-color: rgba(148, 163, 184, .28);
  background: rgba(25, 37, 59, .78);
}

#review-memory .review-case-button.selected {
  border-color: rgba(221, 185, 61, .48);
  background: linear-gradient(100deg, rgba(212, 175, 55, .1), rgba(24, 34, 51, .75));
  box-shadow: inset 3px 0 0 #d8b73e;
}

.review-case-leading {
  width: 32px;
  height: 32px;
  color: #eacb55;
  background: rgba(212, 175, 55, .1);
}

.review-case-leading.success { color: #5ee4bb; background: rgba(16, 185, 129, .11); }
.review-case-leading.danger { color: #fb8c9a; background: rgba(244, 63, 94, .11); }
.review-case-main { min-width: 0; display: grid; gap: 7px; }
.review-case-head { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.review-case-head strong { min-width: 0; color: var(--text-primary); font-size: 12px; font-weight: 700; line-height: 1.4; }
.review-case-head .status-chip { min-height: 22px; padding: 3px 7px; font-size: 10px; }
#review-memory .review-case-strategy { min-width: 0; overflow: hidden; color: #9aabc1; font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.review-case-metrics { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 8px; border-top: 1px solid rgba(148, 163, 184, .1); }
.review-case-metrics > span { min-width: 0; display: flex; align-items: baseline; gap: 5px; }
.review-case-metrics small { color: #71839d; font-size: 9px; white-space: nowrap; }
.review-case-metrics strong { min-width: 0; overflow: hidden; color: #b8c5d7; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.review-case-metrics strong.positive { color: #5ee4bb; }
.review-case-metrics strong.negative { color: #fb8c9a; }
.review-case-arrow { align-self: center; display: grid; width: 24px; height: 36px; place-items: center; color: var(--text-muted); transition: color 180ms ease, transform 180ms ease; }
#review-memory .review-case-button:hover .review-case-arrow,
#review-memory .review-case-button.selected .review-case-arrow { color: #e6c755; transform: translateX(2px); }

@media (max-width: 380px) {
  #review-memory .review-case-button { grid-template-columns: 30px minmax(0, 1fr) 20px; gap: 8px; padding-inline: 9px; }
  .review-case-leading { width: 30px; height: 30px; }
  .review-case-arrow { width: 20px; }
  .review-case-metrics { grid-template-columns: 1fr; gap: 3px; }
}

.review-list-empty { min-height: 220px; margin: 0 2px 2px; border: 1px dashed rgba(148, 163, 184, .18); border-radius: 10px; }
.review-empty-state { min-height: 420px; padding: 48px 24px; }
.review-empty-state > span:last-child { max-width: 320px; text-align: center; line-height: 1.65; }
.review-empty-icon,
.review-detail-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, .2);
  border-radius: 12px;
  background: rgba(212, 175, 55, .08);
  color: #e8c957;
}

.review-detail {
  position: static;
  max-height: none;
  padding: 0;
  overflow: visible;
  background: rgba(15, 23, 38, .88);
}

.review-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.review-detail-title,
.review-detail-status,
.review-action-context,
.review-action-buttons {
  display: flex;
  align-items: center;
}

.review-detail-title { gap: 12px; }
.review-detail-title .review-detail-icon { width: 40px; height: 40px; }
.review-detail-header h2 { margin-top: 2px; font-size: 18px; }
.review-detail-header p { margin: 2px 0 0; color: var(--text-secondary); font-size: 11px; }
.review-detail-status { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.review-detail > .source-notice { margin: 14px 18px 0; }
.review-outcome-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 18px 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 11px;
  background: rgba(8, 14, 25, .34);
}

.review-outcome-main,
.review-outcome-metric {
  display: grid;
  gap: 2px;
  min-height: 84px;
  align-content: center;
  padding: 13px 16px;
  border-left: 1px solid rgba(148, 163, 184, .11);
}

.review-outcome-main { border-left: 0; }
.review-outcome-strip span,
.review-outcome-strip small { color: var(--text-muted); font-size: 10px; }
.review-outcome-strip strong { color: var(--text-primary); font-family: var(--font-mono); font-size: 17px; line-height: 1.35; }
.review-outcome-main.positive strong { color: #5ee4bb; }
.review-outcome-main.negative strong { color: #fb8c9a; }
.review-outcome-strip > p {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 15px;
  border-top: 1px solid rgba(148, 163, 184, .09);
  color: var(--text-muted);
  font-size: 10px;
}

.review-structured-form { gap: 0; padding: 2px 18px 0; }
.review-form-section { padding: 18px 0; border-bottom: 1px solid rgba(148, 163, 184, .1); }
.review-form-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.review-form-heading h3 { margin-top: 2px; font-size: 14px; }
.review-form-heading > small { color: var(--text-muted); font-size: 10px; }
.review-field { gap: 7px; }
.review-field > span { color: var(--text-secondary); font-size: 11px; }
.review-field > small,
.review-confidence-field small { color: var(--text-muted); font-size: 10px; font-weight: 400; line-height: 1.45; }
.review-field textarea { min-height: 92px; background: rgba(25, 36, 56, .74); line-height: 1.7; }
.review-summary-section textarea { min-height: 112px; font-size: 13px; }
.review-assessment-grid { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(170px, .8fr) minmax(260px, 1.5fr); gap: 10px; align-items: start; }
.review-confidence-field > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.review-outcome-summary textarea { min-height: 72px; }
.review-form-columns { gap: 10px; }

.review-issues {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-color: rgba(245, 158, 11, .22);
  background: rgba(245, 158, 11, .055);
}

.review-issues > div { display: flex; align-items: center; gap: 7px; color: #f4ce70; }
.review-issues > div span { font-size: 11px; font-weight: 700; }
.review-issues p { margin: 0 0 0 23px; color: var(--text-secondary); line-height: 1.55; }
.review-issues.is-clear > div { color: #5ee4bb; }
.review-evidence-disclosure { margin: 16px 18px 0; }

.review-actions {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 0;
  padding: 12px 18px;
  border-top: 1px solid rgba(148, 163, 184, .14);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: rgba(13, 20, 33, .96);
  box-shadow: none;
}

.review-action-context { min-width: 180px; gap: 9px; color: #d8bc52; }
.review-action-context > span { display: grid; gap: 1px; }
.review-action-context strong { color: var(--text-secondary); font-size: 10px; }
.review-action-context small { color: var(--text-muted); font-size: 9px; }
.review-action-buttons { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.review-actions .btn { min-height: 36px !important; }

.personal-memory-section {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(10, 17, 29, .42);
}

.personal-memory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 17px;
  border-bottom: 1px solid rgba(148, 163, 184, .11);
  background: rgba(18, 27, 44, .5);
}

.personal-memory-title,
.personal-memory-stats,
.personal-memory-card > header,
.personal-memory-card > footer,
.personal-memory-meta,
.personal-memory-actions {
  display: flex;
  align-items: center;
}

.personal-memory-title { gap: 11px; min-width: 0; }
.personal-memory-title > div { min-width: 0; }
.personal-memory-title h3 { margin: 2px 0 0; color: var(--text-primary); font-size: 15px; }
.personal-memory-title p { margin: 3px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.personal-memory-main-icon,
.personal-memory-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, .18);
  background: rgba(212, 175, 55, .08);
  color: #e7c958;
}

.personal-memory-main-icon { width: 38px; height: 38px; border-radius: 11px; }
.personal-memory-stats { flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.personal-memory-stats > span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 7px;
  background: rgba(8, 14, 25, .38);
  color: var(--text-secondary);
  font-size: 10px;
}

.personal-memory-stats strong { color: var(--text-primary); font-family: var(--font-mono); font-size: 12px; }
.personal-memory-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 13px 0;
  padding: 9px 11px;
  border: 1px solid rgba(16, 185, 129, .16);
  border-radius: 8px;
  background: rgba(16, 185, 129, .05);
  color: var(--text-secondary);
  font-size: 10px;
}

.personal-memory-state svg { flex: 0 0 auto; color: #5ee4bb; }
.personal-memory-state strong { color: var(--text-primary); }
.personal-memory-state.is-off { border-color: rgba(245, 158, 11, .18); background: rgba(245, 158, 11, .05); }
.personal-memory-state.is-off svg { color: #f4ce70; }
.personal-memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 13px 13px; }
.personal-memory-section.is-disabled .personal-memory-grid { opacity: .76; }
.personal-memory-card {
  display: grid;
  align-content: start;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(20, 30, 49, .58);
}

.personal-memory-card.is-active { border-color: rgba(16, 185, 129, .22); }
.personal-memory-card.is-duplicate_candidate,
.personal-memory-card.is-stale { border-color: rgba(212, 175, 55, .25); }
.personal-memory-card.is-revoked { opacity: .62; }
.personal-memory-card.memory-tier-long {
  border-color: rgba(212, 175, 55, .34);
  background: linear-gradient(145deg, rgba(212, 175, 55, .06), rgba(15, 23, 42, .5) 48%);
}
.personal-memory-card.memory-tier-short { border-color: rgba(94, 228, 187, .2); }
.personal-memory-lesson small { display: block; margin-top: 8px; color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.personal-memory-card > header { gap: 9px; padding: 12px 13px 9px; }
.personal-memory-card > header > div { display: grid; min-width: 0; gap: 2px; }
.personal-memory-card > header > div strong { overflow: hidden; color: var(--text-primary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.personal-memory-card > header > div span { color: var(--text-muted); font-size: 9px; }
.personal-memory-card > header > .status-chip { margin-left: auto; }
.personal-memory-icon { width: 32px; height: 32px; border-radius: 9px; }
.personal-memory-icon.success { border-color: rgba(16, 185, 129, .2); background: rgba(16, 185, 129, .08); color: #5ee4bb; }
.personal-memory-icon.danger { border-color: rgba(244, 63, 94, .2); background: rgba(244, 63, 94, .08); color: #fb8c9a; }
.personal-memory-lesson {
  display: grid;
  gap: 5px;
  min-height: 104px;
  align-content: start;
  padding: 11px 13px;
  border-top: 1px solid rgba(148, 163, 184, .09);
  border-bottom: 1px solid rgba(148, 163, 184, .09);
  background: rgba(8, 14, 25, .25);
}

.personal-memory-lesson > span { color: var(--text-muted); font-size: 9px; font-weight: 650; }
.personal-memory-lesson p { margin: 0; color: var(--text-primary); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.memory-context { display: grid; gap: 9px; padding: 11px 13px; border-bottom: 1px solid rgba(148, 163, 184, .09); background: rgba(12, 20, 34, .32); }
.memory-context-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--text-muted); font-size: 10px; }
.memory-category-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border: 1px solid rgba(212, 175, 55, .22); border-radius: 999px; color: #ead06a; background: rgba(212, 175, 55, .07); font-weight: 700; }
.memory-context-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.memory-context-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 27px; padding: 4px 7px; border: 1px solid rgba(148, 163, 184, .13); border-radius: 7px; color: var(--text-secondary); background: rgba(30, 41, 59, .38); font-size: 10px; line-height: 1.35; }
.memory-context-chip strong { color: #cbd5e1; font-size: inherit; }
.memory-context-chip.universal { border-color: rgba(94, 228, 187, .2); color: #8ce8ca; background: rgba(16, 185, 129, .06); }
.memory-context-chip.avoid { border-color: rgba(251, 113, 133, .18); color: #f6a1af; background: rgba(244, 63, 94, .05); }
.memory-context-chip.avoid strong { color: #f8b4bf; }
.memory-context-chip.pending { border-color: rgba(245, 158, 11, .18); color: #e8c875; background: rgba(245, 158, 11, .05); }
.personal-memory-card > footer { justify-content: space-between; gap: 10px; padding: 10px 12px; }
.personal-memory-meta { flex-wrap: wrap; gap: 6px 11px; color: var(--text-muted); font-size: 9px; }
.personal-memory-meta span { display: inline-flex; align-items: center; gap: 4px; }
.personal-memory-actions { flex: 0 0 auto; gap: 7px; }
.personal-memory-actions .btn { min-height: 34px !important; }
.personal-memory-empty { grid-column: 1 / -1; min-height: 210px; border: 1px dashed rgba(148, 163, 184, .16); border-radius: 9px; }
.personal-memory-archive { border-top: 1px solid rgba(148, 163, 184, .1); }
.personal-memory-archive > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 15px; color: var(--text-secondary); cursor: pointer; list-style: none; }
.personal-memory-archive > summary::-webkit-details-marker { display: none; }
.personal-memory-archive > summary > span { display: flex; align-items: center; gap: 7px; }
.personal-memory-archive > summary strong { font-size: 11px; }
.personal-memory-archive > summary small { color: var(--text-muted); font-size: 10px; font-weight: 400; }
.personal-memory-archive[open] > summary > svg { transform: rotate(180deg); }
.personal-memory-archive > div { padding: 0 13px 13px; }
.personal-memory-archive-row { padding: 10px 11px; border-top: 1px solid rgba(148, 163, 184, .09); color: var(--text-muted); }
.personal-memory-archive-row > div { display: grid; min-width: 0; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; }
.personal-memory-archive-row strong { color: var(--text-secondary); font-size: 10px; }
.personal-memory-archive-row span { color: #f2a6b2; font-size: 10px; }
.personal-memory-archive-row p { overflow: hidden; margin: 0; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }

.review-path-summary {
  margin: 0 18px 14px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 12px;
  background: rgba(15, 23, 42, .48);
}
.review-path-summary.is-complete { border-color: rgba(16, 185, 129, .2); }
.review-path-summary > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.review-path-summary h3 { margin: 3px 0 0; color: var(--text-primary); font-size: 14px; }
.review-path-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.review-path-metrics > div { display: grid; gap: 4px; padding: 10px; border: 1px solid rgba(148, 163, 184, .12); border-radius: 9px; background: rgba(30, 41, 59, .46); }
.review-path-metrics span { color: var(--text-muted); font-size: 10px; }
.review-path-metrics strong { color: var(--text-primary); font-family: var(--font-mono); font-size: 13px; }
.review-path-summary > footer { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; color: var(--text-secondary); font-size: 10px; }
.review-path-summary > footer span { padding: 5px 8px; border-radius: 999px; background: rgba(148, 163, 184, .08); }
@media (max-width: 760px) { .review-path-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 1100px) {
  .insight-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-item:nth-child(odd) { border-left: 0; }
  .insight-item:nth-child(n + 3) { border-top: 1px solid var(--calm-border); }
  .strategy-summary-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strategy-model-summary {
    grid-column: 1 / -1;
    border-top: 1px solid var(--calm-border);
    border-left: 0;
  }
  .strategy-essentials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-layout { grid-template-columns: minmax(260px, 292px) minmax(0, 1fr); }
  .review-assessment-grid { grid-template-columns: 1fr 1fr; }
  .review-outcome-summary { grid-column: 1 / -1; }
  .review-action-context { display: none; }
}

@media (max-width: 820px) {
  .calm-page-header,
  .compact-section-header,
  .execution-mode-row,
  .risk-status-card {
    align-items: stretch;
    flex-direction: column;
  }
  .risk-status-card { display: flex; }
  .strategy-control-header { align-items: stretch; flex-direction: column; gap: 12px; }
  .strategy-control-header .toolbar-actions { justify-content: space-between; }
  .risk-status-icon { width: 38px; height: 38px; }
  .manual-run-fields,
  .review-layout,
  .review-form-columns,
  .setting-switches { grid-template-columns: 1fr; }
  .manual-auto-execute { width: 100%; min-width: 0; }
  .review-queue { position: static; }
  .review-detail { position: static; }
  .review-outcome-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .platform-section-header { align-items: flex-start; flex-direction: column; }
  .platform-section-stats { justify-content: flex-start; }
  .personal-memory-header { align-items: flex-start; flex-direction: column; }
  .personal-memory-stats { justify-content: flex-start; }
  .personal-memory-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .model-strategy-shell,
  .inference-workspace,
  .workspace-page { gap: 13px; }
  .model-strategy-header .model-strategy-tabs { gap: 18px; }
  .strategy-summary-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strategy-summary-item:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--calm-border);
    border-left: 0;
  }
  .strategy-model-summary { grid-template-columns: 36px minmax(0, 1fr); }
  .strategy-model-summary .text-action { grid-column: 2; justify-self: start; padding-left: 0; }
  .insight-strip { grid-template-columns: 1fr 1fr; }
  .insight-item { min-height: 82px; padding: 13px; }
  .insight-item > strong { font-size: 15px; }
  .strategy-card { padding: 14px 14px 0; }
  .strategy-card-header { align-items: stretch; flex-direction: column; }
  .strategy-card-actions { justify-content: flex-start; }
  .strategy-essentials { grid-template-columns: 1fr; }
  .strategy-details { margin-inline: -14px; }
  .strategy-details-body { padding-inline: 14px; }
  .workspace-subtabs { width: 100%; }
  .workspace-subtabs button { flex: 1 0 auto; }
  .execution-mode-row { display: flex; }
  .manual-auto-execute { grid-template-columns: 1fr; }
  .mode-option { min-height: 36px; }
  .review-detail-header { align-items: flex-start; }
  .review-outcome-strip { grid-template-columns: 1fr; }
  .review-outcome-main,
  .review-outcome-metric { min-height: 68px; border-top: 1px solid rgba(148, 163, 184, .11); border-left: 0; }
  .review-outcome-main { border-top: 0; }
  .review-assessment-grid { grid-template-columns: 1fr; }
  .review-outcome-summary { grid-column: auto; }
  .review-form-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .review-actions { position: static; align-items: stretch; margin: 14px 0 0; padding: 12px; background: rgba(13, 20, 33, .88); }
  .review-action-buttons { display: grid; grid-template-columns: 1fr; width: 100%; }
  .review-actions .btn,
  .review-actions .text-action { width: 100%; justify-content: center; }
  .personal-memory-card > footer { align-items: stretch; flex-direction: column; }
  .personal-memory-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  #model-strategy *,
  #ai-analyze *,
  #model-compare *,
  #risk-center *,
  #review-memory * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.compare-results-body { max-height:65vh; overflow-y:auto; }
.compare-cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
.compare-card { border:1px solid var(--border-default); border-radius:var(--radius-lg); background:rgba(8,13,23,0.7); padding:16px; display:flex; flex-direction:column; gap:10px; }
.compare-card-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.compare-card-model { font-size:13px; font-weight:600; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.compare-card-provider { font-size:11px; color:var(--text-muted); }
.compare-card-direction { padding:3px 10px; border-radius:var(--radius-pill); font-size:12px; font-weight:700; text-transform:uppercase; }
.compare-card-direction.buy { background:rgba(34,197,94,0.15); color:#22c55e; }
.compare-card-direction.sell { background:rgba(239,68,68,0.15); color:#ef4444; }
.compare-card-direction.hold { background:rgba(234,179,8,0.15); color:#eab308; }
.compare-card-row { display:flex; justify-content:space-between; align-items:center; font-size:12px; }
.compare-card-row span:first-child { color:var(--text-muted); }
.compare-card-row span:last-child { color:var(--text-primary); font-weight:600; }
.compare-card-analysis { font-size:12px; color:var(--text-secondary); line-height:1.6; border-top:1px solid var(--border-default); padding-top:8px; white-space:pre-wrap; max-height:120px; overflow-y:auto; }
.compare-card-error { color:var(--status-danger); font-size:12px; text-align:center; padding:12px 0; }
.compare-summary-bar { display:flex; gap:12px; align-items:center; padding:8px 0; margin-bottom:10px; font-size:13px; color:var(--text-secondary); flex-wrap:wrap; }
.compare-summary-bar strong { color:var(--text-primary); }

.compare-page-body { margin:0; background:var(--bg-base); color:var(--text-primary); font-family:var(--font-ui); min-height:100vh; }
.compare-page-container { max-width:1200px; margin:0 auto; padding:var(--space-6) var(--space-6) var(--space-10); }
.compare-page-header { margin-bottom:var(--space-6); }
.compare-page-header h1 { font-size:24px; font-weight:700; margin:var(--space-2) 0 var(--space-1); }
.compare-page-subtitle { color:var(--text-secondary); font-size:14px; }
.compare-page-back { color:var(--gold-primary); font-size:13px; text-decoration:none; transition:color var(--transition-fast); }
.compare-page-back:hover { color:var(--gold-light); }

.compare-page-controls { background:var(--bg-surface); border:1px solid var(--border-default); border-radius:var(--radius-lg); padding:var(--space-6); margin-bottom:var(--space-6); }
.compare-form-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:var(--space-4); margin-bottom:var(--space-5); }
.compare-field label { display:block; font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:var(--space-1); }
.compare-field input,
.compare-field select { width:100%; padding:8px 12px; background:var(--bg-input); border:1px solid var(--border-default); border-radius:var(--radius-sm); color:var(--text-primary); font-size:13px; font-family:var(--font-ui); outline:none; transition:border-color var(--transition-fast); box-sizing:border-box; }
.compare-field input:focus,
.compare-field select:focus { border-color:var(--gold-primary); }

.compare-models-section { margin-bottom:var(--space-5); }
.compare-models-section > label { display:block; font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:var(--space-2); }
.cmp-hint { font-weight:400; color:var(--text-muted); margin-left:var(--space-2); }
.cmp-hint.active { color:var(--gold-primary); }
.cmp-model-checkboxes { display:flex; flex-wrap:wrap; gap:var(--space-3); }
.cmp-model-label { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; background:var(--bg-card); border:1px solid var(--border-default); border-radius:var(--radius-sm); cursor:pointer; transition:all var(--transition-fast); font-size:13px; }
.cmp-model-label:hover { border-color:var(--gold-dim); background:var(--bg-card-hover); }
.cmp-model-label:has(.cmp-model-cb:checked) { border-color:var(--gold-primary); background:rgba(212,175,55,0.08); }
.cmp-model-cb { accent-color:var(--gold-primary); }
.cmp-model-name { font-weight:500; color:var(--text-primary); }
.cmp-model-label small { color:var(--text-muted); font-size:11px; }
.cmp-loading-text, .cmp-empty { font-size:13px; color:var(--text-muted); }

.compare-actions { display:flex; align-items:center; gap:var(--space-4); }
.cmp-run-btn { display:inline-flex; align-items:center; gap:var(--space-2); padding:10px 28px; background:var(--gold-primary); color:#1a1a2e; border:none; border-radius:var(--radius-sm); font-size:14px; font-weight:700; cursor:pointer; transition:all var(--transition-fast); }
.cmp-run-btn:hover:not(:disabled) { background:var(--gold-light); box-shadow:var(--shadow-glow-gold); }
.cmp-run-btn:disabled { opacity:0.5; cursor:not-allowed; }
.cmp-status-text { font-size:13px; color:var(--text-secondary); }

.cmp-progress-bar { position:relative; height:32px; background:var(--bg-card); border:1px solid var(--border-default); border-radius:var(--radius-sm); overflow:hidden; margin-top:var(--space-4); }
.cmp-progress-fill { height:100%; background:linear-gradient(90deg,var(--gold-primary),var(--gold-light)); border-radius:var(--radius-sm); }
.cmp-progress-label { position:absolute; top:0; left:0; right:0; bottom:0; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; color:var(--text-primary); z-index:1; }

.compare-page-results { margin-top:var(--space-6); }
.cmp-summary-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:var(--space-3); margin-bottom:var(--space-5); }
.cmp-stat-card { background:var(--bg-surface); border:1px solid var(--border-default); border-radius:var(--radius-md); padding:var(--space-4); display:flex; flex-direction:column; align-items:center; gap:var(--space-1); }
.cmp-stat-value { font-size:18px; font-weight:700; color:var(--text-primary); text-align:center; word-break:break-word; }
.cmp-stat-label { font-size:11px; color:var(--text-muted); text-align:center; }
.cmp-stat-best .cmp-stat-value { color:var(--gold-primary); }

.cmp-meta-bar { font-size:12px; color:var(--text-secondary); margin-bottom:var(--space-3); padding:var(--space-2) 0; border-bottom:1px solid var(--border-subtle); }
.cmp-meta-bar strong { color:var(--text-primary); }

.cmp-results-table-wrap { overflow-x:auto; margin-bottom:var(--space-6); }
.cmp-table { width:100%; border-collapse:collapse; font-size:13px; }
.cmp-table th { padding:10px 12px; text-align:left; font-weight:600; color:var(--text-secondary); border-bottom:2px solid var(--border-default); white-space:nowrap; background:var(--bg-surface); position:sticky; top:0; }
.cmp-table td { padding:8px 12px; border-bottom:1px solid var(--border-subtle); color:var(--text-primary); white-space:nowrap; }
.cmp-table tbody tr:hover { background:rgba(212,175,55,0.04); }
.cmp-table td.positive { color:var(--color-positive); }
.cmp-table td.negative { color:var(--color-negative); }

.cmp-section-title { font-size:16px; font-weight:600; margin-bottom:var(--space-3); }
.cmp-legend { display:flex; flex-wrap:wrap; gap:var(--space-3); margin-bottom:var(--space-4); }
.cmp-legend-item { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--text-secondary); }
.cmp-legend-dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
.cmp-timeline-scroll { overflow-x:auto; }
.cmp-timeline-grid { min-width:400px; }
.cmp-tl-row { display:flex; align-items:center; padding:4px 0; border-bottom:1px solid var(--border-subtle); }
.cmp-tl-time { width:100px; flex-shrink:0; font-size:11px; font-family:var(--font-mono); color:var(--text-muted); padding-right:var(--space-3); }
.cmp-tl-cells { display:flex; gap:var(--space-2); flex:1; }
.cmp-tl-cell { width:28px; text-align:center; font-size:13px; font-weight:700; }
.cmp-tl-empty { color:var(--text-muted); opacity:0.3; }
.cmp-timeline-empty { padding:var(--space-6); text-align:center; color:var(--text-muted); font-size:13px; }

/* Impeccable usability pass: explicit controls, calm hierarchy and AA focus. */
.gateway-control,
.trade-permission-control {
  appearance: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.trade-permission-control.status-trade-active {
  color: var(--status-trading);
  background: var(--status-trading-bg);
  border-color: var(--status-trading-border);
}

.clickable-badge::after { display: none; }

:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.nav-item[aria-current="page"] {
  color: var(--gold-light);
}

.bridge-option-recommended {
  border-color: var(--status-connected) !important;
}

.signal-monitor-action span { display: none; }

.kline-toolbar {
  border-top-color: var(--border-subtle);
}

@media (max-width: 1180px) {
  .account-primary-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .app-layout {
    grid-template-rows: 92px 1fr;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 6px 14px;
    padding: 8px 16px;
  }

  .topbar-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .topbar-badges {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .topbar-badges .status-badge {
    max-width: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
  }

  .topbar {
    padding-top: max(var(--space-3), env(safe-area-inset-top));
  }

  .brand-copy small {
    display: none;
  }

  .brand-name {
    font-size: 14px;
  }

  .topbar-badges .status-badge {
    max-width: none;
  }

  .account-secondary-stats {
    grid-template-columns: 1fr;
  }

  .kline-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .kline-more-periods {
    align-items: flex-start;
    flex-direction: column;
  }

  .kline-more-periods > div {
    margin: 3px 0 0;
  }

  .status-badge,
  .kline-period-btn,
  .kline-more-periods summary {
    min-height: 44px;
  }

  .auto-runtime-control.is-progress {
    min-height: 44px;
  }

  .kline-period-btn {
    min-width: 44px;
  }

  .sym-input,
  .account-card details > summary {
    min-height: 44px;
  }

  .btn,
  .btn-sm,
  .icon-btn,
  .card-action-btn,
  .nav-item,
  .workspace-subtabs button,
  .review-period-tabs button,
  .review-status-tabs button,
  .pager button {
    min-height: 44px;
  }

  .icon-btn {
    min-width: 44px;
  }
}

@media (pointer: coarse) {
  .btn,
  .btn-sm,
  .icon-btn,
  .card-action-btn,
  .nav-item,
  .workspace-subtabs button,
  .review-period-tabs button,
  .review-status-tabs button,
  .pager button,
  .audit-result-text,
  select,
  summary {
    min-height: 44px;
  }

  .icon-btn {
    min-width: 44px;
  }
}

/* Core workspace typography: important guidance never falls below the caption tier. */
.brand-copy small {
  font-size: var(--type-caption);
}

.topbar-time span:last-child {
  color: var(--gold-light);
  font-size: var(--type-caption);
  transform: none;
}

/* 独立账户中心在实验室内以同源工作区弹窗呈现。 */
.account-center-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.account-center-modal.hidden { display: none; }

.account-center-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.76);
  backdrop-filter: blur(6px);
}

.account-center-dialog {
  position: relative;
  width: min(1180px, 96vw);
  height: min(820px, 92vh);
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 18px;
  background: var(--bg-base);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.account-center-dialog iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-base);
}

body.account-center-open { overflow: hidden; }

@media (max-width: 760px) {
  .account-center-modal { padding: 0; }
  .account-center-dialog {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

/* 运营中心 · 用户运行档案 */
.ops-runtime-controls { display:grid; grid-template-columns:minmax(240px,1fr) repeat(2,minmax(180px,.55fr)) auto; gap:12px; align-items:center; padding:16px 18px; border-bottom:1px solid var(--border-default); }
.ops-runtime-controls h3,.ops-detail-section h3 { margin:3px 0 4px; font-size:16px; color:var(--text-primary); }
.ops-runtime-controls p,.ops-detail-section .ops-section-heading p { margin:0; color:var(--text-muted); font-size:12px; }
.ops-control-switch { display:flex; align-items:center; gap:10px; min-height:56px; padding:10px 12px; border:1px solid var(--border-default); border-radius:10px; background:var(--bg-elevated); cursor:pointer; }
.ops-control-switch input,.ops-inline-switch input { width:17px; height:17px; accent-color:var(--accent-primary); flex:0 0 auto; }
.ops-control-switch span,.ops-control-switch strong,.ops-control-switch small { display:block; }
.ops-control-switch strong { color:var(--text-primary); font-size:13px; }
.ops-control-switch small { margin-top:2px; color:var(--text-muted); font-size:10px; }
.ops-control-switch.danger:has(input:checked) { border-color:color-mix(in srgb, var(--danger) 48%, var(--border-default)); background:color-mix(in srgb, var(--danger) 8%, var(--bg-elevated)); }
.ops-detail-section { padding:18px; border-bottom:1px solid var(--border-default); }
.ops-detail-section:last-child { border-bottom:0; }
.ops-account-list,.ops-subscription-list { display:grid; gap:12px; margin-top:14px; }
.ops-account-card { border:1px solid var(--border-default); border-radius:12px; background:var(--bg-elevated); overflow:hidden; }
.ops-account-card > header { display:flex; justify-content:space-between; gap:16px; padding:14px 16px; border-bottom:1px solid var(--border-default); }
.ops-account-card h4 { margin:2px 0; color:var(--text-primary); font-size:15px; }
.ops-account-card header p { margin:0; color:var(--text-muted); font-size:11px; }
.ops-account-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
.ops-account-metrics > div { min-width:0; padding:14px 16px; border-right:1px solid var(--border-default); }
.ops-account-metrics > div:last-child { border-right:0; }
.ops-account-metrics span,.ops-account-metrics small { display:block; color:var(--text-muted); font-size:10px; }
.ops-account-metrics strong { display:block; margin:6px 0 3px; color:var(--text-primary); font-size:15px; overflow-wrap:anywhere; }
.ops-account-sync { display:flex; flex-wrap:wrap; gap:8px 18px; padding:9px 16px; border-top:1px solid var(--border-default); color:var(--text-muted); font-size:10px; }
.ops-detail-editor { border-top:1px solid var(--border-default); }
.ops-detail-editor > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; cursor:pointer; list-style:none; }
.ops-detail-editor > summary::-webkit-details-marker { display:none; }
.ops-detail-editor > summary > span { display:flex; align-items:center; gap:8px; }
.ops-detail-editor > summary strong,.ops-detail-editor > summary small { display:block; }
.ops-detail-editor > summary strong { color:var(--text-primary); font-size:12px; }
.ops-detail-editor > summary small { color:var(--text-muted); font-size:10px; }
.ops-detail-editor[open] > summary > svg:last-child { transform:rotate(180deg); }
.ops-risk-editor { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; padding:0 16px 14px; }
.ops-risk-editor label { display:grid; grid-template-columns:minmax(130px,1fr) minmax(120px,.7fr); gap:10px; align-items:center; padding:8px 0; border-bottom:1px solid var(--border-subtle); color:var(--text-secondary); font-size:11px; }
.ops-risk-editor label > span:first-child small { display:block; margin-top:2px; color:var(--text-muted); font-size:9px; }
.ops-detail-actions { display:flex; justify-content:flex-end; padding:0 16px 14px; }
.ops-subscription-row { display:grid; grid-template-columns:minmax(180px,1fr) minmax(190px,.8fr) auto auto; gap:12px; align-items:center; padding:12px 14px; border:1px solid var(--border-default); border-radius:10px; background:var(--bg-elevated); }
.ops-subscription-row > div strong,.ops-subscription-row > div span { display:block; }
.ops-subscription-row > div strong { color:var(--text-primary); font-size:13px; }
.ops-subscription-row > div span { margin-top:3px; color:var(--text-muted); font-size:10px; }
.ops-subscription-row select { min-width:0; }
.ops-inline-switch { display:flex; align-items:center; gap:6px; white-space:nowrap; color:var(--text-secondary); font-size:11px; }
.text-success { color:var(--success) !important; }
.text-danger { color:var(--danger) !important; }

@media (max-width:1100px) {
  .ops-runtime-controls { grid-template-columns:1fr 1fr; }
  .ops-runtime-controls > div:first-child { grid-column:1 / -1; }
  .ops-account-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ops-account-metrics > div:nth-child(2) { border-right:0; }
  .ops-account-metrics > div:nth-child(-n+2) { border-bottom:1px solid var(--border-default); }
  .ops-risk-editor { grid-template-columns:1fr; }
}

@media (max-width:680px) {
  .ops-runtime-controls { grid-template-columns:1fr; }
  .ops-runtime-controls > div:first-child { grid-column:auto; }
  .ops-account-metrics { grid-template-columns:1fr; }
  .ops-account-metrics > div { border-right:0; border-bottom:1px solid var(--border-default); }
  .ops-account-metrics > div:last-child { border-bottom:0; }
  .ops-risk-editor label { grid-template-columns:1fr; }
  .ops-subscription-row { grid-template-columns:1fr; }
  .ops-subscription-row .btn { width:100%; }
}

#ai-analyze .card-title {
  font-size: var(--type-body);
  font-weight: 700;
}

#ai-analyze :is(.signal-price-item span, .execution-targets > div > span, .take-profit-heading small, .take-profit-chip b, .analysis-experience-usage .analysis-section-title > span, .experience-usage-stats > span, .experience-used-list > span, .experience-used-list > strong) {
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  line-height: 1.5;
}

#ai-analyze :is(.execution-targets strong, .take-profit-chip strong) {
  font-size: var(--type-body);
}

#risk-center :is(.risk-rule-name small, .risk-inherited, .risk-boundary, .risk-system-note strong, .risk-system-note small) {
  font-size: var(--type-caption);
  line-height: 1.5;
}

#review-memory :is(.review-queue-hint, .review-queue .review-status-tabs button, .review-case-head .status-chip, .review-case-strategy, .review-case-metrics small, .review-case-metrics strong, .review-detail-header p, .review-outcome-strip small, .review-form-heading > small, .review-field > span, .review-confidence-field small, .review-action-context strong, .review-action-context small) {
  font-size: var(--type-caption);
  line-height: 1.5;
}

#review-memory .review-case-metrics strong {
  font-family: var(--font-mono);
  font-weight: 600;
}

#model-compare :is(.compare-model-copy strong, .compare-field select, .compare-field input, .compare-readonly-value) {
  font-size: var(--type-body);
}

#model-compare .compare-method-note p {
  max-width: 72ch;
  font-size: var(--type-body);
  line-height: 1.65;
}

.strategy-card::before {
  display: none;
}

.strategy-essentials > span {
  padding: 5px 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.strategy-essentials > span + span {
  border-left: 1px solid var(--border-subtle);
}

/* AI 复盘师 · 平台记忆治理 */
.platform-experience-policies,
.platform-experience-evaluation { margin: 0 0 12px; }
.platform-governance-card,
.platform-memory-library { overflow: hidden; border: 1px solid var(--border-default); border-radius: 12px; background: color-mix(in srgb, var(--bg-elevated) 92%, transparent); }
.platform-governance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 16px; border-bottom: 1px solid var(--border-subtle); }
.platform-governance-head h3 { margin: 3px 0 2px; color: var(--text-primary); font-size: 15px; }
.platform-governance-head p { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.platform-memory-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.platform-memory-summary span { padding: 6px 9px; border: 1px solid var(--border-subtle); border-radius: 8px; color: var(--text-muted); font-size: 10px; white-space: nowrap; background: var(--surface-2); }
.platform-memory-summary strong { color: var(--text-primary); font-family: var(--font-mono); }
.platform-policy-list { display: grid; gap: 8px; padding: 12px; }
.platform-policy-row { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(130px, .5fr) 100px 120px auto; align-items: end; gap: 10px; padding: 11px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--surface-2); }
.platform-policy-row label { display: grid; gap: 5px; color: var(--text-muted); font-size: 10px; }
.platform-policy-row :is(input, select) { width: 100%; min-height: 34px; }
.platform-policy-name { display: grid; align-self: center; min-width: 0; gap: 3px; }
.platform-policy-name strong { overflow: hidden; color: var(--text-primary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.platform-policy-name small { color: var(--text-muted); font-size: 9px; }
.platform-evaluation-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--border-subtle); }
.platform-evaluation-metrics > div { display: grid; gap: 4px; padding: 13px 15px; border-right: 1px solid var(--border-subtle); }
.platform-evaluation-metrics > div:last-child { border-right: 0; }
.platform-evaluation-metrics span,
.platform-evaluation-metrics small { color: var(--text-muted); font-size: 9px; }
.platform-evaluation-metrics strong { color: var(--text-primary); font-family: var(--font-mono); font-size: 17px; }
.platform-evaluation-breakdown { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 10px; }
.platform-evaluation-breakdown span { display: inline-flex; align-items: center; gap: 5px; }
.platform-evaluation-breakdown strong { color: var(--text-primary); font-family: var(--font-mono); }
.platform-strategy-evaluation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); }
.platform-strategy-evaluation > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--text-secondary); font-size: 10px; background: var(--bg-elevated); }
.platform-strategy-evaluation strong { color: var(--text-primary); font-family: var(--font-mono); }
.platform-memory-library > .memory-tier-tabs { margin-left: 13px; }
.platform-memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 13px 14px; }
.platform-memory-card { display: grid; align-content: start; overflow: hidden; border: 1px solid var(--border-default); border-radius: 10px; background: var(--surface-2); }
.platform-memory-card.is-candidate { border-color: color-mix(in srgb, var(--warning) 35%, var(--border-default)); }
.platform-memory-card.is-active { border-color: color-mix(in srgb, var(--success) 32%, var(--border-default)); }
.platform-memory-card > header,
.platform-memory-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; }
.platform-memory-card > header { border-bottom: 1px solid var(--border-subtle); }
.platform-memory-card > header > div { display: flex; align-items: center; min-width: 0; gap: 8px; }
.platform-memory-card > header strong { overflow: hidden; color: var(--text-primary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.memory-tier-mark { padding: 4px 6px; border-radius: 6px; color: var(--text-secondary); font-size: 9px; background: color-mix(in srgb, var(--accent-primary) 13%, transparent); }
.memory-tier-mark.long { color: var(--accent-primary); }
.platform-memory-card > p { min-height: 76px; margin: 0; padding: 12px; color: var(--text-primary); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.platform-memory-card > footer { align-items: flex-end; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 9px; }
.platform-memory-card > footer > div { display: flex; flex: 0 0 auto; gap: 7px; }
.platform-memory-archive { border-top: 1px solid var(--border-subtle); }
.platform-memory-archive > summary { padding: 13px 15px; color: var(--text-secondary); font-size: 11px; cursor: pointer; }
.platform-memory-archive > summary span { color: var(--text-muted); }
.platform-memory-archive > div { display: grid; gap: 7px; padding: 0 13px 13px; }
.platform-memory-archive article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-2); }
.platform-memory-archive article strong { color: var(--text-secondary); font-size: 10px; }
.platform-memory-archive article p { margin: 3px 0 0; color: var(--text-muted); font-size: 9px; }

@media (max-width: 980px) {
  .platform-policy-row { grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(100px, .45fr)); }
  .platform-policy-row .btn { grid-column: 1 / -1; justify-self: end; }
}

@media (max-width: 680px) {
  .platform-governance-head { flex-direction: column; }
  .platform-memory-summary { justify-content: flex-start; }
  .platform-policy-row,
  .platform-evaluation-metrics,
  .platform-strategy-evaluation,
  .platform-memory-grid { grid-template-columns: 1fr; }
  .platform-policy-row .btn { width: 100%; }
  .platform-evaluation-metrics > div { border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .platform-memory-card > footer,
  .platform-memory-archive article { align-items: stretch; flex-direction: column; }
  .platform-memory-card > footer > div { justify-content: flex-end; }
  .platform-evaluation-breakdown { flex-direction: column; gap: 7px; }
}

@media (max-width: 760px) {
  .audit-page-head .btn { width: 100%; justify-content: center; }
  .audit-records-head { align-items: stretch; flex-direction: column; padding: 15px 14px 12px; }
  .audit-records-head .record-count { align-self: flex-start; }
  .audit-filter-toolbar { align-items: stretch; flex-direction: column; padding: 12px 14px; }
  .audit-filter-toolbar label { min-width: 0; }
  .audit-table { min-width: 860px; }
  .audit-records-card > .pager { padding: 12px 14px 14px; }
}

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