/* Solute — static course site.
   Served from jackblaker.com/public/chemistry/ under a self-only CSP
   (Google Fonts is the one allowed external origin).
   Design system: Fraunces (display) + Inter (text), cobalt / navy / warm paper,
   full light + dark themes. */

:root {
  --paper: #f4f1e8;
  --paper-bright: #fbf9f3;
  --surface: #ffffff;
  --surface-2: #f3f0e6;
  --surface-3: #ebe7d9;
  --ink: #16202e;
  --ink-soft: #38424f;
  --muted-ink: #5c6675;
  --line: #e2ded1;
  --line-strong: #c9c4b3;
  --cobalt: #1450d4;
  --cobalt-dark: #0d3aa3;
  --cobalt-soft: #e9effc;
  --link: #1450d4;
  --orange: #e15c25;
  --orange-soft: #fcefe6;
  --lime: #cbdb2f;
  --lime-ink: #1c2007;
  --navy: #0f1c30;
  --navy-2: #16253c;
  --navy-line: #34455f;
  --navy-text: #ffffff;
  --navy-soft: #b7c3d5;
  --code-bg: #eef1f6;
  --code-ink: #0b3d91;
  --ok: #1c8a5b;
  --shadow-sm: 0 1px 2px rgba(20, 30, 46, .06), 0 6px 18px rgba(20, 30, 46, .06);
  --shadow-md: 0 12px 34px rgba(20, 30, 46, .10);
  --shadow-lg: 0 24px 60px rgba(20, 30, 46, .13);
  --hard: 4px 4px 0 var(--ink);
  --radius: 6px;
  --radius-lg: 14px;
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-sans: "Inter", "Aptos", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "Cascadia Code", "SF Mono", ui-monospace, "Consolas", monospace;
  --wrap: min(1180px, calc(100% - 44px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1219;
    --paper-bright: #10161f;
    --surface: #171e29;
    --surface-2: #1d2531;
    --surface-3: #232c3a;
    --ink: #e9edf3;
    --ink-soft: #cdd4de;
    --muted-ink: #97a2b1;
    --line: #2a333f;
    --line-strong: #3a4453;
    --cobalt: #4c88f2;
    --cobalt-dark: #4c88f2;
    --cobalt-soft: #172339;
    --link: #82b0ff;
    --orange: #f2703a;
    --orange-soft: #24160e;
    --lime: #c9da3a;
    --lime-ink: #10151d;
    --navy: #0a0f18;
    --navy-2: #111a29;
    --navy-line: #2a394f;
    --navy-soft: #a9b6c8;
    --code-bg: #0d1526;
    --code-ink: #9ec5ff;
    --ok: #43c088;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .34);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
    --hard: 4px 4px 0 rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1219;
  --paper-bright: #10161f;
  --surface: #171e29;
  --surface-2: #1d2531;
  --surface-3: #232c3a;
  --ink: #e9edf3;
  --ink-soft: #cdd4de;
  --muted-ink: #97a2b1;
  --line: #2a333f;
  --line-strong: #3a4453;
  --cobalt: #4c88f2;
  --cobalt-dark: #4c88f2;
  --cobalt-soft: #172339;
  --link: #82b0ff;
  --orange: #f2703a;
  --orange-soft: #24160e;
  --lime: #c9da3a;
  --lime-ink: #10151d;
  --navy: #0a0f18;
  --navy-2: #111a29;
  --navy-line: #2a394f;
  --navy-soft: #a9b6c8;
  --code-bg: #0d1526;
  --code-ink: #9ec5ff;
  --ok: #43c088;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .34);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --hard: 4px 4px 0 rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper-bright);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "cv05", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
svg { stroke-width: 1.7; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; font-family: var(--font-display); font-weight: 500; letter-spacing: -.018em; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--cobalt) 24%, transparent); }

.site-container { width: var(--wrap); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 200;
  background: var(--surface); color: var(--ink); padding: 12px 18px;
  border: 2px solid var(--cobalt); border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }
kbd {
  font-family: var(--font-mono); font-size: .78em; line-height: 1;
  padding: 3px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; background: var(--surface); color: var(--muted-ink);
}

/* ---- eyebrow / section headings ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  color: var(--cobalt); font-family: var(--font-sans); font-size: .72rem;
  font-weight: 800; letter-spacing: .19em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.eyebrow svg { width: 15px; height: 15px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding-inline: 24px; border-radius: var(--radius);
  font: 700 1rem/1 var(--font-sans); cursor: pointer; border: 1.5px solid transparent;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--cobalt); color: #fff; box-shadow: var(--hard); }
.btn-primary:hover { background: var(--cobalt-dark); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-outline { border-color: var(--line-strong); background: transparent; color: inherit; }
.btn-outline:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-soft); }
.light-outline { margin-top: 20px; border-color: rgba(255, 255, 255, .55); color: #fff; background: transparent; }
.light-outline:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .1); }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink-soft); font: 600 .84rem/1 var(--font-sans); cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ghost-btn:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-soft); }
.ghost-btn.icon-only { width: 40px; padding: 0; justify-content: center; }
.ghost-btn svg { width: 18px; height: 18px; }
.theme-toggle { position: relative; }
.theme-toggle .theme-icon {
  position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  opacity: 0; transform: scale(.4) rotate(-70deg);
  transition: opacity .2s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
html:not([data-theme]) .theme-toggle .icon-auto,
html[data-theme="light"] .theme-toggle .icon-sun,
html[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1; transform: scale(1) rotate(0deg);
}
.search-open-face { display: inline-flex; align-items: center; gap: 8px; }
.search-kbd { margin-left: 2px; }

/* ---- reading progress + back to top ---- */
.reading-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--orange); transition: width .1s linear; }
body:not(.page-doc):not(.page-toolkit):not(.page-ptable):not(.page-reference) .reading-progress { display: none; }
.back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--cobalt); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; box-shadow: var(--shadow-md);
}
.back-to-top svg { width: 20px; height: 20px; transform: rotate(-90deg); }
.back-to-top[hidden] { display: none; }

/* ---- term bar + header ---- */
.term-bar { background: var(--lime); color: var(--lime-ink); font-size: .73rem; letter-spacing: .05em; }
.term-bar .site-container { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.term-bar span { font-weight: 800; letter-spacing: .18em; }
.term-bar p { margin: 0; }

.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--paper-bright) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.header-row { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; flex: none; }
.brand-mark svg { width: 23px; height: 23px; }
.brand-word strong, .brand-word small { display: block; }
.brand-word strong { font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; line-height: 1; letter-spacing: -.02em; }
.brand-word small { margin-top: 3px; color: var(--muted-ink); font-size: .72rem; text-transform: uppercase; letter-spacing: .17em; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }
.nav-toggle-close { display: none; }

.course-nav { border-top: 1px solid var(--line); }
.nav-menu { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-menu::-webkit-scrollbar { display: none; }
.nav-menu a { padding: 13px 14px 11px; white-space: nowrap; border-bottom: 3px solid transparent; color: var(--ink-soft); font-size: .84rem; font-weight: 600; }
.nav-menu a:hover, .nav-menu a:focus-visible { color: var(--cobalt); border-bottom-color: color-mix(in srgb, var(--cobalt) 40%, transparent); outline: none; }
.nav-menu a[aria-current="page"] { color: var(--cobalt); border-bottom-color: var(--cobalt); }
.nav-menu .instructor-link { margin-left: auto; color: var(--cobalt-dark); }

/* ---- command palette ---- */
.cmdk { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding: clamp(48px, 12vh, 140px) 16px 16px; }
.cmdk[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(9, 14, 22, .55); backdrop-filter: blur(3px); }
.cmdk-panel { position: relative; width: min(620px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input-row > svg { width: 20px; height: 20px; color: var(--muted-ink); flex: none; }
.cmdk-input-row input { flex: 1; border: 0; background: transparent; color: var(--ink); font: 500 1.05rem/1.3 var(--font-sans); outline: none; }
.cmdk-esc { flex: none; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted-ink); border-radius: 6px; font: 600 .74rem/1 var(--font-sans); padding: 5px 8px; cursor: pointer; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: min(52vh, 460px); overflow-y: auto; }
.cmdk-item { display: flex; align-items: baseline; gap: 10px; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.cmdk-item[aria-selected="true"] { background: var(--cobalt-soft); }
.cmdk-item .kind { flex: none; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); border: 1px solid var(--line-strong); border-radius: 5px; padding: 2px 6px; }
.cmdk-item .body { min-width: 0; }
.cmdk-item .title { font-weight: 600; }
.cmdk-item .sub { display: block; color: var(--muted-ink); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item mark { background: color-mix(in srgb, var(--lime) 55%, transparent); color: inherit; padding: 0 1px; border-radius: 2px; }
.cmdk-empty { margin: 0; padding: 26px 20px; text-align: center; color: var(--muted-ink); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .74rem; color: var(--muted-ink); }
.cmdk-foot kbd { margin-right: 2px; }

/* ---- hero ---- */
.hero-section { position: relative; overflow: hidden; background: var(--paper); border-bottom: 1px solid var(--line); }
.hero-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(1px 1px at 20% 30%, var(--line-strong) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 60%, var(--line-strong) 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 85%, var(--line-strong) 50%, transparent 51%);
  background-size: 120px 120px, 180px 180px, 150px 150px;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; padding-block: clamp(56px, 9vw, 96px); }
.hero-copy h1 { margin: 0; font-size: clamp(2.7rem, 5.6vw, 5.4rem); line-height: 1.0; letter-spacing: -.03em; font-weight: 500; }
.hero-lede { max-width: 46ch; margin: 26px 0 0; color: var(--ink-soft); font-size: 1.16rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 44px 0 0; padding: 0; }
.hero-facts div { padding-left: 13px; border-left: 3px solid var(--orange); }
.hero-facts dt { color: var(--muted-ink); font-size: .66rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.hero-facts dd { margin: 4px 0 0; font-weight: 700; font-size: 1.02rem; }

.hero-visual { display: grid; place-items: center; }
.hero-atom { width: min(100%, 420px); aspect-ratio: 1; color: var(--cobalt); }
.hero-atom .nucleus { fill: var(--orange); }
.hero-atom .orbit { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .38; }
.hero-atom .electron { fill: var(--cobalt); }
.hero-atom .ring { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 5; opacity: .7; }
.hero-atom .e-orbit-1, .hero-atom .e-orbit-2, .hero-atom .e-orbit-3, .hero-atom .nucleus {
  transform-origin: 210px 210px; animation: atom-settle .8s cubic-bezier(.16,1,.3,1) both;
}
.hero-atom .e-orbit-1 { animation-delay: .05s; }
.hero-atom .e-orbit-2 { animation-delay: .14s; }
.hero-atom .e-orbit-3 { animation-delay: .23s; }
.hero-atom .nucleus { animation-delay: .32s; }
@keyframes atom-settle { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
.hero-visual figcaption { margin-top: 14px; text-align: center; color: var(--muted-ink); font-size: .82rem; max-width: 34ch; }
.hero-visual figcaption b { color: var(--ink); font-weight: 700; }

/* ---- generic sections ---- */
.section-block { padding-block: clamp(64px, 9vw, 104px); }
.section-tight { padding-block: clamp(48px, 6vw, 72px); }
.section-heading { max-width: 46ch; margin-bottom: 44px; }
.section-heading h2, .outcome-grid h2, .worked-panel h2 {
  margin: 0; font-size: clamp(2rem, 3.8vw, 3.6rem); line-height: 1.06; letter-spacing: -.028em; font-weight: 500;
}
.section-heading > p:not(.eyebrow), .split-heading > p { color: var(--muted-ink); font-size: 1.04rem; line-height: 1.65; }
.split-heading { max-width: none; display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px 64px; align-items: end; }
.split-heading > p { align-self: center; }

.thinking-section { background: var(--navy); color: var(--navy-text); }
.thinking-section .eyebrow { color: var(--lime); }
.thinking-section .split-heading > p { color: var(--navy-soft); }
.thinking-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--navy-line); border-left: 1px solid var(--navy-line); }
.thinking-grid article { min-height: 240px; padding: 30px; border-right: 1px solid var(--navy-line); border-bottom: 1px solid var(--navy-line); }
.thinking-grid article > span { color: var(--lime); font-size: .78rem; font-weight: 800; letter-spacing: .13em; font-family: var(--font-sans); }
.thinking-grid h3 { margin: 44px 0 12px; font-size: 1.5rem; font-weight: 500; }
.thinking-grid p { margin: 0; color: var(--navy-soft); line-height: 1.62; }

.course-map-section { background: var(--surface); }
.module-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.module-tile { min-height: 152px; display: grid; grid-template-columns: 1fr auto; align-content: space-between; gap: 10px; padding: 20px; background: var(--paper-bright); transition: background .16s ease, color .16s ease; }
.module-tile span { color: var(--cobalt); font-weight: 800; font-family: var(--font-mono); font-size: .82rem; }
.module-tile strong { grid-column: 1 / -1; align-self: end; line-height: 1.28; font-weight: 600; }
.module-tile svg { width: 17px; transition: transform .2s ease; opacity: .5; }
.module-tile:hover { background: var(--cobalt); color: #fff; }
.module-tile:hover span { color: #fff; }
.module-tile:hover svg { transform: translateX(4px); opacity: 1; }

/* ---- worked example ---- */
.worked-section { background: var(--paper); border-block: 1px solid var(--line); }
.worked-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px 64px; align-items: start; }
.worked-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-sm); }
.worked-prompt { margin: 0 0 22px; font-size: 1.12rem; line-height: 1.6; color: var(--ink); }
.worked-prompt b { background: var(--cobalt-soft); box-shadow: 0 0 0 4px var(--cobalt-soft); border-radius: 2px; }
.worked-steps { display: grid; gap: 14px; }
.worked-step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.worked-step .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font: 800 .9rem/1 var(--font-sans); }
.worked-step p { margin: 0 0 6px; }
.worked-step code, .worked-answer code { font-family: var(--font-mono); font-size: .92em; background: var(--code-bg); color: var(--code-ink); padding: 2px 6px; border-radius: 4px; }
.worked-answer { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 1.05rem; }
.worked-answer strong { color: var(--cobalt); }
.worked-aside ul { list-style: none; margin: 18px 0 0; padding: 0; }
.worked-aside li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.worked-aside li span:first-child { font-family: var(--font-mono); font-weight: 700; color: var(--orange); font-size: .8rem; letter-spacing: .04em; padding-top: 2px; }

/* ---- typical week ---- */
.week-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.week-day { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 18px; background: var(--surface); }
.week-day h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.week-day .kind { font-family: var(--font-sans); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cobalt); }
.week-day p { margin: 10px 0 0; color: var(--muted-ink); font-size: .9rem; line-height: 1.55; }

/* ---- resource cards ---- */
.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.resource-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.resource-card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  min-height: 190px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.resource-card::after { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 3px; background: var(--cobalt); border-radius: 0 3px 3px 0; opacity: 0; transition: opacity .2s ease; }
.resource-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.resource-card:hover::after { opacity: 1; }
.resource-card small { color: var(--orange); font-family: var(--font-sans); font-weight: 800; letter-spacing: .11em; text-transform: uppercase; font-size: .7rem; }
.resource-card h3 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 500; }
.resource-card p { margin: 0; color: var(--muted-ink); line-height: 1.58; font-size: .96rem; }
.resource-card .card-arrow, .resource-card > svg:last-child { width: 20px; height: 20px; margin-top: auto; align-self: flex-start; color: var(--cobalt); }

.outcome-section { background: var(--cobalt); color: #fff; }
.outcome-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px 88px; align-items: start; }
.outcome-grid .eyebrow { color: var(--lime); }
.outcome-grid .eyebrow::before { background: var(--lime); }
.outcome-grid > div > p:not(.eyebrow) { color: #dde7fb; line-height: 1.68; }
.outcome-grid ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .3); }
.outcome-grid li { position: relative; padding: 22px 0 22px 34px; border-bottom: 1px solid rgba(255, 255, 255, .3); font-size: 1.04rem; line-height: 1.5; }
.outcome-grid li::before { content: ""; position: absolute; left: 0; top: 27px; width: 16px; height: 2px; background: var(--lime); }

.safety-band { padding-block: 24px; background: var(--orange-soft); border-block: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); color: var(--ink-soft); }
.safety-content { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center; }
.safety-content strong { color: var(--orange); }
.safety-content p { margin: 4px 0 0; font-size: .95rem; }
.safety-content a { display: inline-flex; align-items: center; gap: 8px; color: var(--orange); font-weight: 700; }
.safety-content a svg { width: 16px; }

/* ---- footer ---- */
.site-footer { padding: 64px 0 26px; background: var(--navy); color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 44px; }
.footer-brand { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.footer-atom svg { width: 30px; height: 30px; }
.footer-brand strong { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.footer-brand p { max-width: 30ch; color: var(--navy-soft); line-height: 1.5; margin: 6px 0 0; font-size: .92rem; }
.footer-cta a { display: inline-flex; align-items: center; gap: 7px; color: var(--lime); font-weight: 700; font-size: .88rem; }
.footer-cta svg { width: 15px; }
.footer-grid > div:not(.footer-brand) { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.footer-grid > div:not(.footer-brand) strong { margin-bottom: 6px; color: var(--lime); font-family: var(--font-sans); font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; }
.footer-grid a { color: #c7cfdb; font-size: .89rem; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 30px; margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--navy-line); color: #8290a4; font-size: .77rem; }

/* ---- document pages ---- */
.document-page { background: var(--paper); }
.document-hero { padding: 56px 0 60px; background: var(--navy); color: #fff; border-bottom: 5px solid var(--cobalt); }
.accent-orange .document-hero { border-bottom-color: var(--orange); }
.accent-lime .document-hero { border-bottom-color: var(--lime); }
.document-hero h1 { max-width: 20ch; margin: 0; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: 1.0; letter-spacing: -.032em; font-weight: 500; }
.document-lede { max-width: 62ch; margin: 20px 0 0; color: var(--navy-soft); font-size: 1.06rem; line-height: 1.6; }
.document-meta { margin: 14px 0 0; color: #8fa0b8; font-size: .8rem; font-family: var(--font-sans); letter-spacing: .02em; }
.document-hero .eyebrow { color: var(--lime); }
.document-hero .eyebrow::before { background: var(--lime); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; margin-bottom: 34px; color: #94a2b8; font-size: .78rem; }
.breadcrumbs a:hover { color: #fff; text-decoration: underline; }

.document-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 52px; padding-block: 48px 92px; align-items: start; }
.document-layout.no-toc { grid-template-columns: minmax(0, 1fr); max-width: 880px; }
.document-toc { position: sticky; top: 138px; max-height: calc(100vh - 168px); overflow-y: auto; border-top: 3px solid var(--cobalt); border-bottom: 1px solid var(--line); padding: 4px 0 14px; }
.accent-orange .document-toc { border-top-color: var(--orange); }
.accent-lime .document-toc { border-top-color: var(--lime); }
.document-toc > summary { list-style: none; cursor: default; padding: 16px 0 12px; font-family: var(--font-sans); font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted-ink); font-weight: 700; }
.document-toc > summary::-webkit-details-marker { display: none; }
.document-toc nav { display: flex; flex-direction: column; }
.document-toc a { padding: 7px 12px 7px 10px; color: var(--muted-ink); font-size: .82rem; line-height: 1.36; border-left: 2px solid transparent; }
.document-toc a:hover { color: var(--cobalt); }
.document-toc a.is-active { color: var(--cobalt); border-left-color: var(--cobalt); font-weight: 600; background: var(--cobalt-soft); border-radius: 0 4px 4px 0; }

.markdown-surface { min-width: 0; padding: 40px clamp(22px, 5vw, 66px) 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.markdown-surface > h1:first-child { display: none; }
.markdown-surface h2, .markdown-surface h3, .markdown-surface h4 { scroll-margin-top: 150px; position: relative; }
.markdown-surface h2 { margin: 58px 0 18px; padding-top: 20px; border-top: 1px solid var(--line); font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.12; font-weight: 500; }
.markdown-surface h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.markdown-surface h3 { margin: 38px 0 12px; font-size: 1.28rem; font-weight: 600; color: var(--ink); }
.markdown-surface h4 { margin: 28px 0 10px; font-size: 1.06rem; font-weight: 700; font-family: var(--font-sans); }
.markdown-surface p { margin: 0 0 18px; color: var(--ink-soft); line-height: 1.78; }
.markdown-surface ul, .markdown-surface ol { margin: 0 0 22px; padding-left: 24px; color: var(--ink-soft); }
.markdown-surface li { margin: 7px 0; padding-left: 4px; line-height: 1.7; }
.markdown-surface li::marker { color: var(--cobalt); }
.markdown-surface li > ul, .markdown-surface li > ol { margin: 7px 0 4px; }
.markdown-surface strong { color: var(--ink); font-weight: 700; }
.markdown-surface a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.markdown-surface a:hover { text-decoration-thickness: 2px; }
.external-mark { display: inline-block; margin-left: 3px; font-size: .72em; text-decoration: none; }
.markdown-surface code { padding: 2px 6px; border-radius: 4px; background: var(--code-bg); color: var(--code-ink); font-size: .89em; font-family: var(--font-mono); }
.markdown-surface pre { overflow-x: auto; margin: 0 0 22px; padding: 20px; background: var(--navy); color: #e9edf4; border-radius: var(--radius); }
.markdown-surface pre code { padding: 0; background: transparent; color: inherit; }
.markdown-surface blockquote { margin: 26px 0; padding: 18px 22px; border-left: 4px solid var(--orange); background: var(--orange-soft); color: var(--ink-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.markdown-surface blockquote p:last-child { margin-bottom: 0; }
.markdown-surface hr { margin: 46px 0; border: 0; height: 1px; background: linear-gradient(to right, var(--line-strong), transparent); }
.table-wrap { overflow-x: auto; margin: 24px 0 28px; border: 1px solid var(--line); border-radius: var(--radius); }
.markdown-surface table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.markdown-surface th { background: var(--navy); color: #fff; text-align: left; font-weight: 600; font-family: var(--font-sans); }
.markdown-surface th, .markdown-surface td { min-width: 120px; padding: 11px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.markdown-surface tbody tr:nth-child(even) { background: var(--surface-2); }
.markdown-surface tbody tr:last-child td { border-bottom: 0; }

.heading-anchor {
  position: absolute; left: -1.05em; top: .12em; padding: 0 .22em; color: var(--line-strong);
  opacity: 0; text-decoration: none; font-weight: 400; cursor: pointer; background: none; border: 0; font-size: .8em;
  transition: opacity .12s ease, color .12s ease;
}
.markdown-surface h2:hover .heading-anchor, .markdown-surface h3:hover .heading-anchor, .heading-anchor:focus-visible { opacity: 1; color: var(--cobalt); }
@media (max-width: 900px) { .heading-anchor { display: none; } }

.document-related { margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); }
.document-related strong { display: block; margin-bottom: 12px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-ink); font-family: var(--font-sans); }
.document-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.document-related a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 600; font-size: .88rem; }
.document-related a:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-soft); }
.document-related a svg { width: 14px; }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.doc-pager a { display: flex; flex-direction: column; gap: 5px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.doc-pager a:hover { border-color: var(--cobalt); background: var(--cobalt-soft); transform: translateY(-2px); }
.doc-pager .doc-pager-next { text-align: right; align-items: flex-end; }
.doc-pager-dir { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink); }
.doc-pager-dir svg { width: 13px; }
.doc-pager-prev .doc-pager-dir svg { transform: rotate(180deg); }
.doc-pager-label { font-weight: 600; color: var(--ink); }
.doc-pager .is-empty { display: none; }
@media (min-width: 641px) { .doc-pager .is-empty { display: block; } }

/* ---- glossary ---- */
.glossary-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.glossary-search { flex: 1 1 260px; }
.glossary-search input { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; }
.glossary-jump { display: flex; flex-wrap: wrap; gap: 3px; }
.glossary-jump a { padding: 5px 9px; font-weight: 700; font-size: .82rem; color: var(--cobalt); border: 1px solid var(--line); border-radius: 4px; }
.glossary-jump a:hover { background: var(--cobalt); color: #fff; }
.glossary-list { margin: 0; }
.glossary-letter { margin: 30px 0 6px; font-family: var(--font-display); font-size: 1.5rem; color: var(--orange); font-weight: 600; scroll-margin-top: 140px; }
.glossary-entry { padding: 13px 0; border-top: 1px solid var(--line); scroll-margin-top: 140px; }
.glossary-entry dt { font-weight: 700; color: var(--ink); }
.glossary-entry dd { margin: 4px 0 0; color: var(--muted-ink); line-height: 1.6; }
.glossary-entry.is-hit dt { color: var(--cobalt); }
.glossary-empty { color: var(--muted-ink); font-style: italic; }

/* ---- toolkit ---- */
.tool-page, .reference-page { background: var(--paper); }
.tool-grid { display: grid; gap: 20px; padding-block: 44px 88px; max-width: 860px; }
.tool-intro { margin: 0 0 4px; color: var(--muted-ink); }
.tool-noscript { padding: 16px; border: 1px solid var(--orange); background: var(--orange-soft); border-radius: var(--radius); }
.tool-card { padding: 26px clamp(20px, 4vw, 34px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.tool-card header h2 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 500; }
.tool-card header p { margin: 0 0 18px; color: var(--muted-ink); font-size: .92rem; line-height: 1.55; }
.tool-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.tool-form.grid-3 { display: grid; grid-template-columns: 1fr 1fr auto; }
.tool-form.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.tool-form label { display: flex; flex-direction: column; gap: 5px; font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-ink); flex: 1 1 140px; }
.tool-form input, .tool-form select, .tool-form textarea { padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper-bright); color: var(--ink); font: 500 1rem/1.4 var(--font-sans); text-transform: none; letter-spacing: normal; }
.tool-form textarea { resize: vertical; min-height: 74px; font-family: var(--font-mono); }
.tool-form .btn { flex: 0 0 auto; text-transform: none; letter-spacing: normal; }
.tool-form.grid-4 .btn, .tool-form.grid-3 .btn { grid-column: 1 / -1; justify-self: start; }
.tool-output { display: block; margin-top: 18px; }
.tool-output:empty { display: none; }
.tool-output .result-headline { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 10px; font-weight: 500; }
.tool-output .result-headline b { color: var(--cobalt); }
.tool-output table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.tool-output th, .tool-output td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tool-output .muted { color: var(--muted-ink); font-size: .88rem; line-height: 1.6; }
.tool-output .steps { margin: 10px 0 0; padding: 12px 14px; background: var(--code-bg); border-radius: var(--radius); font-family: var(--font-mono); font-size: .85rem; color: var(--code-ink); overflow-x: auto; white-space: pre-wrap; }
.tool-output.is-error { color: var(--orange); font-weight: 600; }

/* ---- quick reference page ---- */
.reference-wrap { padding-block: 44px 90px; display: grid; gap: 26px; }
.ref-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow-sm); scroll-margin-top: 140px; }
.ref-card > h2 { margin: 0 0 6px; font-size: 1.55rem; font-weight: 500; }
.ref-card > p { margin: 0 0 18px; color: var(--muted-ink); font-size: .93rem; }
.ref-card h3 { margin: 22px 0 10px; font-size: 1rem; font-weight: 700; font-family: var(--font-sans); color: var(--ink); }
.ref-card ul { margin: 0 0 6px; padding-left: 22px; color: var(--ink-soft); }
.ref-card li { margin: 5px 0; line-height: 1.6; }
.ref-card code { font-family: var(--font-mono); font-size: .86em; background: var(--code-bg); color: var(--code-ink); padding: 1px 5px; border-radius: 3px; }
.ref-activity { list-style: none; padding: 0; }
.ref-activity li { margin: 2px 0; }
.ref-activity code { font-size: .92rem; letter-spacing: .06em; background: none; padding: 0; color: var(--ink); font-weight: 700; }
.ref-activity li.muted { color: var(--muted-ink); font-size: .84rem; margin-bottom: 8px; }
.ref-constants { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ref-constants li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.ref-constants li:first-child { border-top: 0; }
.ref-constants .val { font-family: var(--font-mono); font-size: .88rem; color: var(--ink); }
.copy-btn { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted-ink); border-radius: 6px; font: 700 .68rem/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; cursor: pointer; }
.copy-btn:hover { border-color: var(--cobalt); color: var(--cobalt); }
.copy-btn.is-done { color: var(--ok); border-color: var(--ok); }
.ref-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.ref-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ref-table th { background: var(--navy); color: #fff; text-align: left; font-family: var(--font-sans); font-weight: 600; font-size: .78rem; letter-spacing: .04em; }
.ref-table th, .ref-table td { padding: 9px 13px; border-bottom: 1px solid var(--line); }
.ref-table tbody tr:nth-child(even) { background: var(--surface-2); }
.ref-table code { font-family: var(--font-mono); background: var(--code-bg); color: var(--code-ink); padding: 1px 5px; border-radius: 3px; }
.ref-cols { columns: 2 220px; column-gap: 34px; }
.ref-cols li { break-inside: avoid; margin-bottom: 6px; }
.ref-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.ref-nav a { padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .83rem; font-weight: 600; }
.ref-nav a:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-soft); }

/* ---- periodic table ---- */
.ptable-page { background: var(--paper); }
.ptable-wrap { padding-block: 38px 88px; }
.ptable-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ptable-search { flex: 1 1 280px; }
.ptable-search input { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; }
.ptable-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: inherit; font: 600 .74rem/1 var(--font-sans); cursor: pointer; }
.legend-item:hover { border-color: var(--cobalt); }
.legend-item[aria-pressed="true"] { background: var(--ink); color: var(--paper-bright); border-color: var(--ink); }
.legend-item .swatch { width: 12px; height: 12px; border-radius: 3px; }
.legend-clear { color: var(--muted-ink); }

.ptable-scroll { overflow-x: auto; padding-bottom: 8px; }
.ptable-grid { display: grid; grid-template-columns: repeat(18, minmax(46px, 1fr)); grid-auto-rows: 1fr; gap: 4px; min-width: 920px; }
.pt-cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 5px 6px; min-height: 58px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: left;
  transition: transform .1s ease, box-shadow .1s ease, opacity .12s ease;
}
.pt-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); z-index: 2; }
.pt-cell.is-dim { opacity: .2; }
.pt-cell.is-selected { outline: 3px solid var(--ink); outline-offset: 1px; z-index: 3; }
.pt-cell.is-hit { outline: 3px solid var(--orange); outline-offset: 1px; }
.pt-z { font-family: var(--font-mono); font-size: .58rem; font-weight: 600; color: var(--muted-ink); }
.pt-sym { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; line-height: 1.1; }
.pt-name, .pt-mass { font-size: .52rem; line-height: 1.15; color: var(--muted-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pt-marker { align-items: center; justify-content: center; background: transparent; border-style: dashed; color: var(--muted-ink); font-size: .68rem; cursor: default; }
.pt-marker:hover { transform: none; box-shadow: none; }

.pt-cell.cat-alkali { background: color-mix(in srgb, #e15c25 18%, var(--surface)); }
.pt-cell.cat-alkaline { background: color-mix(in srgb, #eaa32b 20%, var(--surface)); }
.pt-cell.cat-transition { background: color-mix(in srgb, #1450d4 14%, var(--surface)); }
.pt-cell.cat-post-transition { background: color-mix(in srgb, #47a1d9 18%, var(--surface)); }
.pt-cell.cat-metalloid { background: color-mix(in srgb, #14a08f 20%, var(--surface)); }
.pt-cell.cat-nonmetal { background: color-mix(in srgb, #6fb83f 22%, var(--surface)); }
.pt-cell.cat-halogen { background: color-mix(in srgb, #cbdb2f 34%, var(--surface)); }
.pt-cell.cat-noble { background: color-mix(in srgb, #9463d9 20%, var(--surface)); }
.pt-cell.cat-lanthanide { background: color-mix(in srgb, #d94a8f 18%, var(--surface)); }
.pt-cell.cat-actinide { background: color-mix(in srgb, #d9564a 20%, var(--surface)); }
.pt-cell.cat-unknown { background: color-mix(in srgb, #869 20%, var(--surface)); }
.swatch.cat-alkali { background: #e15c25; }
.swatch.cat-alkaline { background: #eaa32b; }
.swatch.cat-transition { background: #1450d4; }
.swatch.cat-post-transition { background: #47a1d9; }
.swatch.cat-metalloid { background: #14a08f; }
.swatch.cat-nonmetal { background: #6fb83f; }
.swatch.cat-halogen { background: #b8c72c; }
.swatch.cat-noble { background: #9463d9; }
.swatch.cat-lanthanide { background: #d94a8f; }
.swatch.cat-actinide { background: #d9564a; }
.swatch.cat-unknown { background: #808a9c; }

.pt-trends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 0; }
.pt-trend { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); font-size: .84rem; }
.pt-trend b { display: block; margin-bottom: 3px; font-family: var(--font-sans); }
.pt-trend span { color: var(--muted-ink); }

.pt-detail { margin-top: 24px; padding: 24px clamp(20px, 4vw, 32px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); min-height: 120px; scroll-margin: 24px; }
.pt-detail.is-flash { animation: ptDetailFlash 1.4s ease; }
@keyframes ptDetailFlash { 0%, 100% { background: var(--surface); box-shadow: var(--shadow-sm); } 15% { background: color-mix(in srgb, var(--lime) 40%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 35%, transparent); } }
.pt-detail-hint { margin: 0; color: var(--muted-ink); }
.pt-detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 26px; align-items: start; }
.pt-shell { width: 140px; height: 140px; }
.pt-shell circle.orb { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.pt-shell circle.nuc { fill: var(--orange); }
.pt-shell circle.el { fill: var(--cobalt); }
.pt-shell text { fill: var(--muted-ink); font: 700 8px var(--font-sans); }
.pt-detail-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 6px; }
.pt-detail-head .sym { font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; line-height: 1; }
.pt-detail-head .name { font-size: 1.35rem; font-weight: 600; }
.pt-detail-head .z { color: var(--muted-ink); font-weight: 600; font-family: var(--font-mono); }
.pt-detail .cat-tag { display: inline-block; margin-bottom: 14px; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--ink); color: var(--paper-bright); font-family: var(--font-sans); }
.pt-detail dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 0 0 14px; }
.pt-detail dt { font-family: var(--font-sans); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
.pt-detail dd { margin: 2px 0 0; font-weight: 600; }
.pt-detail .note { margin: 0; color: var(--ink-soft); line-height: 1.6; }

/* ---- 404 ---- */
.notfound { padding-block: 90px 116px; background: var(--paper); }
.notfound h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1.04; margin: 0 0 16px; max-width: 15ch; font-weight: 500; }
.notfound p { max-width: 56ch; color: var(--muted-ink); font-size: 1.08rem; line-height: 1.7; }
.notfound-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.notfound-nav a { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .84rem; font-weight: 600; }
.notfound-nav a:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-soft); }

/* ---- term tooltips ---- */
.term {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help;
  border-bottom: 1.5px dotted color-mix(in srgb, var(--cobalt) 55%, transparent);
  text-underline-offset: 2px;
}
.term:hover, .term:focus-visible { color: var(--cobalt); border-bottom-color: var(--cobalt); outline: none; }
abbr.acr {
  font: inherit; text-decoration: none; cursor: help;
  border-bottom: 1.5px dotted color-mix(in srgb, var(--orange) 60%, transparent);
}
abbr.acr:hover, abbr.acr:focus-visible { color: var(--orange); border-bottom-color: var(--orange); outline: none; }
.term-pop {
  position: absolute; z-index: 250; width: min(320px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 7px;
  padding: 13px 15px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: .88rem; line-height: 1.5;
}
.term-pop .tp-short { color: var(--ink-soft); }
.term-pop .tp-more { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 1px; }
.term-pop .tp-more p { margin: 0 0 6px; color: var(--ink-soft); }
.term-pop .tp-ex { color: var(--muted-ink); font-size: .84rem; }
.term-pop .tp-ex b { color: var(--orange); font-weight: 700; }
.term-pop .tp-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.term-pop .tp-toggle {
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted-ink);
  border-radius: 6px; font: 700 .7rem/1 var(--font-sans); letter-spacing: .04em;
  text-transform: uppercase; padding: 5px 9px; cursor: pointer;
}
.term-pop .tp-toggle:hover { border-color: var(--cobalt); color: var(--cobalt); }
.term-pop::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px;
  margin-left: -5px; background: var(--surface); border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong); transform: rotate(45deg);
}
.term-pop.is-below::after { bottom: auto; top: -6px; transform: rotate(225deg); }
.term-pop strong { font-family: var(--font-sans); font-weight: 700; }
.term-pop a { color: var(--link); font-weight: 600; font-size: .82rem; align-self: flex-start; }

/* ---- keyboard-shortcut help ---- */
.kbd-help { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kbd-help[hidden] { display: none; }
.kbd-help-panel { position: relative; width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px 24px; }
.kbd-help-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kbd-help-head strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.kbd-help dl { display: grid; gap: 12px; margin: 0; }
.kbd-help dl > div { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 16px; align-items: baseline; }
.kbd-help dt { display: flex; flex-wrap: wrap; gap: 4px; }
.kbd-help dd { margin: 0; color: var(--muted-ink); font-size: .9rem; }

/* ---- glossary extras ---- */
.glossary-tools { display: flex; gap: 8px; }
.glossary-note { margin: 0 0 20px; color: var(--muted-ink); font-size: .88rem; }
.glossary-entry dd p { margin: 0 0 8px; }
.glossary-entry.is-expanded dt { font-size: 1.02rem; }
.glossary-example { color: var(--ink-soft); font-size: .92rem; }
.glossary-example span { font-weight: 700; color: var(--orange); font-style: normal; margin-right: 4px; }
.glossary-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px !important; font-size: .82rem; color: var(--muted-ink); }
.glossary-links a { color: var(--link); text-decoration: none; margin: 0 3px; }
.glossary-links a:hover { text-decoration: underline; }
.glossary-see, .glossary-in { display: inline-block; }
.glossary-entry.is-flash { animation: glossFlash 1.4s ease; }
@keyframes glossFlash { 0%, 100% { background: transparent; } 15% { background: color-mix(in srgb, var(--lime) 40%, transparent); } }

/* ---- toolkit "how it works" ---- */
.tool-how { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.tool-how > summary { cursor: pointer; font-family: var(--font-sans); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cobalt); list-style: none; }
.tool-how > summary::-webkit-details-marker { display: none; }
.tool-how > summary::before { content: "+ "; }
.tool-how[open] > summary::before { content: "– "; }
.tool-how p { margin: 12px 0 0; color: var(--muted-ink); font-size: .9rem; line-height: 1.65; }
.tool-how a { color: var(--link); }

/* ---- placement quiz ---- */
.placement-card { padding: 22px clamp(18px, 3.5vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.placement-q { margin: 0 0 12px; font: 600 1.02rem/1.5 var(--font-sans); }
.placement-options { display: grid; gap: 8px; margin: 0; padding: 0; }
.placement-option { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font: 500 .95rem/1.4 var(--font-sans); transition: border-color .15s ease, background .15s ease; }
.placement-option:hover { border-color: var(--cobalt); background: var(--cobalt-soft); }
.placement-option input { accent-color: var(--cobalt); flex: none; }
.placement-result { margin-top: 22px; padding: 20px clamp(18px, 3.5vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.placement-result:empty { display: none; }
.placement-result .result-headline { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 10px; font-weight: 500; }
.placement-result .result-headline b { color: var(--cobalt); }
.placement-result .muted { color: var(--muted-ink); font-size: .92rem; line-height: 1.6; margin: 0; }
.placement-result.is-error .muted { color: var(--orange); }

/* ---- flashcards & self-check quiz ---- */
.quiz-modes { display: flex; gap: 8px; margin-bottom: 4px; }
.quiz-mode-btn { padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted-ink); font: 700 .85rem/1 var(--font-sans); cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.quiz-mode-btn:hover { border-color: var(--cobalt); color: var(--cobalt); }
.quiz-mode-btn.is-active { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.flashcard { margin: 6px 0 10px; min-height: 180px; padding: clamp(24px, 5vw, 40px); display: flex; align-items: center; justify-content: center; text-align: center; background: var(--paper-bright); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); cursor: pointer; position: relative; user-select: none; }
.flashcard:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.flashcard-side { margin: 0; font-family: var(--font-display); }
.flashcard-term { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 600; }
.flashcard-def { display: none; font-family: var(--font-sans); font-size: 1rem; font-weight: 400; line-height: 1.6; text-align: left; }
.flashcard.is-flipped .flashcard-term { display: none; }
.flashcard.is-flipped .flashcard-def { display: block; }
.flashcard-controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.flashcard-controls .btn, .flashcard-controls .ghost-btn { text-transform: none; letter-spacing: normal; }
#fc-counter, #fc-tally { margin: 2px 0; color: var(--muted-ink); font-size: .88rem; }
.quiz-setup { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-bottom: 16px; }
.quiz-setup label { display: flex; flex-direction: column; gap: 5px; font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-ink); }
.quiz-setup select { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper-bright); color: var(--ink); font: 500 .95rem/1.4 var(--font-sans); }
#quiz-progress, #quiz-score { margin: 2px 0; color: var(--muted-ink); font-size: .88rem; }
.quiz-module-tag { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--cobalt); }
.quiz-q { margin: 0 0 14px; font: 600 1.08rem/1.5 var(--font-sans); }
.quiz-options { display: grid; gap: 8px; }
.quiz-option { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: 500 .95rem/1.4 var(--font-sans); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.quiz-option:hover:not(:disabled) { border-color: var(--cobalt); background: var(--cobalt-soft); }
.quiz-option:disabled { cursor: default; }
.quiz-option.is-correct { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 25%, transparent); font-weight: 700; }
.quiz-option.is-wrong { border-color: var(--orange); background: var(--orange-soft); }
.quiz-feedback { margin-top: 16px; padding: 14px 16px; background: var(--paper-bright); border-radius: var(--radius); font-size: .92rem; line-height: 1.6; }
.quiz-feedback .quiz-right { margin: 0 0 6px; color: var(--cobalt); font-weight: 700; }
.quiz-feedback .quiz-miss { margin: 0 0 6px; color: var(--orange); font-weight: 700; }
.quiz-feedback .btn { margin-top: 10px; text-transform: none; letter-spacing: normal; }
#quiz-stage .result-headline { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 10px; font-weight: 500; }
#quiz-stage .result-headline b { color: var(--cobalt); }

/* ---- lesson "next module" links ---- */
.module-next {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  margin: 30px 0 8px; padding: 14px 0 0; border-top: 1px dashed var(--line-strong);
}
.module-next > span {
  font-family: var(--font-sans); font-size: .68rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink);
}
.module-next a { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--cobalt); }
.module-next a svg { width: 15px; }
.module-next.is-final a { color: var(--orange); }

/* ---- what comes next (Chemistry II) ---- */
.next-section { background: var(--paper); border-block: 1px solid var(--line); }
.soon-tag {
  display: inline-block; margin-left: 10px; padding: 3px 10px; border-radius: 999px;
  background: var(--orange); color: #fff; font-family: var(--font-sans);
  font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  vertical-align: middle;
}
.next-subhead { margin: 40px 0 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.next-topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.next-topics li { display: flex; flex-direction: column; gap: 5px; padding: 20px; background: var(--surface); }
.next-topics strong { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.next-topics span { color: var(--muted-ink); font-size: .9rem; line-height: 1.5; }
.next-note { margin: 22px 0 0; color: var(--muted-ink); font-size: .92rem; max-width: 70ch; }

/* ---- home FAQ ---- */
.faq-section { background: var(--surface); }
.faq-list { display: grid; gap: 0; border-top: 1px solid var(--line); max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; position: absolute; right: 6px; top: 18px; font-size: 1.5rem; color: var(--cobalt); font-family: var(--font-sans); line-height: 1; }
.faq-item[open] > summary::after { content: "–"; }
.faq-item p { margin: 0 0 22px; color: var(--muted-ink); line-height: 1.7; max-width: 68ch; }
.faq-more { margin-top: 22px; color: var(--muted-ink); font-size: .92rem; }

/* ---- periodic table: colour-by + compare ---- */
.pt-colourby-label { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-ink); }
.pt-colourby-label select { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: 600 .84rem/1 var(--font-sans); }
.pt-legend-gradient { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-family: var(--font-mono); font-size: .8rem; color: var(--muted-ink); }
.pt-legend-gradient[hidden] { display: none; }
.pt-legend-gradient .bar { flex: 1; max-width: 320px; height: 12px; border-radius: 6px; border: 1px solid var(--line); }
.pt-compare { margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); }
.pt-compare[hidden] { display: none; }
.pt-compare > strong { display: block; font-family: var(--font-sans); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink); margin-bottom: 10px; }
.pt-compare-hint { color: var(--muted-ink); font-size: .9rem; }
.pt-compare-body { overflow-x: auto; }
.pt-compare table { border-collapse: collapse; font-size: .84rem; width: 100%; }
.pt-compare th, .pt-compare td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pt-compare thead th { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.pt-compare tbody th { font-family: var(--font-sans); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-ink); font-weight: 700; white-space: nowrap; }
.pt-compare #pt-compare-clear { margin-top: 12px; }
.pt-cell.is-cmp { outline: 3px solid var(--orange); outline-offset: 1px; z-index: 3; }

/* ---- responsive ---- */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-atom { width: min(72%, 300px); }
  .module-grid { grid-template-columns: repeat(3, 1fr); }
  .worked-grid { grid-template-columns: 1fr; }
  .week-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr repeat(2, 1fr); }
  .document-layout { grid-template-columns: 1fr; }
  .document-toc { position: static; max-height: none; border: 1px solid var(--line); border-top-width: 3px; border-radius: var(--radius); padding: 4px 16px 10px; background: var(--surface); }
  .document-toc > summary { cursor: pointer; }
  .document-toc[open] > summary { margin-bottom: 6px; }
  .document-toc nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
  .document-toc a.is-active { background: none; }
  .split-heading { grid-template-columns: 1fr; }
  .outcome-grid { grid-template-columns: 1fr; }
  .pt-trends { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .search-open-face span { display: none; }
  .search-open { width: 40px; padding: 0; justify-content: center; }
  .search-kbd { display: none; }
  .course-nav { border-top: 0; }
  .nav-menu {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw); z-index: 110;
    flex-direction: column; align-items: stretch; gap: 0; overflow-y: auto;
    background: var(--surface); border-left: 1px solid var(--line-strong);
    padding: 84px 14px 28px; transform: translateX(100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .nav-menu { transform: translateX(0); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 105; background: rgba(9, 14, 22, .45); }
  .nav-menu a { padding: 13px 12px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
  .nav-menu a[aria-current="page"] { border-bottom-color: var(--line); border-left-color: var(--cobalt); background: var(--cobalt-soft); }
  .nav-menu .instructor-link { margin-left: 0; }
  body.nav-open .nav-toggle-open { display: none; }
  body.nav-open .nav-toggle-close { display: inline; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  :root { --wrap: min(1180px, calc(100% - 30px)); }
  .term-bar p { display: none; }
  .hero-actions > .btn { width: 100%; }
  .section-block { padding-block: 56px; }
  .thinking-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .week-strip { grid-template-columns: 1fr; }
  .resource-grid, .resource-grid.cols-2 { grid-template-columns: 1fr; }
  .safety-content { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 22px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
  .document-hero { padding: 38px 0 44px; }
  .document-layout { padding-block: 24px 60px; gap: 20px; }
  .document-toc nav { grid-template-columns: 1fr; }
  .markdown-surface { padding: 26px 18px 42px; }
  .doc-pager { grid-template-columns: 1fr; }
  .pt-detail-grid { grid-template-columns: 1fr; }
  .pt-shell { margin: 0 auto; }
  .ref-cols { columns: 1; }
  .worked-step { grid-template-columns: 28px 1fr; gap: 10px; }
  .kbd-help dl > div { grid-template-columns: 1fr; gap: 4px; }
  .ptable-controls { flex-direction: column; align-items: stretch; }
  .faq-item > summary { font-size: 1.06rem; }
  .next-topics { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .hero-atom .e-orbit-1, .hero-atom .e-orbit-2, .hero-atom .e-orbit-3, .hero-atom .nucleus { animation: none; }
}

@media print {
  .term-bar, .site-header, .site-footer, .document-toc, .back-to-top, .reading-progress, .document-related, .doc-pager, .cmdk { display: none !important; }
  .document-hero { padding: 20px 0; background: none; color: #000; border: 0; }
  .document-hero .breadcrumbs, .document-hero .eyebrow, .document-lede, .document-meta { display: none; }
  .document-layout { display: block; padding: 0; }
  .markdown-surface { border: 0; box-shadow: none; padding: 0; background: none; }
  .markdown-surface > h1:first-child { display: block; }
}
