:root {
  --bg-main: #0b0f14;
  --bg-card: #121821;
  --bg-card-hover: #18202b;
  --text-main: #f5f7fa;
  --text-muted: #9ca3af;
  --brand-yellow: #ffd43b;
  --brand-green: #39ff88;
  --danger-red: #ff4d4d;
  --warning-amber: #ffb800;
  --border-soft: #263241;
  --blue-signal: #56a8ff;
  --panel: rgba(18, 24, 33, 0.9);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg-main);
  color: var(--text-main);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

html.is-scrolling,
html.is-scrolling * {
  scrollbar-color: rgba(255, 212, 59, 0.72) rgba(18, 24, 33, 0.08);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: transparent;
  background-clip: padding-box;
}

html.is-scrolling *::-webkit-scrollbar-thumb {
  border-color: rgba(11, 15, 20, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 212, 59, 0.88), rgba(57, 255, 136, 0.72))
    padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.noscript-shell {
  width: min(720px, calc(100% - 32px));
  margin: 80px auto;
  padding: 24px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-card);
}

.legal-page {
  background: var(--bg-main);
}

.legal-shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.legal-shell a {
  color: var(--brand-yellow);
}

.legal-shell p,
.legal-shell li {
  color: var(--text-muted);
}

.legal-shell section {
  margin-top: 28px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(38, 50, 65, 0.82);
  background: rgba(11, 15, 20, 0.9);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 212, 59, 0.34);
  border-radius: 8px;
  object-fit: cover;
}

.brand-text {
  font-size: 1.02rem;
  font-weight: 850;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(156, 163, 175, 0.2);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.header-button {
  color: var(--brand-yellow);
}

.header-link:hover,
.header-link:focus-visible {
  border-color: rgba(255, 212, 59, 0.44);
  background: rgba(255, 212, 59, 0.08);
}

.youtube-handle {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

.youtube-handle {
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-main);
}

.youtube-handle span {
  color: #ff5a5f;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.youtube-handle strong {
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 900;
}

.youtube-handle:hover {
  border-color: rgba(255, 90, 95, 0.6);
  background: rgba(255, 90, 95, 0.12);
}

.beta-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 212, 59, 0.36);
  border-radius: 999px;
  color: var(--brand-yellow);
  background: rgba(255, 212, 59, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero {
  min-height: 360px;
  display: grid;
  align-items: end;
  gap: 24px;
  padding: clamp(44px, 7vw, 82px) clamp(16px, 4vw, 48px) 34px;
  border-bottom: 1px solid var(--border-soft);
  background:
    linear-gradient(90deg, rgba(11, 15, 20, 0.9) 0%, rgba(11, 15, 20, 0.66) 48%, rgba(11, 15, 20, 0.22) 100%),
    linear-gradient(0deg, rgba(11, 15, 20, 0.86), rgba(11, 15, 20, 0.16)),
    image-set(url("/image/banner.webp") type("image/webp"), url("/image/banner.jpg") type("image/jpeg")) center / cover no-repeat;
}

.hero-copy {
  max-width: 760px;
}

.brand-kicker {
  margin: 0 0 8px;
  color: var(--brand-yellow);
  font-size: 0.82rem;
  font-weight: 850;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-yellow);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.45rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
  max-width: 760px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 560px;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 760;
}

.hero-support {
  max-width: 560px;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 0.98rem;
}

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

.hero-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 900;
}

.hero-button.primary {
  border: 0;
  background: linear-gradient(135deg, var(--brand-yellow), var(--warning-amber));
  color: #10130c;
}

.hero-button.secondary {
  border: 1px solid rgba(255, 212, 59, 0.46);
  background: rgba(11, 15, 20, 0.5);
  color: var(--brand-yellow);
}

.content-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.section-block,
.shorts-zone,
.result-shell,
.chart-panel {
  margin-top: 24px;
}

.ad-slot {
  width: 100%;
  contain: layout paint;
  pointer-events: none;
}

.ad-slot--leaderboard {
  min-height: clamp(28px, 4vw, 48px);
  margin: 0 0 10px;
}

.ad-slot--rectangle {
  min-height: clamp(24px, 5vw, 56px);
  margin-top: 16px;
}

.shorts-zone {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}

.shorts-entry {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 212, 59, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 212, 59, 0.055), rgba(255, 90, 95, 0.035)),
    rgba(11, 15, 20, 0.72);
}

.shorts-entry-copy {
  align-self: start;
}

.shorts-entry-copy p:last-of-type {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--text-muted);
}

.shorts-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.link-action {
  text-decoration: none;
}

.short-meta span {
  width: fit-content;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 212, 59, 0.22);
  border-radius: 999px;
  color: var(--brand-yellow);
  background: rgba(255, 212, 59, 0.08);
  font-size: 0.66rem;
  font-weight: 900;
}

.short-youtube-link {
  color: var(--brand-yellow);
  font-weight: 900;
  text-decoration: none;
}

.short-youtube-link:hover {
  text-decoration: underline;
}

.shorts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.shorts-grid--inline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.short-card {
  overflow: hidden;
  border: 1px solid rgba(156, 163, 175, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)), var(--bg-card);
}

.shorts-grid--inline .short-card {
  flex: 0 0 clamp(190px, 22vw, 236px);
  scroll-snap-align: start;
}

.short-media {
  aspect-ratio: 9 / 16;
  background: #080c12;
}

.short-media video,
.short-media iframe,
.short-poster-link,
.short-poster-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.short-poster-link {
  position: relative;
}

.short-embed {
  border: 0;
  background: #080c12;
}

.short-copy {
  display: grid;
  gap: 9px;
  padding: 12px;
}

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

.short-card h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.15;
}

.short-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.short-youtube-link {
  width: fit-content;
  font-size: 0.82rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.86fr) minmax(560px, 1.14fr);
  gap: 18px;
  align-items: start;
  margin-top: 24px;
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.section-heading.compact {
  align-items: start;
}

.section-note,
.result-subcopy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.battle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.format-scroll-wrap {
  position: relative;
}

.format-scroll-arrow {
  display: none;
}

.battle-card {
  position: relative;
  min-height: 184px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--bg-card);
  color: var(--text-main);
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.battle-card:hover,
.battle-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 212, 59, 0.45);
  background: var(--bg-card-hover);
  outline: none;
}

.battle-card.selected {
  border-color: var(--brand-yellow);
  background:
    linear-gradient(180deg, rgba(255, 212, 59, 0.14), rgba(255, 212, 59, 0.035)),
    var(--bg-card-hover);
  box-shadow: inset 0 0 0 1px rgba(255, 212, 59, 0.42), 0 16px 42px rgba(0, 0, 0, 0.28);
}

.format-symbol {
  min-width: 42px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 212, 59, 0.22);
  border-radius: 8px;
  background: rgba(255, 212, 59, 0.08);
  color: var(--brand-yellow);
  font-size: 0.78rem;
  font-weight: 950;
}

.format-tag,
.selected-format-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 212, 59, 0.28);
  border-radius: 999px;
  background: rgba(255, 212, 59, 0.07);
  color: var(--brand-yellow);
  font-size: 0.68rem;
  font-weight: 900;
}

.battle-card.selected .format-tag {
  background: var(--brand-yellow);
  color: #10130c;
}

.battle-card strong {
  font-size: 1.02rem;
  line-height: 1.1;
}

.format-description {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.run-panel {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(18, 24, 33, 0.96), rgba(11, 15, 20, 0.92));
  box-shadow: var(--shadow);
}

.panel-copy {
  padding: 4px;
}

.run-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.run-title-row .eyebrow {
  margin-bottom: 0;
}

.panel-copy p:last-child {
  color: var(--text-muted);
}

.backtest-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(38, 50, 65, 0.8);
  border-radius: 8px;
  background: rgba(11, 15, 20, 0.58);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 780;
}

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

.ticker-quick-row {
  margin-top: 8px;
}

.quick-button {
  min-height: 30px;
  border: 1px solid rgba(156, 163, 175, 0.26);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.quick-button:hover,
.quick-button:focus-visible {
  border-color: rgba(255, 212, 59, 0.5);
  color: var(--brand-yellow);
  background: rgba(255, 212, 59, 0.08);
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: #0d131a;
  color: var(--text-main);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px rgba(255, 212, 59, 0.16);
}

.money-input {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #0d131a;
}

.money-input span {
  color: var(--brand-green);
  text-align: center;
  font-weight: 850;
}

.money-input input {
  border: 0;
  background: transparent;
}

.run-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-yellow), var(--warning-amber));
  color: #10130c;
  font-weight: 900;
}

.run-button:hover {
  filter: brightness(1.05);
}

.sample-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.result-shell,
.chart-panel {
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--panel);
}

.chart-panel {
  position: relative;
}

.workspace-grid .result-shell {
  margin-top: 0;
}

.empty-shell,
.error-shell {
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: center;
}

.empty-shell p,
.error-shell p {
  margin-bottom: 0;
  color: var(--text-muted);
}

.error-shell {
  border-color: rgba(255, 77, 77, 0.46);
}

.error-shell h2 {
  color: #ffb0b0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 90px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #0d131a;
}

.metric-card span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.metric-card strong {
  overflow-wrap: anywhere;
  color: var(--text-main);
  font-size: clamp(1.14rem, 2vw, 1.58rem);
  line-height: 1.04;
}

.metric-card.winner {
  grid-column: span 2;
  border-color: rgba(255, 212, 59, 0.42);
  background: linear-gradient(135deg, rgba(255, 212, 59, 0.13), rgba(13, 19, 26, 0.96));
}

.metric-card.winner strong,
.metric-card.accent strong {
  color: var(--brand-yellow);
}

.metric-card.green strong {
  color: var(--brand-green);
}

.metric-card.danger strong {
  color: var(--danger-red);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.insight-card {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(255, 212, 59, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 212, 59, 0.065), rgba(13, 19, 26, 0.82));
}

.insight-card span {
  color: var(--brand-yellow);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-card strong {
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.3;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.result-actions--single {
  align-items: center;
}

.secondary-action {
  min-height: 36px;
  border: 1px solid rgba(255, 212, 59, 0.34);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(255, 212, 59, 0.065);
  color: var(--brand-yellow);
  font-size: 0.82rem;
  font-weight: 900;
}

.share-action {
  min-width: 148px;
  width: fit-content;
}

.secondary-action:hover {
  background: rgba(255, 212, 59, 0.12);
}

.share-status {
  color: var(--brand-green);
  font-size: 0.78rem;
  font-weight: 850;
}

.result-disclaimer {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.chart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 780;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.dca,
.legend-dot.green {
  background: var(--brand-green);
}

.legend-dot.lump,
.legend-dot.yellow {
  background: var(--brand-yellow);
}

.line-chart {
  display: block;
  width: 100%;
  height: clamp(360px, 32vw, 420px);
  min-height: 320px;
  touch-action: none;
}

.grid-line {
  stroke: rgba(156, 163, 175, 0.26);
  stroke-width: 1;
}

.grid-line.soft {
  stroke: rgba(156, 163, 175, 0.1);
}

.chart-guide {
  opacity: 0;
  stroke: rgba(255, 212, 59, 0.46);
  stroke-dasharray: 4 5;
  stroke-width: 1.5;
  transition: opacity 120ms ease;
}

.chart-guide.active {
  opacity: 1;
}

.axis-label {
  fill: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.tick-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.chart-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.winner-line {
  stroke-width: 5.5;
  filter: drop-shadow(0 0 5px rgba(255, 212, 59, 0.18));
}

.dca-line,
.green-line {
  stroke: var(--brand-green);
}

.lump-line,
.yellow-line {
  stroke: var(--brand-yellow);
}

.chart-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(156, 163, 175, 0.34);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}

.hover-dot {
  fill: transparent;
  stroke: transparent;
}

.end-label {
  fill: var(--text-main);
  paint-order: stroke;
  stroke: rgba(11, 15, 20, 0.88);
  stroke-width: 5px;
  font-size: 12px;
  font-weight: 900;
  dominant-baseline: middle;
}

.green-label {
  fill: var(--brand-green);
}

.yellow-label {
  fill: var(--brand-yellow);
}

.chart-date-range {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  width: min(230px, calc(100% - 28px));
  display: none;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 212, 59, 0.38);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.chart-tooltip.active {
  display: grid;
}

.chart-tooltip > strong {
  color: var(--brand-yellow);
  font-size: 0.82rem;
}

.chart-tooltip span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  column-gap: 7px;
  row-gap: 2px;
}

.chart-tooltip em {
  color: var(--text-main);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}

.chart-tooltip b {
  color: var(--text-main);
  font-size: 0.82rem;
}

.chart-tooltip small {
  grid-column: 2 / 4;
  color: var(--brand-green);
  font-size: 0.76rem;
  font-weight: 850;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.86rem;
}

.site-footer nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: var(--text-muted);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--brand-yellow);
  text-decoration: underline;
}

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

  .battle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shorts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .site-header {
    position: static;
    gap: 10px;
  }

  .header-actions {
    flex: 1;
    gap: 6px;
  }

  .youtube-handle {
    min-width: 0;
    max-width: 154px;
  }

  .youtube-handle strong {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .beta-pill {
    display: none;
  }

  .hero {
    min-height: 248px;
    padding-top: 28px;
    padding-bottom: 24px;
  }

  h1 {
    margin-bottom: 12px;
  }

  h2 {
    font-size: 1.25rem;
  }

  .content-shell {
    padding-top: 18px;
    padding-bottom: 34px;
  }

  .section-heading,
  .chart-header,
  .run-panel {
    display: grid;
  }

  .section-heading {
    margin-bottom: 10px;
  }

  .workspace-grid {
    gap: 12px;
    margin-top: 14px;
  }

  .run-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .result-shell,
  .chart-panel {
    padding: 14px;
  }

  .empty-shell,
  .error-shell {
    min-height: 96px;
  }

  .metric-card {
    min-height: 72px;
    padding: 10px;
    gap: 6px;
  }

  .metric-card span {
    font-size: 0.72rem;
  }

  .metric-card strong {
    font-size: 1rem;
    line-height: 1.08;
  }

  .insight-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .insight-card {
    min-height: auto;
    padding: 10px;
  }

  .section-block {
    margin-top: 18px;
  }

  .shorts-entry {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .shorts-grid {
    display: flex;
    gap: 10px;
    margin-inline: -8px;
    padding: 0 8px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .short-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
  }

  .battle-grid {
    display: flex;
    gap: 8px;
    margin-inline: 0;
    padding: 0 8px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 8px 56px;
  }

  .format-scroll-wrap {
    margin-inline: -8px;
  }

  .format-scroll-wrap::before,
  .format-scroll-wrap::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 8px;
    width: 72px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .format-scroll-wrap::before {
    right: 0;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(90deg, rgba(11, 15, 20, 0), rgba(11, 15, 20, 0.92) 72%);
  }

  .format-scroll-wrap::after {
    left: 0;
    border-radius: 8px 0 0 8px;
    background: linear-gradient(270deg, rgba(11, 15, 20, 0), rgba(11, 15, 20, 0.92) 72%);
  }

  .format-scroll-wrap.has-scroll-next::before {
    opacity: 1;
  }

  .format-scroll-wrap.has-scroll-prev::after {
    opacity: 1;
  }

  .format-scroll-arrow {
    position: absolute;
    z-index: 3;
    top: calc(50% - 4px);
    width: 38px;
    height: 62px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 212, 59, 0.38);
    border-radius: 8px;
    background: rgba(11, 15, 20, 0.78);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  .format-scroll-arrow::before {
    content: "";
    width: 11px;
    height: 11px;
    border-top: 2px solid var(--brand-yellow);
    border-right: 2px solid var(--brand-yellow);
    transform: translateX(-2px) rotate(45deg);
  }

  .format-scroll-arrow--prev {
    left: 8px;
  }

  .format-scroll-arrow--next {
    right: 8px;
  }

  .format-scroll-arrow--prev::before {
    transform: translateX(2px) rotate(225deg);
  }

  .format-scroll-wrap.has-scroll-next:hover .format-scroll-arrow--next,
  .format-scroll-wrap.has-scroll-next:focus-within .format-scroll-arrow--next,
  .format-scroll-wrap.has-scroll-prev:hover .format-scroll-arrow--prev,
  .format-scroll-wrap.has-scroll-prev:focus-within .format-scroll-arrow--prev {
    opacity: 1;
    pointer-events: auto;
  }

  .format-scroll-wrap.has-scroll-next:hover .format-scroll-arrow--next:hover,
  .format-scroll-wrap.has-scroll-next:focus-within .format-scroll-arrow--next:focus-visible,
  .format-scroll-wrap.has-scroll-prev:hover .format-scroll-arrow--prev:hover,
  .format-scroll-wrap.has-scroll-prev:focus-within .format-scroll-arrow--prev:focus-visible {
    border-color: rgba(57, 255, 136, 0.52);
    background: rgba(18, 24, 33, 0.94);
  }

  .format-scroll-wrap.has-scroll-next:hover .format-scroll-arrow--next:hover,
  .format-scroll-wrap.has-scroll-next:focus-within .format-scroll-arrow--next:focus-visible {
    transform: translateY(-50%) translateX(2px);
  }

  .format-scroll-wrap.has-scroll-prev:hover .format-scroll-arrow--prev:hover,
  .format-scroll-wrap.has-scroll-prev:focus-within .format-scroll-arrow--prev:focus-visible {
    transform: translateY(-50%) translateX(-2px);
  }

  .battle-card {
    flex: 0 0 176px;
    min-height: 132px;
    justify-content: center;
    gap: 7px;
    padding: 10px 12px;
    scroll-snap-align: start;
  }

  .format-symbol {
    min-width: 34px;
    min-height: 28px;
    font-size: 0.68rem;
  }

  .format-tag {
    font-size: 0.62rem;
    min-height: 22px;
  }

  .battle-card strong {
    font-size: 0.88rem;
  }

  .format-description {
    display: block;
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .chart-header {
    gap: 8px;
  }

  .legend {
    flex-wrap: wrap;
  }

  .line-chart {
    height: 300px;
    min-height: 260px;
  }

  .chart-date-range {
    justify-content: flex-start;
  }

  .chart-tooltip {
    width: min(220px, calc(100% - 20px));
  }
}

@media (max-width: 520px) {
  .content-shell {
    width: min(100% - 20px, 1160px);
  }

  .beta-pill {
    display: none;
  }

  .brand-text {
    display: none;
  }

  .youtube-handle span {
    display: none;
  }

  .youtube-handle {
    max-width: 132px;
  }

  .header-link {
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .youtube-handle {
    padding-inline: 8px;
  }

  .shorts-entry-actions {
    display: grid;
  }

  .short-card {
    flex-basis: 198px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .battle-card {
    flex-basis: 168px;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-actions {
    display: grid;
  }

  .quick-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .quick-button {
    flex: 0 0 auto;
  }
}
