/* 2026-09: a warm paper and forest study desk. Load after upgrade.css.
   User-selected accents still enter through the existing inline --teal token. */
:root {
  --ink: #243c36;
  --muted: #5e716b;
  --bg: #f7f6f0;
  --paper: #fffefa;
  --line: #dce3da;
  --navy: #173d35;
  --teal: #236b60;
  --mint: #edbd87;
  --blue: #3f7185;
  --orange: #a45e32;
  --surface: #edf3ed;
  --card: var(--paper);
  --accent-soft: color-mix(in srgb, var(--teal) 9%, var(--paper));
  --accent-ink: var(--teal);
}

/* r16: consistent space inside surfaces and recognizable learning shortcuts. */
.atlas-intro {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--paper), var(--surface));
}
.atlas-intro h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.55;
  margin-block: 0.2rem 0.65rem;
}
.atlas-intro p:last-child {
  color: var(--muted);
  line-height: 1.75;
}
.lookup-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.lookup-tools a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms, background-color 160ms;
}
.lookup-tools a:hover {
  border-color: var(--teal);
  background: var(--surface);
}
.lookup-tools a > span:last-child {
  min-width: 0;
}
.lookup-tools strong,
.lookup-tools small {
  display: block;
  line-height: 1.55;
}
.lookup-tools strong {
  font-size: 0.98rem;
}
.lookup-tools small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}
.lookup-tool-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.toolkit-grid > a.card {
  color: var(--ink);
  text-decoration: none;
  border-radius: 18px;
  transition: background-color 160ms, border-color 160ms;
}
.toolkit-grid > a.card:hover {
  border-color: var(--teal);
  background: var(--surface);
}
.toolkit-grid > a.card h2 {
  margin-bottom: 8px;
}
@media (max-width: 1100px) {
  .lookup-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .lookup-tools {
    gap: 10px;
  }
  .lookup-tools a {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }
  .lookup-tool-icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 360px) {
  .lookup-tools a {
    padding: 13px;
  }
  .lookup-tools strong {
    font-size: 0.9rem;
  }
}
:root[data-theme="dark"] {
  --ink: #e9f1eb;
  --muted: #b8c9be;
  --bg: #11231f;
  --paper: #1c322c;
  --line: #3c564c;
  --navy: #102b24;
  --teal: #80c2a9;
  --surface: #233e33;
  --accent-ink: color-mix(in srgb, var(--teal) 45%, #c8efd9);
}
.brand-symbol {
  background: var(--mint);
  color: #173d35;
}
.sidebar {
  background: var(--navy);
}
.sidebar .brand,
.sidebar .nav a {
  color: #f0f4ed;
}
.sidebar .brand small,
.sidebar-foot,
.sidebar-foot a {
  color: #c7d9cd;
}
.sidebar .nav a.active {
  background: var(--mint);
  color: #173d35;
}
.sidebar .nav a:hover:not(.active) {
  background: #2a5144;
}
.sidebar .progress-track {
  background: #3c6052;
}
.sidebar .progress-track span,
.study-desk .mission .eyebrow {
  color: var(--mint);
}
.sidebar .progress-track span {
  background: var(--mint);
}
.sidebar .sidebar-progress strong {
  color: var(--mint);
}
.mobile-brand,
[data-theme="dark"] .mobile-brand {
  color: var(--ink);
}
.study-desk .mission {
  background: var(--navy);
  border-top-color: var(--mint);
}
.study-desk .mission p,
.mission-tags,
.text-white {
  color: #d1e1d7;
}
.study-desk .mission-tags span,
.study-desk .pill {
  color: #f0f5ed;
  background: #355b4b;
  border-color: #688674;
}
.quick-icon.teal,
.quick-icon.blue,
.avatar,
.tag {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.quick-icon.orange,
.school-mark {
  background: #faead7;
  color: #80542e;
}
.school-strip {
  border-left-color: #cf9a65;
}
.school-strip p,
.school-strip a {
  color: var(--muted);
}
.concept-card {
  border-top-color: color-mix(in srgb, var(--teal) 55%, var(--line));
}
.subject-card:hover {
  border-color: var(--teal);
}
.memory-tabs button.active,
.lab-tabs button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.memory-table th,
[data-theme="dark"] .memory-table th {
  background: var(--surface);
  color: var(--ink);
}
.term-link,
.text-link,
.eyebrow,
[data-theme="dark"] .term-link,
[data-theme="dark"] .text-link,
[data-theme="dark"] .eyebrow {
  color: var(--accent-ink);
}
.daily-ring {
  border-color: var(--line);
  border-top-color: var(--teal);
}
.hormone-stage {
  background: radial-gradient(ellipse at 50% 45%, #30574c, #132d27 80%);
  border-color: #416c5b;
}
.hormone-stage-heading,
.hormone-stage > .device-help {
  color: #d3e7d9;
}
.anatomy-pin {
  border-color: #9bc7b5;
  background: #193b31ef;
}
.anatomy-pin:hover,
.anatomy-pin:focus-visible {
  background: #356c55;
  outline-color: var(--mint);
}
.hormone-stage-play {
  background: #356c55 !important;
}
[data-theme="dark"] .hormone-player,
[data-theme="dark"] .hormone-focus,
[data-theme="dark"] .hormone-site-card,
[data-theme="dark"] .hormone-filter-row select,
[data-theme="dark"] .hormone-play-controls select {
  background: var(--paper);
}
[data-theme="dark"] .memory-table .hormone-group-heading th,
[data-theme="dark"] .hormone-pathway,
[data-theme="dark"] .hormone-caveat {
  background: var(--surface);
  color: var(--ink);
}

/* Titles retain a useful line length before controls take another row. */
.intro-row {
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 1rem;
  row-gap: 1rem;
}
.intro-row > :first-child:not(.daily-ring) {
  flex: 1 1 26rem;
  min-width: min(100%, 20rem);
}
.intro-row > .row {
  flex: 0 1 auto;
  min-width: 0;
}
.intro-row > .primary,
.intro-row > .secondary {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 48px;
  padding: 0.75rem 1rem;
}
.intro-row .eyebrow {
  letter-spacing: 0.1em;
  word-break: normal;
  overflow-wrap: normal;
}
h1,
h2,
h3 {
  word-break: normal;
  overflow-wrap: break-word;
}
.intro-row h1 {
  text-wrap: pretty;
  max-width: 30ch;
}
.section-head,
.card-head,
.calendar-heading,
.model-heading {
  flex-wrap: wrap;
}
.section-head > :first-child,
.card-head > :first-child {
  min-width: 0;
  flex: 1 1 14rem;
}
.section-head > .row,
.card-head > .row,
.memory-card .section-head > .row {
  flex: 0 1 auto;
  min-width: 0;
}
.section-head > .row > *,
.card-head > .row > * {
  max-width: 100%;
}
.page > *,
.row > *,
.hero-grid > *,
.anatomy-layout > *,
.article-layout > *,
.lab-layout > *,
.progress-layout > *,
.scope-layout > *,
.concept-grid > *,
.subject-grid > * {
  min-width: 0;
}
.subject-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.subject-card .number {
  font-size: 0.8rem;
  line-height: 1.6;
}
.subject-card p {
  font-size: 0.9rem;
  line-height: 1.85;
}
.term-link ruby {
  ruby-align: center;
}
.term-link ruby rt {
  font-size: 0.62em;
  letter-spacing: 0;
}
.term-expanded-name {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.term-expanded-name .reading {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}
.term-expanded-name .term-abbreviation {
  font-size: 0.875rem;
  color: var(--accent-ink);
}
.term-chips button {
  min-height: 44px;
  max-width: 100%;
  line-height: 1.8;
}
.hormone-filter-row label {
  min-width: min(100%, 15rem);
  max-width: 100%;
}
.hormone-camera,
.model-toolbar {
  flex-wrap: wrap;
}
.model-heading > * {
  max-width: 100%;
}
.school-strip {
  flex-wrap: wrap;
}
.school-strip > div:not(.school-mark) {
  flex: 1 1 18rem;
}
.school-strip > a {
  white-space: normal;
}
.profile-badge > .avatar {
  flex-shrink: 0;
}

/* A content column beside a desktop rail needs the same attention as a phone. */
@media (max-width: 1100px) {
  .intro-row > :first-child:not(.daily-ring) {
    flex-basis: 100%;
  }
  .intro-row > :first-child:has(+ .daily-ring) {
    flex-basis: 18rem;
    min-width: min(100%, 15rem);
  }
  .scope-layout,
  .hormone-explorer {
    grid-template-columns: minmax(0, 1fr);
  }
  .hormone-stage-wrap {
    position: static;
  }
}
@media (min-width: 761px) and (max-width: 900px) {
  .sidebar {
    background: var(--navy);
    border: 0;
  }
  .sidebar .nav a {
    color: #f0f4ed;
  }
  .sidebar .nav a.active {
    background: var(--mint);
    color: #173d35;
  }
  .hero-grid,
  .quick-grid,
  .toolkit-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .quick-grid .quick-card + .quick-card {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 760px) {
  .sidebar {
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .sidebar .nav a {
    color: var(--muted);
  }
  .sidebar .nav a.active {
    background: var(--accent-soft);
    color: var(--accent-ink);
  }
  .topbar {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }
  .topbar > .row {
    margin-left: auto;
    min-width: 0;
    max-width: 100%;
  }
  .intro-row > .primary,
  .intro-row > .secondary {
    flex: 1 1 14rem;
  }
  .intro-row > .row {
    flex-basis: 100%;
  }
  .intro-row > .row > .primary,
  .intro-row > .row > .secondary {
    flex: 1 1 14rem;
  }
  .intro-row .subtle {
    display: block;
  }
  .section-head > .row,
  .card-head > .row {
    flex-basis: 100%;
  }
  .section-head > .row > *,
  .card-head > .row > * {
    flex: 1 1 12rem;
  }
  .article-tools,
  .lab-explanation,
  .anatomy-panel,
  .toolkit-grid,
  .sources-layout > aside {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-quick-actions .primary {
    white-space: normal;
    line-height: 1.7;
  }
}
@media (max-width: 480px) {
  .intro-row > :first-child:has(+ .daily-ring) {
    flex-basis: calc(100% - 6.5rem);
    min-width: 0;
  }
  .intro-row .daily-ring {
    width: 5.5rem;
    height: 5.5rem;
    border-width: 5px;
  }
  .daily-ring strong {
    font-size: 1.35rem;
  }
  .daily-ring span {
    font-size: 0.625rem;
  }
  .intro-row h1 {
    font-size: 1.6rem;
    line-height: 1.55;
  }
  .concept-grid,
  .hormone-index,
  .pathway-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .hormone-stage-heading {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .hormone-camera button {
    padding: 0.55rem 0.7rem;
  }
  .article,
  .card,
  .question-card {
    padding: 1.1rem;
  }
  .layer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layer-list label {
    font-size: 0.9rem;
    min-height: 44px;
  }
  .quiz-top,
  .quiz-navigation,
  .scope-savebar {
    flex-wrap: wrap;
  }
  .quiz-top .progress-track {
    flex: 1 1 100%;
    order: 3;
  }
  .quiz-navigation button {
    min-height: 44px;
  }
  .calendar-heading {
    row-gap: 0.75rem;
  }
  .calendar-heading h2 {
    flex: 1 1 100%;
  }
}
@media (max-width: 360px) {
  .intro-row > :first-child:has(+ .daily-ring) {
    flex: 1 1 100%;
  }
  .intro-row > .daily-ring {
    display: flex;
    width: auto;
    height: auto;
    flex-direction: row;
    gap: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0.5rem 0.8rem;
  }
  .daily-ring span {
    font-size: 0.75rem;
    margin: 0;
  }
}
/* The first request can include large Japanese dictionaries on a mobile line. */
.initial-loading {
  margin: 12vh auto;
  padding: 24px;
  text-align: center;
  color: #214b40;
}
.initial-loading h1 {
  font-size: 28px;
}
.initial-pulse {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e8c390;
  width: 56px;
  height: 56px;
  font-size: 24px;
}
/* r13 — purpose-first home, readable on a narrow screen without hiding tools. */
.home-paths { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 8px 0 20px; }
.home-paths > a { display: grid; gap: 9px; text-decoration: none; color: var(--ink); padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); min-width: 0; }
.home-paths > a:hover { border-color: var(--teal); }
.home-paths strong { font-size: 1rem; }
.home-paths small { color: var(--muted); line-height: 1.6; }
.home-paths > a > span { color: var(--accent-ink); }
.home-continuity { display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; padding:12px 4px; margin-bottom:12px; font-size:.9rem; }
.home-continuity a { text-decoration: underline; text-underline-offset:4px; }
.daily-ring { flex: 0 0 140px; }
.daily-ring > span { font-size:.72rem; max-width:125px; text-align:center; }
.home-subjects { margin:30px 0; }
.home-subjects > summary { cursor:pointer; border:1px solid var(--line); padding:18px; border-radius:16px; background:var(--paper); font-weight:700; }
.home-subjects > summary span { font-size:.85rem; font-weight:400; margin-left:12px; display:inline-block; }
.home-subjects .subject-grid { margin-top:16px; }
.study-preferences { display:grid; gap:14px; margin:20px 0; }
.study-preferences label { max-width:580px; }
.study-preferences input[type="range"] { display:block; width:100%; margin:16px 0; accent-color:var(--teal); }
.study-preferences output { margin-left:12px; }
.sound-switch { white-space:nowrap; font-size:.82rem; min-height:44px; }
.guide-index { display:flex; flex-wrap:wrap; gap:10px; margin:24px 0; }
.guide-index a { text-decoration:none; font-weight:650; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--paper); }
.guide-chapters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.guide-chapter { margin:0; scroll-margin-top:24px; }
.guide-chapter ol { padding-left:1.5rem; }
.guide-chapter li { margin:14px 0; line-height:1.85; }
.guide-chapter .primary { width:fit-content; max-width:100%; }
.guide-flow { display:flex; align-items:center; gap:8px; padding:18px 10px; margin:18px 0; border-radius:16px; background:var(--accent-soft); }
.guide-flow span { flex:1 1 0; min-width:0; text-align:center; font-size:.83rem; color:var(--ink); }
.guide-flow b { display:grid; place-items:center; width:30px; height:30px; margin:0 auto 8px; background:var(--paper); border-radius:50%; color:var(--accent-ink); }
.guide-flow i { font-style:normal; color:var(--accent-ink); }
.answer-feedback.bad { background:#fff0f1; border:2px solid #b9414f; }
.answer-feedback.bad h2 { color:#952638; }
.answer-feedback.bad .answer-comparison > div:first-child { border-left:4px solid #b9414f; padding-left:12px; }
.answer-feedback .feedback-explanation-label { display:block; margin:18px 0 8px; }
.choice.wrong { border:2px solid #b9414f; background:#fff0f1; color:#802032; }
[data-theme="dark"] .answer-feedback.bad, [data-theme="dark"] .choice.wrong { background:#41222b; border-color:#ee98a4; color:#ffe8ec; }
[data-theme="dark"] .answer-feedback.bad h2 { color:#ffbdc7; }
[data-theme="dark"] .answer-feedback.bad .answer-comparison > div:first-child { border-color:#ee98a4; }
@media(max-width:1000px) { .home-paths { grid-template-columns:repeat(2,minmax(0,1fr)); } .guide-chapters { grid-template-columns:minmax(0,1fr); } }
@media(max-width:520px) { .home-paths { gap:10px; } .home-paths > a { padding:14px 12px; } .home-paths small { font-size:.78rem; } .daily-ring { flex-basis:108px; width:108px; height:108px; } .daily-ring > span { max-width:94px; } .guide-flow { gap:5px; padding:14px 8px; } .home-continuity { display:grid; } }
@media(max-width:360px) { .home-paths { grid-template-columns:minmax(0,1fr); } .home-paths > a { grid-template-columns:28px minmax(0,1fr); gap:4px 10px; } .home-paths > a > span { grid-row:span 2; } .home-paths strong { font-size:1rem; } .guide-flow { flex-direction:column; } .guide-flow span { width:100%; } .guide-flow i { transform:rotate(90deg); } }
/* v5: the next learning action stays above secondary tools; no automatic GLB download. */
.home-heading {margin:22px 0 24px;max-width:760px}.home-heading h1{font-size:clamp(1.65rem,4.5vw,2.7rem);line-height:1.55;margin:10px 0}.home-heading>p:last-child{color:var(--muted);line-height:1.85}.home-next{max-width:none;min-height:0;padding:28px;border-radius:24px}.home-next h2{font-size:clamp(1.3rem,3.5vw,1.9rem);line-height:1.6}.home-next>.row{flex-wrap:wrap}.home-next .primary{min-height:52px}.home-review-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:24px 0}.home-visual-link{display:flex;gap:24px;justify-content:space-between;align-items:center;margin:30px 0}.home-visual-link>div{min-width:0}.home-visual-link h2{line-height:1.6}.home-help .part-related{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 18px}.article-index{margin:24px 0;border-block:1px solid var(--line)}.article-index>summary{min-height:48px;padding:14px 0;cursor:pointer;font-weight:700}.article-index .article-toc{margin:0 0 16px}.article-anatomy{margin:24px 0;background:var(--paper);padding:20px}.article-anatomy .part-related{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:6px 14px}.article-anatomy .part-related a{min-height:44px;padding:10px 0}.article-anatomy .full{width:auto;max-width:100%}.article-head h1{line-height:1.6;overflow-wrap:anywhere}.article-section p{max-width:72ch}.article-quick-actions{flex-wrap:wrap}.article-return{display:inline-flex;align-items:center;min-height:44px}.page .text-link,.page .mark-section,.page .text-white{min-height:44px}.personal-background .home-heading,.personal-background .home-continuity{background:var(--paper);border-radius:16px;padding:18px}.guide-index a{min-height:44px}.guide-video{margin-top:28px}
@media(max-width:760px){.home-heading{margin:18px 0}.home-next{padding:22px}.home-visual-link{align-items:stretch;flex-direction:column;gap:12px}.home-review-row{grid-template-columns:minmax(0,1fr)}.home-help .part-related{grid-template-columns:minmax(0,1fr)}.article-anatomy{padding:18px}.home-paths small{font-size:.85rem}.home-paths a{padding:16px}.home-continuity{font-size:.95rem;line-height:1.7}}
@media(max-width:360px){.home-next{padding:18px}.home-next .row:last-child{display:grid;grid-template-columns:minmax(0,1fr)}.home-heading h1{font-size:1.65rem}.article-anatomy .part-related{grid-template-columns:minmax(0,1fr)}}
.account-entry{max-width:640px;margin:24px auto;padding:clamp(20px,4vw,36px)}.account-entry h1{font-size:clamp(1.5rem,3vw,2rem);line-height:1.6;overflow-wrap:break-word}.account-entry .stack>button{min-height:48px;width:100%;white-space:normal}.account-entry input:not([type=checkbox]),.account-panel input{max-width:100%;min-width:0}.account-entry .row{align-items:flex-start;line-height:1.8}.account-entry .row input{flex:none;margin-top:7px}.account-conflict-value{white-space:pre-wrap;overflow-wrap:anywhere;max-height:300px;overflow:auto;padding:14px;background:var(--bg);color:var(--ink)}.schematic-catalog{margin-block:24px}.schematic-catalog .unit-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}.schematic-catalog .unit-card{min-height:88px;display:grid;gap:10px}.part-list button[aria-pressed=true]{outline:2px solid var(--teal);outline-offset:-2px}.account-panel .row{flex-wrap:wrap}.account-entry .note,.account-panel .note{line-height:1.75}

/* Account actions stay above optional detail, with a stable checkbox column. */
.account-entry > p:not(.eyebrow),
.account-entry [data-account-choices] > p:not(.eyebrow),
.account-auth-screen > p {
  margin-block: 10px 18px;
}
.account-entry [data-account-choices] > .stack,
.account-verification > .stack {
  gap: 12px;
  margin-block: 22px 18px;
}
.account-entry .account-remember {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-block: 18px 12px;
  line-height: 1.7;
  font-size: 0.9rem;
  text-align: left;
}
.account-entry .account-remember input {
  margin: 4px 0 0;
  width: 18px;
  height: 18px;
}
.account-remember .note {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
}
.account-auth-screen {
  min-width: 0;
  scroll-margin-top: 20px;
}
.account-auth-screen h2 {
  font-size: 1.25rem;
  line-height: 1.6;
}
.account-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  margin-block: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.account-auth-tabs button {
  min-height: 46px;
  padding: 10px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
  border: 0;
  background: transparent;
}
.account-auth-tabs [aria-selected="true"],
.account-auth-tabs [aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--paper);
  box-shadow: 0 1px 5px #163e3014;
}
.account-auth-screen form > label {
  margin-block: 16px;
  gap: 8px;
  line-height: 1.65;
  font-weight: 650;
}
.account-auth-screen input:not([type="checkbox"]) {
  width: 100%;
  min-height: 48px;
  font-weight: 400;
  background: var(--paper);
  border-color: var(--line);
}
.account-auth-screen input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.account-auth-screen form > .primary,
.account-auth-screen form > .secondary {
  width: 100%;
  min-height: 50px;
  margin-block: 8px;
  white-space: normal;
  line-height: 1.65;
}
.account-auth-help,
.account-details {
  margin-block: 16px;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.75;
}
.account-auth-help summary,
.account-details summary {
  min-height: 44px;
  padding-block: 10px;
  cursor: pointer;
  color: var(--accent-ink);
  font-weight: 650;
}
.account-auth-help[open],
.account-details[open] {
  padding: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.account-auth-help p + p,
.account-details p + p {
  margin-top: 10px;
}
.account-status,
.account-verification {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow-wrap: anywhere;
  line-height: 1.75;
}
.account-status:empty {
  display: none;
}
.account-verification .row {
  gap: 8px;
}
.account-verification ol {
  padding-left: 1.4rem;
  margin-block: 16px;
}
.account-verification li + li {
  margin-top: 10px;
}
.account-verification-address {
  font-weight: 650;
  color: var(--accent-ink);
}
.account-auth-help summary:focus-visible,
.account-details summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}
.account-auth-screen .text-link {
  padding: 10px 0;
  text-align: left;
  white-space: normal;
}
.account-auth-alternative {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.account-auth-alternative .secondary {
  width: 100%;
  min-height: 48px;
}
@media (max-width: 760px) {
  .account-entry {
    margin-block: 12px 24px;
    border-radius: 22px;
  }
  .account-auth-help[open],
  .account-details[open] {
    padding-inline: 12px;
  }
}
.notice-board .notice-track article{justify-content:flex-start;min-height:0;padding-block:14px}.notice-board .notice-track article h3{margin:7px 0 3px}.notice-board .notice-track article p{margin:6px 0;line-height:1.65;font-size:.94rem}.notice-board .notice-track article p.note{font-size:.82rem;line-height:1.5}.notice-board .notice-track article .tag{font-size:.73rem;padding:3px 7px}.notice-board .notice-track article .primary{min-height:44px;padding-block:10px}.notice-board .notice-dots{padding-block:0}

/* r15: one account identity; thumbnails stay legible without compressing names. */
.account-avatar {width:44px;height:44px;flex:0 0 44px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;background:var(--accent-soft,#e9bc85);color:var(--ink,#193e36);font-size:20px;font-weight:700;line-height:1;vertical-align:middle;}
.account-avatar img {display:block;width:100%;height:100%;object-fit:cover;}
.brand-symbol:has(.account-avatar) {background:transparent;padding:0;overflow:visible;}
.account-name-line {display:flex;align-items:center;gap:12px;min-width:0;overflow-wrap:anywhere;}
.profile-badge {min-width:0;max-width:min(100%,360px);}
.profile-badge-copy {display:flex;flex-direction:column;min-width:0;text-align:left;gap:2px;}
.profile-badge-copy strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:22ch;}
.profile-badge-copy small {font-size:12px;opacity:.8;}
.account-profile {margin:20px 0;padding:20px;background:var(--paper,#fff);border:1px solid var(--line,#dae3da);border-radius:18px;}
.account-profile summary {font-weight:700;cursor:pointer;min-height:32px;}
.account-profile form {max-width:620px;margin:16px 0 0;display:grid;gap:14px;}
.account-profile-preview .account-avatar {width:80px;height:80px;font-size:32px;}
.account-profile label {min-width:0;}
.account-profile input[type=file] {width:100%;max-width:100%;font-size:14px;}
.account-profile input[type=checkbox] {flex-shrink:0;}
.account-profile .row {align-items:flex-start;}
.account-profile .note,.account-profile p {margin:0;}
.email-trust {margin:16px 0;overflow-wrap:anywhere;}
.email-trust summary {cursor:pointer;min-height:44px;}
.community-ranking li>div {min-width:0;}
.community-ranking li strong {overflow-wrap:anywhere;}
@media(max-width:600px){.profile-badge {max-width:190px;}.profile-badge-copy strong{max-width:10ch;font-size:14px;}.profile-badge .account-avatar{width:36px;height:36px;flex-basis:36px;}.account-profile{padding:16px;}.community-ranking li{gap:10px;}.community-ranking .account-avatar{width:36px;height:36px;flex-basis:36px;}}

/* r21: put the next learning action before optional detail, at every width. */
.skip-link {position:fixed;z-index:1000;top:8px;left:12px;padding:12px 18px;background:var(--paper);color:var(--ink);border:2px solid var(--teal);border-radius:12px;transform:translateY(-160%)}
.skip-link:focus {transform:translateY(0)}
#main-content:focus, #main-content h1:focus {outline:none}
.keyboard-navigation #main-content h1:focus {outline:2px solid var(--teal);outline-offset:6px;border-radius:4px}
.home-notices {margin:0 0 16px;border:1px solid var(--line);border-radius:14px;background:var(--paper)}
.home-notices > summary {display:flex;align-items:center;gap:12px;min-height:48px;padding:10px 16px;cursor:pointer;list-style:none;color:var(--ink);font-size:.85rem}
.home-notices > summary::-webkit-details-marker {display:none}
.home-notices > summary > span {flex:1;min-width:0;line-height:1.5;color:var(--muted)}
.home-notices > summary > strong {flex-shrink:0}
.home-notices[open] > summary > b {transform:rotate(45deg)}
.home-notices .notice-board {margin:0;border:0;border-radius:0 0 14px 14px;box-shadow:none}
.home-heading {margin-bottom:18px}
.home-heading h1 {font-size:clamp(1.65rem,3vw,2.6rem);line-height:1.4;margin:.25em 0}
.home-heading > p:last-child {font-size:1rem;margin:.3em 0;line-height:1.6}
.home-next {padding:clamp(20px,3vw,30px)}
.home-next h2 {font-size:clamp(1.25rem,2.6vw,1.8rem);margin:.6em 0 .35em;line-height:1.5}
.home-next p {line-height:1.65;margin:.4em 0 1em}
.save-status {font-size:.8rem;line-height:1.6;color:var(--muted);margin:8px 0 14px;overflow-wrap:anywhere}
.save-status[data-sync-state="error"], .save-status[data-sync-state="storage-error"] {color:var(--orange)}
.home-topic-starts {display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}
.home-topic-starts a {display:flex;align-items:center;min-height:44px;padding:9px 14px;background:var(--paper);border:1px solid var(--line);border-radius:100px;color:var(--ink);text-decoration:none;font-size:.88rem}
.learning-entry .primary {margin-block:12px;min-height:48px}
.learning-entry h1 {font-size:clamp(1.5rem,3vw,2.4rem);line-height:1.5}
.learning-next {text-align:left;background:var(--surface);border-radius:16px;padding:20px;margin:20px 0}
.learning-next h2 {font-size:1.15rem}
.learning-next a {margin:4px}
.answer-rubric,.chosen-reason {background:var(--surface);color:var(--ink);border-radius:14px;padding:16px 20px;margin:16px 0;line-height:1.85}
.answer-rubric h3 {font-size:1rem;margin:0 0 8px}
.answer-rubric ul {padding-left:1.25em;margin:0}
.answer-rubric li+li {margin-top:8px}
.chosen-reason p {margin:.5em 0 0}
.section-references {margin-block:16px;color:var(--muted);font-size:.88rem}
.section-references summary {min-height:36px;cursor:pointer}
.active-filters {display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.active-filters a {min-height:36px;padding:7px 12px;border-radius:100px;background:var(--surface);color:var(--ink);font-size:.8rem;text-decoration:none}
@media(max-width:600px) {
  .home-heading .eyebrow {display:none}
  .home-heading {margin:12px 0 14px;padding:0}
  .home-heading h1 {font-size:1.65rem}
  .home-next .row {gap:8px}
  .home-next .row > .primary {width:100%;justify-content:center}
  .home-notices > summary {gap:8px;padding:10px 12px;font-size:.78rem}
  .home-next {border-radius:20px;padding:20px}
  .home-next .eyebrow {font-size:.75rem}
  .home-topic-starts {gap:6px}
  .home-topic-starts a {font-size:.8rem;padding:8px 10px}
  .learning-next {padding:16px}
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after {scroll-behavior:auto!important}
}

:root { --on-accent: #ffffff; }
:root[data-theme="dark"] { --on-accent: #102b24; }
.memory-tabs button.active, .lab-tabs button.active, .hormone-view-switch button[aria-pressed="true"], .mechanism-node.revealed .step-number { color: var(--on-accent); }
