:root {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --card: #0f1013;
  --card-foreground: #fafafa;
  --muted: #18181b;
  --muted-foreground: #b4b4bd;
  --border: #27272a;
  --border-strong: #34343a;
  --primary: #22c55e;
  --primary-foreground: #052e16;
  --destructive: #ef4444;
  --warning: #eab308;
  --level-0: #161b22;
  --level-1: #0e4429;
  --level-2: #006d32;
  --level-3: #26a641;
  --level-4: #39d353;
  --radius: 10px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", monospace;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.legend[hidden],
.heat-detail[hidden],
.evaluation-results[hidden] {
  display: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.92);
}

.header-inner {
  width: min(100%, 1040px);
  height: 58px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand-icon {
  width: 20px;
  height: 20px;
}

.beta-badge,
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.beta-badge {
  padding: 4px 7px;
}

.badge {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
  padding: 6px 8px;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  border-radius: 7px;
  color: var(--muted-foreground);
  padding: 7px 10px;
  font-size: 13px;
  text-decoration: none;
}

nav a:hover,
nav a.active {
  background: var(--muted);
  color: var(--foreground);
}

.page-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 44px 24px 40px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.heading-meta {
  display: flex;
  flex: none;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.timezone-display {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0 0 8px;
  color: #86efac;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 650px;
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  padding: 6px 10px;
  font-size: 11px;
}

.status-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #71717a;
}

.status-pill.ok span {
  background: var(--primary);
}

.status-pill.warning {
  color: #fde047;
}

.status-pill.warning span {
  background: var(--warning);
}

.status-pill.error {
  color: #fca5a5;
}

.status-pill.error span {
  background: var(--destructive);
}

.panel,
.summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
}

.watch-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.75fr);
  margin-bottom: 12px;
  overflow: hidden;
}

.watch-main {
  min-height: 192px;
  padding: 26px;
}

.watch-main > p {
  margin: 23px 0 4px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.watch-value-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.watch-value-row strong {
  color: #f0fdf4;
  font-size: clamp(50px, 8vw, 72px);
  font-weight: 710;
  letter-spacing: -0.07em;
  line-height: 1;
}

.watch-value-row span {
  color: var(--muted-foreground);
  font-size: 13px;
}

.publication-warning {
  margin-top: 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 7px;
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.55;
}

.publication-warning.synthetic {
  border-color: rgba(234, 179, 8, 0.38);
  background: rgba(234, 179, 8, 0.08);
  color: #fef08a;
}

.watch-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
  padding: 26px;
}

.watch-aside > span,
.watch-aside small {
  color: var(--muted-foreground);
  font-size: 10px;
}

.watch-aside > span {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.watch-aside strong {
  margin-bottom: 9px;
  font-size: 14px;
  line-height: 1.45;
}

.watch-aside small + small {
  margin-top: 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

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

.summary-card {
  min-height: 112px;
  padding: 18px 20px;
}

.summary-card p {
  margin: 0 0 14px;
  color: var(--muted-foreground);
  font-size: 11px;
}

.summary-card strong {
  display: block;
  margin-bottom: 9px;
  font-size: 28px;
  font-weight: 660;
  letter-spacing: -0.045em;
  line-height: 1;
}

.summary-card small {
  display: block;
  min-height: 1.4em;
  color: #a1a1aa;
  font-size: 10px;
  line-height: 1.4;
}

.interval-note {
  display: block;
  margin-top: 12px;
  color: #a1a1aa;
  font-size: 10px;
}

.forecast-audit {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.35fr);
  gap: 24px;
  margin-bottom: 12px;
  padding: 20px;
}

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

.forecast-metadata div {
  min-width: 0;
}

.forecast-metadata dt {
  margin-bottom: 5px;
  color: var(--muted-foreground);
  font-size: 9px;
}

.forecast-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.trust-grid article {
  border-left: 2px solid var(--border-strong);
  padding: 5px 14px;
}

.trust-grid h2 {
  margin-bottom: 6px;
  font-size: 11px;
}

.trust-grid p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.55;
}

.forecast-panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading.compact {
  margin-bottom: 16px;
}

.section-description {
  margin: 7px 0 0;
  color: var(--muted-foreground);
  font-size: 11px;
}

nav a:focus-visible {
  outline: 2px solid rgba(134, 239, 172, 0.85);
  outline-offset: 2px;
}

.legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin: 22px 0 10px;
  color: var(--muted-foreground);
  font-size: 9px;
}

.legend-cells {
  display: inline-flex;
  gap: 3px;
}

.legend-cells i {
  width: 11px;
  height: 11px;
  border: 1px solid rgba(240, 246, 252, 0.08);
  border-radius: 2px;
  background: var(--level-0);
}

.legend-cells i[data-level="1"] {
  background: var(--level-1);
}

.legend-cells i[data-level="2"] {
  background: var(--level-2);
}

.legend-cells i[data-level="3"] {
  background: var(--level-3);
}

.legend-cells i[data-level="4"] {
  background: var(--level-4);
}

.legend-note {
  margin-left: 4px;
  color: #71717a;
}

.heatmap-scroll {
  width: 100%;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-color: var(--border-strong) transparent;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 840px;
}

.forecast-day {
  min-width: 0;
}

.day-label {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-strong);
  color: #a1a1aa;
  padding: 0 2px 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-cells {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(12, clamp(24px, 2.4vw, 30px));
  gap: 4px;
  width: 100%;
}

.contribution-cell {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 1px solid rgba(240, 246, 252, 0.08);
  border-radius: 4px;
  background: var(--level-0);
  cursor: pointer;
  padding: 0;
  transition: border-color 120ms ease, transform 120ms ease;
}

.contribution-cell[data-level="1"] {
  background: var(--level-1);
}

.contribution-cell[data-level="2"] {
  background: var(--level-2);
}

.contribution-cell[data-level="3"] {
  background: var(--level-3);
}

.contribution-cell[data-level="4"] {
  background: var(--level-4);
}

.contribution-cell:hover,
.contribution-cell:focus-visible {
  border-color: #bbf7d0;
  outline: none;
  transform: scale(1.13);
  z-index: 2;
}

.contribution-cell[aria-pressed="true"] {
  border-color: #dcfce7;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.24);
}

.heat-detail {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  padding: 10px 12px;
}

.heat-detail > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.heat-detail span {
  color: var(--muted-foreground);
  font-size: 10px;
}

.heat-detail strong {
  flex: none;
  min-width: 92px;
  color: #f0fdf4;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.heat-detail time {
  overflow: hidden;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  margin: 10px 0 0;
  color: #a1a1aa;
  font-size: 10px;
  line-height: 1.5;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 12px;
  margin-top: 12px;
}

.signal-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.lower-grid > .panel,
.table-panel {
  padding: 20px;
}

.metadata {
  margin: 0;
}

.metadata div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border);
  padding: 11px 0;
}

.metadata dt,
.metadata dd {
  font-size: 10px;
  line-height: 1.4;
}

.metadata dt {
  color: var(--muted-foreground);
}

.metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-list li {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}

.evidence-list li:first-child,
.metadata div:first-child {
  border-top-color: var(--border-strong);
}

.reference-panel {
  background: #0d0e11;
}

.reference-panel .eyebrow,
.reference-panel .signal-badge {
  color: #a1a1aa;
}

.reference-panel .evidence-list p {
  color: var(--muted-foreground);
  -webkit-line-clamp: 1;
}

.evidence-list li > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.evidence-list time,
.evidence-list small {
  color: #a1a1aa;
  font-size: 9px;
}

.evidence-list p {
  display: -webkit-box;
  margin: 7px 0;
  overflow: hidden;
  color: #d4d4d8;
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.evidence-list small a {
  color: #86efac;
  text-decoration: none;
}

.signal-badge {
  color: #86efac;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.signal-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.signal-badge.secondary {
  color: #d4d4d8;
}

.signal-badge.pending {
  color: #fde047;
}

.signal-empty,
.signal-error {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.5;
}

.signal-error {
  color: #fecaca;
}

.cutoff-note {
  margin: -6px 0 8px;
  color: #a1a1aa;
  font-size: 9px;
}

.pending-panel {
  margin-top: 12px;
  padding: 20px;
}

.empty-state {
  min-width: 520px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  padding: 28px;
  text-align: center;
}

.empty-state strong {
  color: var(--foreground);
}

.disclaimer {
  max-width: 760px;
  margin: 20px auto 0;
  color: #a1a1aa;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.accuracy-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
}

.chart-wrap svg {
  width: 100%;
  max-height: 350px;
}

#calibration-chart text {
  fill: var(--muted-foreground);
  font-size: 10px;
  text-anchor: middle;
}

#calibration-chart .axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}

#calibration-chart .chart-grid {
  stroke: #27272a;
  stroke-width: 1;
}

#calibration-chart .tick-label {
  fill: #a1a1aa;
  font-size: 9px;
}

#calibration-chart .y-tick {
  text-anchor: end;
}

#calibration-chart .axis-title {
  fill: #d4d4d8;
  font-size: 10px;
}

#calibration-chart .chart-empty {
  fill: #a1a1aa;
  font-size: 12px;
}

#calibration-chart .ideal {
  stroke: #52525b;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

#calibration-chart .calibration-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
}

#calibration-chart .calibration-point {
  fill: var(--primary);
  stroke: var(--background);
  stroke-width: 2;
}

#calibration-chart .calibration-point:focus {
  outline: none;
  stroke: #f0fdf4;
  stroke-width: 4;
}

.table-panel {
  margin-top: 12px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid var(--border);
  padding: 12px 9px;
  font-size: 10px;
  text-align: left;
}

th {
  color: var(--muted-foreground);
  font-weight: 550;
}

td a {
  color: #86efac;
}

td small {
  display: block;
  margin-top: 5px;
  color: #a1a1aa;
}

.table-primary {
  display: block;
  line-height: 1.5;
}

td code {
  color: #d4d4d8;
  font-family: var(--font-mono);
  font-size: 9px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #bbf7d0;
  outline-offset: 2px;
}

.result {
  display: inline-flex;
  border-radius: 999px;
  background: var(--muted);
  padding: 4px 7px;
}

.result.hit {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
}

.result.miss {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

@media (max-width: 820px) {
  .summary-grid.metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lower-grid,
  .accuracy-grid {
    grid-template-columns: 1fr;
  }

  .forecast-audit,
  .trust-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .header-inner,
  .page-shell {
    padding-right: 16px;
    padding-left: 16px;
  }

  .page-shell {
    padding-top: 32px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .heading-meta {
    align-items: flex-end;
    align-self: flex-end;
  }

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

  .watch-main {
    min-height: 172px;
    padding: 22px;
  }

  .watch-aside {
    border-top: 1px solid var(--border);
    border-left: 0;
    padding: 18px 22px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 98px;
  }

  .forecast-panel,
  .lower-grid > .panel,
  .table-panel,
  .pending-panel,
  .forecast-audit {
    padding: 16px;
  }

  .forecast-metadata {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .heat-detail {
    gap: 14px;
  }
}

@media (max-width: 460px) {
  .beta-badge {
    display: none;
  }

  .brand {
    gap: 7px;
  }

  nav a {
    padding: 7px 8px;
    font-size: 12px;
  }

  .watch-value-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .summary-grid.metrics {
    grid-template-columns: 1fr;
  }

  .metadata div {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
