/* =========================================================
   步步 Bùbù — "peonies, matcha and morning light"
   Palette: Vanilla Cream #FFF7E6 · Blush Petal #F7C8D3 · Rosewood #B46A72
            Sage Leaf #A8B58A · Misty Sky #A9B7C6 / #D5E5F6 · Midnight Lagoon #2D3A47
   ========================================================= */
:root {
  --vanilla: #fff7e6;
  --blush: #f7c8d3;
  --rose: #b46a72;
  --rose-deep: #9c5961;
  --sage: #a8b58a;
  --sage-deep: #7d8d5c;
  --sky: #a9b7c6;
  --sky-soft: #d5e5f6;
  --lagoon: #2d3a47;

  --bg: #fdf2e2;
  --card: rgba(255, 251, 244, .93);
  --card-solid: #fffaf2;
  --paper-2: #f6ead8;
  --ink: #2d3a47;
  --ink-soft: #6b7480;
  --ink-faint: #aeb2b6;
  --line: rgba(180, 106, 114, .2);
  --line-soft: rgba(45, 58, 71, .08);
  --glass-edge: rgba(255, 255, 255, .75);

  /* names used by the scripts */
  --tomato: var(--rose);
  --tomato-ink: #fff7f2;
  --tomato-soft: #fbe1e6;
  --mint: #cfd9b0;
  --butter: #f5e2bf;
  --pink: var(--blush);
  --lilac: #dfe4f0;
  --danger: #b34a57;

  --t1: #c2475a; --t2: #5e8a3b; --t3: #4a6f9c; --t4: #96579c; --t5: #979ca3;
  --s0: #efe3cf; --s1: #dce4c5; --s2: #d4e0ee; --s3: #f8d4dd; --s4: #e6b8be;

  --shadow: 0 1px 2px rgba(45, 58, 71, .05), 0 12px 26px -12px rgba(180, 106, 114, .32);
  --shadow-sm: 0 1px 2px rgba(45, 58, 71, .05), 0 6px 16px -8px rgba(180, 106, 114, .35);
  --shadow-press: 0 1px 2px rgba(45, 58, 71, .08);
  --r: 26px;
  --font: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --serif: 'M PLUS Rounded 1c', 'Nunito', system-ui, sans-serif;
  --hand: 'Pacifico', 'M PLUS Rounded 1c', cursive;
  --han: 'LXGW WenKai TC', 'Kaiti TC', 'STKaiti', 'BiauKai', 'DFKai-SB', 'Noto Serif TC', serif;

  --blob1: rgba(247, 200, 211, .62);
  --blob2: rgba(168, 181, 138, .34);
  --blob3: rgba(213, 229, 246, .75);
  --blob4: rgba(247, 200, 211, .45);
  --leaf-shadow: #4a5560;
  --leaf-opacity: .085;
  --grain-opacity: .35;
  --bubu-ink: #4a4048;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2731; --card: rgba(45, 58, 71, .9); --card-solid: #2b3744; --paper-2: #33414f;
    --ink: #f6eee2; --ink-soft: #b6bcc4; --ink-faint: #6e7984; --line: rgba(247, 200, 211, .18); --line-soft: rgba(255, 255, 255, .07);
    --glass-edge: rgba(255, 255, 255, .09);
    --tomato: #d98892; --tomato-ink: #fff7f2; --tomato-soft: rgba(247, 200, 211, .14); --mint: #5f6f4c; --butter: #5b5240; --lilac: #3c4a5a; --danger: #ff9aa6;
    --t1: #ff97a6; --t2: #b9d58f; --t3: #9ec1ee; --t4: #dfa9e6; --t5: #a5adb5;
    --s0: #3a4653; --s1: #5c6a4b; --s2: #4c6077; --s3: #7a5664; --s4: #9a6870;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -14px rgba(0, 0, 0, .55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 18px -10px rgba(0, 0, 0, .6);
    --blob1: rgba(180, 106, 114, .26); --blob2: rgba(168, 181, 138, .14); --blob3: rgba(169, 183, 198, .18); --blob4: rgba(180, 106, 114, .16);
    --leaf-shadow: #dfe6ee; --leaf-opacity: .045; --grain-opacity: .18; --bubu-ink: #2d3a47;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d2731; --card: rgba(45, 58, 71, .9); --card-solid: #2b3744; --paper-2: #33414f;
  --ink: #f6eee2; --ink-soft: #b6bcc4; --ink-faint: #6e7984; --line: rgba(247, 200, 211, .18); --line-soft: rgba(255, 255, 255, .07);
  --glass-edge: rgba(255, 255, 255, .09);
  --tomato: #d98892; --tomato-ink: #fff7f2; --tomato-soft: rgba(247, 200, 211, .14); --mint: #5f6f4c; --butter: #5b5240; --lilac: #3c4a5a; --danger: #ff9aa6;
  --t1: #ff97a6; --t2: #b9d58f; --t3: #9ec1ee; --t4: #dfa9e6; --t5: #a5adb5;
  --s0: #3a4653; --s1: #5c6a4b; --s2: #4c6077; --s3: #7a5664; --s4: #9a6870;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -14px rgba(0, 0, 0, .55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 18px -10px rgba(0, 0, 0, .6);
  --blob1: rgba(180, 106, 114, .26); --blob2: rgba(168, 181, 138, .14); --blob3: rgba(169, 183, 198, .18); --blob4: rgba(180, 106, 114, .16);
  --leaf-shadow: #dfe6ee; --leaf-opacity: .045; --grain-opacity: .18; --bubu-ink: #2d3a47;
  color-scheme: dark;
}

/* ---------- base & atmosphere ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font: 500 16px/1.55 var(--font);
  background-color: var(--bg);
}
/* soft watercolour light + paper grain: one fixed layer, painted once */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    url('../images/decor/paper-grain.svg'),
    radial-gradient(70vmax 55vmax at -5% -10%, var(--blob1), transparent 62%),
    radial-gradient(55vmax 50vmax at 105% 18%, var(--blob2), transparent 60%),
    radial-gradient(65vmax 55vmax at 25% 108%, var(--blob3), transparent 62%),
    radial-gradient(45vmax 45vmax at 110% 95%, var(--blob4), transparent 60%);
  background-color: var(--bg);
}
.komorebi { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--leaf-opacity); }
.komorebi img { width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="dark"] .komorebi img { filter: invert(1); }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
h1, h2, .num-box b, .stat b, .lad-count, .s-count, .streak-card b, .forecast b, .opt .key, .meanings li::before, .level-badge, .brand > span, .mode b, .dlg h3 { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: 'lnum' 1; }
h1 { font-family: var(--serif); font-weight: 700; font-size: 2.35rem; letter-spacing: -.005em; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 1.55rem; }
h3, h4 { font-weight: 800; }
p { margin: 0 0 .6em; }
.han { font-family: var(--han); font-weight: 400; }
.hand { font-family: var(--hand); font-weight: 400; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.t1 { color: var(--t1); } .t2 { color: var(--t2); } .t3 { color: var(--t3); } .t4 { color: var(--t4); } .t5 { color: var(--t5); }
.ic { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; object-fit: contain; }
i.ic, i.tone-shape { background-color: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.tone-shape { display: inline-block; width: 34px; height: 34px; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--blush); color: var(--lagoon); }

/* ---------- layout ---------- */
.page { max-width: 680px; margin: 0 auto; padding: 14px 18px 130px; position: relative; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 10px 0 20px; }
.page-head h1 { flex: 1; overflow-wrap: anywhere; }
.page-head .hand { font-size: 1.45rem; color: var(--rose); display: block; margin-bottom: -2px; transform: rotate(-2deg); transform-origin: left; }
.crumbs { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 700; font-size: .9rem; margin: 4px 0; padding: 5px 14px 5px 9px; border-radius: 99px; background: var(--card); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); }
.crumbs:hover { color: var(--rose); }
.crumbs .ic { width: 18px; height: 18px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 32px 4px 12px; }
.section-title h2 { display: flex; align-items: center; gap: 10px; }
.section-title h2 .ic { color: var(--rose); width: 22px; height: 22px; }
.section-title h2::after {
  content: ''; width: 46px; height: 16px; flex: none;
  background: url('../images/decor/ornament.svg') no-repeat center / contain;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- glass card ---------- */
.card {
  position: relative; background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--card) 88%, transparent));
  border: 1px solid var(--glass-edge); border-radius: var(--r); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .5);
  padding: 20px;
}
.card + .card { margin-top: 18px; }
.card.flat { box-shadow: var(--shadow-sm); }
.card.framed::after { content: ''; position: absolute; inset: 7px; border-radius: calc(var(--r) - 6px); border: 1px dashed var(--line); pointer-events: none; }
.card.tint-butter { background: linear-gradient(160deg, color-mix(in srgb, var(--butter) 75%, var(--card)), var(--card)); }
.card.tint-mint { background: linear-gradient(160deg, color-mix(in srgb, var(--sage) 30%, var(--card)), var(--card)); }
.card.tint-sky { background: linear-gradient(160deg, color-mix(in srgb, var(--sky-soft) 70%, var(--card)), var(--card)); }
.card.tint-pink { background: linear-gradient(160deg, color-mix(in srgb, var(--blush) 55%, var(--card)), var(--card)); }
.card.tint-lilac { background: linear-gradient(160deg, color-mix(in srgb, var(--sky-soft) 75%, var(--card)), color-mix(in srgb, var(--blush) 35%, var(--card))); }

/* washi tape: gingham, sage stripes, misty dots */
.tape {
  position: absolute; top: -11px; left: 50%; width: 96px; height: 24px; translate: -50% 0; rotate: -3deg; z-index: 2; pointer-events: none;
  background-color: rgba(255, 247, 230, .85);
  background-image: linear-gradient(90deg, rgba(247, 200, 211, .75) 50%, transparent 50%), linear-gradient(rgba(247, 200, 211, .75) 50%, transparent 50%);
  background-size: 10px 10px; opacity: .92; filter: drop-shadow(0 2px 2px rgba(45, 58, 71, .08));
  clip-path: polygon(0 0, 100% 0, 97% 20%, 100% 40%, 97% 60%, 100% 80%, 97% 100%, 0 100%, 3% 80%, 0 60%, 3% 40%, 0 20%);
}
.tape.mint { background-image: repeating-linear-gradient(90deg, rgba(168, 181, 138, .55) 0 6px, rgba(255, 247, 230, .7) 6px 12px); background-size: auto; rotate: 4deg; }
.tape.dots { background-color: rgba(213, 229, 246, .92); background-image: radial-gradient(rgba(255, 255, 255, .95) 2px, transparent 2.5px), radial-gradient(rgba(180, 106, 114, .35) 1.4px, transparent 1.8px); background-size: 12px 12px, 12px 12px; background-position: 0 0, 6px 6px; rotate: 2deg; }
.tape.left { left: 22px; translate: 0 0; rotate: -7deg; width: 74px; }
.tape.right { left: auto; right: 18px; translate: 0 0; rotate: 6deg; width: 74px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card-solid) 88%, transparent);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .5); font-weight: 800; white-space: nowrap; color: var(--ink);
  transition: transform .15s cubic-bezier(.3, 1.4, .5, 1), box-shadow .15s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--rose) 45%, transparent); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: var(--shadow-press); }
.btn.primary {
  background: linear-gradient(180deg, #c9848b 0%, var(--rose) 52%, var(--rose-deep) 100%); color: #fff8f3; border-color: rgba(156, 89, 97, .5);
  box-shadow: 0 10px 22px -10px rgba(180, 106, 114, .85), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .06);
  text-shadow: 0 1px 1px rgba(120, 50, 60, .25);
}
.btn.primary:hover { filter: brightness(1.04) saturate(1.05); }
.btn.mint { background: linear-gradient(180deg, #c5d0a4, var(--sage)); color: #2d3a24; border-color: rgba(125, 141, 92, .45); }
.btn.butter { background: var(--butter); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--rose); padding-inline: 12px; }
.btn.ghost:hover { background: var(--tomato-soft); transform: none; }
.btn.sm { padding: 7px 14px; font-size: .88rem; }
.btn.lg { padding: 15px 24px; font-size: 1.08rem; }
.btn.block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn .ic { width: 20px; height: 20px; }
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; flex: none; padding: 0;
  border: 1px solid transparent; background: transparent; border-radius: 50%; color: var(--ink); transition: background .2s, transform .15s;
}
.icon-btn:hover { background: var(--tomato-soft); }
.icon-btn.boxed { border-color: var(--line); background: color-mix(in srgb, var(--card-solid) 90%, transparent); box-shadow: var(--shadow-sm); color: var(--rose); }
.icon-btn.boxed:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 99px; border: 1px solid var(--line-soft);
  font-size: .8rem; font-weight: 800; background: color-mix(in srgb, var(--card-solid) 80%, transparent); white-space: nowrap;
}
.chip .ic { width: 15px; height: 15px; }
.chip.s0 { background: var(--s0); } .chip.s1 { background: var(--s1); } .chip.s2 { background: var(--s2); }
.chip.s3 { background: var(--s3); } .chip.s4 { background: var(--s4); }
.badge {
  min-width: 24px; height: 24px; padding: 0 8px; border-radius: 99px; display: inline-grid; place-items: center;
  background: linear-gradient(180deg, #c9848b, var(--rose)); color: #fff8f3; font-size: .78rem; font-weight: 900; box-shadow: 0 4px 10px -4px rgba(180, 106, 114, .8);
}

/* ---------- top bar & nav ---------- */
.topbar { max-width: 680px; margin: 0 auto; padding: 14px 18px 0; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand .logo { width: 42px; height: 42px; filter: drop-shadow(0 4px 6px rgba(180, 106, 114, .3)); }
.brand > span { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; letter-spacing: .01em; }
.brand .han { font-size: 1.35rem; color: var(--rose); margin-right: 2px; }
.nav {
  position: fixed; z-index: 30; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); translate: -50% 0;
  display: flex; gap: 4px; padding: 7px; border-radius: 30px; width: min(440px, calc(100vw - 28px));
  background: color-mix(in srgb, var(--card-solid) 72%, transparent); border: 1px solid var(--glass-edge);
  box-shadow: 0 18px 40px -16px rgba(45, 58, 71, .35), 0 2px 6px rgba(45, 58, 71, .06), inset 0 1px 0 rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 5px;
  border-radius: 22px; font-size: .72rem; font-weight: 800; color: var(--ink-soft); position: relative; transition: background .25s, color .25s;
}
.nav a .ic { width: 24px; height: 24px; transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.nav a.on { background: linear-gradient(180deg, color-mix(in srgb, var(--blush) 80%, transparent), color-mix(in srgb, var(--blush) 40%, transparent)); color: var(--ink); }
.nav a.on .ic { color: var(--rose); transform: translateY(-1px) scale(1.06); }
.nav a .dot { position: absolute; top: 5px; right: calc(50% - 19px); width: 8px; height: 8px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 2px var(--card-solid); }

/* ---------- decorative art ---------- */
.peony { overflow: visible; }
.peony.corner { position: absolute; width: 128px; height: 128px; top: -40px; right: -26px; rotate: 14deg; z-index: 3; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(180, 106, 114, .2)); }
.peony.corner.small { width: 92px; height: 92px; top: -30px; right: -18px; }
.peony.corner-left { position: absolute; width: 104px; height: 104px; bottom: -30px; left: -26px; rotate: -18deg; z-index: 3; pointer-events: none; filter: drop-shadow(0 8px 12px rgba(180, 106, 114, .22)); }
@keyframes peony-sway { 50% { rotate: 8deg; translate: 0 2px; } }
.squiggle { width: 160px; height: 28px; display: block; margin: 8px auto 0; }
.peony, .bubu, .plant, .seal { display: block; }
.lesson-row .plant, .garden .plant { display: block; }

.petal-rain { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.petal-rain img {
  position: absolute; top: -30px; opacity: 0;
  animation-name: petal-fall; animation-timing-function: cubic-bezier(.3, .4, .5, 1); animation-fill-mode: forwards;
}
@keyframes petal-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10% { opacity: .95; }
  100% { opacity: 0; transform: translate(var(--dx), 105vh) rotate(var(--rot)); }
}

/* ---------- today ---------- */
.hello { display: grid; grid-template-columns: 116px 1fr; gap: 10px; align-items: end; margin: 6px 0 22px; }
.hello .bubu { width: 116px; height: auto; }
.bubble {
  position: relative; background: color-mix(in srgb, var(--card-solid) 88%, transparent); border: 1px solid var(--glass-edge); border-radius: 26px 26px 26px 8px;
  padding: 14px 18px; box-shadow: var(--shadow-sm); margin-bottom: 28px; font-weight: 700;
}
.bubble .hand { font-size: 1.6rem; line-height: 1.05; display: block; color: var(--rose); margin-bottom: 2px; }
.today-card { padding: 26px 22px 22px; overflow: visible; }
.today-card h2 { font-size: 1.8rem; }
.today-nums { display: flex; gap: 10px; margin: 12px 0 20px; }
.num-box { flex: 1; border-radius: 20px; padding: 12px 12px 10px; border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.num-box:nth-child(1) { background: linear-gradient(160deg, color-mix(in srgb, var(--blush) 60%, transparent), transparent); }
.num-box:nth-child(2) { background: linear-gradient(160deg, color-mix(in srgb, var(--sage) 40%, transparent), transparent); }
.num-box:nth-child(3) { background: linear-gradient(160deg, color-mix(in srgb, var(--sky-soft) 85%, transparent), transparent); }
.num-box b { display: block; font-family: var(--serif); font-size: 2.5rem; line-height: 1; font-weight: 700; }
.num-box span { font-size: .8rem; color: var(--ink-soft); font-weight: 800; line-height: 1.2; display: block; margin-top: 3px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px; border-radius: 24px; position: relative; overflow: hidden;
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); background: var(--card); min-height: 126px;
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s;
}
.mode:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mode:active { transform: scale(.98); }
.mode .m-ic { width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--card-solid) 85%, transparent); box-shadow: var(--shadow-sm); color: var(--rose); }
.mode .m-ic .ic { width: 24px; height: 24px; }
.mode b { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; line-height: 1.1; margin-top: 2px; }
.mode span { font-size: .8rem; color: var(--ink-soft); font-weight: 700; line-height: 1.3; }
.mode .badge { position: absolute; top: 12px; right: 12px; }
.mode::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .45), transparent 70%); pointer-events: none; }
.mode.butter { background: linear-gradient(150deg, color-mix(in srgb, var(--butter) 95%, transparent), var(--card)); }
.mode.mint { background: linear-gradient(150deg, color-mix(in srgb, var(--sage) 50%, transparent), var(--card)); }
.mode.sky { background: linear-gradient(150deg, var(--sky-soft), var(--card)); }
.mode.pink { background: linear-gradient(150deg, color-mix(in srgb, var(--blush) 80%, transparent), var(--card)); }
.week { display: flex; justify-content: space-between; gap: 4px; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .75rem; font-weight: 800; color: var(--ink-soft); flex: 1; }
.week .day .ic { width: 32px; height: 32px; color: var(--ink-faint); }

.week .day.today span { color: var(--rose); }

/* ---------- decks ---------- */
.deck { padding: 18px 18px 12px; }
.deck + .deck { margin-top: 26px; }
.deck-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.deck-head h2 { flex: 1; overflow-wrap: anywhere; }
.lesson-row {
  display: grid; grid-template-columns: 50px 1fr auto; gap: 3px 12px; align-items: center;
  padding: 9px 10px; margin: 0 -8px; border-radius: 18px; transition: background .2s;
}
.lesson-row:hover { background: color-mix(in srgb, var(--blush) 30%, transparent); }
.lesson-row .plant { width: 50px; height: 50px; grid-row: span 2; }
.lesson-row .l-name { font-weight: 800; overflow-wrap: anywhere; }
.lesson-row .l-meta { font-size: .82rem; color: var(--ink-soft); font-weight: 800; display: flex; gap: 8px; align-items: center; justify-self: end; }
.lesson-row .bar { grid-column: 2 / -1; }
.lessons { list-style: none; margin: 0; padding: 0; }
.lessons li + li { border-top: 1px dashed var(--line-soft); }
.lessons.collapsed li:nth-child(n+6) { display: none; }
.more-row { display: flex; justify-content: center; }
.bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--s0); box-shadow: inset 0 1px 2px rgba(45, 58, 71, .08); gap: 2px; }
.bar span { height: 100%; border-radius: 99px; transition: width .5s; }

/* ladder art */
.ladder-art { width: 100%; height: auto; display: block; overflow: visible; }
.lad-block { stroke: color-mix(in srgb, var(--rose) 35%, transparent); stroke-width: 1.4; }
.s0 .lad-block { fill: var(--s0); } .s1 .lad-block { fill: var(--s1); } .s2 .lad-block { fill: var(--s2); }
.s3 .lad-block { fill: var(--s3); } .s4 .lad-block { fill: var(--s4); }
.lad-count { font: 800 21px var(--font); fill: var(--ink); }
.lad-name { font: 800 11px var(--font); fill: var(--ink-soft); }
.lad-ground { stroke: color-mix(in srgb, var(--rose) 40%, transparent); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 2 5; }
.lad-bubu { overflow: visible; }

/* ---------- lesson ---------- */
.lesson-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.lesson-actions .btn.primary { grid-column: 1 / -1; }
.add-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.word-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.word-row {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 0 14px; align-items: center; text-align: left;
  background: var(--card); border: 1px solid var(--glass-edge); border-radius: 22px; padding: 11px 16px; box-shadow: var(--shadow-sm);
 transition: transform .18s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s;
}
.word-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.word-row .w-han { font-family: var(--han); font-size: 1.9rem; line-height: 1.15; min-width: 46px; }
.word-row .w-mid { min-width: 0; }
.word-row .w-pin { font-weight: 800; display: block; }
.word-row .w-tr { color: var(--ink-soft); font-size: .9rem; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-row.frozen { opacity: .55; }
.word-row.fresh { animation: pop .7s ease; }
@keyframes pop { 0% { transform: scale(.94); background: var(--blush); } }

/* ---------- forms ---------- */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-size: .84rem; font-weight: 800; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .01em; }
.input, .field input, .field textarea, .field select {
  width: 100%; padding: 12px 16px; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card-solid) 75%, transparent);
  outline: none; font-weight: 600; transition: box-shadow .2s, border-color .2s; box-shadow: inset 0 1px 3px rgba(45, 58, 71, .05);
}
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blush) 55%, transparent); }
.field textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.field .han-input { font-family: var(--han); font-size: 1.7rem; padding: 6px 16px; }
.hint { font-size: .82rem; color: var(--ink-soft); margin-top: 5px; min-height: 1.2em; font-weight: 600; }
.hint .preview { font-size: 1rem; font-weight: 800; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; gap: 0; } }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.suggest { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.suggest button { text-align: left; border: 1px dashed var(--line); background: color-mix(in srgb, var(--blush) 18%, transparent); border-radius: 14px; padding: 8px 12px; font-size: .9rem; font-weight: 700; }
.suggest button:hover { border-style: solid; border-color: var(--rose); }
.suggest .han { font-size: 1.2rem; margin-right: 6px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.switch:last-child { border-bottom: 0; }
.switch b { display: block; }
.switch small { color: var(--ink-soft); font-weight: 600; display: block; line-height: 1.35; }
.toggle { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--paper-2); position: relative; flex: none; cursor: pointer; transition: background .25s; box-shadow: inset 0 1px 3px rgba(45, 58, 71, .15); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fffaf3; box-shadow: 0 2px 5px rgba(45, 58, 71, .25); transition: left .25s cubic-bezier(.3, 1.5, .5, 1); }
.toggle:checked { background: linear-gradient(180deg, #c5d0a4, var(--sage)); }
.toggle:checked::after { left: 23px; }
.seg { display: inline-flex; border-radius: 99px; padding: 3px; background: var(--paper-2); flex: none; box-shadow: inset 0 1px 3px rgba(45, 58, 71, .1); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 13px; font-weight: 800; font-size: .86rem; border-radius: 99px; transition: background .2s; }
.seg input:checked + span { background: var(--card-solid); box-shadow: var(--shadow-sm); color: var(--rose); }
.seg input:focus-visible + span { outline: 2px solid var(--rose); }
.num-input { width: 84px !important; text-align: center; }

/* ---------- dictionary ---------- */
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 18px; top: 50%; translate: 0 -50%; color: var(--rose); }
.search-box input { padding: 15px 18px 15px 50px; font-size: 1.08rem; border-radius: 99px; box-shadow: var(--shadow-sm); border-color: var(--glass-edge); }
.results { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.result { display: grid; grid-template-columns: auto 1fr; gap: 0 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--glass-edge); border-radius: 22px; background: var(--card); text-align: left; width: 100%; box-shadow: var(--shadow-sm); transition: transform .18s; }
.result:hover { transform: translateY(-1px); }
.result .r-han { font-family: var(--han); font-size: 1.9rem; line-height: 1.15; }
.result .r-pin { font-weight: 800; }
.result .r-tr { color: var(--ink-soft); font-weight: 600; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lvl { font-size: .7rem; font-weight: 900; padding: 2px 8px; border-radius: 99px; background: var(--lilac); margin-left: 6px; vertical-align: 2px; color: var(--ink); letter-spacing: .02em; }
.en-tag { font-size: .68rem; font-weight: 900; padding: 0 6px; border-radius: 6px; border: 1px solid var(--ink-faint); color: var(--ink-soft); margin-right: 5px; }
.entry-head { text-align: center; padding: 30px 20px 22px; overflow: visible; }
.entry-han { font-family: var(--han); font-size: clamp(3.8rem, 19vw, 6rem); line-height: 1.1; text-shadow: 0 6px 18px rgba(180, 106, 114, .18); }
.entry-pin { font-size: 1.45rem; font-weight: 800; margin-top: 6px; }
.entry-zy { font-size: 1rem; color: var(--ink-soft); font-weight: 700; letter-spacing: .05em; }
.entry-simp { color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
.audio-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; align-items: center; }
.meanings { margin: 0; padding-left: 0; list-style: none; counter-reset: m; }
.meanings li { counter-increment: m; position: relative; padding: 7px 0 7px 38px; font-weight: 600; }
.meanings li + li { border-top: 1px dashed var(--line-soft); }
.meanings li::before {
  content: counter(m); position: absolute; left: 0; top: 7px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font: 800 .8rem var(--font); background: var(--blush); color: #8a4b54;
}
.examples { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.examples li { padding: 12px 16px; background: color-mix(in srgb, var(--vanilla) 60%, transparent); border-radius: 18px; border: 1px solid var(--line-soft); border-left: 3px solid var(--sage); }
:root[data-theme="dark"] .examples li { background: rgba(255, 255, 255, .04); }
.examples .ex-zh { font-family: var(--han); font-size: 1.3rem; }
.examples .ex-zh mark { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--blush) 90%, transparent) 58%); color: inherit; }
.examples .lvl { font-family: var(--font); font-size: .66rem; vertical-align: 4px; }
.examples .ex-py { font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
.examples .ex-ru { font-weight: 600; font-size: .95rem; }

/* character breakdown */
.parts { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.part { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; background: color-mix(in srgb, var(--card-solid) 85%, transparent); border: 1px solid var(--line-soft); border-radius: 20px; box-shadow: var(--shadow-sm); }
.part .pt-han {
  font-family: var(--han); font-size: 2rem; line-height: 1; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px;
  background:
    linear-gradient(color-mix(in srgb, var(--rose) 22%, transparent), color-mix(in srgb, var(--rose) 22%, transparent)) center / 100% 1px no-repeat,
    linear-gradient(color-mix(in srgb, var(--rose) 22%, transparent), color-mix(in srgb, var(--rose) 22%, transparent)) center / 1px 100% no-repeat,
    color-mix(in srgb, var(--blush) 30%, var(--card-solid));
  border: 1px solid color-mix(in srgb, var(--rose) 25%, transparent);
}
.part b { display: block; font-weight: 800; font-size: .95rem; }
.plus-sign { align-self: center; font: 600 1.6rem var(--serif); color: var(--rose); }
.char-block + .char-block { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.char-block h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 1rem; }
.char-block h3 .han { font-size: 1.9rem; }

/* ---------- writing grid 米字格 ---------- */
.grid-box {
  position: relative; width: min(280px, 72vw); aspect-ratio: 1; margin: 0 auto; border-radius: 18px; touch-action: none;
  background: color-mix(in srgb, var(--vanilla) 85%, var(--card-solid)); border: 1.5px solid color-mix(in srgb, var(--rose) 55%, transparent);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--card-solid) 70%, transparent), inset 0 0 0 6px color-mix(in srgb, var(--rose) 22%, transparent), var(--shadow-sm);
}
:root[data-theme="dark"] .grid-box { background: rgba(255, 255, 255, .04); }
.grid-box svg.mi { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.grid-box svg.mi path { stroke: color-mix(in srgb, var(--rose) 35%, transparent); stroke-width: 1; stroke-dasharray: 4 5; fill: none; vector-effect: non-scaling-stroke; }
.grid-box .writer { position: absolute; inset: 0; }
.write-row { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.write-row .slot { width: 46px; height: 46px; border: 1.5px dashed var(--line); border-radius: 12px; display: block; text-align: center; font-family: var(--han); font-size: 1.7rem; line-height: 43px; overflow: hidden; }
.write-row .slot.filled { border: 1px solid transparent; background: var(--s1); }
.write-row .slot.now { border: 1.5px solid var(--rose); background: var(--tomato-soft); }

/* ---------- session ---------- */
.session { max-width: 600px; margin: 0 auto; padding: 0 18px 44px; min-height: 100dvh; display: flex; flex-direction: column; }
.s-top { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.s-progress { flex: 1; height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--card-solid) 70%, transparent); overflow: hidden; position: relative; box-shadow: inset 0 1px 3px rgba(45, 58, 71, .12); }
.s-progress div { height: 100%; border-radius: 99px; transition: width .45s cubic-bezier(.3, 1.2, .5, 1); position: relative; background: linear-gradient(90deg, var(--sage), #d6bf98 55%, #e8a5b2); }
.s-progress div::after { content: ''; position: absolute; inset: 2px 6px auto; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .55); }
.s-count { font: 800 .95rem var(--font); color: var(--ink-soft); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.timer { font-weight: 900; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow-sm); color: var(--rose); }
.ex { flex: 1; display: flex; flex-direction: column; animation: ex-in .45s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes ex-in { from { opacity: 0; transform: translateY(14px); } }
.ex-kind { display: inline-flex; align-items: center; gap: 8px; font-family: var(--hand); font-size: 1.55rem; color: var(--rose); margin: 2px 0 14px; }
.ex-kind .ic { width: 22px; height: 22px; }
.prompt { text-align: center; padding: 34px 20px 30px; margin-bottom: 20px; overflow: visible; }
.prompt .p-han { font-family: var(--han); font-size: clamp(3.8rem, 20vw, 6.2rem); line-height: 1.1; overflow-wrap: anywhere; text-shadow: 0 6px 20px rgba(180, 106, 114, .15); }
.prompt .p-tr { font-family: var(--serif); font-size: clamp(1.55rem, 6.5vw, 2.05rem); font-weight: 700; line-height: 1.2; }
.prompt .p-pin { font-size: 1.25rem; font-weight: 800; margin-top: 6px; }
.prompt .p-sub { color: var(--ink-soft); font-weight: 700; margin-top: 8px; }
.prompt .listen-big { width: 100px; height: 100px; background: linear-gradient(180deg, #fbe0e6, var(--blush)); color: var(--rose-deep); border: 0; box-shadow: 0 14px 30px -12px rgba(180, 106, 114, .7), inset 0 2px 0 rgba(255, 255, 255, .6); animation: breathe-btn 2.8s ease-in-out infinite; }
.prompt .listen-big .ic { width: 46px; height: 46px; }
@keyframes breathe-btn { 50% { transform: scale(1.04); } }
.options { display: grid; gap: 12px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 18px; border-radius: 22px;
  border: 1px solid var(--glass-edge); background: var(--card); box-shadow: var(--shadow-sm); font-weight: 700; min-height: 60px;
 transition: transform .18s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s, background .3s, opacity .3s;
}
.opt:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.opt:active { transform: scale(.98); }
.opt .key { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 .8rem var(--font); color: var(--rose); background: var(--tomato-soft); flex: none; }
.opt .o-han { font-family: var(--han); font-size: 2.05rem; font-weight: 400; line-height: 1.1; }
.opt.han-opt { justify-content: center; padding: 16px 8px; }
.opt.right { background: linear-gradient(160deg, #e6edd3, #cfdab0); color: #2c3a22; border-color: rgba(125, 141, 92, .4); animation: glow-ok .7s ease; }
.opt.wrong { background: linear-gradient(160deg, #fde4ea, var(--blush)); color: #6d2e38; border-color: rgba(180, 106, 114, .4); animation: shake .4s; }
.opt.right .key { background: rgba(255, 255, 255, .6); color: var(--sage-deep); }
.opt.wrong .key { background: rgba(255, 255, 255, .6); }
.opt.dim { opacity: .45; }
.options.locked .opt { pointer-events: none; }
@keyframes glow-ok { 0% { box-shadow: 0 0 0 0 rgba(168, 181, 138, .7); } 100% { box-shadow: 0 0 0 16px rgba(168, 181, 138, 0); } }
@keyframes shake { 25% { translate: -6px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
.tone-opt { justify-content: center; gap: 6px; }
.tone-opt .tone-shape { width: 34px; height: 34px; vertical-align: middle; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pairs .opt { justify-content: center; text-align: center; min-height: 66px; font-size: .92rem; }
.pairs .opt.sel { background: linear-gradient(160deg, #e3ecf7, var(--sky-soft)); color: var(--lagoon); box-shadow: 0 0 0 2px var(--sky), var(--shadow-sm); }
.pairs .opt.gone { visibility: hidden; }
.cloze { font-family: var(--han); font-size: 1.7rem; line-height: 1.65; }
.cloze .blank { display: inline-block; min-width: 2.2em; border-bottom: 2.5px solid var(--rose); margin: 0 4px; }
.recall-grades { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* feedback sheet */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card-solid) 88%, transparent); border-radius: 34px 34px 0 0; border-top: 1px solid var(--glass-edge);
  box-shadow: 0 -18px 40px -18px rgba(45, 58, 71, .35);
  animation: sheet-in .45s cubic-bezier(.3, 1.2, .5, 1);
}
.sheet::before { content: ''; position: absolute; top: 9px; left: 50%; translate: -50% 0; width: 44px; height: 5px; border-radius: 99px; background: var(--line); }
.sheet.ok { background: linear-gradient(180deg, rgba(223, 231, 198, .94), rgba(255, 250, 242, .94)); }
.sheet.bad { background: linear-gradient(180deg, rgba(251, 221, 228, .95), rgba(255, 250, 242, .94)); }
:root[data-theme="dark"] .sheet.ok { background: linear-gradient(180deg, rgba(92, 106, 75, .9), rgba(43, 55, 68, .95)); }
:root[data-theme="dark"] .sheet.bad { background: linear-gradient(180deg, rgba(122, 86, 100, .9), rgba(43, 55, 68, .95)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sheet.ok { background: linear-gradient(180deg, rgba(92, 106, 75, .9), rgba(43, 55, 68, .95)); }
  :root:not([data-theme="light"]) .sheet.bad { background: linear-gradient(180deg, rgba(122, 86, 100, .9), rgba(43, 55, 68, .95)); }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-in { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; }
.sheet .bubu { width: 68px; height: auto; grid-row: span 2; }
.sheet .verdict { font-family: var(--hand); font-size: 1.9rem; line-height: 1; color: var(--rose); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet.ok .verdict { color: var(--sage-deep); }
:root[data-theme="dark"] .sheet.ok .verdict { color: #d8eab8; }
.sheet .ans { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sheet .ans .han { font-size: 1.9rem; }
.sheet .ans .tr { width: 100%; font-weight: 600; color: var(--ink-soft); }
.sheet .sheet-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 10px; }
.sheet .sheet-actions .btn.primary { flex: 1; }
.climb { display: inline-flex; align-items: center; gap: 5px; font: 800 .82rem var(--font); padding: 3px 11px; border-radius: 99px; background: linear-gradient(180deg, #fff3d9, #f5e2bf); color: #6b4b2a; box-shadow: var(--shadow-sm); animation: climb .7s cubic-bezier(.3, 1.6, .5, 1); }
.climb .ic { width: 15px; height: 15px; }
@keyframes climb { from { transform: translateY(12px) scale(.6); opacity: 0; } }

/* intro */
.intro-card { text-align: center; padding: 34px 20px 24px; overflow: visible; }
.intro-card .p-han { font-family: var(--han); font-size: clamp(4.2rem, 23vw, 6.8rem); line-height: 1.05; text-shadow: 0 8px 22px rgba(180, 106, 114, .18); }
.intro-card .p-pin { font-size: 1.5rem; font-weight: 800; margin-top: 4px; }
.intro-card .p-tr { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; margin-top: 6px; line-height: 1.2; }
.intro-more { margin-top: 18px; text-align: left; }
.intro-more h4 { font-size: .95rem; margin: 18px 0 10px; display: flex; gap: 8px; align-items: center; color: var(--ink-soft); }
.intro-more h4 .ic { color: var(--rose); }

/* done */
.done { text-align: center; padding: 30px 0 10px; position: relative; }
.done .seal-wrap { position: relative; width: 240px; height: 170px; margin: 0 auto; }
.done .seal-wrap .peony { position: absolute; width: 100px; height: 100px; }
.done .seal-wrap .peony.l { left: 0; top: 50px; rotate: -24deg; }
.done .seal-wrap .peony.r { right: 0; top: 40px; rotate: 30deg; animation-delay: -3s; }
.done .seal { width: 124px; height: 124px; position: absolute; left: 58px; top: 10px; transform: rotate(-8deg); animation: stamp .6s cubic-bezier(.2, 1.6, .4, 1) .25s backwards; filter: drop-shadow(0 8px 14px rgba(180, 106, 114, .35)); }
@keyframes stamp { from { transform: scale(2.4) rotate(-18deg); opacity: 0; } to { transform: rotate(-8deg); } }
.done h1 { margin-top: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.stat { border-radius: 22px; background: var(--card); padding: 12px 6px; box-shadow: var(--shadow-sm); border: 1px solid var(--glass-edge); text-align: center; }
.stat b { display: block; font: 700 2rem/1.05 var(--serif); }
.stat span { font-size: .78rem; color: var(--ink-soft); font-weight: 800; }
.stat:nth-child(1) { background: linear-gradient(160deg, color-mix(in srgb, var(--blush) 55%, transparent), var(--card)); }
.stat:nth-child(2) { background: linear-gradient(160deg, color-mix(in srgb, var(--sage) 40%, transparent), var(--card)); }
.stat:nth-child(3) { background: linear-gradient(160deg, color-mix(in srgb, var(--sky-soft) 85%, transparent), var(--card)); }
.climbed { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 22px; }
.climbed .chip { font-size: .95rem; padding: 5px 12px; }
.climbed .chip .han { font-size: 1.25rem; }

/* seal */

/* ---------- flashcards (browse) ---------- */
.scene { perspective: 1400px; margin: 10px 0 20px; touch-action: pan-y; }
.flashcard { position: relative; height: min(54dvh, 430px); transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, 1.2, .5, 1); cursor: pointer; }
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard.enter { animation: card-in .45s cubic-bezier(.3, 1.2, .5, 1); }
.flashcard.enter-back { animation: card-in-back .45s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes card-in { from { opacity: 0; translate: 40px 0; rotate: 4deg; } }
@keyframes card-in-back { from { opacity: 0; translate: -40px 0; rotate: -4deg; } }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: linear-gradient(170deg, var(--card-solid), color-mix(in srgb, var(--vanilla) 70%, var(--card-solid)));
  border: 1px solid var(--glass-edge); border-radius: 30px; box-shadow: var(--shadow); padding: 28px 22px; overflow: auto;
}
:root[data-theme="dark"] .face { background: var(--card-solid); }
.face::after { content: ''; position: absolute; inset: 9px; border-radius: 23px; border: 1px dashed var(--line); pointer-events: none; }
.face.back { transform: rotateY(180deg); background: linear-gradient(170deg, color-mix(in srgb, var(--blush) 35%, var(--card-solid)), var(--card-solid)); }
.face .label { position: absolute; top: 18px; left: 24px; font-family: var(--hand); font-size: 1.4rem; color: var(--rose); }
.face .f-han { font-family: var(--han); font-size: clamp(3.6rem, 18vw, 6.2rem); line-height: 1.1; overflow-wrap: anywhere; }
.face .f-pin { font-size: 1.45rem; font-weight: 800; }
.face .f-tr { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.face .f-tr.big { font-size: clamp(1.7rem, 7vw, 2.3rem); }
.face .f-note { font-size: .92rem; font-weight: 600; color: var(--ink-soft); background: color-mix(in srgb, var(--card-solid) 70%, transparent); border-radius: 14px; padding: 8px 14px; }
.face .tap-hint { position: absolute; bottom: 18px; font-size: .82rem; color: var(--ink-faint); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.card-controls { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; }
.card-controls .icon-btn { width: 54px; height: 54px; }
.card-options { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.card-options .btn.on { background: var(--tomato-soft); border-color: var(--rose); color: var(--rose); }

/* ---------- progress ---------- */
.big-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.big-stats .stat { padding: 16px 6px; }
.streak-card { display: flex; align-items: center; gap: 18px; }
.streak-card .lanterns { display: flex; gap: 2px; flex-wrap: wrap; }
.streak-card .lanterns .ic { width: 28px; height: 28px; }
@keyframes lantern { 50% { rotate: 6deg; } }
.streak-card b { font: 700 3rem/1 var(--serif); }
.heat-wrap { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 4px; width: max-content; margin-left: auto; }
.heat i { width: 14px; height: 14px; border-radius: 50%; background: color-mix(in srgb, var(--paper-2) 80%, transparent); }
.heat i.h1 { background: #f8dbe2; } .heat i.h2 { background: #f1b9c6; } .heat i.h3 { background: #d98f9d; } .heat i.h4 { background: var(--rose); }
.heat i.today { box-shadow: 0 0 0 2px var(--card-solid), 0 0 0 3.5px var(--rose); }
.heat i.future { visibility: hidden; }
.heat-legend { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); margin-top: 10px; }
.heat-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.months { display: flex; font-size: .74rem; font-weight: 800; color: var(--ink-soft); margin-bottom: 6px; width: max-content; margin-left: auto; }
.forecast { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 22px; }
.forecast .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.forecast .col i { width: 100%; max-width: 36px; background: linear-gradient(180deg, var(--sky-soft), var(--sky)); border-radius: 14px 14px 6px 6px; min-height: 6px; position: relative; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.forecast .col i b { position: absolute; top: -22px; left: 50%; translate: -50% 0; font: 700 1rem var(--serif); font-style: normal; }
.forecast .col.today i { background: linear-gradient(180deg, var(--blush), var(--rose)); }
.forecast .col span { font-size: .74rem; font-weight: 800; color: var(--ink-soft); }
.garden { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.garden a { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: .74rem; font-weight: 800; color: var(--ink-soft); padding: 6px; border-radius: 18px; transition: background .2s; }
.garden a:hover { background: color-mix(in srgb, var(--blush) 30%, transparent); }
.garden .plant { width: 66px; height: 66px; }
.garden a span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* plant art */
.plant { overflow: visible; }

/* Bubu */
.bubu { overflow: visible; }
.bubu-happy, .bubu-wow { animation: hop 3.4s ease-in-out infinite; transform-origin: 50% 100%; will-change: transform; }
@keyframes hop { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-6px) scaleY(1.03); } 88% { transform: scaleY(.96) scaleX(1.03); } }
.bubu-sleep { animation: breathe 3.8s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scaleY(.97) scaleX(1.02); } }

/* ---------- empty states & hero ---------- */
.empty { text-align: center; padding: 28px 10px; position: relative; }
.empty .bubu { width: 150px; height: auto; margin: 0 auto 4px; }
.empty p { color: var(--ink-soft); max-width: 420px; margin: 10px auto 20px; font-weight: 600; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bubu-stage { position: relative; width: 250px; height: 196px; margin: 0 auto; }
.bubu-stage .bubu { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: 150px; margin: 0; }
.bubu-stage .peony { position: absolute; width: 96px; height: 96px; }
.bubu-stage .peony.l { left: 0; bottom: 4px; rotate: -20deg; }
.bubu-stage .peony.r { right: 4px; bottom: 22px; rotate: 24deg; width: 74px; height: 74px; animation-delay: -3s; }
.empty h1 { font-size: 2.7rem; }

/* ---------- TOCFL library ---------- */
.level-card { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center; }
.level-badge { width: 62px; height: 62px; border-radius: 20px; display: grid; place-items: center; font: 700 1.4rem var(--serif); box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .6); color: #2d3a47 !important; }
.level-card p { margin: 2px 0 0; font-size: .84rem; color: var(--ink-soft); font-weight: 700; }

/* ---------- text import ---------- */
.tokens { font-family: var(--han); font-size: 1.6rem; line-height: 2.2; }
.tok { border: none; background: none; padding: 0 2px; border-radius: 10px; font: inherit; color: inherit; transition: background .2s; }
.tok.word { border-bottom: 2px dotted var(--ink-faint); border-radius: 4px; }
.tok.word:hover { background: color-mix(in srgb, var(--blush) 35%, transparent); }
.tok.known { border-bottom: 2px solid var(--sage); }
.tok.picked { background: var(--blush); color: var(--lagoon); border-radius: 10px; border-bottom-color: transparent; box-shadow: 0 4px 10px -4px rgba(180, 106, 114, .6); }
.picked-list { display: grid; gap: 8px; margin-top: 12px; }
.picked-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); }
.picked-item .han { font-size: 1.55rem; }
.picked-item small { color: var(--ink-soft); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- confusion pairs ---------- */
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.pair .side { text-align: center; padding: 14px 6px; border-radius: 22px; background: color-mix(in srgb, var(--vanilla) 55%, transparent); border: 1px solid var(--line-soft); }
:root[data-theme="dark"] .pair .side { background: rgba(255, 255, 255, .04); }
.pair .side .han { font-size: 3.2rem; line-height: 1.1; display: block; }
.pair .side b { display: block; font-weight: 800; }
.pair .side small { display: block; color: var(--ink-soft); font-weight: 700; line-height: 1.3; }
.pair .vs { font-family: var(--hand); font-size: 1.8rem; color: var(--rose); }

/* ---------- dialogs ---------- */
.dlg {
  border: 1px solid var(--glass-edge); border-radius: 30px; padding: 0; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: linear-gradient(180deg, var(--card-solid), color-mix(in srgb, var(--vanilla) 60%, var(--card-solid)));
  color: var(--ink); box-shadow: 0 30px 80px -20px rgba(45, 58, 71, .5); overflow: auto;
}
:root[data-theme="dark"] .dlg { background: var(--card-solid); }
.dlg::backdrop { background: rgba(45, 58, 71, .35); }
.dlg[open] { animation: dlg-in .4s cubic-bezier(.3, 1.25, .5, 1); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.dlg form { padding: 24px 22px 22px; }
.dlg h3 { font: 700 1.65rem var(--serif); margin-bottom: 14px; padding-right: 34px; }
.dlg-body { margin-bottom: 18px; }
.dlg-body > p { color: var(--ink-soft); font-weight: 600; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-actions .spacer { flex: 1; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list .btn { justify-content: flex-start; box-shadow: none; border-radius: 18px; }
.word-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
@media (max-width: 420px) {
  .dlg form { padding: 20px 16px 16px; }
  .dlg-actions .btn { padding: 10px 14px; }
}

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); translate: -50% 20px; z-index: 100;
  background: rgba(45, 58, 71, .92); color: var(--vanilla); padding: 11px 20px; border-radius: 99px; font-weight: 800; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, translate .35s cubic-bezier(.3, 1.4, .5, 1); max-width: calc(100vw - 32px);
  box-shadow: 0 12px 30px -10px rgba(45, 58, 71, .6);
}
#toast.show { opacity: 1; translate: -50% 0; }
body.in-session #toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

.footer-note { text-align: center; font-size: .8rem; color: var(--ink-faint); font-weight: 700; margin-top: 30px; }
.credits { font-size: .88rem; color: var(--ink-soft); font-weight: 600; }
.credits li { margin-bottom: 4px; }

@media (min-width: 760px) {
  .page { padding-top: 26px; }
  .hello { grid-template-columns: 140px 1fr; }
  .hello .bubu { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- lesson plan ---------- */
.plan-card { display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 18px; font: inherit; color: inherit; cursor: pointer; }
.plan-card .plant { width: 54px; height: 54px; }
.plan-today { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: center; margin-top: 18px; }
.plan-today .hand { grid-column: 1; font-size: 1.35rem; color: var(--rose); line-height: 1.1; }
.plan-today b { grid-column: 1; font: 700 1.45rem var(--serif); }
.plan-today .muted { grid-column: 1; }
.plan-today .ic { grid-column: 2; grid-row: 1 / span 3; color: var(--rose); }
.lesson-row .l-sub { display: block; font-size: .76rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
.lesson-row.is-today { background: color-mix(in srgb, var(--blush) 38%, transparent); }
.lesson-row.is-review .l-name { color: var(--ink-soft); }
.lesson-row .review-ic { width: 50px; height: 50px; display: grid; place-items: center; grid-row: span 2; color: var(--sage-deep); }
.lesson-row .review-ic .ic { width: 26px; height: 26px; }
.today-chip { background: var(--rose) !important; color: #fff8f3; border: 0; font-size: .7rem; padding: 1px 8px; vertical-align: 2px; }
.lesson-note { margin-bottom: 18px; }
.lesson-note p:last-child { margin: 0; }
.review-bubu { width: 92px; margin: 0 auto 4px; }
.mark-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--card-solid); }
.word-row .mark-dot { position: absolute; top: 10px; right: 10px; }
.word-row { position: relative; }
.mark-active { background: var(--sage); } .mark-recognize { background: #e9c46a; } .mark-extra { background: var(--sky); }
.mark-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .8rem; font-weight: 700; }
.mark-legend span { display: inline-flex; align-items: center; gap: 6px; }
.intro-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 18px; }
.intro-actions .btn:only-child { grid-column: 1 / -1; }

/* listen to a whole example */
.examples li { overflow: hidden; }
.examples .ex-audio { float: right; display: flex; gap: 6px; margin: 0 0 6px 10px; }
.examples .ex-audio .icon-btn { width: 36px; height: 36px; }
.examples .ex-audio .ic { width: 19px; height: 19px; }

/* room for the hosting badge at the bottom of the screen (Netlify free plan) */
:root { --badge-space: 0px; }
:root.host-badge { --badge-space: 60px; }
.nav { bottom: calc(14px + var(--badge-space) + env(safe-area-inset-bottom)); }
.page { padding-bottom: calc(130px + var(--badge-space)); }
.sheet { padding-bottom: calc(20px + var(--badge-space) + env(safe-area-inset-bottom)); }
#toast { bottom: calc(104px + var(--badge-space) + env(safe-area-inset-bottom)); }
body.in-session #toast { bottom: calc(24px + var(--badge-space) + env(safe-area-inset-bottom)); }
.session { padding-bottom: calc(44px + var(--badge-space)); }


/* =========================================================
   Livelier layer: rounder, bolder, more colour
   ========================================================= */
html[data-han="sans"] { --han: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif; }
html[data-han="serif"] { --han: 'Noto Serif TC', 'PMingLiU', 'Songti TC', serif; }

h1 { font-weight: 900; font-size: 2.05rem; letter-spacing: -.01em; }
h2 { font-weight: 800; font-size: 1.35rem; }
.page-head .hand, .bubble .hand, .plan-today .hand, .wotd .hand { font-size: 1.15rem; transform: rotate(-3deg); }
.ex-kind { font-size: 1.15rem; }
.sheet .verdict { font-size: 1.45rem; }
.face .label { font-size: 1.05rem; }
.num-box b, .stat b, .streak-card b { font-weight: 900; }
.brand > span { font-weight: 900; font-size: 1.35rem; }

.btn { font-weight: 900; }
.btn.primary { background: linear-gradient(180deg, #d4848e 0%, #bf6c76 55%, #a85a64 100%); box-shadow: 0 6px 0 #8e4a53, 0 14px 22px -10px rgba(180, 106, 114, .8); transform: translateY(-2px); }
.btn.primary:hover { transform: translateY(-3px); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #8e4a53; }

/* mode tiles: solid colour, a little Bubu in the corner */
.modes { gap: 12px; }
.mode { min-height: 140px; padding: 16px 16px 14px; border: 0; box-shadow: 0 5px 0 rgba(45, 58, 71, .08), 0 12px 24px -14px rgba(45, 58, 71, .35); }
.mode b { font-size: 1.12rem; font-weight: 900; max-width: 75%; }
.mode span { max-width: 68%; color: color-mix(in srgb, var(--lagoon) 70%, transparent); }
.mode .m-ic { background: rgba(255, 255, 255, .75); box-shadow: none; }
.mode.butter { background: linear-gradient(150deg, #fbe7bf, #f4d398); }
.mode.pink { background: linear-gradient(150deg, #fbd5de, #f2b3c2); }
.mode.sky { background: linear-gradient(150deg, #e2edf9, #bcd2ea); }
.mode.mint { background: linear-gradient(150deg, #e3ead0, #c6d3a3); }
.mode.lilac { background: linear-gradient(150deg, #ece2f6, #d5c3ea); }
.mode.wide { grid-column: 1 / -1; min-height: 118px; }
.mode .tile-art { position: absolute; right: -6px; bottom: -8px; width: 82px; height: auto; pointer-events: none; }
.mode.wide .tile-art { width: 96px; right: 8px; bottom: -10px; }
.mode .badge { right: auto; left: 64px; top: 14px; }
.mode b, .mode span, .mode .m-ic { position: relative; z-index: 1; }
:root[data-theme="dark"] .mode span { color: #3b4652; }
:root[data-theme="dark"] .mode b, :root[data-theme="dark"] .mode { color: #2d3a47; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mode, :root:not([data-theme="light"]) .mode b { color: #2d3a47; } :root:not([data-theme="light"]) .mode span { color: #3b4652; } }

.today-card .num-box:nth-child(1) { background: linear-gradient(160deg, #fbd5de, #f7c0cc); border: 0; }
.today-card .num-box:nth-child(2) { background: linear-gradient(160deg, #e3ead0, #cfdcae); border: 0; }
.today-card .num-box:nth-child(3) { background: linear-gradient(160deg, #e2edf9, #c7daf0); border: 0; }
.today-card .num-box span, .today-card .num-box b { color: #2d3a47; }

/* word of the day */
.wotd { margin-top: 18px; background: linear-gradient(150deg, color-mix(in srgb, var(--blush) 40%, var(--card)), var(--card)); }
.wotd-main { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.wotd-han { font-family: var(--han); font-size: 3.2rem; line-height: 1.1; }
.wotd-info { flex: 1; display: flex; flex-direction: column; }
.wotd-info b { font-size: 1.15rem; }
.wotd-info span { color: var(--ink-soft); font-weight: 700; }

/* answer sheet: example, rule, combo */
.sheet { max-height: 78dvh; overflow-y: auto; }
.sheet-ex { grid-column: 1 / -1; }
.sheet-ex .examples li { background: rgba(255, 255, 255, .55); }
:root[data-theme="dark"] .sheet-ex .examples li { background: rgba(0, 0, 0, .15); }
.rule-btn { grid-column: 1 / -1; justify-self: start; }
.combo-chip { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 99px; background: linear-gradient(180deg, #ffd9a8, #f6b97a); color: #6b3d16; font: 900 .8rem var(--font); animation: climb .6s cubic-bezier(.3, 1.6, .5, 1); }
.cant-listen { display: flex; margin: -6px auto 14px; }

/* grammar notes */
.grammar p { margin: 0 0 .5em; font-weight: 600; }
.grammar b { color: var(--rose); }
.grammar .examples { margin-top: 10px; }
.grammar-dlg .dlg-body { max-height: 60dvh; overflow-y: auto; }

/* sentence builder */
.build-prompt .p-tr { font-size: clamp(1.25rem, 5.5vw, 1.6rem); }
.build-answer { min-height: 66px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding: 12px; margin-bottom: 14px;
  border-radius: 20px; border: 2px dashed color-mix(in srgb, var(--rose) 40%, transparent); background: color-mix(in srgb, var(--card-solid) 60%, transparent); transition: background .3s, border-color .3s; }
.build-answer.right { border-color: var(--sage-deep); background: color-mix(in srgb, var(--sage) 30%, transparent); }
.build-answer.wrong { border-color: var(--rose); background: color-mix(in srgb, var(--blush) 40%, transparent); animation: shake .4s; }
.build-placeholder { color: var(--ink-faint); font-weight: 700; align-self: center; }
.build-tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
.tile { font-family: var(--han); font-size: 1.55rem; padding: 8px 14px; border-radius: 16px; border: 0; background: var(--card-solid); color: var(--ink);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--rose) 30%, transparent), 0 8px 16px -10px rgba(45, 58, 71, .4); transition: transform .12s, opacity .2s; }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--rose) 30%, transparent); }
.tile.used { opacity: .25; pointer-events: none; }
.tile.in { background: linear-gradient(180deg, #fff, #fbe9ee); animation: pop .3s ease; }
:root[data-theme="dark"] .tile.in { background: var(--card-solid); }

/* lesson growth line, garden percent */
.grow-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-size: .86rem; font-weight: 700; color: var(--ink-soft); }
.grow-line .plant { width: 40px; height: 40px; flex: none; }
.grow-line b { color: var(--rose); }
.garden small { font-weight: 900; color: var(--rose); }

/* stickers */
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.sticker { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 6px; border-radius: 20px; background: var(--paper-2); }
.sticker img { width: 56px; height: 56px; object-fit: contain; filter: grayscale(1); opacity: .35; }
.sticker b { font-size: .82rem; font-weight: 900; color: var(--ink-faint); }
.sticker small { font-size: .68rem; font-weight: 700; color: var(--ink-faint); line-height: 1.2; }
.sticker.got { background: linear-gradient(160deg, color-mix(in srgb, var(--blush) 55%, var(--card)), var(--card)); box-shadow: var(--shadow-sm); }
.sticker.got img { filter: none; opacity: 1; animation: pop .5s ease; }
.sticker.got b { color: var(--ink); }
.sticker.got small { color: var(--ink-soft); }

.plan-today .hand { margin-bottom: 4px; display: block; }
.plan-today-wrap { position: relative; }
.plan-change { position: absolute; right: 12px; bottom: 10px; }
.plan-today { padding-bottom: 46px; }
.make-current { margin: -8px 0 16px; }
.page-head .hand { margin-bottom: 2px; }

/* the same dark-only touches when the theme follows the system */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .komorebi img { filter: invert(1); }
  :root:not([data-theme="light"]) .examples li { background: rgba(255, 255, 255, .04); }
  :root:not([data-theme="light"]) .grid-box { background: rgba(255, 255, 255, .04); }
  :root:not([data-theme="light"]) .sheet.ok { background: linear-gradient(180deg, rgba(92, 106, 75, .9), rgba(43, 55, 68, .95)); }
  :root:not([data-theme="light"]) .sheet.bad { background: linear-gradient(180deg, rgba(122, 86, 100, .9), rgba(43, 55, 68, .95)); }
  :root:not([data-theme="light"]) .sheet.ok .verdict { color: #d8eab8; }
  :root:not([data-theme="light"]) .face { background: var(--card-solid); }
  :root:not([data-theme="light"]) .pair .side { background: rgba(255, 255, 255, .04); }
  :root:not([data-theme="light"]) .dlg { background: var(--card-solid); }
  :root:not([data-theme="light"]) .mode span { color: #3b4652; }
  :root:not([data-theme="light"]) .mode b, :root:not([data-theme="light"]) .mode { color: #2d3a47; }
  :root:not([data-theme="light"]) .sheet-ex .examples li { background: rgba(0, 0, 0, .15); }
  :root:not([data-theme="light"]) .tile.in { background: var(--card-solid); }
}

/* ---------- context first: sentences, «также», function words ---------- */
.p-also { margin: 6px auto 0; max-width: 32ch; font-weight: 700; color: var(--ink-soft); font-size: .95rem; }
.p-also span { font-family: var(--hand); color: var(--rose); font-size: .9rem; margin-right: 4px; }
.func-note { display: flex; gap: 8px; align-items: flex-start; text-align: left; margin: 12px auto 0; max-width: 36ch; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--sky-soft) 70%, transparent); font-weight: 700; font-size: .88rem; }
.func-note .ic { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.intro-ex { margin-top: 16px; text-align: left; }
.not-hint { color: var(--rose); font-weight: 800; }
.limit-line { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 14px 0 0; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--sage) 22%, transparent); font-weight: 700; font-size: .92rem; }
.limit-line > span { flex: 1 1 220px; }
.limit-line > .ic { width: 20px; height: 20px; }

/* «Пойми фразу» */
.sense-card { padding: 22px 18px 16px; }
.sense-zh { font-family: var(--han); font-size: 2rem; line-height: 1.5; letter-spacing: .02em; }
.sense-py { margin-top: 4px; font-size: 1rem; }
.sense-tools { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 12px 0 6px; }
.sense-opts { grid-template-columns: 1fr; }
.sense-opts .opt { text-align: left; font-size: 1rem; line-height: 1.35; padding-top: 14px; padding-bottom: 14px; }

/* tappable words */
.rw { cursor: pointer; border-radius: 8px; padding: 0 1px; transition: background .15s; }
.rw:hover { background: color-mix(in srgb, var(--sky-soft) 80%, transparent); }
.rw.mark { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--blush) 90%, transparent) 58%); }
.rw.on { background: var(--blush); }

/* mini-stories */
.mode.peach { background: linear-gradient(150deg, #fde6dc, #f4c3b9); }
.story-list { display: grid; gap: 12px; }
.story-row { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 18px 22px; color: inherit; text-decoration: none; overflow: hidden; }
.story-han { font-family: var(--han); font-size: 1.7rem; padding-right: 40px; }
.story-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.story-info b { font-size: 1.02rem; }
.story-info small { color: var(--ink-soft); font-weight: 700; }
.story-done { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); }
.story-done .ic { width: 18px; height: 18px; }
.story-bar { position: absolute; left: 18px; right: 18px; bottom: 9px; height: 5px; border-radius: 5px; background: var(--line-soft); }
.story-bar i { display: block; height: 100%; border-radius: 5px; background: var(--sage); }
.story-row.fits .story-bar i { background: var(--rose); }
.story-title { font-size: 2.3rem; }
.story-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.btn.on { background: var(--tomato-soft); border-color: var(--rose); color: var(--rose); }
.story { padding: 8px 18px; }
.story-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px 0; border-bottom: 1px dashed var(--line); transition: background .2s; }
.story-line:last-child { border-bottom: 0; }
.story-line.now { background: color-mix(in srgb, var(--blush) 30%, transparent); border-radius: 14px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.sl-zh { font-family: var(--han); font-size: 1.55rem; line-height: 1.6; grid-column: 1; }
.sl-zh .rw, .sense-zh .rw, .sl-zh .nw, .sense-zh .nw { display: inline-block; }
.nw { white-space: nowrap; }
.sl-py { grid-column: 1; color: var(--ink-soft); font-weight: 700; font-size: .92rem; }
.sl-ru { grid-column: 1; font-weight: 700; color: var(--rose-deep); }
.sl-tools { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 2px; align-self: start; }
.sl-tools .icon-btn { width: 36px; height: 36px; }
.story-end { display: flex; justify-content: center; margin: 22px 0 8px; }
.word-pop { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--badge-space, 0px) + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 24px)); z-index: 40; }
.wp-in { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 22px; background: var(--card-solid); box-shadow: var(--shadow); border: 1px solid var(--line); }
.wp-han { font-size: 2rem; }
.wp-info { display: grid; flex: 1; min-width: 0; }
.wp-info span { font-weight: 700; font-size: .92rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="dark"] .wp-in { background: #34424f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wp-in { background: #34424f; } }

/* stories: levels, toggles, check */
.story-lead { font-weight: 700; margin: -6px 0 16px; }
.story-next { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 8px; color: inherit; text-decoration: none; background: linear-gradient(150deg, #fde6dc, #f4c3b9); border: 0; }
.story-next .bubu { width: 62px; height: auto; flex: none; }
.story-next > span { display: grid; flex: 1; min-width: 0; }
.story-next b { font-size: 1.6rem; font-weight: 400; color: #2d3a47; }
.story-next small { font-weight: 700; color: #3b4652; }
.story-next .hand { color: var(--rose-deep); }
.story-level { margin-top: 26px; align-items: baseline; }
.lvl-avg { font-weight: 800; font-size: .85rem; color: var(--ink-soft); }
.story-about { margin: -6px 0 12px; font-weight: 700; }
.story-done b { font-size: .7rem; }
.story-line .sl-py, .story-line .sl-ru { display: none; }
.story.show-py .sl-py, .story.show-tr .sl-ru, .story-line.peek .sl-py, .story-line.peek .sl-ru { display: block; }
.sl-tools .icon-btn.on { background: var(--tomato-soft); color: var(--rose); }
.btn.sw-btn { gap: 8px; }
.btn.sw-btn .tg { width: 28px; height: 16px; border-radius: 10px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.btn.sw-btn .tg::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.btn.sw-btn.on .tg { background: var(--rose); }
.btn.sw-btn.on .tg::after { transform: translateX(12px); }
.story-end { gap: 10px; flex-wrap: wrap; }
.check-next { margin-top: 14px; }
.story-done-page h1 { margin-top: 8px; }
.story-fresh { max-width: 420px; margin: 16px auto 0; text-align: left; display: grid; gap: 10px; justify-items: start; }
.fresh-words { display: flex; flex-wrap: wrap; gap: 6px; }
.fresh-words .chip { font-size: 1.2rem; background: var(--s0); }

/* stories that follow the plan */
.plan-tag { font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--s1); color: #3b4652; margin-bottom: 2px; }
.plan-tag.now { background: var(--s2); }
.plan-tag.later { background: var(--line-soft); color: var(--ink-soft); }
.story-row.ahead { opacity: .7; }
.story-row.ahead .story-han { color: var(--ink-soft); }
.rw.rep { text-decoration: underline wavy color-mix(in srgb, var(--sage-deep) 80%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.plan-legend { font-weight: 700; font-size: .9rem; color: var(--ink-soft); margin: -4px 0 12px; }
.plan-legend .rw { cursor: default; color: var(--ink); }
.plan-ahead { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: .9rem; padding: 10px 14px; border-radius: 16px; background: var(--line-soft); margin: -4px 0 12px; }
.plan-ahead .ic { width: 18px; height: 18px; flex: none; }
.home-story { margin-top: 14px; }
.fresh-words .chip.s1, .fresh-words .chip.s2, .fresh-words .chip.s3, .fresh-words .chip.s4 { background: var(--s1); }
.story-more { margin-top: 12px; }
.story-more summary { cursor: pointer; list-style: none; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; padding: 6px 2px; }
.story-more summary .ic { width: 18px; height: 18px; transition: transform .2s; }
.story-more[open] summary .ic { transform: rotate(90deg); }
.story-more .story-list { margin-top: 10px; }

/* lesson grammar: its words and the rule */
.grammar-note p { margin: 0 0 8px; }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.g-chip { text-decoration: none; color: inherit; display: inline-flex; align-items: baseline; gap: 6px; }
.g-chip small { font-family: var(--font, inherit); font-size: .7rem; font-weight: 800; color: var(--rose); }
.grammar-note .btn { margin-bottom: 4px; }
.g-line { font-weight: 800; color: var(--ink); margin: 0 0 12px; }
.g-topic + .g-topic { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--line, rgba(0,0,0,.1)); }
.g-topic h3 { font-size: 1rem; margin: 0 0 8px; }
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gram-topic { font-weight: 800; margin: 0 0 8px; }

/* tap a word outside a session: reading and meaning */
.peek-pop {
  position: fixed; z-index: 300; width: min(260px, calc(100vw - 16px)); padding: 12px 14px; border-radius: 18px;
  background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow, 0 10px 30px rgba(45, 58, 71, .18));
  animation: peek-in .18s ease-out; text-align: left;
}
@keyframes peek-in { from { opacity: 0; transform: translateY(4px); } }
.peek-pop .pk-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.peek-pop .han { font-size: 1.8rem; line-height: 1.1; font-weight: 500; }
.peek-pop .pk-py { font-weight: 800; color: var(--rose); }
.peek-pop .pk-ru { font-weight: 700; margin: 6px 0 10px; color: var(--ink); }
.peek-pop .pk-act { display: flex; gap: 8px; align-items: center; }
.peek-pop .pk-act .btn { text-decoration: none; }
::highlight(peek) { background-color: rgba(247, 200, 211, .75); }
.session .sense-zh .rw { cursor: default; }
/* the handwritten labels have tall letters: room below them on wide screens too */
.bubble .hand { line-height: 1.3; margin-bottom: 4px; }
.plan-today .hand { line-height: 1.35; margin-bottom: 6px; }


/* =========================================================
   Notebook · editorial · collage (2026 redesign)
   - grid-paper page with a highlighter, as in a study notebook
   - editorial headings: numbered sections [01], thin rules, a serif display face
   - collage: big pale characters and an ink plum branch behind, tiles cut out like stickers
   Only the palette colours and their tints.
   ========================================================= */
:root {
  --display: 'Playfair Display', 'M PLUS Rounded 1c', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --grid-line: rgba(169, 183, 198, .2);
  --grid-size: 26px;
  --rule: rgba(45, 58, 71, .14);
  --hl: rgba(247, 200, 211, .9);
  --sticker-edge: #fffaf2;
  --side: 248px;
}
:root[data-theme="dark"] { --grid-line: rgba(213, 229, 246, .045); --rule: rgba(255, 255, 255, .12); --hl: rgba(180, 106, 114, .55); --sticker-edge: #3a4756; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --grid-line: rgba(213, 229, 246, .045); --rule: rgba(255, 255, 255, .12); --hl: rgba(180, 106, 114, .55); --sticker-edge: #3a4756; }
}

/* grid paper over the soft morning light */
body::before {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    url('../images/decor/paper-grain.svg'),
    radial-gradient(70vmax 55vmax at -5% -10%, var(--blob1), transparent 62%),
    radial-gradient(55vmax 50vmax at 105% 18%, var(--blob2), transparent 60%),
    radial-gradient(65vmax 55vmax at 25% 108%, var(--blob3), transparent 62%),
    radial-gradient(45vmax 45vmax at 110% 95%, var(--blob4), transparent 60%),
    var(--bg);
}

/* highlighter stroke, a little uneven like a real marker */
mark.hl {
  color: inherit; padding: 0 .12em; margin: 0 -.04em; border-radius: .3em .5em .4em .2em;
  background: linear-gradient(100deg, transparent .15em, var(--hl) .3em, var(--hl) calc(100% - .3em), transparent calc(100% - .1em)) 0 78% / 100% .58em no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.bubble mark.hl { --hl: rgba(168, 181, 138, .55); }

/* editorial headings */
h1, .page-head h1 { font-family: var(--display); font-weight: 800; letter-spacing: -.015em; }
.today-card h2, .section-title h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
.page { counter-reset: sec; }
.section-title { border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-top: 34px; }
.section-title h2::before {
  counter-increment: sec; content: '[' counter(sec, decimal-leading-zero) ']';
  font: 700 .72rem/1 var(--mono); color: var(--rose); letter-spacing: .04em; align-self: flex-start; margin-top: .45em;
}
.section-title h2::after { opacity: .9; }

/* collage hero: pale big characters and an ink branch behind Bubu */
.hello { position: relative; isolation: isolate; }
.hello-han {
  position: absolute; z-index: -1; right: -6px; top: -26px; font: 400 6.6rem/1 var(--han); letter-spacing: -.05em;
  color: color-mix(in srgb, var(--blush) 70%, transparent); rotate: -7deg; pointer-events: none; user-select: none;
}
.hello-branch { position: absolute; z-index: -1; left: 64px; top: -34px; width: 190px; opacity: .55; rotate: -4deg; pointer-events: none; }
.hello .bubble { box-shadow: var(--shadow-sm); border: 1px solid var(--rule); }

/* cards: a thin pencil edge */
.card { border-color: color-mix(in srgb, var(--rose) 14%, var(--glass-edge)); }
.card.tint-butter { background: linear-gradient(160deg, color-mix(in srgb, #f6e4c4 70%, var(--card)), var(--card)); }

/* stickers: the tiles and the day numbers are cut out with a cream edge */
.mode, .today-card .num-box {
  border: 3px solid var(--sticker-edge) !important;
  box-shadow: 0 1px 0 rgba(45, 58, 71, .06), 0 10px 22px -14px rgba(45, 58, 71, .45);
}
.modes > :nth-child(odd) { rotate: -.6deg; }
.modes > :nth-child(even) { rotate: .7deg; }
.mode { transition: rotate .25s cubic-bezier(.3, 1.4, .5, 1), transform .25s cubic-bezier(.3, 1.4, .5, 1), box-shadow .25s; }
.mode:hover { rotate: 0deg; transform: translateY(-3px); box-shadow: 0 1px 0 rgba(45, 58, 71, .06), 0 18px 30px -16px rgba(45, 58, 71, .5); }
/* faint grid inside each sticker, like a cut-out of the notebook */
.mode::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: linear-gradient(rgba(255, 255, 255, .55) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(90deg, rgba(255, 255, 255, .55) 1px, transparent 1px) 0 0 / 18px 18px;
}
/* tiles in the palette only: blush, rosewood, sage, misty sky, vanilla */
.mode.blush { background: linear-gradient(150deg, #fde3e9, #f7c8d3); }
.mode.mint { background: linear-gradient(150deg, #e6ebd6, #c7d2a8); }
.mode.sky { background: linear-gradient(150deg, #eaf2fb, #d5e5f6); }
.mode.vanilla { background: linear-gradient(150deg, #fff7e6, #f5e3c3); }
.mode.pink { background: linear-gradient(150deg, #f6dde0, #e4b6bc); }
.mode.mist { background: linear-gradient(150deg, #e7ecf1, #c3cfdb); }
.mode.sage-soft { background: linear-gradient(150deg, #f1f4e8, #dbe3c5); }
.mode b { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.005em; }
.mode .badge { font-family: var(--mono); }
.today-card .num-box:nth-child(1) { background: linear-gradient(160deg, #fde3e9, #f7c8d3); }
.today-card .num-box:nth-child(2) { background: linear-gradient(160deg, #e6ebd6, #cdd8b0); }
.today-card .num-box:nth-child(3) { background: linear-gradient(160deg, #eaf2fb, #d5e5f6); }
.today-card .num-box b { font-family: var(--display); font-weight: 800; }
.today-card .num-box:nth-child(1) { rotate: -1deg; } .today-card .num-box:nth-child(3) { rotate: 1deg; }

/* the side menu parts only show on a wide screen */
.nav-brand, .nav-extra, .nav-branch { display: none !important; }

/* ---------- tablet ---------- */
@media (min-width: 760px) {
  .modes { grid-template-columns: repeat(3, 1fr); }
  .mode.wide { grid-column: span 3; }
  .hello-han { font-size: 8rem; }
}

/* ---------- computer: side menu, two columns ---------- */
@media (min-width: 1024px) {
  .topbar { display: none; }
  .nav {
    left: 18px; top: 18px; bottom: 18px; translate: none; width: var(--side);
    flex-direction: column; align-items: stretch; gap: 4px; padding: 18px 14px; border-radius: 32px;
    background: color-mix(in srgb, var(--card-solid) 80%, transparent); overflow: hidden;
  }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 16px; font-size: .98rem; border-radius: 18px; }
  .nav a .ic { width: 22px; height: 22px; }
  .nav a:not(.on):hover { background: color-mix(in srgb, var(--blush) 28%, transparent); color: var(--ink); }
  .nav a .dot { position: static; margin-left: auto; }
  .nav .nav-brand { display: flex !important; align-items: center; gap: 10px; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); border-radius: 0; color: var(--ink); }
  .nav .nav-brand:hover { background: none !important; }
  .nav-brand .logo { width: 46px; height: 46px; filter: drop-shadow(0 4px 6px rgba(180, 106, 114, .3)); }
  .nav-brand > span { font: 900 1.4rem var(--serif); }
  .nav-brand .han { color: var(--rose); font-size: 1.3rem; margin-right: 2px; }
  .nav .nav-extra { display: flex !important; margin-top: auto; }
  .nav .nav-branch { display: block !important; width: 230px; margin: 10px -30px -26px auto; opacity: .7; pointer-events: none; }

  main.page { max-width: none; margin: 0 0 0 calc(var(--side) + 18px); padding: 36px clamp(28px, 4vw, 64px) 64px; }
  main.page > * { max-width: 900px; margin-left: auto; margin-right: auto; }
  main.page > .section-title { margin-top: 34px; }
  main.page-today > .home { max-width: 1160px; }
  .page-head h1 { font-size: 2.9rem; }
  .page-head .hand { font-size: 1.5rem; }
  #toast { left: calc(50% + (var(--side) + 18px) / 2); bottom: 28px; }

  /* home: today and the plan on the left, the word of the day and the week on the right */
  .home {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px 32px; align-items: start;
    grid-template-areas: 'hello side' 'today side' 'plan side' 'modes modes' 'backup backup';
  }
  .home > .hello { grid-area: hello; margin: 0; }
  .home > .h-today { grid-area: today; margin: 0; }
  .home > .h-plan { grid-area: plan; }
  .home > .h-side { grid-area: side; padding-top: 52px; }
  .home > .h-modes { grid-area: modes; }
  .home > .h-backup { grid-area: backup; }
  .h-plan .plan-today { margin-top: 0; }
  .h-side .wotd { margin-top: 0; }
  .h-side .section-title { margin-top: 26px; }
  .hello { grid-template-columns: 150px 1fr; }
  .hello .bubu { width: 150px; }
  .hello .bubble { font-size: 1.12rem; }
  .bubble .hand { font-size: 1.7rem; }
  .hello-han { font-size: 9.5rem; top: -40px; right: 0; }
  .hello-branch { width: 240px; left: 90px; top: -46px; }

  /* modes: a sticker sheet of four columns */
  .modes { grid-template-columns: repeat(4, 1fr); gap: 18px; grid-auto-flow: dense; }
  .mode { min-height: 150px; }
  .mode.wide, .modes > a[href="#/confusion"], .modes > a[href="#/text"] { grid-column: span 2; }

  /* sessions: a calm centred sheet of paper */
  .session { max-width: 720px; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .nav-branch { animation: sway 9s ease-in-out infinite; transform-origin: 100% 100%; }
}
@keyframes sway { 50% { rotate: -2deg; } }

/* home on a phone: everything in one column, the modes before the week */
.home { display: flex; flex-direction: column; }
.home > .h-side { display: contents; }
.home > .hello { order: 1; } .home > .h-today { order: 2; } .home > .h-plan { order: 3; }
.home .wotd { order: 4; } .home > .h-modes { order: 5; } .home .week-title { order: 6; } .home .week-card { order: 7; } .home > .h-backup { order: 8; }
.home .modes-title h2::before { content: '[01]'; counter-increment: none; }
.home .week-title h2::before { content: '[02]'; counter-increment: none; }
mark.hl { white-space: nowrap; }
/* the ink branch sits behind the speech bubble, not over Bubu */
.hello-branch { left: auto; right: -14px; top: -40px; width: 170px; rotate: 6deg; opacity: .5; }
.hello-han { right: auto; left: 104px; top: -30px; }

@media (min-width: 1024px) {
  .home { display: grid; }
  .home > .h-side { display: block; }
  .home .modes-title h2::before { content: '[02]'; }
  .home .week-title h2::before { content: '[01]'; }
  .hello-branch { width: 230px; right: -20px; top: -50px; }
  .hello-han { left: 150px; top: -44px; }
  /* reading: stories side by side */
  .story-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .story-list > * + * { margin-top: 0 !important; }
  /* progress: the ladder does not need the whole width */
  .page-progress .ladder-art { max-width: 640px; margin: 0 auto; }
  /* answer sheet: under the exercise, not across the whole screen */
  .sheet { left: 50%; right: auto; width: min(760px, 100vw); translate: -50% 0; }
}
@media (min-width: 1024px) {
  .ladder-art { max-width: 620px; margin: 0 auto; }
  main.page > .crumbs { margin-left: max(0px, calc((100% - 900px) / 2)); }
  .word-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .word-list > li + li { margin-top: 0 !important; }
  .hello-han { top: -16px; }
}
