/* zh: ink on paper, a seal's red, pinyin in its tones' colours. */
:root {
  --paper: #f8f5ef;
  --card: #fffdf9;
  --ink: #1e1c19;
  --muted: #6e675d;
  --line: #e4ddd1;
  --soft: #efe9de;
  --red: #b8322a;
  --red-soft: #f6e3df;
  --on-red: #fff;
  --good: #2f7d4a;
  --t1: #c8372c;
  --t2: #2c8a4b;
  --t3: #2a5fc4;
  --t4: #8a3cb9;
  --t5: #857e72;
  --saved: #c99a2e;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(40 30 20 / 6%), 0 6px 24px rgb(40 30 20 / 6%);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --zh: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --zh-display: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", "Songti SC", "SimSun", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161412;
    --card: #1f1c19;
    --ink: #ece6dc;
    --muted: #a39b8e;
    --line: #35302a;
    --soft: #2a2622;
    --red: #e0574b;
    --red-soft: #3a211d;
    --on-red: #1a0f0d;
    --good: #5bbd7c;
    --t1: #f06a5c;
    --t2: #5cc37f;
    --t3: #6f9bf0;
    --t4: #c483ee;
    --t5: #9d9589;
    --saved: #e2b54a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161412; --card: #1f1c19; --ink: #ece6dc; --muted: #a39b8e; --line: #35302a; --soft: #2a2622;
  --red: #e0574b; --red-soft: #3a211d; --on-red: #1a0f0d; --good: #5bbd7c;
  --t1: #f06a5c; --t2: #5cc37f; --t3: #6f9bf0; --t4: #c483ee; --t5: #9d9589; --saved: #e2b54a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 1.2rem 0 .6rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .7rem; }
p { margin: .5rem 0; }
[hidden] { display: none !important; }
.zh { font-family: var(--zh); }
.muted { color: var(--muted); font-weight: 400; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 40rem; }
.hint { color: var(--muted); font-size: .92rem; }
.empty { color: var(--muted); padding: 1rem 0; }
.notice { background: var(--soft); border-radius: var(--radius); padding: .8rem 1rem; }
.error { background: var(--red-soft); color: var(--ink); border-left: 4px solid var(--red); border-radius: 8px; padding: .7rem 1rem; }
kbd { font: .75em var(--sans); border: 1px solid currentColor; border-radius: 4px; padding: 0 .3em; opacity: .7; }

/* Tones */
.t1 { color: var(--t1); } .t2 { color: var(--t2); } .t3 { color: var(--t3); } .t4 { color: var(--t4); } .t5, .t0 { color: var(--t5); }

/* Buttons */
.button, button.button {
  display: inline-flex; align-items: center; gap: .4em;
  font: 600 1rem var(--sans);
  background: var(--red); color: var(--on-red);
  border: 1px solid var(--red); border-radius: 999px;
  padding: .6rem 1.2rem; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, filter .15s;
}
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(1px); }
.button.ghost { background: transparent; color: var(--red); }
.button.small { font-size: .9rem; padding: .35rem .85rem; }
.button.danger { background: transparent; color: var(--red); }
.link-button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: .2rem .4rem; }
.link-button:hover { color: var(--red); }
.chip {
  font: 500 .85rem var(--sans); color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: .2rem .75rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.say { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: .15rem .3rem; border-radius: 6px; line-height: 1; filter: grayscale(.3); }
.say:hover { background: var(--soft); }
.no-speech .say:not(.chip) { display: none; }
.no-speech [data-say-all] { display: none; }
form.inline { display: inline; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: transparent; }
label { display: block; font-weight: 600; font-size: .95rem; margin: .9rem 0; }
label input, label textarea { margin-top: .35rem; font-weight: 400; }
.tag {
  display: inline-block; font: 600 .72rem/1.6 var(--sans); letter-spacing: .02em;
  color: var(--muted); background: var(--soft); border-radius: 999px; padding: 0 .55rem; margin-right: .3rem; white-space: nowrap;
}
a.tag { text-decoration: none; }
.saved-tag { color: var(--saved); }
.hot-tag { color: var(--red); }
.free-tag { color: var(--good); }

/* The seal and the header */
.seal {
  display: inline-grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 7px;
  background: var(--red); color: var(--on-red);
  font: 700 1.05rem/1 var(--zh);
}
.seal.small { width: 1.3rem; height: 1.3rem; font-size: .75rem; border-radius: 5px; }
.top {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  max-width: 1080px; width: 100%; margin: 0 auto; padding: .8rem 16px;
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.nav { display: flex; gap: .2rem; }
.nav a { color: var(--ink); text-decoration: none; padding: .35rem .7rem; border-radius: 999px; font-weight: 500; }
.nav a:hover { background: var(--soft); }
.nav a[aria-current="page"] { background: var(--soft); color: var(--red); }
.badge { display: inline-block; min-width: 1.4em; text-align: center; font-size: .75rem; font-weight: 700; background: var(--red); color: var(--on-red); border-radius: 999px; padding: 0 .4em; }
.search { flex: 1; min-width: 12rem; max-width: 22rem; margin-left: auto; }
.search input { border-radius: 999px; padding: .42rem 1rem; background: var(--card); }
.me { display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.me a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 500; }
.member-mark { color: var(--saved); }
@media (max-width: 760px) {
  .top { gap: .5rem .8rem; }
  .search { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .me { margin-left: auto; }
  .nav { order: 4; flex-basis: 100%; overflow-x: auto; }
  h1 { font-size: 1.6rem; }
}
.foot { color: var(--muted); font-size: .85rem; text-align: center; padding: 2rem 16px 2.5rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.foot .seal { vertical-align: -3px; }

/* Pages */
.page { padding-top: .5rem; }
.narrow { max-width: 46rem; margin: 0 auto; }
.form-page { max-width: 24rem; margin: 2rem auto; }
.form-page .button { width: 100%; justify-content: center; margin-top: .4rem; }
.prose { max-width: 40rem; }
.prose li { margin: .4rem 0; }

/* Home */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; padding: 2.5rem 0 1rem; }
.hero h1 { font-size: 2.9rem; letter-spacing: -.03em; margin-top: 0; }
.hero h1 em { font-style: normal; color: var(--red); }
.cta { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hero-sample { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1.3rem 1.5rem; border: 1px solid var(--line); }
.sample-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.sample-foot { color: var(--muted); font-size: .8rem; text-align: right; margin: .3rem 0 0; }
.hero-sample .line { display: block; }
.hero-sample .en { display: block; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1rem; }
  .hero h1 { font-size: 2.2rem; }
}
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 2.5rem 0; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.feature h2 { font-size: 1.05rem; margin: 0 0 .4rem; display: flex; align-items: center; gap: .5rem; }
.feature h2 .zh { color: var(--red); font-family: var(--zh-display); font-size: 1.5rem; font-weight: 400; }
.feature p { color: var(--muted); font-size: .95rem; margin: 0; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; max-width: 44rem; margin: 2rem auto; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem 1.4rem; }
.plan.best { border: 2px solid var(--red); }
.plan h3 { margin: 0; }
.plan ul { padding-left: 1.1rem; color: var(--muted); }
.price { font-size: 2rem; font-weight: 700; margin: .2rem 0; }
.price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.price.big { font-size: 2.6rem; }
.today h1 { font-family: var(--zh); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.tile { display: flex; flex-direction: column; gap: .2rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.3rem; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--red); }
.tile.hot { border: 2px solid var(--red); }
.tile-n { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.tile-n.zh { font-weight: 500; }
.tile-label { color: var(--muted); }
.tile-go { margin-top: auto; padding-top: .6rem; color: var(--red); font-weight: 600; }
.progress-line { display: flex; align-items: center; gap: .8rem; color: var(--muted); flex-wrap: wrap; }
progress.bar { flex: 1; min-width: 6rem; max-width: 20rem; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--soft); appearance: none; -webkit-appearance: none; }
progress.bar::-webkit-progress-bar { background: var(--soft); border-radius: 99px; }
progress.bar::-webkit-progress-value { background: var(--red); border-radius: 99px; transition: width .3s; }
progress.bar::-moz-progress-bar { background: var(--red); border-radius: 99px; }

/* Lists of words */
.results { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.results > li { border-bottom: 1px solid var(--line); }
.result {
  display: grid; grid-template-columns: minmax(4.5rem, auto) minmax(6rem, auto) 1fr auto; align-items: baseline; gap: .3rem 1rem;
  padding: .6rem .3rem; color: var(--ink); text-decoration: none;
}
a.result:hover { background: var(--soft); }
.r-word { font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.r-pinyin { font-size: .95rem; }
.r-gloss { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.r-tags { text-align: right; }
.results.compact .result { grid-template-columns: auto auto 1fr; padding: .45rem .2rem; }
.results.compact .r-word { font-size: 1.15rem; }
.words-list .result { grid-template-columns: minmax(4.5rem, auto) minmax(6rem, auto) 1fr auto auto; }
@media (max-width: 560px) {
  .result { grid-template-columns: auto 1fr auto; }
  .words-list .result { grid-template-columns: auto 1fr auto auto; }
  .r-gloss { grid-column: 1 / -1; grid-row: 2; }
}
.big-search { display: flex; gap: .5rem; margin: 1rem 0; }
.big-search input { font-size: 1.15rem; border-radius: 999px; padding: .65rem 1.2rem; }
.big-search button { flex: none; font: 600 1rem var(--sans); border-radius: 999px; border: 0; background: var(--red); color: var(--on-red); padding: 0 1.3rem; cursor: pointer; }

/* A word's page */
.word-head { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; padding: 1rem 0 .5rem; }
.big-zh { font-family: var(--zh-display); font-weight: 400; font-size: 5.5rem; line-height: 1.05; margin: 0; letter-spacing: .05em; }
.trad { color: var(--muted); margin: 0; }
.big-pinyin { font-size: 1.7rem; margin: 0; }
.word-meta .gloss { font-size: 1.15rem; margin: .1rem 0 .4rem; }
.word-meta form { margin-top: .6rem; }
.reading-block { padding: .3rem 0 .6rem; border-bottom: 1px solid var(--line); }
.reading-block:last-child { border-bottom: 0; }
.reading-pinyin { font-size: 1.15rem; margin: .4rem 0 .1rem; }
.reading-pinyin .trad { display: inline; margin-left: .3rem; }
.meanings { margin: .2rem 0; padding-left: 1.4rem; }
.meanings li { margin: .1rem 0; }
.measures { color: var(--muted); font-size: .95rem; }
.measures a { font-size: 1.15rem; text-decoration: none; }

/* Reading: words with their pinyin over them */
.reading .line { margin: .1rem 0; padding: .45rem 0; display: grid; grid-template-columns: 1fr auto; column-gap: .5rem; align-items: start; }
.reading .line .zh { font-size: 1.45rem; line-height: 2.1; }
.show-pinyin .line .zh, .reading.show-pinyin .zh { line-height: 2.5; }
.reading .line .en { grid-column: 1 / -1; color: var(--muted); font-size: .98rem; display: none; padding: .1rem 0 .2rem; }
.show-english .reading .line .en, .reading .line.open .en, .reading .line .en.always { display: block; }
.line-tools { display: flex; gap: .1rem; padding-top: .5rem; opacity: .55; transition: opacity .15s; }
.line:hover .line-tools, .line:focus-within .line-tools { opacity: 1; }
.en-toggle { font: 700 .7rem var(--sans); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; padding: .15rem .35rem; }
.line.open .en-toggle { background: var(--ink); color: var(--paper); }
.para { padding: .3rem 0 .6rem; border-bottom: 1px dashed var(--line); }
.para:last-of-type { border-bottom: 0; }
ruby.w { ruby-position: over; cursor: pointer; border-radius: 4px; transition: background .12s; padding: 0 .02em; }
ruby.w:hover { background: var(--soft); }
ruby.w.active { background: var(--red-soft); }
ruby.w.saved { text-decoration: underline 2px var(--saved); text-underline-offset: 6px; }
ruby.w.known { text-decoration-style: dotted; }
ruby.w.name { cursor: default; }
/* Hidden pinyin takes no room: the characters keep their spacing */
ruby.w rt { font: 500 .5em var(--sans); letter-spacing: 0; display: none; user-select: none; }
.show-pinyin ruby.w rt { display: revert; }
.reading-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.reading-bar h2 { margin: 1.8rem 0 .5rem; }
.toggles { display: flex; gap: .4rem; flex-wrap: wrap; }
.note { display: flex; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: .7rem 0; }
.note p { margin: 0; }
.note .zh { font-size: 1.1em; }
.note ruby.w rt { font-size: .45em; }
.note-mark { flex: none; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--red-soft); color: var(--red); font: 600 .85rem var(--zh); }
.example .zh { font-size: 1.25rem; }
.source { color: var(--muted); font-size: .8rem; text-decoration: none; }

/* A lesson */
.crumbs { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }
.crumbs a { color: var(--muted); }
.lesson-head h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .9rem; }
.lesson-head h1 .zh { font-family: var(--zh-display); font-weight: 400; font-size: 2.6rem; }
.h-en { color: var(--muted); font-weight: 500; font-size: 1.3rem; }
.best-score { color: var(--good); font-weight: 600; }
.lesson { max-width: 50rem; margin: 0 auto; }
.word-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; }
.word-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem .6rem; display: flex; flex-direction: column; }
.word-card.saved { border-color: color-mix(in srgb, var(--saved) 60%, var(--line)); }
.wc-zh { font-size: 1.7rem; color: var(--ink); text-decoration: none; line-height: 1.3; }
.wc-pinyin { font-size: .95rem; }
.wc-gloss { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.word-card .say { position: absolute; top: .4rem; right: .3rem; }
.teaser { position: relative; }
.locked-box { background: var(--card); border: 2px solid var(--red); border-radius: 16px; padding: 1.2rem 1.4rem; margin: 1rem 0; }
.lock-title { font-weight: 700; font-size: 1.1rem; }
.check { margin-top: 2rem; }
.q { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 0 0 .8rem; padding: .8rem 1rem 1rem; }
.q legend { padding: 0 .3rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.q-n { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--soft); font-size: .8rem; }
.q-big { font-size: 1.6rem; font-weight: 400; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .45rem; margin-top: .4rem; }
.option { margin: 0; font-weight: 400; display: flex; align-items: center; gap: .55rem; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; cursor: pointer; }
.option:hover { background: var(--soft); }
.option:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.option input { width: auto; margin: 0; accent-color: var(--red); }
.option .zh { font-size: 1.35rem; }
.result-box { background: var(--card); border: 2px solid var(--good); border-radius: 16px; padding: 1rem 1.4rem; margin: 1rem 0 1.5rem; }
.result-box h2 { margin-top: .3rem; }
.checked { padding-left: 0; list-style: none; }
.checked li { padding: .25rem 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.checked .zh { font-size: 1.2rem; }
.checked .mark { font-weight: 700; width: 1.2rem; }
.checked .right .mark { color: var(--good); }
.checked .wrong .mark { color: var(--red); }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; flex-wrap: wrap; }

/* The course */
.course-head { max-width: 46rem; }
.unit h2 { display: flex; align-items: baseline; gap: .6rem; }
.unit-n { color: var(--red); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.lessons { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .6rem; }
.lessons a { display: grid; grid-template-columns: 2rem 1fr auto; grid-template-rows: auto auto; gap: 0 .7rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; color: var(--ink); text-decoration: none; }
.lessons a:hover { border-color: var(--red); }
.l-n { grid-row: 1 / 3; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--soft); font-weight: 700; font-size: .9rem; }
.done .l-n { background: var(--good); color: var(--card); }
.l-title .zh { font-size: 1.2rem; }
.l-en { color: var(--muted); font-size: .92rem; }
.l-words { grid-column: 2; color: var(--muted); font-size: .8rem; }
.l-state { grid-row: 1 / 3; grid-column: 3; color: var(--good); font-weight: 600; font-size: .9rem; }
.locked .l-state { color: var(--muted); }

/* The reader */
.read-form textarea { font: 1.25rem/1.7 var(--zh); }
.form-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.texts { padding-left: 1.2rem; }
.texts li { margin: .3rem 0; }
.texts .zh { font-size: 1.1rem; }
.text-layout { display: grid; grid-template-columns: 1fr 17rem; gap: 2.5rem; align-items: start; }
.text-words { position: sticky; top: 1rem; }
.text-words h2 { margin-top: 1.8rem; }
.line.plain { display: block; }
@media (max-width: 860px) { .text-layout { grid-template-columns: 1fr; gap: 0; } .text-words { position: static; } }

/* Review */
.review-page { max-width: 34rem; margin: 0 auto; }
.review-top { display: flex; align-items: center; gap: .8rem; color: var(--muted); margin-top: 1.5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); min-height: 18rem; padding: 1.5rem 1.5rem 1.2rem; text-align: center; display: flex; flex-direction: column; justify-content: center; position: relative; }
.card-tag { position: absolute; top: .9rem; left: 1rem; margin: 0; font: 700 .7rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.card-zh { font-family: var(--zh-display); font-size: 5rem; line-height: 1.2; margin: .5rem 0; }
.card-pinyin { font-size: 1.6rem; margin: 0; }
.card-gloss { font-size: 1.2rem; font-weight: 600; margin: .2rem 0 .4rem; }
.card-meanings { list-style: none; padding: 0; color: var(--muted); font-size: .95rem; margin: .2rem 0 .6rem; }
.card-example { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .6rem; }
.card-example .zh { display: block; font-size: 1.25rem; line-height: 2.3; }
.card-example .en { display: block; color: var(--muted); font-size: .92rem; }
.card-links { display: flex; justify-content: center; align-items: center; gap: .8rem; font-size: .9rem; margin-top: .5rem; }
.review-actions { margin: 1rem 0; }
.button.show { width: 100%; justify-content: center; padding: .85rem; font-size: 1.05rem; }
.rates { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.rate { font: 600 1rem var(--sans); border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .65rem .2rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.rate span { font-weight: 400; font-size: .78rem; color: var(--muted); }
.rate:hover { border-color: var(--ink); }
.rate.again { color: var(--red); }
.rate.good { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.rate.good span { color: var(--paper); opacity: .75; }
.review-done { text-align: center; padding: 3rem 0; }
.review-done .big-zh { color: var(--red); }

/* Account */
.account h2 { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.delete-form { max-width: 22rem; }
.checks { list-style: none; padding: 0; }
.checks li { padding: .45rem 0 .45rem 1.8rem; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }

/* The popup */
.pop {
  position: absolute; z-index: 20; width: min(21rem, calc(100vw - 24px));
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgb(0 0 0 / 18%);
  padding: 1rem 1.1rem .9rem;
}
.pop-head { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; padding-right: 1.5rem; }
.pop-zh { font: 400 2.4rem/1.15 var(--zh-display); color: var(--ink); text-decoration: none; }
.pop-pinyin { font-size: 1.2rem; }
.pop-close { position: absolute; top: .45rem; right: .55rem; background: none; border: 0; font-size: 1.3rem; color: var(--muted); cursor: pointer; line-height: 1; padding: .2rem; }
.pop-gloss { font-weight: 600; margin: .3rem 0 .1rem; }
.pop-meanings { margin: .2rem 0 .4rem; padding-left: 1.2rem; color: var(--muted); font-size: .92rem; max-height: 9rem; overflow: auto; }
.pop-more { color: var(--muted); font-size: .85rem; margin: .2rem 0; }
.pop-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; font-size: .9rem; }
.pop-foot .button { margin-right: auto; }
.pop-error { color: var(--red); font-size: .88rem; }
@media (max-width: 560px) {
  .pop { position: fixed; left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; border-radius: 18px; }
}
