:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #17213a; background: #f5f7fb; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at top left, #e9f4ff 0, transparent 32rem), #f5f7fb; }
.rh-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 40px; }
.rh-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin: 22px 0; }
.eyebrow, .section-label { margin: 0 0 8px; color: #245fa5; font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1 { max-width: 940px; margin: 0; font-size: clamp(1.75rem, 3.7vw, 3rem); line-height: 1.06; letter-spacing: -.035em; }
.subtitle { margin: 12px 0 0; color: #52627b; font-size: 1.08rem; }
.local-note { flex: 0 0 auto; margin: 4px 0; padding: 8px 12px; border: 1px solid #bfd2ea; border-radius: 999px; background: #fff; color: #49627f; font-size: .82rem; font-weight: 750; }
.local-note span { color: #1e9d68; }
.rh-workspace, .rh-insight { border: 1px solid #cbd8e8; border-radius: 24px; background: rgba(255,255,255,.97); box-shadow: 0 18px 50px rgba(42,74,112,.1); }
.rh-workspace { display: grid; gap: 16px; padding: clamp(14px, 2.8vw, 28px); }
.irritation-card { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: clamp(12px,2vw,24px); align-items: center; padding: clamp(18px,3vw,30px); border: 1px solid #cbd8e8; border-radius: 20px; background: #f7fbff; }
.probability-token, .rhythm-token { display: grid; gap: 7px; min-height: 150px; place-content: center; padding: 18px; border-radius: 17px; background: #fff; text-align: center; }
.probability-token span, .rhythm-token span { color: #52627b; font-size: .82rem; font-weight: 800; }
.probability-token strong, .rhythm-token strong { color: #245fa5; font-size: clamp(2rem,5vw,3.6rem); line-height: 1; }
.rhythm-token strong { color: #9a3e2e; }
.probability-token small, .rhythm-token small { color: #52627b; }
.rh-arrow { color: #9a3e2e; font-size: clamp(2rem,5vw,4rem); font-weight: 900; }
.chart-card, .explore-card, .conclusion-card { padding: clamp(16px,2.5vw,24px); border: 1px solid #cbd8e8; border-radius: 18px; background: #fff; }
.chart-copy { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 14px; }
.chart-copy h2 { margin: 0; font-size: clamp(1.25rem,2.5vw,1.75rem); }
.chart-copy > p { max-width: 370px; margin: 0; color: #52627b; font-size: .88rem; text-align: right; }
.chart-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); gap: 20px; align-items: center; }
.chart-panel, .chart-scroll { min-width: 0; }
.chart-scroll { overflow-x: auto; }
.chart-scroll-hint { display: none; margin: 0 0 5px; color: #52627b; font-size: .78rem; font-weight: 750; }
.rh-chart { display: block; width: 100%; aspect-ratio: 670 / 370; }
.grid-line { stroke: #dce5ef; stroke-width: 1; }
.y-label { fill: #52627b; font-size: 16px; text-anchor: end; }
.x-label { fill: #52627b; font-size: 17px; font-weight: 750; text-anchor: middle; }
.reference-line { stroke: #9a3e2e; stroke-width: 3; stroke-dasharray: 10 8; }
.reference-label { fill: #8b3428; font-size: 17px; font-weight: 850; text-anchor: end; }
.rh-line { fill: none; stroke: #245fa5; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.rh-point { fill: #fff; stroke: #245fa5; stroke-width: 7; }
.rh-point.is-selected { fill: #df7a28; stroke: #17213a; stroke-width: 8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { margin-bottom: 8px; color: #52627b; font-size: .78rem; font-weight: 800; text-align: left; text-transform: uppercase; }
th, td { padding: 12px 10px; border-bottom: 1px solid #dce5ef; text-align: left; }
thead th { color: #52627b; font-size: .75rem; }
tbody th { color: #245fa5; }
.rh-row.is-selected { background: #fff1e4; }
.rh-row strong { color: #8e4917; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.metric-grid p { display: grid; gap: 5px; margin: 0; padding: 13px 15px; border-radius: 13px; background: #f2f6fb; }
.metric-grid span { color: #52627b; font-size: .75rem; font-weight: 800; }
.metric-grid strong { color: #245fa5; font-size: clamp(1.05rem,2.2vw,1.4rem); }
.explore-card { display: grid; grid-template-columns: auto minmax(220px,1fr) auto; gap: 16px; align-items: center; background: #f7fbff; }
.explore-card label { font-weight: 850; }
.explore-card input { width: 100%; accent-color: #a65b1d; }
.explore-card output { min-width: 108px; color: #8e4917; font-weight: 900; text-align: right; }
.conclusion-card { border-color: #9cccbc; background: #eaf9f3; text-align: center; }
.conclusion-card h2 { margin: 0 0 7px; color: #18715b; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.conclusion-card p { margin: 5px 0; font-size: clamp(1rem,2.1vw,1.25rem); }
.rh-insight { margin-top: 16px; padding: 20px 24px; }
.rh-insight > p { min-height: 1.5em; margin: 0 0 14px; color: #354964; }
.rh-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.primary-button, .reset-button { min-height: 46px; padding: 0 20px; border-radius: 13px; font: inherit; font-weight: 800; cursor: pointer; }
.primary-button { border: 1px solid #8e4917; background: #a65b1d; color: #fff; }
.primary-button:disabled { cursor: not-allowed; opacity: .55; }
.reset-button { border: 1px solid #bdd0e4; background: #fff; color: #405873; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .rh-shell { width: min(100% - 20px,1180px); padding-top: 10px; }
  .rh-header { display: block; }
  .local-note { display: inline-block; margin-top: 14px; }
  .rh-workspace { padding: 10px; }
  .irritation-card { grid-template-columns: 1fr; }
  .probability-token, .rhythm-token { min-height: 120px; }
  .rh-arrow { transform: rotate(90deg); text-align: center; }
  .chart-copy { display: block; }
  .chart-copy > p { margin-top: 8px; text-align: left; }
  .chart-layout { grid-template-columns: 1fr; }
  .rh-chart { width: 520px; }
  .chart-scroll-hint { display: block; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .explore-card { grid-template-columns: 1fr; }
  .explore-card output { text-align: left; }
  .rh-insight { padding: 18px; }
  .rh-controls > * { flex: 1 1 140px; }
}

@media (min-width: 721px) and (max-width: 1040px) {
  .rh-shell { width: min(100% - 28px,1180px); }
  .chart-layout { grid-template-columns: 1fr; }
}

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