/* ---------- Design tokens ---------- */
:root {
  --paper: #faf5ec;
  --paper-2: #f3ebdc;
  --ink: #2c2438;
  --ink-soft: #6b6178;
  --line: #e4d9c6;
  --card: #ffffff;

  --red: #c0392b;
  --red-bright: #e04b3a;
  --gold: #f2b134;
  --gold-soft: #ffd98a;

  --radical: #2f9e97;
  --radical-soft: #e2f4f2;
  --hanzi: #d1493a;
  --hanzi-soft: #fbe9e5;
  --vocab: #8e5bd1;
  --vocab-soft: #f0e8fb;

  --apprentice: #e0656e;
  --guru: #9a5dc9;
  --master: #4a6fd4;
  --enlightened: #3aa2c9;
  --burned: #52465e;

  --quiz-bg: #221b2e;
  --quiz-card: #2e2540;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(44, 36, 56, 0.08), 0 8px 30px rgba(44, 36, 56, 0.06);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-han: "Songti SC", "Noto Serif SC", "SimSun", "PingFang SC", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
a { color: inherit; }

/* ---------- Layout / nav ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0.7rem 1.4rem;
  background: #fffdf8;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.05rem; text-decoration: none;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-han); font-size: 1.25rem;
  box-shadow: 0 2px 6px rgba(192, 57, 43, 0.35);
}
.topbar nav { display: flex; gap: 0.2rem; margin-left: auto; }
.topbar nav a {
  text-decoration: none; padding: 0.45rem 0.85rem; border-radius: 8px;
  font-size: 0.92rem; font-weight: 600; color: var(--ink-soft);
}
.topbar nav a:hover { background: var(--paper-2); color: var(--ink); }
.topbar nav a.active { background: var(--ink); color: #fff; }
.level-chip {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em;
  background: var(--gold-soft); color: #7a5410;
  border-radius: 999px; padding: 0.3rem 0.75rem;
}

main { max-width: 1020px; margin: 0 auto; padding: 1.6rem 1.4rem 4rem; }

/* ---------- Dashboard ---------- */
.hero {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  position: relative; margin-bottom: 1.4rem;
}
.hero svg { display: block; width: 100%; height: 210px; }
.hero .hero-text {
  position: absolute; left: 1.6rem; bottom: 1.2rem; color: #fff;
}
.hero .hero-text h1 { font-size: 1.7rem; text-shadow: 0 2px 12px rgba(0,0,0,0.45); }
.hero .hero-text p { opacity: 0.92; text-shadow: 0 1px 8px rgba(0,0,0,0.5); font-size: 0.95rem; }

.byline {
  text-align: center; color: var(--ink-soft); font-size: 0.92rem;
  font-style: italic; margin: -0.5rem 0 1.2rem;
}

.tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.4rem; }
@media (max-width: 640px) { .tile-row { grid-template-columns: 1fr; } }

.big-tile {
  border-radius: var(--radius); padding: 1.3rem 1.4rem; color: #fff;
  display: flex; align-items: center; gap: 1.1rem;
  box-shadow: var(--shadow); border: none; text-align: left; width: 100%;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.big-tile:hover { transform: translateY(-2px); filter: brightness(1.05); }
.big-tile:disabled { filter: grayscale(0.55) brightness(0.92); cursor: default; transform: none; }
.big-tile .count { font-size: 2.6rem; font-weight: 800; line-height: 1; min-width: 3.2rem; }
.big-tile .label { font-size: 1.15rem; font-weight: 700; }
.big-tile .sub { font-size: 0.85rem; opacity: 0.9; margin-top: 0.15rem; }
.tile-lessons { background: linear-gradient(135deg, #f2596b, #d1387c); }
.tile-reviews { background: linear-gradient(135deg, #35a5c9, #2f6fd4); }

.panel-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; margin-bottom: 1.4rem; }
@media (max-width: 760px) { .panel-row { grid-template-columns: 1fr; } }
.panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.15rem 1.3rem;
}
.panel h2 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-soft); margin-bottom: 0.9rem;
}

.progress-wrap { display: flex; align-items: center; gap: 1.2rem; }
.ring { width: 110px; height: 110px; flex: none; }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--paper-2); }
.ring .bar {
  stroke: var(--gold); stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.6s ease;
}
.ring text { font-size: 1.35rem; font-weight: 800; fill: var(--ink); }
.ring .ring-sub { font-size: 0.55rem; fill: var(--ink-soft); font-weight: 600; }

.srs-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.srs-cell {
  flex: 1; min-width: 74px; border-radius: 10px; color: #fff;
  padding: 0.6rem 0.4rem; text-align: center;
}
.srs-cell .n { font-size: 1.35rem; font-weight: 800; }
.srs-cell .t { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.92; }
.srs-apprentice { background: var(--apprentice); }
.srs-guru { background: var(--guru); }
.srs-master { background: var(--master); }
.srs-enlightened { background: var(--enlightened); }
.srs-burned { background: var(--burned); }

.forecast { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.forecast .bar-col {
  flex: 1; background: linear-gradient(180deg, #6ec3dd, #3a9dc9);
  border-radius: 3px 3px 0 0; min-height: 2px; position: relative;
}
.forecast .bar-col span {
  position: absolute; top: -1.2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.62rem; font-weight: 700; color: var(--ink-soft);
}
.forecast-labels { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--ink-soft); margin-top: 0.35rem; }
.muted-note { color: var(--ink-soft); font-size: 0.88rem; }
.empty-art { text-align: center; padding: 0.6rem 0; }
.empty-art svg { width: 130px; height: auto; opacity: 0.9; }

/* ---------- Item colors ---------- */
.c-radical { background: var(--radical); }
.c-hanzi { background: var(--hanzi); }
.c-vocab { background: var(--vocab); }

/* ---------- Items browser ---------- */
.level-section { margin-bottom: 1.8rem; }
.level-section h2 {
  font-size: 1.05rem; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.6rem;
}
.level-section h2 .lv {
  background: var(--ink); color: var(--gold-soft); font-size: 0.75rem;
  border-radius: 6px; padding: 0.2rem 0.5rem; letter-spacing: 0.04em;
}
.item-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.item-chip {
  border: none; border-radius: 10px; color: #fff; position: relative;
  min-width: 58px; padding: 0.5rem 0.65rem 0.4rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  box-shadow: 0 2px 5px rgba(44,36,56,0.16);
  transition: transform 0.1s ease;
}
.item-chip:hover { transform: translateY(-2px) scale(1.03); }
.item-chip .ch { font-family: var(--font-han); font-size: 1.5rem; line-height: 1.15; }
.item-chip .py { font-size: 0.62rem; opacity: 0.92; }
.item-chip.locked { filter: grayscale(0.9) opacity(0.45); }
.item-chip .burn-dot {
  position: absolute; top: 4px; right: 5px; width: 7px; height: 7px;
  background: var(--gold-soft); border-radius: 50%;
}

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(30, 24, 44, 0.55);
  display: grid; place-items: center; z-index: 60; padding: 1rem;
}
.modal {
  background: var(--card); border-radius: var(--radius); max-width: 560px; width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}
.modal-head { color: #fff; padding: 1.5rem 1.5rem 1.2rem; border-radius: var(--radius) var(--radius) 0 0; text-align: center; }
.modal-head .big-char { font-family: var(--font-han); font-size: 4rem; line-height: 1.15; }
.modal-head .reading { font-size: 1.15rem; margin-top: 0.45rem; }
.modal-head .primary { font-size: 1rem; font-weight: 700; margin-top: 0.45rem; }
/* the color language: reading = dark pill, meaning = light pill */
.tag-reading {
  display: inline-block; background: rgba(34, 27, 46, 0.55); color: #fff;
  border-radius: 999px; padding: 0.22rem 0.9rem;
}
.tag-meaning {
  display: inline-block; background: rgba(255, 253, 248, 0.92); color: var(--ink);
  border-radius: 999px; padding: 0.22rem 0.9rem;
}
.modal-body { padding: 1.2rem 1.5rem 1.5rem; }
.modal-body h3 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-soft); margin: 0.9rem 0 0.4rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.modal-body h3::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--line); }
h3.sec-mnemonic { color: var(--radical); } h3.sec-mnemonic::before { background: var(--radical); }
h3.sec-parts { color: var(--hanzi); } h3.sec-parts::before { background: var(--hanzi); }
h3.sec-example { color: var(--vocab); } h3.sec-example::before { background: var(--vocab); }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { font-size: 0.95rem; line-height: 1.55; }
.example-zh { font-family: var(--font-han); font-size: 1.15rem; }
.example-py { color: var(--ink-soft); font-size: 0.88rem; }
.example-en { font-size: 0.92rem; margin-top: 0.15rem; }
.component-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.stage-pill {
  display: inline-block; border-radius: 999px; color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.7rem; letter-spacing: 0.04em;
}
.modal-close {
  display: block; margin: 0 auto 1.2rem; border: none; background: var(--paper-2);
  border-radius: 8px; padding: 0.5rem 1.4rem; font-weight: 600; color: var(--ink-soft);
}
.modal-close:hover { background: var(--line); }

/* ---------- Lessons ---------- */
.lesson-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; max-width: 640px; margin: 0 auto;
}
.lesson-progress { display: flex; gap: 4px; margin: 0 auto 1rem; max-width: 640px; }
.lesson-progress .seg { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.lesson-progress .seg.done { background: var(--gold); }
.lesson-nav { display: flex; justify-content: space-between; max-width: 640px; margin: 1rem auto 0; }
.btn {
  border: none; border-radius: 10px; padding: 0.7rem 1.5rem; font-size: 0.95rem;
  font-weight: 700; transition: transform 0.1s ease, filter 0.1s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-gold { background: var(--gold); color: #5a3d08; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--paper-2); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; filter: none; }

/* ---------- Quiz ---------- */
.quiz-screen {
  position: fixed; inset: 0; z-index: 50; background: var(--quiz-bg);
  display: flex; flex-direction: column; color: #f2ecf7;
}
.quiz-top { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1.2rem; }
.quiz-top .bar { flex: 1; height: 8px; background: rgba(255,255,255,0.13); border-radius: 4px; overflow: hidden; }
.quiz-top .bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width 0.3s ease; }
.quiz-top .quit { background: none; border: none; color: rgba(255,255,255,0.6); font-size: 1.3rem; }
.quiz-top .quit:hover { color: #fff; }
.quiz-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.quiz-char-wrap { text-align: center; padding: 1.5rem 3rem 1.2rem; border-radius: var(--radius); margin-bottom: 0.4rem; }
.quiz-char { font-family: var(--font-han); font-size: clamp(4rem, 14vw, 7.5rem); line-height: 1.1; color: #fff; }
.quiz-type-tag {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.85);
}
.quiz-question {
  font-size: 1.05rem; font-weight: 700; padding: 0.6rem 1.6rem; border-radius: 8px; margin: 0 0 1rem;
}
.q-meaning { background: #fffdf8; color: #2c2438; }
.q-reading { background: #221b2e; color: #fff; }

/* the whole answer area flips with the question type */
.answer-zone {
  width: min(560px, 92vw); border-radius: 16px; margin-top: 1rem;
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex; flex-direction: column; align-items: center;
}
.zone-meaning { background: #efe7db; }
.zone-meaning .quiz-feedback, .zone-meaning .quiz-hint { color: #55495f; }
.zone-meaning .quiz-feedback .answer { color: #8a5d10; }
.zone-reading { background: #3a3151; }
.quiz-input {
  width: min(430px, 86vw); font-size: 1.25rem; text-align: center;
  padding: 0.75rem 1rem; border-radius: 10px; border: 2px solid transparent; outline: none;
  background: #fffdf8; color: var(--ink);
}
.quiz-input:focus { border-color: var(--gold); }
.quiz-input.correct { background: #d9f2df; border-color: #3fa963; color: #1d5c34; }
.quiz-input.wrong { background: #f8dcd8; border-color: var(--red-bright); color: #8c271c; }
.quiz-input.shake { animation: shake 0.4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}
.tone-row { display: flex; gap: 0.45rem; margin-top: 0.7rem; }
.tone-row button {
  min-width: 44px; height: 40px; border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08); color: #f2ecf7; border-radius: 9px;
  font-size: 1.15rem; font-family: var(--font-ui);
  transition: background 0.1s ease, transform 0.1s ease;
}
.tone-row button:hover { background: rgba(255,255,255,0.2); transform: translateY(-1px); }
.tone-row button:active { transform: translateY(0); }

.quiz-feedback { min-height: 2.2rem; margin-top: 0.8rem; font-size: 0.95rem; text-align: center; }
.quiz-feedback .answer { font-weight: 700; color: var(--gold-soft); }
.quiz-hint { color: rgba(255,255,255,0.55); font-size: 0.85rem; margin-top: 0.4rem; }
.quiz-continue { margin-top: 1rem; }

/* ---------- Summary ---------- */
.summary { max-width: 640px; margin: 0 auto; text-align: center; }
.summary .acc { font-size: 3.2rem; font-weight: 800; margin: 0.5rem 0 0.2rem; }
.summary-lists { text-align: left; margin-top: 1.4rem; display: grid; gap: 1rem; }
.summary-item {
  display: flex; align-items: center; gap: 0.8rem; background: var(--card);
  border-radius: 10px; padding: 0.6rem 0.9rem; box-shadow: var(--shadow);
}
.summary-item .ch { font-family: var(--font-han); font-size: 1.6rem; width: 2.4rem; text-align: center; border-radius: 8px; color: #fff; padding: 0.15rem 0; }
.summary-item .meta { flex: 1; font-size: 0.88rem; }
.summary-item .meta b { font-size: 0.95rem; }
.summary-item .shift { font-size: 0.78rem; font-weight: 700; }
.shift.up { color: #2e8b57; }
.shift.down { color: var(--red-bright); }

/* ---------- Level up overlay ---------- */
.levelup {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(30, 24, 44, 0.72); animation: fadein 0.3s ease;
}
.levelup .box {
  background: var(--paper); border-radius: var(--radius); padding: 2.2rem 3rem;
  text-align: center; position: relative; box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}
.levelup svg.sealed { width: 90px; height: 90px; margin-bottom: 0.6rem; }
.levelup h2 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.confetti { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); pointer-events: none; }
.confetti rect { animation: burst 1.4s ease-out var(--delay) forwards; opacity: 0; }
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Settings ---------- */
.settings-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.6rem; }
textarea.io {
  width: 100%; min-height: 140px; font-family: ui-monospace, monospace; font-size: 0.78rem;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem; margin-top: 0.6rem;
  background: #fffdf8; color: var(--ink);
}

.footer-note { text-align: center; color: var(--ink-soft); font-size: 0.8rem; margin-top: 3rem; }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .topbar {
    flex-wrap: wrap; padding: 0.55rem 0.8rem; row-gap: 0.35rem; gap: 0.55rem;
  }
  .brand { font-size: 1rem; white-space: nowrap; }
  .brand .logo { width: 30px; height: 30px; font-size: 1.1rem; }
  .level-chip { margin-left: auto; white-space: nowrap; }
  .topbar nav { margin-left: 0; width: 100%; justify-content: space-between; gap: 0.15rem; }
  .topbar nav a { padding: 0.4rem 0.55rem; font-size: 0.88rem; flex: 1; text-align: center; }

  main { padding: 1rem 0.8rem 3rem; }
  .hero svg { height: 160px; }
  .hero .hero-text { left: 1rem; bottom: 0.85rem; }
  .hero .hero-text h1 { font-size: 1.25rem; }
  .hero .hero-text p { font-size: 0.85rem; }

  .big-tile { padding: 1rem 1.1rem; gap: 0.9rem; }
  .big-tile .count { font-size: 2.1rem; min-width: 2.6rem; }
  .panel { padding: 1rem; }
  .progress-wrap { gap: 0.9rem; }
  .ring { width: 96px; height: 96px; }

  .quiz-char-wrap { padding: 1rem 1.4rem 0.9rem; }
  .quiz-input { font-size: 1.15rem; }
  .tone-row button { min-width: 40px; height: 42px; }
  .quiz-question { font-size: 0.95rem; padding: 0.5rem 1.1rem; }

  .modal-head .big-char { font-size: 3.1rem; }
  .modal-body { padding: 1rem 1.1rem 1.2rem; }
  .lesson-nav .btn { padding: 0.65rem 1.1rem; }

  details.hsk-level summary { padding: 0.8rem 0.9rem; flex-wrap: wrap; }
  details.hsk-level .hsk-grid { padding: 0 0.9rem 1rem; }
  .item-chip { min-width: 52px; padding: 0.42rem 0.5rem 0.35rem; }
  .item-chip .ch { font-size: 1.3rem; }

  textarea.io { font-size: 16px; } /* keep iOS from zooming on focus */
  .settings-actions .btn { flex: 1; }
}

/* ---------- HSK browser ---------- */
.hsk-search {
  width: 100%; font-size: 1rem; padding: 0.65rem 0.9rem; margin-top: 0.3rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fffdf8;
  color: var(--ink); outline: none;
}
.hsk-search:focus { border-color: var(--gold); }
details.hsk-level {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 0.9rem; overflow: hidden;
}
details.hsk-level summary {
  display: flex; align-items: center; gap: 0.8rem; cursor: pointer;
  padding: 0.95rem 1.3rem; font-weight: 700; list-style: none;
}
details.hsk-level summary::-webkit-details-marker { display: none; }
details.hsk-level summary::after {
  content: '▾'; margin-left: auto; color: var(--ink-soft);
  transition: transform 0.15s ease;
}
details.hsk-level[open] summary::after { transform: rotate(180deg); }
details.hsk-level summary .lv {
  background: var(--ink); color: var(--gold-soft); font-size: 0.78rem;
  border-radius: 6px; padding: 0.25rem 0.6rem; letter-spacing: 0.05em;
}
details.hsk-level summary .hsk-meta { color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }
details.hsk-level .hsk-grid { padding: 0 1.3rem 1.2rem; }

/* ---------- Custom lists ---------- */
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.list-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 0 1.3rem 0.8rem; }
@media (max-width: 700px) { .list-actions { padding: 0 0.9rem 0.7rem; } }
.modal .hsk-search { margin-top: 0.2rem; }
.modal code { background: var(--paper-2); border-radius: 4px; padding: 0.05rem 0.3rem; font-size: 0.85em; }

/* ---------- Reference link chips ---------- */
.ref-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ref-links a {
  display: inline-block; background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 0.88rem; font-weight: 600;
  border-radius: 999px; padding: 0.42rem 0.95rem;
  transition: background 0.1s ease, transform 0.1s ease;
}
.ref-links a:hover { background: var(--gold-soft); border-color: var(--gold); transform: translateY(-1px); }
.hsk-fullpage { padding: 0 1.3rem 0.6rem; font-size: 0.88rem; }
.hsk-fullpage a { color: var(--red); font-weight: 600; }
@media (max-width: 700px) {
  .hsk-fullpage { padding: 0 0.9rem 0.5rem; }
}

/* ---------- Audio ---------- */
.speak-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(44, 36, 56, 0.08); color: var(--ink-soft);
  vertical-align: middle; margin-left: 0.25rem;
  transition: transform 0.1s ease, background 0.1s ease;
}
.speak-btn:hover { background: var(--gold-soft); color: #7a5410; transform: scale(1.08); }
.speak-btn.speak-light { background: rgba(255,255,255,0.22); color: #fff; }
.speak-btn.speak-light:hover { background: rgba(255,255,255,0.4); color: #fff; }
.summary-item .speak-btn { flex: none; }

/* ---------- Quiz hints ---------- */
.hint-btn {
  margin-top: 1rem; border: 1px dashed rgba(255,255,255,0.35);
  background: transparent; color: rgba(255,255,255,0.65);
  border-radius: 999px; padding: 0.4rem 1.1rem; font-size: 0.82rem; font-weight: 600;
}
.hint-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.hint-reveal {
  margin-top: 1rem; max-width: min(520px, 88vw); text-align: center;
  background: rgba(255, 217, 138, 0.12); border: 1px solid rgba(255, 217, 138, 0.35);
  color: var(--gold-soft); border-radius: 10px; padding: 0.7rem 1rem;
  font-size: 0.92rem; line-height: 1.5; animation: fadein 0.25s ease;
}
.hint-reveal .hint-parts { margin-top: 0.35rem; font-size: 0.85rem; color: rgba(255,255,255,0.75); }
