:root {
  --ink: #121821;
  --muted: #5b6471;
  --paper: #f5f7fa;
  --panel: #ffffff;
  --line: #d8dee8;
  --blue: #1d4ed8;
  --teal: #0f766e;
  --amber: #b45309;
  --red: #b42318;
  --shadow: 0 18px 60px rgba(18, 24, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  color: #f8fafc;
  background: rgba(7, 16, 20, 0.76);
  border-bottom: 1px solid rgba(216, 222, 232, 0.16);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 2px solid #60a5fa;
  border-left-color: #14b8a6;
  border-bottom-color: #f59e0b;
  border-radius: 50%;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

nav a {
  color: rgba(248, 250, 252, 0.84);
  text-decoration: none;
}

nav a:hover,
nav a:focus {
  color: #ffffff;
}

.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #071014;
  color: #ffffff;
}

.chart-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 16, 20, 0.96) 0%, rgba(7, 16, 20, 0.78) 34%, rgba(7, 16, 20, 0.24) 72%),
    linear-gradient(0deg, rgba(7, 16, 20, 0.34), rgba(7, 16, 20, 0.08));
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 48px));
  margin-left: max(24px, calc((100vw - 1120px) / 2));
  padding-top: 48px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #67e8f9;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(46px, 8vw, 94px);
  line-height: 0.94;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

p {
  margin: 14px 0 0;
}

.hero-text {
  max-width: 620px;
  color: rgba(248, 250, 252, 0.84);
  font-size: clamp(18px, 2.2vw, 24px);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(248, 250, 252, 0.28);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
}

.button.primary {
  color: #071014;
  background: #67e8f9;
  border-color: #67e8f9;
}

.button.secondary {
  color: #ffffff;
}

.workspace-page {
  min-height: 100vh;
  background: #eef2f6;
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.workspace-brand {
  color: var(--ink);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.status-pill.ok {
  color: var(--teal);
  border-color: #99d8d2;
  background: #ecfdfb;
}

.status-pill.pending {
  color: var(--amber);
  border-color: #f3c781;
  background: #fffbeb;
}

.status-pill.error {
  color: var(--red);
  border-color: #f2c4bd;
  background: #fff7f5;
}

.status-pill.neutral {
  color: #475569;
  background: #f8fafc;
}

.widget-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.widget-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.widget-intro h1 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.widget-intro p {
  max-width: 780px;
  color: var(--muted);
}

.route-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.route-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  color: var(--blue);
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.widget-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 0.24fr) minmax(0, 1fr) minmax(280px, 0.32fr);
  gap: 14px;
  align-items: stretch;
}

.workspace-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  border-bottom: 0;
}

.panel-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-section strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.panel-section p,
.panel-section li {
  color: var(--muted);
  font-size: 14px;
}

.panel-section p {
  margin-top: 6px;
}

.panel-section ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

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

.mode-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.widget-stage {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.widget-limitation {
  padding: 12px 14px;
  color: #5f1715;
  background: #fff7f5;
  border-bottom: 1px solid #f2c4bd;
  font-size: 14px;
  font-weight: 800;
}

.tradingview-widget-container {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: min(68vh, 720px);
  min-height: 520px;
}

.tradingview-widget-container__widget {
  min-height: 0;
}

.tradingview-widget-container__widget iframe {
  width: 100%;
  height: 100%;
}

.tradingview-widget-copyright {
  min-height: 28px;
  padding: 5px 10px;
  color: var(--muted);
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.tradingview-widget-copyright a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.caveat-section {
  background: #fff7f5;
}

.source-section {
  background: #f8fafc;
}

.prototype-shell {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.prototype-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.prototype-intro h1 {
  max-width: 860px;
  color: var(--ink);
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1;
}

.prototype-intro p {
  max-width: 820px;
  color: var(--muted);
}

.prototype-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.25fr) minmax(0, 1fr) minmax(320px, 0.34fr);
  gap: 14px;
  align-items: stretch;
}

.prototype-controls,
.prototype-evidence {
  min-width: 0;
}

.field-control {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
}

.field-help,
.muted-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.segmented-button,
.tool-button,
.secondary-action,
.annotation-row {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.segmented-button:active,
.tool-button:active,
.secondary-action:active,
.annotation-row:active {
  transform: scale(0.98);
}

.segmented-button,
.secondary-action {
  min-height: 38px;
  padding: 0 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.segmented-button.active,
.secondary-action:hover,
.secondary-action:focus {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

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

.tool-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  color: #475569;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.tool-button.active {
  color: var(--blue);
  background: #eff6ff;
  border-color: #93b7ee;
}

.tool-icon {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.level-icon,
.fib-icon {
  border-color: transparent;
}

.level-icon::before,
.fib-icon::before,
.fib-icon::after,
.projection-icon::before,
.label-icon::before,
.all-icon::before,
.all-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.level-icon::before {
  inset: 7px 1px auto;
  height: 2px;
}

.fib-icon::before {
  inset: 3px 1px auto;
  height: 1px;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.projection-icon::before {
  left: 2px;
  right: 2px;
  top: 7px;
  height: 2px;
  transform: rotate(-32deg);
}

.label-icon::before {
  left: 4px;
  right: 4px;
  top: 4px;
  height: 2px;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.all-icon::before {
  left: 2px;
  right: 2px;
  top: 4px;
  height: 1px;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.all-icon::after {
  left: 7px;
  top: 1px;
  width: 1px;
  height: 14px;
}

#clear-annotations {
  width: 100%;
  margin-top: 10px;
}

.prototype-stage {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stage-meta {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(150px, 0.38fr) minmax(220px, 0.56fr);
  border-bottom: 1px solid var(--line);
}

.stage-meta > div {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.stage-meta > div:last-child {
  border-right: 0;
}

.stage-meta strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-frame {
  position: relative;
  height: min(68vh, 720px);
  min-height: 600px;
  background: #ffffff;
}

.prototype-chart,
.annotation-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.annotation-overlay {
  pointer-events: none;
}

.chart-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
}

.chart-state[hidden] {
  display: none;
}

.chart-state strong {
  color: var(--ink);
  font-size: 18px;
}

.chart-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.chart-state[data-state="error"] {
  background: rgba(255, 247, 245, 0.94);
}

.chart-state[data-state="empty"] {
  background: rgba(248, 250, 252, 0.94);
}

.chart-state[data-state="stale"] {
  inset: 14px auto auto 14px;
  display: block;
  width: min(420px, calc(100% - 28px));
  padding: 12px 14px;
  text-align: left;
  background: #fffbeb;
  border: 1px solid #f3c781;
  border-radius: 6px;
  pointer-events: none;
}

.chart-state[data-state="stale"] strong {
  display: block;
  font-size: 14px;
}

.chart-state[data-state="stale"] p {
  margin-top: 4px;
  font-size: 13px;
}

.state-skeleton {
  display: grid;
  gap: 9px;
  width: min(420px, 82%);
}

.state-skeleton span {
  display: block;
  height: 12px;
  overflow: hidden;
  background: linear-gradient(90deg, #eef2f7 0%, #ffffff 48%, #eef2f7 100%);
  border-radius: 999px;
  animation: skeleton-shift 1.3s ease-in-out infinite;
}

.state-skeleton span:nth-child(2) {
  width: 74%;
}

.state-skeleton span:nth-child(3) {
  width: 56%;
}

.chart-state[data-state="error"] .state-skeleton,
.chart-state[data-state="empty"] .state-skeleton,
.chart-state[data-state="stale"] .state-skeleton {
  display: none;
}

@keyframes skeleton-shift {
  0% {
    opacity: 0.52;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
  100% {
    opacity: 0.52;
    transform: translateY(0);
  }
}

.chart-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.advanced-placeholder {
  display: flex;
  min-height: min(68vh, 720px);
  padding: clamp(18px, 4vw, 42px);
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98)),
    repeating-linear-gradient(90deg, #edf2f7 0, #edf2f7 1px, transparent 1px, transparent 72px);
}

.advanced-placeholder h2 {
  max-width: 680px;
  color: var(--ink);
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.05;
}

.advanced-placeholder p {
  max-width: 760px;
  color: var(--muted);
}

.advanced-charts-page .prototype-intro,
.advanced-charts-page .prototype-workspace,
.advanced-charts-page .workspace-panel,
.advanced-charts-page .prototype-stage,
.advanced-charts-page .route-links,
.advanced-placeholder {
  min-width: 0;
  max-width: 100%;
}

.advanced-charts-page .prototype-intro p,
.advanced-charts-page .panel-section p,
.advanced-placeholder p,
.advanced-placeholder code {
  overflow-wrap: anywhere;
}

.advanced-intro p span {
  display: block;
}

.advanced-gates p span {
  display: block;
}

.advanced-intro h1 span {
  display: block;
}

.adapter-diagram,
.method-grid {
  display: grid;
  gap: 8px;
}

.adapter-diagram {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 820px;
}

.adapter-diagram span {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.adapter-diagram span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 16px;
  height: 1px;
  background: var(--blue);
}

.method-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 900px;
}

.method-grid span,
.advanced-gates code {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: #26323d;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.method-grid span {
  justify-content: center;
  padding: 0 10px;
  text-align: center;
}

.advanced-gates code {
  justify-content: flex-start;
  margin-top: 8px;
  padding: 0 10px;
}

.mapping-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.mapping-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.mapping-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mapping-list strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.mapping-list span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.selected-evidence h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.selected-evidence p {
  color: var(--muted);
  font-size: 14px;
}

.value-grid,
.source-metadata {
  display: grid;
  grid-template-columns: minmax(90px, 0.45fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 14px 0 0;
  font-size: 13px;
}

.value-grid dt,
.source-metadata dt {
  color: var(--muted);
  font-weight: 800;
}

.value-grid dd,
.source-metadata dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.annotation-list {
  display: grid;
  gap: 8px;
}

.annotation-row {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.annotation-row.selected {
  border-color: #93b7ee;
  background: #eff6ff;
}

.annotation-row.dimmed {
  opacity: 0.52;
}

.annotation-row strong {
  color: var(--ink);
  font-size: 14px;
}

.annotation-row span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.json-panel {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  color: #26323d;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.artifact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.band {
  padding: 72px 24px;
  background: #ffffff;
}

.band.light {
  background: var(--paper);
}

.band.contact {
  color: #ffffff;
  background: #121821;
}

.content {
  max-width: 1120px;
  margin: 0 auto;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 44px;
  align-items: start;
}

.content p {
  color: var(--muted);
  max-width: 760px;
}

.contact .content p {
  color: rgba(248, 250, 252, 0.76);
}

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

.facts div,
.implementation-grid article {
  min-height: 120px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.facts span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.facts strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.2;
}

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

.implementation-grid p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

code {
  padding: 1px 4px;
  background: #eef2f7;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.datafeed-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.datafeed-panel p {
  margin-top: 6px;
  font-size: 15px;
}

.datafeed-panel > * {
  min-width: 0;
}

.datafeed-panel code {
  overflow-wrap: anywhere;
}

.datafeed-links {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.datafeed-links a {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  color: var(--blue);
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
}

.boundary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.boundary-list div {
  min-height: 112px;
  padding: 18px;
  color: #5f1715;
  background: #fff7f5;
  border: 1px solid #f2c4bd;
  border-radius: 6px;
  font-weight: 800;
}

.contact-links {
  display: grid;
  gap: 10px;
}

.contact-links a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  color: #dff6ff;
  text-decoration: none;
  border: 1px solid rgba(223, 246, 255, 0.24);
  border-radius: 6px;
}

.contact-links a:hover,
.contact-links a:focus {
  border-color: #67e8f9;
}

footer {
  padding: 24px;
  color: #6b7280;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

footer p {
  max-width: 1120px;
  margin: 0 auto;
  font-size: 13px;
}

.evidence-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 28px 24px 44px;
}

.evidence-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 18px;
}

.evidence-hero h1 {
  max-width: 860px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
}

.evidence-hero p {
  max-width: 820px;
  color: var(--muted);
}

.evidence-status-grid,
.proof-list,
.qa-grid {
  display: grid;
  gap: 14px;
}

.evidence-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 30px;
}

.evidence-status-card,
.proof-card,
.artifact-ledger,
.qa-grid > div {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.evidence-status-card {
  min-height: 152px;
  padding: 18px;
}

.evidence-status-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.evidence-status-card p,
.proof-card p,
.artifact-ledger li,
.qa-grid p {
  color: var(--muted);
  font-size: 14px;
}

.evidence-status-card p {
  margin-top: 8px;
}

.caveat-card {
  background: #fff7f5;
}

.evidence-section {
  margin-top: 28px;
}

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

.section-heading h2 {
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

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

.proof-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 18px;
}

.proof-card h3 {
  font-size: 18px;
}

.proof-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  color: var(--blue);
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.artifact-ledger {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  padding: 18px;
}

.artifact-ledger ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.artifact-ledger a {
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.qa-grid > div {
  min-height: 138px;
  padding: 18px;
}

.qa-grid p {
  margin-top: 6px;
}

@media (max-width: 980px) {
  .implementation-grid,
  .boundary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evidence-hero,
  .artifact-ledger {
    grid-template-columns: 1fr;
  }

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

  .widget-intro,
  .widget-workspace,
  .prototype-intro,
  .prototype-workspace {
    grid-template-columns: 1fr;
  }

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

  .adapter-diagram,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .adapter-diagram span:not(:last-child)::after {
    display: none;
  }

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

  .prototype-controls .source-section {
    grid-column: 1 / -1;
  }

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

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

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

  .control-panel .mode-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .datafeed-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: absolute;
    min-height: auto;
    padding: 18px;
    align-items: flex-start;
  }

  nav {
    display: none;
  }

  .hero {
    min-height: 82vh;
    align-items: flex-end;
    padding-bottom: 44px;
  }

  .hero::after {
    background:
      linear-gradient(0deg, rgba(7, 16, 20, 0.96) 0%, rgba(7, 16, 20, 0.72) 54%, rgba(7, 16, 20, 0.24) 100%);
  }

  .hero-copy {
    width: calc(100% - 32px);
    margin: 0 16px;
    padding-top: 72px;
  }

  .band {
    padding: 52px 16px;
  }

  .workspace-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .widget-shell {
    padding: 22px 16px 32px;
  }

  .prototype-shell {
    padding: 22px 16px 32px;
  }

  .evidence-shell {
    padding: 22px 16px 32px;
  }

  .evidence-status-grid,
  .proof-list,
  .qa-grid {
    grid-template-columns: 1fr;
  }

  .proof-card {
    grid-template-columns: 1fr;
  }

  .proof-card a {
    width: 100%;
  }

  .advanced-charts-page {
    width: 100vw;
    overflow-x: hidden;
  }

  .advanced-shell {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .widget-intro {
    gap: 16px;
  }

  .prototype-intro {
    gap: 16px;
  }

  .advanced-intro h1 {
    font-size: 30px;
  }

  .advanced-charts-page .route-links a {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .advanced-charts-page .route-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .advanced-charts-page .route-links a {
    width: 100%;
  }

  .advanced-charts-page .prototype-intro,
  .advanced-charts-page .prototype-workspace,
  .advanced-charts-page .route-links,
  .advanced-charts-page .workspace-panel,
  .advanced-charts-page .prototype-stage {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .advanced-charts-page .advanced-intro h1,
  .advanced-charts-page .prototype-intro p {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .advanced-charts-page .panel-section p {
    max-width: calc(100vw - 64px);
  }

  .prototype-controls {
    display: block;
  }

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

  .stage-meta {
    grid-template-columns: 1fr;
  }

  .stage-meta > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stage-meta > div:last-child {
    border-bottom: 0;
  }

  .chart-frame {
    height: 520px;
    min-height: 520px;
  }

  .artifact-actions {
    grid-template-columns: 1fr;
  }

  .control-panel {
    display: block;
  }

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

  .tradingview-widget-container {
    height: 540px;
    min-height: 540px;
  }

  .facts,
  .implementation-grid,
  .boundary-list {
    grid-template-columns: 1fr;
  }
}
