/* ==========================================================================
   Genomics.Study
   Design rule: the page chrome is achromatic. Every colour on this page
   carries meaning — a nucleotide identity or an amino-acid side-chain class.
   Nothing is tinted for decoration.
   ========================================================================== */

:root {
  /* Ground */
  --paper:       #F1F4F6;
  --surface:     #FFFFFF;
  --surface-sunk:#E8EDF0;
  --line:        #DCE3E8;
  --line-firm:   #C2CCD4;

  /* Ink */
  --ink:         #101821;
  --ink-2:       #46565F;
  --ink-3:       #78888F;

  /* The one dark surface: the duplex film */
  --film:        #0A1014;
  --film-raise:  #121C23;
  --film-line:   #22323D;
  --film-ink:    #A9BBC6;
  --film-ink-2:  #6B808D;

  /* Nucleotides */
  --a: #2BB673;  --c: #3B82F6;  --g: #E39B2E;  --t: #E8514E;  --u: #A86BDD;
  --nt-x: #8798A3;

  /* Amino-acid side-chain classes */
  --nonpolar: #8E9AA3;
  --polar:    #14A79E;
  --acidic:   #DC3F58;
  --basic:    #5468E0;
  --stop:     #E8514E;
  --unknown:  #9AA7B0;

  /* Metrics */
  --shell: 1200px;
  --rail: 300px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --cell: 1.62ch;

  --font-display: 'Familjen Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(16, 24, 33, .05);
  --shadow-md: 0 2px 4px rgba(16, 24, 33, .04), 0 8px 24px rgba(16, 24, 33, .06);
  --shadow-film: 0 4px 12px rgba(10, 16, 20, .18), 0 20px 50px rgba(10, 16, 20, .22);
}

/* --------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute must win over any display rule below. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}
.film :focus-visible { outline-color: #7FD8FF; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: var(--r-sm); text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 20px; }

/* Micro-caps utility label — the lab-instrument voice of the page */
.label, .eyebrow, .ad__tag, .segmented__hint, .counter,
.card__unit, .stat__key, .drawer__summary {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ============================================================== AD SLOTS = */
/* Height is reserved up front so ads never shift the layout. */
.ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ad__tag { color: var(--ink-3); font-size: 9px; letter-spacing: .16em; }
.ad__slot {
  width: 100%;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(120,136,143,.05) 9px 10px),
    var(--surface-sunk);
  border: 1px dashed var(--line-firm);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad--leaderboard { padding: 14px 20px 0; }
.ad--leaderboard .ad__slot { max-width: 970px; min-height: 90px; }

.ad--inline { margin: 8px 0; }
.ad--inline .ad__slot { min-height: 250px; max-width: 336px; }

.ad--rail .ad__slot { width: var(--rail); min-height: 600px; }

/* =============================================================== MASTHEAD */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: rgba(241, 244, 246, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 62px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink); text-decoration: none;
}
.wordmark__mark { width: 26px; height: 26px; flex: none; }
.wordmark__text {
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px; letter-spacing: -.035em;
}
.wordmark__text em { font-style: normal; font-weight: 500; color: var(--ink-2); }
.wordmark__text--sm { font-size: 17px; }

.masthead__nav { display: flex; gap: 22px; }
.masthead__nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 4px 0; border-bottom: 1px solid transparent;
}
.masthead__nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* =================================================================== HERO */
.hero { padding: clamp(38px, 7vw, 76px) 0 clamp(26px, 4vw, 40px); }
.eyebrow { color: var(--ink-3); margin-bottom: 18px; }
.hero__title {
  font-size: clamp(38px, 8.2vw, 76px);
  font-weight: 700;
  letter-spacing: -.045em;
  margin-bottom: 20px;
}
.hero__lede {
  max-width: 56ch; color: var(--ink-2);
  font-size: clamp(15px, 1.6vw, 17.5px); line-height: 1.65;
}

/* ================================================================= LAYOUT */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: 40px;
  align-items: start;
  padding-bottom: 72px;
}
.work { display: flex; flex-direction: column; gap: 34px; min-width: 0; }
.rail { position: sticky; top: 86px; }

/* ================================================================== PANEL */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.panel__title { font-size: 19px; }
.panel__actions { display: flex; gap: 8px; }
.panel__body { padding: 22px; display: flex; flex-direction: column; gap: 22px; }

.section-title { font-size: clamp(21px, 3vw, 27px); margin-bottom: 16px; letter-spacing: -.03em; }
.prose { color: var(--ink-2); max-width: 68ch; margin-bottom: 18px; font-size: 15px; }

/* ================================================================ CONTROLS */
.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field--row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.label { display: block; color: var(--ink-3); margin-bottom: 10px; padding: 0; }
.field--row .label { margin-bottom: 0; }
.label__note {
  display: inline-block; margin-left: 8px;
  text-transform: none; letter-spacing: 0; font-size: 12px;
  font-family: var(--font-body); color: var(--ink-3);
}

/* Segmented control — the four input modes */
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.segmented__item input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented__face {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 13px;
  border: 1px solid var(--line-firm);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
  height: 100%;
}
.segmented__face:hover { border-color: var(--ink-3); }
.segmented__name { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.segmented__hint { color: var(--ink-3); font-size: 10px; letter-spacing: .07em; }
.segmented__item input:checked + .segmented__face {
  background: var(--ink); border-color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.segmented__item input:checked + .segmented__face .segmented__name { color: #fff; }
.segmented__item input:checked + .segmented__face .segmented__hint { color: rgba(255,255,255,.6); }
.segmented__item input:focus-visible + .segmented__face { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 5' / 3' end selector */
.ends { display: inline-flex; border: 1px solid var(--line-firm); border-radius: 999px; padding: 3px; gap: 3px; background: var(--surface); }
.ends__item input { position: absolute; opacity: 0; width: 0; height: 0; }
.ends__face {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 15px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  transition: background .14s ease, color .14s ease;
  white-space: nowrap;
}
.ends__face:hover { background: var(--surface-sunk); }
.ends__arrow { color: var(--ink-3); }
.ends__item input:checked + .ends__face { background: var(--ink); color: #fff; }
.ends__item input:checked + .ends__face .ends__arrow { color: rgba(255,255,255,.65); }
.ends__item input:focus-visible + .ends__face { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Chips */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: 6px 13px; cursor: pointer;
  border: 1px solid var(--line-firm); border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
  white-space: nowrap;
}
.chip span:hover { border-color: var(--ink-3); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--line-firm); background: var(--surface);
  color: var(--ink); font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-sunk); border-color: var(--ink-3); }
.btn:active { transform: translateY(.5px); }
.btn--ghost { background: transparent; }
.btn--tight { padding: 5px 11px; font-size: 12.5px; }

/* Editor */
.editor { border: 1px solid var(--line-firm); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.editor:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(16,24,33,.08); }
.editor textarea {
  display: block; width: 100%; border: 0; resize: vertical;
  padding: 14px 15px; background: transparent;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75;
  letter-spacing: .06em; min-height: 120px;
}
.editor textarea:focus { outline: none; }
.editor textarea::placeholder { color: var(--ink-3); letter-spacing: .06em; }
.editor__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px 8px 15px; border-top: 1px solid var(--line);
  background: var(--surface-sunk);
}
.counter { color: var(--ink-3); }

/* Messages */
.messages:empty { display: none; }
.messages { display: flex; flex-direction: column; gap: 8px; }
.msg {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 13px; border-radius: var(--r-sm);
  font-size: 13.5px; line-height: 1.5;
  background: var(--surface-sunk); color: var(--ink-2);
  border-left: 2px solid var(--line-firm);
}
.msg--warn { border-left-color: var(--g); }
.msg--error { border-left-color: var(--t); color: var(--ink); }
.msg b { font-family: var(--font-mono); font-weight: 600; }

/* ================================================= THE FILM (signature) == */
.film {
  background: var(--film);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-film);
  overflow: hidden;
  color: var(--film-ink);
}
.film__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 15px 20px;
  border-bottom: 1px solid var(--film-line);
  background: var(--film-raise);
}
.film__title {
  font-size: 15px; color: #EAF2F7; letter-spacing: .04em;
  font-family: var(--font-mono); font-weight: 500; text-transform: uppercase;
}
.film__controls { display: flex; gap: 18px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12.5px; color: var(--film-ink-2); user-select: none; }
.switch:hover { color: var(--film-ink); }
.switch input { width: 15px; height: 15px; accent-color: #4FA8D8; cursor: pointer; margin: 0; }
.switch input:checked ~ span { color: #EAF2F7; }

.film__stage { padding: 20px; overflow-x: auto; }
.film__empty { color: var(--film-ink-2); font-size: 14px; text-align: center; padding: 34px 10px; }

.film__legend {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--film-line);
  background: var(--film-raise);
}
.film__legend-sep { width: 1px; height: 14px; background: var(--film-line); margin-inline: 4px; }
.key {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px;
  background: rgba(255,255,255,.05);
}
.key--a { color: var(--a); } .key--c { color: var(--c); } .key--g { color: var(--g); }
.key--t { color: var(--t); } .key--u { color: var(--u); } .key--n { color: var(--nt-x); }
.key--nonpolar { color: var(--nonpolar); } .key--polar { color: var(--polar); }
.key--acidic { color: var(--acidic); } .key--basic { color: var(--basic); }
.key--stop { color: var(--stop); }

/* --- duplex grid --- */
.blocks { display: flex; flex-direction: column; gap: 22px; min-width: max-content; }
.block { font-family: var(--font-mono); font-size: 13px; line-height: 1; }

.trow {
  display: grid;
  grid-template-columns: 3.4ch repeat(var(--cols), var(--cell)) 3.4ch;
  align-items: center;
  height: 19px;
}
.trow--rungs { height: 11px; }
.trow--ruler { height: 15px; }
.trow--aa { height: 21px; margin-top: 3px; }
.trow--trna { height: 21px; margin-top: 3px; }
.trow--gap { height: 7px; }

.cap {
  font-size: 10.5px; color: var(--film-ink-2); font-weight: 500;
  letter-spacing: .02em;
}
.cap--l { text-align: left; }
.cap--r { text-align: right; }

.nt { text-align: center; font-weight: 500; }
.nt--A { color: var(--a); } .nt--C { color: var(--c); } .nt--G { color: var(--g); }
.nt--T { color: var(--t); } .nt--U { color: var(--u); }
.nt--x { color: var(--nt-x); }

.rung { text-align: center; color: #3E5261; font-size: 11px; }
.rung--weak { color: #2B3A46; }        /* A:T — two hydrogen bonds */

.tick { font-size: 9.5px; color: #4A5F6D; text-align: center; white-space: nowrap; }
.tick--mark { color: #7A93A3; }

.strandtag {
  grid-column: 1 / -1; font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: #48606F; padding-bottom: 3px;
}

.aabox {
  display: flex; align-items: center; justify-content: center;
  height: 19px; margin: 0 1px; border-radius: 3px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .01em;
  background: rgba(255,255,255,.045);
  border-bottom: 1.5px solid currentColor;
  overflow: hidden;
}
.aabox--nonpolar { color: var(--nonpolar); }
.aabox--polar    { color: var(--polar); }
.aabox--acidic   { color: var(--acidic); }
.aabox--basic    { color: var(--basic); }
.aabox--unknown  { color: var(--unknown); }
.aabox--stop     { color: var(--stop); background: rgba(232,81,78,.12); }
.aabox--start    { box-shadow: inset 0 0 0 1px rgba(43,182,115,.5); }

/* tRNA anticodon boxes — each spans the three bases of the codon it reads */
.trnabox {
  display: inline-flex; align-items: center; justify-content: center;
  height: 19px; margin: 0 1px; border-radius: 3px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .06em;
  background: rgba(255,255,255,.045);
  border-bottom: 1.5px solid rgba(255,255,255,.18);
  overflow: hidden; white-space: nowrap;
}
.trnabox b { font-weight: 500; }
/* direction end-caps of each anticodon box */
.trnabox__end {
  font-size: 7px; font-weight: 500; letter-spacing: 0; color: #5E7686;
  flex: none; margin: 0 2px;
}

.film__more {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--film-line);
  color: var(--film-ink-2); font-size: 12.5px; font-family: var(--font-body);
}

/* ================================================================== CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; min-width: 0;
}
.card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 13px 15px 9px;
}
.card__title { font-size: 15px; font-family: var(--font-display); font-weight: 600; }
.card__unit { color: var(--ink-3); white-space: nowrap; }
.card__ends {
  padding: 0 15px 8px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase;
}
.card__seq {
  margin: 0 15px; padding: 11px 12px;
  background: var(--surface-sunk); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.85;
  letter-spacing: .09em; word-break: break-all;
  max-height: 168px; overflow-y: auto;
  color: var(--ink);
}
/* Three-letter residues wrap between codes, never inside one. */
.card__seq--words { word-break: normal; overflow-wrap: normal; }
.card__seq b { font-weight: 500; }
/* tRNA anticodon cards: dim the arrow between adaptor codons */
.trna-sep { color: var(--ink-3); letter-spacing: 0; }
.seq-A { color: #1E8C55; } .seq-C { color: #1D5FD1; } .seq-G { color: #A9700F; }
.seq-T { color: #C43B38; } .seq-U { color: #8446BC; } .seq-x { color: var(--ink-3); }
.aa-nonpolar { color: #6B7780; } .aa-polar { color: #0C7F78; }
.aa-acidic { color: #B92F45; } .aa-basic { color: #3F4FC0; }
.aa-stop { color: #C43B38; font-weight: 600; } .aa-unknown { color: var(--ink-3); }

.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 15px; margin-top: auto;
}
.card__note { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

/* ================================================================ DRAWERS */
.drawer {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); margin-bottom: 12px; overflow: hidden;
}
.drawer__summary {
  padding: 14px 16px; cursor: pointer; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.drawer__summary::-webkit-details-marker { display: none; }
.drawer__summary::before {
  content: '+'; font-size: 14px; line-height: 1; color: var(--ink-3);
  width: 14px; text-align: center;
}
.drawer[open] > .drawer__summary::before { content: '\2212'; }
.drawer__summary:hover { color: var(--ink); background: var(--surface-sunk); }
.drawer__body { padding: 4px 16px 18px; border-top: 1px solid var(--line); padding-top: 16px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 14px 18px; }
.stat { min-width: 0; }
.stat__key { color: var(--ink-3); display: block; margin-bottom: 3px; }
.stat__val { font-family: var(--font-mono); font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.stat__sub { font-size: 11.5px; color: var(--ink-3); }

.bars { margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: 3.5ch 1fr 13ch; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 12px; }
.bar__track { height: 7px; background: var(--surface-sunk); border-radius: 4px; overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 4px; transition: width .3s ease; }
.bar__num { text-align: right; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

/* Frames / ORFs */
.frame-row {
  display: grid; grid-template-columns: 5.5ch 1fr; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.frame-row:last-child { border-bottom: 0; }
.frame-row__tag { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); padding-top: 2px; }
.frame-row__seq { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; letter-spacing: .07em; word-break: break-all; }

.orf-row {
  display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.orf-row:last-child { border-bottom: 0; }
.orf-row__pos { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.orf-row__len { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.orf-row__seq { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); word-break: break-all; flex: 1 1 220px; min-width: 0; }
.empty-note { color: var(--ink-3); font-size: 13.5px; }

/* =========================================================== CODON TABLE */
.codon-table { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.codon-col { display: flex; flex-direction: column; gap: 4px; }
.codon-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 9px;
  display: flex; flex-direction: column; gap: 2px;
}
.codon-cell {
  display: flex; align-items: baseline; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
}
.codon-cell__codon { letter-spacing: .05em; }
.codon-cell__aa { font-size: 11px; margin-left: auto; font-weight: 500; }

/* ======================================================== AMINO ACID CODES = */
.aa-table {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.aa-table table { width: 100%; border-collapse: collapse; }
.aa-table caption { display: none; }
.aa-table th, .aa-table td {
  padding: 11px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.aa-table thead th {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); background: var(--surface-sunk);
}
.aa-table tbody tr:last-child td { border-bottom: 0; }
.aa-table tbody tr:hover td { background: var(--surface-sunk); }
.aa-table td { font-size: 14px; }
.aa-table th { font-weight: 600; }
.aa-table .aa__three { font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em; }
.aa-table .aa__one {
  font-family: var(--font-mono); font-weight: 600; font-size: 16px; width: 1.5ch;
}
.aa-table .aa__name { color: var(--ink-2); }
.aa-table .aa__group {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  color: #fff; background: var(--unknown); white-space: nowrap;
}
.aa-table .aa__group--nonpolar { background: var(--nonpolar); }
.aa-table .aa__group--polar    { background: var(--polar); }
.aa-table .aa__group--acidic   { background: var(--acidic); }
.aa-table .aa__group--basic    { background: var(--basic); }
.aa-table .aa__group--stop     { background: var(--stop); }

@media (max-width: 760px) {
  .aa-table th, .aa-table td { padding: 9px 12px; }
  .aa-table .aa__group { display: none; }
}


/* ================================================================== NOTES */
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 22px; }
.note h3 {
  font-size: 15px; margin-bottom: 7px;
  padding-top: 12px; border-top: 2px solid var(--ink);
}
.note p { color: var(--ink-2); font-size: 14px; line-height: 1.6; }

/* ================================================================= FOOTER */
.footer { background: var(--film); color: var(--film-ink-2); padding: 44px 0 34px; }
.footer__inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: 30px; align-items: start;
}
.footer__brand .wordmark__text { color: #E6EEF3; display: block; margin-bottom: 8px; }
.footer__brand em { color: var(--film-ink-2); }
.footer__brand p { font-size: 13.5px; line-height: 1.6; max-width: 30ch; }
.footer__nav { display: flex; flex-direction: column; gap: 8px; }
.footer__nav a { color: var(--film-ink); text-decoration: none; font-size: 13.5px; }
.footer__nav a:hover { color: #fff; text-decoration: underline; }
.footer__legal { font-size: 12.5px; line-height: 1.65; max-width: 46ch; }
.footer__legal #copyright { color: var(--film-ink); }

/* ================================================================== TOAST */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 13.5px; z-index: 90;
  box-shadow: 0 6px 24px rgba(16,24,33,.25);
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================ RESPONSIVE = */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; display: flex; justify-content: center; }
  .ad--rail .ad__slot { width: 100%; max-width: 336px; min-height: 280px; }
}

@media (max-width: 760px) {
  .shell { padding-inline: 16px; }
  .masthead__nav { gap: 14px; }
  .masthead__nav a { font-size: 13px; }
  .hero { padding-top: 30px; }
  .segmented { grid-template-columns: repeat(2, 1fr); }
  .panel__head { padding: 15px 16px; }
  .panel__body { padding: 16px; gap: 18px; }
  .codon-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .film__stage { padding: 14px 12px; }
  .film__head { padding: 13px 14px; }
  .film__controls { gap: 14px; }
  .block { font-size: 12px; }
  .cards { grid-template-columns: 1fr; }
  .frame-row { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 460px) {
  .masthead__nav a:not(:last-child) { display: none; }
  .hero__title { font-size: 34px; }
  .field--row { gap: 10px; }
  .panel__actions { width: 100%; }
  .panel__actions .btn { flex: 1; justify-content: center; }
}

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

@media print {
  .ad, .rail, .masthead, .footer__nav, .toast, .panel__actions,
  .film__controls, .editor__foot { display: none !important; }
  body { background: #fff; }
  .film { background: #fff; color: #000; box-shadow: none; border: 1px solid #999; }
  .film__head, .film__legend { background: #fff; }
  .layout { display: block; }
  .drawer { break-inside: avoid; }
}
