:root {
  color-scheme: dark;
  --ink: #e6edf8;
  --ink-soft: #b0bed1;
  --muted: #98aac2;
  --paper: #0b1120;
  --surface: #111c2d;
  --line: #27364b;
  --heading: #f0f5ff;
  --teal: #80e0bc;
  --teal-soft: #142e28;
  --amber: #f1d38e;
  --amber-soft: #332b1b;
  --red: #ffabb1;
  --red-soft: #3b202c;
  --blue: #a0cfff;
  --brand-blue: #45a9fd;
  --blue-soft: #182c47;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 87% 1%, rgba(31, 79, 139, .16), transparent 32rem),
    var(--paper);
}
[hidden] { display: none !important; }
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #173448;
  color: #a5eef3;
}
.skip-link:focus { transform: translateY(0); }
.sample-banner {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 16px;
  background: #10283e;
  border-bottom: 1px solid #25435d;
  color: white;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .035em;
  text-align: center;
}
.sample-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-blue); }
.topbar {
  display: flex;
  height: 96px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1380px) / 2));
  border-bottom: 1px solid var(--line);
  background: #0e1726;
}
.brand { display: inline-flex; align-items: center; gap: 17px; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: 160px; height: auto; flex: 0 0 auto; }
.brand-research { padding-left: 17px; border-left: 1px solid #34516c; color: #83c8ff; font-size: 12px; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.connection-status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.connection-status::before { width: 7px; height: 7px; border-radius: 50%; background: #91a0ad; content: ""; }
.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-dark { background: var(--brand-blue); color: #061829; }
.button-dark:hover { background: #81c4ff; }
.button-light { border-color: var(--line); background: #172438; color: var(--ink); }
.button-light:hover { border-color: #56718f; background: #21334a; }

.page-shell { width: min(1380px, calc(100% - 56px)); margin: 0 auto; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 64px 0 42px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 13px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.eyebrow-line { width: 21px; height: 2px; background: var(--brand-blue); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; color: var(--heading); font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 4.3vw, 53px); font-weight: 400; letter-spacing: -.04em; line-height: 1.09; }
.intro-text { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.refresh-card { display: flex; min-width: 238px; align-items: center; gap: 12px; margin-bottom: 2px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.refresh-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #16323e; color: #9ce5ec; font-size: 21px; line-height: 1; }
.refresh-copy { display: flex; flex-direction: column; gap: 4px; }
.refresh-copy strong { color: var(--ink); font-size: 12px; font-weight: 720; }
.refresh-copy span { color: var(--muted); font-size: 10px; }

.auth-panel, .loading-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 13px 0 40px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .16);
}
.auth-glyph { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 13px; background: #16323e; color: #9ce5ec; font-size: 20px; }
.auth-copy { flex: 1; }
.auth-copy h2 { margin: 0 0 5px; color: var(--heading); font-size: 16px; letter-spacing: -.02em; }
.auth-copy p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.loading-panel { justify-content: center; min-height: 140px; color: var(--ink-soft); }
.loading-panel p { margin: 0; font-size: 13px; }
.loading-mark { width: 18px; height: 18px; border: 2px solid #334b65; border-top-color: var(--brand-blue); border-radius: 50%; animation: turn .85s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

.dashboard-panel { margin-bottom: 20px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 17px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; color: var(--heading); font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
.timezone-note { display: flex; align-items: center; gap: 8px; margin: 0 3px 3px 0; color: var(--muted); font-size: 11px; }
.timezone-dot { width: 7px; height: 7px; border: 1px solid #5ca6b0; border-radius: 50%; background: #193542; }
.column-headings, .pipeline-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.18fr) minmax(165px, 1fr) minmax(175px, 1.05fr) minmax(170px, 1fr) minmax(160px, .95fr);
  gap: 20px;
  align-items: center;
}
.column-headings { padding: 0 20px 10px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.pipeline-rows { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 15px 45px rgba(0, 0, 0, .2); }
.pipeline-row { min-height: 151px; padding: 23px 20px; border-bottom: 1px solid var(--line); }
.pipeline-row:last-child { border-bottom: 0; }
.row-source { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.source-mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid #285461; border-radius: 10px; background: #15343e; color: #9ce5ec; font-size: 12px; font-weight: 800; }
.source-bloomberg_ohlc .source-mark, .source-bloomberg_close .source-mark { border-color: #473b67; background: #29233e; color: #d1c3ff; }
.source-copy { min-width: 0; }
.source-title { margin: 1px 0 5px; color: var(--heading); font-size: 14px; font-weight: 750; line-height: 1.3; }
.source-description { margin: 0 0 8px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.table-name { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .035em; }
.row-field { min-width: 0; }
.field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.data-value { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 7px; }
.primary-value { color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.35; }
.supporting-value { color: var(--muted); font-size: 10px; line-height: 1.45; }
.coverage-warning { color: var(--amber); }
.pill { display: inline-flex; min-height: 21px; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid transparent; border-radius: 99px; font-size: 9px; font-weight: 760; line-height: 1.2; white-space: nowrap; }
.pill::before { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.pill-good { border-color: #2e5a4a; background: var(--teal-soft); color: var(--teal); }
.pill-warning { border-color: #67532e; background: var(--amber-soft); color: var(--amber); }
.pill-bad { border-color: #6a384a; background: var(--red-soft); color: var(--red); }
.pill-accent { border-color: #34567c; background: var(--blue-soft); color: var(--blue); }
.pill-neutral { border-color: #3b4c64; background: #1e2b3f; color: #b0bed1; }
.run-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.run-meta .pill { min-height: 19px; padding: 2px 7px; }
.empty-active { padding: 3px 0; }
.active-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.active-run { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.recovery-panel { display: grid; grid-column: 2 / -1; grid-template-columns: auto 1fr; align-items: center; gap: 6px 15px; margin-top: -4px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: #142237; }
.recovery-attention { border-color: #365778; background: #15263b; }
.recovery-heading { display: flex; align-items: center; gap: 9px; }
.recovery-kicker { color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.recovery-facts { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.recovery-fact { color: var(--ink-soft); font-size: 10px; font-weight: 630; }
.recovery-original { margin: 7px 0 0; color: var(--ink-soft); font-size: 10px; overflow-wrap: anywhere; }
.recovery-guidance { grid-column: 2; margin: -1px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.data-note { margin: 13px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.page-error { margin: 18px 0; padding: 14px 16px; border: 1px solid #6a384a; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 13px; }
.page-footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 54px; padding: 17px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .12em; }

@media (max-width: 1120px) {
  .column-headings, .pipeline-row { grid-template-columns: minmax(165px, 1.1fr) repeat(2, minmax(150px, 1fr)) minmax(160px, 1fr) minmax(140px, .9fr); gap: 14px; }
  .column-headings { padding-right: 16px; padding-left: 16px; font-size: 8px; }
  .pipeline-row { padding-right: 16px; padding-left: 16px; }
  .source-mark { width: 30px; height: 30px; }
}
@media (max-width: 880px) {
  .topbar { height: 88px; padding: 0 22px; }
  .page-shell { width: min(100% - 40px, 720px); }
  .intro { padding: 49px 0 33px; }
  .refresh-card { min-width: 210px; }
  .column-headings { display: none; }
  .pipeline-rows { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .pipeline-row { grid-template-columns: 1fr 1fr; gap: 20px 18px; margin-bottom: 13px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 28px rgba(0, 0, 0, .16); }
  .row-source { grid-column: 1 / -1; padding-bottom: 1px; }
  .field-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
  .recovery-panel { grid-column: 1 / -1; margin-top: -1px; }
  .data-note { margin-top: 17px; }
}
@media (max-width: 580px) {
  .sample-banner { font-size: 10px; letter-spacing: .015em; }
  .topbar { height: 86px; gap: 12px; padding: 0 16px; }
  .brand { flex-direction: column; align-items: flex-start; gap: 3px; }
  .brand-logo { width: 116px; }
  .brand-research { padding-left: 0; border-left: 0; font-size: 9px; letter-spacing: .24em; }
  .topbar-actions { min-width: 0; gap: 10px; }
  .connection-status { min-width: 0; max-width: 103px; font-size: 10px; }
  .connection-status::before { flex-shrink: 0; }
  .button { min-height: 36px; flex-shrink: 0; padding: 0 12px; font-size: 11px; }
  .page-shell { width: calc(100% - 32px); }
  .intro { display: block; padding: 41px 0 26px; }
  .eyebrow { margin-bottom: 11px; font-size: 9px; }
  h1 { max-width: 12ch; margin-bottom: 9px; font-size: 38px; }
  .intro-text { max-width: 33ch; font-size: 13px; }
  .refresh-card { min-width: 0; width: fit-content; margin-top: 21px; padding: 10px 12px; }
  .refresh-icon { width: 30px; height: 30px; }
  .section-heading { align-items: flex-start; gap: 12px; }
  .section-heading h2 { font-size: 17px; }
  .timezone-note { max-width: 120px; align-items: flex-start; padding-top: 5px; font-size: 9px; line-height: 1.4; }
  .pipeline-row { grid-template-columns: 1fr; gap: 16px; padding: 17px 16px; }
  .row-source, .recovery-panel { grid-column: 1; }
  .row-field { display: grid; grid-template-columns: minmax(115px, .7fr) 1fr; gap: 10px; align-items: start; padding-top: 11px; border-top: 1px solid var(--line); }
  .field-label { margin: 4px 0 0; font-size: 8px; }
  .field-value { min-width: 0; }
  .data-value { gap: 6px; }
  .primary-value { font-size: 11px; }
  .recovery-panel { grid-template-columns: 1fr; gap: 8px; margin-top: -1px; padding: 12px; }
  .recovery-guidance { grid-column: 1; margin: 0; }
  .recovery-facts { gap: 5px 12px; }
  .auth-panel { flex-wrap: wrap; gap: 13px; padding: 17px; }
  .auth-copy { flex-basis: calc(100% - 60px); }
  .auth-panel .button { margin-left: 57px; }
  .page-footer { margin-top: 38px; font-size: 8px; letter-spacing: .08em; }
  .page-footer span:last-child { max-width: 165px; text-align: right; line-height: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
