html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(63, 81, 181, 0.14), transparent 28%),
    linear-gradient(180deg, #f8f9fc 0%, #f5f7fb 44%, #eef2f8 100%);
  color: #212121;
  font-family: Roboto, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

main {
  width: calc(100% - 32px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 0 48px;
}

header,
.panel,
.chart-card {
  background: #fff;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 52, 77, .08);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 18px;
}

.header-copy {
  min-width: 0;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.header-cta {
  white-space: nowrap;
}

.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.route-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #d0dbe6;
  border-radius: 6px;
  color: #254966;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.route-tabs a.active {
  border-color: #146c94;
  background: #146c94;
  color: #fff;
}

header span {
  display: block;
  margin-bottom: 8px;
  color: #466179;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.2;
}

p {
  color: #50677d;
}

header p {
  margin-bottom: 0;
}

.panel {
  padding: 24px;
  margin-bottom: 18px;
}

.intro-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e7f2ff;
  color: #205b8f;
  font-size: 13px;
  font-weight: 700;
}

.capability-grid,
.examples-grid,
.event-grid {
  display: grid;
  gap: 16px;
}

.capability-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.capability-grid div {
  padding: 14px;
  border: 1px solid #dbe6ef;
  border-radius: 6px;
  background: #f8fbfd;
}

.capability-grid strong,
.capability-grid span {
  display: block;
}

.capability-grid span {
  margin-top: 6px;
  color: #536b80;
  font-size: 13px;
  line-height: 1.45;
}

.examples-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.chart-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 18px;
  overflow: hidden;
}

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

.chart-head h2,
.chart-head h3 {
  margin-bottom: 6px;
}

.chart-head h3 {
  font-size: 18px;
}

.chart-head span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: #41576b;
  font-size: 12px;
  font-weight: 700;
}

.feature-panel {
  margin-top: 18px;
}

.market-source-panel {
  margin-bottom: 18px;
}

.live-market-card {
  margin-bottom: 18px;
  padding: 18px;
  background: #0b0d10;
  border-color: #242933;
  color: #f5f7fb;
}

.live-market-card.market-light {
  background: #fff;
  border-color: #d9e5ee;
  color: #101828;
}

.live-market-card p {
  color: #a7afbc;
}

.live-market-card.market-light p {
  color: #667085;
}

.live-market-card .chart-head span {
  background: #1d2430;
  color: #dfe6ef;
}

.live-market-card.market-light .chart-head span {
  background: #eef4ff;
  color: #344054;
}

.market-head h2 {
  margin-bottom: 6px;
}

.market-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #232a35;
  border-radius: 6px;
  background: #11161d;
}

@media (max-width: 760px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-tabs {
    justify-content: flex-start;
    width: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }
}

.market-light .market-toolbar {
  border-color: #d0d5dd;
  background: #f8fafc;
}

.market-toolbar div {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.market-toolbar strong {
  color: #c3cad6;
  font-size: 12px;
  text-transform: uppercase;
}

.market-light .market-toolbar strong {
  color: #475467;
}

.market-toolbar button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #343b48;
  background: #171d26;
  color: #dfe6ef;
}

.market-light .market-toolbar button {
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
}

.market-toolbar button.active {
  border-color: #f0b90b;
  background: #f0b90b;
  color: #111;
}

.market-light .market-toolbar button.active {
  border-color: #146c94;
  background: #146c94;
  color: #fff;
}

.market-toolbar .reload-button {
  margin-left: auto;
  background: #146c94;
  border-color: #146c94;
  color: #fff;
}

.market-ticker,
.market-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 10px;
  color: #9ca5b1;
  font-size: 13px;
}

.market-light .market-ticker,
.market-light .market-status {
  color: #667085;
}

.market-ticker strong {
  margin-left: 4px;
  color: #f5f7fb;
}

.market-ticker em {
  font-style: normal;
}

.market-light .market-ticker strong {
  color: #101828;
}

.market-ticker .positive strong,
.market-ticker .positive {
  color: #02c076;
}

.market-ticker .negative strong,
.market-ticker .negative {
  color: #f6465d;
}

.market-status {
  color: #c6ccd5;
}

.market-frame {
  min-height: 560px;
  border: 1px solid #242933;
  border-radius: 6px;
  overflow: hidden;
  background: #050505;
}

.market-light .market-frame {
  border-color: #d0d5dd;
  background: #fff;
}

.market-frame chart,
.market-frame .chart-host {
  min-height: 560px;
}

.chart-frame {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 340px;
  overflow: hidden;
}

.chart-frame.large {
  min-height: 380px;
}

.chart-frame chart,
.chart-frame .chart-host {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 320px;
}

.lazy-chart-mount {
  width: 100%;
  min-width: 0;
}

.chart-frame .highcharts-container,
.chart-frame svg {
  max-width: 100% !important;
}

.tutorial-collapse {
  margin-top: 14px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #f8fbfd;
  overflow: hidden;
}

.live-market-card .tutorial-collapse {
  border-color: #242933;
  background: #11161d;
}

.live-market-card.market-light .tutorial-collapse {
  border-color: #d9e5ee;
  background: #f8fbfd;
}

.tutorial-collapse summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
  color: #1e3145;
  font-weight: 700;
}

.live-market-card .tutorial-collapse summary {
  color: #f5f7fb;
}

.live-market-card.market-light .tutorial-collapse summary {
  color: #1e3145;
}

.tutorial-collapse summary::-webkit-details-marker {
  display: none;
}

.tutorial-collapse summary:before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: #e7f2ff;
  color: #205b8f;
  font-weight: 800;
}

.tutorial-collapse[open] summary:before {
  content: '-';
}

.tutorial-collapse summary span {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}

.tutorial-collapse summary small {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.live-market-card .tutorial-collapse summary small {
  color: #a7afbc;
}

.live-market-card.market-light .tutorial-collapse summary small {
  color: #667085;
}

.code-layer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-top: 1px solid #d9e5ee;
}

.live-market-card .code-layer-grid {
  border-top-color: #242933;
}

.live-market-card.market-light .code-layer-grid {
  border-top-color: #d9e5ee;
}

.code-layer-grid h4 {
  margin: 0 0 8px;
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
}

.live-market-card .code-layer-grid h4 {
  color: #dfe6ef;
}

.live-market-card.market-light .code-layer-grid h4 {
  color: #344054;
}

.code-layer-grid pre {
  max-height: 420px;
  margin: 0;
}

pre {
  overflow: auto;
  padding: 16px;
  border-radius: 6px;
  background: #112236;
  color: #f3f8ff;
  font-size: 12px;
  line-height: 1.5;
}

button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #146c94;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.event-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
}

.event-log {
  padding: 16px;
  border: 1px solid #d9e5ee;
  border-radius: 6px;
  background: #f8fbfd;
}

.event-log ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.event-log li {
  margin-bottom: 6px;
  color: #40586d;
}

@media (max-width: 760px) {
  main {
    width: calc(100% - 20px);
    padding-top: 20px;
  }

  header,
  .panel,
  .chart-card {
    padding: 16px;
  }

  .intro-panel,
  .chart-head {
    display: block;
  }

  .status-pill,
  .chart-head span,
  button {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
  }

  .examples-grid,
  .event-grid,
  .code-layer-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
    overflow-wrap: anywhere;
  }

  h2 {
    font-size: 22px;
    line-height: 1.2;
  }

  h3 {
    font-size: 17px;
  }

  .market-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .live-market-card .market-head,
  .live-market-card .market-toolbar,
  .live-market-card .market-status {
    display: none;
  }

  .market-toolbar div {
    display: flex;
    width: 100%;
  }

  .market-toolbar .reload-button {
    margin-left: 0;
  }

  .market-ticker,
  .market-status {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .market-ticker {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    overflow: hidden;
    padding-bottom: 0;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1.35;
  }

  .market-ticker span {
    min-width: 0;
    overflow: hidden;
  }

  .market-ticker strong {
    margin-left: 2px;
  }

  .market-frame,
  .market-frame chart,
  .market-frame .chart-host {
    min-height: 440px;
  }

  .chart-frame {
    margin-right: 0;
    min-height: 300px;
  }

  .chart-frame chart,
  .chart-frame .chart-host {
    min-height: 280px;
  }

  .tutorial-collapse summary {
    align-items: flex-start;
    min-height: 48px;
    padding: 10px 12px;
  }

  .tutorial-collapse summary small {
    max-width: 90px;
    text-align: right;
    overflow-wrap: anywhere;
  }

  pre {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  main {
    width: calc(100% - 16px);
  }

  header,
  .panel,
  .chart-card,
  .live-market-card {
    padding: 14px;
  }

  button {
    width: 100%;
    justify-content: center;
  }

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

  .route-tabs a {
    justify-content: center;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    text-align: center;
  }

  .market-toolbar button {
    width: auto;
  }
}

/* React 19 compatibility layer over the Angular 21 Highcharts shell. */
#root {
  min-height: 100vh;
  overflow-x: hidden;
}

.shell {
  width: calc(100% - 32px);
  max-width: 1360px;
  min-width: 0;
  margin: 0 auto;
  padding: 32px 0 48px;
  overflow-x: hidden;
}

code {
  overflow-wrap: anywhere;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card,
.demo-card,
.log-panel,
.footer {
  background: #fff;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  box-shadow: 0 10px 28px #17344d14;
}

.hero-card {
  padding: 24px;
}

.hero-card .badge {
  display: inline-flex;
  margin-bottom: 8px;
  color: #466179;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hero-card h1,
.hero-card h2 {
  margin-top: 0;
}

.feature-grid,
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.feature,
.ref-card,
.note {
  padding: 14px;
  border: 1px solid #dbe6ef;
  border-radius: 6px;
  background: #f8fbfd;
}

.feature strong {
  display: block;
  margin-bottom: 6px;
}

.cta-row,
.controls,
.log-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #146c94;
  color: #fff;
  font-weight: 800;
}

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

.panels,
.demo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.demo-grid .chart-card {
  width: 100%;
}

.log-panel {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.log-list {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow: auto;
  margin-top: 12px;
}

.log-entry {
  padding: 9px 10px;
  border-radius: 6px;
  background: #f8fbfd;
  border: 1px solid #d9e5ee;
  color: #40586d;
  font-size: 12px;
}

.chart-placeholder,
.module-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  border: 1px dashed #a8bdd0;
  border-radius: 6px;
  background: #f8fbfd;
  color: #40586d;
}

.chart-lazy-placeholder {
  color: #5f7387;
  font-size: 13px;
  font-weight: 700;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.api-table th,
.api-table td {
  padding: 9px;
  border-bottom: 1px solid #d9e5ee;
  text-align: left;
  vertical-align: top;
}

.footer {
  margin-top: 18px;
  padding: 18px;
}

pre.code {
  white-space: pre-wrap;
}

.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  background: #146c94;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.btn.secondary,
a.btn.secondary,
button.secondary,
button.ghost {
  border: 1px solid #d0dbe6;
  background: #f8fbfd;
  color: #254966;
}

button.small {
  min-height: 30px;
  padding: 0 12px;
}

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

  .log-panel {
    position: static;
  }
}
