:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --strong-line: rgba(0, 0, 0, 0.22);
  --amber: #0071e3;
  --teal: #0066cc;
  --green: #1d7f42;
  --red: #d70015;
  --blue: #0071e3;
  --wine: #af1e2d;
  --ink: #ffffff;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --motion-fast: 150ms;
  --motion-medium: 260ms;
  --motion-slow: 520ms;
  --motion-reveal-duration: 520ms;
  --motion-reveal-stagger: 24ms;
  --motion-reveal-enter-y: 12px;
  --motion-reveal-enter-rotate: 2.2deg;
  --motion-reveal-compact-duration: 210ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: "Aptos", "Avenir Next", "Avenir", "Segoe UI", "PingFang SC", "Noto Sans", sans-serif;
  --font-body: "Aptos", "IBM Plex Sans", "Noto Sans", "Segoe UI", sans-serif;
  --font-mono-var: "IBM Plex Mono", "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
  --font-sans: var(--font-body);
}

body.light-mode {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --strong-line: rgba(0, 0, 0, 0.22);
  --ink: #ffffff;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.08);
}

body.dark-mode {
  color-scheme: dark;
  --bg: #101114;
  --bg-2: #15171b;
  --surface: #191b20;
  --surface-2: #1f2228;
  --surface-3: #252932;
  --text: #f5f5f7;
  --muted: #a8adb7;
  --line: rgba(255, 255, 255, 0.13);
  --strong-line: rgba(255, 255, 255, 0.28);
  --ink: #ffffff;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
}

body.page-shell:not([data-boot-label="Search"]) {
  --bg: #e8edf5;
  --bg-2: #eff4fa;
  --surface: #f1f5fb;
  --surface-2: #e8eef8;
  --surface-3: #dee6f2;
  --text: #171d2b;
  --muted: #49566a;
  --line: rgba(15, 23, 42, 0.14);
  --strong-line: rgba(15, 23, 42, 0.32);
  --shadow: 0 16px 44px rgba(14, 25, 42, 0.11);
}

html.dark-mode body.page-shell:not([data-boot-label="Search"]) {
  --bg: #090f1c;
  --bg-2: #101b2e;
  --surface: #172338;
  --surface-2: #1e2a44;
  --surface-3: #27364f;
  --text: #ebf0f8;
  --muted: #a0adbf;
  --line: rgba(255, 255, 255, 0.16);
  --strong-line: rgba(255, 255, 255, 0.3);
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  position: relative;
  z-index: 2;
  background: var(--bg);
}

body.light-mode {
  background: var(--bg);
}

body.dark-mode {
  background: var(--bg);
}

html.startup-welcome-pending body {
  overflow: hidden;
}

html.startup-welcome-pending .site-header,
html.startup-welcome-pending main,
html.startup-welcome-pending .site-footer {
  opacity: 0;
}

html.motion-boot:not(.motion-boot-timeout) body:not(.page-ready) {
  overflow: hidden;
}

html.motion-boot:not(.motion-boot-timeout) body:not(.page-ready) .site-header,
html.motion-boot:not(.motion-boot-timeout) body:not(.page-ready) main,
html.motion-boot:not(.motion-boot-timeout) body:not(.page-ready) .site-footer {
  opacity: 0;
  transform: translateY(8px);
}

html.motion-soft-enter body:not(.page-ready) .site-header,
html.motion-soft-enter body:not(.page-ready) main,
html.motion-soft-enter body:not(.page-ready) .site-footer {
  opacity: 0.985;
  transform: translateY(2px);
}

html.motion-boot:not(.motion-boot-timeout) body:not(.page-ready)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1100;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 113, 227, 0.12), transparent 34%),
    rgba(245, 245, 247, 0.94);
  backdrop-filter: blur(22px) saturate(150%);
}

html.motion-boot:not(.motion-boot-timeout) body:not(.page-ready)::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1101;
  display: block;
  width: 104px;
  height: 70px;
  background:
    url("/assets/chemvault-logo-mark.png") center top / 48px 48px no-repeat,
    linear-gradient(90deg, #003c70, #0071e3, var(--amber)) left bottom / 12% 3px no-repeat;
  filter: drop-shadow(0 12px 28px rgba(0, 43, 84, 0.16));
  transform: translate(-50%, -50%) scale(0.98);
  animation:
    chemvault-boot-card 620ms var(--ease-out) both,
    chemvault-boot-rail 920ms var(--ease-out) forwards;
}

html.motion-available body.page-ready .site-header,
html.motion-available body.page-ready main,
html.motion-available body.page-ready .site-footer {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--motion-medium) var(--ease-out), transform var(--motion-medium) var(--ease-out);
}

html.motion-available body.page-ready .site-footer {
  transform: none;
}

body.page-is-soft-leaving {
  pointer-events: none;
}

body.page-is-soft-leaving .site-header,
body.page-is-soft-leaving main,
body.page-is-soft-leaving .site-footer {
  opacity: 0.985;
  transform: translateY(-2px);
  transition: opacity 90ms ease, transform 90ms ease;
}

body.page-is-soft-leaving .site-footer {
  transform: none;
}

body.page-is-soft-leaving::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: var(--bg);
  opacity: 0.08;
  transition: opacity 90ms ease;
}

html.theme-switching body,
html.theme-switching :where(
  .site-header,
  .search-shell,
  .theme-toggle,
  .site-nav a,
  .nav-more > summary,
  .nav-more-menu,
  .home-search-card,
  .portal-card,
  .page-panel,
  .record-panel,
  input,
  select,
  textarea
) {
  transition:
    background-color 260ms var(--ease-out),
    color 260ms var(--ease-out),
    border-color 260ms var(--ease-out),
    box-shadow 260ms var(--ease-out);
}

html.theme-switching::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1080;
  pointer-events: none;
  background:
    radial-gradient(circle 180px at var(--theme-x, 50%) var(--theme-y, 50%), rgba(0, 113, 227, 0.18), transparent 72%),
    rgba(16, 17, 20, 0.22);
  opacity: 0;
  transform: translateZ(0);
  will-change: opacity;
  animation: chemvault-theme-reveal 360ms var(--ease-out) both;
}

html.theme-switching[data-theme-target="light"]::before {
  background:
    radial-gradient(circle 180px at var(--theme-x, 50%) var(--theme-y, 50%), rgba(0, 113, 227, 0.14), transparent 72%),
    rgba(245, 245, 247, 0.32);
}

html.theme-switching[data-theme-target="dark"]::before {
  background:
    radial-gradient(circle 180px at var(--theme-x, 50%) var(--theme-y, 50%), rgba(0, 113, 227, 0.2), transparent 72%),
    rgba(16, 17, 20, 0.34);
}

@keyframes chemvault-theme-reveal {
  0% {
    opacity: 0;
  }

  42% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.theme-switching::before {
    animation: none;
    opacity: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 100;
  background: var(--amber);
  color: #ffffff;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-weight: 800;
}

.skip-link:focus {
  left: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(180%) blur(20px);
  background: rgba(251, 251, 253, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background var(--motion-medium) ease, border-color var(--motion-medium) ease, box-shadow var(--motion-medium) ease;
}

body.page-is-leaving .site-header {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.09);
}

.nav-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  transition: transform var(--motion-fast) var(--ease-spring);
}

.brand:hover,
.brand:focus-visible {
  transform: translateY(-1px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 8px 20px rgba(0, 43, 84, 0.08);
  transition: transform var(--motion-medium) var(--ease-spring), box-shadow var(--motion-medium) ease, border-color var(--motion-medium) ease;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
  transform: rotate(-4deg) scale(1.04);
  border-color: rgba(0, 113, 227, 0.24);
  box-shadow: 0 10px 24px rgba(0, 43, 84, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.15;
}

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  justify-self: center;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 12px 34px rgba(0, 43, 84, 0.1);
  overflow: visible;
}

.site-nav a,
.nav-more > summary {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  color: #4c515b;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
  transition:
    color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    transform var(--motion-fast) ease;
}

.nav-more {
  position: relative;
}

.nav-more > summary {
  list-style: none;
}

.nav-more > summary::-webkit-details-marker {
  display: none;
}

.nav-more > summary::before {
  content: "+";
  display: inline-block;
  margin-right: 6px;
  color: var(--amber);
  font-weight: 850;
}

.nav-more[open] > summary::before {
  content: "-";
}

.nav-more-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  display: grid;
  min-width: 220px;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(0, 43, 84, 0.16);
  backdrop-filter: blur(18px) saturate(160%);
}

.nav-more-menu a {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
}

.site-nav a::after,
.nav-more > summary::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 30px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: #0071e3;
  box-shadow:
    0 0 18px 5px rgba(0, 113, 227, 0.22),
    0 8px 18px rgba(0, 113, 227, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scaleX(0.45);
  transition: opacity var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.nav-more-menu a::after {
  display: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.nav-more > summary:hover,
.nav-more > summary:focus-visible {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.74);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(0, 43, 84, 0.08);
  transform: translateY(-1px);
}

.site-nav a[aria-current],
.nav-more > summary[aria-current] {
  color: #0057b8;
  background: rgba(0, 113, 227, 0.11);
  border-color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(0, 113, 227, 0.18),
    0 8px 22px rgba(0, 113, 227, 0.1);
}

.site-nav a[aria-current]::after,
.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.nav-more > summary[aria-current]::after,
.nav-more > summary:hover::after,
.nav-more > summary:focus-visible::after {
  opacity: 0.72;
  transform: translateX(-50%) scaleX(0.88);
}

.site-nav a[aria-current]::after,
.nav-more > summary[aria-current]::after {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-actions .small-button {
  align-self: stretch;
  box-sizing: border-box;
  height: 56px;
  min-height: 56px;
  padding: 0 18px;
  line-height: 1;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  isolation: isolate;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-sizing: border-box;
  flex: 0 0 112px;
  width: 112px;
  max-width: 112px;
  min-height: 44px;
  min-width: 0;
  overflow: visible;
  padding: 0 13px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1;
  cursor: text;
  transition:
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

.search-shell span {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 1.2em;
  font-weight: 850;
  line-height: 1;
}

.search-shell:is(:focus-within, .is-expanded, .has-value) {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(0, 113, 227, 0.1);
}

.search-shell:focus-within {
  border-color: color-mix(in srgb, var(--amber) 54%, var(--line));
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 113, 227, 0.11);
}

@media (min-width: 1321px) {
  .site-header.nav-stacked .nav-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
  }

  .site-header.nav-stacked .brand {
    grid-column: 1;
    justify-self: start;
  }

  .site-header.nav-stacked .header-actions {
    grid-column: 2;
    justify-self: end;
  }

  .site-header.nav-stacked .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
    justify-self: start;
    width: fit-content;
    gap: 3px;
    padding: 4px;
    border-radius: 999px;
  }

  .site-header.nav-stacked .site-nav a,
  .site-header.nav-stacked .nav-more > summary {
    border: 0;
    background: transparent;
    padding: 0 13px;
  }

  .site-header.nav-stacked .search-shell {
    width: 112px;
  }

  .site-header.nav-stacked .search-shell:is(:focus-within, .is-expanded, .has-value) {
    width: 112px;
  }
}

.search-shell input {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  display: block;
  width: min(420px, calc(100vw - 32px));
  min-width: 0;
  min-height: 46px;
  align-self: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 18px 46px rgba(0, 43, 84, 0.16);
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

.search-shell:is(:focus-within, .is-expanded, .has-value) input {
  width: min(420px, calc(100vw - 32px));
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  align-self: center;
  width: 64px;
  height: 36px;
  min-width: 64px;
  border: 1px solid rgba(0, 102, 204, 0.22);
  border-radius: 999px;
  background: linear-gradient(135deg, #eaf4ff, #c8e1ff);
  color: #003c70;
  padding: 4px;
  position: relative;
  overflow: visible;
  transition:
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-spring);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(0, 102, 204, 0.44);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.22);
  transform: translateY(-1px);
}

.theme-toggle__icon {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 2px 6px rgba(0, 43, 84, 0.18);
  transform: translateX(0);
  transition:
    background var(--motion-medium) ease,
    box-shadow var(--motion-medium) ease,
    transform var(--motion-medium) var(--ease-spring),
    border-color var(--motion-medium) ease,
    color var(--motion-medium) ease;
}

.theme-toggle__icon::before,
.theme-toggle__icon::after {
  content: "";
  position: absolute;
  display: block;
  transition:
    background var(--motion-fast) ease,
    transform var(--motion-fast) ease;
}

.theme-toggle[data-theme-state="light"] .theme-toggle__icon {
  background: #fffdf8;
  transform: translateX(0);
}

.theme-toggle[data-theme-state="light"] .theme-toggle__icon::before {
  inset: 8px;
  border-radius: 50%;
  background: #f5ab1b;
  box-shadow:
    0 -6px 0 -4px #f5ab1b,
    0 6px 0 -4px #f5ab1b,
    6px 0 0 -4px #f5ab1b,
    -6px 0 0 -4px #f5ab1b;
}

.theme-toggle[data-theme-state="dark"] {
  border-color: rgba(147, 197, 253, 0.34);
  background: linear-gradient(135deg, #111c31, #29456f);
}

.theme-toggle[data-theme-state="dark"] .theme-toggle__icon {
  background: #e9f2ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.36);
  transform: translateX(30px);
}

.theme-toggle[data-theme-state="dark"] .theme-toggle__icon::before {
  inset: 6px;
  border-radius: 50%;
  background: #36547c;
}

.theme-toggle[data-theme-state="dark"] .theme-toggle__icon::after {
  top: 4px;
  left: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e9f2ff;
}

.search-results {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-bottom: 12px;
}

.search-results.active {
  display: grid;
}

.search-hit {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  transition: border-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-spring), background var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.search-hit:hover,
.search-hit:focus-visible {
  border-color: var(--strong-line);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.search-hit img {
  grid-row: 1 / span 3;
  width: 54px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  object-fit: cover;
}

.search-hit span {
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-hit strong {
  display: block;
  margin-top: 3px;
}

.icon-button,
.small-button,
.primary-button,
.secondary-button,
.text-button,
.segmented button,
.calculator-tabs button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 38px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition:
    transform var(--motion-fast) var(--ease-spring),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    opacity var(--motion-fast) ease;
  position: relative;
  overflow: hidden;
}

.primary-button,
.secondary-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 13px;
  font-weight: 800;
}

.primary-button {
  border-color: transparent;
  background: var(--amber);
  color: #ffffff;
}

.primary-button:hover,
.primary-button:focus-visible {
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.18);
  transform: translateY(-1px);
}

.secondary-button:hover,
.small-button:hover,
.text-button:hover,
.segmented button:hover,
.calculator-tabs button:hover {
  border-color: var(--strong-line);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.icon-button:active,
.small-button:active,
.primary-button:active,
.secondary-button:active,
.text-button:active,
	.segmented button:active,
	.calculator-tabs button:active,
	.site-nav a:active,
	.nav-more > summary:active,
	.search-hit:active {
  transform: translateY(0);
}

.small-button[hidden],
.primary-button[hidden],
.secondary-button[hidden] {
  display: none;
}

.text-button {
  min-height: 32px;
  padding: 4px 8px;
  color: var(--muted);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body.startup-welcome-active {
  overflow: hidden;
}

.startup-welcome {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(245, 245, 247, 0.96), rgba(245, 245, 247, 0.9)),
    linear-gradient(135deg, rgba(0, 113, 227, 0.12), rgba(43, 187, 173, 0.08) 48%, rgba(245, 245, 247, 0.92));
  backdrop-filter: blur(24px) saturate(150%);
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms var(--ease-out), visibility 320ms var(--ease-out);
}

.startup-welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.034) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

.startup-welcome.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-welcome__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(690px, calc(100vw - 32px));
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(0, 43, 84, 0.16);
  padding: 38px 32px 34px;
  text-align: center;
  transform: translateY(0) scale(1);
  transition: transform 320ms var(--ease-out);
}

.startup-welcome.is-leaving .startup-welcome__panel {
  transform: translateY(8px) scale(0.985);
}

.startup-welcome__logo {
  display: block;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0, 43, 84, 0.12);
}

.startup-welcome__gooey {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(620px, 100%);
  height: 112px;
  margin: 18px 0 4px;
  filter: url("#chemvault-gooey-threshold");
}

.startup-welcome__filter {
  position: absolute;
  width: 0;
  height: 0;
}

.startup-welcome__gooey span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  will-change: filter, opacity;
}

.startup-welcome__copy {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.startup-welcome__enter {
  min-height: 46px;
  margin-top: 24px;
  border: 1px solid color-mix(in srgb, var(--amber) 68%, #003c70);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 92%, #ffffff), #005ec2);
  color: #ffffff;
  padding: 0 22px;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 14px 32px rgba(0, 113, 227, 0.22);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.startup-welcome__enter:hover,
.startup-welcome__enter:focus-visible {
  border-color: color-mix(in srgb, var(--amber) 86%, #003c70);
  box-shadow: 0 18px 38px rgba(0, 113, 227, 0.28);
  transform: translateY(-1px);
}

.startup-welcome__enter:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--amber) 32%, transparent);
  outline-offset: 3px;
}

.startup-welcome__enter:active {
  transform: translateY(0);
}

.startup-welcome__enter[disabled] {
  cursor: default;
  opacity: 0.74;
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: rgba(245, 245, 247, 0.58);
  backdrop-filter: blur(18px) saturate(160%);
  transition: opacity var(--motion-medium) ease, visibility var(--motion-medium) ease;
  overflow: hidden;
}

.page-transition.is-active {
  opacity: 1;
  visibility: visible;
}

.page-transition::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 35% 18%, rgba(0, 113, 227, 0.22), transparent 52%),
    radial-gradient(circle at 78% 72%, rgba(0, 113, 227, 0.16), transparent 50%);
  opacity: 0;
  transition: opacity var(--motion-slow) var(--ease-out);
}

.page-transition.is-active::before {
  opacity: 1;
}

.page-transition__panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 12px;
  align-items: center;
  position: relative;
  width: min(340px, calc(100vw - 48px));
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.14);
  padding: 14px;
  transform: translateY(20px) rotateX(2.2deg) scale(0.97);
  transition:
    transform 580ms var(--ease-out),
    box-shadow 300ms var(--ease-out),
    opacity 260ms ease;
}

.page-transition.is-active .page-transition__panel {
  transform: translateY(0) rotateX(0deg) scale(1);
}

.page-transition__panel::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0, rgba(255, 255, 255, 0.5) 48%, transparent 95%);
  opacity: 0.22;
  transform: translateX(-130%);
  animation: chemvault-panel-sheen 1900ms var(--ease-spring) infinite;
  content: "";
}

.page-transition__logo {
  grid-row: 1 / span 2;
  display: block;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 8px 20px rgba(0, 43, 84, 0.1);
}

.page-transition__copy {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.page-transition__rail {
  position: relative;
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.page-transition__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #003c70, var(--amber));
  transform: scaleX(0.08);
  transform-origin: left center;
}

.page-transition.is-active .page-transition__bar {
  animation: chemvault-progress 1250ms var(--ease-out) forwards;
}

.site-boot-loader {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 113, 227, 0.12), transparent 34%),
    rgba(245, 245, 247, 0.92);
  backdrop-filter: blur(22px) saturate(150%);
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.site-boot-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.site-boot-loader__panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 48px));
  color: var(--text);
}

.site-boot-loader__logo {
  display: block;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 18px;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 22px 48px rgba(0, 43, 84, 0.16);
  animation: chemvault-boot-logo 820ms var(--ease-out) both;
}

.site-boot-loader__label {
  margin-top: 2px;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 900;
  letter-spacing: 0;
}

.site-boot-loader__rail {
  position: relative;
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.site-boot-loader__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #003c70, #0071e3, var(--amber));
  transform: scaleX(0.1);
  transform-origin: left center;
  animation: chemvault-boot-progress 920ms var(--ease-out) forwards;
}

.site-is-booting {
  cursor: progress;
}

.motion-ripple {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5), rgba(0, 113, 227, 0.2));
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  animation: none;
  will-change: transform, opacity;
}

.motion-ripple.is-active {
  animation: chemvault-ripple var(--chemvault-ripple-duration, 620ms) cubic-bezier(0.18, 0.82, 0.21, 1) forwards;
}

.is-motion-ripple-host {
  position: relative;
  overflow: hidden;
}

.motion-available [data-motion-bound="true"] {
  opacity: 0;
  transform: translateY(var(--motion-enter-y, var(--motion-reveal-enter-y))) rotateX(var(--motion-enter-rotate, 0deg));
  filter: blur(8px);
  transition:
    opacity var(--motion-reveal-duration, var(--motion-slow)) var(--ease-out),
    transform var(--motion-reveal-duration, var(--motion-slow)) var(--ease-out),
    filter var(--motion-reveal-duration, var(--motion-slow)) var(--ease-out),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
  will-change: opacity, transform, filter;
  transition-delay: var(--motion-reveal-delay, var(--reveal-delay, calc(var(--motion-order, 0) * var(--motion-reveal-stagger, 18ms))));
}

.motion-available [data-motion-profile="compact"] {
  --motion-enter-y: 5px;
  --motion-enter-rotate: 0deg;
  --motion-reveal-duration: var(--motion-reveal-compact-duration);
  --motion-reveal-stagger: 7ms;
}

.motion-available [data-motion-profile="default"] {
  --motion-enter-y: var(--motion-reveal-enter-y);
  --motion-enter-rotate: var(--motion-reveal-enter-rotate);
}

.motion-available [data-motion-bound="true"].is-visible {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
  filter: blur(0);
}

@keyframes chemvault-progress {
  0% {
    transform: scaleX(0.08);
  }
  58% {
    transform: scaleX(0.74);
  }
  100% {
    transform: scaleX(0.94);
  }
}

@keyframes chemvault-panel-sheen {
  to {
    transform: translateX(130%);
  }
}

@keyframes chemvault-boot-progress {
  0% {
    transform: scaleX(0.1);
  }
  46% {
    transform: scaleX(0.68);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes chemvault-boot-card {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px)) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes chemvault-boot-rail {
  0% {
    background-size: 48px 48px, 12% 3px;
  }
  58% {
    background-size: 48px 48px, 74% 3px;
  }
  100% {
    background-size: 48px 48px, 100% 3px;
  }
}

@keyframes chemvault-boot-logo {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chemvault-ripple {
  0% {
    opacity: 0.48;
    transform: translate(-50%, -50%) scale(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

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

  .page-transition {
    display: none;
  }

  .site-boot-loader {
    display: none;
  }

  html.motion-boot body:not(.page-ready)::before,
  html.motion-boot body:not(.page-ready)::after {
    display: none;
  }
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 9px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  background: var(--text);
}

.workspace-hero {
  padding: 62px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(420px, 1.06fr);
  gap: 30px;
  align-items: stretch;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 4.7rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.35rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.lead {
  max-width: 680px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 26px;
}

.metric-strip div,
.score-grid div,
.command-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.metric-strip strong,
.score-grid strong,
.command-grid strong {
  display: block;
  color: var(--amber);
  font-size: 1.35rem;
  line-height: 1.1;
}

.metric-strip span,
.score-grid span,
.label,
.command-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.command-panel,
.control-panel,
.library-panel,
.detail-card,
.compare-card,
.mechanism-detail,
.table-card,
.calculator-shell,
.quiz-card,
.notes-panel,
.safety-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.command-panel {
  overflow: hidden;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.panel-toolbar code {
  margin-left: auto;
  color: var(--amber);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

#moleculeCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #ffffff;
}

body.light-mode #moleculeCanvas {
  background: #f5f5f7;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
}

.section {
  padding: 66px 0;
}

.section-tint {
  background:
    linear-gradient(90deg, rgba(0, 113, 227, 0.035), transparent 34%),
    rgba(255, 255, 255, 0.024);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 520px);
  gap: 26px;
  align-items: end;
  margin-bottom: 24px;
}

.section-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.workbench-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.control-panel,
.library-panel,
.detail-card,
.compare-card,
.mechanism-detail,
.table-card,
.calculator-shell,
.quiz-card,
.notes-panel {
  padding: 16px;
}

label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  margin: 0 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  outline: 0;
  padding: 11px 12px;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-fast) var(--ease-spring);
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--amber) 54%, var(--line));
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.1);
  transform: translateY(-1px);
}

select {
  appearance: none;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 20%, transparent);
}

.route-planner {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.route-output {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  color: var(--muted);
  min-height: 58px;
}

.route-output strong {
  color: var(--text);
}

.academic-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: stretch;
}

.scholar-panel {
  padding: 18px;
  min-width: 0;
}

.concept-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.concept-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.concept-item span,
.source-card span {
  display: block;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.concept-item strong {
  display: block;
  margin-top: 3px;
}

.concept-item.selected {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
}

.paper-head {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.paper-head h3 {
  margin: 0;
  font-size: 1.55rem;
}

.paper-head code {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--amber);
  padding: 6px 8px;
}

.paper-block {
  border-left: 3px solid var(--teal);
  padding: 8px 0 8px 12px;
  margin: 12px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 9%, transparent), transparent);
}

.paper-block p {
  margin: 4px 0 0;
  color: var(--muted);
}

.reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.reference-list a,
.source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.reference-list a strong,
.reference-list a span,
.source-card strong,
.source-card small {
  display: block;
}

.reference-list a span,
.source-card p,
.source-card small {
  color: var(--muted);
}

.matrix-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.evidence-ladder {
  display: grid;
  gap: 9px;
}

.evidence-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.evidence-step > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--amber);
  color: #ffffff;
  font-weight: 900;
}

.evidence-step p {
  margin: 3px 0;
  color: var(--muted);
}

.evidence-step small {
  color: var(--teal);
}

.source-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.source-card {
  min-height: 154px;
}

.source-card strong {
  margin: 4px 0 8px;
  color: var(--text);
}

.source-card p {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.dossier-console {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}

.dossier-spotlight,
.method-ledger,
.publication-queue,
.dossier-manuscript {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(82, 199, 184, 0.055), transparent 38%),
    color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.spotlight-head,
.ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.spotlight-head h3 {
  margin: 8px 0 0;
  font-size: 1.55rem;
}

.spotlight-head > strong {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 64px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-radius: var(--radius);
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 9%, transparent);
  font-size: 1.2rem;
}

.method-list,
.queue-list,
.instrument-list {
  display: grid;
  gap: 10px;
}

.method-card,
.queue-item,
.instrument-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.method-card span,
.queue-item span {
  display: block;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.method-card strong,
.queue-item strong,
.instrument-card strong {
  display: block;
  margin: 3px 0 6px;
}

.method-card p,
.instrument-card p,
.instrument-card small {
  color: var(--muted);
}

.method-card p,
.instrument-card p {
  margin: 0 0 9px;
}

.queue-item small {
  color: var(--muted);
}

.priority-high {
  color: var(--wine) !important;
}

.priority-medium {
  color: var(--amber) !important;
}

.mini-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.mini-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.linked-records {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.dossier-page-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.methods-page-layout,
.spectroscopy-page-layout,
.materials-page-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.dossier-side {
  display: grid;
  gap: 14px;
}

.manuscript-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.manuscript-head h2 {
  margin-top: 8px;
}

.manuscript-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.readiness-gauge {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 126px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--amber) 18%, transparent) var(--value), transparent var(--value)),
    rgba(255, 255, 255, 0.035);
  text-align: center;
}

.readiness-gauge span {
  display: none;
}

.readiness-gauge strong {
  color: var(--amber);
  font-size: 1.65rem;
}

.readiness-gauge small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 900;
}

.manuscript-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 12px;
}

.method-snapshot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.materials-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.material-preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(82, 199, 184, 0.06), transparent 46%),
    color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: 188px;
}

.material-preview-card span {
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.material-preview-card strong,
.material-preview-card small {
  display: block;
}

.material-preview-card strong {
  margin: 8px 0;
  font-size: 1.12rem;
}

.material-preview-card p,
.material-preview-card small {
  color: var(--muted);
}

.signal-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.signal-matrix.compact {
  grid-template-columns: 1fr;
}

.signal-matrix article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.signal-matrix strong,
.signal-matrix small {
  display: block;
}

.signal-matrix p,
.signal-matrix small {
  color: var(--muted);
}

.ledger-table {
  display: grid;
  gap: 8px;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.ledger-row span {
  color: var(--muted);
}

.state-complete {
  color: var(--green);
}

.state-partial {
  color: var(--amber);
}

.state-missing {
  color: var(--wine);
}

.library-toolbar,
.compare-head,
.quiz-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.segmented,
.calculator-tabs {
  display: inline-flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.segmented button,
.calculator-tabs button {
  min-height: 32px;
  padding: 6px 10px;
  color: var(--muted);
}

.segmented button.active,
.calculator-tabs button.active {
  color: #ffffff;
  background: var(--amber);
  border-color: transparent;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card-grid.dense {
  grid-template-columns: 1fr;
}

.data-card,
.mechanism-card,
.element-tile,
.note-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
  min-width: 0;
}

.data-card {
  display: grid;
  gap: 10px;
  min-height: 238px;
}

.data-card.selected,
.mechanism-card.selected,
.element-tile.selected {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
}

.data-card h3,
.mechanism-card h3,
.element-tile h3,
.note-card h3 {
  margin: 0 0 4px;
}

.formula {
  color: var(--amber);
  font-family: var(--font-mono-var);
  font-weight: 900;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent);
  border-radius: 6px;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  padding: 3px 7px;
  font-size: 0.75rem;
  font-weight: 800;
}

.risk-standard {
  color: var(--green);
}

.risk-dry,
.risk-oxidizer {
  color: var(--amber);
}

.risk-corrosive {
  color: var(--red);
}

.detail-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  margin: 8px 0 14px;
}

.detail-list li {
  color: var(--muted);
}

.compare-table {
  display: grid;
  gap: 8px;
}

.compare-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.mechanism-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.mechanism-list {
  display: grid;
  gap: 9px;
}

.mechanism-card {
  text-align: left;
  color: var(--text);
}

.step-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.step-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.step-item span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--amber);
  color: #ffffff;
  font-weight: 900;
}

.spectra-layout,
.element-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.table-card {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--amber);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.84rem;
}

td {
  color: var(--muted);
}

td strong {
  color: var(--text);
}

.calculator-tabs {
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.calc-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calc-field.full {
  grid-column: 1 / -1;
}

.calc-output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

#calculatorOutput {
  margin: 8px 0 14px;
  color: var(--muted);
  min-height: 88px;
}

#calculatorOutput strong {
  display: block;
  color: var(--amber);
  font-size: 1.55rem;
  margin-bottom: 7px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.study-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.quiz-card h3 {
  min-height: 72px;
  font-size: 1.4rem;
}

.quiz-options {
  display: grid;
  gap: 9px;
  margin: 16px 0;
}

.quiz-option {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.quiz-option.correct {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 16%, transparent);
}

.quiz-option.wrong {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 14%, transparent);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}

.element-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.element-tile {
  min-height: 116px;
  text-align: left;
  color: var(--text);
}

.element-symbol {
  display: block;
  color: var(--amber);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.element-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.notebook-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.notes-panel {
  display: grid;
  gap: 10px;
  min-height: 260px;
}

.note-card p {
  color: var(--muted);
  margin: 0 0 10px;
}

.safety-section {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
}

.safety-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.safety-copy {
  color: var(--muted);
}

.site-footer {
  --footer-height: 620px;
  position: relative;
  width: 100%;
  height: var(--footer-height);
  color: #f7f9fc;
  background: transparent;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  isolation: isolate;
  view-timeline-axis: block;
  view-timeline-name: --footer-clarify;
  z-index: 0;
}

.footer-sticky-layer {
  position: fixed;
  inset: auto 0 0;
  z-index: 0;
  width: 100%;
  height: var(--footer-height);
  pointer-events: auto;
}

.footer-sticky-shell {
  position: sticky;
  top: calc(100vh - var(--footer-height));
  height: var(--footer-height);
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.footer-panel {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(14, 32, 56, 0.94), rgba(7, 10, 16, 0.98) 46%, #06070a),
    #070a10;
  padding: 76px 0 22px;
}

.footer-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  contain: strict;
}

.footer-ambient span {
  position: absolute;
  top: -230px;
  left: -90px;
  display: block;
  width: 260px;
  height: 980px;
  border-radius: 999px;
  transform: rotate(-38deg);
  background: radial-gradient(50% 50% at 50% 50%, rgba(21, 112, 239, 0.18), rgba(21, 112, 239, 0.05) 58%, transparent 100%);
  filter: blur(1px);
}

.footer-ambient span:nth-child(2) {
  left: 8%;
  width: 120px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(87, 188, 255, 0.14), rgba(87, 188, 255, 0.04) 62%, transparent 100%);
}

.footer-ambient span:nth-child(3) {
  left: auto;
  right: 6%;
  width: 180px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.08), rgba(21, 112, 239, 0.03) 64%, transparent 100%);
}

.footer-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.9fr);
  gap: clamp(34px, 6vw, 88px);
  align-items: start;
  text-align: left;
}

.developer-footer-grid {
  align-items: start;
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 440px;
  min-width: 0;
}

.footer-brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  width: fit-content;
}

.footer-brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.footer-brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.footer-brand strong {
  display: block;
  margin: 0;
  color: #ffffff;
  font-size: 1.12rem;
  line-height: 1.1;
}

.footer-brand small,
.footer-brand-block p,
.footer-column span,
.footer-bottom {
  color: rgba(247, 249, 252, 0.68);
}

.footer-brand small {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.3;
}

.footer-brand-block p {
  margin: 8px 0 0;
  max-width: 420px;
  font-size: 0.94rem;
  line-height: 1.65;
}

.footer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.footer-social {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.footer-social:hover,
.footer-social:focus-visible {
  border-color: rgba(118, 184, 255, 0.6);
  background: rgba(21, 112, 239, 0.18);
  transform: translateY(-1px);
}

.footer-link-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(124px, 1fr));
  gap: clamp(18px, 3vw, 34px);
}

.footer-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.footer-heading {
  color: rgba(170, 205, 255, 0.72) !important;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-column a {
  width: fit-content;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.91rem;
  font-weight: 760;
  line-height: 1.32;
  overflow-wrap: anywhere;
  transition: color 180ms ease, transform 180ms ease;
}

.footer-column a:hover,
.footer-column a:focus-visible {
  color: #8ec5ff;
  transform: translateX(2px);
}

.footer-column span:not(.footer-heading) {
  font-size: 0.9rem;
  line-height: 1.45;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  font-size: 0.82rem;
  font-weight: 760;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
  text-align: right;
}

.footer-mobile-compact {
  display: none;
}

.footer-version {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 10px;
  color: rgba(247, 249, 252, 0.8);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .footer-reveal {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(-8px);
    animation: footer-reveal 780ms ease forwards;
    animation-delay: var(--footer-delay, 0ms);
  }

  @supports (animation-timeline: view()) {
    .footer-panel {
      animation: footer-clarify 1s ease-out both;
      animation-range: entry 0% entry 44%;
      animation-timeline: --footer-clarify;
    }
  }
}

@keyframes footer-reveal {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes footer-clarify {
  from {
    opacity: 0.92;
    filter: blur(5px) saturate(0.95);
  }

  to {
    opacity: 1;
    filter: blur(0) saturate(1);
  }
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

@media (max-width: 1080px) {
  .hero-grid,
  .academic-grid,
  .workbench-layout,
  .notebook-layout,
  .dossier-console,
  .dossier-page-layout,
  .methods-page-layout,
  .spectroscopy-page-layout,
  .materials-page-layout,
  .method-snapshot-grid,
  .materials-home-grid {
    grid-template-columns: 1fr;
  }

  .source-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    gap: 14px;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .element-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .nav-shell {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .menu-toggle {
    display: block;
    grid-column: 3;
    justify-self: end;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
  }

  .header-actions {
    display: grid;
    grid-column: 2;
    grid-template-columns: minmax(112px, min(360px, 45vw)) auto;
    justify-self: end;
    min-width: 0;
  }

  .site-header.nav-open .site-nav {
    display: grid;
  }

  .site-nav {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    justify-content: stretch;
    justify-self: stretch;
    width: 100%;
    gap: 6px;
    padding: 8px;
    border-radius: 18px;
  }

  .site-nav a {
    border: 0;
    padding: 0 12px;
  }

  .nav-more {
    display: grid;
  }

  .nav-more > summary {
    border: 0;
    padding: 0 12px;
  }

  .nav-more-menu {
    position: static;
    min-width: 0;
    margin-top: 6px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: none;
  }

  .header-actions {
    grid-template-columns: 1fr auto;
  }

  .search-shell {
    position: static;
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    overflow: hidden;
  }

  .search-shell input {
    position: static;
    z-index: auto;
    width: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .search-shell:is(:focus-within, .is-expanded, .has-value) input {
    width: auto;
    transform: none;
  }

  .search-results.active {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 3.45rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .section-heading,
  .academic-grid,
  .mechanism-layout,
  .spectra-layout,
  .element-layout,
  .calculator-grid,
  .study-layout,
  .safety-grid,
  .detail-panel,
  .manuscript-head,
  .manuscript-grid,
  .signal-matrix {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip,
  .command-grid,
  .source-strip,
  .element-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-link-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-bottom p:last-child {
    display: none;
  }

  .site-footer {
    height: auto;
    clip-path: none;
    view-timeline-name: none;
  }

  .footer-sticky-layer {
    position: relative;
    inset: auto;
    z-index: auto;
    height: auto;
  }

  .footer-sticky-shell {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
  }

  .footer-panel {
    min-height: 0;
    animation: none;
    filter: none;
    opacity: 1;
    padding: 56px 0 24px;
  }

  .footer-reveal {
    animation: none;
    filter: none;
    opacity: 1;
    transform: none;
  }

  .footer-bottom-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 22px, 1220px);
  }

  h1 {
    font-size: 2.65rem;
  }

  .workspace-hero {
    padding-top: 34px;
  }

  .metric-strip,
  .command-grid,
  .card-grid,
  .calc-panel,
  .score-grid,
  .reference-list,
  .source-strip,
  .element-grid,
  .search-results.active,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    align-items: flex-start;
    gap: 24px;
  }

  .footer-panel {
    gap: 16px;
    padding: 26px 0 16px;
  }

  .footer-grid {
    display: none;
  }

  .footer-mobile-compact {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
  }

  .footer-mobile-identity {
    display: grid;
    gap: 9px;
  }

  .footer-mobile-identity .footer-brand {
    gap: 10px;
  }

  .footer-mobile-identity .footer-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .footer-mobile-identity .footer-brand-mark img {
    width: 25px;
    height: 25px;
  }

  .footer-mobile-identity .footer-brand strong {
    font-size: 0.92rem;
  }

  .footer-mobile-identity .footer-brand small,
  .footer-mobile-identity p {
    margin: 0;
    color: rgba(247, 249, 252, 0.66);
    font-size: 0.7rem;
    line-height: 1.4;
  }

  .footer-mobile-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .footer-mobile-links a {
    display: flex;
    min-height: 30px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.72rem;
    font-weight: 760;
  }

  .footer-bottom {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding-top: 12px;
    font-size: 0.68rem;
  }

  .footer-bottom-meta {
    margin-left: auto;
  }

  .footer-bottom-meta p {
    display: none;
  }

  .footer-version {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.6rem;
  }

  .header-actions {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 64px;
    justify-self: stretch;
    width: 100%;
    gap: 8px;
  }

  .search-shell {
    min-height: 42px;
    padding: 0 12px;
  }

  .search-shell span {
    display: none;
  }

  .search-shell input {
    min-height: 42px;
    font-size: 16px;
  }

  .theme-toggle {
    width: 64px;
    height: 42px;
    min-width: 64px;
  }

  .site-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .startup-welcome {
    padding: 16px;
  }

  .startup-welcome__panel {
    width: min(100%, 430px);
    padding: 30px 18px 28px;
  }

  .startup-welcome__logo {
    width: 48px;
    height: 48px;
  }

  .startup-welcome__gooey {
    height: 88px;
    margin-top: 16px;
  }

  .startup-welcome__gooey span {
    font-size: 2.8rem;
  }

  .startup-welcome__copy {
    font-size: 0.96rem;
  }

  .startup-welcome__enter {
    width: 100%;
  }
}

/* Final light-system defaults for the Cloudflare Pages build. */
:root,
body.light-mode {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --strong-line: rgba(0, 0, 0, 0.22);
  --amber: #0071e3;
  --teal: #0066cc;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.08);
}

html,
body {
  background: #f5f5f7;
  color: #1d1d1f;
}

body.dark-mode {
  background: #101114;
  color: #f5f5f7;
}

.site-header {
  background: rgba(251, 251, 253, 0.86);
}

body.dark-mode .site-header {
  background: rgba(18, 19, 23, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .brand-mark,
body.dark-mode .search-shell,
body.dark-mode .theme-toggle {
  background: rgba(25, 27, 32, 0.82);
  border-color: rgba(255, 255, 255, 0.13);
}

body.dark-mode .search-shell:focus-within,
body.dark-mode .theme-toggle:hover,
body.dark-mode .theme-toggle:focus-visible {
  background: #1f2228;
}

body.dark-mode .site-nav,
html.dark-mode body .site-nav {
  background: rgba(25, 27, 32, 0.66);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.skip-link,
.primary-button,
.small-button,
.workbench-tab.active,
.progress-fill,
.scan-beam,
.timeline-node::before {
  background: #0071e3;
  color: #ffffff;
}

.primary-button:hover,
.primary-button:focus-visible {
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.18);
}

.search-hit:hover,
.search-hit:focus-visible,
.secondary-button:hover,
.small-button:hover,
.text-button:hover,
.segmented button:hover,
.calculator-tabs button:hover {
  background: #f5f5f7;
}

#moleculeCanvas,
.graph-board,
.network-board,
.spectrum-window {
  background: #ffffff;
}

.section-tint {
  background: #fbfbfd;
}

/* Dark theme parity for shell and shared surfaces that have final light overrides. */
html.dark-mode {
  color-scheme: dark;
  --bg: #101114;
  --bg-2: #15171b;
  --surface: #191b20;
  --surface-2: #1f2228;
  --surface-3: #252932;
  --text: #f5f5f7;
  --muted: #a8adb7;
  --line: rgba(255, 255, 255, 0.13);
  --strong-line: rgba(255, 255, 255, 0.28);
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

body.dark-mode,
html.dark-mode body {
  background: #101114;
  color: #f5f5f7;
}

body.dark-mode .site-header,
html.dark-mode body .site-header {
  background: rgba(18, 19, 23, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode :where(.brand-mark, .search-shell, .theme-toggle, .nav-more-menu),
html.dark-mode body :where(.brand-mark, .search-shell, .theme-toggle, .nav-more-menu) {
  background: rgba(25, 27, 32, 0.84);
  border-color: rgba(255, 255, 255, 0.13);
  color: #f5f5f7;
}

body.dark-mode .site-header .brand-mark,
html.dark-mode body .site-header .brand-mark {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 43, 84, 0.22);
}

body.dark-mode .site-header .brand-mark img,
html.dark-mode body .site-header .brand-mark img {
  filter: none;
}

body.dark-mode :where(.search-shell:focus-within, .search-shell.is-expanded, .theme-toggle:hover, .theme-toggle:focus-visible),
html.dark-mode body :where(.search-shell:focus-within, .search-shell.is-expanded, .theme-toggle:hover, .theme-toggle:focus-visible) {
  background: #1f2228;
  border-color: rgba(255, 255, 255, 0.24);
}

body.dark-mode .search-shell input,
html.dark-mode body .search-shell input {
  background: #1f2228;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f5f7;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

body.dark-mode .search-shell input::placeholder,
html.dark-mode body .search-shell input::placeholder {
  color: rgba(245, 245, 247, 0.58);
}

@media (max-width: 900px) {
  body.dark-mode .search-shell input,
  html.dark-mode body .search-shell input {
    background: transparent;
    border: 0;
    box-shadow: none;
  }
}

body.dark-mode .site-nav a[aria-current],
body.dark-mode .nav-more > summary[aria-current],
html.dark-mode body .site-nav a[aria-current],
html.dark-mode body .nav-more > summary[aria-current] {
  color: #ffffff;
  background: rgba(0, 113, 227, 0.24);
  border-color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(104, 178, 255, 0.34),
    0 10px 26px rgba(0, 113, 227, 0.2);
}

body.dark-mode .site-nav a:not([aria-current]),
body.dark-mode .nav-more > summary:not([aria-current]),
html.dark-mode body .site-nav a:not([aria-current]),
html.dark-mode body .nav-more > summary:not([aria-current]) {
  color: rgba(245, 245, 247, 0.82);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.dark-mode .site-nav a:not([aria-current]):hover,
body.dark-mode .site-nav a:not([aria-current]):focus-visible,
body.dark-mode .nav-more > summary:not([aria-current]):hover,
body.dark-mode .nav-more > summary:not([aria-current]):focus-visible,
html.dark-mode body .site-nav a:not([aria-current]):hover,
html.dark-mode body .site-nav a:not([aria-current]):focus-visible,
html.dark-mode body .nav-more > summary:not([aria-current]):hover,
html.dark-mode body .nav-more > summary:not([aria-current]):focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

body.dark-mode .site-nav a::after,
body.dark-mode .nav-more > summary::after,
html.dark-mode body .site-nav a::after,
html.dark-mode body .nav-more > summary::after {
  background: #409cff;
}

body.dark-mode :where(.home-hero, .workspace-hero, .page-hero, .section, .section-tint),
html.dark-mode body :where(.home-hero, .workspace-hero, .page-hero, .section, .section-tint) {
  background: #101114;
}

body.dark-mode :where(.home-hero, .page-hero),
html.dark-mode body :where(.home-hero, .page-hero) {
  background: linear-gradient(180deg, #15171b 0%, #101114 100%);
}

body.dark-mode :where(.home-hero-copy h1, .page-hero h1, h1, h2, h3, strong),
html.dark-mode body :where(.home-hero-copy h1, .page-hero h1, h1, h2, h3, strong) {
  color: #f5f5f7;
}

body.dark-mode :where(.lead, .page-hero p, .section-heading p, .portal-card p, .record-lead, .live-card p, .search-note p, .muted, small),
html.dark-mode body :where(.lead, .page-hero p, .section-heading p, .portal-card p, .record-lead, .live-card p, .search-note p, .muted, small) {
  color: #a8adb7;
}

body.dark-mode :where(
  .home-status-panel,
  .home-search-card,
  .home-metric-grid > div,
  .home-quick-card,
  .portal-card,
  .portal-card-featured,
  .page-index-card,
  .data-window,
  .detail-card,
  .compare-card,
  .table-card,
  .calculator-shell,
  .calc-panel,
  .quiz-card,
  .notes-panel,
  .safety-section,
  .source-card,
  .method-card,
  .metric-strip > div,
  .command-grid > div,
  .source-strip > div,
  .element-grid > div,
  .search-results,
  .search-hit,
  .graph-board,
  .network-board,
  .spectrum-window,
  #moleculeCanvas
),
html.dark-mode body :where(
  .home-status-panel,
  .home-search-card,
  .home-metric-grid > div,
  .home-quick-card,
  .portal-card,
  .portal-card-featured,
  .page-index-card,
  .data-window,
  .detail-card,
  .compare-card,
  .table-card,
  .calculator-shell,
  .calc-panel,
  .quiz-card,
  .notes-panel,
  .safety-section,
  .source-card,
  .method-card,
  .metric-strip > div,
  .command-grid > div,
  .source-strip > div,
  .element-grid > div,
  .search-results,
  .search-hit,
  .graph-board,
  .network-board,
  .spectrum-window,
  #moleculeCanvas
) {
  background: #191b20;
  border-color: rgba(255, 255, 255, 0.13);
  color: #f5f5f7;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
}

body.dark-mode :where(.portal-card-featured, .nih-import-panel),
html.dark-mode body :where(.portal-card-featured, .nih-import-panel) {
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.16), rgba(25, 27, 32, 0.96));
  border-color: rgba(0, 113, 227, 0.32);
}

body.dark-mode :where(.search-hit:hover, .search-hit:focus-visible, .secondary-button:hover, .small-button:hover, .text-button:hover, .segmented button:hover, .calculator-tabs button:hover),
html.dark-mode body :where(.search-hit:hover, .search-hit:focus-visible, .secondary-button:hover, .small-button:hover, .text-button:hover, .segmented button:hover, .calculator-tabs button:hover) {
  background: #252932;
}

body.dark-mode :where(input, select, textarea),
html.dark-mode body :where(input, select, textarea) {
  background: #15171b;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f5f7;
}

body.dark-mode :where(input, textarea)::placeholder,
html.dark-mode body :where(input, textarea)::placeholder {
  color: rgba(245, 245, 247, 0.5);
}

body.dark-mode :where(.secondary-button, .text-button, .tag, .source-card span, .method-card span),
html.dark-mode body :where(.secondary-button, .text-button, .tag, .source-card span, .method-card span) {
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.12);
  color: #66aaff;
}

body.dark-mode :where(.result-thumb, .live-card-media, .imported-record-list img, .home-quick-card img),
html.dark-mode body :where(.result-thumb, .live-card-media, .imported-record-list img, .home-quick-card img) {
  background: #252932;
  border-color: rgba(255, 255, 255, 0.14);
}

body.dark-mode #moleculeCanvas,
html.dark-mode body #moleculeCanvas {
  background: #191b20;
}

body.dark-mode .startup-welcome,
html.dark-mode body .startup-welcome {
  background:
    linear-gradient(180deg, rgba(16, 17, 20, 0.96), rgba(16, 17, 20, 0.9)),
    linear-gradient(135deg, rgba(0, 113, 227, 0.16), rgba(43, 187, 173, 0.1) 48%, rgba(16, 17, 20, 0.92));
}

body.dark-mode .startup-welcome::before,
html.dark-mode body .startup-welcome::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

body.dark-mode .startup-welcome__panel,
html.dark-mode body .startup-welcome__panel {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(25, 27, 32, 0.9);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

body.dark-mode .startup-welcome__logo,
html.dark-mode body .startup-welcome__logo {
  border-color: rgba(255, 255, 255, 0.14);
  background: #ffffff;
}

/* Final theme-switch parity after shared dark-mode surface overrides. */
body.dark-mode .theme-toggle,
html.dark-mode body .theme-toggle {
  border-color: rgba(147, 197, 253, 0.34);
  background: linear-gradient(135deg, #111c31, #29456f);
}

body.dark-mode .theme-toggle:hover,
body.dark-mode .theme-toggle:focus-visible,
html.dark-mode body .theme-toggle:hover,
html.dark-mode body .theme-toggle:focus-visible {
  border-color: rgba(191, 219, 254, 0.68);
  background: linear-gradient(135deg, #16243c, #355987);
}

/* Final readability guard for every non-search shell page. */
body.page-shell:not([data-boot-label="Search"]) {
  background: var(--bg);
  color: var(--text);
}

body.page-shell:not([data-boot-label="Search"]) main {
  background: var(--bg);
  color: var(--text);
}

body.page-shell:not([data-boot-label="Search"]) :where(
  .page-hero,
  .section,
  .section-tint
) {
  background-color: var(--bg);
  color: var(--text);
}

body.page-shell:not([data-boot-label="Search"]) :where(
  .page-panel,
  .page-index-card,
  .portal-card,
  .data-window,
  .source-browser-card,
  .route-network article,
  .local-result-card,
  .external-source-card,
  .fallback-source-card,
  .workbench-command-card,
  .workbench-detail-card,
  .route-card,
  .mechanism-audit-card,
  .material-interface-card,
  .related-record-card,
  .record-panel,
  .record-trust-card
) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

body.page-shell:not([data-boot-label="Search"]) :where(
  .page-hero h1,
  .page-panel h1,
  .page-panel h2,
  .page-panel h3,
  .page-index-card strong,
  .portal-card strong,
  .data-window h2,
  .data-window h3,
  .source-browser-card h2,
  .source-browser-card h3,
  .local-result-card strong,
  .external-source-card strong,
  .fallback-source-card strong,
  .workbench-topline h2,
  .route-card h3,
  .mechanism-audit-card h3,
  .material-interface-card h3,
  .evidence-item h3,
  .selected-record h3,
  .related-record-card h3,
  .record-panel h2
) {
  color: var(--text);
}

body.page-shell:not([data-boot-label="Search"]) :where(
  .page-hero p,
  .page-index-card ol,
  .portal-card p,
  .data-window p,
  .source-browser-card p,
  .route-card p,
  .mechanism-audit-card p,
  .material-interface-card p,
  .evidence-item p,
  .selected-record p,
  .related-record-card p,
  .record-panel p,
  .record-trust-card p
) {
  color: var(--muted);
}
