:root {
  --background:#f7f7fa; --ink:#24232e; --muted:#5d5c6a; --border:#dfdfe7;
  --accent:#96244a; --accent-strong:#7a163a; --accent-pale:#f8e9ee;
  --radius:1.25rem;
}
body {font-feature-settings:"palt"; letter-spacing:.015em;}
.site-header {background:#fffffff5;}
.site-header-inner {max-width:72rem; min-height:4.3rem;}
.brand {font-family:Georgia,"Hiragino Mincho ProN","Yu Mincho",serif; font-size:1.28rem; letter-spacing:.075em;}
.brand-mark {position:relative; width:2.15rem; height:2.15rem; transform:rotate(-26deg); border-radius:58% 44% 56% 46%; background:linear-gradient(155deg,#ff8785,#c72c57 55%,#801a45); border:0; box-shadow:inset 0 -3px 3px #78143644;}
.brand-mark:after {content:""; position:absolute; inset:29% 21%; border-radius:50%; background:linear-gradient(168deg,#8e1743,#d84566 65%,#ffa097); box-shadow:0 2px 3px #ffc1ad66;}
.site-nav {display:flex; gap:.15rem; border:0; background:#f0f0f5; border-radius:2rem; padding:.25rem;}
.site-nav a {color:#5a5866; min-height:2.5rem; font-size:.9rem; padding:.35rem 1rem; border-radius:2rem;}
.site-nav a[aria-current] {background:#24222f; color:white;}
.nav-count {color:#702139; background:#ffc5cf;}
.layout {max-width:72rem; padding:2rem 1.5rem 4rem; grid-template-columns:14.3rem minmax(0,1fr); gap:2.4rem;}
body[data-layout=wide] .layout {display:block;}
body[data-layout=wide] .sidebar {display:none;}
.screen {scroll-margin-top:1rem;}
.home-hero {position:relative; isolation:isolate; overflow:hidden; display:flex; align-items:center; min-height:22rem; padding:clamp(2rem,4.5vw,3.8rem); border-radius:1.6rem; color:#fff9f8; background:#181623;}
.home-hero:before {content:""; position:absolute; z-index:-1; inset:0; background:linear-gradient(90deg,#181622 2%,#181622de 24%,transparent 64%);}
.kicker {display:flex; gap:.65rem; align-items:center; margin:0 0 .9rem; color:#ffc5c6; font-size:.94rem; font-weight:650; letter-spacing:.10em;}
.kicker:before {content:""; width:1.6rem; height:2px; background:currentColor;}
.hero-copy h1 {margin:0; font-family:"Hiragino Mincho ProN","Yu Mincho","Noto Serif CJK JP",serif; font-size:clamp(2.5rem,4.5vw,4.35rem); line-height:1.14; font-weight:700; letter-spacing:.015em;}
.hero-intro {margin:1rem 0 1.25rem; line-height:1.65; color:#e8dfe7;}
.hero-start {display:inline-flex; align-items:center; min-height:2.9rem; padding:.6rem 1.35rem; border-radius:2rem; background:#ffc7ce; color:#351725; text-decoration:none; font-weight:750;}
.hero-start:hover {background:#ffe0e2;}
.specimen-caption {position:absolute; right:1.55rem; bottom:1.15rem; color:#e4c9d4; font-size:.78rem; letter-spacing:.07em;}
.specimen-caption:before {content:""; display:inline-block; width:1.6rem; height:1px; margin:0 .45rem .22rem 0; background:currentColor;}
.home-summary {display:flex; align-items:center; gap:1.4rem; padding:1rem 1.4rem; margin:.8rem 0 1.9rem; background:white; border:1px solid var(--border); border-radius:1.05rem;}
.home-summary>div {display:flex; align-items:baseline; gap:.9rem; white-space:nowrap;}
.home-summary span,.home-summary a {font-size:.9rem; font-weight:650;}
.home-summary strong {font-size:1.2rem; font-variant-numeric:tabular-nums;}
.home-summary small {color:var(--muted); font-size:.88rem; font-weight:500;}
.home-summary progress {flex:1; margin:0; min-width:2rem;}
.home-summary a,.back-link {color:var(--accent-strong); text-underline-offset:.25em;}
.section-head {display:flex; justify-content:space-between; align-items:baseline; margin:1.6rem 0 .85rem;}
.section-head h2,.atlas-index h1 {margin:0; font-size:clamp(1.4rem,2.6vw,2rem); letter-spacing:.01em;}
.section-head span,#atlas-count {font-size:.9rem; color:var(--muted);}
.deck-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem;}
.deck,.atlas-result {display:flex; align-items:center; gap:.9rem; text-decoration:none; background:white; border:1px solid var(--border); border-radius:1rem; min-width:0;}
.deck {padding:.9rem 1rem; min-height:5.7rem;}
.deck strong,.deck small,.atlas-result strong,.atlas-result small,.result-prompt {display:block;}
.deck strong,.atlas-result strong {line-height:1.45;}
.deck small,.atlas-result small {font-size:.83rem; color:var(--muted); margin-top:.15rem;}
.deck-art,.result-art {display:grid; flex:0 0 3.25rem; height:3.25rem; place-content:center; background:#f8e9e1; border-radius:.92rem;}
.deck-art canvas,.result-art canvas {width:3.5rem; height:auto;}
.tone-1 {background:#fbe4ea;} .tone-2,.tone-4 {background:#eee7fb;} .tone-3 {background:#e2f1f3;} .tone-5 {background:#eaeafa;} .tone-6 {background:#f6e5e8;}
.deck-chevron {margin-left:auto; color:#827d8a; font-size:1.4rem; font-weight:450;}
.all-courses {background:white; margin-top:1.1rem; border:1px solid var(--border); border-radius:1rem; padding:0 1.15rem;}
.all-courses summary,.category-panel summary {cursor:pointer; font-weight:700;}
.all-courses summary {padding:.9rem 0;}
.all-courses>div {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem 1.3rem; padding-bottom:.8rem;}
.all-courses a {display:flex; justify-content:space-between; align-items:center; gap:.5rem; min-height:2.8rem; border-top:1px solid var(--border); text-decoration:none;}
.all-courses a small {white-space:nowrap; color:var(--muted);}
.storage-note {text-align:right; font-size:.8rem;}
.side-title {font-size:1.65rem; font-weight:760; margin:.2rem 0;}
.category-panel {border-radius:.95rem;}
.category-link,.category-link[data-category^=drill-] {background:transparent; border-color:transparent; color:var(--ink);}
.category-link[aria-current],.category-link:hover {background:var(--accent-pale);color:var(--accent-strong);}
.card {border-color:var(--border); box-shadow:0 8px 26px #21172c07;}
.card:has(> .choices)>h2 {color:var(--ink); padding:0; background:none; font-size:clamp(1.24rem,2.2vw,1.75rem); line-height:1.6;}
.choice {background:white; border-color:var(--border); border-radius:.8rem; padding:.8rem .95rem;}
.choice-number {border-radius:50%; background:#f1eff5; color:#4e4b60;}
.button {border-radius:2rem; border-color:var(--border); padding-inline:1.25rem;}
.button-primary {background:#822044;color:white;border-color:#822044;}
.actions [data-action=study-figure] {background:#eee9fb;color:#462c70;border-color:#ddd1f3;}
.atlas-index,.atlas-detail {max-width:60rem; margin:0 auto;}
.atlas-index {padding:clamp(1.15rem,3.6vw,2.6rem); background:white; border:1px solid var(--border); border-radius:1.4rem;}
.atlas-filters {display:grid; grid-template-columns:2fr 1fr; gap:.75rem; margin:1.4rem 0;}
.atlas-filters label {font-size:.88rem; font-weight:700;}
.atlas-filters input,.atlas-filters select {width:100%; min-height:3rem; margin-top:.35rem; color:var(--ink); background:#f9f8fb; border:1px solid #c8c5d0; border-radius:.72rem; padding:.55rem .8rem; font:inherit; font-size:1rem;}
.atlas-filters select {appearance:none; padding-right:2.1rem; background-image:linear-gradient(45deg,transparent 50%,#635c68 50%),linear-gradient(135deg,#635c68 50%,transparent 50%); background-position:calc(100% - 1.1rem) center,calc(100% - .83rem) center; background-size:.3rem .3rem; background-repeat:no-repeat;}
.atlas-results {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem;}
.atlas-result {padding:.85rem; align-items:flex-start;}
.atlas-result>span:last-child {min-width:0;}
.atlas-result .result-art {background:#f6f2f6;}
.result-prompt {font-size:.88rem; line-height:1.55; color:#615c69; margin-top:.3rem;}
.atlas-more {grid-column:1/-1; justify-self:center;}
.back-link {display:inline-flex;align-items:center;min-height:2.75rem;margin-bottom:.5rem;}
@media(hover:hover) {
  .deck:hover,.atlas-result:hover {border-color:#bd8ba4; box-shadow:0 .3rem 1rem #54233b0d; transform:translateY(-2px);}
}
@media(prefers-reduced-motion:no-preference) {
  .deck,.atlas-result,.choice,.hero-start {transition:transform .16s ease,background .16s ease,box-shadow .16s ease,border-color .16s ease;}
}
@media(max-width:850px) {.deck-grid {grid-template-columns:repeat(2,minmax(0,1fr));} .layout {gap:1.3rem;}}
@media(max-width:680px) {
  .site-header-inner {display:flex; min-height:3.85rem; padding:.45rem .85rem; gap:.3rem;}
  .brand {font-size:1.05rem; gap:.42rem;}
  .brand-mark {width:1.55rem;height:1.55rem;}
  .site-nav {gap:0; padding:.12rem;}
  .site-nav a {font-size:.83rem; min-height:2.75rem; padding:.35rem .56rem;}
  .layout {grid-template-columns:minmax(0,1fr); padding:.8rem .8rem 2rem; gap:.8rem;}
  .home-hero {min-height:21.2rem; padding:1.55rem; border-radius:1.15rem; background-position:63% center;}
  .home-hero:before {background:linear-gradient(90deg,#181622f0 0%,#181622b8 35%,#18162209 78%);}
  .hero-copy h1 {font-size:clamp(2.15rem,8vw,3.2rem);}
  .hero-intro {font-size:.94rem; text-shadow:0 1px 4px #181622;}
  .specimen-caption {right:.8rem;bottom:.65rem;font-size:.75rem;}
  .home-summary {display:grid;grid-template-columns:1fr auto;gap:.3rem .6rem; margin:.55rem 0 1.3rem;padding:.8rem 1rem;}
  .home-summary>div {gap:.65rem;flex-wrap:wrap;}
  .home-summary progress {grid-column:1;grid-row:2;}
  .home-summary a {grid-column:2;grid-row:1/3; display:flex;align-items:center;min-height:2.75rem;}
  .section-head {margin:1rem 0 .55rem;}
  .deck-grid {gap:.5rem;}
  .deck {min-height:5.85rem; display:grid; grid-template-columns:1fr auto; align-content:start; align-items:center; gap:.3rem .15rem; padding:.65rem .8rem;}
  .deck-art {width:2.55rem;height:2rem;border-radius:.55rem;grid-column:1;}
  .deck-art canvas {width:2.8rem;}
  .deck>span:nth-child(2) {grid-row:2;grid-column:1/-1;}
  .deck-chevron {grid-row:1;grid-column:2;font-size:1.2rem;}
  .deck strong {font-size:1rem;}
  .deck small {margin:0;}
  .side-title,.chapter-label,.sidebar-copy {display:none;}
  .category-panel {margin:0;}
  .sidebar {gap:.4rem;}
  .progress-block {padding:0 .2rem;}
  .all-courses>div,.atlas-results,.atlas-filters {grid-template-columns:1fr;}
  .card,.atlas-index {padding:1.05rem;border-radius:1rem;}
  .card .actions {align-items:stretch;}
}
@media(max-width:345px) {.site-nav a {padding:.3rem .36rem;} .brand {letter-spacing:0;} .hero-copy h1{font-size:2rem;}}
@media(max-width:680px) {
  .site-header {position:sticky;top:0;z-index:4;}
  .screen {scroll-margin-top:4.35rem;}
}
/* A luminous editorial cover with a compact, persistent learning toolbar. */
body {background:radial-gradient(ellipse at 95% 0%,#e2dfff 0,transparent 36rem),#f6f5fa;}
.home-hero {border-radius:.4rem 3.6rem .4rem 2rem; background-color:#111328; box-shadow:0 .8rem 2.2rem #36234c21;}
.home-hero:before {background:linear-gradient(100deg,#171628 4%,#20182cdb 30%,transparent 70%),linear-gradient(18deg,#3832828c,transparent 55%);}
.home-hero:after {content:"";position:absolute;z-index:-1;pointer-events:none;width:68%;height:60%;right:-8%;top:19%;border:1px solid #f5d2e87a;border-radius:50%;transform:rotate(-25deg);box-shadow:0 12px 0 -11px #aaa5ff80,0 26px 0 -25px #c4a1d666;}
.hero-copy h1 {letter-spacing:-.055em;font-weight:800;}
.hero-copy h1 em {font-style:normal;color:#e7d7ff;}
.cover-links {display:flex;align-items:center;flex-wrap:wrap;gap:.65rem;}
.cover-figure,.hero-start {min-height:3rem;font-size:.96rem;font-weight:730;text-decoration:none;border-radius:.45rem 1.3rem .45rem .45rem;}
.cover-figure {display:inline-flex;align-items:center;gap:.65rem;background:#d7f694;color:#202514;padding:.55rem 1rem;}
.cover-figure span {font-size:.83rem;padding-left:.65rem;border-left:1px solid #859756;}
.hero-start {background:#201a31c9;color:white;border:1px solid #c6b8d5;}
.hero-start:hover {background:#493554;}
.deck {border-radius:.45rem 1.45rem .45rem .45rem;border-top:2px solid #b69ec5;}
.deck:nth-child(3n+2){border-top-color:#d892a9;}
.deck:nth-child(3n){border-top-color:#a7bd84;}
.quick-tools {position:fixed;z-index:8;left:50%;bottom:max(.65rem,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:stretch;gap:.35rem;width:max-content;max-width:calc(100% - 1rem);padding:.38rem;border-radius:1.15rem;background:#242035;box-shadow:0 .35rem 1.2rem #241e3540;}
.quick-tools button,#quick-dialog header button {border:0;border-radius:.85rem;min-height:2.85rem;padding:.48rem .9rem;font-weight:700;cursor:pointer;}
#quick-open {background:#d7f694;color:#24281b;}
#quick-action {background:#41394e;color:white;}
#quick-action:disabled{opacity:.65;}
.has-tools .layout {padding-bottom:calc(6rem + env(safe-area-inset-bottom));}
#quick-dialog {width:min(44rem,calc(100% - 1.2rem));max-height:82dvh;padding:0;border:1px solid #c8bdd6;border-radius:1.25rem;color:var(--ink);background:white;}
#quick-dialog::backdrop {background:#17132699;}
#quick-dialog header {position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;padding:.65rem 1rem;gap:.5rem;background:#f5f0f9;}
#quick-dialog header button {background:white;color:#3a2b48;}
#quick-body {padding:0 .85rem 1rem;}
@media(max-width:680px){.home-hero {min-height:17rem;padding:1.35rem;border-radius:.35rem 2.2rem .35rem 1.4rem;} .hero-intro{margin:.6rem 0 .9rem;} .cover-links{gap:.45rem;} .hero-start{padding:.45rem .75rem;} .cover-figure{flex-wrap:wrap;gap:.3rem;} .quick-tools{width:calc(100% - 1.5rem);} .quick-tools button{flex:1;line-height:1.3;} .quick-tools button span{display:none;} .atlas-detail .back-link{margin:0;}}
.cover-art {
  position:absolute; inset:0; z-index:-2; pointer-events:none;
  background:url("erythrocytes.webp") right 49% / cover no-repeat;
  transform-origin:74% 52%;
}
.title-line {display:block;}
@media(max-width:680px) {.cover-art {background-position:63% center;}}
@media (prefers-reduced-motion: no-preference) {
  .home-hero .cover-art {animation: cell-drift 14s ease-in-out infinite alternate;}
  .home-hero .title-line {animation: title-settle 4.8s ease-in-out both;}
  .home-hero .title-line + .title-line {animation-delay: .25s;}
  @keyframes cell-drift {
    from {transform: scale(1.05) translateX(-.65%);}
    to {transform: scale(1.085) translateX(.65%);}
  }
  @keyframes title-settle {
    from {transform: translateY(.1em);}
    to {transform: translateY(0);}
  }
}
.reason-field {display:grid; gap:.4rem; margin:1rem 0; font-weight:700;}
.reason-field textarea {width:100%; box-sizing:border-box; min-height:6rem; padding:.8rem; border:1px solid #8e8399; border-radius:.65rem; font:inherit; font-weight:400;}
 .home-privacy {font-size:.88rem;color:#524a5d;line-height:1.6;margin:.6rem .15rem 1.2rem;}

.help-entry {display:block; width:100%; margin:.4rem 0 .9rem; padding:.8rem 1rem; text-align:left; border:1px solid #c5b4d6; border-radius:.65rem; color:#382244; background:#f4edf9; font:inherit; cursor:pointer;}
.help-entry span {font-weight:700;}
.study-why {margin:.75rem 0 1rem;}
.study-why summary {padding:.6rem 0; color:#533662; font-weight:650; cursor:pointer;}
.word-link {display:inline; padding:0; border:0; background:transparent; color:inherit; font:inherit; letter-spacing:inherit; text-decoration:underline dotted #917698; text-underline-offset:.18em; cursor:help;}
.word-chip {padding:.45rem .6rem; margin:.15rem; border:1px solid #cbbdd4; border-radius:.5rem; background:#fff; color:#432d51; cursor:pointer;}
.study-words summary {padding:.6rem 0; cursor:pointer; font-weight:650;}
#word-dialog {width:min(24rem,calc(100% - 2rem)); padding:1.25rem; border:1px solid #c9b9cd; border-radius:1rem; color:#312135;}
#word-dialog p {line-height:1.8;}
#word-dialog form {float:right;}
#word-dialog button {padding:.5rem .85rem; border:0; border-radius:.5rem; color:#392643; background:#f1eaf3; cursor:pointer;}
#word-dialog::backdrop {background:#21182770;}
@media(prefers-reduced-motion:no-preference) {
  button,a,summary {transition:background-color .16s,color .16s,opacity .16s;}
  :is(button,a,summary):active {opacity:.76;}
  @keyframes panel-in {from {opacity:.32;} to {opacity:1;}}
  dialog[open],dialog[open]::backdrop,details[open] > :not(summary) {animation:panel-in .18s ease-out;}
  @supports (transition-behavior:allow-discrete) {
    dialog,dialog::backdrop {opacity:0; transition:opacity .18s,display .18s allow-discrete,overlay .18s allow-discrete;}
    dialog[open],dialog[open]::backdrop {opacity:1;}
    details::details-content {opacity:0; transition:opacity .18s,content-visibility .18s allow-discrete;}
    details[open]::details-content {opacity:1;}
  }
}

.intent-panel {margin-block:.65rem;padding:.8rem 1rem;border:1px solid #c5d5d5;border-radius:14px;background:#f4f8f7;color:#193936}
.intent-panel summary {font-weight:700;cursor:pointer}
.intent-panel label,.intent-panel output {display:block;margin-top:.7rem}
.intent-panel textarea,.intent-panel select {display:block;width:100%;box-sizing:border-box;margin-block:.35rem;padding:.65rem;font:inherit;color:#193936;background:white;border:1px solid #8ca9a6;border-radius:8px}
@media (prefers-reduced-motion:no-preference){.intent-panel[open]>:not(summary){animation:intent-in .22s ease-out}@keyframes intent-in{from{opacity:0}to{opacity:1}}}

.study-reason > strong {color:var(--accent-strong);font-size:.9rem}
.study-reason ol {margin:0;padding:.55rem .9rem .55rem 2.2rem;border-inline-start:3px solid #c58f9c;background:#fff8fa}
.study-reason li {padding:.18rem 0;line-height:1.55}
.study-reason li::marker {color:#834458;font-weight:bold}
