:root {
  color-scheme: light;
  --paper: #f2eee3;
  --paper-2: #fbf8f0;
  --ink: #18333a;
  --muted: #65777a;
  --line: #d8d0bf;
  --accent: #c36b42;
  --accent-2: #087e83;
  --water: #4d9eb0;
  --gold: #c49b50;
  --shadow: 0 16px 42px rgba(33, 48, 44, .09);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #087e83; outline-offset: 3px; }
.app-shell { max-width: 1600px; margin: 0 auto; padding: 0 28px 30px; }
.masthead { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.brand-mark { width: 34px; height: 34px; border: 1px solid var(--accent); border-radius: 50%; display: grid; place-items: center; color: var(--accent); font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.mast-meta { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.pair-link { color: var(--accent-2); text-decoration: none; font-weight: 750; }
.pair-link:hover { text-decoration: underline; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 26px 0 24px; }
.kicker { margin: 0 0 9px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 4vw, 48px); font-weight: 400; letter-spacing: -.035em; line-height: 1.05; }
.hero-copy { max-width: 360px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.controls { background: var(--paper-2); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); padding: 19px 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.panel-head h2 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.small-label { color: var(--muted); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.control-group { padding: 12px 0 13px; border-top: 1px solid #e6dfd1; }
.control-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 12px; font-weight: 650; }
.control-value { color: var(--accent-2); font-family: Georgia, serif; font-size: 16px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type=range] { display: block; width: 100%; height: 18px; margin: 0; accent-color: var(--accent); cursor: ew-resize; }
.range-ends { display: flex; justify-content: space-between; color: #8b9691; font-size: 9px; }
.button-row { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; }
.btn { min-height: 38px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 3px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 750; letter-spacing: .04em; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: white; }
.btn.secondary { border-color: var(--line); }
.btn:hover { filter: brightness(.96); }
.main-panel { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric { min-height: 86px; padding: 13px 15px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; }
.metric-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.metric-value { margin-top: 7px; font-family: Georgia, serif; font-size: clamp(20px, 2vw, 27px); line-height: 1; font-variant-numeric: tabular-nums; }
.metric-unit { margin-left: 4px; color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: 10px; }
.exhibit { overflow: hidden; border: 1px solid #cfc7b7; border-radius: 4px; background: #e7e3d8; box-shadow: var(--shadow); }
.exhibit-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: #e1dccf; border-bottom: 1px solid #d0c8b8; }
.exhibit-top h2 { margin: 0; font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.exhibit-top span { color: #647477; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
#labCanvas { display: block; width: 100%; height: auto; aspect-ratio: 1.55 / 1; background: #e7e3d8; }
.exhibit-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 15px; border-top: 1px solid #d0c8b8; color: #65777a; font-size: 10px; }
.check-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: #e3eee9; border: 1px solid #c8d9d0; border-radius: 4px; }
.check-row strong { display: block; margin-bottom: 3px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.check-row p { margin: 0; color: #536c68; font-size: 11px; line-height: 1.5; }
.check-status { color: #087e83; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
details.science { margin-top: 2px; padding: 15px 17px; border: 1px solid var(--line); background: var(--paper-2); border-radius: 4px; }
details.science summary { cursor: pointer; font-family: Georgia, serif; font-size: 17px; }
.science-body { max-width: 1000px; padding-top: 12px; color: #4f6262; font-size: 12px; line-height: 1.65; }
.equations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.equation { padding: 10px; background: #f0ece1; border: 1px solid #e1d9c8; font-family: Georgia, serif; font-size: 14px; }
.equation small { display: block; margin-top: 5px; color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: 9px; }
.footer-note { margin: 18px 0 0; color: #7a8781; font-size: 10px; line-height: 1.5; }
.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
.embed-mode .app-shell { height: 100%; max-width: none; padding: 10px; display: flex; flex-direction: column; }
.embed-mode .masthead, .embed-mode .hero, .embed-mode .footer-note { display: none; }
.embed-mode .workspace { min-height: 0; flex: 1; grid-template-columns: 270px minmax(0, 1fr); }
.embed-mode .controls { overflow-y: auto; }
.embed-mode .main-panel { min-height: 0; }
.embed-mode .exhibit { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.embed-mode #labCanvas { flex: 1; min-height: 0; aspect-ratio: auto; }
@media (max-width: 900px) {
  .app-shell { padding: 0 18px 24px; }
  .workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-copy { max-width: 280px; }
}
@media (max-width: 650px) {
  .app-shell { padding: 0 12px 20px; }
  .masthead { height: 60px; }
  .mast-meta { display: none; }
  .hero { display: block; padding: 21px 0 17px; }
  .hero-copy { margin-top: 10px; max-width: 100%; }
  .workspace { grid-template-columns: 1fr; }
  .controls { order: 2; }
  .main-panel { order: 1; }
  #labCanvas { aspect-ratio: 1 / 1.65; }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equations { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 1fr; }
  .embed-mode .workspace { display: flex; flex-direction: column; gap: 8px; }
  .embed-mode .main-panel { flex: 0 0 54%; min-height: 0; }
  .embed-mode .check-row, .embed-mode details.science, .embed-mode .exhibit-foot { display: none; }
  .embed-mode .controls { flex: 1; min-height: 0; overflow-y: auto; }
  .embed-mode .exhibit-top { padding: 8px 11px; }
  .embed-mode #labCanvas { flex: 1; aspect-ratio: auto; min-height: 0; }
  .embed-mode .exhibit-foot { display: none; }
  .embed-mode .readouts { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
