:root {
  --frame-ink: #172a3c;
  --frame-muted: #5a6064;
  --frame-paper: #f1eee7;
  --frame-line: #c9c8c2;
  --frame-red: #a94b4d;
  --frame-blue: #587790;
  --frame-gold: #927635;
  --frame-green: #61796c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--frame-ink); background: var(--frame-paper); font-family: Arial, Helvetica, sans-serif; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 30000; padding: .75rem 1rem; color: white; background: var(--frame-ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.frames-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.3rem, 4vw, 3rem) 0 4rem; }
.page-heading { position: static; display: flex; width: auto; max-width: 1180px; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 auto .6rem; padding: 0; border: 0; color: var(--frame-ink); background: transparent; box-shadow: none; }
.page-heading h1 { margin: 0; font: 700 clamp(1.8rem, 4.2vw, 3.2rem)/1 Georgia, 'Times New Roman', serif; letter-spacing: -.045em; }
.key-label { margin: .35rem 0 0; color: var(--frame-red); font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.frame-nav a:focus-visible { outline: 3px solid #174f85; outline-offset: 3px; }
.frame-nav { position: static; display: flex; width: auto; flex-wrap: wrap; gap: .45rem; overflow: visible; padding: .25rem 0 1rem; border: 0; background: transparent; box-shadow: none; }
.frame-nav a { flex: 0 0 auto; min-height: 42px; display: inline-flex; align-items: center; padding: .55rem .75rem; border: 1px solid var(--frame-line); color: var(--frame-ink); background: rgba(255,255,255,.65); font-size: .72rem; font-weight: 700; text-decoration: none; }
.frame-nav a:hover { border-color: var(--frame-ink); }
.diagram-sheet { --accent: var(--frame-red); position: relative; width: 100%; min-height: 10in; margin: 0 auto 2rem; padding: clamp(1.1rem, 3.4vw, 2.5rem); border: 1px solid var(--frame-line); background: #fffefa; box-shadow: 0 8px 26px rgba(23,42,60,.08); scroll-margin-top: 1rem; }
.accent-one { --accent: var(--frame-red); }
.accent-two { --accent: var(--frame-blue); }
.accent-three { --accent: var(--frame-gold); }
.accent-four { --accent: var(--frame-green); }
.sheet-meta { display: flex; justify-content: space-between; align-items: center; gap: .8rem; color: #262626; font-size: .69rem; font-weight: 800; letter-spacing: .09em; }
.key-stamp { flex: 0 0 auto; min-width: 7.2rem; padding: .4rem .55rem; border: 1.5px solid #252525; border-radius: 8px; text-align: center; letter-spacing: .02em; }
.sheet-title { margin: .38in 0 .27in; color: #151719; font: 700 clamp(1.7rem, 3.7vw, 2.8rem)/1.08 Georgia, 'Times New Roman', serif; letter-spacing: -.025em; }
.sheet-rule { height: 3px; margin-bottom: .18in; background: var(--accent); }
.sheet-instruction { margin: 0 0 .16in; color: var(--frame-muted); font-size: .72rem; font-weight: 700; letter-spacing: .055em; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .32in; }
.three-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .2in; }
.full-card { margin-bottom: .2in; }
.chamber h3, .subsection-title { margin: 0 0 .11in; color: #202326; font-size: .8rem; line-height: 1.2; font-weight: 800; letter-spacing: .015em; }
.chamber { min-width: 0; }
.diagram-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: .16in .17in; margin: 0 0 .09in; border: 2px solid var(--accent); border-radius: 11px; background: white; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .16s ease; scroll-margin: 1rem; }
.diagram-card:hover, .diagram-card:focus-visible, .diagram-card.is-highlighted { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 23%, transparent); }
.diagram-card:focus-visible { outline: 2px solid var(--frame-ink); outline-offset: 2px; }
.card-heading { padding-right: .55in; color: #202326; font-size: .73rem; line-height: 1.25; font-weight: 800; text-transform: uppercase; }
.ap-mark { position: absolute; top: .09in; right: .11in; min-width: .42in; padding: .08in .1in; border: 1.5px solid #242424; border-radius: 4px; color: #222; background: white; font-size: .65rem; line-height: 1; font-weight: 800; text-align: center; }
.answer-slot { display: flex; flex: 1; flex-direction: column; min-height: .37in; margin-top: .08in; color: #555; font-size: .73rem; line-height: 1.42; white-space: pre-line; }
.answer-slot .answer-text { display: block; }
.compact { min-height: .66in; }
.compact:nth-of-type(5) { min-height: .78in; }
.tall { min-height: 1in; margin-top: .06in; }
.subsection-title { margin: .19in 0 .1in; }
.power-card { min-height: 1.6in; }
.power-card .answer-slot { min-height: 1.1in; }
.sheet-footer { display: flex; justify-content: space-between; gap: .7rem; margin-top: .25in; padding-top: .1in; border-top: 1px solid #333; color: #333; font-size: .62rem; font-weight: 700; }
.sheet-footer span:last-child { font-weight: 500; text-align: right; }

/* Leadership and committee diagram */
.leader-card { min-height: .82in; margin-bottom: .08in; }
.leader-card:nth-of-type(2) { min-height: .96in; }
.leader-card:nth-of-type(3) { min-height: .78in; }
.leader-card .answer-slot { min-height: .35in; }
.committee-overview { min-height: .72in; margin-top: .12in; }
.committee-types { row-gap: .1in; }
.type-card { min-height: .85in; }
.chair-role { min-height: .86in; margin-top: .12in; }

/* Process and budget flows */
.step-flow, .budget-flow { display: grid; justify-items: stretch; }
.budget-flow { width: 87%; margin: 0 auto; }
.process-step { min-height: .76in; margin: 0; }
.process-step .answer-slot { min-height: .28in; }
.budget-step { min-height: .63in; margin: 0; }
.budget-step .answer-slot { min-height: .24in; }
.flow-arrow { height: .23in; color: var(--accent); font-size: 1.4rem; line-height: .23in; font-weight: 900; text-align: center; cursor: pointer; transition: color .15s ease, transform .15s ease; }
.flow-arrow.is-highlighted { color: var(--frame-ink); transform: scale(1.16); }
.flow-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.spending-grid { margin-top: .02in; }
.spending-card { min-height: 1.45in; }
.spending-card .answer-slot { min-height: .8in; }

@media (max-width: 680px) {
  .frames-shell { width: min(100% - 1rem, 1180px); }
  .page-heading { align-items: flex-start; flex-direction: column; gap: .55rem; }
  .diagram-sheet { min-height: 0; padding: 1rem; }
  .sheet-meta { font-size: .58rem; }
  .key-stamp { min-width: 6.8rem; }
  .sheet-title { margin: .28in 0 .2in; font-size: clamp(1.48rem, 7vw, 2.1rem); }
  .two-columns { gap: .12in; }
  .three-columns { gap: .1in; }
  .chamber h3, .subsection-title { font-size: .68rem; }
  .diagram-card { padding: .12in; border-radius: 8px; }
  .card-heading { font-size: .63rem; }
  .answer-slot { font-size: .67rem; }
  .ap-mark { top: .06in; right: .06in; min-width: .34in; font-size: .57rem; }
  .compact { min-height: 1.02in; }
  .compact:nth-of-type(5) { min-height: 1.36in; }
  .tall { min-height: 1.18in; }
  .power-card { min-height: 2.05in; }
  .power-card .answer-slot { min-height: 1.5in; }
  .leader-card { min-height: 1.12in; }
  .leader-card:nth-of-type(2) { min-height: 1.54in; }
  .leader-card:nth-of-type(3) { min-height: 1.15in; }
  .type-card { min-height: 1.42in; }
  .chair-role { min-height: 1.15in; }
  .process-step { min-height: 1.03in; }
  .budget-flow { width: 100%; }
  .budget-step { min-height: .9in; }
  .spending-card { min-height: 1.7in; }
}

@media (max-width: 420px) {
  .two-columns { grid-template-columns: 1fr; }
  .three-columns { grid-template-columns: 1fr; }
  .chamber + .chamber { margin-top: .12in; }
  .power-card, .power-card .answer-slot { min-height: 1.05in; }
  .sheet-footer { font-size: .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
