html,
body {
  height: 100%;
}

:root {
  --bg: #050505;
  --panel: #0b0b0d;
  --panel-2: #08080a;
  --text: #f2f2f2;
  --muted: #a3a8b4;
  --accent: #f5f5f5;
  --accent-2: #d6d6d6;
  --danger: #ff6b6b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --scroll-thumb: linear-gradient(
    180deg,
    rgba(120, 255, 200, 0.65),
    rgba(76, 194, 255, 0.55)
  );
  --scroll-thumb-hover: linear-gradient(
    180deg,
    rgba(120, 255, 200, 0.8),
    rgba(76, 194, 255, 0.72)
  );
  --scroll-track: rgba(255, 255, 255, 0.04);
  --scroll-track-hover: rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05), transparent 24%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.04), transparent 22%),
    linear-gradient(135deg, #030303 0%, #0a0a0c 100%);
  color: var(--text);
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #0f0f11 0%, #070707 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.spark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: conic-gradient(from 180deg, rgba(255, 255, 255, 0.4), rgba(180, 180, 180, 0.5));
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.25));
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.header-controls select {
  min-width: 110px;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 14px;
}

.header-controls .field-inline {
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  gap: 6px;
}

.icon-button {
  padding: 8px 10px;
  font-size: 13px;
}

.icon-button[data-variant="close"],
#video-dialog-close {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.layout {
  display: grid;
  flex: 1;
  height: 100%;
  grid-template-columns: minmax(0, 1fr) 280px 64px;
  grid-template-areas: "chart controls rail";
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  align-content: stretch;
  min-height: 0;
}

.layout > * {
  min-width: 0;
}

.control-panel {
  grid-area: controls;
  max-width: 320px;
  padding: 14px;
  min-width: 0;
  align-self: stretch;
  height: 100%;
  overflow: auto;
}

.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(200deg, #0f0f12 0%, #09090c 60%, #0c0c10 100%);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
}

.panel.control-panel {
  overflow: auto;
}

.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.05), transparent 32%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.04), transparent 25%);
  opacity: 0.6;
}

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

.panel h1,
.panel h2 {
  margin: 4px 0 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.hint {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.pill {
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 15px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
input[type="range"]:focus {
  outline: 1px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

body,
.control-panel,
.panel.control-panel,
.yt-list,
.video-dialog-body,
.video-dialog-tabs,
.video-dialog-panels,
.video-tab-panel,
.trade-calls,
.key-levels,
.quote-list {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

body::-webkit-scrollbar,
.control-panel::-webkit-scrollbar,
.panel.control-panel::-webkit-scrollbar,
.yt-list::-webkit-scrollbar,
.video-dialog-body::-webkit-scrollbar,
.video-dialog-tabs::-webkit-scrollbar,
.video-dialog-panels::-webkit-scrollbar,
.video-tab-panel::-webkit-scrollbar,
.trade-calls::-webkit-scrollbar,
.key-levels::-webkit-scrollbar,
.quote-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-thumb,
.control-panel::-webkit-scrollbar-thumb,
.panel.control-panel::-webkit-scrollbar-thumb,
.yt-list::-webkit-scrollbar-thumb,
.video-dialog-body::-webkit-scrollbar-thumb,
.video-dialog-tabs::-webkit-scrollbar-thumb,
.video-dialog-panels::-webkit-scrollbar-thumb,
.video-tab-panel::-webkit-scrollbar-thumb,
.trade-calls::-webkit-scrollbar-thumb,
.key-levels::-webkit-scrollbar-thumb,
.quote-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--scroll-thumb);
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body::-webkit-scrollbar-thumb:hover,
.control-panel::-webkit-scrollbar-thumb:hover,
.panel.control-panel::-webkit-scrollbar-thumb:hover,
.yt-list::-webkit-scrollbar-thumb:hover,
.video-dialog-body::-webkit-scrollbar-thumb:hover,
.video-dialog-tabs::-webkit-scrollbar-thumb:hover,
.video-dialog-panels::-webkit-scrollbar-thumb:hover,
.video-tab-panel::-webkit-scrollbar-thumb:hover,
.trade-calls::-webkit-scrollbar-thumb:hover,
.key-levels::-webkit-scrollbar-thumb:hover,
.quote-list::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

body::-webkit-scrollbar-track,
.control-panel::-webkit-scrollbar-track,
.panel.control-panel::-webkit-scrollbar-track,
.yt-list::-webkit-scrollbar-track,
.video-dialog-body::-webkit-scrollbar-track,
.video-dialog-tabs::-webkit-scrollbar-track,
.video-dialog-panels::-webkit-scrollbar-track,
.video-tab-panel::-webkit-scrollbar-track,
.trade-calls::-webkit-scrollbar-track,
.key-levels::-webkit-scrollbar-track,
.quote-list::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}

body::-webkit-scrollbar-track:hover,
.control-panel::-webkit-scrollbar-track:hover,
.panel.control-panel::-webkit-scrollbar-track:hover,
.yt-list::-webkit-scrollbar-track:hover,
.video-dialog-body::-webkit-scrollbar-track:hover,
.video-dialog-tabs::-webkit-scrollbar-track:hover,
.video-dialog-panels::-webkit-scrollbar-track:hover,
.video-tab-panel::-webkit-scrollbar-track:hover,
.trade-calls::-webkit-scrollbar-track:hover,
.key-levels::-webkit-scrollbar-track:hover,
.quote-list::-webkit-scrollbar-track:hover {
  background: var(--scroll-track-hover);
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 13px) calc(50% - 3px);
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

select:focus,
select:active {
  background-color: rgba(255, 255, 255, 0.04);
}

select option {
  background: #090909;
  color: var(--text);
}

select::-ms-expand {
  display: none;
}

.field-inline {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}

.input-hint,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.slider-field {
  gap: 10px;
}

.slider-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

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

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 10px;
}

button {
  border: none;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:active {
  transform: translateY(0);
}

button[type="submit"] {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #0b0b0b;
  flex: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-panel {
  grid-area: chart;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  padding: 10px;
  border-radius: 14px;
}

.chart {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
}

.chart-stack {
  display: grid;
  grid-template-rows: 1.75fr auto 0.85fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  position: relative;
}

.chart-stack .chart {
  min-height: 0;
}

.crosshair-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(124, 243, 255, 0.9), rgba(124, 243, 255, 0.3));
  opacity: 0.9;
  pointer-events: none;
  will-change: transform;
}

.crosshair-line.hidden {
  display: none;
}

.chart-resizer {
  height: 10px;
  cursor: row-resize;
  position: relative;
  display: grid;
  place-items: center;
}

.chart-resizer::before {
  content: '';
  display: block;
  width: 82px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(124, 243, 255, 0.5), rgba(255, 255, 255, 0.08));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.chart-resizer:active::before,
.resizing-indicator .chart-resizer::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(124, 243, 255, 0.8), rgba(255, 255, 255, 0.16));
}

.main-chart {
  border-radius: 12px;
}

.indicator-chart {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.03), transparent 30%),
    radial-gradient(circle at 84% 6%, rgba(255, 255, 255, 0.025), transparent 28%),
    rgba(255, 255, 255, 0.01);
  position: relative;
}


.indicator-chart::after {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  top: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.indicator-toolbar {
  position: absolute;
  right: 10px;
  top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 2;
  background: rgba(5, 5, 5, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 4px 6px;
  backdrop-filter: blur(6px);
}

.indicator-toolbar .label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.indicator-toolbar button {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.indicator-toolbar .ghost {
  border-color: rgba(255, 255, 255, 0.1);
}

.indicator-toolbar .warn {
  color: #ffb3b3;
  border-color: rgba(255, 107, 107, 0.4);
}

.resizing-indicator {
  user-select: none;
  cursor: row-resize;
}

.indicator-chart.disabled {
  opacity: 0.8;
  border-style: dotted;
}

.indicator-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2000;
}

.indicator-dialog.hidden {
  display: none;
}

.indicator-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.indicator-dialog-box {
  position: relative;
  width: min(520px, 92vw);
  background: linear-gradient(180deg, #101018 0%, #0a0a0f 100%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 16px;
  z-index: 1;
}

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

.indicator-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.indicator-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.chart-meta {
  display: none;
}

.panel-rail {
  grid-area: rail;
  display: flex;
  align-self: stretch;
  flex-direction: column;
  gap: 10px;
  width: 64px;
  min-width: 56px;
  padding: 8px 0;
  justify-content: flex-start;
  align-items: center;
}

.panel-rail .rail-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease, transform 120ms ease;
  padding: 0;
}

.panel-rail .rail-btn::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.panel-rail .rail-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.panel-rail .rail-btn:active {
  transform: translateY(0);
}

.panel-rail .rail-btn.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(160, 160, 160, 0.22));
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

body.panel-collapsed .layout {
  grid-template-columns: minmax(0, 1fr) 64px;
  grid-template-areas: "chart rail";
}

body.panel-collapsed .control-panel {
  display: none;
}

body.panel-collapsed .chart-panel {
  grid-column: 1 / 2;
  height: 100%;
}

.auth-page {
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05), transparent 24%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.04), transparent 22%),
    linear-gradient(135deg, #030303 0%, #0a0a0c 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.dash-bg {
  background: radial-gradient(circle at 20% 20%, rgba(80, 160, 255, 0.06), transparent 26%),
    radial-gradient(circle at 80% 0%, rgba(255, 124, 255, 0.05), transparent 22%),
    linear-gradient(120deg, #040507 0%, #0a0c12 45%, #0b0d15 100%);
}

.auth-wrapper {
  width: min(900px, 100%);
}

.auth-box {
  background: linear-gradient(180deg, #0f0f14 0%, #09090c 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-wrapper {
  width: min(1080px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(124, 243, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(124, 243, 255, 0.15);
  border-radius: 16px;
  padding: 16px;
  gap: 10px;
}

.dash-hero h1 {
  margin: 6px 0;
}

.primary {
  background: linear-gradient(135deg, #7cf3ff 0%, #f5f5f5 100%);
  color: #050505;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.fatal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.fatal-card {
  width: min(420px, 92vw);
  background: linear-gradient(180deg, #0f0f14 0%, #09090c 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fatal-card h3 {
  margin: 0;
}

.fatal-card p {
  margin: 0;
  color: var(--muted);
}

.fatal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.card-title {
  font-weight: 800;
  margin: 0 0 4px 0;
}

.card-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.card-summary {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.empty {
  color: var(--muted);
  padding: 12px;
}
.charts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand .spark.small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.auth-box h1 {
  margin: 4px 0;
}

.auth-box .muted {
  margin: 0 0 8px 0;
}

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

.chart-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.chart-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.chart-card:active {
  transform: translateY(0);
}

.chart-card .chart-name {
  font-weight: 700;
}

.chart-card .chart-meta {
  color: var(--muted);
  font-size: 12px;
}

.chart-list + button {
  width: 100%;
  margin-top: 6px;
}

.chart-pill {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dash-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 840px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

.toolbar-selects {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-selects select {
  min-width: 110px;
}

.toolbar-selects .field-inline {
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.toolbar-selects option {
  background: #090909;
  color: var(--text);
}

.inline-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  min-width: 140px;
}

.hidden {
  display: none;
}

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

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 4px;
}

.legend-swatch.up {
  background: #2ed47a;
}

.legend-swatch.down {
  background: #ff6b6b;
}

.error {
  margin-top: 12px;
  min-height: 18px;
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}

.yt-section {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.yt-head {
  align-items: center;
  gap: 10px;
}

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

.yt-indicator-btn {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}

.yt-indicator-btn.active {
  border-color: rgba(124, 243, 255, 0.5);
  background: rgba(124, 243, 255, 0.08);
  color: #e6fbff;
  box-shadow: 0 8px 20px rgba(124, 243, 255, 0.15);
}

.yt-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.yt-add-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.28);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.yt-add-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.yt-add-card .plus {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.yt-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.yt-dialog.hidden {
  display: none;
}

.yt-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.yt-dialog-box {
  position: relative;
  width: min(820px, 96vw);
  max-height: 82vh;
  background: linear-gradient(180deg, #0e0e13 0%, #09090c 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  z-index: 1;
}

.yt-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.video-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.video-dialog.hidden {
  display: none;
}

.video-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.video-dialog-box {
  position: relative;
  --dialog-body-max: calc(92vh - 240px);
  width: min(1100px, 96vw);
  max-height: 92vh;
  background: radial-gradient(90% 120% at 10% 10%, rgba(64, 226, 155, 0.08), transparent),
    radial-gradient(80% 140% at 90% 20%, rgba(90, 210, 255, 0.06), transparent),
    linear-gradient(180deg, #0c0c11 0%, #050507 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 36px 120px rgba(0, 0, 0, 0.7);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  z-index: 1;
}

.video-dialog-shell {
  position: relative;
}

.video-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  padding: 0;
}

.video-dialog-box h1,
.video-dialog-box h2,
.video-dialog-box h3 {
  margin: 0;
}

.video-hero {
  display: grid;
  --hero-padding-y: 14px;
  --hero-padding-x: 16px;
  --hero-gap: 14px;
  --hero-thumb-min: 180px;
  --hero-thumb-max: 720px;
  --hero-thumb-scale: 1;
  --hero-title-size: 20px;
  --hero-meta-gap: 8px;
  --hero-chip-padding: 8px 12px;
  --hero-chip-size: 13px;
  grid-template-columns: minmax(220px, 1.15fr) minmax(0, 1.85fr);
  gap: var(--hero-gap);
  padding: var(--hero-padding-y) var(--hero-padding-x);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    padding 220ms cubic-bezier(0.33, 1, 0.68, 1),
    gap 220ms cubic-bezier(0.33, 1, 0.68, 1),
    background 220ms ease,
    border-color 220ms ease;
}

.video-hero-thumb {
  position: relative;
  width: 100%;
  min-width: var(--hero-thumb-min);
  max-width: var(--hero-thumb-max);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f172a, #0b0f1a);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: #e6f7ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  transform: scale(var(--hero-thumb-scale));
  transition:
    transform 240ms cubic-bezier(0.33, 1, 0.68, 1),
    border-radius 220ms ease,
    max-width 220ms ease;
}

.video-hero-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms ease;
}

.video-hero-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.02em;
  color: #e6f7ff;
  background: linear-gradient(135deg, #0f172a, #0b0f1a);
  transition: opacity 180ms ease;
}

.video-hero-thumb.has-image .video-hero-thumb-img {
  opacity: 1;
}

.video-hero-thumb.has-image .video-hero-thumb-fallback {
  opacity: 0;
}

.video-hero-meta {
  display: flex;
  flex-direction: column;
  gap: var(--hero-meta-gap);
  transition: gap 180ms ease;
}

.video-hero-top,
.video-hero-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.video-hero h3 {
  font-size: var(--hero-title-size);
  letter-spacing: -0.01em;
  margin: 4px 0;
  transition: font-size 180ms ease;
}

.video-dialog.video-hero-collapsed .video-hero {
  --hero-padding-y: 10px;
  --hero-padding-x: 12px;
  --hero-gap: 8px;
  --hero-thumb-min: 130px;
  --hero-thumb-max: 180px;
  --hero-thumb-scale: 1;
  --hero-title-size: 18px;
  --hero-meta-gap: 6px;
  --hero-chip-padding: 6px 10px;
  --hero-chip-size: 12px;
  align-items: flex-start;
  grid-template-columns: minmax(130px, 180px) 1fr;
}

.video-dialog.video-hero-collapsed .video-hero-thumb {
  border-radius: 10px;
  filter: brightness(0.96) saturate(0.96);
}

.video-dialog.video-hero-collapsed .video-hero-meta {
  gap: var(--hero-meta-gap);
}

.video-dialog.video-hero-collapsed .video-hero h3 {
  font-size: var(--hero-title-size);
}

.video-dialog.video-hero-collapsed .video-chip {
  padding: var(--hero-chip-padding);
  font-size: var(--hero-chip-size);
}

.video-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--hero-chip-padding, 8px 12px);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  color: #f6f7fb;
  font-size: var(--hero-chip-size, 13px);
  transition:
    padding 180ms ease,
    font-size 180ms ease;
}

.video-chip.subtle {
  background: rgba(255, 255, 255, 0.04);
  color: #9ca3af;
}

.video-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: var(--dialog-body-max);
  overflow-y: auto;
  padding: 18px 20px 20px;
  transition: max-height 200ms ease;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

#video-summary-card {
  grid-column: 1 / -1;
}

.video-dialog-asset-tabs {
  width: 100%;
}

#video-assets-card {
  grid-column: 1 / -1;
}

.video-dialog.video-hero-collapsed .video-dialog-box {
  --dialog-body-max: calc(92vh - 180px);
}

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

.auth-toggle {
  display: inline-flex;
  gap: 8px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-dialog-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  border-radius: 14px;
  width: 100%;
}

.video-tabs-card {
  gap: 12px;
  padding: 18px;
}

.video-tab-btn {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.video-tab-btn.active {
  background: linear-gradient(120deg, #48e5c2, #7cf3ff);
  color: #061016;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.video-dialog-asset-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  border-radius: 12px;
  width: 100%;
}

.asset-outlook {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-asset-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.video-asset-btn[data-bias="bullish"] {
  background: linear-gradient(135deg, rgba(60, 191, 117, 0.18), rgba(60, 191, 117, 0.08));
  border-color: rgba(60, 191, 117, 0.45);
  color: #e8fff2;
  box-shadow: 0 6px 14px rgba(60, 191, 117, 0.18);
}

.video-asset-btn[data-bias="bearish"] {
  background: linear-gradient(135deg, rgba(255, 97, 97, 0.2), rgba(255, 97, 97, 0.1));
  border-color: rgba(255, 97, 97, 0.5);
  color: #ffe6e6;
  box-shadow: 0 6px 14px rgba(255, 97, 97, 0.18);
}

.video-asset-btn[data-bias="neutral"] {
  background: linear-gradient(135deg, rgba(242, 194, 0, 0.2), rgba(242, 194, 0, 0.1));
  border-color: rgba(242, 194, 0, 0.5);
  color: #fff5d0;
  box-shadow: 0 6px 14px rgba(242, 194, 0, 0.18);
}

.video-asset-btn[data-bias="insufficient"] {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e5e7eb;
  box-shadow: none;
}

.video-asset-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.video-asset-btn.active {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.video-asset-btn[data-bias="bullish"].active {
  background: linear-gradient(135deg, rgba(60, 191, 117, 0.32), rgba(60, 191, 117, 0.16));
  border-color: rgba(60, 191, 117, 0.82);
  box-shadow: 0 12px 26px rgba(60, 191, 117, 0.25);
}

.video-asset-btn[data-bias="bearish"].active {
  background: linear-gradient(135deg, rgba(255, 97, 97, 0.32), rgba(255, 97, 97, 0.16));
  border-color: rgba(255, 97, 97, 0.84);
  box-shadow: 0 12px 26px rgba(255, 97, 97, 0.25);
}

.video-asset-btn[data-bias="neutral"].active {
  background: linear-gradient(135deg, rgba(242, 194, 0, 0.3), rgba(242, 194, 0, 0.16));
  border-color: rgba(242, 194, 0, 0.82);
  box-shadow: 0 12px 26px rgba(242, 194, 0, 0.22);
}

.video-asset-btn[data-bias="insufficient"].active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.video-dialog-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: none;
  overflow: visible;
  min-height: 0;
  padding: 0;
}

.video-tab-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  max-height: none;
  overflow: visible;
  padding: 0;
  min-height: 260px;
}

.video-tab-panel.active {
  display: flex;
}

.video-tabs-layout {
  display: grid;
  grid-template-columns: minmax(200px, 0.4fr) minmax(320px, 1.6fr);
  gap: 12px;
}

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

.panel-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}

.panel-block-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-block-head h5 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.empty-panel-msg {
  text-align: center;
  width: 100%;
  color: var(--muted);
  padding: 16px 8px;
}

.panel-block.is-empty {
  justify-content: center;
}

.video-card,
.video-section {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 36px rgba(0, 0, 0, 0.28);
}

.video-card-head,
.video-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.video-card-head h4,
.video-section-head h4 {
  margin: 0;
}

.video-section-head .eyebrow {
  margin: 0 0 2px 0;
}

.video-section-head .muted {
  margin: 0;
}

.video-outlook-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(260px, 0.68fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .video-outlook-grid {
    grid-template-columns: 1fr;
  }
}

.video-outlook-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.video-outlook-block .block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-outlook-block h5 {
  margin: 0;
  font-size: 16px;
}

.video-overview-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
}
.analysis-placeholder {
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  background: radial-gradient(circle at 20% 20%, rgba(46, 212, 122, 0.08), rgba(255, 255, 255, 0.01)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px dashed rgba(255, 255, 255, 0.16);
}

.analysis-placeholder-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  align-items: center;
}

.analysis-placeholder-text h4 {
  margin: 4px 0 6px 0;
}

.analysis-placeholder-text p {
  margin: 0;
  color: var(--muted);
}

.analysis-cta-btn {
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2ed47a, #1fb368);
  color: #02110a;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(46, 212, 122, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.analysis-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(46, 212, 122, 0.35);
}

.analysis-cta-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dialog-no-analysis .analysis-placeholder {
  display: flex;
}

.dialog-no-analysis .video-section:not(.analysis-placeholder),
.dialog-no-analysis .video-tabs-card {
  display: none;
}
.video-card.full-row {
  grid-column: 1 / -1;
}

.overall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.bias-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 300px;
}

.video-section-split {
  display: grid;
  grid-template-columns: minmax(200px, 0.6fr) minmax(320px, 1.4fr);
  gap: 16px;
}

.confidence-row {
  width: 100%;
}

.confidence-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.confidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conf-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.conf-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.conf-meter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conf-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 97, 97, 0.14) 0%,
    rgba(242, 194, 0, 0.12) 45%,
    rgba(60, 191, 117, 0.16) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.conf-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6161 0%, #f2c200 50%, #3cbf75 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.conf-dot {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 2px solid #3cbf75;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
}

.conf-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.8;
}

.video-section-block h5 {
  margin: 0 0 6px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.overall-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
}

.overall-pill .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.overall-pill .value {
  font-size: 14px;
}

.overall-pill.tight {
  padding: 10px 12px;
}

.others-pill {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.others-title {
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.others-sub {
  color: var(--muted);
  font-size: 13px;
}

.verdict-text p {
  margin: 0 0 6px 0;
  line-height: 1.5;
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.verdict-grid.single-asset-verdict {
  grid-template-columns: 1fr;
}

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

.verdict-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.verdict-item h5 {
  margin: 0 0 6px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.verdict-item p {
  margin: 0;
  line-height: 1.5;
}

.verdict-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
}

.verdict-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
  justify-content: flex-end;
}

.verdict-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
  transition: all 140ms ease;
}

.verdict-metric.bullish {
  background: linear-gradient(135deg, rgba(60, 191, 117, 0.18), rgba(60, 191, 117, 0.08));
  border-color: rgba(60, 191, 117, 0.6);
  color: #e8fff2;
  box-shadow: 0 8px 18px rgba(60, 191, 117, 0.18);
}

.verdict-metric.bearish {
  background: linear-gradient(135deg, rgba(255, 97, 97, 0.2), rgba(255, 97, 97, 0.1));
  border-color: rgba(255, 97, 97, 0.65);
  color: #ffe6e6;
  box-shadow: 0 8px 18px rgba(255, 97, 97, 0.18);
}

.verdict-metric.neutral {
  background: linear-gradient(135deg, rgba(242, 194, 0, 0.18), rgba(242, 194, 0, 0.08));
  border-color: rgba(242, 194, 0, 0.65);
  color: #fff5d0;
  box-shadow: 0 8px 18px rgba(242, 194, 0, 0.18);
}

.verdict-metric-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.verdict-metric-value {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 800;
}

.verdict-metric:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.verdict-refs {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: none;
  flex-direction: column;
  gap: 6px;
}

.verdict-refs.open {
  display: flex;
}

.verdict-ref {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: #e5e7eb;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.verdict-ref:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.1));
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.verdict-ref-time {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 700;
  color: #e5e7eb;
  min-width: 64px;
  text-align: center;
}

.verdict-ref-text {
  flex: 1;
  line-height: 1.4;
}

.verdict-ref-toggle {
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.verdict-ref-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.verdict-others {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: #ffffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.verdict-others-title {
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.verdict-others-sub {
  color: var(--muted);
  font-size: 13px;
}

.verdict-extra {
  margin-top: 6px;
}

.video-dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.video-link-btn {
  display: none !important;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.video-dialog-notes {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.video-dialog-notes-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.quote-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quote-list li {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 18px;
  align-items: start;
}

.quote-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  color: #0b0b0d;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.quote-time:hover {
  filter: brightness(1.02);
}

.quote-text {
  grid-column: 2 / 3;
  line-height: 1.6;
}

.quote-list li .quote-text {
  line-height: 1.6;
}

.quote-reason {
  grid-column: 2 / 3;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.video-summary {
  margin: 0 0 12px 0;
  line-height: 1.65;
  color: var(--text);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chip.alt {
  background: rgba(124, 243, 255, 0.12);
  border-color: rgba(124, 243, 255, 0.25);
}

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

.trade-calls,
.key-levels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trade-card,
.level-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trade-card h5,
.level-card h5 {
  margin: 0;
  font-size: 15px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  grid-column: 2 / 3;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge.bullish {
  background: rgba(46, 212, 122, 0.15);
  border-color: rgba(46, 212, 122, 0.35);
  color: #5ff7b2;
}

.badge.bearish {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.35);
  color: #ff9a9a;
}

.badge.time-badge {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  border-color: rgba(255, 255, 255, 0.95);
  color: #0b0b0d;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.trade-detail {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.target-list,
.level-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-target {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

.yt-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.yt-search-status {
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
}

.yt-search-results {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  overflow: auto;
  padding-right: 4px;
  max-height: 380px;
}

.yt-result-card {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.yt-result-thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  background-size: cover;
  background-position: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.yt-result-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.yt-result-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-result-handle {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.yt-result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.yt-result-actions a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

.yt-result-actions a:hover {
  color: var(--accent);
}

.yt-result-actions button {
  padding: 10px 12px;
  font-size: 14px;
}

.yt-manual {
  margin-top: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yt-manual-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.yt-manual-head {
  font-weight: 700;
  font-size: 14px;
}

.yt-card {
  display: grid;
  grid-template-columns: auto 38px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.yt-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.yt-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.yt-thumb {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
}

.yt-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.yt-name,
.yt-handle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.yt-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.yt-handle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.video-tooltip {
  position: absolute;
  pointer-events: auto;
  z-index: 10;
  background: #0d0d12;
  color: var(--text);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  width: 300px;
}

.video-tooltip h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

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

.video-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  transition: background 80ms ease, border-color 80ms ease;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.video-thumb {
  width: 72px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.video-date {
  color: var(--muted);
  font-size: 12px;
}

.video-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-secondary {
  color: var(--muted);
  font-size: 12px;
}

.video-channel {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-duration {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

.video-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
}

.sentiment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sentiment-pill.neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.sentiment-pill.bullish {
  background: rgba(46, 212, 122, 0.15);
  color: #5ff7b2;
  border-color: rgba(46, 212, 122, 0.4);
}

.sentiment-pill.bearish {
  background: rgba(255, 107, 107, 0.15);
  color: #ff9a9a;
  border-color: rgba(255, 107, 107, 0.4);
}

.scale-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 4;
}

.scale-controls.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scale-controls button {
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #0c0c10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.scale-controls button.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(180, 180, 180, 0.26));
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "controls"
      "rail";
    grid-template-rows: 1fr auto auto;
    align-content: stretch;
    flex: 1;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .chart {
    min-height: 360px;
  }

  .panel-rail {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 0;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .video-overview-grid {
    grid-template-columns: 1fr;
  }
}
