:root {
  --paper: #faf8f5; --surface: #fffdf9; --ink: #25221f; --muted: #6e655f;
  --line: #e8ddd3; --clay: #b45132; --clay-hover: #94412a; --peach: #f5e6d3;
  --serif: 'Songti SC', 'Noto Serif CJK SC', 'STSong', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.65 var(--sans); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { font: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled, select:disabled { opacity: .55; cursor: wait; }
a { color: var(--clay); text-decoration-thickness: 1px; text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid #b45132; outline-offset: 4px; }
.site-header { max-width: 1440px; margin: 0 auto; padding: 24px 40px; display: flex; justify-content: space-between; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); display: inline-flex; gap: 12px; align-items: center; text-decoration: none; font-weight: 600; line-height: 1.35; }
.brand-mark { color: var(--clay); border: 1px solid #d1ab97; border-radius: 10px 10px 4px 10px; width: 40px; height: 40px; display: grid; place-items: center; font-family: var(--serif); font-size: 25px; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.account { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; min-width: 0; }
.account > span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { max-width: 1440px; padding: 0 40px; margin: 0 auto; }
.page-heading { padding: 40px 0 32px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; color: var(--clay); margin: 0 0 8px; font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 600; line-height: 1.35; letter-spacing: .02em; margin-bottom: 12px; }
h2 { font-size: 22px; font-weight: 600; line-height: 1.4; margin-bottom: 0; }
h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.intro { color: var(--muted); font-size: 14px; margin-bottom: 0; }
.state-panel { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; text-align: center; padding: 48px 24px; margin-bottom: 24px; }
.state-mark { display: grid; place-items: center; margin: 0 auto 16px; width: 40px; height: 40px; border-radius: 50%; color: var(--clay); background: var(--peach); font-family: var(--serif); font-size: 28px; }
.state-panel h2 { font-family: var(--serif); margin-bottom: 8px; }
.state-panel p { color: var(--muted); max-width: 560px; margin: 0 auto 24px; font-size: 14px; overflow-wrap: anywhere; }
.state-panel p:last-child { margin-bottom: 0; }
.state-panel[data-kind="error"] { border-color: #d6b4a7; }
.date-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 16px; }
.report-label .eyebrow { display: block; margin-bottom: 4px; }
.report-label h2 { font-family: var(--serif); font-size: 28px; }
.report-selectors { display: flex; align-items: flex-end; gap: 12px; }
.report-selectors label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
select { min-height: 44px; padding: 8px 32px 8px 12px; color: var(--ink); background: var(--surface); border: 1px solid #d6c9be; border-radius: 8px; font-size: 16px; max-width: 100%; }
.date-help { font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 24px; padding: 10px 20px; font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1.5; transition: background .2s ease-out, border-color .2s ease-out; white-space: nowrap; }
.primary { color: #fffdf9; background: var(--clay); }
.primary:hover { background: var(--clay-hover); }
.secondary { color: var(--ink); background: transparent; border-color: #d8cbbf; }
.secondary:hover { background: #f2ece4; }
.text-button { min-height: 44px; padding: 8px 4px; background: transparent; color: var(--muted); border: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 24px; padding: 4px 10px; background: var(--peach); color: #83502d; font-weight: 500; }
.metric-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; overflow: hidden; }
.metric { padding: 24px; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric p { margin-bottom: 8px; font-size: 14px; }
.metric p span { color: var(--muted); font-size: 12px; margin-left: 4px; }
.metric strong { display: block; font-size: clamp(30px, 3vw, 42px); line-height: 1.3; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric-income strong { color: var(--clay); }
.metric-note { display: block; color: var(--muted); font-size: 12px; margin-top: 12px; }
.coverage-note { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 24px; padding: 16px 20px; background: #f2ede5; border-radius: 10px; font-size: 13px; color: #65584c; }
.coverage-note p { margin: 0; }
.coverage-note p + p { margin-top: 4px; font-size: 12px; color: var(--muted); }
.note-dot { width: 6px; height: 6px; border-radius: 50%; background: #af8050; flex-shrink: 0; margin-top: 9px; }
.analysis-entry { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 8px 0 24px; }
.analysis-entry p { margin: 0; color: var(--muted); font-size: 13px; }
.analysis { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 24px; }
.analysis-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.analysis-heading h2 { font-family: var(--serif); }
.analysis-heading .eyebrow { margin-bottom: 4px; }
.frame-status { font-size: 13px; color: var(--muted); padding: 12px 16px; border: 1px dashed var(--line); border-radius: 8px; }
.report-frame-wrap { min-width: 0; }
#reportFrame { display: block; width: 100%; height: 640px; border: 0; background: var(--paper); }
.site-footer { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 32px; padding: 24px 0 32px; font-size: 12px; }
.mobile-groups { display: none; }
.skip-link { position: fixed; top: 8px; left: 16px; padding: 12px 16px; background: var(--surface); z-index: 20; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.noscript-note { margin: 24px; padding: 24px; color: var(--ink); background: var(--peach); }
@media (max-width: 760px) {
  html { scroll-padding-top: 16px; }
  .site-header { padding: 16px 20px; }
  .page { padding: 0 20px; }
  .page-heading { padding: 24px 0; }
  h1 { font-size: 26px; }
  .intro { font-size: 13px; max-width: 25em; }
  .account > span { display: none; }
  .date-bar { display: block; }
  .report-label h2 { font-size: 24px; margin-bottom: 16px; }
  .report-selectors { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
  .report-selectors label { min-width: 0; }
  .report-selectors select { width: 100%; }
  #latestButton { grid-column: 1 / -1; justify-self: start; padding: 4px 0; border: none; border-radius: 0; min-height: 44px; color: var(--clay); text-decoration: underline; text-underline-offset: 4px; }
  .date-help { margin: -4px 0 20px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { padding: 20px; }
  .metric-income { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-left: 0; }
  .metric strong { font-size: 32px; }
  .metric-income strong { font-size: 40px; }
  .metric-note { font-size: 12px; margin-top: 8px; }
  .report-meta { gap: 8px 12px; }
  #cutoffLabel { flex-basis: 100%; }
  .coverage-note { padding: 16px; }
  .analysis-entry { display: block; }
  .analysis-entry .button { margin-top: 16px; width: 100%; }
  .analysis-heading { padding: 0 4px; }
  .analysis { margin-left: -12px; margin-right: -12px; }
  .analysis-heading h2 { font-size: 20px; }
  .site-footer { display: block; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .site-footer span { display: block; }
  body.analysis-open { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .mobile-groups { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: #faf8f5; border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(105, 77, 55, .05); }
  .mobile-groups button { min-height: 44px; padding: 8px 4px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; }
  .mobile-groups button[aria-current="true"] { background: var(--peach); color: #8d452d; border-color: #e6cbbb; font-weight: 600; }
}
@media (max-width: 360px) { .page { padding: 0 16px; } .metric { padding: 16px; } h1 { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
