:root { color-scheme: light; }
body { margin: 0; background: #FAF8F4; }
[hidden] { display: none !important; }
#studio, .edition-note { --ink: #202a32; --quiet: #475a66; --blue: #164e75; --line: #c9c7ba; color: var(--ink); font: 17px/1.5 "Atkinson Hyperlegible Next",Arial,sans-serif; }
#studio *, .edition-note * { box-sizing: border-box; }
#studio { max-width: 1048px; margin: auto; padding: 24px 36px 16px; }
.studio-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.studio-head a, .studio-head span { text-decoration: none; color: var(--quiet); font-size: 14px; }
.studio-head .school-name { font: bold 21px/1.1 Georgia,serif; color: var(--ink); }
#studio h1, #studio h2 { margin: 0; letter-spacing: -.035em; font: 500 clamp(34px,5.1vw,62px)/1.04 "Iowan Old Style",Georgia,serif; }
#studio h1 { padding: 28px 0 6px; }
#studio .course-type { margin: 0 0 19px; color: var(--quiet); }
.step-links { display: flex; flex-wrap: wrap; gap: 5px 9px; padding: 11px 0; border-block: 1px solid var(--line); }
.step-links a, #studio button, .project-links a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--blue); font: 600 15px/1.3 Arial,sans-serif; border-radius: 4px; }
.step-links a { text-decoration: none; padding: 5px 13px; }
.step-links a[aria-current] { color: white; background: #214f65; }
#studio a:hover { text-decoration: underline; }
#studio :focus-visible, .edition-note :focus-visible { outline: 3px solid #0875a9; outline-offset: 3px; }
#experiment { display: grid; grid-template-columns: minmax(0,1.13fr) minmax(0,1fr); gap: 20px 42px; margin: 25px 0; align-items: start; }
.case-copy, .case-data { min-width: 0; }
#studio .part-number, #studio .outcome h4 { color: var(--blue); margin: 0 0 10px; font: 700 13px/1.4 Arial,sans-serif; letter-spacing: .09em; text-transform: uppercase; }
#studio h2 { font-size: clamp(30px,3.5vw,45px); }
#studio .case-copy > p:not(.part-number) { margin: 12px 0 18px; }
.case-data { padding: 18px; border: 1px solid #bbb9ab; background: #f3f1e7; border-radius: 6px; }
#studio .fixture { margin: 0; }
.fixture svg { width: 100%; display: block; max-height: 205px; }
.fixture svg text { font: 16px/1.2 Arial,sans-serif; fill: #213540; }
.fixture svg .sheet-title { font: 700 16px Arial,sans-serif; letter-spacing: .3px; }

.fixture .sheet { fill: #fffcf4; stroke: #45535a; stroke-width: 1.5; }
.fixture .sheet-back { fill: #decfb3; stroke: #45535a; }
.fixture .box { fill: #e7e8df; stroke: #89998d; }
.fixture .flag { fill: #e7a647; stroke: #754d20; }
.fixture .pen, .fixture .rule { stroke: #717e7c; stroke-width: 1.5; }
.fixture .route, .fixture .arrow { stroke: #21516c; fill: none; stroke-width: 2.5; }
.fixture figcaption { color: var(--quiet); font-size: 15px; line-height: 1.4; margin: 5px 0 13px; }
.case-setting { padding-top: 12px; border-top: 1px solid #bbb9ab; display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; }
.case-setting output { font-weight: bold; font-variant-numeric: tabular-nums; color: var(--blue); }
.case-setting input { width: 100%; grid-column: 1/-1; accent-color: #21516c; min-height: 30px; margin: 0; }
.predict-studio { border: 0; padding: 0; margin: 0; min-width: 0; }
.predict-studio legend { font-weight: bold; padding: 0; margin-bottom: 8px; }
.choice-list { display: flex; flex-direction: column; gap: 7px; align-items: stretch; }
#studio button { cursor: pointer; color: var(--blue); border: 1px solid #738b97; background: #fffefa; padding: 8px 15px; text-align: left; justify-content: start; }
#studio button:hover, #studio button:focus-visible { background: #eef2ef; }
#studio button::after { content: '→'; margin-left: auto; padding-left: 8px; }
.save-error:empty { display:none; }
.outcome { grid-column: 1/-1; border-left: 4px solid #2b6657; padding: 4px 18px; margin: 0; }
#studio .outcome h3 { margin: 0; font: 600 24px/1.25 Georgia,serif; }
.outcome p { margin: 8px 0 12px; }
#studio .outcome h4 { margin: 13px 0 4px; }
.run-metrics { display: flex; flex-wrap: wrap; gap: 14px 40px; }
.run-metrics div { display: grid; font-size: 15px; }
.run-metrics strong { font: 500 29px/1.2 Georgia,serif; font-variant-numeric: tabular-nums; }
.rule-editor summary, #trial-history summary, .edition-note summary { cursor: pointer; padding: 10px 0; color: var(--blue); }
.edition-note code { white-space: pre-wrap; overflow-wrap: anywhere; }
.rule-editor input { width: 5em; font: inherit; }
.project-links { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0 25px; margin-top: 18px; }
.project-links a, .edition-note a { color: var(--blue); }
.edition-note { max-width: 1048px; margin: auto; padding: 0 36px 36px; }
#trial-history li { margin-bottom: 10px; }
#trial-history li p { margin: 0; }
@media(max-width:700px) {
  #studio { padding: 12px 16px; }
  .edition-note { padding-inline: 16px; }
  #studio h1 { padding-top: 16px; font-size: 34px; }
  #studio .course-type { margin-bottom: 10px; font-size: 15px; }
  .studio-head { padding-bottom: 9px; }
  .step-links { gap: 2px 4px; padding: 6px 0; }
  .step-links a { padding: 4px 6px; font-size: 14px; }
  #experiment { grid-template-columns: minmax(0,1fr); gap: 12px; margin: 16px 0; }
  .case-copy { display: contents; }
  #studio .part-number { margin: 0; }
  #studio .case-copy > p:not(.part-number) { margin: 0; }
  .case-data { grid-row: 4; padding: 10px 13px; }
  .fixture svg { max-height: 116px; }
  .fixture svg text, .fixture svg .sheet-title { font-size: 19px; }
  .fixture figcaption { font-size: 14px; margin: 2px 0 7px; }
  .case-setting { padding-top: 6px; gap: 0 8px; }
  .choice-list { gap: 5px; }
  .outcome { padding-inline: 12px; }
}

@media(min-width:701px) {
  .case-data { grid-column: 2; grid-row: 1/3; }
  .predict-studio { grid-column: 1; }
  #studio .case-copy > p:not(.part-number) { margin-bottom: 0; }
}

@media (max-width: 520px) {
  #studio { padding-top: 8px; }
  .studio-head { padding-bottom: 4px; }
  .studio-head .school-name { font-size: 18px; }
  #studio h1 { padding: 9px 0 4px; font-size: 30px; }
  #studio .course-type { line-height: 1.35; margin-bottom: 7px; }
  .step-links { gap: 2px 4px; padding-block: 3px; }
  .step-links a { min-height: 34px; padding: 3px 5px; }
  #experiment { margin-block: 12px; gap: 8px; }
  #studio .case-copy > p:not(.part-number) { line-height: 1.4; }
  .choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-list button:last-child:nth-child(odd) { grid-column: 1/-1; }
  #studio .choice-list button { padding: 7px 10px; }
  #studio .choice-list button::after { content: none; }
}
