/* Native CSS material for the static lab. Scientific images retain their colors. */
:root {
  color-scheme: light;
  --paper: #f7f8f2;
  --ink: #193b34;
  --muted: #52665d;
  --green: #1c6b4f;
  --line: #d9e0d7;
  --glass: rgba(255,255,255,.76);
  --nav-glass: rgba(255,255,255,.72);
  --solid: #fff;
  --field: #fff;
  --shadow: 0 5px 22px rgba(25,49,36,.06);
  --focus: #23765c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111915; --ink: #edf3ed; --muted: #b3c3b9;
    --green: #a8d5bb; --line: #35483c;
    --glass: rgba(13,16,22,.12); --nav-glass: rgba(13,16,22,.12);
    --solid: #1a2620; --field: #1c2c23;
    --shadow: 0 6px 24px rgba(0,0,0,.16); --focus: #b4dec5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111915; --ink: #edf3ed; --muted: #b3c3b9;
  --green: #a8d5bb; --line: #35483c;
  --glass: rgba(13,16,22,.12); --nav-glass: rgba(13,16,22,.12);
  --solid: #1a2620; --field: #1c2c23;
  --shadow: 0 6px 24px rgba(0,0,0,.16); --focus: #b4dec5;
}
.research-shell, .research-reader { background: var(--paper); color: var(--ink); }
.research-header, .research-footer, .reader-actions { font: 14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.research-header {
  position: relative; isolation: isolate; display: flex; align-items: center;
  flex-wrap: wrap; gap: 8px 20px; max-width: 1248px; min-height: 76px;
  margin: 20px auto 0; padding: 14px 24px; border: 0; border-radius: 30px;
  color: var(--ink); background: none;
}
.research-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit; background: var(--nav-glass); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.research-brand { display: inline-flex; align-items: baseline; gap: 10px; min-height: 44px; padding: 7px 0; font-size: 23px; font-weight: 800; letter-spacing: -.8px; text-decoration: none; white-space: nowrap; color: var(--ink); }
.research-brand span { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.research-nav { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.research-nav a, .reader-actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); }
.research-nav a[aria-current] { background: var(--field); font-weight: 600; }
.theme-toggle { min-width: 58px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: 13px/1.4 system-ui; cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.skip-link { position: absolute; left: 20px; top: -100px; z-index: 10; background: var(--solid); color: var(--ink); padding: 12px 18px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
.research-header :focus-visible, .research-footer :focus-visible, .reader-actions :focus-visible, .local-nav :focus-visible,
.research-shell :is(button,input,select,summary,a,.figure-scroll):focus-visible,
.research-reader a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.research-footer { display: block; max-width: 1248px; margin: 28px auto 0; padding: 25px 0 35px; border-top: 1px solid var(--line); color: var(--muted); }
.research-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; }
.research-footer nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.research-credits { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 15px; font-size: 12px; }
.research-credits a { color: var(--muted); }
.local-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 22px 0 0; font-size: 13px; }
.local-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }
.research-shell .panel, .research-shell .methods {
  position: relative; isolation: isolate; background: transparent; border-color: transparent;
}
.research-shell .panel::before, .research-shell .methods::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: var(--glass); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
/* Keep live plot surfaces out of ancestor backdrop compositing. */
.research-shell .observations .panel::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
.research-shell :is(.lead,.scope,.hint,.studyNote,.legend,.sectiontop>span:last-child) { color: var(--muted); }
.research-shell :is(input,select) { color: var(--ink); background: var(--field); border-color: var(--line); min-height: 44px; border-radius: 10px; }
.research-shell button { min-height: 44px; border-radius: 999px; }
.research-shell button:not(.secondary):not(.textbutton):not(.theme-toggle) { color: #fff; background: #1c6b4f; border-color: #1c6b4f; }
.research-shell button.secondary { background: var(--field); color: var(--ink); border-color: var(--line); }
.research-shell button.textbutton { color: var(--muted); }
.research-shell summary { min-height: 44px; align-content: center; }
.research-shell th { background: var(--field); color: var(--ink); }
.research-shell :is(th,td) { border-color: var(--line); }
.research-shell #error { color: #ba4533; }
:root[data-theme="dark"] .research-shell #error { color: #ffb5a7; }
.plot-surface { background: #fff; color-scheme: light; forced-color-adjust: none; border-radius: 10px; overflow: hidden; }
.plot-surface #curve { background: #fff; }
.research-shell .plot-surface .legend { color: #52665d; padding: 3px 12px 10px; margin-bottom: 0; }
.research-shell .plot-surface .green { background: #1c6b4f; }
.research-shell .plot-surface .orange { background: #c27c45; }
.research-shell .evidence-figure { background: var(--glass); border-color: transparent; box-shadow: var(--shadow); }
.research-shell .figure-scroll { background: #fff; color-scheme: light; }
.research-shell .evidence-figure figcaption { color: var(--muted); }
.research-shell :is(.reuse,.task-gallery>summary) { border-color: var(--line); }
.research-reader { color-scheme: light; }
.research-reader .research-header { margin: 0 0 28px; padding: 12px 18px; gap: 4px 12px; }
.research-reader .research-brand span { display: none; }
.research-reader .research-nav { gap: 0; }
.research-reader .research-nav a { padding-inline: 10px; }
.research-reader .reader-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.research-reader .reader-actions a { background: var(--glass); box-shadow: var(--shadow); }
.research-reader main a { color: var(--green); }
.research-reader :is(figcaption,caption) { color: var(--muted); }
.research-reader :is(td,th) { border-color: var(--line); }
.research-reader .equation { background: var(--field); }
.research-reader figure img { background: #fff; border-radius: 8px; }
.research-reader .research-footer { margin-top: 44px; }
@media (hover: hover) {
  .research-nav a:hover, .theme-toggle:hover { background: var(--field); }
  .research-footer a:hover, .local-nav a:hover { text-decoration: underline; }
}
@media (max-width: 1320px) { .research-shell .research-header, .research-shell .research-footer { margin-left: 36px; margin-right: 36px; } }
@media (max-width: 900px) {
  .research-header { gap: 4px 12px; }
  .research-brand span { display: none; }
}
@media (max-width: 767px), (pointer: coarse) {
  .research-shell .panel::before, .research-shell .methods::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 600px) {
  .research-shell .research-header { margin: 12px 20px 0; }
  .research-header, .research-reader .research-header { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 14px; border-radius: 24px; }
  .research-brand { grid-column: 1; grid-row: 1; }
  .research-brand span, .research-reader .research-brand span { display: inline; font-size: 12px; }
  .theme-toggle { grid-column: 2; grid-row: 1; }
  .research-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; gap: 0; justify-content: space-between; font-size: 12px; }
  .research-nav a, .research-reader .research-nav a { padding: 9px 7px; }
  .research-shell .research-footer { margin-left: 20px; margin-right: 20px; }
  .research-footer nav { gap: 2px 20px; }
  .research-credits { gap: 7px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .research-header::before, .research-shell .panel::before, .research-shell .methods::before { background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .research-shell .evidence-figure, .research-reader .reader-actions a { background: var(--solid); }
}
@media (forced-colors: active) {
  .research-header, .research-shell .panel, .research-shell .methods, .research-shell .evidence-figure { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  .research-header::before, .research-shell .panel::before, .research-shell .methods::before { display: none; }
  .research-header :focus-visible, .research-footer :focus-visible, .research-shell :focus-visible, .research-reader :focus-visible { outline: 2px solid Highlight; }
}
@media print {
  .research-header, .research-footer, .skip-link, .reader-actions, .local-nav { display: none; }
  .research-reader { --green: #176149; --muted: #516458; --line: #dce3d9; --field: #f1f5ee; background: #fff; color: #000; }
}
