*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08080d;
  --bg-elev: #0c0c14;
  --panel: #10101a;
  --panel-soft: #141420;
  --card: #161622;
  --card-alt: #1a1a28;
  --border: #232337;
  --border-soft: rgba(255, 255, 255, 0.05);
  --text: #e8e8ec;
  --text-dim: #8b8b9a;
  --text-muted: #b6b6c2;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.28);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #eab308;
  --green: var(--success);
  --red: var(--danger);
  --yellow: var(--warning);
  --accent: #d4a843;
  --accent-dim: #8b7355;
  --accent-rgb: 212, 168, 67;
  --accent-strong: #f0d78c;
  --accent-deep: #a67c2e;
  --accent-on: #08080d;
  --gold: var(--accent);
  --gold-dim: var(--accent-dim);
  --header-grad-start: #0c0c14;
  --header-grad-end: #12121f;
  --header-sheen: rgba(212, 168, 67, 0.45);
  --panel-glass: rgba(16, 16, 26, 0.95);
  --panel-glass-soft: rgba(16, 16, 26, 0.72);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --chip-hover: rgba(var(--accent-rgb), 0.12);
  --chip-active: rgba(var(--accent-rgb), 0.18);
  --row-hover: rgba(var(--accent-rgb), 0.05);
  --news-grad-start: #0d0d18;
  --news-grad-end: #111120;
  --news-label-text: var(--accent-on);
  --chart-bg: #10101a;
  --chart-text: #8a8a9a;
  --chart-grid: rgba(40, 40, 58, 0.55);
  --chart-scale: #2a2a3c;
  --bb-mid: rgba(var(--accent-rgb), 0.55);
  --bb-band: rgba(var(--accent-rgb), 0.22);
  --toast-bg: rgba(20, 20, 32, 0.94);
}

html[data-theme="light"] {
  --bg: #eef3f9;
  --bg-elev: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f5f7fb;
  --card: #ffffff;
  --card-alt: #f7f9fc;
  --border: #d7e1ee;
  --border-soft: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --text-dim: #64748b;
  --text-muted: #475569;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --header-grad-start: #ffffff;
  --header-grad-end: #f4f7fb;
  --header-sheen: rgba(var(--accent-rgb), 0.35);
  --panel-glass: rgba(255, 255, 255, 0.96);
  --panel-glass-soft: rgba(255, 255, 255, 0.72);
  --chip-bg: rgba(15, 23, 42, 0.04);
  --chip-hover: rgba(var(--accent-rgb), 0.1);
  --chip-active: rgba(var(--accent-rgb), 0.15);
  --row-hover: rgba(var(--accent-rgb), 0.09);
  --news-grad-start: #f8fafc;
  --news-grad-end: #eef2f7;
  --chart-bg: #ffffff;
  --chart-text: #64748b;
  --chart-grid: rgba(148, 163, 184, 0.28);
  --chart-scale: #d7e1ee;
  --toast-bg: rgba(255, 255, 255, 0.96);
}

html[data-accent="gold"] {
  --accent: #d4a843;
  --accent-dim: #8b7355;
  --accent-rgb: 212, 168, 67;
  --accent-strong: #f0d78c;
  --accent-deep: #a67c2e;
  --accent-on: #08080d;
}

html[data-theme="light"][data-accent="gold"] {
  --accent: #96640d;
  --accent-dim: #6b4906;
  --accent-rgb: 150, 100, 13;
  --accent-strong: #c99a39;
  --accent-deep: #6b4906;
  --accent-on: #ffffff;
  --bb-mid: rgba(107, 73, 6, 0.95);
  --bb-band: rgba(107, 73, 6, 0.58);
}

html[data-accent="blue"] {
  --accent: #3b82f6;
  --accent-dim: #5d7cc0;
  --accent-rgb: 59, 130, 246;
  --accent-strong: #93c5fd;
  --accent-deep: #1d4ed8;
  --accent-on: #ffffff;
}

html[data-accent="emerald"] {
  --accent: #10b981;
  --accent-dim: #3c8f79;
  --accent-rgb: 16, 185, 129;
  --accent-strong: #6ee7b7;
  --accent-deep: #047857;
  --accent-on: #ffffff;
}

html[data-accent="violet"] {
  --accent: #8b5cf6;
  --accent-dim: #7c67bb;
  --accent-rgb: 139, 92, 246;
  --accent-strong: #c4b5fd;
  --accent-deep: #6d28d9;
  --accent-on: #ffffff;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg-elev), var(--bg));
}

button, input, select {
  font: inherit;
}

/* ─── Header ─── */
.header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--header-grad-start), var(--header-grad-end));
  border-bottom: 1px solid var(--border);
  position: relative;
  box-shadow: var(--shadow-soft);
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--header-sheen), transparent);
}

.header-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.18));
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent), var(--accent-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 300;
  letter-spacing: 2px;
  margin-top: 1px;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-clock {
  font-size: 13px;
  color: var(--gold-dim);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.header-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--green);
}

.header-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

.theme-toolbar {
  position: relative;
}

.theme-toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-glass) 88%, transparent);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.18s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.theme-toolbar-toggle:hover,
.theme-toolbar.open .theme-toolbar-toggle,
.theme-toolbar:focus-within .theme-toolbar-toggle {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: color-mix(in srgb, var(--panel-glass) 96%, transparent);
  box-shadow: var(--shadow-soft);
}

.theme-toolbar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
  flex-shrink: 0;
}

.theme-toolbar-text {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.theme-toolbar-arrow {
  width: 14px;
  height: 14px;
  transition: transform 0.18s ease;
}

.theme-toolbar.open .theme-toolbar-arrow {
  transform: rotate(180deg);
}

.theme-toolbar-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 212px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.theme-toolbar.open .theme-toolbar-panel,
.theme-toolbar:hover .theme-toolbar-panel,
.theme-toolbar:focus-within .theme-toolbar-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.theme-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-field-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.theme-group,
.accent-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-mode-btn {
  min-width: 54px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-mode-btn:hover,
.theme-mode-btn.active {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--chip-active);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.accent-btn {
  --swatch: var(--accent);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--border), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.accent-btn:hover,
.accent-btn.active {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.22), inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.accent-gold { --swatch: #d4a843; }
.accent-blue { --swatch: #3b82f6; }
.accent-emerald { --swatch: #10b981; }
.accent-violet { --swatch: #8b5cf6; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ─── Ticker ─── */
.ticker {
  height: 46px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  animation: tickScroll 30s linear infinite;
  white-space: nowrap;
}

.ticker-track:hover { animation-play-state: paused; }

.tick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  height: 100%;
}

.tick-name {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.tick-price {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tick-change {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tick-up { color: var(--green); }
.tick-down { color: var(--red); }

@keyframes tickScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ─── Main Grid ─── */
.main {
  display: grid;
  grid-template-columns: 1fr 320px 300px;
  gap: 0;
  height: calc(100vh - 56px - 46px - 220px - 42px);
  min-height: 320px;
}

.col {
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: var(--panel);
}

.col:last-child { border-right: none; }

.col-label,
.bottom-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: linear-gradient(180deg, var(--panel-glass) 0%, var(--panel-glass-soft) 72%, transparent);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-label .d,
.bottom-label .d {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.col-wrapper {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
  background: var(--panel);
}

.col-wrapper .col { border-right: none; }
.col-top { border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.col-bottom { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hero-panel { padding-bottom: 16px; overflow: visible; height: auto; }

/* ─── Mini Charts ─── */
.mini-grid {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  height: 100%;
  padding-top: 28px;
}

.mini-item {
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.mini-item:last-child { border-bottom: none; }

.mini-label {
  position: absolute;
  top: 4px;
  left: 10px;
  font-size: 10px;
  color: var(--gold-dim);
  z-index: 3;
  letter-spacing: 0.5px;
  font-weight: 500;
  pointer-events: none;
}

.mini-chart { width: 100%; height: 100%; }

/* ─── Technical Analysis Panel ─── */
.ta-panel {
  padding: 36px 12px 8px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ta-panel::-webkit-scrollbar,
.calendar-wrap::-webkit-scrollbar {
  width: 4px;
}

.ta-panel::-webkit-scrollbar-thumb,
.calendar-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.ta-gauge-wrap { text-align: center; padding: 8px 0; flex-shrink: 0; }
.ta-verdict { font-size: 16px; font-weight: 700; letter-spacing: 1px; margin-top: 4px; }
.ta-sections { flex: 1; overflow-y: auto; min-height: 0; }
.ta-section { margin-bottom: 6px; flex-shrink: 0; }

.ta-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1.5px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

/* ─── TA Hero ─── */
.ta-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.ta-hero-price { text-align: center; margin-bottom: 18px; }

.hero-val {
  font-size: 38px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.hero-pct {
  font-size: 14px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 6px;
}

.ta-hero-bands {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 6px;
}

.band-item {
  flex: 1;
  text-align: center;
  background: var(--card-alt);
  padding: 8px 2px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.band-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding: 2px 4px;
  border-radius: 3px;
  display: inline-block;
}

.band-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ta-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  padding: 4px 0;
}

.ta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--border-soft);
}

.ta-row .name { color: var(--text-dim); }
.ta-row .val { font-variant-numeric: tabular-nums; font-weight: 500; margin-left: auto; margin-right: 6px; }
.ta-row .signal { font-size: 10px; font-weight: 600; padding: 1px 4px; border-radius: 3px; }
.sig-buy { color: var(--green); background: rgba(34, 197, 94, 0.1); }
.sig-sell { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.sig-neutral { color: var(--yellow); background: rgba(234, 179, 8, 0.12); }

.ta-summary {
  display: flex;
  justify-content: space-around;
  padding: 8px 4px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.ta-summary .s-item { text-align: center; }
.ta-summary .s-label { font-size: 9px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 2px; }

/* ─── Sentiment & Volume Panel ─── */
.vix-wrap, .vol-wrap { text-align: center; padding: 8px 0 12px; }

.vix-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.vix-bar-bg {
  width: 80%;
  margin: 0 auto 8px;
  height: 6px;
  background: var(--chip-bg);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.vix-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  border-radius: 3px;
  transition: width 0.3s;
}

.vix-labels {
  display: flex;
  justify-content: space-between;
  width: 80%;
  margin: 0 auto;
  font-size: 10px;
  color: var(--text-dim);
}

.vol-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.vol-sub { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* ─── Bottom: Calendar ─── */
.bottom {
  height: 220px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  position: relative;
}

.bottom-panel { position: relative; overflow: hidden; height: 100%; }

.calendar-wrap {
  padding-top: 32px;
  height: 100%;
  overflow-y: auto;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.calendar-table th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--gold-dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.calendar-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
}

.calendar-table tr:hover td {
  background: var(--row-hover);
  color: var(--text);
}

.impact-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.impact-high { background: var(--red); }
.impact-medium { background: var(--yellow); }
.impact-low { background: var(--text-dim); }
.flag { font-size: 14px; margin-right: 4px; }

/* ─── News Ticker ─── */
.news-ticker {
  height: 42px;
  border-top: 1px solid var(--border);
  background: linear-gradient(90deg, var(--news-grad-start), var(--news-grad-end));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.news-ticker .news-label {
  flex-shrink: 0;
  padding: 0 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--news-label-text);
  background: linear-gradient(135deg, var(--accent-strong), var(--accent), var(--accent-deep));
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
  text-transform: uppercase;
  position: relative;
}

.news-ticker .news-label::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 0;
  width: 24px;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), transparent);
  z-index: 2;
}

.news-track-wrap {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}

.news-track {
  display: flex;
  white-space: nowrap;
  animation: marquee var(--dur, 80s) linear infinite;
  will-change: transform;
}

.news-track:hover { animation-play-state: paused; }

.news-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 32px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: default;
  transition: color 0.2s;
}

.news-item:hover { color: var(--text); }
.news-item .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); opacity: 0.6; flex-shrink: 0; }
.news-item .headline { letter-spacing: 0.3px; }
.news-item .src { font-size: 10px; color: var(--gold-dim); margin-left: 4px; opacity: 0.8; }

@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ─── Timeframe Selector ─── */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.chart-header .title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeframes {
  display: flex;
  gap: 4px;
  pointer-events: auto;
}

.tf-btn {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
  outline: none;
}

.tf-btn:hover {
  background: var(--chip-hover);
  color: var(--gold);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.tf-btn.active {
  background: var(--accent-deep);
  color: #ffffff;
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.28);
}

/* ─── Mobile Responsiveness ─── */
@media (max-width: 1024px) {
  html, body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body {
    display: flex;
    flex-direction: column;
  }

  .main { display: contents; }
  .header { order: 1; flex-wrap: wrap; padding: 10px 16px; }
  .ticker { order: 2; }
  .col:first-child { order: 3; height: 450px; flex: none; border-right: none; border-bottom: 1px solid var(--border); }
  .bottom { order: 4; height: auto; min-height: 300px; border-bottom: 1px solid var(--border); }
  .col-wrapper { order: 5; border-right: none; border-bottom: 1px solid var(--border); }
  .col:nth-child(3) { order: 6; height: 600px; border-right: none; }
  .news-ticker { order: 7; }
  .col { height: auto; min-height: auto; }
  .col-bottom { height: auto; }
  .ta-panel { height: auto; overflow: visible; padding-top: 40px; }
  .mini-grid { height: 100%; }
  .calendar-wrap { height: auto; overflow-y: visible; padding-bottom: 20px; }
  .header-right { width: 100%; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; }
  .theme-toolbar { order: 3; }
  .theme-toolbar-panel { right: auto; left: 0; }
  .ticker-track { animation-duration: 20s; }
}

@media (max-width: 640px) {
  .header-title { font-size: 18px; }
  .header-sub { letter-spacing: 1px; }
  .theme-toolbar-panel { min-width: 200px; }
  .theme-field { align-items: flex-start; flex-direction: column; gap: 6px; }
  .theme-group { width: 100%; }
  .theme-mode-btn { flex: 1; }
  .timeframes { flex-wrap: wrap; justify-content: flex-end; }
  .chart-header { align-items: flex-start; gap: 8px; }
}

