:root {
  color-scheme: light;
  --background: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #eef1f5;
  --foreground: #141820;
  --muted: #626b7a;
  --border: #d9dee7;
  --border-strong: #b9c1cf;
  --accent: #315efb;
  --accent-strong: #2147d5;
  --accent-soft: #e8edff;
  --cut: #168477;
  --cut-soft: #e1f3f0;
  --hold: #315efb;
  --hold-soft: #e8edff;
  --hike: #a65e00;
  --hike-soft: #fff0d7;
  --danger: #b42318;
  --danger-soft: #fee9e7;
  --shadow: 0 12px 32px rgb(24 36 55 / 0.08);
  --radius: 10px;
  --font-sans: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #10141b;
  --surface: #171c25;
  --surface-muted: #202631;
  --foreground: #edf1f7;
  --muted: #a5afbe;
  --border: #303846;
  --border-strong: #475163;
  --accent: #6f91ff;
  --accent-strong: #9bb0ff;
  --accent-soft: #222f59;
  --cut: #63c9bb;
  --cut-soft: #173a36;
  --hold: #6f91ff;
  --hold-soft: #222f59;
  --hike: #f0ad4e;
  --hike-soft: #47341b;
  --danger: #ff8b81;
  --danger-soft: #4b2422;
  --shadow: 0 16px 40px rgb(0 0 0 / 0.24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #10141b;
    --surface: #171c25;
    --surface-muted: #202631;
    --foreground: #edf1f7;
    --muted: #a5afbe;
    --border: #303846;
    --border-strong: #475163;
    --accent: #6f91ff;
    --accent-strong: #9bb0ff;
    --accent-soft: #222f59;
    --cut: #63c9bb;
    --cut-soft: #173a36;
    --hold: #6f91ff;
    --hold-soft: #222f59;
    --hike: #f0ad4e;
    --hike-soft: #47341b;
    --danger: #ff8b81;
    --danger-soft: #4b2422;
    --shadow: 0 16px 40px rgb(0 0 0 / 0.24);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
select {
  font: inherit;
}

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

a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

button,
select {
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--foreground);
}

button {
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease;
}

button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

button:active {
  transform: translateY(1px);
}

button:disabled,
select:disabled {
  cursor: wait;
  opacity: 0.64;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  transform: translateY(-160%);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--foreground);
  color: var(--background);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(100% - 40px, 1360px);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 92%, transparent);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--foreground);
}

.status-indicator::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hike);
}

.status-indicator.is-live::before {
  background: var(--cut);
}

.status-indicator.is-error::before {
  background: var(--danger);
}

.page-shell {
  padding-block: 30px 64px;
}

.notice {
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid var(--hike);
  border-radius: 8px;
  background: var(--hike-soft);
  color: var(--foreground);
}

.notice.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.decision-section,
.chart-section,
.macro-section,
.calendar-section,
.sources-section,
.method-section {
  border: 1px solid var(--border);
  background: var(--surface);
}

.decision-section {
  box-shadow: var(--shadow);
}

.toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.field-label select {
  min-width: 210px;
  padding: 7px 34px 7px 10px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(390px, 0.72fr);
}

.decision-main,
.outcome-panel {
  padding: clamp(22px, 3vw, 40px);
}

.outcome-panel {
  border-left: 1px solid var(--border);
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 5px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.decision-summary {
  max-width: 700px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 16px;
}

.probability-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 10px;
  background: var(--border);
}

.probability-readout > div {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
}

.probability-readout span,
.probability-readout strong {
  display: block;
}

.probability-readout span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.probability-readout strong {
  font-family: var(--font-mono);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.probability-readout .is-primary {
  background: var(--accent-soft);
}

.probability-readout .is-primary strong {
  color: var(--accent-strong);
}

.probability-bar {
  height: 12px;
  display: flex;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-muted);
}

.probability-bar span {
  width: 0;
  min-width: 0;
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-cut { background: var(--cut); }
.bar-hold { background: var(--hold); }
.bar-hike { background: var(--hike); }

.key-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.key-metrics dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.key-metrics dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

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

.section-heading.compact {
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-heading a {
  flex: 0 0 auto;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-weight: 500;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 0;
  text-align: left;
  white-space: normal;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 0;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.outcome-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.outcome-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--hold);
}

.outcome-swatch.cut { background: var(--cut); }
.outcome-swatch.hike { background: var(--hike); }

.outcome-probability {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-weight: 600;
}

.panel-footnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-section,
.macro-section,
.method-section {
  margin-top: 22px;
  padding: clamp(20px, 2.6vw, 32px);
}

.range-control {
  display: flex;
  gap: 4px;
}

.range-control button {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 12px;
}

.range-control button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.chart-wrap {
  position: relative;
  min-height: 280px;
}

#history-chart {
  width: 100%;
  height: auto;
  display: block;
  color: var(--accent);
  overflow: visible;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis-label,
.chart-event-label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.chart-event-line {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-area {
  fill: color-mix(in srgb, var(--accent) 11%, transparent);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.chart-last-dot,
.chart-hover-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 3;
}

.chart-hover-line {
  stroke: var(--foreground);
  stroke-width: 1;
  opacity: 0.38;
}

.chart-empty {
  fill: var(--muted);
  font-size: 15px;
  text-anchor: middle;
}

.chart-detail {
  min-height: 24px;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.chart-scrubber {
  width: 100%;
  margin-top: 6px;
  accent-color: var(--accent);
}

.macro-table th,
.macro-table td {
  padding-block: 13px;
}

.metric-name {
  display: block;
  color: var(--foreground);
  font-weight: 600;
}

.metric-group {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.signal-label {
  display: inline-block;
  min-width: 44px;
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
}

.signal-label.dovish {
  border-color: var(--cut);
  background: var(--cut-soft);
}

.signal-label.hawkish {
  border-color: var(--hike);
  background: var(--hike-soft);
}

.source-link {
  font-weight: 600;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 22px;
}

.calendar-section,
.sources-section {
  padding: clamp(20px, 2.5vw, 28px);
}

.calendar-list,
.sources-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-list li,
.sources-list li {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.calendar-list li {
  grid-template-columns: 76px 1fr auto;
}

.sources-list li {
  grid-template-columns: 1fr auto;
}

.calendar-list li:last-child,
.sources-list li:last-child {
  border-bottom: 0;
}

.calendar-date {
  font-family: var(--font-mono);
  font-size: 12px;
}

.calendar-event strong,
.calendar-event span,
.source-name strong,
.source-name span {
  display: block;
}

.calendar-event span,
.source-name span {
  color: var(--muted);
  font-size: 12px;
}

.event-type,
.source-status {
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.source-status.live {
  border-color: var(--cut);
  color: var(--foreground);
}

.source-status.stale,
.source-status.fallback {
  border-color: var(--hike);
  color: var(--foreground);
}

.method-section h2 {
  margin-bottom: 18px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.method-grid p {
  margin: 0;
  color: var(--muted);
}

.method-grid strong {
  color: var(--foreground);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--muted);
  font-size: 12px;
}

.footer-inner p {
  margin: 0;
}

.skeleton-row span,
.skeleton-block {
  display: block;
  min-height: 18px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-muted) 25%, color-mix(in srgb, var(--surface-muted) 55%, var(--surface)) 45%, var(--surface-muted) 65%);
  background-size: 240% 100%;
  animation: skeleton 1.4s ease infinite;
}

.skeleton-row td {
  padding-block: 13px;
}

.skeleton-block {
  min-height: 44px;
}

@keyframes skeleton {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 980px) {
  .decision-grid {
    grid-template-columns: 1fr;
  }

  .outcome-panel {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

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

@media (max-width: 720px) {
  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar {
    display: none;
  }

  .shell {
    width: min(100% - 24px, 1360px);
  }

  .header-inner {
    min-height: 64px;
  }

  .brand small,
  #last-updated {
    display: none;
  }

  .page-shell {
    padding-block: 16px 42px;
  }

  .toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    gap: 12px;
  }

  .field-label {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .field-label select {
    width: 100%;
    min-width: 0;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button {
    flex: 1;
  }

  .decision-main,
  .outcome-panel {
    padding: 20px 16px;
  }

  h1 {
    font-size: 34px;
  }

  .probability-readout > div {
    padding: 11px 10px;
  }

  .probability-readout strong {
    font-size: 22px;
  }

  .key-metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .key-metrics > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }

  .chart-section,
  .macro-section,
  .method-section {
    padding: 18px 14px;
  }

  .range-control {
    align-self: flex-start;
  }

  .chart-wrap {
    min-height: 210px;
    overflow: hidden;
  }

  .method-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .calendar-list li {
    grid-template-columns: 64px 1fr;
  }

  .calendar-list .event-type {
    display: none;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding-block: 16px;
  }
}

@media (max-width: 420px) {
  .brand strong {
    font-size: 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .status-indicator {
    font-size: 11px;
  }

  .probability-readout span {
    font-size: 11px;
  }

  .probability-readout strong {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
