:root {
  --bg: #0b0a10;
  --panel: #14121c;
  --panel-2: #1b1827;
  --border: #2a2438;
  --accent: #6e56f7;
  --accent-2: #c084fc;
  --accent-soft: rgba(110, 86, 247, 0.35);
  --accent-faint: rgba(110, 86, 247, 0.12);
  --text: #edebf5;
  --text-muted: #9b94ae;
  --up: #34d399;
  --down: #f87171;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  min-height: 100vh;
}

/* faint grid that fades out toward the bottom */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(110, 86, 247, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 86, 247, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
}

.glow-top {
  top: -320px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 900px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
}

.glow-bottom {
  right: -260px;
  bottom: -320px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.18) 0%, transparent 65%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* top bar */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wordmark {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(20, 18, 28, 0.7);
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pill.ready::before {
  background: var(--up);
  box-shadow: 0 0 10px var(--up);
}

.status-pill.loading::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}


/* layout */

.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.content {
  min-width: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--accent-faint);
  border-color: var(--accent-soft);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-btn.spinning svg {
  animation: spin 0.9s linear infinite;
}

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

.drawer-btn,
.drawer-close {
  display: none;
}

/* sidebar */

.sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 0 40px -16px var(--accent-soft);
}

.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.side-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.side-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
}

.side-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.side-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 14px 6px;
  text-align: center;
}

.side-note {
  color: var(--down);
  font-size: 0.76rem;
  margin-top: 8px;
  line-height: 1.4;
}

.watchlist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.watch-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-display);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.watch-row:hover {
  background: var(--accent-faint);
}

.watch-row.active {
  border-color: var(--accent-soft);
  background: var(--accent-faint);
}

.watch-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.watch-symbol {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
}

.spark {
  width: 100%;
  height: 26px;
  display: block;
}

.watch-row.up .spark,
.watch-row.up .watch-pct {
  color: var(--up);
}

.watch-row.down .spark,
.watch-row.down .watch-pct {
  color: var(--down);
}

.watch-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-family: var(--font-mono);
  padding-right: 14px;
}

.watch-last {
  font-size: 0.8rem;
}

.watch-pct {
  font-size: 0.7rem;
}

.watch-loading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  grid-column: 2 / 4;
  padding-right: 14px;
  animation: fade 1.2s ease-in-out infinite;
}

@keyframes fade {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.watch-remove {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.watch-row:hover .watch-remove,
.watch-row:focus-within .watch-remove {
  opacity: 1;
}

.watch-remove:hover {
  background: rgba(248, 113, 113, 0.18);
  color: var(--down);
}

.recents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.recent-chip.active {
  border-color: var(--accent-soft);
}

.recent-load,
.recent-star {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 5px 8px 5px 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.recent-star {
  padding: 5px 9px 5px 4px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}

.recent-load:hover,
.recent-star:hover {
  background: var(--accent-faint);
}

.recent-star.on {
  color: #fbbf24;
}

/* star */

.star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  align-self: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.star-btn svg path {
  fill-opacity: 0;
  transition: fill-opacity 0.15s ease;
}

.star-btn:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.star-btn.on {
  color: #fbbf24;
}

.star-btn.on svg path {
  fill-opacity: 1;
}

.star-btn.pop svg {
  animation: starPop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.4);
}

@keyframes starPop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.star-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drawer-backdrop {
  display: none;
}

/* search */

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

#ticker-input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#ticker-input::placeholder {
  color: var(--text-muted);
}

#ticker-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-bar button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.search-bar button:hover {
  background: #7d69f9;
  box-shadow: 0 0 22px -4px var(--accent);
}

.search-bar button:disabled {
  opacity: 0.6;
  cursor: wait;
  box-shadow: none;
}

.search-bar button:focus-visible,
#ticker-input:focus-visible,
.segmented button:focus-visible,
.control-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* controls row */

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.segmented button,
.control-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.segmented button:hover,
.control-btn:hover {
  color: var(--text);
  background: var(--accent-faint);
}

.segmented button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px -2px var(--accent);
}

.control-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.count-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 1px 7px;
}

/* indicator dropdown */

.dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 330px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85), 0 0 40px -18px var(--accent-soft);
  z-index: 30;
}

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

.ind-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ind-row:hover {
  background: var(--accent-faint);
}

.ind-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
}

.ind-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ind-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.ind-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* switch */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
  position: relative;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.18s ease;
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: #fff;
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status-message {
  min-height: 20px;
  color: var(--down);
  font-size: 0.9rem;
  margin: 0 0 14px 4px;
}

/* chart panel */

.chart-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 0 60px -12px var(--accent-soft);
  backdrop-filter: blur(20px);
  animation: panelReveal 0.6s ease-out;
}

.chart-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(110, 86, 247, 0.08), transparent 38%, transparent 62%, rgba(192, 132, 252, 0.06));
  pointer-events: none;
}

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

.chart-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.chart-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-symbol {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.35rem;
}

.chart-price {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--text);
}

.chart-change {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
}

.chart-change.up,
.stat-value.up {
  color: var(--up);
}

.chart-change.down,
.stat-value.down {
  color: var(--down);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 120px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.bias-track {
  display: block;
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-top: 4px;
}

.bias-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease;
}

.bias-fill.up {
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
}

.bias-fill.down {
  background: var(--down);
  box-shadow: 0 0 8px var(--down);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 440px;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.chart-panel.is-loading .chart-container {
  opacity: 0.35;
  filter: blur(2px);
}

.skeleton {
  height: 440px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 45%, var(--panel) 90%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

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

.empty-state {
  position: relative;
  text-align: center;
  color: var(--text-muted);
  padding: 110px 20px;
  font-size: 0.95rem;
}

.legend {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}


/* snapshot */

.snapshot {
  position: relative;
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 0 40px -18px var(--accent-soft);
  animation: panelReveal 0.5s ease-out;
}

.snap-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.snap-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.snap-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.snap-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.snap-market {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
}

.snap-market:empty {
  display: none;
}

.snap-market::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.snap-market.open::before {
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
}

.snap-market.closed::before {
  background: var(--down);
}

.snap-range {
  margin-bottom: 18px;
}

.range-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.range-end {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.range-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}

.range-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.range-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-soft);
  transform: translate(-50%, -50%);
  transition: left 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.snap-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.snap-tile {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(11, 10, 16, 0.55);
  border: 1px solid var(--border);
  min-height: 62px;
  animation: tileIn 0.45s ease-out both;
}

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

.snap-tile.down .snap-value {
  color: var(--down);
}

.snap-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.snap-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.skeleton-tile {
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 45%, var(--panel) 90%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.snap-note {
  margin: 14px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.snap-note:empty {
  display: none;
}


/* mode toggle and fullscreen */

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented.small button {
  padding: 5px 9px;
  font-size: 0.74rem;
}

.fullscreen-btn {
  margin-left: auto;
}

.chart-panel.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  border-radius: 0;
  border: none;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
  animation: none;
}

.chart-panel.fullscreen .chart-container,
.chart-panel.fullscreen .skeleton {
  flex: 1 1 auto;
  height: auto;
  min-height: 320px;
}

.chart-panel.fullscreen .fullscreen-btn {
  color: var(--text);
  border-color: var(--accent-soft);
}

body.has-fullscreen {
  overflow: hidden;
}

/* paper trading dock */

.paper-dock {
  position: relative;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: dockIn 0.4s ease-out;
}

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

.paper-dock::before {
  content: '';
  position: absolute;
  inset: 8px -12px -8px;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.paper-dock.hit-up::before {
  background: radial-gradient(ellipse at 70% 50%, rgba(52, 211, 153, 0.16), transparent 60%);
  animation: hit 0.7s ease-out;
}

.paper-dock.hit-down::before {
  background: radial-gradient(ellipse at 70% 50%, rgba(248, 113, 113, 0.16), transparent 60%);
  animation: hit 0.7s ease-out;
}

@keyframes hit {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

.paper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.replay-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 380px;
}

.replay-btn {
  min-width: 78px;
  justify-content: center;
}

.replay-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.replay-btn:disabled,
.trade-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.replay-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 160px;
  min-width: 140px;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.paper-dock.playing .progress-fill {
  box-shadow: 0 0 10px var(--accent-soft);
}

.replay-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.trade-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#paper-qty {
  width: 82px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

#paper-qty:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.trade-btn {
  position: relative;
  border: none;
  border-radius: 9px;
  padding: 9px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #071a12;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.trade-btn.buy {
  background: var(--up);
}

.trade-btn.sell {
  background: var(--down);
  color: #2a0a0a;
}

.trade-btn:not(:disabled):hover {
  filter: brightness(1.08);
  box-shadow: 0 0 20px -4px currentColor;
}

.trade-btn:not(:disabled):active {
  transform: scale(0.96);
}

.trade-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0;
  pointer-events: none;
}

.trade-btn.buy::after {
  border-color: var(--up);
}

.trade-btn.sell::after {
  border-color: var(--down);
}

.trade-btn.pulse::after {
  animation: ring 0.6s ease-out;
}

@keyframes ring {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}

.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.paper-stats {
  gap: 8px 26px;
  justify-content: flex-start;
}

.paper-stats .stat {
  min-width: 108px;
}

.equity-stat {
  position: relative;
}

.equity-stat .stat-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.float-tag {
  position: absolute;
  left: 0;
  top: -6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
}

.float-tag.up {
  color: var(--up);
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
}

.float-tag.down {
  color: var(--down);
  text-shadow: 0 0 12px rgba(248, 113, 113, 0.7);
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-30px); }
}

.paper-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.balance-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.balance-field input {
  width: 84px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.paper-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--down);
}

.paper-summary {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-faint);
  border: 1px solid var(--accent-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.paper-summary .up {
  color: var(--up);
}

.paper-summary .down {
  color: var(--down);
}

.paper-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.log-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(11, 10, 16, 0.5);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.log-side {
  font-weight: 600;
}

.log-row.buy .log-side {
  color: #fbbf24;
}

.log-row.sell .log-side {
  color: var(--text-muted);
}

.log-time {
  color: var(--text-muted);
}

.log-pnl.up {
  color: var(--up);
}

.log-pnl.down {
  color: var(--down);
}

.paper-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .mode-toggle button {
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .trade-controls {
    width: 100%;
  }

  .trade-btn {
    flex: 1;
  }

  .paper-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}

.mute-btn .slash {
  opacity: 0;
}

.mute-btn.muted .wave {
  opacity: 0.25;
}

.mute-btn.muted .slash {
  opacity: 1;
}


/* info tabs and news */

.info-tabs {
  display: inline-flex;
  gap: 2px;
  background: rgba(11, 10, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 18px;
}

.info-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.info-tab:hover {
  color: var(--text);
}

.info-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px -2px var(--accent);
}

.info-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.news-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(11, 10, 16, 0.55);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  min-height: 84px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  animation: tileIn 0.45s ease-out both;
}

.news-card:not(.skeleton-tile):hover {
  border-color: var(--accent-soft);
  background: var(--accent-faint);
  transform: translateY(-1px);
}

.news-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.news-card:not(:has(.news-thumb)) {
  grid-template-columns: 1fr;
}

.news-thumb {
  width: 96px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.news-meta {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.news-source {
  color: var(--accent-2);
}

.news-headline {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

.news-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.news-note {
  margin: 12px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.news-note.error {
  color: var(--down);
}

.news-note.setup {
  color: var(--accent-2);
}

@media (max-width: 720px) {
  .news-card {
    grid-template-columns: 72px 1fr;
  }

  .news-thumb {
    width: 72px;
    height: 54px;
  }
}

/* footer */

.disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 560px;
  margin: 22px auto 0;
  line-height: 1.55;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .chart-panel,
  .skeleton,
  .status-pill.loading::before {
    animation: none;
  }

  .bias-fill,
  .chart-container,
  .sidebar,
  .drawer-backdrop {
    transition: none;
  }

  .icon-btn.spinning svg,
  .star-btn.pop svg,
  .watch-loading,
  .snapshot,
  .snap-tile,
  .skeleton-tile,
  .news-card,
  .paper-dock,
  .paper-dock::before,
  .trade-btn::after,
  .float-tag,
  .shake {
    animation: none;
  }

  .range-fill,
  .range-marker {
    transition: none;
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .drawer-btn,
  .drawer-close {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    padding: 16px 14px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 60;
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 4, 10, 0.6);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 50;
  }

  .drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  body.drawer-open {
    overflow: hidden;
  }

  .watch-remove {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 20px 14px 48px;
  }

  .search-bar {
    flex-direction: column;
  }

  .segmented {
    width: 100%;
    justify-content: space-between;
  }

  .segmented button {
    flex: 1;
    padding: 7px 4px;
  }

  .controls-right {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-panel {
    right: auto;
    left: 0;
    width: min(330px, calc(100vw - 28px));
  }

  .chart-panel {
    padding: 16px;
  }

  .chart-container,
  .skeleton {
    height: 320px;
  }

  .empty-state {
    padding: 70px 16px;
  }

  .stat {
    min-width: 100px;
  }
}
