:root {
  --bg: rgb(1 11 21);
  --panel-surface: rgb(12 22 32);
  --panel: var(--panel-surface);
  --panel-2: var(--panel-surface);
  --surface-glass: rgb(12 22 32 / 0.82);
  --surface-glass-strong: rgb(12 22 32 / 0.94);
  --line: rgba(70, 99, 128, 0.42);
  --line-soft: rgba(76, 99, 124, 0.22);
  --text: #e8eff8;
  --text-strong: #f5f8fc;
  --text-muted: #9aa7b8;
  --muted: var(--text-muted);
  --dim: #758394;
  --amber: #ffbd2e;
  --cyan: #67e8ff;
  --blue: #178bff;
  --violet: #a78bfa;
  --green: rgb(10 200 120);
  --red: rgb(250 100 50);
  --evidence-cyan: #67e8ff;
  --evidence-green: rgb(10 200 120);
  --signal-purple: #a78bfa;
  --risk-red: rgb(250 100 50);
  --accent-gradient: linear-gradient(135deg, rgba(103, 232, 255, 0.92), rgba(23, 139, 255, 0.76) 46%, rgba(167, 139, 250, 0.82));
  --success-gradient: linear-gradient(135deg, rgba(32, 211, 107, 0.92), rgba(103, 232, 255, 0.6));
  --warning-gradient: linear-gradient(135deg, rgba(255, 189, 46, 0.94), rgba(103, 232, 255, 0.44));
  --danger-gradient: linear-gradient(135deg, rgba(255, 79, 88, 0.92), rgba(255, 189, 46, 0.5));
  --shadow-deep: 0 18px 54px rgba(0, 0, 0, 0.42);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --font: "Inter", "Segoe UI", Arial, sans-serif;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --control-height: 34px;
  --control-border: rgba(83, 108, 135, 0.5);
  --control-border-soft: rgba(83, 108, 135, 0.32);
  --control-bg: rgba(8, 22, 36, 0.54);
  --control-bg-active: rgba(255, 189, 46, 0.1);
  --watch-card-bg: rgb(12 22 32 / 0.78);
  --watch-card-border: rgba(83, 108, 135, 0.38);
  --watch-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --watch-card-active-bg: rgb(11 36 83 / 0.84);
  --watch-card-active-border: rgba(45, 142, 255, 0.96);
  --watch-card-active-glow: 0 0 0 1px rgba(23, 139, 255, 0.32), 0 0 22px rgba(23, 139, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --watch-card-blur: blur(18px) saturate(150%);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: var(--font-regular);
  letter-spacing: 0;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.terminal-shell {
  min-height: 100vh;
  padding: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
}

.topbar {
  height: 42px;
  border: 1px solid rgba(38, 49, 61, 0.95);
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto 270px;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  background: #050b13;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 100%;
  padding-left: 0;
  color: #f7fbff;
  font-weight: 900;
  font-size: 18px;
}

.brand-mark {
  position: relative;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  color: #f7fbff;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-e2 {
  color: #2dff76;
  font-weight: 950;
}

.brand-e2 span {
  color: #ff4d57;
  font-size: 0.45em;
  vertical-align: super;
}

.brand-cn {
  color: #f5aa00;
}

.market-tape {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 260px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

.tape-item {
  color: #dce7f5;
}

.tape-item .up {
  color: var(--green);
}

.tape-item .down {
  color: var(--red);
}

.status-line {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  color: #b5c5d8;
  font-size: 12px;
}

.status-line strong {
  color: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: 72px minmax(820px, 1fr) 368px;
  gap: 10px;
  margin-top: 10px;
}

.watchlist-rail,
.right-column,
.main-column {
  min-height: calc(100vh - 82px);
}

.watchlist-rail {
  border: 1px solid var(--line);
  background: #090d12;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-title {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  font-weight: 900;
}

.watchlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.symbol-button,
.rail-button {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  background: #0a0f15;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.symbol-button.active,
.symbol-button:hover,
.rail-button:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(255, 174, 0, 0.08);
}

.rail-button:disabled {
  cursor: not-allowed;
  color: var(--dim);
  border-color: #1b2530;
  background: #070a0e;
}

.symbol-button.editing {
  border-style: dashed;
}

.watchlist-tools {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-button {
  height: 30px;
  color: #bed0e8;
  font-size: 10px;
}

.control-strip {
  height: 48px;
  border: 1px solid var(--line);
  background: #090d12;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto 130px;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

#symbolSelect {
  height: 30px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.timeframes {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: var(--control-height);
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: rgba(6, 17, 29, 0.5);
  overflow: visible;
}

.timeframes button {
  position: relative;
  height: 100%;
  min-width: 54px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--control-border-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
}

.timeframes button:first-child {
  border-radius: 5px 0 0 5px;
}

.timeframes button:last-child {
  border-right: 0;
  border-radius: 0 5px 5px 0;
}

.timeframes button.active {
  z-index: 2;
  height: calc(100% + 2px);
  margin: -1px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: var(--control-bg-active);
  color: var(--amber);
  box-shadow: 0 0 12px rgba(255, 189, 46, 0.16);
}

.timeframes button:hover:not(.active) {
  color: var(--text-strong);
  background: rgba(83, 108, 135, 0.12);
}

.tool,
.param {
  height: 30px;
  min-width: 46px;
  border: 1px solid var(--line);
  background: #0a0f15;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.tool.active,
.param.active {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(255, 174, 0, 0.08);
}

.param.active {
  border-color: #2f6072;
  color: var(--cyan);
}

.clock {
  height: 30px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: #b7c4d7;
  font-size: 12px;
}

.chart-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.chart-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.quote-box {
  text-align: right;
}

.quote-box strong {
  display: block;
  color: var(--green);
  font-size: 18px;
}

.quote-box span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.quote-box span.down {
  color: var(--red);
}

.quote-box small {
  color: var(--muted);
}

.quote-box em {
  display: block;
  margin-top: 3px;
  color: var(--cyan);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.chart-tools {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.tool-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool:not(.active),
.param:not(.active) {
  color: var(--dim);
  border-color: #1b2530;
  background: #070a0e;
}

.chart-action {
  height: 30px;
  min-width: 70px;
  border: 1px solid var(--green);
  background: rgba(0, 168, 67, 0.12);
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
}

.chart-action:hover {
  background: rgba(0, 168, 67, 0.2);
}

.chart-stage {
  position: relative;
  border: 1px solid var(--line);
  background: #06090d;
  width: 100%;
  overflow: hidden;
}

#priceChart {
  display: block;
  width: 100%;
  height: min(65vh, 720px);
  min-height: 560px;
  cursor: crosshair;
  touch-action: pan-y;
}

#priceChart.touch-panning {
  cursor: grabbing;
  touch-action: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 10;
  min-width: 190px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.3), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(0, 168, 67, 0.26), transparent 42%),
    linear-gradient(135deg, rgba(7, 17, 24, 0.58) 0%, rgba(5, 10, 16, 0.42) 48%, rgba(2, 7, 12, 0.62) 100%);
  color: var(--text);
  padding: 8px 10px;
  pointer-events: none;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.48),
    0 0 22px rgba(34, 211, 238, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 18px rgba(34, 211, 238, 0.05);
  font-size: 11px;
  line-height: 1.45;
  backdrop-filter: blur(10px) saturate(145%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}

.chart-tooltip b {
  display: block;
  margin-bottom: 4px;
  color: var(--amber);
}

.chart-tooltip span {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 8px;
}

.chart-tooltip i {
  color: var(--muted);
  font-style: normal;
}

.bottom-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.mini-panel,
.side-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px;
}

.watchlist-rail,
.forecast-panel,
.news-panel {
  background: rgb(44, 46, 61);
}

.terminal-shell {
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.08), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(167, 139, 250, 0.075), transparent 24%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
}

.topbar,
.control-strip,
.watchlist-rail,
.chart-card,
.side-panel,
.mini-panel {
  background: var(--surface-glass);
  border-color: var(--line);
  box-shadow: var(--shadow-inner), var(--shadow-deep);
  backdrop-filter: blur(18px);
}

.brand {
  letter-spacing: 0;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chart-card {
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 36%, rgba(245, 185, 66, 0.045));
}

.chart-tools {
  position: relative;
  z-index: 1;
  gap: 8px;
}

.tool-group {
  align-items: center;
  background: rgba(5, 9, 18, 0.48);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 5px;
}

.tool-group-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 0 5px;
}

.tool,
.param,
.chart-action {
  border-radius: 6px;
  box-shadow: var(--shadow-inner);
}

.tool.active,
.param.active {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.09));
  border-color: rgba(34, 211, 238, 0.56);
  color: #b8f7ff;
}

.evidence-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(8, 13, 24, 0.88));
  box-shadow: var(--shadow-inner);
}

.evidence-card strong {
  font-size: 24px;
  line-height: 1;
}

.evidence-card .confidence {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.evidence-card .confidence i {
  display: block;
  height: 100%;
  background: var(--accent-gradient);
}

.evidence-reasons {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.panel-title {
  font-size: 12px;
  font-weight: 950;
  margin-bottom: 10px;
}

.options-metrics {
  display: grid;
  grid-template-columns: 1.45fr 1.25fr 1.15fr;
  gap: 8px;
}

.metric-box,
.risk-box,
.phase-box {
  border: 1px solid var(--line);
  padding: 8px;
  min-height: 52px;
  background: #0a0f15;
}

.metric-box small,
.risk-box small,
.phase-box small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.metric-box strong,
.risk-box strong,
.phase-box strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.warn {
  color: var(--amber);
}

.meter-row {
  margin-top: 9px;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.meter-row div {
  height: 4px;
  background: #14202a;
}

.meter-row i {
  display: block;
  height: 4px;
  background: var(--green);
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forecast-row,
.impact-row,
.factor-row,
.news-row {
  display: grid;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 0;
  font-size: 12px;
}

.forecast-row {
  grid-template-columns: 68px 1fr 44px;
}

.impact-row {
  grid-template-columns: 58px 96px 1fr;
}

.factor-row {
  grid-template-columns: 1fr 50px 48px;
}

.news-row {
  grid-template-columns: 42px 1fr 46px;
}

.forecast-row b,
.impact-row b,
.factor-row b {
  font-size: 12px;
}

.badge {
  border: 1px solid #304156;
  color: #b8c7db;
  padding: 4px 6px;
  text-align: center;
  font-size: 11px;
  background: #0b1016;
}

.risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.phase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.phase-box.active {
  border-color: var(--green);
}

.phase-notes {
  margin-top: 10px;
  color: #c6d4e8;
  font-size: 11px;
  line-height: 1.6;
}

.factor-radar {
  display: grid;
  gap: 4px;
}

.news-panel {
  flex: 1;
}

.news-feed {
  display: grid;
  gap: 0;
}

.news-row time {
  color: var(--amber);
  font-weight: 900;
}

.news-row p {
  margin: 0;
  line-height: 1.35;
}

.news-row span {
  color: var(--muted);
  text-align: right;
  font-size: 10px;
}

.disclaimer {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 1280px) {
  body {
    min-width: 1180px;
  }

  .workspace {
    grid-template-columns: 220px minmax(720px, 1fr) 292px;
    gap: 8px;
  }

  .watchlist-rail {
    width: auto;
  }

  .right-column {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .terminal-shell {
    padding: 8px;
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .brand {
    font-size: 13px;
  }

  .market-tape {
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .status-line {
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
  }

  .watchlist-rail,
  .right-column,
  .main-column {
    min-height: 0;
  }

  .watchlist-rail {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 8px;
  }

  .rail-title {
    min-width: 74px;
    text-align: left;
  }

  .watchlist {
    flex-direction: row;
    gap: 6px;
  }

  .symbol-button {
    width: 52px;
    min-width: 52px;
    height: 38px;
  }

  .watchlist-tools {
    margin-top: 0;
    margin-left: auto;
    flex-direction: row;
    gap: 6px;
  }

  .rail-button {
    width: 44px;
    min-width: 44px;
    height: 32px;
  }

  .control-strip {
    height: auto;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #symbolSelect {
    width: 100%;
  }

  .timeframes,
  #drawingTools,
  #indicatorTools {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .timeframes button,
  .tool,
  .param {
    min-width: 42px;
    height: 32px;
  }

  .clock {
    justify-self: stretch;
  }

  .chart-card {
    margin-top: 8px;
    padding: 8px;
  }

  .chart-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chart-header p {
    line-height: 1.45;
  }

  .quote-box {
    text-align: left;
  }

  .chart-tools {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  #indicatorTools {
    grid-column: 1 / -1;
  }

  .chart-action {
    min-width: 62px;
  }

  .chart-stage {
    touch-action: pan-y;
  }

  #priceChart {
    height: 58vh;
    min-height: 460px;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .options-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .right-column {
    grid-column: auto;
    min-height: 0;
  }

  .risk-grid {
    grid-template-columns: 1fr 1fr;
  }

  .phase-grid {
    grid-template-columns: 1fr;
  }

  .forecast-row,
  .impact-row,
  .factor-row,
  .news-row {
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .status-line {
    display: none;
  }

  #priceChart {
    height: 60vh;
    min-height: 430px;
  }

  .forecast-row {
    grid-template-columns: 60px 1fr 40px;
  }

  .impact-row {
    grid-template-columns: 52px 80px 1fr;
  }

  .options-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Reference terminal shell: dense TradingView-style workstation */
:root {
  --terminal-glow: 0 0 22px rgba(103, 232, 255, 0.16), 0 0 54px rgba(23, 139, 255, 0.12);
  --terminal-border: rgba(70, 99, 128, 0.42);
  --terminal-border-soft: rgba(76, 99, 124, 0.24);
  --terminal-fill: rgba(4, 15, 26, 0.92);
  --terminal-fill-2: rgba(7, 22, 36, 0.88);
  --terminal-card: rgb(12 22 32 / 0.78);
}

body {
  min-width: 1180px;
  background:
    radial-gradient(circle at 50% -12%, rgba(15, 79, 132, 0.35), transparent 38%),
    radial-gradient(circle at 12% 10%, rgba(103, 232, 255, 0.08), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(32, 211, 107, 0.055), transparent 28%),
    var(--bg);
}

.terminal-shell {
  min-height: 100vh;
  padding: 0;
  background:
    linear-gradient(90deg, rgba(75, 105, 134, 0.08) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(180deg, rgba(75, 105, 134, 0.065) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
}

.topbar {
  height: 42px;
  grid-template-columns: minmax(250px, 1fr) auto 270px;
  gap: 16px;
  border: 1px solid rgba(55, 79, 103, 0.46);
  padding: 0 12px;
  background: rgb(1 11 21 / 0.82);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 100%;
  padding-left: 0;
  color: #f4f9ff;
  font-size: 18px;
}

.brand-mark {
  position: relative;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  color: #f7fbff;
  box-shadow: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  color: #f7fbff;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-e2 {
  color: #2dff76;
  font-weight: 950;
}

.brand-e2 span {
  color: #ff4d57;
  font-size: 0.45em;
  vertical-align: super;
}

.brand-cn {
  color: #f5aa00;
}

.brand em {
  padding: 3px 6px;
  border: 1px solid rgba(55, 67, 83, 0.9);
  border-radius: 4px;
  color: #d4dce7;
  background: #0b121d;
  font-size: 10px;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
}

.global-search-shell {
  position: relative;
  width: 100%;
  max-width: 270px;
  justify-self: end;
}

.global-search {
  height: 28px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid rgba(76, 99, 124, 0.42);
  border-radius: 5px;
  background: rgba(8, 22, 36, 0.74);
  color: #aab8c9;
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.global-search:focus-within {
  border-color: rgba(103, 232, 255, 0.54);
  background: rgba(10, 29, 47, 0.88);
  box-shadow: none;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: #b6c4d6;
  filter: none;
}

.global-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f6f8fb;
  font-size: 11px;
  font-weight: 500;
}

.global-search input::placeholder {
  color: #8d99a8;
  font-weight: 650;
}

.global-search kbd {
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8f9cac;
  font: 700 10px var(--font);
  letter-spacing: 0;
  box-shadow: none;
}

.topbar .status-line {
  display: flex;
}

.topbar .market-tape {
  display: none;
}

.global-search kbd span:first-child {
  font-size: 14px;
  line-height: 1;
  transform: translateY(-1px);
}

.global-search kbd span:last-child {
  font-size: 12px;
}

.symbol-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid rgba(67, 86, 111, 0.74);
  border-radius: 10px;
  background: #0b121d;
  box-shadow: none;
}

.symbol-search-option {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(76, 99, 124, 0.22);
  background: transparent;
  color: var(--text);
  font: 12px var(--font);
  text-align: left;
  cursor: pointer;
}

.symbol-search-option:last-child {
  border-bottom: 0;
}

.symbol-search-option:hover,
.symbol-search-option:focus-visible {
  outline: 0;
  background: rgba(34, 132, 255, 0.15);
}

.symbol-search-option strong {
  color: var(--cyan);
  font-size: 14px;
}

.symbol-search-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.symbol-search-option small,
.symbol-search-note {
  color: #8fa3ba;
  font-size: 11px;
}

.symbol-search-note {
  padding: 10px 12px;
}

.status-line {
  align-items: center;
  justify-self: end;
  gap: 10px;
  color: #8793a2;
  font-size: 11px;
  white-space: nowrap;
}

.status-line select,
.top-icon {
  height: 23px;
  border: 1px solid var(--terminal-border-soft);
  border-radius: 5px;
  background: rgba(9, 18, 29, 0.8);
  color: #c6d4e6;
  font-size: 11px;
}

.ai-mode-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 25px 4px 9px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.22);
  color: #9df7ff;
  font-size: 11px;
  line-height: 1;
}

.ai-mode-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #a7fbff;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.85);
  transform: translateY(-50%);
}

.top-icon.active {
  border-color: rgba(59, 130, 246, 0.8);
  color: #60a5fa;
}

.event-preview-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 5px;
  border: 1px solid rgba(77, 96, 122, 0.52);
  border-radius: 6px;
  background: rgba(7, 16, 27, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.event-preview-controls span {
  padding: 0 4px 0 2px;
  color: #7f94ae;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.event-preview-controls button {
  display: grid;
  width: 23px;
  height: 22px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #8ca0b7;
  font-size: 10px;
  font-weight: 800;
}

.event-preview-controls button:hover {
  border-color: rgba(91, 116, 149, 0.65);
  color: #d5e4f5;
}

.event-preview-controls button.active {
  border-color: rgba(34, 211, 238, 0.58);
  background: rgba(34, 211, 238, 0.14);
  color: #9df7ff;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}

.market-open {
  color: var(--green);
}

.market-open-closed {
  color: var(--red);
}

.market-open-pre,
.market-open-post {
  color: var(--amber);
}

.market-open-pending,
.market-open-fallback {
  color: #8da0b8;
}

.data-trust-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(141, 160, 184, 0.28);
  border-radius: 6px;
  color: #a9b8c9;
  background: rgba(12, 18, 25, 0.58);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.data-trust-status::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.data-trust-status.trust-fact {
  color: #6aa263;
  border-color: rgba(106, 162, 99, 0.4);
}

.data-trust-status.trust-delayed {
  color: #d69538;
  border-color: rgba(214, 149, 56, 0.4);
}

.data-trust-status.trust-model {
  color: #e0b658;
  border-color: rgba(224, 182, 88, 0.4);
}

.data-trust-status.trust-fallback {
  color: #8da0b8;
}

.workspace {
  height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: 220px minmax(760px, 1fr) 300px;
  gap: 6px;
  margin-top: 5px;
}

.site-footer {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px 4px;
  color: #6f8196;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
}

.watchlist-rail,
.ai-intelligence,
.mini-panel,
.chart-card,
.chart-command-bar {
  border: 1px solid var(--terminal-border-soft);
  background: var(--terminal-card);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.watchlist-rail {
  position: relative;
  min-height: 0;
  padding: 8px;
  background: rgb(1 11 21);
  overflow: hidden;
}

.watchlist-header,
.watchlist-actions,
.ai-header,
.watchlist-tabs,
.watchlist-table-head {
  display: flex;
  align-items: center;
}

.watchlist-header {
  justify-content: space-between;
  margin-bottom: 8px;
}

.rail-title,
.rail-button,
.watchlist-tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: #d7e4f3;
}

.rail-title {
  width: auto;
  height: 24px;
  font-size: 12px;
  text-align: left;
}

.rail-button {
  width: 24px;
  height: 24px;
  font-size: 16px;
}

.watchlist-sort-button {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.watchlist-sort-dots {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transform: translate(-50%, -50%);
}

.watchlist-sort-dot {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.watchlist-sort-menu {
  position: absolute;
  z-index: 20;
  top: 36px;
  right: 8px;
  width: 168px;
  overflow: hidden;
  border: 1px solid rgba(62, 78, 99, 0.9);
  border-radius: 6px;
  background: #09111b;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

.watchlist-sort-menu button {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(62, 78, 99, 0.36);
  background: transparent;
  color: #b8c6d7;
  font-size: 11px;
  text-align: left;
}

.watchlist-sort-menu button:last-child {
  border-bottom: 0;
}

.watchlist-sort-menu button:hover,
.watchlist-sort-menu button.active {
  color: #e7f8ff;
  background: rgba(34, 132, 255, 0.16);
}

.watchlist-tabs {
  height: 28px;
  border: 1px solid var(--terminal-border-soft);
  border-radius: 5px;
  background: rgba(9, 23, 36, 0.82);
  overflow: hidden;
}

.watchlist-tabs button {
  flex: 1;
  height: 100%;
  font-size: 11px;
  color: #8497ad;
}

.watchlist-tabs .active {
  background: linear-gradient(180deg, rgba(38, 82, 110, 0.9), rgba(15, 42, 61, 0.82));
  color: #e5f6ff;
}

.watchlist-table-head {
  display: grid;
  grid-template-columns: 1fr 58px 52px;
  margin: 12px 4px 6px;
  color: #8799ad;
  font-size: 11px;
}

.watchlist {
  min-height: 0;
  max-height: calc(100vh - 264px);
  overflow: hidden auto;
  gap: 4px;
}

.symbol-button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 50px;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--watch-card-border);
  border-radius: 6px;
  background: var(--watch-card-bg);
  backdrop-filter: var(--watch-card-blur);
  -webkit-backdrop-filter: var(--watch-card-blur);
  box-shadow: var(--watch-card-shadow);
  text-align: left;
}

.symbol-button.active {
  border-color: var(--watch-card-active-border);
  background: var(--watch-card-active-bg);
  box-shadow: var(--watch-card-active-glow);
}

.symbol-button:not(.active):hover {
  border-color: rgba(83, 108, 135, 0.54);
  background: rgb(12 22 32 / 0.88);
}

.symbol-meta {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 40px;
  overflow: hidden;
}

.symbol-meta strong,
.symbol-last,
.symbol-change {
  display: block;
  font-size: 12px;
}

.symbol-last small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #7d8fa5;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.symbol-meta strong,
.symbol-meta small {
  position: relative;
  z-index: 1;
}

.symbol-meta small {
  display: block;
  margin-top: 2px;
  color: #96a4b7;
  font-size: 10px;
  line-height: 1.16;
  white-space: normal;
}

.symbol-button.active .symbol-meta strong {
  color: var(--amber);
}

.symbol-button:not(.active) .symbol-meta strong {
  color: var(--text-strong);
}

.symbol-last {
  color: #e6eef8;
  text-align: right;
}

.symbol-spark {
  position: absolute;
  z-index: 0;
  right: 0;
  top: 50%;
  display: block;
  width: 76px;
  height: 25px;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-50%);
  opacity: 0.72;
}

.symbol-spark::before {
  content: "";
  position: absolute;
  inset: 2px 0;
  background:
    linear-gradient(180deg, rgba(34, 197, 94, 0.26), transparent 74%),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(148, 163, 184, 0.14) 5px 6px);
  clip-path: polygon(0 68%, 16% 52%, 31% 58%, 48% 34%, 66% var(--spark-shift, 40%), 82% 22%, 100% 12%, 100% 100%, 0 100%);
  opacity: 0.8;
}

.symbol-spark i {
  position: absolute;
  inset: 2px 0;
  border-top: 1.5px solid var(--green);
  filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.55));
  clip-path: polygon(0 70%, 16% 54%, 31% 60%, 48% 36%, 66% var(--spark-shift, 40%), 82% 24%, 100% 14%, 100% 24%, 82% 34%, 66% calc(var(--spark-shift, 40%) + 10%), 48% 46%, 31% 70%, 16% 64%, 0 80%);
}

.symbol-spark.down::before {
  background:
    linear-gradient(180deg, rgba(248, 113, 113, 0.22), transparent 74%),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(148, 163, 184, 0.14) 5px 6px);
  clip-path: polygon(0 22%, 16% 38%, 31% 32%, 48% 56%, 66% var(--spark-shift, 54%), 82% 70%, 100% 78%, 100% 100%, 0 100%);
}

.symbol-spark.down i {
  border-color: var(--red);
  filter: drop-shadow(0 0 5px rgba(248, 113, 113, 0.5));
  clip-path: polygon(0 24%, 16% 40%, 31% 34%, 48% 58%, 66% var(--spark-shift, 54%), 82% 72%, 100% 80%, 100% 90%, 82% 82%, 66% calc(var(--spark-shift, 54%) + 10%), 48% 68%, 31% 44%, 16% 50%, 0 34%);
}

.symbol-change {
  color: var(--green);
  text-align: right;
}

.symbol-change.down {
  color: var(--red);
}

.watchlist-edit {
  width: 100%;
  height: 28px;
  border-color: var(--terminal-border-soft);
  border-radius: 5px;
  color: #8ea4ba;
  font-size: 11px;
}

.watchlist-edit-stack {
  position: relative;
  margin-top: 8px;
  padding-top: 0;
  transition: padding-top 160ms ease;
}

.watchlist-rail.editing .watchlist-edit-stack {
  padding-top: 38px;
}

.watchlist-add-float {
  position: absolute;
  left: 50%;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(45, 255, 118, 0.78);
  border-radius: 6px;
  background: rgba(6, 18, 14, 0.92);
  color: #69ff9c;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(0.94);
  box-shadow:
    inset 0 1px 0 rgba(188, 255, 209, 0.12),
    0 0 0 1px rgba(45, 255, 118, 0.12),
    0 0 18px rgba(45, 255, 118, 0.28);
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.watchlist-rail.editing .watchlist-add-float {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  animation: watchlistAddPulse 1.8s ease-in-out infinite;
}

.watchlist-add-float:hover {
  color: #eafff0;
  border-color: rgba(103, 255, 156, 0.96);
  background: rgba(7, 30, 19, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(218, 255, 231, 0.18),
    0 0 0 1px rgba(45, 255, 118, 0.2),
    0 0 24px rgba(45, 255, 118, 0.42);
}

@keyframes watchlistAddPulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(188, 255, 209, 0.12),
      0 0 0 1px rgba(45, 255, 118, 0.12),
      0 0 16px rgba(45, 255, 118, 0.24);
  }

  50% {
    box-shadow:
      inset 0 1px 0 rgba(218, 255, 231, 0.2),
      0 0 0 1px rgba(45, 255, 118, 0.22),
      0 0 28px rgba(45, 255, 118, 0.46);
  }
}

.market-overview {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--terminal-border-soft);
}

.market-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.market-row {
  --market-core-stroke: url("#market-green-core");
  --market-under-stroke: url("#market-green-under");
  --market-area-fill: url("#market-green-area");
  --market-pocket-fill: url("#market-green-pocket");
  --market-shadow-stroke: #173823;
  --market-value-color: rgba(88, 190, 105, 0.92);
  --market-value-glow: rgba(72, 168, 94, 0.22);
  display: grid;
  grid-template-columns: 58px minmax(74px, 1fr) 54px;
  gap: 7px;
  align-items: center;
  min-height: 58px;
  padding: 0 1px;
  border-bottom: 1px solid rgba(101, 126, 151, 0.23);
  color: #dce7f5;
}

.market-row:last-child {
  border-bottom: 0;
}

.market-row.down {
  --market-core-stroke: url("#market-red-core");
  --market-under-stroke: url("#market-red-under");
  --market-area-fill: url("#market-red-area");
  --market-pocket-fill: transparent;
  --market-shadow-stroke: #4b211d;
  --market-value-color: rgba(218, 87, 70, 0.94);
  --market-value-glow: rgba(218, 87, 70, 0.22);
}

.market-symbol {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.market-symbol strong {
  color: rgba(235, 242, 250, 0.92);
  font-size: 15px;
  line-height: 1;
  font-weight: 850;
}

.market-value,
.market-change {
  color: var(--market-value-color);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1;
  font-weight: 780;
  text-shadow: 0 0 9px var(--market-value-glow);
}

.market-change {
  justify-self: end;
  font-weight: 850;
}

.market-spark {
  width: 100%;
  height: 39px;
  overflow: visible;
}

.market-pocket {
  fill: var(--market-pocket-fill);
  opacity: 0.45;
  filter: blur(2.6px);
  transform: translateY(2.3px);
}

.market-terrain {
  fill: var(--market-area-fill);
  opacity: 0.39;
  filter: blur(1.7px);
}

.market-terrain-tight {
  fill: var(--market-area-fill);
  opacity: 0.43;
  filter: blur(0.7px);
}

.market-under-glow {
  fill: none;
  stroke: var(--market-under-stroke);
  stroke-width: 9.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.42;
  filter: blur(3.35px);
  transform: translateY(3.5px);
}

.market-under-shadow {
  fill: none;
  stroke: var(--market-shadow-stroke);
  stroke-width: 4.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.4;
  filter: blur(1.18px);
  transform: translateY(2.35px);
}

.market-core-halo {
  fill: none;
  stroke: var(--market-core-stroke);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.22;
  filter: blur(0.7px);
}

.market-core {
  fill: none;
  stroke: var(--market-core-stroke);
  stroke-width: 2.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 1px 0 rgba(3, 11, 9, 0.84))
    drop-shadow(0 0 2px rgba(112, 198, 112, 0.23));
}

.market-row.down .market-core {
  filter:
    drop-shadow(0 1px 0 rgba(13, 5, 5, 0.78))
    drop-shadow(0 0 2px rgba(221, 84, 67, 0.22));
}

.main-column {
  min-height: 0;
  container-type: inline-size;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) minmax(112px, auto);
  gap: 6px;
}

.chart-command-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(180px, clamp(180px, 18cqw, 260px)) 30px auto minmax(150px, 1fr) 58px;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
}

.menu-button,
.chart-action,
.tool,
.param {
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--control-bg);
  color: var(--text-muted);
}

.menu-button,
.chart-action {
  display: grid;
  place-items: center;
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  line-height: 1;
}

.favorite-button {
  display: grid;
  place-items: center;
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8b98aa;
  line-height: 1;
}

.favorite-star-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(139, 152, 170, 0.1));
}

.chart-action {
  width: auto;
  min-width: 58px;
  padding: 0 12px;
  font-size: 11px;
}

#symbolSelect {
  width: 100%;
  height: var(--control-height);
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: rgba(7, 16, 27, 0.82);
  color: var(--text-strong);
}

.timeframes {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: var(--control-height);
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: rgba(6, 17, 29, 0.5);
  overflow: visible;
}

.param {
  height: var(--control-height);
  font-size: 11px;
}

.timeframes button {
  position: relative;
  height: 100%;
  min-width: 54px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--control-border-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
}

.timeframes button:first-child {
  border-radius: 5px 0 0 5px;
}

.timeframes button:last-child {
  border-right: 0;
  border-radius: 0 5px 5px 0;
}

.timeframes button.active {
  z-index: 2;
  height: calc(100% + 2px);
  margin: -1px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: var(--control-bg-active);
  color: var(--amber);
  box-shadow: 0 0 12px rgba(255, 189, 46, 0.16);
}

.timeframes button:hover:not(.active) {
  color: var(--text-strong);
  background: rgba(83, 108, 135, 0.12);
}

.favorite-button.can-add:hover {
  border-color: transparent;
  background: transparent;
  color: var(--amber);
}

.command-indicators {
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow: hidden;
}

.command-indicators .tool-group-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.command-indicators .param {
  min-width: 42px;
  padding: 0 8px;
  white-space: nowrap;
}

.chart-workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 0;
}

.vertical-drawing-bar {
  --rail-icon-muted: #c7ced7;
  --rail-icon-active: #a6dcff;
  --rail-node-fill: rgba(5, 13, 22, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: clamp(72px, 18vh, 190px);
  border: 1px solid rgba(44, 60, 77, 0.88);
  border-right: 0;
  border-radius: 7px 0 0 7px;
  background:
    linear-gradient(180deg, rgba(12, 25, 39, 0.99), rgba(6, 15, 25, 0.98)),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08), transparent 24%, transparent 78%, rgba(3, 8, 15, 0.48));
  box-shadow:
    inset -1px 0 0 rgba(148, 163, 184, 0.075),
    inset 1px 0 0 rgba(255, 255, 255, 0.03),
    0 18px 36px rgba(0, 0, 0, 0.22);
}

.reference-rail-style {
  overflow: hidden;
}

.vertical-drawing-bar .tool-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 5px;
}

.rail-signal-tools {
  padding-top: 0;
}

.tool-section {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  justify-content: center;
  justify-items: center;
  padding: 12px 1px 13px;
  border-bottom: 1px solid rgba(54, 73, 94, 0.58);
}

.tool-section::before {
  content: none;
  position: absolute;
  inset: 0 2px;
  border-radius: 4px;
  background: rgba(6, 15, 24, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(184, 225, 255, 0.035),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.vertical-drawing-bar .tool-group-label {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  color: #b7c0ca;
  font-size: 9px;
  font-weight: 800;
  text-align: left;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.52);
}

.vertical-drawing-bar .tool {
  position: relative;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--rail-icon-muted);
  box-shadow: none;
  isolation: isolate;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.vertical-drawing-bar .tool:not(.active):hover {
  border-color: rgba(236, 244, 255, 0.18);
  color: #eefbff;
  background: rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 12px rgba(255, 255, 255, 0.04);
}

.vertical-drawing-bar .tool.active {
  border-color: transparent;
  color: var(--rail-icon-active);
  background: transparent;
  box-shadow: none;
}

.vertical-drawing-bar .tool.active::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(82, 169, 255, 0.42), rgba(82, 169, 255, 0.16) 38%, transparent 68%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

.vertical-drawing-bar .tool.active:hover {
  border-color: rgba(91, 177, 255, 0.48);
  color: #c4e9ff;
  background:
    radial-gradient(circle at 50% 50%, rgba(83, 174, 255, 0.18), transparent 56%),
    rgba(20, 47, 77, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(181, 225, 255, 0.16),
    0 0 20px rgba(51, 143, 255, 0.18);
}

.tool.active .tool-icon {
  filter:
    drop-shadow(0 0 2px rgba(180, 226, 255, 0.98))
    drop-shadow(0 0 7px rgba(71, 163, 255, 0.88))
    drop-shadow(0 0 15px rgba(33, 118, 255, 0.6));
}

.tool-icon {
  position: relative;
  display: block;
  width: 25px;
  height: 25px;
  color: currentColor;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.7px;
  z-index: 1;
}

.tool-icon .tool-dash {
  stroke-dasharray: 3 2.5;
}

.tool-icon .tool-node {
  fill: var(--rail-node-fill);
  stroke: currentColor;
}

.tool-icon .tool-glow-dot {
  fill: var(--rail-node-fill);
  stroke: currentColor;
  filter: none;
}

.tool-icon .tool-glow-line {
  stroke: currentColor;
  filter: none;
}

.tool-icon .tool-fill {
  fill: rgba(199, 206, 215, 0.035);
}

.tool-icon::before,
.tool-icon::after,
.tool-icon i,
.tool-icon i::before,
.tool-icon i::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.icon-trend i {
  left: 2px;
  top: 9px;
  width: 16px;
  border-top: 1.6px solid currentColor;
  transform: rotate(-34deg);
  transform-origin: left center;
}

.icon-trend::before,
.icon-trend::after {
  width: 4px;
  height: 4px;
  border: 1.4px solid currentColor;
  border-radius: 50%;
}

.icon-trend::before {
  left: 1px;
  bottom: 3px;
}

.icon-trend::after {
  right: 1px;
  top: 3px;
}

.icon-arrow i {
  left: 3px;
  top: 10px;
  width: 13px;
  border-top: 1.6px solid currentColor;
  transform: rotate(-39deg);
  transform-origin: left center;
}

.icon-arrow::after {
  right: 2px;
  top: 2px;
  width: 7px;
  height: 7px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
}

.icon-path::before {
  left: 1px;
  top: 9px;
  width: 17px;
  border-top: 1.5px dashed currentColor;
  transform: rotate(-17deg);
}

.icon-path i,
.icon-path i::before,
.icon-path i::after {
  width: 4px;
  height: 4px;
  border: 1.3px solid currentColor;
  border-radius: 50%;
}

.icon-path i {
  left: 1px;
  bottom: 4px;
}

.icon-path i::before {
  left: 6px;
  top: -6px;
}

.icon-path i::after {
  left: 13px;
  top: -3px;
}

.icon-fib::before {
  inset: 3px 2px;
  background: repeating-linear-gradient(180deg, currentColor 0 1.3px, transparent 1.3px 4px);
  opacity: 0.94;
}

.icon-fib::after {
  left: 2px;
  right: 2px;
  top: 9px;
  border-top: 1px dashed rgba(125, 211, 252, 0.76);
}

.icon-fib-channel i,
.icon-fib-channel::before,
.icon-fib-channel::after {
  width: 16px;
  border-top: 1.5px solid currentColor;
  transform: rotate(-26deg);
  transform-origin: left center;
}

.icon-fib-channel i {
  left: 2px;
  top: 6px;
}

.icon-fib-channel::before {
  left: 2px;
  top: 10px;
  opacity: 0.76;
}

.icon-fib-channel::after {
  left: 2px;
  top: 14px;
  opacity: 0.52;
}

.icon-zone::before {
  inset: 4px 2px;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), transparent);
}

.icon-zone::after {
  left: 5px;
  right: 5px;
  top: 9px;
  border-top: 1px dashed currentColor;
  opacity: 0.7;
}

.icon-elliott i,
.icon-elliott i::before,
.icon-elliott i::after,
.icon-elliott::before,
.icon-elliott::after {
  width: 4px;
  height: 4px;
  border: 1.2px solid currentColor;
  border-radius: 50%;
}

.icon-elliott i {
  left: 1px;
  bottom: 4px;
}

.icon-elliott i::before {
  left: 4px;
  top: -8px;
}

.icon-elliott i::after {
  left: 8px;
  top: -2px;
}

.icon-elliott::before {
  right: 4px;
  top: 3px;
}

.icon-elliott::after {
  right: 1px;
  bottom: 5px;
}

.icon-evidence::before {
  inset: 4px;
  border: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.icon-evidence::after {
  left: 8px;
  top: 8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.icon-events::before {
  left: 4px;
  top: 3px;
  bottom: 2px;
  border-left: 1.5px solid currentColor;
}

.icon-events::after {
  left: 6px;
  top: 4px;
  width: 10px;
  height: 7px;
  border: 1.4px solid currentColor;
  border-left: 0;
  background: rgba(34, 211, 238, 0.12);
}

.icon-flow::before {
  left: 2px;
  right: 2px;
  top: 9px;
  border-top: 1.5px solid currentColor;
}

.icon-flow i,
.icon-flow i::before,
.icon-flow i::after {
  bottom: 3px;
  width: 3px;
  background: currentColor;
}

.icon-flow i {
  left: 4px;
  height: 6px;
}

.icon-flow i::before {
  left: 5px;
  height: 11px;
}

.icon-flow i::after {
  left: 10px;
  height: 8px;
}

.icon-risk::before {
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 12px;
  border: 1.4px solid currentColor;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.icon-risk::after {
  left: 9px;
  top: 8px;
  height: 5px;
  border-left: 1.4px solid currentColor;
}

.icon-td::before {
  inset: 3px;
  border: 1.4px solid currentColor;
  border-radius: 50%;
}

.icon-td::after {
  left: 8px;
  top: 5px;
  height: 9px;
  border-left: 1.4px solid currentColor;
  transform: rotate(24deg);
}

.icon-range::before,
.icon-range::after {
  left: 3px;
  right: 3px;
  border-top: 1.4px solid currentColor;
}

.icon-range::before {
  top: 5px;
}

.icon-range::after {
  bottom: 5px;
}

.icon-range i {
  left: 8px;
  top: 5px;
  height: 9px;
  border-left: 1.4px dashed currentColor;
}

.chart-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
}

.chart-header {
  min-height: 54px;
  align-items: center;
  margin: 0;
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--terminal-border-soft);
  background: rgba(6, 14, 24, 0.72);
}

h1 {
  font-size: 13px;
}

.chart-header p {
  font-size: 11px;
}

.mobile-chart-shell {
  display: none;
}

.mobile-chart-title-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: 6px;
}

.mobile-chart-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.06;
  font-weight: var(--font-regular);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-chart-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--control-bg);
  color: #bdc8d7;
}

.mobile-chart-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-ohlc-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--green);
  font-size: 10.5px;
  line-height: 1;
  font-weight: var(--font-medium);
  white-space: nowrap;
}

.mobile-ohlc-strip span {
  color: var(--text-strong);
  font-weight: var(--font-regular);
}

.mobile-ohlc-strip .down {
  color: var(--red);
}

.quote-box strong {
  font-size: 15px;
}

.chart-stage {
  min-height: 0;
  border: 0;
  background:
    linear-gradient(90deg, rgba(36, 58, 82, 0.16) 1px, transparent 1px) 0 0 / 58px 58px,
    linear-gradient(180deg, rgba(36, 58, 82, 0.13) 1px, transparent 1px) 0 0 / 58px 58px,
    rgba(3, 13, 22, 0.96);
}

#priceChart {
  height: 100%;
  min-height: 0;
}

.ai-intelligence {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  overflow: hidden auto;
}

.ai-header {
  justify-content: flex-start;
  height: 28px;
}

.panel-title {
  color: #dce9f7;
  font-size: 11px;
  letter-spacing: 0;
}

.evidence-card {
  position: relative;
  min-height: 134px;
  margin: 0;
  padding: 13px 14px;
  border-radius: 6px;
  border-color: var(--terminal-border-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 38%),
    rgba(7, 17, 27, 0.86);
}

.evidence-card-top {
  display: block;
  max-width: calc(100% - 126px);
}

.evidence-micro-instrument {
  position: absolute;
  width: 112px;
  height: 84px;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  justify-self: end;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #91a4ba;
  overflow: visible;
}

.evidence-score,
.confidence-meta,
.evidence-card > .confidence,
.evidence-reasons {
  max-width: calc(100% - 126px);
}

.evidence-micro-instrument:focus-visible {
  outline: 1px solid rgba(34, 211, 238, 0.7);
  outline-offset: 2px;
}

.micro-chart {
  position: absolute;
  inset: 12px 0 0;
  width: 100%;
  height: calc(100% - 12px);
}

.micro-status {
  position: absolute;
  top: 2px;
  left: 8px;
  z-index: 2;
  color: #9fb0c2;
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.micro-info-dot {
  position: absolute;
  top: 0;
  right: 4px;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(141, 160, 184, 0.68);
  border-radius: 50%;
  color: #9eb0c4;
  font-size: 8px;
  line-height: 11px;
  text-align: center;
}

.micro-track,
.micro-ring,
.micro-spoke {
  fill: none;
  stroke: rgba(111, 130, 150, 0.34);
  stroke-width: 1.2;
}

.micro-segment {
  fill: none;
  stroke: rgba(111, 130, 150, 0.22);
  stroke-width: 6;
  stroke-linecap: butt;
}

.micro-segment.is-active.risk,
.micro-risk-field,
.micro-alert-node {
  stroke: rgba(241, 62, 58, 0.92);
}

.micro-segment.is-active.risk {
  stroke: rgba(241, 62, 58, 0.82);
}

.micro-segment.is-active.watch,
.micro-pulse {
  stroke: rgba(255, 174, 0, 0.92);
  fill: rgba(255, 174, 0, 0.26);
}

.micro-segment.is-active.buy {
  stroke: rgba(34, 197, 94, 0.78);
}

.micro-segment.is-active.stale {
  stroke: rgba(111, 130, 150, 0.5);
}

.micro-baseline,
.micro-vwap-tick,
.micro-anchor {
  stroke: rgba(34, 211, 238, 0.9);
}

.micro-vwap-tick {
  stroke-width: 1.4;
}

.micro-core,
.micro-event-core {
  fill: rgba(34, 211, 238, 0.25);
  stroke: rgba(34, 211, 238, 0.92);
  stroke-width: 1.1;
}

.micro-threshold {
  fill: none;
  stroke: rgba(255, 174, 0, 0.72);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.micro-risk-field {
  fill: rgba(241, 62, 58, 0.22);
  stroke-width: 1.1;
}

.micro-alert-node {
  fill: rgba(241, 62, 58, 0.86);
  stroke-width: 1;
}

.micro-needle {
  stroke: rgba(233, 241, 250, 0.9);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.micro-decay {
  fill: none;
  stroke: rgba(167, 139, 250, 0.44);
  stroke-width: 1.1;
  stroke-dasharray: 5 5;
}

.micro-event-node circle {
  stroke-width: 1.1;
}

.micro-event-node.is-active circle {
  fill: rgba(167, 139, 250, 0.48);
  stroke: rgba(167, 139, 250, 0.95);
}

.micro-event-node.is-stale circle {
  fill: rgba(111, 130, 150, 0.34);
  stroke: rgba(111, 130, 150, 0.58);
}

.micro-event-node text,
.micro-label {
  fill: #91a4ba;
  font-size: 7px;
  letter-spacing: 0;
}

.micro-flow-gauge .micro-status,
.micro-shakeout-radar .micro-status {
  color: var(--red);
}

.micro-pressure-gauge .micro-status {
  color: var(--amber);
}

.micro-event-orbit .micro-status {
  color: #a78bfa;
}

.evidence-card.watch .micro-flow-gauge .micro-status,
.evidence-card.watch .micro-shakeout-radar .micro-status {
  color: var(--amber);
}

.evidence-card.moderate .micro-flow-gauge .micro-status,
.evidence-card.strong .micro-flow-gauge .micro-status {
  color: var(--green);
}

.micro-tooltip {
  position: absolute;
  top: 18px;
  right: 100px;
  z-index: 5;
  display: grid;
  gap: 3px;
  min-width: 72px;
  padding: 6px 7px;
  border: 1px solid rgba(70, 89, 110, 0.8);
  border-radius: 5px;
  background: rgba(8, 17, 29, 0.96);
  color: #c9d7e8;
  font-size: 8px;
  line-height: 1.2;
  opacity: 0;
  transform: translateX(4px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.micro-tooltip::after {
  content: "";
  position: absolute;
  top: 16px;
  right: -5px;
  width: 8px;
  height: 8px;
  border-top: 1px solid rgba(70, 89, 110, 0.8);
  border-right: 1px solid rgba(70, 89, 110, 0.8);
  background: rgba(8, 17, 29, 0.96);
  transform: rotate(45deg);
}

.evidence-micro-instrument:hover .micro-tooltip,
.evidence-micro-instrument:focus-visible .micro-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.evidence-score {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  margin-top: 6px;
}

.evidence-score strong {
  font-size: 32px;
  line-height: 1;
}

.evidence-score span {
  color: var(--green);
}

.evidence-card.weak .evidence-score strong,
.evidence-card.weak .evidence-score span {
  color: var(--red);
}

.evidence-card.watch .evidence-score strong,
.evidence-card.watch .evidence-score span {
  color: var(--amber);
}

.confidence-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: #94a8bd;
  font-size: 10px;
}

.confidence-meta span {
  color: #94a8bd;
}

.confidence-meta b {
  color: #d7e6f6;
}

.confidence {
  height: 7px;
  margin: 10px 0 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(111, 130, 150, 0.26) 0 8px, transparent 8px 12px);
}

.confidence-segments {
  height: 8px;
  margin-top: 5px;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(9, 16, 27, 0.42), rgba(9, 16, 27, 0.1)),
    repeating-linear-gradient(90deg, rgba(111, 130, 150, 0.34) 0 7px, transparent 7px 11px);
}

.confidence i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.evidence-card.watch .confidence i {
  background: linear-gradient(90deg, var(--amber), #facc15);
}

.evidence-card.weak .confidence i {
  background: linear-gradient(90deg, var(--red), #fb7185);
}

.evidence-reasons {
  gap: 4px;
}

.evidence-reasons small {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 3px 6px;
  border: 1px solid var(--terminal-border-soft);
  border-radius: 4px;
  background: rgba(16, 31, 47, 0.8);
  color: #b4c2d2;
  font-size: 9px;
}

.news-panel,
.options-panel {
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  background: rgba(7, 17, 27, 0.7);
}

.news-row {
  grid-template-columns: 42px 1fr 42px;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--terminal-border-soft);
}

.news-row p {
  font-size: 10px;
}

.event-ledger {
  display: grid;
  gap: 0;
}

.event-row {
  display: grid;
  grid-template-columns: 54px 48px minmax(0, 1fr) 34px;
  gap: 5px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--terminal-border-soft);
  color: #aebdd0;
  font-size: 10px;
}

.event-row time {
  color: #8fa4bb;
  line-height: 1.15;
}

.event-form {
  color: var(--amber);
  font-weight: 800;
}

.event-row p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #d8e5f3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-row strong {
  color: #7dd3fc;
  text-align: right;
  font-size: 10px;
}

.event-row strong.up {
  color: var(--green);
}

.trade-desk {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(78px, auto);
  align-content: start;
  gap: 6px;
}

.mini-panel {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  overflow: hidden;
}

.ai-summary-body {
  color: #b7c9dd;
  font-size: 12px;
  line-height: 1.7;
}

.ai-summary-body strong {
  color: var(--green);
}

.trade-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 58px;
  margin-top: 10px;
  border: 1px solid var(--terminal-border-soft);
  border-radius: 6px;
  overflow: hidden;
}

.trade-stats div {
  display: grid;
  place-content: center;
  gap: 5px;
  border-right: 1px solid var(--terminal-border-soft);
  color: #8ea3ba;
  font-size: 10px;
}

.trade-stats div:last-child {
  border-right: 0;
}

.trade-stats strong {
  color: var(--green);
  font-size: 15px;
}

.trade-plan-grid {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 6px;
  justify-content: start;
  align-items: start;
}

.trade-plan .forecast-row {
  grid-template-columns: minmax(72px, 0.85fr) minmax(64px, 1fr) 52px;
  gap: 8px;
  min-height: 15px;
  padding: 0;
  border-bottom: 0;
  font-size: 11px;
}

.trade-plan .forecast-row,
.trade-plan .trade-stats div {
  min-height: 16px;
  padding: 1px 0 2px;
  border-bottom: 1px solid rgba(123, 148, 180, 0.12);
  line-height: 1.15;
}

.trade-plan .forecast-row:last-child,
.trade-plan .trade-stats div:last-child {
  border-bottom: 0;
}

.trade-plan .forecast-row b,
.trade-plan .forecast-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-plan .forecast-row .badge {
  padding: 1px 3px;
  font-size: 9px;
}

.trade-plan .trade-stats {
  height: auto;
  margin-top: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  overflow: visible;
}

.trade-plan .trade-stats div {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(72px, 1fr);
  place-content: initial;
  align-items: center;
  gap: 8px;
  border-right: 0;
  color: #93a7bd;
  font-size: 11px;
}

.trade-plan .trade-stats strong {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

@media (max-width: 1840px) {
  .trade-plan-grid {
    column-gap: 8px;
  }

  .trade-plan .trade-stats {
    gap: 3px;
  }

  .trade-plan .trade-stats div {
    grid-template-columns: 40px minmax(0, 34px);
    gap: 2px;
    font-size: 9px;
    line-height: 1;
  }

  .trade-plan .trade-stats strong {
    font-size: 10px;
    line-height: 1;
  }

  .trade-plan .trade-stats span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
  }

  .trade-plan .forecast-row {
    grid-template-columns: 56px minmax(30px, 1fr) 28px;
    gap: 3px;
    font-size: 10px;
  }

  .trade-plan .forecast-row .badge {
    padding: 1px 2px;
    font-size: 8px;
  }
}

.entry-rows,
.position-rows {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.entry-panel-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.entry-rows {
  gap: 4px;
  margin-top: 0;
}

.entry-rows div,
.position-rows div {
  display: grid;
  grid-template-columns: 84px 1fr;
  color: #93a7bd;
  font-size: 11px;
}

.entry-rows div {
  grid-template-columns: 62px minmax(0, 1fr);
}

.entry-rows strong,
.position-rows strong {
  color: #eef6ff;
  text-align: right;
}

.entry-rows strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-rows {
  display: grid;
  gap: 4px;
  margin-top: 0;
}

.risk-rows div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  color: #93a7bd;
  font-size: 11px;
}

.risk-rows strong {
  min-width: 0;
  color: #eef6ff;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-rows strong,
.risk-rows strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

/* Reference typography pass: lighter weights with cool grey text tones. */
body {
  font-weight: var(--font-regular);
}

.brand,
.brand-title {
  color: var(--text-strong);
  font-weight: var(--font-semibold);
}

.brand-e2,
.brand-cn {
  font-weight: var(--font-semibold);
}

.brand em,
.global-search input,
.global-search input::placeholder,
.global-search kbd,
.status-line,
.status-line select,
.top-icon,
.ai-mode-toggle,
.data-trust-status,
.rail-button,
.watchlist-tabs button,
.symbol-button,
.timeframes button,
.param,
.chart-action,
.event-row,
.trade-plan .forecast-row,
.trade-stats div,
.entry-rows div,
.position-rows div,
.risk-rows div,
.ai-summary-body {
  font-weight: var(--font-regular);
}

.rail-title {
  color: var(--text-strong);
  font-weight: var(--font-medium);
}

.symbol-meta strong {
  color: var(--text-strong);
  font-weight: var(--font-medium);
}

.symbol-meta small {
  color: #96a4b7;
  font-weight: var(--font-regular);
}

.symbol-last {
  color: var(--text-strong);
  font-weight: var(--font-regular);
}

.symbol-change,
.timeframes button.active,
.param.active,
.trade-stats strong,
.trade-plan .trade-stats strong,
.entry-rows strong,
.position-rows strong,
.risk-rows strong,
.event-form,
.event-row strong {
  font-weight: var(--font-medium);
}

.timeframes button,
.param {
  font-weight: var(--font-regular);
}

h1,
.panel-title,
.mini-panel h3 {
  color: var(--text-strong);
  font-weight: var(--font-medium);
}

.chart-header p,
.watchlist-table-head,
.trade-plan .trade-stats div,
.entry-rows div,
.position-rows div,
.risk-rows div {
  color: var(--text-muted);
}

@media (max-width: 1280px) {
  .topbar {
    height: 42px;
    grid-template-columns: minmax(240px, 1fr) auto 270px;
    gap: 14px;
  }

  .brand {
    padding-left: 0;
    gap: 8px;
  }

  .brand-mark {
    width: 23px;
    height: 23px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand em {
    font-size: 10px;
  }

  .global-search-shell {
    max-width: 270px;
  }

  .global-search {
    height: 28px;
    grid-template-columns: 18px minmax(0, 1fr) 34px;
    gap: 8px;
    padding: 0 8px;
  }

  .search-icon {
    width: 18px;
    height: 18px;
  }

  .global-search input {
    font-size: 11px;
  }

  .global-search kbd {
    height: 18px;
    font-size: 10px;
  }

  .workspace {
    grid-template-columns: 220px minmax(720px, 1fr) 292px;
    gap: 6px;
  }

  .chart-command-bar {
    grid-template-columns: 30px 180px 30px auto minmax(120px, 1fr) 58px;
  }

  .command-indicators .param:nth-of-type(n+6) {
    display: none;
  }

  .trade-plan-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 0;
  }

  .trade-plan .trade-stats {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .trade-plan .trade-stats div {
    grid-template-columns: 40px minmax(0, 34px);
    gap: 2px;
    font-size: 9px;
    line-height: 1;
  }

  .trade-plan .trade-stats strong {
    text-align: right;
    font-size: 10px;
    line-height: 1;
  }

  .trade-plan .trade-stats span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
  }

  .trade-plan .forecast-row {
    grid-template-columns: 57px minmax(31px, 1fr) 23px;
    gap: 3px;
    font-size: 10px;
  }

  .trade-plan .forecast-row .badge {
    padding: 1px 2px;
    font-size: 8px;
  }
}

@media (max-width: 1180px) and (min-width: 901px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar {
    height: 42px;
    grid-template-columns: 230px minmax(220px, 1fr) 240px;
    gap: 10px;
  }

  .brand em,
  .status-line > span:first-of-type {
    display: none;
  }

  .workspace {
    grid-template-columns: 190px minmax(500px, 1fr) 280px;
  }

  .watchlist-table-head {
    grid-template-columns: 1fr 50px 42px;
  }

  .symbol-button {
    grid-template-columns: minmax(0, 1fr) 50px 42px;
  }

  .market-row {
    grid-template-columns: 52px minmax(58px, 1fr) 48px;
    gap: 6px;
  }

  .market-symbol strong {
    font-size: 13px;
  }

  .market-value,
  .market-change {
    font-size: 10px;
  }

  .command-indicators .param:nth-of-type(n+4) {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar {
    height: 42px;
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    gap: 8px;
  }

  .brand {
    font-size: 18px;
  }

  .brand em,
  .market-tape,
  #clock,
  .status-line > span:first-of-type {
    display: none;
  }

  .global-search-shell,
  .global-search {
    max-width: none;
  }

  .global-search {
    height: 28px;
    grid-template-columns: 18px minmax(0, 1fr) 34px;
  }

  .search-icon {
    width: 18px;
    height: 18px;
  }

  .status-line {
    gap: 6px;
  }

  .workspace {
    grid-template-columns: 140px minmax(360px, 1fr) 190px;
    gap: 4px;
  }

  .watchlist-rail,
  .ai-intelligence {
    padding: 6px;
  }

  .watchlist-table-head {
    grid-template-columns: 1fr 42px 40px;
    font-size: 9px;
  }

  .symbol-button {
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .symbol-last,
  .symbol-change {
    display: none;
  }

  .market-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 6px;
    min-height: 72px;
    padding: 5px 0;
  }

  .market-symbol {
    gap: 4px;
  }

  .market-symbol strong {
    font-size: 13px;
  }

  .market-value,
  .market-change {
    font-size: 10px;
  }

  .market-spark {
    grid-column: 1 / -1;
    height: 34px;
  }

  .chart-command-bar {
    grid-template-columns: 28px minmax(140px, 160px) auto minmax(0, 1fr);
    gap: 4px;
  }

  .chart-action,
  .command-indicators .param:nth-of-type(n+4) {
    display: none;
  }

  .timeframes button {
    min-width: 25px;
    padding: 0 4px;
  }

  .chart-workbench {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .vertical-drawing-bar .tool {
    width: 20px;
    min-width: 20px;
    height: 20px;
  }

  .trade-desk {
    gap: 6px;
  }

  .options-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .terminal-shell {
    padding: 6px 8px 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 8px;
    padding: 8px 4px 6px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .brand {
    height: auto;
  }

  .brand-title {
    font-size: 18px;
  }

  .status-line,
  .global-search-shell,
  .global-search {
    width: 100%;
  }

  .status-line {
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .global-search {
    height: 38px;
    grid-template-columns: 20px minmax(0, 1fr) 34px;
    border-color: rgba(76, 99, 124, 0.42);
    border-radius: 8px;
    background: rgba(8, 22, 36, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  }

  .global-search:focus-within {
    border-color: rgba(103, 232, 255, 0.58);
    background: rgba(10, 29, 47, 0.88);
  }

  .workspace {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 4px;
    overflow: visible;
  }

  .watchlist-rail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 8px 10px;
    overflow: hidden;
  }

  .watchlist-header {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0;
    padding: 0 2px;
  }

  .watchlist-tabs {
    display: none;
  }

  .watchlist {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 8px;
    max-height: none;
    padding: 0 2px 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .watchlist::-webkit-scrollbar {
    display: none;
  }

  .watchlist-table-head,
  .market-overview,
  .watchlist-edit {
    display: none;
  }

  .symbol-button {
    position: relative;
    width: auto;
    min-width: 0;
    min-height: 94px;
    flex: 0 0 clamp(124px, 32vw, 152px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 36px 16px 16px;
    grid-template-areas:
      "meta"
      "price"
      "change";
    row-gap: 4px;
    align-content: start;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--watch-card-border);
    background: var(--watch-card-bg);
    overflow: hidden;
    scroll-snap-align: start;
  }

  .symbol-button.active {
    border-color: var(--watch-card-active-border);
    background: var(--watch-card-active-bg);
    box-shadow: var(--watch-card-active-glow);
  }

  .symbol-meta {
    grid-area: meta;
    position: static;
    display: grid;
    align-content: start;
    gap: 2px;
    min-height: 36px;
    overflow: visible;
  }

  .symbol-meta strong {
    font-size: 16px;
    font-weight: var(--font-medium);
    line-height: 18px;
  }

  .symbol-button.active .symbol-meta strong {
    color: var(--amber);
  }

  .symbol-meta small {
    max-width: 100%;
    min-height: 13px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: var(--font-regular);
    line-height: 13px;
    white-space: nowrap;
  }

  .symbol-last {
    grid-area: price;
    display: block;
    max-width: calc(100% - 68px);
    margin-top: 0;
    color: var(--text-strong);
    font-size: 11.5px;
    font-weight: var(--font-regular);
    line-height: 16px;
    text-align: left;
    white-space: nowrap;
  }

  .symbol-last small {
    display: none;
  }

  .symbol-change {
    grid-area: change;
    display: block;
    max-width: calc(100% - 68px);
    margin-top: 0;
    padding-left: 0;
    font-size: 12px;
    font-weight: var(--font-medium);
    line-height: 16px;
    text-align: left;
    white-space: nowrap;
  }

  .symbol-spark {
    top: auto;
    right: 10px;
    bottom: 10px;
    width: 58px;
    height: 25px;
    transform: none;
  }

  .vertical-drawing-bar {
    display: none;
  }

  .main-column {
    grid-template-rows: auto auto auto;
    gap: 8px;
    overflow: visible;
  }

  .chart-command-bar {
    display: none;
  }

  #symbolSelect {
    min-width: 0;
  }

  .favorite-button {
    display: grid;
    width: 28px;
    height: 28px;
    justify-self: end;
  }

  .timeframes {
    grid-column: auto;
    width: 100%;
    height: 28px;
    overflow: visible;
    scrollbar-width: none;
  }

  .timeframes button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
  }

  .timeframes button.active {
    height: calc(100% + 2px);
    margin: -1px;
  }

  .timeframes::-webkit-scrollbar {
    display: none;
  }

  .command-indicators {
    display: none;
  }

  .command-indicators::-webkit-scrollbar {
    display: none;
  }

  .chart-workbench {
    grid-template-columns: 1fr;
  }

  .chart-card {
    grid-template-rows: auto minmax(148px, clamp(148px, 38vw, 188px));
    min-height: 234px;
    margin-top: 0;
    padding: 10px;
    border-radius: 8px;
  }

  .chart-header {
    min-height: auto;
    padding: 0 0 6px;
    border-bottom: 0;
    background: transparent;
  }

  .chart-header-copy {
    display: none;
  }

  .mobile-chart-shell {
    display: grid;
    gap: 6px;
  }

  .mobile-chart-title-row {
    grid-template-columns: minmax(0, 1fr) 28px 28px;
  }

  .mobile-ohlc-strip {
    font-size: 10.5px;
    white-space: nowrap;
  }

  .chart-header p,
  .event-preview-controls {
    display: none;
  }

  .quote-box {
    display: none;
  }

  .quote-box small,
  .quote-box em {
    display: none;
  }

  .chart-stage {
    min-height: 148px;
    height: clamp(148px, 38vw, 188px);
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(90deg, rgba(68, 89, 113, 0.26) 1px, transparent 1px) 0 0 / 54px 100%,
      linear-gradient(180deg, rgba(68, 89, 113, 0.22) 1px, transparent 1px) 0 0 / 100% 24px,
      rgba(3, 13, 22, 0.96);
  }

  #priceChart {
    height: 100%;
    min-height: 148px;
    touch-action: pan-y;
  }

  .trade-desk {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    align-content: start;
    gap: 8px;
    min-height: auto;
  }

  .mini-panel {
    min-height: auto;
    overflow: visible;
  }

  .trade-plan-grid,
  .entry-panel-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .trade-plan .trade-stats div,
  .risk-rows div {
    grid-template-columns: minmax(82px, 1fr) minmax(0, 1fr);
  }

  .ai-intelligence {
    max-height: none;
    overflow: visible;
  }
}

@container (max-width: 679px) {
  .trade-desk {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(78px, auto);
  }
}

@container (min-width: 680px) {
  .trade-desk {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(96px, auto);
  }
}

@container (max-width: 1199px) {
  .trade-plan-grid {
    grid-template-columns: minmax(186px, 1.35fr) minmax(128px, 0.85fr);
    column-gap: 10px;
  }

  .trade-plan .forecast-row {
    grid-template-columns: 72px minmax(48px, 1fr) 40px;
    gap: 5px;
    font-size: 10px;
  }

  .trade-plan .forecast-row .badge {
    padding: 1px 3px;
    font-size: 8px;
  }

  .trade-plan .trade-stats div {
    grid-template-columns: 68px minmax(54px, 1fr);
    gap: 4px;
    font-size: 10px;
    line-height: 1.1;
  }

  .trade-plan .trade-stats strong {
    font-size: 10px;
    line-height: 1.1;
  }
}

@container (min-width: 1200px) {
  .trade-desk {
    grid-template-columns: minmax(240px, 23fr) minmax(320px, 28fr) minmax(350px, 32fr) minmax(170px, 15fr);
    grid-auto-rows: minmax(112px, auto);
    gap: 8px;
  }

  .trade-plan-grid {
    column-gap: 16px;
  }

  .trade-plan .forecast-row {
    grid-template-columns: minmax(72px, 0.85fr) minmax(64px, 1fr) 52px;
    gap: 8px;
    font-size: 11px;
  }

  .trade-plan .forecast-row .badge {
    padding: 1px 3px;
    font-size: 9px;
  }

  .trade-plan .trade-stats {
    gap: 4px;
  }

  .trade-plan .trade-stats div {
    grid-template-columns: minmax(86px, 1fr) minmax(72px, 1fr);
    gap: 8px;
    font-size: 11px;
    line-height: 1.15;
  }

  .trade-plan .trade-stats strong {
    font-size: 11px;
    line-height: 1.15;
  }
}
