:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #eef2f6;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e1ea;
  --line-soft: #edf1f5;
  --chart-bg: transparent;
  --chart-grid: rgba(148, 163, 184, 0.22);
  --chart-text: #667085;
  --spark-bg: #fafbfd;
  --blue: #1267db;
  --blue-soft: #eaf2ff;
  --red: #d92d2d;
  --red-soft: #fff0f0;
  --rise-color: #d92d2d;
  --fall-color: #1267db;
  --rise-soft: #fff0f0;
  --fall-soft: #eaf2ff;
  --green: #168a55;
  --dark: #050b12;
  --layer-bg: #ffffff;
  --layer-ink: #0f172a;
  --layer-muted: #475569;
  --layer-soft: #f8fafc;
  --layer-line: #cbd5e1;
}

body[data-theme="dark"] {
  --bg: #111821;
  --panel: #222b36;
  --panel-2: #1c2430;
  --panel-3: #2a3441;
  --ink: #f1f5f9;
  --muted: #a2adba;
  --line: #2f3a49;
  --line-soft: #273241;
  --chart-bg: #10161d;
  --chart-grid: rgba(95, 112, 130, 0.24);
  --chart-text: #9aa7b6;
  --spark-bg: #1c2430;
  --blue-soft: #172f50;
  --red-soft: #3a1d26;
  --layer-bg: #172231;
  --layer-ink: #f8fafc;
  --layer-muted: #c4cfdd;
  --layer-soft: #1f2b3a;
  --layer-line: #405066;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  cursor: default;
}

button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.96);
}

.compare-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(8px);
}

.compare-header p,
.section-head span {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.compare-header h1,
.section-head h2,
.section-head p,
.decision-notes h3,
.decision-notes p {
  margin: 0;
}

.compare-header h1 {
  font-size: 26px;
  line-height: 1.2;
}

.compare-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.compare-header a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.theme-switch label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.theme-switch label:has(input:checked) {
  background: var(--blue);
  color: #ffffff;
}

.theme-switch input {
  margin: 0;
  accent-color: var(--blue);
}

.compare-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 22px auto 48px;
}

.compare-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.compare-summary article,
.study-section,
.decision-notes,
.hts-screen,
.hybrid-screen {
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: var(--panel);
}

.compare-summary article {
  padding: 16px;
}

.compare-summary strong,
.compare-summary span {
  display: block;
}

.compare-summary strong {
  margin-bottom: 7px;
  font-size: 16px;
}

.compare-summary span,
.section-head p,
.decision-notes p,
.decision-notes li {
  color: var(--muted);
  line-height: 1.55;
}

.study-section {
  margin-top: 22px;
  padding: 22px;
}

.section-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 24px;
}

.mobile-stage {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(240px, 1fr);
  gap: 20px;
  align-items: start;
}

.phone {
  position: relative;
  overflow: hidden;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 20px 18px 22px;
  border: 8px solid #11151d;
  border-radius: 38px;
  background:
    radial-gradient(circle at 20% 0%, rgba(28, 98, 160, 0.23), transparent 34%),
    linear-gradient(145deg, #061018, #010407 62%, #071018);
  color: #eef6ff;
  box-shadow: 0 24px 60px rgba(8, 13, 22, 0.28);
}

.phone-top,
.mobile-title,
.quote-row,
.speed-row,
.buy-sell,
.training-head,
.training-actions,
.panel-tabs,
.market-tabs,
.quick-ratio,
.order-switch,
.price-step {
  display: flex;
  align-items: center;
}

.phone-top,
.mobile-title,
.quote-row,
.buy-sell,
.training-head {
  justify-content: space-between;
}

.phone-top {
  font-size: 13px;
  font-weight: 700;
}

.mobile-title {
  margin: 20px 0 18px;
}

.mobile-title button,
.phone button {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f9ff;
}

.mobile-title button {
  width: 34px;
  border: 0;
  background: transparent;
  font-size: 28px;
}

.quote-row {
  gap: 10px;
}

.last-price {
  display: block;
  color: var(--rise-color);
  font-size: 30px;
  line-height: 1.1;
}

.last-price.blue {
  color: var(--fall-color);
}

.last-price.rise {
  color: var(--rise-color);
}

.last-price.neutral,
.quote-main > span.neutral,
.quote-metrics strong.neutral {
  color: #0f172a;
}

.rise {
  color: var(--rise-color);
}

.blue {
  color: var(--fall-color);
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(35, 124, 190, 0.42);
  border-radius: 8px;
}

.position-grid span,
.price-step span,
.ratio-grid span,
.training-head span,
.account-mini span,
.review-strip span,
.market-strip span {
  display: block;
  color: #9aa7b8;
  font-size: 12px;
}

.position-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.time-tabs,
.ratio-grid {
  display: grid;
  gap: 8px;
}

.time-tabs {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 8px;
}

.time-tabs button.active,
.speed-row button.active,
.order-switch button.active,
.ratio-grid button.active,
.training-actions button.active,
.chart-tools button.active,
.panel-tabs button.active,
.market-tabs button.active,
.scenario-rail button.active,
.quick-ratio button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.book-cell.empty-cell {
  background: #ffffff;
}

.mobile-chart,
.hts-chart,
.hts-live-overlay,
.hybrid-chart {
  width: 100%;
  max-width: 100%;
  display: block;
}

.mobile-chart {
  height: 268px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.14);
}

.spark-canvas {
  width: 120px;
  height: 58px;
  background: rgba(255, 255, 255, 0.03);
}

.speed-row {
  gap: 8px;
  margin: 12px 0;
}

.speed-row button {
  flex: 1;
  font-weight: 800;
}

.order-switch {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.order-switch button {
  flex: 1;
  border: 0;
  border-radius: 0;
}

.ratio-grid {
  grid-template-columns: repeat(6, 1fr);
  margin-top: 12px;
}

.ratio-grid span,
.price-step span {
  grid-column: 1 / -1;
}

.price-step {
  gap: 8px;
  margin-top: 12px;
}

.price-step strong {
  flex: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.price-step button {
  min-width: 76px;
}

.buy-sell {
  gap: 10px;
  margin-top: 16px;
}

.buy-sell button {
  flex: 1;
  min-height: 54px;
  border: 0;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.buy {
  background: var(--rise-color) !important;
}

.sell {
  background: var(--fall-color) !important;
}

.decision-notes {
  padding: 18px;
}

.decision-notes h3 {
  margin-bottom: 8px;
}

.decision-notes ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.hts-screen {
  overflow: hidden;
}

.hts-topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, auto);
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid #dfe6ee;
}

.hts-topbar > strong,
.symbol-title {
  padding: 0 18px;
  font-size: 18px;
}

.hts-topbar strong span {
  color: var(--muted);
  font-size: 12px;
}

.symbol-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.top-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  justify-content: flex-end;
  margin-right: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.session-mode-badge,
.practice-mode-badge,
.scenario-purpose-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid #b6c3d3;
  border-radius: 999px;
  background: #ffffff;
  color: #243447;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.practice-mode-badge {
  border-color: rgba(18, 103, 219, 0.46);
  background: #eef6ff;
  color: #075dc4;
}

.scenario-purpose-badge {
  border-color: rgba(217, 45, 45, 0.48);
  background: #fff1f1;
  color: #c81e1e;
}

.session-mode-badge.practice {
  border-color: rgba(217, 45, 45, 0.5);
  background: #fff1f1;
  color: #c81e1e;
}

.session-mode-badge.review,
.session-mode-badge.learn {
  border-color: rgba(18, 103, 219, 0.46);
  background: var(--blue-soft);
  color: #075dc4;
}

.symbol-title span {
  white-space: nowrap;
  font-weight: 900;
}

.symbol-title button {
  min-height: 30px;
  padding: 0 9px;
  border-color: #cfd8e3;
  background: #ffffff;
  color: #263241;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.symbol-title b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  border-radius: 8px;
  background: #ffd24d;
  color: #8a5a00;
  font-size: 15px;
  line-height: 1;
}

.replay-clock {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
  padding: 0 8px;
  color: #111827;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-tools,
.panel-tabs,
.market-tabs,
.training-actions {
  display: flex;
  gap: 4px;
}

.panel-tabs button,
.market-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 800;
}

.search,
.mode-picker {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-left: 0;
  color: #98a2b3;
  font-size: 13px;
}

.mode-picker {
  position: relative;
  gap: 6px;
  justify-content: flex-end;
  color: #475569;
  min-width: 0;
}

.mode-picker > span {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-picker > button {
  min-height: 28px;
  padding: 0 10px;
  border-color: #cfd8e3;
  background: #ffffff;
  color: #263241;
  font-size: 12px;
  font-weight: 800;
}

.mode-picker > button.active {
  border-color: var(--rise-color);
  color: var(--rise-color);
}

.mode-layer,
.game-settings-layer,
.indicator-layer {
  position: absolute;
  z-index: 30;
  border: 1px solid var(--layer-line);
  border-radius: 8px;
  background: var(--layer-bg);
  color: var(--layer-ink);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.mode-layer {
  top: calc(100% + 8px);
  right: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 6px;
  width: 250px;
  padding: 10px;
}

.mode-layer button {
  min-height: 30px;
  border-color: var(--layer-line);
  background: var(--layer-soft);
  color: var(--layer-ink);
  font-size: 12px;
  font-weight: 800;
}

.game-settings-layer {
  top: 54px;
  right: 14px;
  width: 230px;
  padding: 12px;
}

.game-settings-layer h3 {
  margin: 0 0 10px;
  color: var(--layer-ink);
  font-size: 12px;
}

.game-settings-layer label {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--layer-muted);
  font-size: 12px;
  font-weight: 800;
}

.game-settings-layer select {
  min-height: 30px;
  border: 1px solid var(--layer-line);
  border-radius: 6px;
  background: var(--layer-soft);
  color: var(--layer-ink);
  font-size: 12px;
}

.hts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "chart market"
    "review market"
    "trade market";
  gap: 8px;
  padding: 8px;
  background: #eef2f6;
}

.hts-chart-panel {
  grid-area: chart;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.market-list {
  grid-area: market;
  position: relative;
}

.review-analysis-panel {
  grid-area: review;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.review-analysis-panel[hidden] {
  display: none;
}

.review-analysis-guide,
.review-analysis-text {
  display: grid;
  gap: 5px;
  align-content: start;
}

.review-analysis-panel strong {
  font-size: 13px;
  color: var(--ink);
}

.review-analysis-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  white-space: pre-line;
  word-break: keep-all;
}

.review-analysis-result {
  display: grid;
  gap: 8px;
}

.review-summary-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1fr 1fr 0.7fr 0.9fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.review-summary-grid div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  background: #ffffff;
}

.review-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
}

.review-summary-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-summary-grid .profit {
  color: var(--rise-color);
}

.review-summary-grid .loss {
  color: var(--fall-color);
}

.review-analysis-result p {
  margin: 0;
}

.review-analysis-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.review-col-indicator {
  width: 35%;
}

.review-col-time {
  width: 10%;
}

.review-col-price {
  width: 14%;
}

.review-col-return {
  width: 17%;
}

.review-analysis-table th,
.review-analysis-table td {
  padding: 5px 6px;
  border: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.review-analysis-table th:first-child,
.review-analysis-table td:first-child {
  text-align: left;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.review-candidate-radio {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  cursor: pointer;
}

.review-candidate-radio input {
  width: 13px;
  height: 13px;
  margin: 1px 0 0;
}

.review-candidate-radio span {
  min-width: 0;
}

.review-analysis-table th {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 900;
}

.review-analysis-table td {
  color: var(--ink);
  font-weight: 800;
}

.review-analysis-table .profit {
  color: var(--rise-color);
  font-weight: 900;
}

.compact-orderbook {
  grid-area: trade;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  width: calc(54% - 4px);
  height: 620px;
  min-height: 620px;
  max-height: 620px;
}

.hts-order {
  grid-area: trade;
  align-self: stretch;
  justify-self: end;
  width: calc(46% - 4px);
  height: 620px;
  min-height: 620px;
  max-height: 620px;
}

.main-hts-embed .compact-orderbook,
.main-hts-embed .hts-order {
  height: 620px;
  min-height: 620px;
  max-height: 620px;
}

.hts-chart-panel,
.market-list,
.orderbook,
.hts-order {
  background: var(--panel);
  border: 1px solid var(--line);
}

.market-strip {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(360px, 1.55fr) 240px;
  gap: 18px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e6edf5;
}

.market-strip .last-price {
  font-size: 31px;
}

.market-strip .last-price small {
  margin-left: 3px;
  font-size: 13px;
  font-weight: 800;
}

.quote-main > span {
  display: block;
  margin-top: 2px;
  color: var(--rise-color);
  font-size: 16px;
  font-weight: 800;
}

.quote-main {
  min-width: 0;
}

.quote-vi-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid rgba(217, 45, 45, 0.42);
  border-radius: 999px;
  background: #fff4f4;
  color: var(--rise-color);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  vertical-align: 5px;
}

.quote-main > span.blue {
  color: var(--fall-color);
}

.quote-main > span.rise {
  color: var(--rise-color);
}

.quote-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 22px;
}

.quote-metrics div {
  min-width: 0;
}

.quote-metrics span {
  font-size: 12px;
}

.quote-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.15;
}

.quote-metrics strong small {
  margin-left: 3px;
  color: inherit;
  font-size: 11px;
  font-weight: 650;
}

.quote-spark {
  justify-self: end;
  width: 220px;
  height: 78px;
  background: #fafbfd;
}

.chart-tools {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #e6edf5;
}

.chart-tool-spacer {
  flex: 1;
}

.chart-tools button {
  min-height: 22px;
  border: 0;
  background: transparent;
}

.chart-tools .chart-zoom-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 26px;
  min-height: 26px;
  margin-left: 3px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
  color: #263241;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.chart-tools .chart-zoom-btn:hover {
  border-color: var(--blue);
  background: #f4f8ff;
  color: var(--blue);
}

.chart-tools .indicator-tool-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #f1f5f9;
  color: #263241;
}

.chart-tools .tool-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.chart-tools .tool-settings-btn span {
  font-size: 18px;
  line-height: 1;
}

.indicator-layer {
  top: 0;
  left: 0;
  width: 470px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.indicator-layer h3 {
  margin: 0 0 8px;
  font-size: 13px;
  cursor: grab;
}

.indicator-layer[data-dragging="true"],
.indicator-layer[data-dragging="true"] h3 {
  cursor: grabbing;
}

.indicator-layer section > div {
  display: grid;
  gap: 6px;
}

.indicator-layer label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--layer-line);
  border-radius: 999px;
  background: var(--layer-soft);
  color: var(--layer-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.indicator-layer input {
  accent-color: var(--red);
}

.indicator-layer p {
  margin: 8px 0 0;
  color: var(--layer-muted);
  font-size: 11px;
  line-height: 1.35;
}

.chart-settings-drawer.compact {
  max-width: 480px;
  padding: 10px;
  font-size: 12px;
}

.chart-settings-drawer.compact .settings-head {
  margin-bottom: 8px;
}

.chart-settings-drawer.compact .settings-head strong {
  font-size: 13px;
}

.chart-settings-drawer.compact .settings-actions {
  gap: 4px;
}

.chart-settings-drawer.compact button.secondary {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.chart-settings-drawer.compact .icon-button {
  width: 28px;
  font-size: 13px;
}

.chart-settings-drawer.compact .settings-tabs {
  margin-bottom: 8px;
}

.chart-settings-drawer.compact .settings-tab {
  padding: 6px 8px;
  font-size: 12px;
}

.chart-settings-drawer.compact .settings-section {
  gap: 5px;
  margin-top: 6px;
}

.chart-settings-drawer.compact .settings-section h3 {
  font-size: 12px;
}

.chart-settings-drawer.compact .settings-section p,
.chart-settings-drawer.compact .settings-status {
  font-size: 10px;
}

.chart-settings-drawer.compact label {
  font-size: 11px;
}

.chart-settings-drawer.compact .setting-row {
  min-height: 24px;
  gap: 6px;
}

.chart-settings-drawer.compact input[type="checkbox"] {
  width: 13px;
  height: 13px;
}

.chart-settings-drawer.compact input[type="color"] {
  width: 28px;
  height: 22px;
}

.chart-settings-drawer.compact select,
.chart-settings-drawer.compact input:not([type="checkbox"]):not([type="color"]) {
  min-height: 24px;
  max-width: 112px;
  font-size: 11px;
}

.chart-settings-drawer.compact .color-choice select,
.chart-settings-drawer.compact .line-style-choice select {
  max-width: 84px;
}

.chart-settings-drawer.compact .indicator-row {
  grid-template-columns: minmax(60px, 0.8fr) minmax(84px, 1fr) 50px minmax(70px, 0.75fr);
}

.chart-settings-drawer.compact .line-indicator-head {
  grid-template-columns: 34px minmax(0, 1fr) minmax(76px, 92px);
}

.chart-settings-drawer.compact .line-indicator-style {
  grid-template-columns: minmax(42px, 0.5fr) minmax(80px, 1fr) 50px minmax(70px, 0.75fr);
}

.chart-settings-drawer.compact .settings-subtabs {
  gap: 4px;
  margin-bottom: 6px;
}

.chart-settings-drawer.compact .settings-subtab {
  min-height: 24px;
  font-size: 11px;
}

.chart-settings-drawer.compact .line-indicator-group,
.chart-settings-drawer.compact .multi-indicator,
.chart-settings-drawer.compact .separate-slot {
  gap: 5px;
  padding: 5px;
}

.chart-settings-drawer.compact .line-indicator-title,
.chart-settings-drawer.compact .line-chip,
.chart-settings-drawer.compact .line-indicator-style > span {
  font-size: 11px;
}

.chart-hover-line {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid #e6edf5;
  color: #263241;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-hover-line .up {
  color: var(--rise-color);
}

.chart-hover-line .down {
  color: var(--fall-color);
}

.chart-crosshair {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.chart-crosshair span {
  position: absolute;
  display: block;
  background: rgba(15, 23, 42, 0.42);
}

.chart-crosshair [data-crosshair-x] {
  top: 0;
  bottom: 0;
  width: 1px;
}

.chart-crosshair [data-crosshair-y] {
  left: 0;
  right: 0;
  height: 1px;
}

.chart-crosshair [data-crosshair-y]::after {
  content: attr(data-label);
  position: absolute;
  right: 6px;
  top: -10px;
  min-width: 86px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
}

.chart-current-price-label {
  position: absolute;
  z-index: 7;
  min-width: 86px;
  padding: 2px 6px;
  border-radius: 3px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  font-family: "Segoe UI", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.chart-current-price-label--tick {
  animation: current-price-label-tick 140ms ease-out;
}

@keyframes current-price-label-tick {
  0% {
    filter: brightness(1.45);
    transform: translateX(-1px) scale(1.03);
  }
  100% {
    filter: brightness(1);
    transform: translateX(0) scale(1);
  }
}

.hts-chart {
  height: var(--hts-chart-height, 470px);
  cursor: grab;
  touch-action: none;
}

.hts-live-overlay {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  height: var(--hts-chart-height, 470px);
  pointer-events: none;
}

.hts-chart:active {
  cursor: grabbing;
}

.replay-countdown {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  z-index: 8;
  min-width: 190px;
  padding: 16px 24px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.market-tabs,
.panel-tabs {
  border-bottom: 1px solid #dfe6ee;
}

.market-tabs button,
.panel-tabs button {
  flex: 1;
  min-height: 40px;
}

.market-list .market-tabs {
  background: #eef2f6;
}

.market-list .market-tabs button {
  background: #eef2f6;
  color: #475569;
  font-size: 13px;
}

.market-list .market-tabs button.active {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #263241;
}

.single-tab button {
  justify-content: flex-start;
  padding-left: 16px;
  border-bottom: 2px solid var(--blue);
  background: #ffffff !important;
  color: var(--blue) !important;
}

.orderbook-title {
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 0;
  min-height: 40px;
}

.orderbook-title button {
  position: absolute;
  inset: 0;
  flex: none;
  width: 100%;
  height: 100%;
  justify-content: center;
  padding: 0 16px;
  border-bottom: 0;
  text-align: center;
}

.orderbook-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--blue);
}

.orderbook-clock-stack {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  padding-right: 4px;
  min-width: 150px;
}

.orderbook-bottom-clock {
  grid-area: clock;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  padding: 0 10px 4px;
  border-top: 1px solid #dfe6ee;
  background: #ffffff;
}

.orderbook-clock-stack .replay-clock {
  min-height: 16px;
  display: flex;
  align-items: flex-end;
  padding: 0;
  width: 58px;
  justify-content: flex-end;
  color: #0f172a;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.vi-timer {
  margin: 0;
  padding: 2px 7px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fff7cc;
  color: #92400e;
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.orderbook-title > .vi-timer {
  position: absolute;
  right: 10px;
  padding: 3px 8px;
  border: 1px solid rgba(217, 45, 45, 0.34);
  border-radius: 999px;
  background: #fff5f5;
  color: var(--rise-color);
}

.coin-row {
  display: grid;
  grid-template-columns: 1fr 92px 84px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 47px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  background: #ffffff;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.coin-row:hover {
  background: #f8fafc;
}

.coin-row:active {
  transform: translateY(1px);
}

.coin-row span,
.coin-row small {
  text-align: right;
}

.game-list-help {
  padding: 8px 12px;
  border-bottom: 1px solid #edf1f5;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.saved-chart-action-layer {
  position: absolute;
  z-index: 35;
  right: 12px;
  top: 96px;
  display: grid;
  gap: 8px;
  width: min(300px, calc(100% - 24px));
  padding: 12px;
  border: 1px solid var(--layer-line);
  border-radius: 8px;
  background: var(--layer-bg);
  color: var(--layer-ink);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.saved-chart-action-layer strong {
  font-size: 13px;
}

.saved-chart-action-layer p {
  margin: 0;
  color: var(--layer-muted);
  font-size: 12px;
  line-height: 1.45;
}

.saved-chart-action-layer button {
  min-height: 34px;
  border-color: var(--layer-line);
  background: var(--layer-soft);
  color: var(--layer-ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.saved-chart-action-layer button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.upbit-orderbook {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 56px 0.75fr 1.15fr 1fr 56px;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) 34px 30px;
  grid-template-areas:
    "askCancel askSize askPrice openOrders openOrders"
    "tape tape bidPrice bidSize bidCancel"
    "sellCancel sellTotal totalMode buyTotal buyCancel"
    "clock clock clock clock clock";
  align-content: stretch;
  min-height: 0;
  background: #ffffff;
}

.ask-cancel-col {
  grid-area: askCancel;
}

.ask-size-col {
  grid-area: askSize;
}

.ask-price-col {
  grid-area: askPrice;
}

.open-orders {
  grid-area: openOrders;
  min-height: 0;
  overflow-y: auto;
}

.tick-tape {
  grid-area: tape;
}

.bid-price-col {
  grid-area: bidPrice;
}

.bid-size-col {
  grid-area: bidSize;
}

.bid-cancel-col {
  grid-area: bidCancel;
}

.sell-cancel {
  grid-area: sellCancel;
}

.sell-total-value {
  grid-area: sellTotal;
}

.book-total-label {
  grid-area: totalMode;
}

.buy-total-value {
  grid-area: buyTotal;
}

.buy-cancel {
  grid-area: buyCancel;
}

.ask-cancel-col,
.ask-size-col,
.ask-price-col,
.open-orders {
  border-bottom: 1px solid #e1e7ef;
}

.ask-size-col,
.ask-price-col,
.bid-price-col,
.bid-size-col {
  display: grid;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  min-height: 0;
}

.ask-cancel-col,
.ask-size-col,
.tick-tape {
  border-right: 1px solid #e1e7ef;
}

.ask-price-col,
.bid-price-col,
.bid-size-col,
.bid-cancel-col {
  border-right: 1px solid #e1e7ef;
}

.book-cell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 0 7px;
  border-bottom: 1px solid #dfe6ee;
  overflow: hidden;
  font-size: 11px;
  font-family: "Segoe UI", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.book-cell::before {
  content: "";
  position: absolute;
  inset: 3px 0 3px auto;
  width: var(--w);
  background: var(--tone);
  opacity: 0.63;
}

.book-cell > * {
  position: relative;
  z-index: 1;
}

.size-cell {
  justify-content: flex-end;
  background: #eaf3ff;
  color: #0f4ea7;
}

.bid-size-col .size-cell {
  justify-content: flex-start;
  background: #fff1f1;
  color: #b91c1c;
}

.bid-size-col .book-cell::before {
  inset: 3px auto 3px 0;
}

.price-cell {
  justify-content: space-between;
  gap: 8px;
  background: #eaf3ff;
  cursor: pointer;
  transition: none;
}

.bid-price-col .price-cell {
  background: #fff1f1;
}

.price-cell:hover {
  background: #d9ecff;
  box-shadow: inset 0 0 0 1px rgba(18, 103, 219, 0.28);
}

.bid-price-col .price-cell:hover {
  background: #ffe0e0;
  box-shadow: inset 0 0 0 1px rgba(211, 47, 47, 0.26);
}

.price-cell.empty-cell,
.price-cell.empty-cell:hover,
.size-cell.empty-cell,
.size-cell.empty-cell:hover {
  cursor: default;
  box-shadow: none;
}

.ask-price-col .price-cell.empty-cell,
.ask-size-col .size-cell.empty-cell {
  background: #eaf3ff;
}

.bid-price-col .price-cell.empty-cell,
.bid-size-col .size-cell.empty-cell {
  background: #fff1f1;
}

.ask-size-col .size-cell {
  color: var(--fall-color);
}

.bid-size-col .size-cell {
  color: var(--rise-color);
}

.price-cell.tone-rise strong,
.price-cell.tone-rise span {
  color: var(--rise-color);
}

.price-cell.tone-fall strong,
.price-cell.tone-fall span {
  color: var(--fall-color);
}

.price-cell.tone-flat strong,
.price-cell.tone-flat span {
  color: #111827;
}

.price-cell strong {
  font-size: 12px;
  font-weight: 650;
}

.price-cell span {
  font-size: 10px;
  white-space: nowrap;
}

.tick-tape {
  display: grid;
  grid-template-rows: 21px repeat(10, 1fr);
  padding: 0 7px;
  min-height: 0;
  font-size: 11px;
  font-family: "Segoe UI", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.tick-tape > div {
  display: grid;
  grid-template-columns: 1fr 68px;
  gap: 8px;
  align-items: center;
  min-height: 0;
  border-bottom: 1px solid #edf1f5;
}

.tick-tape span,
.tick-tape strong {
  text-align: right;
  font-weight: 400;
}

.tick-tape .tick-head {
  color: var(--muted);
  font-weight: 600;
}

.ask-cancel-col,
.bid-cancel-col {
  display: grid;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  min-height: 0;
  background: #ffffff;
}

.order-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #edf1f5;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
}

.order-marker.active {
  background: #fff8df;
  color: #a16207;
}

.order-marker.pending {
  cursor: pointer;
}

.open-orders {
  margin: 0;
  padding: 0 7px;
  scrollbar-width: thin;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 29px,
      #edf1f5 29px,
      #edf1f5 30px
    ),
    #fbfcfe;
}

.open-orders-head,
.open-orders button {
  display: grid;
  grid-template-columns: 44px 1fr 52px;
  gap: 6px;
  align-items: center;
}

.open-orders-head {
  min-height: 30px;
  border-bottom: 1px solid #edf1f5;
  color: var(--muted);
  font-size: 10px;
}

.open-orders-head strong {
  color: #263241;
  font-size: 12px;
}

.open-orders button {
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  background: transparent;
  color: #263241;
  font-size: 11px;
  text-align: left;
}

.open-orders button strong,
.open-orders button em {
  text-align: right;
  font-style: normal;
  font-weight: 650;
}

.price-cell.current-price {
  border-color: #dfe6ee;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #1f2937;
}

.price-cell.vi-upper,
.price-cell.vi-lower {
  box-shadow: inset 0 0 0 1px rgba(217, 163, 0, 0.24);
}

.price-cell.vi-upper {
  background: #fff9db;
}

.price-cell.vi-lower {
  background: #fff9db;
}

.price-cell.vi-active {
  background: #fff2b8;
  box-shadow: inset 0 0 0 2px #e0a900;
}

.vi-price-badge {
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #e0a900;
  color: #111827;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.price-cell.vi-lower .vi-price-badge {
  background: #e0a900;
  color: #111827;
}

.practice-guide-layer {
  position: absolute;
  z-index: 45;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100% - 40px));
  padding: 16px 18px;
  border: 1px solid var(--layer-line);
  border-radius: 8px;
  background: var(--layer-bg);
  color: var(--layer-ink);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
  transform: translate(-50%, -50%);
  cursor: grab;
}

.practice-guide-layer[data-dragging="true"] {
  cursor: grabbing;
}

.practice-guide-layer strong {
  font-size: 15px;
}

.practice-guide-layer p {
  margin: 0;
  color: var(--layer-muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.practice-guide-layer button {
  display: none;
  justify-self: end;
  min-width: 74px;
  min-height: 32px;
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.practice-guide-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.practice-guide-layer .practice-guide-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body[data-theme="dark"] .compare-summary article,
body[data-theme="dark"] .study-section,
body[data-theme="dark"] .decision-notes,
body[data-theme="dark"] .hts-screen,
body[data-theme="dark"] .hybrid-screen,
body[data-theme="dark"] .market-strip,
body[data-theme="dark"] .upbit-orderbook,
body[data-theme="dark"] .saved-chart-action-layer,
body[data-theme="dark"] .game-settings-layer,
body[data-theme="dark"] .indicator-layer,
body[data-theme="dark"] .chart-settings-layer,
body[data-theme="dark"] .practice-guide-layer,
body[data-theme="dark"] .order-form-body {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

body[data-theme="dark"] .mode-layer,
body[data-theme="dark"] .game-settings-layer,
body[data-theme="dark"] .indicator-layer,
body[data-theme="dark"] .saved-chart-action-layer,
body[data-theme="dark"] .practice-guide-layer {
  background: var(--layer-bg);
  color: var(--layer-ink);
  border-color: var(--layer-line);
}

body[data-theme="dark"] .mode-layer button,
body[data-theme="dark"] .indicator-layer label,
body[data-theme="dark"] .saved-chart-action-layer button,
body[data-theme="dark"] .game-settings-layer select {
  background: var(--layer-soft) !important;
  color: var(--layer-ink) !important;
  border-color: var(--layer-line);
}

body[data-theme="dark"] .game-settings-layer h3,
body[data-theme="dark"] .indicator-layer h3,
body[data-theme="dark"] .practice-guide-layer strong,
body[data-theme="dark"] .saved-chart-action-layer strong {
  color: var(--layer-ink);
}

body[data-theme="dark"] .game-settings-layer label,
body[data-theme="dark"] .indicator-layer p,
body[data-theme="dark"] .practice-guide-layer p,
body[data-theme="dark"] .saved-chart-action-layer p {
  color: var(--layer-muted);
}

body[data-theme="dark"] .practice-guide-layer p,
body[data-theme="dark"] .saved-chart-action-layer p {
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .practice-guide-layer {
  background: #1f2b3a !important;
  border-color: #53657c !important;
}

body[data-theme="dark"] .study-section {
  background: #151d28;
  padding: 6px;
}

body[data-theme="dark"] .hts-screen {
  background: #151d28;
}

body[data-theme="dark"] .hts-grid {
  background: #151d28;
}

body[data-theme="dark"] .hts-chart-panel {
  background: #151d28;
}

body[data-theme="dark"] .hts-topbar,
body[data-theme="dark"] .market-strip,
body[data-theme="dark"] .chart-tools,
body[data-theme="dark"] .market-tabs,
body[data-theme="dark"] .panel-tabs,
body[data-theme="dark"] .open-orders-head,
body[data-theme="dark"] .open-orders button,
body[data-theme="dark"] .coin-row,
body[data-theme="dark"] .book-cell,
body[data-theme="dark"] .bulk-cancel,
body[data-theme="dark"] .book-total-value,
body[data-theme="dark"] .book-total-label {
  border-color: var(--line-soft);
}

body[data-theme="dark"] .ask-cancel-col,
body[data-theme="dark"] .ask-size-col,
body[data-theme="dark"] .ask-price-col,
body[data-theme="dark"] .open-orders,
body[data-theme="dark"] .tick-tape,
body[data-theme="dark"] .bid-price-col,
body[data-theme="dark"] .bid-size-col,
body[data-theme="dark"] .bid-cancel-col {
  border-color: #2a3544;
}

body[data-theme="dark"] .ask-cancel-col,
body[data-theme="dark"] .bid-cancel-col {
  background: #1b2531;
}

body[data-theme="dark"] .study-section,
body[data-theme="dark"] .hts-screen,
body[data-theme="dark"] .hts-chart-panel,
body[data-theme="dark"] .market-list,
body[data-theme="dark"] .review-analysis-panel,
body[data-theme="dark"] .orderbook,
body[data-theme="dark"] .hts-order {
  border-color: #2b3544;
}

body[data-theme="dark"] button,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] .symbol-title button,
body[data-theme="dark"] .coin-row,
body[data-theme="dark"] .single-tab button,
body[data-theme="dark"] .replay-control-block,
body[data-theme="dark"] .speed-readout {
  background: var(--panel-2) !important;
  color: var(--ink) !important;
  border-color: var(--line);
}

body[data-theme="dark"] input::placeholder {
  color: #6f7c8d;
}

body[data-theme="dark"] .play-toggle,
body[data-theme="dark"] .guest-actions button,
body[data-theme="dark"] .market-tabs button.active {
  background: var(--rise-color) !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .order-tabs button.active {
  background: transparent !important;
  color: var(--rise-color) !important;
}

body[data-theme="dark"] .hts-order > .panel-tabs button:nth-child(2).active {
  color: var(--fall-color) !important;
}

body[data-theme="dark"] .hts-order > .panel-tabs button:nth-child(3).active,
body[data-theme="dark"] .hts-order > .panel-tabs button:nth-child(4).active {
  color: var(--blue) !important;
}

body[data-theme="dark"] .play-toggle.paused {
  background: var(--fall-color) !important;
}

body[data-theme="dark"] .mode-picker,
body[data-theme="dark"] .market-list .market-tabs,
body[data-theme="dark"] .game-list-help,
body[data-theme="dark"] .open-orders {
  background: #1a2330;
  color: var(--muted);
  border-color: var(--line);
}

body[data-theme="dark"] .market-strip,
body[data-theme="dark"] .chart-tools,
body[data-theme="dark"] .hts-topbar {
  background: var(--panel-2);
}

body[data-theme="dark"] .market-list,
body[data-theme="dark"] .review-analysis-panel,
body[data-theme="dark"] .orderbook,
body[data-theme="dark"] .hts-order {
  background: var(--panel);
}

body[data-theme="dark"] .review-analysis-panel p {
  color: #c4cfdd;
}

body[data-theme="dark"] .review-analysis-table th {
  background: var(--panel-2);
  color: #c4cfdd;
}

body[data-theme="dark"] .review-analysis-table td {
  color: var(--ink);
}

body[data-theme="dark"] .coin-row:hover,
body[data-theme="dark"] .saved-chart-action-layer button:hover {
  background: var(--panel-3) !important;
}

body[data-theme="dark"] .session-mode-badge,
body[data-theme="dark"] .practice-mode-badge,
body[data-theme="dark"] .scenario-purpose-badge {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .session-mode-badge {
  background: rgba(199, 53, 58, 0.16);
  border-color: rgba(248, 113, 113, 0.46);
  color: #ff7077;
}

body[data-theme="dark"] .practice-mode-badge {
  background: rgba(43, 116, 199, 0.18);
  border-color: rgba(96, 165, 250, 0.48);
  color: #87bdff;
}

body[data-theme="dark"] .scenario-purpose-badge {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.56);
  color: #ffd166;
}

body[data-theme="dark"] .top-badge-group {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[data-theme="dark"] .replay-clock {
  color: #e8eef6;
}

body[data-theme="dark"] .last-price.neutral,
body[data-theme="dark"] .quote-main > span.neutral,
body[data-theme="dark"] .quote-metrics strong.neutral {
  color: #f8fafc !important;
}

body[data-theme="dark"] .orderbook-clock-stack .replay-clock {
  color: #f8fafc;
}

body[data-theme="dark"] .orderbook-clock-stack .vi-timer {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
}

body[data-theme="dark"] .orderbook-bottom-clock {
  border-top-color: #304055;
  background: #172231;
}

body[data-theme="dark"] .ask-size-col .size-cell,
body[data-theme="dark"] .ask-price-col .price-cell,
body[data-theme="dark"] .ask-price-col .price-cell.empty-cell,
body[data-theme="dark"] .ask-size-col .size-cell.empty-cell {
  background: #182f48;
}

body[data-theme="dark"] .bid-size-col .size-cell,
body[data-theme="dark"] .bid-price-col .price-cell,
body[data-theme="dark"] .bid-price-col .price-cell.empty-cell,
body[data-theme="dark"] .bid-size-col .size-cell.empty-cell {
  background: #211a22 !important;
}

body[data-theme="dark"] .book-cell::before {
  opacity: 0.55;
}

body[data-theme="dark"] .ask-cancel-col,
body[data-theme="dark"] .bid-cancel-col,
body[data-theme="dark"] .tick-tape,
body[data-theme="dark"] .book-total-value,
body[data-theme="dark"] .book-total-label,
body[data-theme="dark"] .bulk-cancel {
  background: var(--panel-2);
}

body[data-theme="dark"] .sell-total-value {
  color: #60a5fa;
}

body[data-theme="dark"] .buy-total-value {
  color: #f87171;
}

body[data-theme="dark"] .order-marker {
  border-color: #2d3847;
}

body[data-theme="dark"] .tick-tape > div,
body[data-theme="dark"] .tick-tape .tick-head {
  border-bottom-color: #2d3847;
}

body[data-theme="dark"] .book-cell,
body[data-theme="dark"] .open-orders button {
  border-bottom-color: #2d3847 !important;
}

body[data-theme="dark"] .order-marker.active {
  background: #272a26;
  color: #d3a13a;
  cursor: pointer;
}

body[data-theme="dark"] .orderbook-title {
  border-bottom-color: transparent;
}

body[data-theme="dark"] .price-cell.current-price {
  background: #2f3a46;
  border-color: #2d3847 !important;
  box-shadow: inset 0 0 0 1px #d1d5db;
}

body[data-theme="dark"] .price-cell.current-price strong,
body[data-theme="dark"] .price-cell.current-price span {
  color: #94a3b8 !important;
}

body[data-theme="dark"] .price-cell.tone-flat strong,
body[data-theme="dark"] .price-cell.tone-flat span {
  color: #94a3b8 !important;
}

body[data-theme="dark"] .price-cell.vi-upper,
body[data-theme="dark"] .price-cell.vi-lower {
  background: #2f2810;
}

body[data-theme="dark"] .price-cell.vi-active {
  background: #4a3608;
  box-shadow: inset 0 0 0 2px #facc15;
}

body[data-theme="dark"] .vi-price-badge {
  background: #facc15;
  color: #111827;
}

body[data-theme="dark"] .open-orders {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 29px,
      var(--line-soft) 29px,
      var(--line-soft) 30px
    ),
    #1a2330;
}

body[data-theme="dark"] .open-orders-head {
  color: #9eabba;
}

body[data-theme="dark"] .open-orders-head strong {
  color: #dbe5f1;
}

body[data-theme="dark"] .open-orders button {
  color: #dce6f2;
}

body[data-theme="dark"] .market-list .market-tabs button {
  background: var(--panel-2);
  color: var(--ink);
}

body[data-theme="dark"] .market-list .market-tabs button.active {
  background: #dd2d33 !important;
  color: #ffffff !important;
  border-color: #dd2d33;
}

body[data-theme="dark"] .chart-tools button.active,
body[data-theme="dark"] .mode-picker > button.active {
  background: #1f6fc8 !important;
  border-color: #2f87e5;
  color: #ffffff !important;
}

body[data-theme="dark"] .quote-spark {
  background: var(--spark-bg);
}

body[data-theme="dark"] .chart-hover-line {
  color: #c8d2df;
  background: #131c28;
  border-color: #283546;
}

body[data-theme="dark"] .chart-hover-line .up {
  color: var(--rise-color);
}

body[data-theme="dark"] .chart-hover-line .down {
  color: var(--fall-color);
}

body[data-theme="dark"] .chart-crosshair span {
  background: #94a3b8;
}

body[data-theme="dark"] .chart-crosshair [data-crosshair-y]::after {
  background: #263241;
  color: #e5edf7;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .speed-readout strong {
  color: #ffffff;
}

body[data-theme="dark"] .speed-readout span {
  color: #b4c0cf;
}

body[data-theme="dark"] .order-info-row,
body[data-theme="dark"] .hts-order label,
body[data-theme="dark"] .order-type-row {
  color: #c1cad6;
}

body[data-theme="dark"] .order-info-row strong {
  color: #e8eef6;
  border-bottom-color: #6f7b8d;
}

body[data-theme="dark"] .hts-order input {
  background: #1b2531;
  color: #eef5ff;
  border-color: #5b6b82;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

body[data-theme="dark"] .hts-order input:disabled {
  background: #17202b;
  color: #b8c3d2;
}

body[data-theme="dark"] .order-type-buttons {
  border-color: transparent;
}

body[data-theme="dark"] .order-type-buttons button {
  background: #1d2937 !important;
  color: #eef5ff !important;
  border-color: #617089;
}

body[data-theme="dark"] .order-type-buttons button.active {
  background: #111a25 !important;
  color: var(--rise-color) !important;
  border-color: var(--rise-color);
  box-shadow: none;
}

body[data-theme="dark"] .hts-order > .panel-tabs button {
  background: #1d2937 !important;
  border-color: #617089;
  color: #e8eef6;
}

body[data-theme="dark"] .quick-ratio button,
body[data-theme="dark"] .quick-amount button {
  background: #1b2531 !important;
  color: #eef5ff !important;
  border-color: #334154;
}

body[data-theme="dark"] .order-submit-actions .order-reset,
body[data-theme="dark"] .order-submit-actions .order-cancel {
  background: #172231 !important;
  border-color: #304055;
  color: #e7eef7 !important;
}

body[data-theme="dark"] .order-submit-actions .order-submit {
  background: var(--rise-color) !important;
  border-color: var(--rise-color);
  color: #ffffff !important;
}

body[data-theme="dark"] .order-submit-actions .order-submit.sell {
  background: var(--fall-color) !important;
  border-color: var(--fall-color);
}

body[data-theme="dark"] .order-submit-actions .order-submit.correction {
  background: var(--blue) !important;
  border-color: var(--blue);
}

body[data-theme="dark"] .order-feedback.visible {
  color: #e8eef6;
}

body[data-theme="dark"] .order-feedback.buy {
  border-color: color-mix(in srgb, var(--rise-color) 27%, #334154);
  background: color-mix(in srgb, var(--rise-color) 7%, #172231);
}

body[data-theme="dark"] .order-feedback.sell {
  border-color: color-mix(in srgb, var(--fall-color) 27%, #334154);
  background: color-mix(in srgb, var(--fall-color) 7%, #172231);
}

body[data-theme="dark"] .order-feedback.correction {
  border-color: color-mix(in srgb, var(--blue) 58%, #334154);
  background: color-mix(in srgb, var(--blue) 11.2%, #172231);
}

body[data-theme="dark"] .order-feedback.cancel {
  border-color: #41536b;
  background: #182535;
  color: #d6e1ef;
}

body[data-theme="dark"] .order-feedback.error {
  border-color: #b7791f;
  background: #2d2314;
  color: #facc8b;
}

body[data-theme="dark"] .vi-timer,
body[data-theme="dark"] .quote-vi-badge {
  background: #3a1d26;
  border-color: #6f2932;
}

body[data-theme="dark"] .chart-settings-drawer {
  background: var(--layer-bg);
  color: var(--layer-ink);
  border-color: var(--layer-line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

body[data-theme="dark"] .chart-settings-drawer button.secondary,
body[data-theme="dark"] .chart-settings-drawer .settings-tab,
body[data-theme="dark"] .chart-settings-drawer .settings-subtab {
  background: var(--layer-soft) !important;
  color: var(--layer-ink) !important;
  border-color: var(--layer-line);
}

body[data-theme="dark"] .chart-settings-drawer .settings-tab.active,
body[data-theme="dark"] .chart-settings-drawer .settings-subtab.active {
  background: #0f3b66 !important;
  color: #ffffff !important;
  border-color: #4d9bf2;
}

body[data-theme="dark"] .chart-settings-drawer .settings-head strong,
body[data-theme="dark"] .chart-settings-drawer .settings-section h3,
body[data-theme="dark"] .chart-settings-drawer label,
body[data-theme="dark"] .chart-settings-drawer .setting-row,
body[data-theme="dark"] .chart-settings-drawer .line-indicator-title,
body[data-theme="dark"] .chart-settings-drawer .line-chip,
body[data-theme="dark"] .chart-settings-drawer .line-indicator-style > span {
  color: var(--layer-ink);
}

body[data-theme="dark"] .chart-settings-drawer .settings-section p,
body[data-theme="dark"] .chart-settings-drawer .settings-status {
  color: var(--layer-muted);
}

body[data-theme="dark"] .chart-settings-drawer select,
body[data-theme="dark"] .chart-settings-drawer input:not([type="checkbox"]):not([type="color"]) {
  background: #101923 !important;
  color: var(--layer-ink) !important;
  border-color: var(--layer-line);
}

body[data-theme="dark"] .chart-settings-drawer .settings-section,
body[data-theme="dark"] .chart-settings-drawer .line-indicator-group,
body[data-theme="dark"] .chart-settings-drawer .multi-indicator,
body[data-theme="dark"] .chart-settings-drawer .separate-slot {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--layer-line);
}

.bulk-cancel,
.book-total-value,
.book-total-label {
  min-height: 34px;
  border-top: 1px solid #d8e0ea;
  border-right: 1px solid #e1e7ef;
  border-bottom: 1px solid #d8e0ea;
  background: #ffffff;
  font-size: 12px;
}

.bulk-cancel {
  border-left: 0;
  border-radius: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.sell-cancel {
  color: #2563eb;
}

.buy-cancel {
  color: #dc2626;
}

.book-total-value,
.book-total-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.sell-total-value {
  border-left: 1px solid #e1e7ef;
  color: #1d4ed8;
}

.buy-total-value {
  color: #dc2626;
}

.book-total-label {
  border-left: 1px solid #e1e7ef;
  border-top: 1px solid #d8e0ea;
  border-right: 1px solid #e1e7ef;
  border-bottom: 1px solid #d8e0ea;
  border-radius: 0;
  color: #263241;
  font-size: 11px;
  gap: 4px;
}

.book-total-label [data-mode-qty],
.book-total-label [data-mode-amount] {
  font-weight: 400;
}

.book-total-label[data-mode="qty"] [data-mode-qty],
.book-total-label[data-mode="amount"] [data-mode-amount] {
  font-weight: 800;
}

.hts-order {
  display: flex;
  flex-direction: column;
  padding-bottom: 14px;
  overflow: visible;
}

.replay-control-block {
  display: grid;
  grid-template-columns: 1.08fr 1.24fr 0.7fr 1fr 0.7fr 1.08fr;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #dfe6ee;
  background: #f8fafc;
}

.hts-order > .panel-tabs {
  border-top: 1px solid #dfe6ee;
}

.hts-order > .panel-tabs button.active:first-child {
  border: 1px solid var(--rise-color);
  border-bottom: 1px solid var(--rise-color);
  background: transparent;
  color: var(--rise-color);
}

.hts-order > .panel-tabs button.active:first-child {
  border-color: var(--rise-color);
}

.hts-order > .panel-tabs button:nth-child(2).active {
  background: transparent;
  border-color: var(--fall-color);
  color: var(--fall-color);
}

.hts-order > .panel-tabs button:nth-child(3).active,
.hts-order > .panel-tabs button:nth-child(4).active {
  background: transparent;
  border-color: var(--blue);
  color: var(--blue);
}

.replay-control-block button {
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border-color: #cfd8e3;
  background: #ffffff;
  color: #263241;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.replay-control-block button:hover {
  background: #f3f7fb;
  border-color: #9eb3cb;
}

.replay-control-block .play-toggle {
  background: var(--rise-color);
  color: #ffffff;
  border-color: var(--rise-color);
}

.replay-control-block .play-toggle:hover {
  background: var(--rise-color);
  color: #ffffff;
  border-color: var(--rise-color);
}

.replay-control-block .play-toggle.paused {
  background: var(--fall-color);
  border-color: var(--fall-color);
}

.replay-control-block .play-toggle.paused:hover {
  background: var(--fall-color);
  border-color: var(--fall-color);
}

.speed-readout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  min-height: 34px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
}

.speed-readout span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.speed-readout strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.05;
}

.compact-orderbook {
  min-height: 620px;
}

.hts-order label,
.order-type-row,
.order-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
  margin: 9px 24px 0;
  color: #4b5563;
  font-size: 13px;
  background: transparent;
}

.order-info-row strong {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 10px;
  border-bottom: 1px solid #e6edf5;
  color: #111827;
  font-size: 13px;
}

.holding-pnl-row {
  grid-template-columns: 142px 1fr;
}

.holding-pnl-row > span {
  white-space: nowrap;
}

.holding-row strong,
.holding-pnl-row strong,
.availability-row strong {
  border-bottom: 0;
}

.order-info-row strong em {
  font-style: normal;
}

.total-row {
  margin-top: 10px;
}

.hts-order input {
  min-height: 36px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 0 10px;
  text-align: right;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  background: transparent;
}

.hts-order input:disabled {
  background: #f2f5f8;
  color: #98a2b3;
  cursor: not-allowed;
}

.order-type-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  overflow: visible;
}

.order-type-buttons button {
  min-height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background: #f4f7fb;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.order-type-buttons button.active {
  border-color: var(--rise-color);
  background: #ffffff;
  color: var(--rise-color);
  box-shadow: none;
}

.quick-ratio,
.quick-amount {
  gap: 6px;
  margin: 9px 24px 0;
}

.quick-ratio button,
.quick-amount button {
  flex: 1;
  min-height: 30px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.order-tabs button,
.guest-actions button {
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.hts-order > .panel-tabs {
  gap: 6px;
  padding: 5px 6px 6px;
}

.hts-order > .panel-tabs button {
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background: #f4f7fb;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.hts-order > .panel-tabs button.active {
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.order-type-buttons button:hover,
.order-tabs button:hover,
.quick-ratio button:hover,
.quick-amount button:hover {
  background: #f3f7fb;
  border-color: #9eb3cb;
}

.quick-amount {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-amount button {
  padding: 0 5px;
  font-size: 12px;
}

.guest-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 24px 0;
}

.guest-actions[hidden] {
  display: none;
}

.guest-actions button {
  min-height: 44px;
  border: 0;
  background: var(--rise-color);
  color: #ffffff;
  font-weight: 900;
}

.guest-actions button:hover {
  filter: brightness(0.96);
}

.order-form-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.order-form-body .holding-row[hidden],
.order-form-body .holding-pnl-row[hidden],
.order-form-body .quick-amount[hidden] {
  display: none !important;
}

.trade-history-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.trade-history-panel[hidden] {
  display: none;
}

.trade-history-panel .history-list {
  max-height: 500px;
  overflow-y: auto;
}

.order-feedback-slot {
  min-height: 32px;
  margin: 8px 24px 0;
}

.order-feedback {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: transparent;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  opacity: 0;
  transition: opacity 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.order-feedback.visible {
  opacity: 1;
  color: #111827;
}

.order-feedback.buy {
  border-color: color-mix(in srgb, var(--rise-color) 17%, #dbe5ef);
  background: color-mix(in srgb, var(--rise-color) 3.5%, #ffffff);
}

.order-feedback.sell {
  border-color: color-mix(in srgb, var(--fall-color) 17%, #dbe5ef);
  background: color-mix(in srgb, var(--fall-color) 3.5%, #ffffff);
}

.order-feedback.correction {
  border-color: color-mix(in srgb, var(--blue) 45%, #dbe5ef);
  background: color-mix(in srgb, var(--blue) 5.6%, #ffffff);
}

.order-feedback.cancel {
  border-color: #cfd8e3;
  background: #f6f9fd;
  color: #334155;
}

.order-feedback.error {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #92400e;
}

.order-submit-actions {
  display: grid;
  grid-template-columns: 0.62fr 1fr;
  gap: 8px;
  margin: 10px 24px 0;
}

.order-submit-actions.correction {
  grid-template-columns: 0.62fr 0.9fr 0.9fr;
}

.order-submit-actions button {
  min-height: 42px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: filter 0.12s ease, border-color 0.12s ease;
}

.order-submit-actions button:hover {
  filter: brightness(0.96);
}

.order-submit-actions .order-reset,
.order-submit-actions .order-cancel {
  border-color: #cfd8e3;
  background: #ffffff;
  color: #334155;
}

.order-submit-actions .order-submit {
  border-color: var(--rise-color);
  background: var(--rise-color);
  color: #ffffff;
}

.order-submit-actions .order-submit.sell {
  border-color: var(--fall-color);
  background: var(--fall-color);
  color: #ffffff;
}

.order-submit-actions .order-submit.correction {
  border-color: var(--blue);
  background: var(--blue);
}

.order-submit-actions .order-cancel {
  color: var(--rise-color);
  border-color: color-mix(in srgb, var(--rise-color) 62%, #cfd8e3);
}

.trade-history-panel {
  margin: 8px 16px 0;
  color: #1f2937;
  font-size: 12px;
}

.history-filter {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding: 3px 4px 4px;
  border-bottom: 1px solid #dbe5ef;
}

.history-filter label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
}

.history-filter input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.history-row {
  cursor: pointer;
}

.history-list p {
  margin: 6px 4px 4px;
  color: #475569;
}

.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.history-summary span {
  white-space: nowrap;
}

.history-list {
  max-height: 316px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.history-head,
.history-row {
  display: grid;
  grid-template-columns: 76px 48px 1fr 54px 48px;
  align-items: center;
  width: 100%;
}

.history-head {
  min-height: 28px;
  border-bottom: 1px solid #cfd8e3;
  padding: 0 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.history-head small {
  color: #64748b;
  font-size: 11px;
}

.history-row {
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid #e5edf5;
  background: #ffffff;
  padding: 6px 4px;
  color: #111827;
  text-align: left;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.history-row:hover {
  background: #f6f9fd;
}

.history-row span small,
.history-row strong small {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.history-row b {
  font-weight: 700;
}

.history-row b.trade-buy,
.history-summary .trade-buy {
  color: var(--rise-color);
}

.history-row b.trade-sell,
.history-summary .trade-sell {
  color: var(--fall-color);
}

.history-row strong .fill-amount {
  font-size: 12px;
  font-weight: 800;
}

.history-row strong,
.history-row em {
  font-style: normal;
  font-weight: 700;
}

.history-row i {
  justify-self: end;
  min-width: 38px;
  padding: 5px 8px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  color: #334155;
  font-style: normal;
  text-align: center;
}

.history-row i:hover {
  border-color: var(--red);
  color: var(--red);
}

.history-head.filled,
.history-row.filled {
  grid-template-columns: 118px 48px 1fr 54px;
}

.history-row.filled {
  cursor: default;
}

.history-row.filled:hover {
  background: #ffffff;
}

body[data-theme="dark"] .trade-history-panel {
  color: #d8e2ef;
}

body[data-theme="dark"] .history-filter {
  border-bottom-color: #5b6b82;
}

body[data-theme="dark"] .history-filter label,
body[data-theme="dark"] .history-list p,
body[data-theme="dark"] .history-head,
body[data-theme="dark"] .history-head small {
  color: #94a3b8;
}

body[data-theme="dark"] .history-row {
  background: #1b2531;
  border-bottom-color: #334154;
  color: #e8eef6;
}

body[data-theme="dark"] .history-row:hover {
  background: #223044;
}

body[data-theme="dark"] .history-row span small,
body[data-theme="dark"] .history-row strong small {
  color: #94a3b8;
}

body[data-theme="dark"] .history-row i {
  border-color: #64748b;
  color: #cbd5e1;
  background: #17202b;
}

body[data-theme="dark"] .history-row i:hover {
  border-color: var(--red);
  color: var(--red);
}

.hybrid-screen {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 300px;
  gap: 12px;
  padding: 12px;
  background: #eef3f8;
}

.scenario-rail,
.training-chart,
.execution-panel {
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #ffffff;
}

.scenario-rail,
.execution-panel {
  padding: 14px;
}

.scenario-rail h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.scenario-rail button {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 8px;
  text-align: left;
  font-weight: 700;
}

.score-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #edf1f5;
}

.score-box span {
  color: var(--muted);
  font-size: 12px;
}

.training-chart {
  overflow: hidden;
}

.training-head {
  min-height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid #e1e7ef;
}

.training-head strong,
.training-head span {
  display: block;
}

.training-actions button {
  min-width: 48px;
}

.hybrid-chart {
  height: 430px;
}

.review-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #e1e7ef;
  border-top: 1px solid #e1e7ef;
}

.review-strip div {
  padding: 12px;
  background: #ffffff;
}

.review-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.account-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.account-mini div:first-child {
  grid-column: 1 / -1;
}

.account-mini .last-price {
  font-size: 26px;
}

.compact-book {
  margin-bottom: 12px;
  border: 1px solid #e1e7ef;
  border-radius: 6px;
  overflow: hidden;
}

.trade-box {
  display: grid;
  gap: 10px;
}

.trade-box .price-step {
  margin: 0;
}

.trade-box .price-step button {
  min-width: 0;
  flex: 0 0 62px;
}

.trade-box .price-step strong {
  color: var(--ink);
  border-color: #dfe6ee;
}

@media (max-width: 1100px) {
  .compare-header,
  .mobile-stage,
  .hybrid-screen {
    grid-template-columns: 1fr;
  }

  .compare-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .compare-header nav {
    justify-content: flex-start;
  }

  .compare-summary {
    grid-template-columns: 1fr;
  }

  .hts-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "market"
      "book"
      "order";
  }

  .compact-orderbook {
    grid-area: book;
    width: 100%;
  }

  .hts-order {
    grid-area: order;
    justify-self: stretch;
    width: 100%;
  }

  .hts-topbar,
  .market-strip,
  .review-strip {
    grid-template-columns: 1fr;
  }

  .quote-spark {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .compare-shell {
    width: min(100vw - 18px, 1480px);
  }

  .study-section {
    padding: 14px;
  }

  .position-grid,
  .ratio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .price-step {
    flex-wrap: wrap;
  }
}
