:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #f0f5ff;
  background: #0a1425;
  font-synthesis: none;
  --bg: #0a1425;
  --side: #0e1a2f;
  --panel: #121f34;
  --panel-soft: #192b48;
  --line: #2a4061;
  --muted: #adc0da;
  --muted-dim: #90a6c3;
  --cyan: #67dcff;
  --accent: #86caff;
  --green: #70dbb8;
  --red: #f4a5b5;
  --gold: #f3cd83;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .58; cursor: default; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #c7e2fd; text-decoration: underline; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
a svg, .text-button svg { vertical-align: -2px; }

.workspace { display: grid; grid-template-columns: 221px minmax(0, 1fr); min-height: 100vh; }
.skip { position: absolute; top: -90px; z-index: 10; margin: 12px; padding: 12px; background: var(--panel); }
.skip:focus { top: 0; }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 25px 16px 20px; background: linear-gradient(170deg, #15274b, var(--side) 44%); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 7px 37px; color: #f0f4f8; font-size: 17px; line-height: 1.12; font-weight: 680; letter-spacing: -.35px; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 9px; border-radius: 10px; background: linear-gradient(145deg, #3478f5, #233bab); color: #d9f8ff; box-shadow: 0 4px 16px #356afb40; }
.brand-mark i { display: block; width: 4px; border-radius: 1px; background: currentColor; }
.brand-mark i:nth-child(1) { height: 8px; opacity: .65; }
.brand-mark i:nth-child(2) { height: 15px; opacity: .85; }
.brand-mark i:nth-child(3) { height: 22px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button { display: flex; align-items: center; gap: 10px; min-height: 43px; width: 100%; padding: 0 10px; text-align: left; font-size: 13px; font-weight: 550; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #a8b3c3; }
.sidebar nav button svg { flex: 0 0 auto; }
.sidebar nav button:hover { color: #edf5ff; background: #1a3154; }
.sidebar nav button[aria-current] { color: #f1f7ff; background: linear-gradient(100deg, #244591, #1b2e59); border-color: #3a65b0; box-shadow: inset 3px 0 var(--cyan); }
.sidebar nav button[aria-current] svg { color: var(--cyan); }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.workspace-label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.main-wrap { min-width: 0; background: radial-gradient(ellipse 80% 390px at 77% 0, #172d59, var(--bg) 85%); }
.topbar { min-height: 61px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: #0d192de6; color: #b8cbe6; font-size: 13px; font-weight: 550; }
.topbar > div { display: flex; align-items: center; gap: 16px; }
.timezone { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.demo-label { background: #24396b; border: 1px solid #4469ad; color: #d0e7ff; border-radius: 5px; padding: 4px 8px; white-space: nowrap; font-size: 11px; }
.main-content { max-width: 1540px; margin: 0 auto; padding: 31px 32px 24px; }
.page-head, .section-heading, .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.page-head { margin-bottom: 32px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 3vw, 36px); font-weight: 680; line-height: 1.12; letter-spacing: -.9px; }
.page-head p { color: var(--muted); margin-top: 8px; font-size: 14px; line-height: 1.45; }
h2 { font-size: 17px; letter-spacing: -.18px; font-weight: 650; }
.section-heading { margin-bottom: 12px; }
.section-heading > span, .quiet-label { color: var(--muted); font-size: 12px; }
.button, .icon-button { border: 1px solid #3a5680; background: #1b2f4e; color: #e4efff; border-radius: 7px; min-height: 36px; gap: 7px; display: inline-flex; align-items: center; justify-content: center; padding: 0 11px; font-size: 12px; font-weight: 620; white-space: nowrap; }
.button:hover, .icon-button:hover { background: #24446e; border-color: #577cb4; }
.refresh-button, .button.primary { background: linear-gradient(125deg, #275cc9, #23438f); border-color: #5b88ec; color: #f2f8ff; }
.refresh-button:hover, .button.primary:hover { background: #2d5fc4; border-color: #86aaff; }
.icon-button { padding: 0; width: 34px; min-height: 34px; }
.text-button { background: none; border: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); padding: 2px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.text-button:hover { color: #cee8ff; text-decoration: underline; text-underline-offset: 3px; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.metric {
  --metric-accent: #50cbf8;
  padding: 14px 13px 11px;
  background: linear-gradient(150deg, #1b3257, var(--panel) 59%);
  box-shadow: inset 0 2px var(--metric-accent), 0 5px 14px #050d1e35;
}
.metric:nth-child(2), .metric:nth-child(5) { --metric-accent: #6999ff; }
.metric:nth-child(3) { --metric-accent: #a19bff; }
.metric h3 { font-weight: 650; font-size: 13px; }
.metric-sub { display: block; color: var(--muted); margin-top: 3px; line-height: 1.3; font-size: 11px; }
.metric-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; margin-top: 12px; font-size: clamp(21px, 2.3vw, 31px); letter-spacing: -1px; font-weight: 630; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 11px; font-weight: 550; letter-spacing: 0; color: var(--muted); }
.metric-change { display: block; font-size: 11px; font-weight: 680; margin-top: 4px; font-variant-numeric: tabular-nums; }
.metric-change small { color: var(--muted); font-weight: 450; font-size: inherit; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.spark, .spark-empty { width: 100%; height: 32px; display: block; margin-top: 8px; }
.spark polyline { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-guide { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.metric-foot { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.metric-foot a { white-space: nowrap; font-size: 10px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.overview-right { display: grid; gap: 14px; }
.panel-head { min-height: 73px; padding: 15px 16px; }
.panel-head p { color: var(--muted); margin-top: 5px; font-size: 12px; }
.event-grid { display: grid; grid-template-columns: 91px minmax(0, 1fr) minmax(63px, 85px) 14px; gap: 10px; align-items: center; }
.event-head { background: #1b3152; padding: 10px 16px; font-size: 11px; color: #b8cdea; border-top: 1px solid var(--line); }
.event-row { background: transparent; border: 0; border-top: 1px solid var(--line); text-align: left; width: 100%; min-height: 65px; padding: 10px 16px; }
.event-row:hover, .event-row[aria-expanded='true'] { background: var(--panel-soft); }
.event-row:last-child { border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; }
.event-date, .event-name > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.event-date b, .event-name b { font-size: 12px; line-height: 1.35; font-weight: 650; }
.event-date > span, .event-name small, .event-agency { color: var(--muted); font-size: 11px; }
.event-name { display: flex; align-items: center; gap: 8px; }
.event-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { background: #203d66; color: #b8e0ff; border: 1px solid #3a6397; border-radius: 4px; font-size: 10px; font-weight: 650; padding: 3px 5px; width: max-content; }
.tag-fomc { background: #423321; border-color: #614d30; color: #ebcd98; }
.tag-cpi, .tag-ppi { background: #322943; border-color: #4b3e61; color: #d6c6f1; }
.tag-nfp { background: #243932; border-color: #34574b; color: #a0dcbd; }
.chevron { display: grid; place-items: center; color: var(--muted); }
.chevron.is-open { transform: rotate(90deg); }
.event-detail { padding: 14px 16px 18px; background: #101d33; border-top: 1px solid var(--line); }
.event-detail p { color: #c7d2df; font-size: 13px; line-height: 1.55; }
.event-values { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0; gap: 8px; }
.event-values div { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 5px; padding: 9px; font-size: 11px; }
.event-values dd { margin: 5px 0 0; font-size: 16px; }
.event-detail footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 11px; }
.gold-panel { padding: 14px 16px; background: linear-gradient(125deg, #22283d, var(--panel) 66%); border-color: #46506a; }
.gold-title { display: flex; align-items: center; gap: 10px; }
.gold-title p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.gold-icon { display: grid; width: 35px; height: 35px; place-items: center; color: var(--gold); background: #3c3227; border: 1px solid #594934; border-radius: 8px; }
.gold-body { margin-top: 12px; }
.gold-body strong { font-size: 13px; color: var(--gold); }
.gold-body p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.42; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 10px 16px; border-top: 1px solid var(--line); }
.source-row b, .source-row small { display: block; font-size: 11px; }
.source-row small { margin-top: 4px; line-height: 1.3; color: var(--muted); }
.source-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.source-right time, .source-right a { color: var(--muted); font-size: 10px; white-space: nowrap; }
.source-right a { color: var(--accent); }
.source-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; font-size: 11px; white-space: nowrap; }
.source-badge > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.source-badge.good { color: var(--green); }
.source-badge.delayed, .source-row small.warn-text { color: var(--gold); }
.snapshot-footer { color: var(--muted-dim); font-size: 11px; display: flex; flex-wrap: wrap; gap: 6px 10px; padding-top: 14px; }
.snapshot-footer span { font-variant-numeric: tabular-nums; }
.calendar-head { flex-wrap: wrap; }
.switcher { display: inline-flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 3px; }
.switcher button { background: none; border: 0; padding: 7px 10px; font-size: 12px; color: var(--muted); border-radius: 4px; }
.switcher button[aria-pressed='true'] { background: #284c91; color: #e0edff; }
.select-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
input, select, textarea { width: 100%; color: #edf1f7; border: 1px solid #46628a; border-radius: 6px; background: #0e1a2e; padding: 8px 9px; min-height: 35px; }
.note-form { border-top: 1px solid var(--line); padding: 17px; display: grid; gap: 13px; justify-items: start; }
.note-form label { min-width: min(100%, 500px); }
.note-form label, .auth-card label { display: grid; gap: 5px; color: #c6d0db; font-size: 12px; }
.note-card { padding: 15px 16px; border-top: 1px solid var(--line); }
.note-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11px; }
.note-card h3 { margin-top: 8px; font-size: 14px; }
.note-card p { margin: 7px 0; max-width: 78ch; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: #b9c5d2; }
.note-card a { font-size: 12px; }
.notice, .form-error, .empty { padding: 12px 16px; font-size: 13px; line-height: 1.5; }
.notice { border: 1px solid #41689e; background: #172e51; color: #d3e5f6; border-radius: 7px; margin-bottom: 16px; }
.form-error { background: #392627; border: 1px solid #6a4648; border-radius: 6px; color: #f1b9b6; }
.empty { color: var(--muted); }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.auth-card { width: min(100%, 440px); padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.auth-card .brand { margin: 0 0 27px; }
.auth-card h1 { font-size: 27px; }
.auth-card p { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.auth-card form { display: grid; gap: 14px; margin: 16px 0 0; }
.auth-card form .button, .auth-body > .button { margin-top: 6px; }
.auth-return { margin-top: 14px; }
.setup-key { display: grid; gap: 6px; color: var(--gold); }
.setup-key code { overflow-wrap: anywhere; }

@media (max-width: 1230px) {
  .main-content, .topbar { padding-left: 23px; padding-right: 23px; }
  .workspace { grid-template-columns: 192px minmax(0, 1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .metrics-grid { gap: 8px; }
  .metric { padding-left: 10px; padding-right: 10px; }
  .event-grid { grid-template-columns: 77px minmax(0, 1fr) 58px 11px; gap: 7px; }
}

@media (max-width: 1030px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .event-grid { grid-template-columns: 85px minmax(0, 1fr) 85px 14px; }
}

@media (max-width: 760px) {
  .workspace { display: block; }
  .sidebar { position: relative; height: auto; padding: 11px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 0 10px; font-size: 14px; }
  .sidebar .brand br { display: none; }
  .sidebar .brand br::after { content: ' '; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; padding-bottom: 5px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; }
  .sidebar nav button { flex: 0 0 auto; width: max-content; min-height: 34px; padding: 0 7px; font-size: 11px; gap: 4px; }
  .sidebar nav button svg { width: 14px; }
  .sidebar-foot { border: 0; padding: 0; margin: 0; position: absolute; right: 15px; top: 16px; }
  .workspace-label { display: none; }
  .topbar, .main-content { padding-left: 15px; padding-right: 15px; }
  .topbar { min-height: 45px; font-size: 11px; }
  .topbar > div { gap: 8px; }
  .main-content { padding-top: 18px; }
  .page-head { align-items: flex-start; margin-bottom: 21px; gap: 8px; }
  .page-head p { font-size: 12px; }
}

@media (max-width: 480px) {
  .sidebar nav button svg { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-right { grid-template-columns: 1fr; }
  .section-heading { flex-wrap: wrap; gap: 4px; }
  .event-grid { grid-template-columns: 63px minmax(0, 1fr) 10px; }
  .event-grid > :nth-child(3) { display: none; }
  .event-name { align-items: flex-start; gap: 5px; }
  .panel-head, .event-head, .event-row { padding-left: 11px; padding-right: 11px; }
}
