/* ---------- Mayday Medical — warm Claude + botanical ---------- */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* warm tan + botanical greens */
  --bg:        #F4EFE6;
  --bg-2:      #EFE7D9;
  --surface:   #FBF7F0;
  --surface-2: #F4EEDF;
  --ink:       #1F2218;
  --ink-soft:  #3A3D2F;
  --muted:     #6D7060;
  --muted-2:   #8E8F7C;
  --line:      #D8D4BF;
  --line-soft: #E5E0CB;

  /* primary is now moss green (was clay); names kept so nothing else moves */
  --clay:      #4F6B3D;   /* deep moss — primary */
  --clay-2:    #3B5230;   /* deeper moss */
  --clay-tint: #DCE4CC;   /* light moss tint */
  --sage:      #7C8E62;   /* warmer botanical sage */
  --sage-2:    #4A5C36;
  --sage-tint: #DCE2CD;
  --leaf-gold: #B89B4A;   /* a touch of warm gold for ornaments */
  --ink-100:   #100E08;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-sm: 0 1px 0 rgba(60, 60, 30, 0.04), 0 1px 3px rgba(60, 60, 30, 0.06);
  --shadow-md: 0 2px 4px rgba(60, 60, 30, 0.06), 0 8px 22px rgba(60, 60, 30, 0.08);
}

:root[data-theme="dark"] {
  --bg:        #181A14;
  --bg-2:      #1F2118;
  --surface:   #22251C;
  --surface-2: #282B21;
  --ink:       #ECEAD6;
  --ink-soft:  #D2D2B9;
  --muted:     #9A9C84;
  --muted-2:   #797B65;
  --line:      #383B2C;
  --line-soft: #2E3124;
  --clay:      #93AE73;
  --clay-2:    #7C9460;
  --clay-tint: #2A301E;
  --sage:      #A5B98A;
  --sage-2:    #C7D6AC;
  --sage-tint: #2C311F;
  --leaf-gold: #D7BB6A;
  --ink-100:   #FFFCEF;
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.35), 0 8px 22px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

.serif { font-family: 'Newsreader', Georgia, serif; font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.78em; letter-spacing: 0.04em; }

h1, h2, h3, h4 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; letter-spacing: -0.015em; margin: 0; color: var(--ink); }
h1 { font-size: 60px; line-height: 1.05; font-weight: 400; }
h2 { font-size: 38px; line-height: 1.1; font-weight: 400; }
h3 { font-size: 24px; line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.3; font-weight: 500; }
p  { margin: 0; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }

/* ---------- helpers ---------- */
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.divider-orn {
  display: flex; align-items: center; gap: 12px;
  color: var(--sage); font-family: 'Newsreader', serif; font-size: 18px;
}
.divider-orn::before, .divider-orn::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--clay); color: #FFF8EE;
  font-weight: 500; font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--clay-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn.ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn.sm { padding: 8px 14px; font-size: 13px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-soft);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card.hov:hover {
  border-color: var(--clay);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ---------- layout ---------- */
.shell {
  max-width: 1240px; margin: 0 auto;
  padding: 28px 36px 80px;
}
@media (max-width: 700px) {
  .shell { padding: 20px 18px 60px; }
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }
}
@media (max-width: 920px) {
  .hdr nav { display: none; }
  .hdr .search { width: 180px; }
}

/* ---------- header ---------- */
.hdr {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.hdr .logo {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  flex-shrink: 0;
}
.hdr .logo-mk {
  width: 32px; height: 32px;
  border-radius: 50%; background: var(--clay);
  display: grid; place-items: center;
  color: #FAF7EE; font-family: 'Newsreader', serif;
  font-size: 14px; font-weight: 600; letter-spacing: 0.06em;
  font-style: italic;
}
.hdr .brand { font-family: 'Newsreader', serif; font-size: 24px; letter-spacing: -0.01em; white-space: nowrap; font-weight: 400; color: var(--ink); }
.hdr .brand .md { color: inherit; font-weight: 400; }
.hdr .brand i { color: var(--sage-2); font-style: italic; font-weight: 400; }
.hdr nav { display: flex; gap: 4px; margin-left: 18px; flex-shrink: 0; }
.hdr nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-soft);
  white-space: nowrap; cursor: pointer;
}
.hdr nav a.active { background: var(--surface-2); color: var(--ink); }
.hdr nav a:hover { color: var(--ink); }
.hdr .grow { flex: 1; }
.hdr .search {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  width: 240px; max-width: 30vw; color: var(--muted);
  cursor: text; flex-shrink: 1; min-width: 0;
}
.hdr .search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.hdr .avatar { flex-shrink: 0; }
.hdr .search:hover { border-color: var(--muted-2); }
.hdr .search input { background: none; border: none; outline: none; width: 100%; font-size: 14px; }
.hdr .search kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line);
}
.hdr .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--sage-tint); color: var(--sage-2);
  display: grid; place-items: center; font-family: 'Newsreader', serif; font-weight: 500;
  border: 1px solid var(--line);
}

/* ---------- breadcrumb ---------- */
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 20px;
}
.crumbs a:hover { color: var(--ink); }
.crumbs span.sep { opacity: 0.5; }
.crumbs .last { color: var(--ink); }

/* ---------- subject / topic grids ---------- */
.grid-3 {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.subject-card {
  padding: 24px; cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 200px;
}
.subject-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.subject-card .ttl { font-family: 'Newsreader', serif; font-size: 26px; line-height: 1.15; }
.subject-card .meta { font-size: 12.5px; color: var(--muted); }
.subject-card .desc { color: var(--ink-soft); font-size: 14px; line-height: 1.55; flex: 1; }
.subject-card .foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--muted);
}
.subject-card .badge {
  background: var(--sage-tint); color: var(--sage-2);
  padding: 2px 8px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.06em;
}
.subject-card .ornament { position: absolute; top: 12px; right: 14px; color: var(--sage); opacity: 0.45; font-family: 'Newsreader', serif; font-size: 22px; }

/* progress bar */
.prog {
  height: 4px; background: var(--line-soft); border-radius: 999px; overflow: hidden;
}
.prog > i {
  display: block; height: 100%; background: var(--clay); border-radius: 999px;
}
.prog.sage > i { background: var(--sage); }

/* mastery dots */
.mastery { display: inline-flex; gap: 3px; }
.mastery i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.mastery i.l { background: var(--clay); opacity: 0.5; }
.mastery i.m { background: var(--sage); }

/* ---------- topic list ---------- */
.topic-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer; margin-bottom: 8px;
}
.topic-row:hover { border-color: var(--clay); }
.topic-row .num {
  font-family: 'Newsreader', serif; font-style: italic; color: var(--muted); width: 28px;
}
.topic-row .ttl { flex: 1; font-size: 16px; }
.topic-row .ttl b { font-weight: 500; }
.topic-row .ttl .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topic-row .right { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }

/* ---------- lesson page ---------- */
.lesson {
  display: grid; grid-template-columns: 1fr 280px; gap: 36px;
}
@media (max-width: 980px) { .lesson { grid-template-columns: 1fr; } }

.lesson h1 { font-size: 48px; margin-bottom: 4px; }
.lesson .deck { color: var(--muted); font-size: 15px; margin-bottom: 28px; }

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  margin-bottom: 18px;
}
.section h3 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; font-size: 22px;
}
.section h3 .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--clay-tint); color: var(--clay-2);
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500;
}
.section p { color: var(--ink-soft); margin-bottom: 10px; }
.section ul { padding-left: 18px; margin: 6px 0 4px; }
.section li { color: var(--ink-soft); margin-bottom: 6px; }
.section li b { font-weight: 600; color: var(--ink); }
.section .kv {
  display: grid; grid-template-columns: 140px 1fr; gap: 6px 18px;
  font-size: 14px; padding: 6px 0;
}
.section .kv .k { color: var(--muted); }
.section .kv .v { color: var(--ink-soft); }

.callout {
  background: var(--clay-tint);
  border-left: 3px solid var(--clay);
  padding: 14px 18px; border-radius: 8px;
  margin: 10px 0;
  font-size: 14px; color: var(--ink-soft);
}
.callout b { color: var(--clay-2); }
.callout.sage { background: var(--sage-tint); border-left-color: var(--sage); }
.callout.sage b { color: var(--sage-2); }

.toc {
  position: sticky; top: 20px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.toc .lab { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc a {
  display: block; padding: 6px 10px; border-radius: 6px;
  color: var(--ink-soft); font-size: 13.5px;
  border-left: 2px solid transparent; margin-left: -10px; padding-left: 10px;
}
.toc a:hover { color: var(--ink); background: var(--bg-2); }
.toc a.active { color: var(--clay-2); border-left-color: var(--clay); }
.toc .mini {
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line);
}
.toc .mini .row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; color: var(--muted); }
.toc .mini .row b { color: var(--ink); font-weight: 500; }

/* ---------- Qbank ---------- */
.qbank { padding: 28px 32px; }
.qbank .stem { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 18px; }
.qbank .stem b { color: var(--ink); }
.qopt {
  display: flex; gap: 14px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer;
  transition: all .15s ease;
}
.qopt:hover { border-color: var(--muted-2); background: var(--surface-2); }
.qopt .letter {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  flex-shrink: 0;
}
.qopt.sel { border-color: var(--clay); background: var(--clay-tint); }
.qopt.sel .letter { background: var(--clay); color: #FFF8EE; border-color: var(--clay); }
.qopt.correct { border-color: var(--sage); background: var(--sage-tint); }
.qopt.correct .letter { background: var(--sage); color: #FFF8EE; border-color: var(--sage); }
.qopt.wrong { opacity: 0.55; }
.qopt .body { font-size: 14.5px; color: var(--ink-soft); }
.qexplain {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--bg-2); border-radius: 10px;
  font-size: 14px; color: var(--ink-soft); line-height: 1.6;
}
.qexplain h4 { margin-bottom: 6px; font-size: 15px; font-family: 'DM Sans', sans-serif; font-weight: 600; }

/* ---------- Flashcards ---------- */
.flash-wrap { perspective: 1200px; }
.flash {
  position: relative; height: 220px;
  transition: transform .55s cubic-bezier(.5,.1,.3,1);
  transform-style: preserve-3d;
  cursor: pointer;
}
.flash.flipped { transform: rotateY(180deg); }
.flash .face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 10px;
}
.flash .face.back { transform: rotateY(180deg); background: var(--surface-2); }
.flash .face .q { font-family: 'Newsreader', serif; font-size: 24px; line-height: 1.25; }
.flash .face .a { font-size: 15px; color: var(--ink-soft); line-height: 1.55; max-width: 480px; }
.flash .face .lab { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.flash-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.flash-bar .controls { display: flex; gap: 8px; }
.flash-bar .ix { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }

/* ---------- landing hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px;
  padding: 40px 0 56px;
  align-items: center;
}
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; gap: 36px; } }
.hero h1 .it { font-style: italic; color: var(--sage-2); font-weight: 400; }
.hero p.lede { color: var(--ink-soft); font-size: 18px; line-height: 1.6; max-width: 540px; margin-top: 18px; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 28px; }
.hero .stats { display: flex; gap: 30px; margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.hero .stats .stat .n { font-family: 'Newsreader', serif; font-size: 28px; color: var(--ink); }
.hero .stats .stat .l { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }

/* botanical SVG-friendly placeholder card */
.botanical-frame {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  aspect-ratio: 4/5;
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
}
.botanical-frame .stripe {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, transparent 0 18px, var(--line-soft) 18px 19px);
  opacity: 0.7;
}
.botanical-frame .label {
  position: relative; z-index: 1; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em; color: var(--muted);
  background: var(--surface); padding: 8px 14px; border: 1px solid var(--line); border-radius: 4px;
}
.botanical-frame .inner-border {
  position: absolute; inset: 22px; border: 1px solid var(--line);
  z-index: 0;
}
.botanical-frame .corner {
  position: absolute; color: var(--sage); font-family: 'Newsreader', serif; font-size: 28px;
}
.botanical-frame .c1 { top: 8px; left: 12px; }
.botanical-frame .c2 { top: 8px; right: 12px; transform: scaleX(-1); }
.botanical-frame .c3 { bottom: 8px; left: 12px; transform: scaleY(-1); }
.botanical-frame .c4 { bottom: 8px; right: 12px; transform: scale(-1, -1); }

/* tag-pill row */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-soft); cursor: pointer;
}
.pill.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill:hover:not(.active) { border-color: var(--muted-2); }

/* search overlay */
.search-ov {
  position: fixed; inset: 0; background: rgba(20, 14, 8, 0.45);
  z-index: 80; display: grid; place-items: start center;
  padding-top: 14vh;
  backdrop-filter: blur(2px);
}
.search-box {
  width: min(620px, 92vw); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.search-box .ib {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.search-box input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 17px;
}
.search-box .results { max-height: 60vh; overflow: auto; padding: 6px; }
.search-result {
  padding: 12px 14px; border-radius: 8px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.search-result:hover, .search-result.hl { background: var(--bg-2); }
.search-result .kind { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted); width: 64px; }
.search-result .ttl { font-size: 14.5px; flex: 1; }
.search-result .path { font-size: 11.5px; color: var(--muted); }

/* footer */
.foot {
  margin-top: 60px; padding-top: 36px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 13px;
}
.foot .ornament { color: var(--sage); font-family: 'Newsreader', serif; font-size: 20px; }

/* misc */
.muted { color: var(--muted); }
.ink-soft { color: var(--ink-soft); }
.row { display: flex; align-items: center; gap: 14px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 8px; } .gap-md { gap: 14px; } .gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 28px; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 28px; }

/* page transitions */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade { animation: fadeUp .35s ease both; }

/* ===================== additions ===================== */

/* brand mark logo: M + D */
.hdr .logo-mk .md-mark {
  font-family: 'Newsreader', serif; font-style: italic;
  letter-spacing: -0.02em;
}

/* section tabs (Step 1 hub) */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; align-self: flex-start; flex-wrap: wrap;
}
.tab {
  padding: 8px 16px; border-radius: 999px;
  font-size: 13.5px; color: var(--ink-soft);
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--clay); color: #FAF7EE; box-shadow: var(--shadow-sm); }
.tab .count { font-size: 11px; opacity: 0.7; font-family: 'JetBrains Mono', monospace; }

/* botanical vine column (lesson page left margin) */
.vine-col {
  width: 36px; pointer-events: none; flex-shrink: 0;
  display: flex; align-items: stretch;
}
.vine-col svg { width: 100%; height: 100%; }

/* picture placeholder */
.pic {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  margin: 14px 0;
  position: relative;
  overflow: hidden;
}
.pic .pic-frame {
  aspect-ratio: 16/9;
  border: 1px dashed var(--line);
  border-radius: 6px;
  display: grid; place-items: center;
  background-image: repeating-linear-gradient(45deg, transparent 0 14px, var(--line-soft) 14px 15px);
  position: relative;
}
.pic .pic-frame .label {
  background: var(--surface); padding: 6px 12px; border-radius: 4px;
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase;
  z-index: 1;
}
.pic .cap {
  margin-top: 10px; font-size: 13px; color: var(--muted);
  font-style: italic;
}

/* ways-to-think note (handwritten / personal note feel) */
.note {
  position: relative;
  background: linear-gradient(180deg, #FBF7E5 0%, #F6F0DA 100%);
  border: 1px solid var(--leaf-gold);
  border-radius: var(--r-md);
  padding: 22px 26px 22px 28px;
  margin: 18px 0;
  color: #3A3D2F;
  box-shadow: 0 1px 0 #fff inset, var(--shadow-sm);
}
:root[data-theme="dark"] .note {
  background: linear-gradient(180deg, #2A2B1A 0%, #232416 100%);
  color: var(--ink-soft);
}
.note::before {
  content: '';
  position: absolute; left: 12px; top: 14px; bottom: 14px; width: 2px;
  background: var(--leaf-gold); border-radius: 2px;
  opacity: 0.45;
}
.note .lab {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--leaf-gold);
  margin-bottom: 8px;
}
.note .body {
  font-family: 'Newsreader', serif; font-size: 18px; line-height: 1.55;
  font-style: italic;
}
.note .body.empty {
  color: var(--muted); font-style: italic;
  font-family: 'Newsreader', serif;
}
.note .edit-stub {
  display: inline-block; margin-top: 12px; font-size: 12px; color: var(--muted);
  font-family: 'DM Sans', sans-serif; font-style: normal;
}

/* cross-reference inline */
.xref {
  color: var(--clay-2);
  border-bottom: 1px dotted var(--clay);
  cursor: pointer; font-weight: 500;
  padding: 1px 0;
}
.xref:hover { background: var(--clay-tint); }
.xref::before { content: '⤳ '; opacity: 0.6; margin-right: 1px; font-size: 0.85em; }

/* see also card */
.see-also {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 16px 0;
}
.see-also .lab {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--sage-2);
  margin-bottom: 10px;
}
.see-also ul { padding-left: 0; list-style: none; margin: 0; }
.see-also li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px dashed var(--line-soft);
  cursor: pointer; color: var(--ink-soft);
}
.see-also li:last-child { border-bottom: none; }
.see-also li:hover { color: var(--clay-2); }
.see-also li .path { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* anki button */
.anki-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--sage-tint); color: var(--sage-2);
  border: 1px solid var(--sage); border-style: dashed;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.anki-btn:hover { background: var(--sage); color: #FAF7EE; }
.anki-btn .ico { font-size: 14px; }
.anki-btn[disabled] { opacity: 0.85; cursor: pointer; }

/* tooltip */
.tip-wrap { position: relative; display: inline-flex; }
.tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 6px 10px; border-radius: 6px;
  font-size: 12px; white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity .12s ease;
  z-index: 50;
}
.tip-wrap:hover .tip { opacity: 1; }

/* dashboard */
.dash-grid {
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 22px;
}
@media (max-width: 920px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
}
.dash-hero .big {
  font-family: 'Newsreader', serif; font-size: 72px; line-height: 1;
  color: var(--ink);
}
.dash-hero .big .pct { font-size: 28px; color: var(--muted); margin-left: 4px; }
.dash-hero .bar-row {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; height: 80px;
  margin-top: 4px;
}
.dash-hero .bar {
  background: var(--clay-tint); border-radius: 4px 4px 1px 1px;
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative; align-items: center;
}
.dash-hero .bar i {
  display: block; width: 100%; background: var(--clay); border-radius: 4px 4px 1px 1px;
}
.dash-hero .bar .lab {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted);
  position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.dash-card h4 { margin-bottom: 12px; }
.dash-list .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--line-soft);
}
.dash-list .row:last-child { border-bottom: none; }
.dash-list .row .name { font-size: 14px; color: var(--ink-soft); }
.dash-list .row .name b { font-weight: 500; color: var(--ink); }
.dash-list .row .meta { font-size: 12px; color: var(--muted); }
.suggest-card {
  display: flex; gap: 14px;
  padding: 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  margin-bottom: 8px; cursor: pointer;
}
.suggest-card:hover { border-color: var(--clay); }
.suggest-card .ico { color: var(--clay); flex-shrink: 0; padding-top: 2px; }
.suggest-card .ttl { font-size: 14.5px; font-weight: 500; }
.suggest-card .desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* signature flourish for the divider-orn use cases */
.flourish {
  display: inline-block; color: var(--sage); opacity: 0.7;
}

/* compact card row utility */
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }


/* ============================================================
   Library hub sub-tabs bar
   ============================================================ */
.library-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 24px;
  margin-top: 18px;
}
.library-bar-inner {
  display: flex; gap: 24px; flex-wrap: wrap;
  justify-content: space-between; align-items: center;
}
.library-bar-title { display: flex; flex-direction: column; gap: 4px; }
.library-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  padding: 4px; border-radius: 999px;
}
.library-tab {
  padding: 8px 16px; border-radius: 999px;
  font-size: 13.5px; color: var(--ink-soft);
  font-family: 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  background: transparent;
}
.library-tab:hover { color: var(--ink); }
.library-tab.active {
  background: var(--clay); color: #FAF7EE;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Rapid Dx
   ============================================================ */

/* status dots used in headers and section cards */
.dot.correct   { background: var(--sage-2); }
.dot.incorrect { background: #B85C3F; }
.dot.notdone   { background: var(--muted-2); }
.dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 999px; vertical-align: middle;
  margin-right: 6px;
}

.rdx-stat-card {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  min-width: 280px;
}
.rdx-stat-mini { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-soft); }

.rdx-section-card { padding: 22px; cursor: pointer; position: relative; }

/* status badge (corner of question card) */
.rdx-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2);
  color: var(--muted);
  white-space: nowrap;
}
.rdx-badge.correct   { color: var(--sage-2); border-color: var(--sage-tint); background: var(--sage-tint); }
.rdx-badge.incorrect { color: #B85C3F; border-color: rgba(184,92,63,0.25); background: rgba(184,92,63,0.08); }
.rdx-badge.notdone   { color: var(--muted); }

/* question card */
.rdx-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .15s ease;
}
.rdx-card.open { border-color: var(--clay); }
.rdx-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px; align-items: flex-start;
  padding: 18px 22px;
  cursor: pointer;
}
.rdx-head:hover { background: var(--surface-2); }
.rdx-num {
  color: var(--muted); font-size: 13px;
  letter-spacing: 0.08em;
  padding-top: 2px;
}
.rdx-vignette {
  font-size: 15px; line-height: 1.55; color: var(--ink-soft);
}
.rdx-meta {
  display: flex; gap: 10px; align-items: center; flex-shrink: 0;
}
.rdx-chev { color: var(--muted); font-size: 13px; padding-left: 4px; }

.rdx-body {
  padding: 4px 22px 22px 22px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-2);
}
.rdx-part { margin-top: 18px; }
.rdx-part-label {
  display: flex; align-items: baseline; gap: 10px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 16px; font-weight: 500;
  margin-bottom: 10px;
}
.rdx-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.rdx-opt {
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.rdx-opt:hover:not(:disabled) { border-color: var(--clay); background: var(--surface-2); }
.rdx-opt.picked {
  border-color: var(--clay); background: var(--clay-tint); color: var(--clay-2);
  font-weight: 500;
}
.rdx-opt.correct {
  border-color: var(--sage-2);
  background: var(--sage-tint);
  color: var(--sage-2);
  font-weight: 500;
}
.rdx-opt.incorrect {
  border-color: rgba(184,92,63,0.5);
  background: rgba(184,92,63,0.08);
  color: #8E3F26;
  font-weight: 500;
}
.rdx-opt:disabled { cursor: default; }
.rdx-explain {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-left: 3px solid var(--sage);
  border-radius: 6px;
  font-size: 13.5px; line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
}
.rdx-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rdx-score {
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line);
}

/* ============================================================
   Tools cards
   ============================================================ */
.tool-card {
  padding: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.tool-thumb { background: var(--bg-2); padding: 18px 18px 0 18px; }
.tool-body { padding: 16px 20px 20px 20px; }
.tool-card .btn:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }

/* responsive: stack the library bar on small screens */
@media (max-width: 720px) {
  .library-bar-inner { flex-direction: column; align-items: stretch; }
  .library-tabs { justify-content: flex-start; }
  .rdx-head { grid-template-columns: 36px 1fr; }
  .rdx-head .rdx-meta { grid-column: 2; padding-top: 6px; }
}


/* ============================================================
   Header dropdown (Library)
   ============================================================ */
.hdr-dropdown { position: relative; display: inline-block; }
.hdr-dd-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
}
.hdr-dd-caret {
  font-size: 9px; opacity: 0.5; transform: translateY(1px);
  transition: transform .15s ease, opacity .15s ease;
}
.hdr-dropdown:hover .hdr-dd-caret { opacity: 0.85; }
.hdr-dropdown:hover .hdr-dd-trigger { color: var(--ink); }
.hdr-dd-menu {
  position: absolute; top: calc(100% + 10px); left: -10px;
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 8px;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 200;
}
.hdr-dd-menu.open {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.hdr-dd-menu::before {
  content: ''; position: absolute; top: -8px; left: 28px;
  width: 14px; height: 14px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-top:  1px solid var(--line);
  transform: rotate(45deg);
  z-index: -1;
}
.hdr-dd-item {
  display: flex; gap: 12px; align-items: flex-start;
  width: 100%; text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent; cursor: pointer;
  transition: background .12s ease;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.hdr-dd-item:hover { background: var(--bg-2); }
.hdr-dd-item-l { padding-top: 2px; flex-shrink: 0; }
.hdr-dd-item-text { min-width: 0; }
.hdr-dd-item-title { font-weight: 500; color: var(--ink); font-size: 14px; }
.hdr-dd-item-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }

/* ============================================================
   Account menu
   ============================================================ */
.acct-wrap { position: relative; }
.acct-trigger {
  padding: 0; background: none; border-radius: 999px;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.acct-trigger:hover { transform: scale(1.04); box-shadow: var(--shadow-sm); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 14px;
  z-index: 200;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.acct-menu-head {
  display: flex; gap: 12px; align-items: center;
  padding: 4px 6px 14px 6px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}
.acct-menu-list { display: flex; flex-direction: column; gap: 2px; }
.acct-menu-list button {
  width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px;
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 14px;
  color: var(--ink-soft); background: transparent;
  cursor: pointer; transition: background .1s ease, color .1s ease;
}
.acct-menu-list button:hover { background: var(--bg-2); color: var(--ink); }
.acct-menu-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }

/* ============================================================
   Auth modal
   ============================================================ */
.auth-ov {
  position: fixed; inset: 0;
  background: rgba(31, 34, 24, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fadeIn .18s ease;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 420px;
  padding: 30px 28px;
  position: relative;
}
.auth-close {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px; border-radius: 999px;
  font-size: 20px; line-height: 1; color: var(--muted);
  cursor: pointer;
}
.auth-close:hover { background: var(--bg-2); color: var(--ink); }
.auth-field {
  display: block; margin-top: 14px;
}
.auth-field > span {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase;
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; font-size: 14.5px;
  color: var(--ink); outline: none;
  transition: border-color .12s ease, background .12s ease;
}
.auth-field input:focus {
  border-color: var(--clay);
  background: var(--surface);
}
.auth-err {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(184, 92, 63, 0.08);
  border: 1px solid rgba(184, 92, 63, 0.3);
  border-radius: 8px;
  color: #8E3F26;
  font-size: 13.5px;
}
.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.auth-switch a {
  color: var(--clay); cursor: pointer; font-weight: 500;
  border-bottom: 1px dotted var(--clay);
}
.auth-switch a:hover { color: var(--clay-2); }
.auth-note {
  margin-top: 14px;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted-2);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
}

/* ============================================================
   Topic description block
   ============================================================ */
.topic-desc {
  margin-top: 22px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: 10px;
}
.topic-desc .eyebrow { margin-bottom: 8px; }
.topic-desc p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 19px; line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ============================================================
   Comments section
   ============================================================ */
.comments {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.comments-head { margin-bottom: 22px; }
.comment-compose {
  display: flex; gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 22px;
}
.comment-compose textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  font-family: inherit; font-size: 14px;
  color: var(--ink); resize: vertical;
  outline: none; min-height: 70px;
  transition: border-color .12s ease, background .12s ease;
}
.comment-compose textarea:focus { border-color: var(--clay); background: var(--surface); }
.comment-signin {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap;
  padding: 6px 4px;
}
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment {
  display: flex; gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.comment-body {
  margin-top: 6px;
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment-del {
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  color: var(--muted); cursor: pointer;
  border-bottom: 1px dotted var(--muted);
}
.comment-del:hover { color: #8E3F26; border-color: #8E3F26; }
.comment-empty {
  padding: 24px;
  text-align: center; font-size: 14px;
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

/* ============================================================
   Rapids — filter builder
   ============================================================ */
.rapids-filter {
  display: flex; flex-direction: column; gap: 18px;
  margin-top: 8px;
}
.filter-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.filter-block h4 { font-family: 'Newsreader', Georgia, serif; }
.rapids-filter-foot {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
  padding: 18px 24px;
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}
.link-btn {
  font-size: 11.5px; font-family: 'JetBrains Mono', monospace;
  color: var(--clay); cursor: pointer;
  letter-spacing: 0.04em; padding: 2px 4px;
  border-radius: 4px;
}
.link-btn:hover { background: var(--clay-tint); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 999px;
  background: var(--line);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--clay);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--clay);
  border: none;
  cursor: pointer;
}

/* ============================================================
   Rapids — quiz
   ============================================================ */
.quiz-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin: 6px 0 22px 0; gap: 24px; flex-wrap: wrap;
}
.quiz-actions { display: flex; align-items: center; gap: 16px; }
.quiz-progress {
  width: 220px; height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress i {
  display: block; height: 100%;
  background: var(--clay);
  transition: width .25s ease;
}
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.quiz-vignette {
  padding: 28px 32px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.quiz-vignette p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 20px; line-height: 1.55;
  color: var(--ink);
  margin-top: 6px;
  text-wrap: pretty;
}
.quiz-part {
  padding: 22px 32px;
  border-top: 1px solid var(--line-soft);
  animation: slideIn .22s ease;
}
.quiz-part:first-of-type { border-top: 0; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quiz-part-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.quiz-part-label {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 19px; font-weight: 500;
}
.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.rdx-opt.dim { opacity: 0.5; }

.quiz-summary {
  padding: 24px 32px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.rating-bar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.rating-prompt {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 17px; margin-bottom: 10px;
}
.rating-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.rating {
  padding: 14px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  text-align: center; font-family: 'DM Sans', system-ui, sans-serif;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease;
}
.rating:hover { transform: translateY(-1px); }
.rating.solid {
  background: var(--sage-tint);
  border-color: var(--sage);
  color: var(--sage-2);
}
.rating.solid:hover { background: var(--sage); color: #FAF7EE; }
.rating.shaky {
  background: rgba(184, 155, 74, 0.18);
  border-color: var(--leaf-gold);
  color: #6E5A1F;
}
.rating.shaky:hover { background: var(--leaf-gold); color: #FAF7EE; }
.rating.lost {
  background: rgba(184, 92, 63, 0.10);
  border-color: rgba(184, 92, 63, 0.5);
  color: #8E3F26;
}
.rating.lost:hover { background: #B85C3F; color: #FAF7EE; }

.quiz-end {
  margin-top: 24px;
}
.quiz-end-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-top: 24px;
}

/* Responsive: stack ratings */
@media (max-width: 640px) {
  .rating-buttons { grid-template-columns: 1fr; }
  .quiz-progress { width: 120px; }
  .acct-menu { right: -10px; width: 260px; }
  .hdr-dd-menu { left: -60px; min-width: 260px; }
}
