/* Keep deep links and keyboard destinations below the floating navigation. */
:root {
  --nav-inset: max(.65rem, env(safe-area-inset-top));
  --nav-height: 3.85rem;
  scroll-padding-top: calc(var(--nav-inset) + var(--nav-height) + .7rem);
}
body > header {
  position: sticky;
  top: var(--nav-inset);
  z-index: 15;
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 6px 25px #152e4915, 0 1px 3px #142d4910;
}
body > header nav a[aria-current] { color: var(--action); text-decoration-color: var(--index-blue); text-decoration-thickness: 2px; }
body > header nav a:hover { color: var(--action-hover); }
body > .skip { z-index: 30; }
body[data-page="/"] .exhibit-hero { margin-block-end: clamp(3rem, 6vw, 6rem); }

.exhibit-intro .trial-terms {
  margin: .6rem 0 0;
  color: var(--dim);
  font-size: .88rem;
}
.hero-actions > a:last-child, .exhibit-strip a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 44px;
}
.exhibit-strip { padding-block: 2px; }
.exhibit { container: boiler-model / inline-size; }
@container boiler-model (max-width: 36rem) {
  /* Keep the inspection and its feedback below the pins on narrow drawings. */
  #inspector {
    position: static;
    width: auto;
    padding: .65rem 1rem;
    margin-block: .5rem;
    background: var(--paper);
    box-shadow: none;
  }
  #inspector .inspect-content { font-size: .9rem; }
  #inspector .lens-quiz { margin-bottom: 0; }
  #inspector .lens-quiz p { font-size: .88rem; }
  #inspector .lens-quiz button { min-height: 44px; padding-inline: .7rem; font-size: .85rem; }
  #inspector .close-lens { width: 44px; height: 44px; }
  #inspector a { display: inline-flex; align-items: center; min-height: 44px; font-size: .88rem; }
}
@media (pointer: coarse) {
  .model-pins .pin { min-height: 44px; }
}

#try-room {
  --desk-dark: #173d60;
  isolation: isolate;
  position: relative;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: clamp(2rem, 4.5vw, 4rem) 0;
}
#try-room::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: var(--desk-dark);
  box-shadow: 0 0 0 100vmax var(--desk-dark);
  clip-path: inset(0 -100vmax);
}
#try-room .bench-head { align-items: end; margin-bottom: clamp(1rem, 2.3vw, 2rem); }
#try-room .bench-head .eyebrow { color: var(--sky); }
#try-room .bench-head h2 { color: #fff; margin: .5rem 0 0; font-weight: 510; line-height: 1; }
#try-room .bench-switch { background: #11324e; border-color: #79a5c7; }
#try-room .bench-switch button { color: var(--paper); min-height: 40px; }
#try-room .bench-switch button:hover { background: #315d80; }
#try-room .bench-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: inset 0 -3px var(--index-blue); }
#try-room .bench-grid {
  gap: 0; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr);
  align-items: stretch; border: 1px solid #80a7c5; border-radius: .85rem;
  box-shadow: 0 16px 40px #05172446;
}
#try-room .bench-device, .lesson-layout .instrument-card, .classroom-grid .instrument-card {
  color: var(--paper); background-color: #305e83;
  background-image: linear-gradient(to bottom, #102f4c52, transparent 24%),
    radial-gradient(ellipse at 48% 38%, #659cc0 0%, transparent 63%),
    linear-gradient(145deg, #315b7b, #467c9f 42%, #284e72 79%, #183955);
  box-shadow: inset 0 1px 0 #c0e4ff90, inset 0 -4px 0 #102c485c;
}
#try-room .bench-device {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  border: 0; border-radius: .8rem 0 0 .8rem; padding: 1rem clamp(1rem,2vw,2rem) 1.25rem;
}
#try-room .bench-plate,.instrument-card .panel-head { width: 100%; color: var(--paper); padding-bottom: .55rem; border-bottom: 1px solid #a8cbe3; }
#try-room .bench-plate { font-size: .69rem; }
#try-room .bench-device canvas { width: min(100%, 242px); margin: .55rem auto; filter:drop-shadow(2px 8px 6px #08172566); }
.dial-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
#try-room .dial-tools button,.instrument-card .scale-control {
  min-height: 40px; padding: .5rem .76rem; border: 1px solid #829bac;
  color: var(--paper); background: #193e60; border-radius: .35rem; font-size: .82rem;
}
#try-room .dial-tools button:hover,.instrument-card .scale-control:hover { background: #12314f; }
#try-room .dial-tools [aria-pressed="true"],.instrument-card .scale-control[aria-pressed="true"] { color: var(--ink); background:var(--paper); border-color:var(--paper); }
#scale-hint,.instrument-card .scale-hint { color: #f6f8fa; margin: .6rem auto 0; max-width: 38ch; font-size: .87rem; }
#try-room .bench-response {
  background: var(--paper); border-radius: 0 .8rem .8rem 0;
  padding: clamp(1.4rem, 3.2vw, 3rem); display: flex; flex-direction: column; justify-content: center;
}
#try-room .bench-response h3 { font-size: clamp(1.8rem, 2.8vw, 2.65rem); color: var(--ink); }
#try-room .bench-response h3:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
#try-room .bench-response > p { margin: .35rem 0; }
#try-room #quick-options { flex-wrap: wrap; gap: .5rem; }
#try-room #quick-options button { min-width: 4.5rem; min-height: 44px; background: white; color: var(--ink); border-color: #9eb0c4; font-variant-numeric: tabular-nums; }
#try-room #quick-options button:hover { background: var(--surface); border-color: var(--action); }
#try-room #quick-options button[aria-pressed="true"] { background:var(--action); color:white; }
#practice-forward { margin: .45rem 0 1rem; }
#practice-forward button,#practice-forward a { display:inline-flex; align-items:center; min-height:44px; padding:.63rem .94rem; border-radius:.4rem; color:white; background:var(--action); font-size:.89rem; font-weight:650; text-decoration:none; }
#practice-forward button:hover,#practice-forward a:hover { background:var(--action-hover); }
#try-room :focus-visible { outline-color:white; }
.guide-banner :focus-visible { outline-color:var(--focus); }
#try-room .bench-response :focus-visible { outline-color:var(--focus); }
#try-room .bench-response details { padding-top:.6rem; }
#try-room .bench-next { align-self:start; }
body[data-page="/"] .stations { margin:0; padding:clamp(3rem,6vw,6rem) 0; }
body[data-page="/"] .guide-banner {
  display:grid; grid-template-columns:.86fr 1.14fr; gap:0; align-items:stretch; margin: 0 0 clamp(3rem,6vw,5rem);
  background:var(--sky); color:var(--ink); border:1px solid var(--enamel); border-radius:.65rem;
}
body[data-page="/"] .guide-banner > div:last-child { position:relative; align-content:center; padding:clamp(1.4rem,4vw,3.6rem); padding-bottom:clamp(2.4rem,5vw,4.6rem); }
.guide-banner > div:last-child::after {
  content:""; position:absolute; inset:auto clamp(1.4rem,4vw,3.6rem) 0; height:13px;
  background:repeating-linear-gradient(90deg, var(--index-blue) 0 1px, transparent 1px 40px) left bottom / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, var(--index-blue) 0 1px, transparent 1px 8px) left bottom / 100% 5px no-repeat;
  pointer-events:none;
}
.guide-banner h2 { max-width:15ch; text-wrap:balance; }
.guide-banner .archive { border-radius:.6rem 0 0 .6rem; min-height:100%; }
.guide-banner .archive img { height:100%; min-height:250px; position:absolute; inset:0; filter:grayscale(1); }
.guide-banner .archive small { background:var(--ink); color:var(--paper); max-width:90%; text-wrap:balance; }
.guide-banner .eyebrow { color:var(--index-blue); }
.guide-banner p { color:var(--ink); max-width:45ch; }
body[data-page="/"] .plan-section { padding-top:clamp(1.7rem,3vw,3rem); border-top:2px solid var(--line); }
body[data-page="/practice/"] .page-intro { padding:clamp(2rem,4.5vw,4.2rem) 0 1.7rem; }
body[data-page="/practice/"] .page-intro h1 { font-size:clamp(3rem,6vw,5.4rem); }
.lesson-layout .instrument-card,.classroom-grid .instrument-card { border:1px solid #415c72; box-shadow:0 8px 22px #162f4417; }
.instrument-card details,.instrument-card details p { color:#e0ecf5; }
.instrument-card details { border-color:#88949e; }
.instrument-card .scale-control { margin:0 auto .75rem; display:flex; }
.instrument-card :focus-visible { outline:3px solid var(--paper); outline-offset:3px; box-shadow:0 0 0 3px var(--action-hover); }
.instrument-card .scale-hint { margin:0 auto .8rem; text-align:center; }
.instrument-card .observation { background:var(--paper); color:var(--ink); }
.lesson-layout .exercise-card,.classroom-grid .exercise-card { background:#fff; border-color:#bdcbdc; border-top:3px solid var(--action); }
@media (max-width:680px) {
  :root { --nav-inset:max(.4rem,env(safe-area-inset-top)); --nav-height:5.7rem; }
  body > header { width:calc(100% - 20px); }
  #try-room .bench-head { align-items:start; }
  #try-room .bench-grid { grid-template-columns:1fr; }
  #try-room .bench-device { border-radius:.8rem .8rem 0 0; padding:.8rem 1rem .9rem; }
  #try-room .bench-response { border-radius:0 0 .8rem .8rem; padding:1.2rem; }
  #try-room .bench-device canvas { width:clamp(156px,46vw,224px); }
  body[data-page="/"] .guide-banner { grid-template-columns:1fr; }
  .guide-banner .archive { min-height:175px; border-radius:.6rem .6rem 0 0; }
  .guide-banner .archive img { min-height:0; }
}
@media (max-width:400px) {
  .guide-banner .button { font-size:.9rem; gap:.35rem; padding-inline:.55rem; }
  .exhibit-strip { display:grid; grid-template-columns:1fr auto; gap:0 .75rem; padding-inline:.65rem; }
  .exhibit-strip a { grid-column:2; grid-row:1 / span 2; }
  .exhibit-strip .figure { align-self:end; }
  #exhibit-label { align-self:start; }
}
@media print {
  :root {scroll-padding-top:0}
  body > header {position:static;box-shadow:none}
  #try-room::before{display:none}
  #try-room .bench-head h2,#try-room .bench-head .eyebrow{color:black}
  body[data-page="/"] .guide-banner { background:var(--paper); border-color:var(--line); break-inside:avoid; }
  .guide-banner > div:last-child::after { display:none; }
  #try-room .bench-device,.lesson-layout .instrument-card,.classroom-grid .instrument-card { background:var(--paper); color:var(--ink); box-shadow:none; }
  #try-room .bench-plate,.instrument-card .panel-head,.instrument-card details,.instrument-card details p,#scale-hint,.instrument-card .scale-hint { color:var(--ink); }
}
.access-heading.pricing-heading { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:clamp(1.5rem,5vw,4rem); padding:clamp(1.5rem,3.5vw,3rem) 0; }
.access-heading .eyebrow { color:var(--dim); }
.access-heading.pricing-heading h1 { font-size:clamp(3rem,5.1vw,4.7rem); line-height:1; margin:.6rem 0 .8rem; text-wrap:balance; }
.access-heading h1 em { color:var(--ink); font-style:normal; }
@media (max-width:680px) {
  .access-heading.pricing-heading { padding:1.1rem 0 .7rem; }
}

.reader-case { max-width:45rem; padding:clamp(1.25rem,3vw,2.4rem); background:var(--paper); color:var(--ink); border:1px solid var(--line); border-radius:.75rem; }
.reader-case p { margin:.7rem 0; }
.reader-case details { margin-top:.6rem; border-top:1px solid var(--line); padding:.4rem 0; }
.reader-case summary { min-height:44px; align-content:center; color:var(--ink); }
.lesson-layout:has(.reader-case),#try-room:has(.reader-case) .bench-grid { display:block; }
#try-room:has(.reader-case) :is(.bench-device,.bench-switch),main:has(#try-room .reader-case) .model-pins { display:none; }

#restore fieldset { min-width:0; padding:0; margin:0; border:0; }

@media(max-width:680px) {
  body>header { grid-template-columns:minmax(0,1fr) auto; }
  body>header .brand { width:auto; min-width:0; }
  body>header .brand img { flex:none; }
  body>header nav { min-width:0; flex-wrap:wrap; }
}

body>header { container:boiler-nav / inline-size; }
@media(min-width:681px) {
  @container boiler-nav (max-width:35rem) {
    .brand { grid-column:1 / span 2; grid-row:1; }
    .my { grid-column:3; grid-row:1; }
    nav { grid-row:2; grid-column:1 / -1; justify-content:space-around; flex-wrap:wrap; }
  }
}
@media(max-width:940px) {
  .exhibit-intro,.case-copy,.bench-head>div,.guide-banner>div,.section-heading>div { min-width:0; overflow-wrap:anywhere; }
  #try-room .bench-head,.bench-switch,.section-heading,.hero-actions { flex-wrap:wrap; }
  #try-room .bench-switch { max-width:100%; }
  .cards .case-card { min-width:0; }
}
@media(max-width:680px) {
  .exhibit-hero,.guide-banner,.stations .cards { grid-template-columns:minmax(0,1fr); }
  #try-room .bench-head { display:flex; flex-flow:column; align-items:start; }
  #try-room .bench-grid { grid-template-columns:minmax(0,1fr); }
  .guide-banner .archive { min-width:0; }
  .case-card .case-copy,.hero-actions .button { max-width:100%; }
  body>header .brand { overflow-wrap:anywhere; }
}
