:root {
  color-scheme: dark;
  --bg: #070b0f;
  --panel: #0d1319;
  --panel-2: #101820;
  --line: rgba(151, 174, 194, 0.13);
  --line-strong: rgba(151, 174, 194, 0.22);
  --text: #edf4f7;
  --muted: #84919e;
  --muted-2: #5f6b76;
  --green: #20d6a1;
  --green-soft: rgba(32, 214, 161, 0.12);
  --red: #ff5f70;
  --red-soft: rgba(255, 95, 112, 0.12);
  --amber: #f4b860;
  --amber-soft: rgba(244, 184, 96, 0.12);
  --cyan: #56c7f3;
  --ema20: #ff6688;
  --ema50: #f3a54b;
  --ema200: #8794a8;
  --radius: 18px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(32, 214, 161, 0.07), transparent 31rem),
    radial-gradient(circle at 90% 0%, rgba(86, 199, 243, 0.05), transparent 28rem),
    var(--bg);
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1800px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 22px 18px;
}

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(360px, 1fr);
  align-items: center;
  gap: 26px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 11, 15, 0.87);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-block,
.market-strip,
.header-actions,
.market-name,
.chart-title-row,
.indicator-strip,
.chart-footer,
.position-header {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(32, 214, 161, 0.24);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(32, 214, 161, 0.16), rgba(86, 199, 243, 0.04));
  box-shadow: inset 0 0 22px rgba(32, 214, 161, 0.05);
}

.brand-mark span {
  display: block;
  border-radius: 3px 3px 1px 1px;
  background: var(--green);
}

.brand-mark span:nth-child(1) { height: 42%; opacity: 0.55; }
.brand-mark span:nth-child(2) { height: 72%; opacity: 0.8; }
.brand-mark span:nth-child(3) { height: 100%; }

.eyebrow,
.panel-kicker {
  margin: 0 0 3px;
  color: var(--muted-2);
  font: 700 9px/1.2 var(--mono);
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.market-strip {
  justify-content: center;
  gap: 14px;
}

.market-name {
  gap: 7px;
}

.symbol {
  font: 720 13px/1 var(--mono);
  letter-spacing: -0.02em;
}

.badge,
.mode-pill,
.subtle-chip,
.return-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.badge {
  padding: 4px 7px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
}

#headerPrice {
  min-width: 92px;
  font: 700 17px/1 var(--mono);
  text-align: right;
}

.market-change {
  min-width: 63px;
  font: 700 12px/1 var(--mono);
}

.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.neutral { color: var(--muted) !important; }

.header-actions {
  justify-content: flex-end;
  gap: 9px;
}

.connection-pill,
.mode-pill,
.ghost-button,
.text-button,
.timeframe-tabs button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.connection-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.connection-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(244, 184, 96, 0.08);
}

.connection-pill.live {
  color: #b8f5e4;
  border-color: rgba(32, 214, 161, 0.2);
  background: var(--green-soft);
}

.connection-pill.live i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(32, 214, 161, 0.1), 0 0 12px rgba(32, 214, 161, 0.6);
  animation: pulse 2s infinite;
}

.connection-pill.error {
  color: #ffc4cb;
  border-color: rgba(255, 95, 112, 0.2);
  background: var(--red-soft);
}

.connection-pill.error i { background: var(--red); }

@keyframes pulse {
  50% { opacity: 0.42; }
}

.mode-pill {
  min-height: 30px;
  padding: 0 10px;
  color: var(--cyan);
  border: 1px solid rgba(86, 199, 243, 0.18);
  background: rgba(86, 199, 243, 0.07);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.04em;
}

.ghost-button,
.text-button,
.timeframe-tabs button {
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ghost-button {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.ghost-button[aria-pressed="false"] {
  color: var(--muted);
  background: transparent;
}

.ghost-button:hover,
.text-button:hover,
.timeframe-tabs button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.ghost-button:active,
.text-button:active,
.timeframe-tabs button:active {
  transform: translateY(1px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 40%),
    var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.chart-panel { grid-column: span 8; }
.side-stack { grid-column: span 4; display: grid; gap: 14px; }
.account-panel { grid-column: span 4; }
.performance-panel { grid-column: span 4; }
.history-panel { grid-column: span 4; }

.panel-heading {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading.compact {
  min-height: 57px;
  padding: 13px 16px;
}

.chart-heading {
  align-items: flex-end;
}

.chart-title-row {
  gap: 9px;
}

.subtle-chip {
  min-height: 22px;
  padding: 0 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  font: 650 9px/1 var(--mono);
}

.timeframe-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #090e13;
}

.timeframe-tabs button {
  min-width: 48px;
  height: 28px;
  padding: 0 9px;
  color: var(--muted);
  border-color: transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}

.timeframe-tabs button.active {
  color: var(--text);
  border-color: var(--line-strong);
  background: #172028;
  box-shadow: 0 3px 8px rgba(0,0,0,0.22);
}

.indicator-strip {
  min-height: 36px;
  gap: 15px;
  padding: 0 18px;
  overflow-x: auto;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font: 600 9px/1 var(--mono);
  scrollbar-width: none;
}

.indicator-strip::-webkit-scrollbar { display: none; }
.indicator-strip span { white-space: nowrap; }
.indicator-strip b { color: #bbc5cd; font-weight: 650; }

.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
}

.dot.ema20 { background: var(--ema20); }
.dot.ema50 { background: var(--ema50); }
.dot.ema200 { background: var(--ema200); }

.chart-wrap {
  height: 520px;
  position: relative;
  background:
    linear-gradient(rgba(151, 174, 194, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 174, 194, 0.02) 1px, transparent 1px);
  background-size: 100% 70px, 100px 100%;
}

#marketChart,
#equityChart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tooltip {
  max-width: 235px;
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 9px 10px;
  color: #cdd7de;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(8, 13, 18, 0.94);
  box-shadow: 0 8px 22px rgba(0,0,0,0.26);
  font: 600 9px/1.65 var(--mono);
  backdrop-filter: blur(10px);
}

.chart-tooltip b { color: var(--text); }

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  background: rgba(13, 19, 25, 0.86);
  font-size: 11px;
}

.chart-empty[hidden] { display: none; }
.chart-empty p { margin-bottom: 0; }

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.chart-footer {
  min-height: 33px;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.02em;
}

.decision-panel,
.experts-panel {
  min-height: 0;
}

.timestamp {
  color: var(--muted-2);
  font: 600 9px/1 var(--mono);
}

.decision-hero {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 15px 10px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}

.decision-hero.long {
  border-color: rgba(32,214,161,0.25);
  background: linear-gradient(110deg, rgba(32,214,161,0.13), rgba(32,214,161,0.02));
}

.decision-hero.short {
  border-color: rgba(255,95,112,0.25);
  background: linear-gradient(110deg, rgba(255,95,112,0.13), rgba(255,95,112,0.02));
}

.decision-hero > div:first-child p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.decision-hero > div:first-child strong {
  display: block;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.decision-hero.long > div:first-child strong { color: var(--green); }
.decision-hero.short > div:first-child strong { color: var(--red); }

.confidence-ring {
  --score: 0;
  width: 60px;
  height: 60px;
  display: grid;
  place-content: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(var(--amber) calc(var(--score) * 1%), rgba(255,255,255,0.06) 0);
  text-align: center;
}

.confidence-ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: var(--panel-2);
}

.confidence-ring span,
.confidence-ring small {
  position: relative;
  z-index: 1;
}

.confidence-ring span {
  font: 720 15px/1 var(--mono);
}

.confidence-ring small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 7px;
}

.decision-summary {
  min-height: 38px;
  margin: 0;
  padding: 0 16px 10px;
  color: #aab5be;
  font-size: 10px;
  line-height: 1.55;
}

.decision-levels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.decision-levels div {
  min-width: 0;
  padding: 10px 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.decision-levels div:nth-child(2n) { border-right: 0; }
.decision-levels div:nth-last-child(-n + 2) { border-bottom: 0; }

.decision-levels span,
.decision-levels b {
  display: block;
}

.decision-levels span {
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.decision-levels b {
  overflow: hidden;
  color: #c9d2d9;
  font: 650 10px/1 var(--mono);
  text-overflow: ellipsis;
}

.risk-gate {
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 15px 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,0.018);
}

.risk-gate.pass {
  border-color: rgba(32,214,161,0.18);
  background: rgba(32,214,161,0.06);
}

.risk-gate.block {
  border-color: rgba(255,95,112,0.2);
  background: rgba(255,95,112,0.06);
}

.risk-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  color: var(--amber);
  border: 1px solid rgba(244,184,96,0.28);
  border-radius: 8px;
  background: var(--amber-soft);
  font: 750 10px/1 var(--mono);
}

.risk-gate.pass .risk-icon { color: var(--green); border-color: rgba(32,214,161,.25); background: var(--green-soft); }
.risk-gate.block .risk-icon { color: var(--red); border-color: rgba(255,95,112,.25); background: var(--red-soft); }

.risk-gate b {
  display: block;
  margin-bottom: 3px;
  font-size: 9px;
}

.risk-gate p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.experts-panel {
  display: flex;
  flex-direction: column;
}

.expert-list {
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  padding: 7px 8px 9px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.expert-group-heading {
  position: sticky;
  top: -7px;
  z-index: 1;
  padding: 8px 7px 5px;
  color: var(--muted-2);
  background: rgba(13, 19, 25, 0.96);
  font: 700 7px/1 var(--mono);
  letter-spacing: 0.14em;
}

.expert-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 7px;
  border-bottom: 1px solid rgba(151,174,194,0.08);
}

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

.expert-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.035);
  font: 750 8px/1 var(--mono);
}

.expert-row.long .expert-icon { color: var(--green); background: var(--green-soft); }
.expert-row.short .expert-icon { color: var(--red); background: var(--red-soft); }
.expert-row.wait .expert-icon { color: var(--amber); background: var(--amber-soft); }

.expert-copy { min-width: 0; }

.expert-copy b {
  display: block;
  margin-bottom: 3px;
  font-size: 9px;
  font-weight: 700;
}

.expert-copy p {
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expert-vote {
  min-width: 37px;
  text-align: right;
  font: 720 8px/1 var(--mono);
}

.expert-row.long .expert-vote { color: var(--green); }
.expert-row.short .expert-vote { color: var(--red); }
.expert-row.wait .expert-vote { color: var(--amber); }

.expert-skeleton {
  height: 41px;
  margin: 7px;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(255,255,255,.025), rgba(255,255,255,.055), rgba(255,255,255,.025));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer { to { background-position: -200% 0; } }

.text-button {
  padding: 6px 8px;
  color: var(--muted);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 650;
}

.equity-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 17px 17px 12px;
}

.equity-main > div > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.equity-main strong {
  font: 730 25px/1 var(--mono);
  letter-spacing: -0.05em;
}

.equity-main strong small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0;
}

.return-badge {
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  font: 700 9px/1 var(--mono);
}

.return-badge.positive { border-color: rgba(32,214,161,.2); background: var(--green-soft); }
.return-badge.negative { border-color: rgba(255,95,112,.2); background: var(--red-soft); }

.account-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.account-metrics > div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.account-metrics > div:nth-child(3n) { border-right: 0; }
.account-metrics > div:nth-last-child(-n + 3) { border-bottom: 0; }

.account-metrics span,
.account-metrics b {
  display: block;
}

.account-metrics span {
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.account-metrics b {
  overflow: hidden;
  color: #cbd4da;
  font: 650 10px/1 var(--mono);
  text-overflow: ellipsis;
}

.position-card {
  margin: 12px 16px 15px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,0.018);
}

.position-card.long { border-color: rgba(32,214,161,.2); background: rgba(32,214,161,.045); }
.position-card.short { border-color: rgba(255,95,112,.2); background: rgba(255,95,112,.045); }

.position-header {
  justify-content: space-between;
  margin-bottom: 10px;
}

.position-header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.position-header b {
  font: 700 10px/1 var(--mono);
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.position-grid span,
.position-grid b { display: block; }
.position-grid span { margin-bottom: 4px; color: var(--muted-2); font-size: 7px; }
.position-grid b { color: #bfc9d0; font: 630 9px/1 var(--mono); }

.equity-chart-wrap {
  height: 141px;
  margin: 4px 10px 0;
}

.performance-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.performance-metrics > div {
  min-width: 0;
  padding: 9px 7px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.performance-metrics > div:last-child { border-right: 0; }
.performance-metrics span,
.performance-metrics b { display: block; }
.performance-metrics span { margin-bottom: 5px; color: var(--muted-2); font-size: 7px; }
.performance-metrics b { overflow: hidden; color: #c8d1d8; font: 650 9px/1 var(--mono); text-overflow: ellipsis; }

.trade-table-wrap {
  max-height: 239px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid rgba(151,174,194,0.08);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted-2);
  background: var(--panel);
  font-size: 7px;
  font-weight: 650;
}

td {
  overflow: hidden;
  color: #aeb9c1;
  font: 600 8px/1 var(--mono);
  text-overflow: ellipsis;
}

th:nth-child(1), td:nth-child(1) { width: 23%; }
th:nth-child(2), td:nth-child(2) { width: 18%; }
th:nth-child(3), td:nth-child(3) { width: 13%; }
th:nth-child(4), td:nth-child(4) { width: 27%; }
th:nth-child(5), td:nth-child(5) { width: 19%; text-align: right; }

.empty-row td {
  height: 108px;
  color: var(--muted-2);
  text-align: center;
  font-family: inherit;
}

.trade-side.long { color: var(--green); }
.trade-side.short { color: var(--red); }

.disclaimer {
  padding: 14px 2px 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 30px));
  padding: 11px 13px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  color: #dce5ea;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(13,19,25,.96);
  box-shadow: 0 14px 35px rgba(0,0,0,.32);
  font-size: 10px;
  line-height: 1.45;
  transition: .2s ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1500px) {
  .chart-wrap { height: 550px; }
  .expert-list { max-height: 270px; }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .market-strip { justify-content: flex-end; }
  .header-actions { grid-column: 1 / -1; justify-content: flex-start; padding-bottom: 10px; }
  .chart-panel { grid-column: span 7; }
  .side-stack { grid-column: span 5; }
  .account-panel,
  .performance-panel { grid-column: span 6; }
  .history-panel { grid-column: span 12; }
}

@media (max-width: 820px) {
  .app-shell { padding: 0 10px 14px; }
  .topbar { position: static; min-height: auto; padding: 12px 0; gap: 11px; }
  .brand-block { grid-column: 1 / -1; }
  .market-strip { justify-content: flex-start; gap: 10px; }
  .header-actions { overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .header-actions::-webkit-scrollbar { display: none; }
  .mode-pill { display: none; }
  .dashboard-grid { gap: 10px; padding-top: 10px; }
  .chart-panel,
  .side-stack,
  .account-panel,
  .performance-panel,
  .history-panel { grid-column: span 12; }
  .side-stack { grid-template-columns: 1fr; }
  .chart-heading { align-items: flex-start; flex-direction: column; }
  .timeframe-tabs { width: 100%; }
  .timeframe-tabs button { flex: 1; }
  .chart-wrap { height: 360px; }
  .chart-footer span:nth-child(2) { display: none; }
  .expert-list { max-height: none; }
  .expert-group-heading { position: static; }
}

@media (max-width: 520px) {
  .market-name .badge { display: none; }
  #headerPrice { min-width: auto; font-size: 15px; }
  .market-change { min-width: auto; }
  .connection-pill { max-width: 132px; }
  .connection-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chart-wrap { height: 320px; }
  .indicator-strip { gap: 11px; }
  .decision-levels { grid-template-columns: 1fr 1fr; }
  .account-metrics { grid-template-columns: repeat(2, 1fr); }
  .account-metrics > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .account-metrics > div:nth-child(2n) { border-right: 0; }
  .account-metrics > div:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .account-metrics > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .position-grid { grid-template-columns: repeat(2, 1fr); }
  .performance-metrics { grid-template-columns: repeat(3, 1fr); }
  .performance-metrics > div:nth-child(3) { border-right: 0; }
  .performance-metrics > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .performance-metrics > div:nth-child(5) { border-right: 0; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  th:nth-child(1), td:nth-child(1) { width: 26%; }
  th:nth-child(3), td:nth-child(3) { width: 16%; }
  th:nth-child(4), td:nth-child(4) { width: 34%; }
  th:nth-child(5), td:nth-child(5) { width: 24%; }
}

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