:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #10151d;
  --panel-2: #151b25;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f7fb;
  --muted: #9aa6b8;
  --soft: #c6d0df;
  --green: #2ee59d;
  --red: #ff5f6d;
  --gold: #f8c25c;
  --cyan: #52d8ff;
  --blue: #738cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 0%, rgba(82, 216, 255, 0.12), transparent 32rem),
    radial-gradient(circle at 90% 20%, rgba(248, 194, 92, 0.1), transparent 30rem),
    linear-gradient(180deg, #07090d 0%, #0b0e14 48%, #07090d 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 74px;
  padding: 14px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand-mark {
  display: block;
  overflow: hidden;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(82, 216, 255, 0.42);
  background: #050608;
}

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

.brand strong,
.brand small {
  display: block;
}

.brand small,
.nav a,
.panel-label,
.eyebrow,
.stat-card span,
.card-heading span,
.calendar-grid span,
.derivatives-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 18px;
}

.nav a {
  padding: 8px 0;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(16, 21, 29, 0.8);
  color: var(--text);
  cursor: pointer;
}

.snapshot-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(244, 247, 251, 0.08);
  color: var(--text);
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 34px;
  align-items: end;
  min-height: 300px;
  padding: 34px 0 24px;
}

.hero h1 {
  max-width: 720px;
  margin: 12px 0 18px;
  font-size: clamp(2.4rem, 4.8vw, 4.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
}

.primary-action {
  background: var(--text);
  color: #07090d;
}

.secondary-action {
  background: rgba(16, 21, 29, 0.78);
}

.pulse-panel,
.stat-card,
.chart-card,
.content-band,
.calendar-grid article {
  border: 1px solid var(--line);
  background: rgba(16, 21, 29, 0.78);
  box-shadow: var(--shadow);
}

.pulse-panel {
  padding: 22px;
}

.pulse-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
}

.meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin: 24px 0 18px;
}

.meter span {
  height: 36px;
  background: linear-gradient(180deg, var(--green), rgba(46, 229, 157, 0.24));
}

.meter .dim {
  background: rgba(255, 255, 255, 0.12);
}

#lastUpdated,
.snapshot-status,
.stat-card small,
.card-heading small,
.calendar-grid small,
.derivatives-grid small,
.signal-list,
.levels,
.content-band p,
footer {
  color: var(--muted);
}

.section-grid,
.chart-grid,
.calendar-grid,
.derivatives-grid,
.split {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stat-card {
  min-height: 136px;
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.content-band {
  margin: 16px 0;
  padding: 24px;
}

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

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.section-heading.tight h2 {
  font-size: 1.55rem;
}

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

.chart-card {
  padding: 18px;
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.card-heading strong {
  display: block;
  margin-top: 4px;
}

canvas {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.tv-chart {
  width: 100%;
  height: 360px;
  background: rgba(255, 255, 255, 0.03);
}

.split {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.alt-meter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.score strong {
  font-size: 3rem;
}

.score span {
  color: var(--muted);
}

.bar {
  overflow: hidden;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 350ms ease;
}

.signal-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-list li {
  display: flex;
  gap: 10px;
  align-items: start;
}

.signal-list span {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  background: var(--cyan);
}

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

.economic-calendar-widget {
  width: 100%;
  height: 620px;
  overflow: hidden;
}

.economic-calendar-widget .tradingview-widget-container {
  width: 100%;
  height: 100%;
}

.economic-calendar-widget .tradingview-widget-container__widget {
  width: 100%;
  height: calc(100% - 32px);
}

.derivatives-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
}

.calendar-grid article,
.derivatives-grid article {
  min-height: 126px;
  padding: 18px;
}

.calendar-grid strong,
.derivatives-grid strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1.1rem;
}

.levels {
  display: grid;
  gap: 12px;
  margin: 0;
}

.levels div {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.levels dt {
  color: var(--soft);
}

.levels dd {
  margin: 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 36px 0 48px;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .hero,
  .split,
  .chart-grid {
    grid-template-columns: 1fr;
  }

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

  .hero {
    min-height: auto;
    padding-top: 50px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    gap: 12px;
  }

  .nav {
    display: none;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .stats-grid,
  .calendar-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content-band {
    padding: 18px;
  }

  .economic-calendar-widget {
    height: 560px;
  }

  footer {
    display: grid;
  }
}

@media (max-width: 480px) {
  .stats-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .levels div {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  html,
  body {
    width: 100%;
    min-width: 0;
    background: #07090d;
  }

  body {
    color: var(--text);
  }

  .app-shell {
    width: 100%;
  }

  .topbar {
    position: static;
  }

  .snapshot-button,
  .icon-button {
    display: none;
  }

  .hero,
  .stats-grid,
  .chart-grid,
  .derivatives-grid,
  .calendar-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .content-band {
    break-before: page;
    page-break-before: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .stat-card,
  .chart-card,
  .calendar-grid article,
  .derivatives-grid article,
  .pulse-panel {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .tv-chart {
    height: 300px;
  }

  .economic-calendar-widget {
    height: 520px;
  }

  footer {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
