/* Screen-level layouts for Path Mandarin (loaded after app.css).
   Colour blocks follow the Taipei retro palette: Darlington mint for calm welcome blocks, Grenadine for the
   brand moments (splash, finish), Cafe Latte for footers. Text on colour is always ink or white (checked for AA). */

/* ---------- splash (boot): real loading progress, huge 學 as the visual object ---------- */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr auto; color: #fff; overflow: hidden;
  background: radial-gradient(90% 60% at 85% 10%, rgba(255, 255, 255, .12), transparent 60%), linear-gradient(172deg, #C8102E 0%, #B00D29 55%, #8E0A21 100%);
  padding: calc(18px + env(safe-area-inset-top, 0px)) 24px calc(26px + env(safe-area-inset-bottom, 0px)); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.boot.out { opacity: 0; transform: scale(1.03); pointer-events: none; }
.boot-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.boot-top img { height: 30px; width: auto; display: block; }
.boot .lbl { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .86); font-variant-numeric: tabular-nums; }
.boot-c { display: grid; align-content: center; justify-items: center; text-align: center; gap: 10px; }
.boot-hz { font-family: var(--font-zh); font-size: min(64vw, 46vh, 380px); line-height: .95; color: #fff; animation: ink 1.3s var(--ease) both .1s; }
.boot-cap { display: flex; gap: 14px; align-items: baseline; animation: fade .8s var(--ease) both .7s; }
.boot-cap .py { font-size: 20px; color: #fff; }
.boot-foot { display: grid; gap: 12px; width: min(560px, 100%); margin: 0 auto; animation: fade .8s var(--ease) both .4s; }
.boot-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.boot-row b { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.boot-bar { height: 2px; background: rgba(255, 255, 255, .26); overflow: hidden; }
.boot-bar i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(var(--p, .04)); transition: transform .5s var(--ease); }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent-ink); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- gate: grand welcome + sign in ---------- */
.gate { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); }
.gate-hero { background: var(--mint); color: var(--ink); padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter) 34px; position: relative; overflow: hidden; }
.gate-hero .gh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gate-hero .gh-top img { height: 34px; width: auto; display: block; }
.gate-hero .seg { background: rgba(255, 255, 255, .45); }
.gh-hz { font-family: var(--font-zh); font-size: min(38vw, 260px); white-space: nowrap; line-height: .95; margin: 22px 0 6px -4px; animation: ink 1.2s var(--ease) both .1s; }
.gh-cap { display: flex; gap: 14px; align-items: baseline; margin-bottom: 22px; }
.gh-cap .py { font-size: 18px; color: var(--ink-2); }
.gh-cap .lbl, .gh-kick { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.gh-title { font-family: var(--font-display); font-size: clamp(34px, 7vw, 56px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; margin: 8px 0 10px; color: var(--ink); }
.gh-lede { font-size: 16.5px; color: var(--ink-2); max-width: 36ch; margin: 0; }
.gh-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; border-top: 1px solid rgba(23, 24, 26, .18); max-width: 520px; }
.gh-list li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid rgba(23, 24, 26, .18); font-size: 14.5px; color: var(--ink-2); }
.gh-list li .zh { font-size: 26px; color: var(--ink); line-height: 1; }
.gh-list li b { color: var(--ink); font-weight: 700; }
.gate-main { display: grid; align-content: start; justify-items: center; padding: 30px var(--gutter) 34px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1, .auth-card h2.big { font-size: 30px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gate-foot { background: var(--latte); color: #fff; padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; font-size: 13.5px; }
.gate-foot a { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.gate-foot span { color: rgba(255, 255, 255, .86); }
.gate-check { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px; text-align: center; background: var(--mint); }
.gate-check .zh { font-size: min(40vw, 200px); line-height: 1; }
@media (min-width: 900px) {
  .gate { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .gate-hero { grid-row: 1 / span 2; padding: 34px clamp(36px, 5vw, 72px); display: flex; flex-direction: column; }
  .gate-hero .gh-body { margin-top: auto; }
  .gh-hz { font-size: min(15vw, 220px); margin-top: 0; }
  .gate-main { align-content: center; padding: 48px; }
  .gate-foot { justify-content: flex-start; padding: 18px 48px; }
}

/* ---------- onboarding: one question per screen ---------- */
.ob { min-height: 100dvh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.ob-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 0 8px; position: sticky; top: 0; z-index: 5; background: var(--bg); }
.ob-top .icon-btn { margin-left: -10px; }
.ob-top .icon-btn[aria-hidden="true"] { visibility: hidden; }
.ob-prog { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ob-prog i { height: 3px; background: var(--surface-3); position: relative; overflow: hidden; }
.ob-prog i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.ob-prog i.done::after { transform: none; }
.ob-prog i.cur::after { background: var(--accent); transform: none; animation: growX .7s var(--ease) both .15s; }
.ob-step { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.ob-body { flex: 1; padding: 18px 0 28px; animation: slideL .5s var(--ease) both; }
.ob-body.back { animation-name: slideR; }
.ob-word { display: flex; align-items: flex-end; gap: 14px; margin: 6px 0 26px; }
.ob-word .zh { font-size: clamp(84px, 26vw, 132px); line-height: .92; animation: ink 1s var(--ease) both .12s; }
.ob-word .cap { display: grid; gap: 2px; padding-bottom: 8px; }
.ob-word .cap .py { font-size: 16px; color: var(--ink-2); }
.ob-word .cap .lbl { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ob-body h1 { font-size: clamp(30px, 7.4vw, 40px); }
.ob-body .lede { color: var(--muted); margin: 12px 0 24px; max-width: 46ch; }
.ob-cta { position: sticky; bottom: 0; padding: 14px 0 calc(16px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 72%, color-mix(in srgb, var(--bg) 0%, transparent)); display: grid; gap: 8px; }
.opt-grid { display: grid; gap: 8px; }
.opt { text-align: left; padding: 16px 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; font: inherit; color: inherit; transition: border-color var(--snap) var(--ease), box-shadow var(--snap) var(--ease), transform var(--snap) var(--ease); }
.opt:active { transform: scale(.985); }
.opt b { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.opt span:not(.radio) { font-size: 14px; color: var(--muted); grid-column: 1; }
.opt .radio { grid-column: 2; grid-row: 1 / span 2; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: border-color var(--snap) var(--ease); }
.opt .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform var(--reveal) var(--spring); }
.opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt[aria-pressed="true"] .radio { border-color: var(--ink); }
.opt[aria-pressed="true"] .radio::after { transform: scale(1); }
@media (hover: hover) { .opt:hover { border-color: var(--muted); } }

/* welcome (onboarding step 0): the grand Path Academy welcome */
.welcome { min-height: 100dvh; background: var(--mint); color: var(--ink); display: flex; flex-direction: column; margin: 0 calc(-1 * var(--gutter)); padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter) 0; }
.welcome .w-in { max-width: 980px; width: 100%; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.welcome .w-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.welcome .w-top img { height: 34px; width: auto; display: block; }
.welcome .w-hz { font-family: var(--font-zh); font-size: min(40vw, 300px); white-space: nowrap; line-height: .92; margin: 4vh 0 4px -6px; animation: ink 1.3s var(--ease) both .15s; }
.welcome .w-cap { display: flex; gap: 14px; align-items: baseline; animation: fade .8s var(--ease) both .8s; }
.welcome .w-cap .py { font-size: 18px; color: var(--ink-2); }
.welcome .w-kick { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.welcome h1 { font-size: clamp(36px, 8.4vw, 64px); letter-spacing: -.045em; margin: 26px 0 12px; max-width: 13ch; }
.welcome .w-lede { font-size: 17px; color: var(--ink-2); max-width: 40ch; margin: 0; }
.welcome .gh-list { margin-top: 28px; }
.welcome .w-cta { position: sticky; bottom: 0; margin-top: auto; padding: 22px 0 calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; background: linear-gradient(to top, var(--mint) 75%, rgba(172, 202, 178, 0)); }
.welcome .btn.ghost { color: var(--ink); }
.welcome .stagger > * { animation-delay: calc(var(--i, 0) * 70ms + .5s); }
@media (min-width: 900px) {
  .welcome .w-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: end; margin-top: auto; }
  .welcome .w-hz { font-size: min(24vw, 340px); margin-top: 0; }
  .welcome .w-cta { position: static; background: none; grid-template-columns: auto auto; justify-content: start; padding-bottom: 48px; }
}

/* finish: you're all set */
.finish { min-height: 100dvh; margin: 0 calc(-1 * var(--gutter)); color: #fff; display: grid; grid-template-rows: 1fr auto; padding: calc(24px + env(safe-area-inset-top, 0px)) var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(90% 60% at 85% 10%, rgba(255, 255, 255, .12), transparent 60%), linear-gradient(172deg, #C8102E 0%, #B00D29 55%, #8E0A21 100%); animation: fade .5s var(--ease) both; }
.finish .f-in { width: min(640px, 100%); margin: 0 auto; display: grid; align-content: center; }
.finish .zh { font-size: min(30vw, 190px); line-height: .95; animation: ink 1.1s var(--ease) both .2s; }
.finish .f-cap { display: flex; gap: 14px; align-items: baseline; margin: 8px 0 24px; }
.finish .f-cap .py { font-size: 18px; }
.finish .lbl { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .88); }
.finish h1 { color: #fff; font-size: clamp(32px, 7vw, 48px); margin-bottom: 22px; }
.finish ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .35); }
.finish li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .35); font-size: 16px; font-weight: 600; animation: rise .5s var(--ease) backwards; animation-delay: calc(.9s + var(--i, 0) * .45s); }
.finish li svg { width: 20px; height: 20px; }
.finish .f-cta { width: min(640px, 100%); margin: 0 auto; }

/* ---------- today ---------- */
.today { display: grid; gap: 0; }
.t-mast { background: var(--mint); margin: -18px calc(-1 * var(--gutter)) 0; padding: 18px var(--gutter) 24px; position: relative; }
.t-mast .t-top { display: flex; justify-content: space-between; gap: 12px; }
.t-mast .label-caps { color: var(--ink-2); }
.t-mast .label-caps b { color: var(--ink); font-weight: 700; letter-spacing: .06em; }
.t-hz { font-family: var(--font-zh); font-size: min(44vw, 240px); line-height: .95; margin: 18px 0 2px -4px; white-space: nowrap; }
.t-cap { display: flex; gap: 14px; align-items: baseline; }
.t-cap .py { font-size: 17px; color: var(--ink-2); }
.t-greet { font-family: var(--font-display); font-size: clamp(22px, 5.4vw, 30px); font-weight: 600; letter-spacing: -.025em; line-height: 1.2; margin: 20px 0 0; max-width: 24ch; }
.t-greet span { color: var(--ink-2); font-weight: 500; }
.t-next { padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.t-next h2 { font-size: clamp(26px, 6vw, 34px); font-weight: 700; letter-spacing: -.035em; margin: 8px 0 6px; }
.t-next .meta { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.t-sec { padding: 28px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.t-sec:last-child { border-bottom: 0; }
.t-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.t-sec-head h2 { font-size: 18px; }
.t-sec-head a, .t-sec-head span { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.plan { display: grid; border-top: 1px solid var(--line); }
.plan-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background var(--snap) var(--ease); }
@media (hover: hover) { .plan-item:hover { background: var(--surface-2); } }
.plan-item:active { background: var(--surface-2); }
.plan-item .pi-icon { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.plan-item .pi-icon svg { width: 14px; height: 14px; stroke-width: 3; }
.plan-item b { font-weight: 650; font-size: 15.5px; }
.plan-item .pi-sub { display: block; font-size: 13.5px; color: var(--muted); }
.plan-item .pi-meta { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-item.done .pi-icon { background: var(--ink); border-color: var(--ink); color: var(--bg); animation: pop .4s var(--spring) both; }
.plan-item.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.plan-item.next .pi-icon { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--accent); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 120px; }
.week .d { display: grid; grid-template-rows: 1fr auto; gap: 8px; height: 100%; text-align: center; }
.week .col { position: relative; height: 100%; border-bottom: 1px solid var(--line-strong); }
.week .col i { position: absolute; left: 50%; width: min(14px, 46%); margin-left: max(-7px, -23%); bottom: 0; height: var(--h, 0%); background: var(--ink); transform-origin: bottom; animation: growY .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + .15s); }
.week .d.today .col i { background: var(--accent); }
.week .d span { font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.week .d.today span { color: var(--accent-ink); }
.goal-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 16px 0 8px; font-size: 14px; }
.goal-line b { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.t-word { background: var(--amber-soft); margin: 0 calc(-1 * var(--gutter)); padding: 28px var(--gutter); border-bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: end; }
.t-word .tw-hz { font-family: var(--font-zh); font-size: clamp(76px, 22vw, 128px); line-height: 1; grid-column: 1 / -1; }
.t-word .tw-py { font-size: 20px; }
.t-word .tw-en { color: var(--ink-2); font-size: 15px; }
.t-word .label-caps { color: var(--amber-ink); grid-column: 1 / -1; }
.t-install { background: var(--latte); color: #fff; margin: 0 calc(-1 * var(--gutter)); padding: 22px var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; }
.t-install b { display: block; font-family: var(--font-display); font-size: 19px; letter-spacing: -.02em; }
.t-install span { font-size: 14px; color: rgba(255, 255, 255, .88); }
.t-install .btn { --b: #fff; --c: #17181A; --l: #fff; }
.t-install .icon-btn { color: #fff; }
.chart-box { min-height: 150px; }
@media (min-width: 768px) {
  .t-mast { margin-top: -26px; padding: 26px var(--gutter) 30px; }
  .t-hz, .t-mast .t-hz { font-size: 180px; }
  .t-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-bottom: 1px solid var(--line); }
  .t-pair > .t-sec { border-bottom: 0; }
}
@media (min-width: 1024px) {
  .today { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 40px; }
  .today > * { grid-column: 1 / -1; }
  .t-mast { margin: -44px 0 0 calc(-1 * var(--gutter)); padding: 44px 40px 34px var(--gutter); grid-column: 1 / span 7; }
  .t-next { grid-column: 8 / -1; align-self: end; border-bottom: 0; padding-bottom: 34px; }
  .t-word, .t-install { margin: 0; padding: 28px; }
  .t-hz, .t-mast .t-hz { font-size: min(16vw, 200px); }
}

/* ---------- menu overlay (account) and More page ---------- */
.menu-ov { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(26px) saturate(140%); backdrop-filter: blur(26px) saturate(140%); overflow-y: auto; animation: fade .3s var(--ease) both; }
.menu-ov.out { animation: fadeOut .22s var(--ease) both; }
@keyframes fadeOut { to { opacity: 0; } }
.menu-in { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; max-width: 1080px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px)); }
.menu-in .m-top { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.m-grid { display: grid; gap: 28px; align-content: center; padding: 18px 0; }
.m-id { display: flex; align-items: center; gap: 14px; }
.m-id .avatar { width: 52px; height: 52px; font-size: 22px; }
.m-id b { display: block; font-family: var(--font-display); font-size: 20px; letter-spacing: -.02em; }
.m-id span { font-size: 13.5px; color: var(--muted); }
.m-big { display: grid; border-top: 1px solid var(--line); }
.m-big a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 650; font-size: clamp(26px, 7vw, 46px); letter-spacing: -.04em; line-height: 1.1; transition: color var(--snap) var(--ease), padding var(--reveal) var(--ease); }
.m-big a .zh { font-size: .62em; font-weight: 400; color: var(--muted); letter-spacing: .02em; }
@media (hover: hover) { .m-big a:hover { color: var(--accent-ink); padding-left: 10px; } }
.m-small { display: flex; flex-wrap: wrap; gap: 8px; }
.m-small button, .m-small a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink); text-decoration: none; }
.m-small svg { width: 17px; height: 17px; stroke-width: 1.75; }
.m-small .out { color: var(--bad); }
.menu-ov .m-grid > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + .05s); }
@media (min-width: 900px) {
  .m-grid { grid-template-columns: 300px minmax(0, 1fr); gap: 0 56px; align-items: center; }
  .m-left { border-right: 1px solid var(--line); padding-right: 40px; display: grid; gap: 24px; align-self: stretch; align-content: center; }
}

/* ---------- review session: focus mode like a printed card ---------- */
.study { min-height: 100dvh; display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; }
.study .session-bar { flex: none; }
.study-card { flex: 1; display: grid; align-content: center; padding: 8px 0 18px; }
.flash.flat { background: transparent; border: 0; padding: 8px 0; min-height: 0; }
.flash.enter { animation: cardIn .42s var(--ease) both; }
.flash.leave { animation: cardOut .16s ease-in both; }
@keyframes cardIn { from { opacity: 0; transform: translateX(28px); } }
@keyframes cardOut { to { opacity: 0; transform: translateX(-22px); } }
.flash .back-in { animation: rise .4s var(--ease) both; }
.study-dock { position: sticky; bottom: 0; padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--surface) 78%, color-mix(in srgb, var(--surface) 0%, transparent)); }
.study-dock .kbd-hint { margin-top: 10px; }
.gloss-line { font-size: 18px; color: var(--ink-2); }
.gloss-line span + span::before { content: " / "; color: var(--faint); }
.kind-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- course levels: Chinese numerals as the level marks ---------- */
details.level { border-top: 1px solid var(--ink); padding: 0; }
details.level + details.level { margin-top: 10px; }
details.level > summary { list-style: none; cursor: pointer; padding: 18px 0 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 18px; align-items: start; }
details.level > summary::-webkit-details-marker { display: none; }
.lv-num { font-family: var(--font-zh); font-size: 64px; line-height: .9; grid-row: 1 / span 3; min-width: 64px; text-align: center; }
details.level.cur .lv-num { color: var(--accent); }
details.level.soon .lv-num { color: var(--faint); }
.lv-count { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; display: grid; justify-items: end; gap: 6px; }
.lv-count svg { width: 18px; height: 18px; transition: transform var(--reveal) var(--ease); }
details.level[open] .lv-count svg { transform: rotate(180deg); }
.lv-tags { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lv-body { padding: 0 0 22px; }
.lv-body .path { margin-top: 6px; }

/* ---------- lesson player ---------- */
.stepper { display: flex; gap: 0; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 18px; padding: 0 var(--gutter); scrollbar-width: none; border-bottom: 1px solid var(--line); }
.stepper::-webkit-scrollbar { display: none; }
.stepper a { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 12px 12px 13px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13.5px; position: relative; }
.stepper a svg { width: 15px; height: 15px; stroke-width: 1.75; }
.stepper a.done { color: var(--ink-2); }
.stepper a.done svg { color: var(--ok); }
.stepper a[aria-current="step"] { color: var(--ink); }
.stepper a[aria-current="step"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); border-top: 1px solid var(--line); }
.word-tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.word-tile .zh { font-size: 30px; line-height: 1.25; }
.word-tile .en { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.char-tile { aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color var(--snap) var(--ease), transform var(--snap) var(--ease); font: inherit; color: inherit; padding: 6px; }
.char-tile .zh { font-size: 42px; line-height: 1.1; }
.char-tile .py { font-size: 13px; color: var(--muted); }
.char-tile.known { border-color: var(--ink); }
.char-tile:active { transform: scale(.96); }
@media (hover: hover) { .char-tile:hover { border-color: var(--ink); } }
.dlg { display: grid; gap: 2px; }
.dlg-line { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 12px; border-radius: var(--r); transition: background var(--snap) var(--ease); }
.dlg-line.now { background: var(--mint-soft); }
.dlg-line .spk { font-family: var(--font-zh); font-size: 17px; color: var(--muted); padding-top: 16px; }
.dlg-line .ruby-line { font-size: 25px; line-height: 2.2; }
.dlg-line .en { font-size: 14px; color: var(--muted); }
.dlg-line.mine .ruby-line { filter: blur(8px); transition: filter var(--reveal) var(--ease); }
.dlg-line.mine.show .ruby-line { filter: none; }
.hide-en .en, .hide-en .ex-en { visibility: hidden; }
@media (max-width: 600px) { .dlg-line { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding-inline: 4px; } .dlg-line .ruby-line { font-size: 22px; } }
.ex-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ex-row:last-child { border-bottom: 0; }
.ex-row .ruby-line { font-size: 23px; line-height: 2.1; }
.reveal-box { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 12px 14px; }
.big-glyph { font-family: var(--font-zh); font-size: 128px; line-height: 1; }
.writer-box { width: 280px; height: 280px; max-width: 100%; margin: 0 auto; touch-action: none; }
.writer-box svg { display: block; }
.pattern { font-family: var(--font-zh); font-size: 18px; background: var(--surface-2); border-radius: var(--r); padding: 8px 12px; display: inline-block; }

/* ---------- tones ---------- */
.tone-card { text-align: center; }
.tone-card .mark { font-family: var(--font-py); font-size: 56px; font-weight: 600; line-height: 1.1; }
.tone-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tone-btns.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tone-btn { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; min-height: 84px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font: inherit; font-weight: 700; color: inherit; transition: transform var(--snap) var(--ease); }
.tone-btn:active { transform: scale(.96); }
.tone-btn svg.shape { width: 54px; height: 30px; }
.tone-btn.right { border-color: var(--ok); background: var(--ok-soft); }
.tone-btn.wrong { border-color: var(--bad); background: var(--bad-soft); }
.tone-btn.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.conf { display: grid; grid-template-columns: 76px repeat(4, minmax(0, 1fr)); gap: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.conf div { padding: 7px 4px; border-radius: 4px; text-align: center; }
.conf .h { color: var(--muted); font-weight: 700; }

/* ---------- misc screens ---------- */
.local-note { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.local-note svg { width: 15px; height: 15px; }
.sync { width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--faint); }
.sync svg { width: 17px; height: 17px; }
.sync[data-state="saving"] { color: var(--muted); animation: blink 1s infinite; }
.sync[data-state="error"] { color: var(--bad); }
@media (max-width: 420px) { .sync { display: none; } }
.timer-big { font-family: var(--font-display); font-weight: 600; font-size: 56px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.passage { font-family: var(--font-zh); font-size: 25px; line-height: 2.3; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.level-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 76px; gap: 12px; align-items: center; padding: 9px 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(20px, 4vw, 36px); }
.q-prompt { font-family: var(--font-zh); font-size: 28px; line-height: 2; }
.dots { display: flex; gap: 6px; }
.dots i { width: 24px; height: 3px; background: var(--surface-3); }
.dots i.on { background: var(--ink); }

/* Today: the top bar takes the masthead colour so status bar, bar and masthead read as one block */
body[data-route="today"] .top { background: color-mix(in srgb, var(--mint) 94%, transparent); border-bottom-color: transparent; }
body[data-route="today"] .top { animation: none; }
@media (max-width: 899px) { .gh-wide { display: none; } }

body[data-route="onboarding"] { background: var(--bg); }
body[data-route="onboarding"] .session-bar { background: var(--bg); }

/* practice hub: one row per skill, each marked by its character */
.skills { display: grid; border-top: 1px solid var(--ink); }
.skill { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background var(--snap) var(--ease); }
.skill .zh { font-size: 52px; line-height: 1; text-align: center; transition: color var(--snap) var(--ease); }
.skill > svg { width: 20px; height: 20px; color: var(--faint); transition: transform var(--reveal) var(--ease), color var(--snap) var(--ease); }
@media (hover: hover) { .skill:hover { background: var(--surface-2); } .skill:hover .zh { color: var(--accent-ink); } .skill:hover > svg { transform: translateX(4px); color: var(--ink); } }
.skill:active { background: var(--surface-2); }
@media (min-width: 900px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; } }

/* ---------- the climb: the course as a staircase ---------- */
.stair { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; align-items: end; height: 140px; padding-top: 30px; min-width: 0; }
.st { position: relative; display: block; height: calc(var(--h) * 100%); background: var(--surface-3); text-decoration: none; transform-origin: 50% 100%; animation: growY .75s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms + .1s); transition: opacity var(--snap) var(--ease); }
.st.done { background: var(--ink); }
.st.cur { background: var(--accent); }
.st-hz { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); font-family: var(--font-zh); font-size: clamp(12px, 3.1vw, 19px); line-height: 1; color: var(--faint); white-space: nowrap; }
.st.done .st-hz { color: var(--ink); }
.st.cur .st-hz { color: var(--accent-ink); font-size: clamp(20px, 5.6vw, 30px); }
@media (hover: hover) { .st:hover { opacity: .75; } }
.st.just { animation: growY .75s var(--ease) backwards, stepFill 1s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms + .1s), .9s; }
@keyframes stepFill { from { background: var(--accent); } }
.climb-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: end; }
.climb-lv { display: grid; justify-items: center; gap: 2px; padding-bottom: 0; min-width: 48px; }
.climb-lv .zh { font-size: 58px; line-height: .9; }
.climb-lv .py { font-size: 13px; color: var(--muted); }
.climb-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.climb-note b { color: var(--ink); font-weight: 650; }
.course-climb { margin: -6px 0 28px; }
.ladder { display: flex; align-items: flex-end; gap: 8px; }
.flight { min-width: 0; }
.ladder .stair { height: 150px; gap: 2px; padding-top: 34px; }
.ladder .st-hz { display: none; }
.ladder .st.cur .st-hz { display: block; }
.fl-lab { display: grid; justify-items: start; gap: 2px; border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 6px; font-size: 11px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-lab .n { font-size: 10.5px; }
.fl-lab .zh { font-size: 20px; color: var(--ink); font-weight: 400; }
.flight.soon .soon-st { height: 150px; border: 1px dashed var(--line-strong); border-bottom: 0; background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--line) 70%, transparent) 7px 8px); }
.flight.soon .fl-lab { border-top-style: dashed; border-top-color: var(--line-strong); }
.flight.soon .fl-lab .zh { color: var(--faint); }
/* a lesson's eight segments as a small stair */
.seg-stair { display: inline-grid; grid-template-columns: repeat(8, 7px); gap: 2px; align-items: end; height: 20px; vertical-align: middle; }
.seg-stair i { display: block; height: calc(var(--h) * 100%); background: var(--surface-3); transform-origin: 50% 100%; }
.seg-stair i.done { background: var(--ink); }
.seg-stair i.cur { background: var(--accent); }
.seg-stair i.new { background: var(--ink); animation: segIn .7s var(--spring) backwards .5s; }
@keyframes segIn { from { transform: scaleY(0); background: var(--accent); } }
.seg-stair.big { grid-template-columns: repeat(8, 18px); height: 64px; gap: 5px; }
.lesson-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: end; margin-bottom: 18px; }
.lh-hz { font-family: var(--font-zh); font-size: clamp(72px, 20vw, 112px); line-height: .9; }
.lh-seg { display: flex; align-items: center; gap: 12px; }
/* segment cleared: a stamp lands */
.cleared-ov { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: fade .25s var(--ease) both; cursor: pointer; padding: 24px; }
.cleared-ov.out { animation: fadeOut .22s var(--ease) both; }
.co-in { text-align: center; display: grid; justify-items: center; }
.co-in h2 { font-size: 26px; }
.co-seal { width: 128px; height: 128px; font-size: 76px; }
.co-cap { display: flex; gap: 10px; align-items: baseline; margin: 18px 0 0; }
.co-cap .py { font-size: 17px; }
/* lesson complete and level up */
.cleared { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; max-width: 640px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top, 0px)) 0 calc(18px + env(safe-area-inset-bottom, 0px)); }
.cl-in { display: grid; align-content: center; }
.cl-in h1 { font-size: clamp(32px, 8vw, 46px); margin-top: 6px; }
.cl-in .lede { color: var(--muted); margin: 8px 0 0; font-size: 17px; }
.cl-stamp { display: flex; align-items: flex-end; gap: 22px; margin: 22px 0 20px; }
.cl-seal { width: 150px; height: 150px; font-size: 96px; border-radius: 8px; animation-delay: .25s; }
.cl-cap { display: grid; gap: 2px; padding-bottom: 6px; }
.cl-cap .zh { font-size: 34px; line-height: 1; }
.cl-cap .py { font-size: 15px; color: var(--ink-2); }
.cl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 26px 0 0; }
.cl-stats .value { font-size: 30px; }
.cl-climb { margin-top: 26px; }
.cl-cta { display: grid; gap: 6px; padding-top: 20px; }
.lu-nums { display: flex; align-items: center; gap: 14px; margin: 12px 0 6px; }
.lu-nums .zh { font-size: min(36vw, 180px); line-height: 1; }
.lu-nums .old { color: var(--faint); }
.lu-nums .new { color: var(--accent-ink); animation: stamp .8s var(--spring) backwards .45s; display: inline-block; }
.lu-nums svg { width: 34px; height: 34px; color: var(--muted); animation: slideL .6s var(--ease) backwards .2s; }
.stamp-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 10px; }
.stamp { aspect-ratio: 1; display: grid; place-items: center; font-family: var(--font-zh); font-size: 28px; border-radius: 5px; text-decoration: none; line-height: 1; }
.stamp.got { background: var(--seal); color: #fff; transform: rotate(var(--r, -3deg)); box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 4px rgba(255, 255, 255, .35); }
.cleared .stamp.got { animation: stamp .55s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 90ms + .7s); }
.stamp.todo { border: 1px dashed var(--line-strong); color: var(--surface-3); }
@media (hover: hover) { a.stamp:hover { opacity: .8; } }
@media (min-width: 768px) { .stair { height: 160px; } .seg-stair:not(.big) { grid-template-columns: repeat(8, 9px); height: 24px; } }

/* ---------- Path Method: learning words ---------- */
.learn-cta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px; background: var(--mint-soft); border-radius: var(--r-l); align-items: end; }
.learn-cta .btn { justify-self: start; }
.learn-prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.learn-prog .bar { background: color-mix(in srgb, var(--ink) 10%, transparent); }
@media (min-width: 768px) { .learn-cta { grid-template-columns: minmax(0, 1fr) auto; padding: 26px 28px; } .learn-cta .btn { justify-self: end; } }
.word-tile.learned .zh { color: var(--ink); }
.word-tile:not(.learned) .zh { color: var(--ink-2); }
.lt-ok { width: 14px; height: 14px; color: var(--ok); vertical-align: -2px; margin-right: 4px; stroke-width: 3; }
.study.learn .study-card { align-content: center; }
.ln-card .big-hz { font-size: clamp(104px, 32vw, 176px); }
.ln-mean { font-family: var(--font-display); font-size: clamp(26px, 7vw, 36px); font-weight: 650; letter-spacing: -.03em; line-height: 1.15; margin: 26px 0 6px; }
.say-hint { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.say-hint svg { width: 16px; height: 16px; color: var(--accent-ink); }
.ln-fb { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); animation: rise .3s var(--ease) backwards; }

/* ---------- habit: cue, repair, fresh start, meter ---------- */
.t-cue { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.t-cue svg { width: 16px; height: 16px; }
.t-short { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); text-decoration: none; font-weight: 600; }
.t-short svg { width: 16px; height: 16px; }
@media (hover: hover) { .t-short:hover { color: var(--ink); } }
.t-repair h2, .t-fresh h2 { font-size: 22px; margin: 6px 0 0; }
.habit { margin-top: 18px; display: grid; gap: 8px; }
.icon-btn.sm-i { width: 32px; height: 32px; } .icon-btn.sm-i svg { width: 16px; height: 16px; color: var(--muted); }
.ob-when { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ---------- postcards from Taiwan ---------- */
.postcard { position: relative; display: grid; gap: 10px; align-content: start; width: 100%; text-align: left; padding: 22px 22px 24px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-l); font: inherit; color: inherit; box-shadow: 0 1px 0 var(--line), 0 18px 30px -24px rgba(40, 30, 20, .35); }
.postcard::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--line); border-radius: 4px; pointer-events: none; }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pc-post { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 1.5px solid var(--accent-line); color: var(--accent-ink); display: grid; place-items: center; text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1.3; transform: rotate(-12deg); }
.pc-hz { font-size: clamp(54px, 15vw, 84px); line-height: 1.05; }
.pc-body { margin: 0; font-size: 15px; color: var(--ink-2); }
.postcard.sealed { background: var(--mint); border-color: transparent; cursor: pointer; transition: transform var(--reveal) var(--ease); }
.postcard.sealed .pc-body { color: var(--ink); }
.postcard.sealed .label-caps { color: var(--ink-2); }
.postcard.sealed .pc-post { border-color: rgba(23, 24, 26, .35); color: var(--ink-2); }
@media (hover: hover) { .postcard.sealed:hover { transform: translateY(-3px) rotate(-.4deg); } }
.postcard.sealed:active { transform: scale(.985); }
.postcard.flip-in { animation: flipIn .7s var(--ease) both; transform-origin: 50% 50%; }
@keyframes flipIn { from { transform: perspective(900px) rotateY(80deg); opacity: 0; } }
.postcard.small { padding: 16px 16px 18px; }
.postcard.small .pc-hz { font-size: 44px; }
.postcard.small .pc-post { width: 48px; height: 48px; font-size: 8px; }
.postcard.small .pc-body { font-size: 13.5px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }

/* lesson overview: numbers on hairlines and a plain can-do list */
.ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
@media (min-width: 600px) { .ov-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ov-stats .value { font-size: 28px; }
.can-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.can-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.can-list li svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 3px; stroke-width: 2.5; }
.can-list.notes li { color: var(--ink-2); font-size: 15px; }

/* ---------- pinyin chart and tone pairs ---------- */
.pc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.seg a { display: inline-flex; align-items: center; padding: 6px 14px; min-height: 38px; border-radius: 4px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 17, 19, .1), 0 0 0 1px rgba(17, 17, 19, .05); }
.pc-search { position: relative; display: block; width: min(220px, 100%); }
.pc-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.pc-search .input { min-height: 42px; padding-left: 36px; font-family: var(--font-py); }
.pc-wrap { overflow: auto; max-height: calc(100dvh - 210px); border-top: 1px solid var(--ink); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); -webkit-overflow-scrolling: touch; }
.pc-table, .tp-table { border-collapse: separate; border-spacing: 0; font-family: var(--font-py); }
.pc-table th, .pc-table td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; }
.pc-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); font-size: 13px; font-weight: 700; color: var(--ink-2); height: 38px; min-width: 52px; border-bottom: 1px solid var(--ink); }
.pc-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--bg); font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 10px; min-width: 52px; text-align: left; border-right: 1px solid var(--ink); }
.pc-table .pc-corner, .tp-table .pc-corner { position: sticky; left: 0; top: 0; z-index: 3; background: var(--bg); }
.pc-table tr.grp > * { border-top: 2px solid var(--ink); }
.pc-table td button { display: block; width: 100%; min-width: 52px; height: 38px; padding: 0 6px; border: 0; background: transparent; font: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer; transition: background var(--snap) var(--ease), color var(--snap) var(--ease); }
.pc-table td button:active { background: var(--accent-soft); }
.pc-table .lit { background: var(--accent-soft); color: var(--accent-ink); }
.pc-table th.lit { color: var(--accent-ink); }
.pc-modal { width: min(460px, 100%); }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.pc-syl { font-family: var(--font-py); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.pc-parts { font-family: var(--font-py); font-size: 15px; color: var(--muted); margin-top: 8px; }
.pc-parts b { color: var(--ink); font-weight: 600; }
.pc-tones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pc-tone { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 4px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: transform var(--snap) var(--ease), background var(--snap) var(--ease); }
.pc-tone:active { transform: scale(.95); }
.pc-tone.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pc-tone.off { opacity: .45; cursor: default; }
.pc-tn { position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 700; color: var(--faint); }
.pc-py { font-family: var(--font-py); font-size: 20px; font-weight: 600; }
.pc-ch { font-size: 30px; line-height: 1.15; min-height: 34px; }
.pc-zy { font-family: var(--font-zh); font-size: 12px; color: var(--muted); }
.pc-tone.on .pc-zy, .pc-tone.on .pc-tn { color: inherit; opacity: .7; }
.tp-table th, .tp-table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; }
.tp-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); height: 38px; min-width: 92px; border-bottom: 1px solid var(--ink); }
.tp-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--bg); border-right: 1px solid var(--ink); }
.tp-row { display: grid; justify-items: center; gap: 4px; width: 72px; padding: 12px 4px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.tp-row svg { width: 16px; height: 16px; color: var(--accent-ink); }
.tp-w { display: grid; justify-items: center; gap: 2px; width: 100%; min-width: 92px; padding: 12px 6px; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; transition: background var(--snap) var(--ease); }
.tp-w .zh { font-size: 26px; line-height: 1.15; }
.tp-py { font-family: var(--font-py); font-size: 13px; color: var(--ink-2); }
.tp-note { font-size: 10.5px; color: var(--accent-ink); font-weight: 600; }
.tp-w.on, .tp-w:active { background: var(--accent-soft); }
@media (hover: hover) { .tp-w:hover, .pc-table td button:hover { background: var(--surface-2); } .tp-row:hover { color: var(--ink); } }

/* ---------- my class ---------- */
.cls-exam { display: grid; gap: 2px; text-align: right; }
.cls-exam b { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; }
.cls-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cls-quiz { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.cls-q { display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: transform var(--snap) var(--ease), border-color var(--snap) var(--ease); }
.cls-q .zh { font-size: 30px; line-height: 1.15; white-space: nowrap; }
.cls-q .py { font-size: 12.5px; color: var(--muted); }
.cls-q:active { transform: scale(.96); }
.cls-q.on { border-color: var(--ink); }
@media (hover: hover) { .cls-q:hover { border-color: var(--ink); } }
.zh-sub { font-family: var(--font-zh); }

/* ---------- motion: answers land, cards hand over, pages move the way you move ---------- */
.rv { animation: rise .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 55ms + 40ms); }
.m-out > *, .dock-out > * { animation: mOut .17s ease-in both; pointer-events: none; }
@keyframes mOut { to { opacity: 0; transform: translateY(-6px); } }
.ln-card.morphing > :not([data-flip]) { animation: fadeOut .2s ease-in both; }
/* an answer: the right choice is ticked, the others step back */
.choices.answered .choice { pointer-events: none; }
.choices.answered .choice:not(.right):not(.wrong) { opacity: .38; transform: scale(.985); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.choice.right { animation: okPop .45s var(--spring); }
.choice.right::after { content: ""; flex: none; width: 7px; height: 13px; margin: -4px 6px 0 auto; border: solid var(--ok); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); animation: tickIn .4s var(--spring) .06s backwards; }
@keyframes okPop { 40% { transform: scale(1.02); } }
@keyframes tickIn { from { opacity: 0; transform: rotate(45deg) scale(0); } }
.ln-picked { margin: 8px 0 0; text-align: left; }
.ln-picked .zh { font-size: 18px; color: var(--ink); }
/* a learned word gets its stamp */
.ln-card { position: relative; }
.ln-stamp { position: absolute; top: 34px; right: 2%; width: 62px; height: 62px; font-size: 34px; transform: rotate(-8deg); box-shadow: inset 0 0 0 3px var(--accent-ink), inset 0 0 0 4px rgba(255, 255, 255, .35); animation: stamp .55s var(--spring) both; }
.w-done { animation: wDone .9s var(--ease); }
.m-in { animation: rise .45s var(--ease); }
@keyframes wDone { 25% { box-shadow: 0 0 0 6px var(--ok-soft), 0 0 0 7px var(--ok); } }
/* a finished plan item ticks itself off when you come back to Today */
.plan-item.done .pi-icon { animation: none; }
.plan-item.just .pi-icon { animation: tick .6s var(--spring) .45s backwards; }
.plan-item.just { animation: justBg 1.8s var(--ease) .3s backwards; }
@keyframes tick { from { transform: scale(0); background: var(--accent); border-color: var(--accent); } }
@keyframes justBg { from { background: var(--mint-soft); } }
/* overlays leave a little faster than they arrive */
/* only the dim layer fades; the sheet itself stays solid while it moves */
.scrim { animation: scrimIn var(--reveal) var(--ease); }
.scrim.out { animation: scrimOut .22s ease-in both; pointer-events: none; }
@keyframes scrimIn { from { background-color: rgba(12, 12, 14, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
@keyframes scrimOut { to { background-color: rgba(12, 12, 14, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
.scrim.out .modal { animation: popOut .2s ease-in both; }
@keyframes popOut { to { opacity: 0; transform: scale(.97); } }
@media (max-width: 767px) {
  .scrim.out .modal { animation: sheetOut .22s ease-in both; }
  .scrim.out .modal.cmdk { animation: sheetOutUp .22s ease-in both; }
}
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes sheetOutUp { to { transform: translateY(-100%); } }
/* page transitions (View Transitions): the screen you see moves, the shell stays put */
.top { view-transition-name: top; }
.tabbar { view-transition-name: tabbar; }
.side { view-transition-name: side; }
.view.no-in { animation: none; }
.vt-run .top, .vt-run .tabbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
.badge-id [data-hero] { display: inline-block; }
::view-transition-old(root) { animation: vtOut .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vtIn .46s var(--ease) both; }
:root[data-dir="fwd"]::view-transition-old(root) { animation-name: vtOutL; }
:root[data-dir="fwd"]::view-transition-new(root) { animation-name: vtInR; }
:root[data-dir="back"]::view-transition-old(root) { animation-name: vtOutR; }
:root[data-dir="back"]::view-transition-new(root) { animation-name: vtInL; }
:root[data-dir="up"]::view-transition-old(root) { animation-name: vtSink; animation-duration: .3s; }
:root[data-dir="up"]::view-transition-new(root) { animation-name: vtUp; animation-duration: .52s; }
:root[data-dir="down"]::view-transition-old(root) { animation-name: vtDown; animation-duration: .26s; }
/* the tab bar and sidebar show their live state, so the red marker slides to the new tab */
::view-transition-old(tabbar), ::view-transition-old(side) { display: none; }
::view-transition-new(tabbar), ::view-transition-new(side) { animation: none; }
::view-transition-group(top) { animation-duration: .3s; }
::view-transition-group(hero), ::view-transition-old(hero), ::view-transition-new(hero) { animation-duration: .56s; animation-timing-function: var(--ease); }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes vtOutL { to { opacity: 0; transform: translateX(-32px); } }
@keyframes vtInR { from { opacity: 0; transform: translateX(44px); } }
@keyframes vtOutR { to { opacity: 0; transform: translateX(32px); } }
@keyframes vtInL { from { opacity: 0; transform: translateX(-44px); } }
@keyframes vtSink { to { opacity: 0; transform: scale(.97); } }
@keyframes vtUp { from { opacity: 0; transform: translateY(56px); } }
@keyframes vtDown { to { opacity: 0; transform: translateY(44px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* ---------- native feel: iPhone and iPad ---------- */
html { touch-action: manipulation; }                     /* no double-tap zoom on controls; pinch zoom stays */
html.modal-open { overflow: hidden; }                    /* the page behind a sheet stays still */
.modal, .menu-ov { overscroll-behavior: contain; }
body.session { overscroll-behavior-y: none; }            /* no accidental pull-to-refresh in the middle of a session */
html:has(body.session) { background: var(--surface); }
html.at-top:has(body[data-route="today"]) { background: var(--mint); }   /* the mint masthead continues into the top bounce */
/* controls are not text: no selection, no long-press callout */
button, .btn, .icon-btn, .choice, .tabbar, .top, .side, .session-bar, .study-dock, .study-card, .seg, .rate, .lesson-card, .plan-item, .st, .stamp, .pc-cell, .pc-tone, .cls-q, .char-tile, .mast, .t-hz, .lh-hz, .big-hz, .flash, .m-big, .pad { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* pressed states you can feel */
.lesson-card { transition: background var(--snap) var(--ease); }
.lesson-card:active, .m-big a:active { background: var(--surface-2); }
.icon-btn:active { transform: scale(.9); }
.tabbar a svg { transition: transform .22s var(--spring); }
.tabbar a:active svg { transform: scale(.84); }
.tabbar a[aria-current="page"] svg { animation: tabPop .5s var(--spring); }
@keyframes tabPop { 35% { transform: scale(.82); } 70% { transform: scale(1.1); } }
.char-tile, .cls-q, .pc-tone { transition: transform var(--snap) var(--ease), border-color var(--snap) var(--ease); }
.char-tile:active, .pc-tone:active { transform: scale(.95); }
/* sheets move on the curve iOS uses for its own sheets, and every sheet has a way out */
.modal { position: relative; }
.modal-x { position: sticky; top: 0; float: right; z-index: 3; margin: -8px -8px 0 8px; background: var(--surface); }
.cmdk-row { display: flex; align-items: center; gap: 8px; }
.cmdk-row .input { flex: 1; min-width: 0; }
.cmdk-cancel { display: none; border: 0; background: none; color: var(--accent-ink); font: inherit; font-weight: 600; min-height: 44px; padding: 0 4px; cursor: pointer; }
@media (max-width: 767px) {
  .modal { animation: sheetUp .52s cubic-bezier(.32, .72, 0, 1); transition: transform .42s cubic-bezier(.32, .72, 0, 1); touch-action: pan-y; }
  .scrim.out .modal { animation: sheetOut .3s cubic-bezier(.32, .72, 0, 1) both; }
  .modal.cmdk { animation: sheetDown .45s cubic-bezier(.32, .72, 0, 1); }
  .cmdk-cancel { display: block; }
  .modal-x { margin-top: -4px; }
}
.menu-ov { transition: transform .42s cubic-bezier(.32, .72, 0, 1); }
.menu-ov.out { animation: menuOut .26s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes menuOut { to { opacity: 0; transform: translateY(24px); } }
/* the keyboard: a session's dock sits on top of it */
html.kb-open .study-dock { bottom: var(--kb, 0px); padding-bottom: 10px; }
/* landscape on a notched iPhone */
@media (orientation: landscape) and (max-width: 1023px) { .main, body.session .main { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); } }
/* iPad: answers in two columns, less travel for the thumb and the eye */
@media (min-width: 700px) { .study .choices { grid-template-columns: 1fr 1fr; } }
/* course levels open with their content rising in */
details.level[open] > :not(summary) { animation: rise .45s var(--ease) backwards; }
/* swipe back (installed app): the returning page comes in from the left */
.view.back-in { animation: vtInL .36s var(--ease) backwards; }

/* ---------- free handwriting (Apple Pencil, finger, mouse) ---------- */
.pad { --pad-ink: var(--ink); position: relative; width: 100%; aspect-ratio: 1; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; touch-action: none; }
.pad canvas, .pad svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pad canvas { touch-action: none; cursor: crosshair; z-index: 2; }
.pad-grid { z-index: 0; }
.pad-grid path { fill: none; stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 5 6; }
.pad-grid path.d { stroke: var(--line); }
.pad-model { z-index: 1; pointer-events: none; }
.pad-model path { fill: var(--accent); opacity: 0; animation: modelIn .32s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 110ms); }
.pad-model path.bad { animation-name: modelBad; }
@keyframes modelIn { to { opacity: .24; } }
@keyframes modelBad { 0%, 100% { opacity: .85; } 50% { opacity: .45; } }
.pad.checked canvas { opacity: .82; }
.pad-tip { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .55; pointer-events: none; z-index: 3; }
.fw { display: grid; gap: 10px; width: 100%; max-width: 520px; margin: 0 auto; }
.fw-msg { margin: 0; min-height: 22px; text-align: center; color: var(--ink-2); }
.fw-tools { display: flex; align-items: center; justify-content: center; gap: 6px; }
.fw-tools .btn { min-width: 150px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.tzg.free { background: none; border: 0; width: 100% !important; height: auto !important; max-width: 520px; }
.tzg.free::before, .tzg.free::after { display: none; }
.wm-seg { display: flex; width: 100%; max-width: 280px; margin: 4px auto 12px; }
.wm-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.wm-seg svg { width: 15px; height: 15px; }
.wp .wp-card { min-height: 0; justify-items: center; gap: 8px; }
.wp-q { display: grid; justify-items: center; gap: 2px; }
.wp-area { width: 100%; display: grid; justify-items: center; gap: 8px; }
.wp-nav { justify-content: center; margin-top: 14px; }
@media (max-width: 600px) { .wp .wp-card { padding: 16px 12px; } }

/* ---------- Class Circle (classmates) and the teacher view ---------- */
/* a seal (印章): a crimson square, TW-Kai in paper white, a thin inner frame, columns read right to left */
.cseal { --s: 64px; width: var(--s); height: var(--s); flex: none; display: inline-grid; direction: rtl; grid-auto-flow: column; grid-template-rows: minmax(0, 1fr); grid-auto-columns: minmax(0, 1fr);
  padding: calc(var(--s) * .1); border-radius: min(var(--r), calc(var(--s) * .14)); background: var(--seal); color: #FFF6EC; font-family: var(--font-zh); line-height: 1;
  transform: rotate(var(--rot, -2deg)); box-shadow: inset 0 0 0 calc(var(--s) * .045) var(--seal), inset 0 0 0 calc(var(--s) * .06 + .5px) rgba(255, 246, 236, .72);
  -webkit-mask: var(--worn) 0 0 / 180px 180px; mask: var(--worn) 0 0 / 180px 180px; }
/* worn ink: a fixed noise pattern leaves a few specks unprinted, as a real stamp does */
:root { --worn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 7.9'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23f)'/%3E%3C/svg%3E"); }
.cseal i { font-style: normal; display: grid; place-items: center; min-width: 0; min-height: 0; }
.cseal.n1 i { font-size: calc(var(--s) * .6); }
.cseal.n2 i { font-size: calc(var(--s) * .37); transform: scaleY(1.55); }
.cseal.n3, .cseal.n4 { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.cseal.n3 i, .cseal.n4 i { font-size: calc(var(--s) * .34); }
.cseal.n3 i:first-child { grid-row: span 2; font-size: calc(var(--s) * .37); transform: scaleY(1.65); }
.cseal.dim { background: transparent; color: color-mix(in srgb, var(--faint) 75%, transparent); box-shadow: none; outline: 1px dashed var(--line-strong); outline-offset: -1px; transform: none; -webkit-mask: none; mask: none; }
.cseal.dim.empty { color: var(--surface-3); }
.stamp-in { animation: stamp .6s var(--spring) both; }

.circle .page-head, .teach .page-head { margin-bottom: 18px; }
.cw-sub { margin: 0 0 20px; } .cw-sub b { color: var(--ink); font-weight: 700; }
.cw-switch { display: flex; margin: -4px 0 22px; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
.cw-switch a { padding: 8px 14px; border-radius: 4px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; min-height: 38px; display: inline-flex; align-items: center; }
.cw-switch a[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 17, 19, .1), 0 0 0 1px rgba(17, 17, 19, .05); }
.cw-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 18px 6px; padding: 0 0 30px; }
.cw-m { display: grid; justify-items: center; gap: 9px; padding: 6px 0 2px; background: none; border: 0; border-radius: var(--r); cursor: pointer; min-width: 0; font: inherit; color: inherit; transition: transform var(--snap) var(--ease); }
.cw-m:active { transform: scale(.94); }
.cw-n { font-size: 12.5px; font-weight: 600; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-m.on .cw-n { color: var(--ink); }
.cw-m.me .cw-n { color: var(--accent-ink); }
.cw-wall .cseal:not(.dim) { animation: stamp .55s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 55ms + .12s); }
.cw-goal { background: var(--mint); margin: 0 calc(-1 * var(--gutter)); padding: 24px var(--gutter) 26px; }
.cw-goal .label-caps { color: var(--mint-ink); margin: 0; }
.cw-goal h2 { font-size: clamp(24px, 6.4vw, 30px); letter-spacing: -.03em; margin: 6px 0 16px; }
.cw-goal .bar { height: 8px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.cw-goal .bar > i { background: var(--ink); }
.cw-goal.met .bar > i { background: var(--accent); }
.cw-goal-n { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.cw-goal-n b { font-family: var(--font-display); font-size: 24px; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cw-each { margin: 6px 0 0; color: var(--ink-2); }
.cdays { display: inline-grid; grid-template-columns: repeat(7, 8px); gap: 3px; vertical-align: middle; }
.cdays i { width: 8px; height: 8px; border-radius: 2px; background: var(--surface-3); font-style: normal; }
.cdays i.on { background: var(--accent); }
.cdays i.later { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.cdays.big { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 400px; }
.cdays.big i { width: auto; height: 40px; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); border-radius: var(--r-s); }
.cdays.big i.on { color: #fff; }
.cdays.big i.today { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.cw-mine { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }
.cw-mine > span:not(.cseal) { flex: 1; display: grid; line-height: 1.35; }
.cw-mine > svg { color: var(--muted); }
.cw-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.cw-foot a { color: var(--ink-2); font-weight: 600; }
.cw-leave { background: none; border: 0; padding: 8px 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.cw-big { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 18px 0 8px; }
.cw-big h2 { margin-top: 16px; }
.cw-big .label-caps { margin: 0 0 8px; }
@media (min-width: 768px) { .cw-goal { margin: 0; padding: 26px 28px; border-radius: var(--r); } }

.cj { margin-top: 4px; gap: 18px; }
.cj-code { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: .26em; text-align: center; text-transform: uppercase; min-height: 70px; }
.cj-code::placeholder { color: var(--surface-3); }
.cj-demo { border: 0; background: var(--amber-soft); color: var(--amber-ink); font: inherit; font-weight: 700; letter-spacing: .08em; padding: 2px 8px; border-radius: var(--r-s); cursor: pointer; }
.cj-share { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.cj-share .label-caps { margin: 0 0 6px; }
.cj-share ul { margin: 0; padding-left: 16px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); display: grid; gap: 4px; }
.cj-agree { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; font-weight: 600; cursor: pointer; padding-top: 14px; border-top: 1px solid var(--line); }
.cj-agree input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); flex: none; }
.cj-teach { margin: 34px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.smk { display: grid; gap: 10px; }
.sm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.sm-in { font-size: 24px; letter-spacing: .08em; }
.sm-prev { display: grid; place-items: center; width: 104px; height: 104px; }
.sm-pick summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); min-height: 40px; }
.sm-pick summary::-webkit-details-marker { display: none; }
.sm-pick summary svg { width: 16px; height: 16px; transition: transform var(--reveal) var(--ease); }
.sm-pick[open] summary svg { transform: rotate(180deg); }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; padding-top: 6px; }
.sm-c { display: grid; justify-items: center; gap: 1px; padding: 10px 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: transform var(--snap) var(--ease), border-color var(--snap) var(--ease); }
.sm-c .zh { font-size: 28px; line-height: 1.15; }
.sm-c .py { font-size: 12.5px; color: var(--ink-2); }
.sm-c:active { transform: scale(.95); }
@media (hover: hover) { .sm-c:hover { border-color: var(--ink); } }
.cs-hero { display: grid; justify-items: center; gap: 16px; padding: 10px 0 30px; text-align: center; }
.cs-hero p { margin: 0; }
.cs-form .sm-row { grid-template-columns: minmax(0, 1fr); }
.cs-form .sm-prev { display: none; }   /* the big seal above is the preview */
.sm-in::placeholder { color: var(--surface-3); }
.circle .t-sec .lesson-card { border-bottom: 0; padding-bottom: 4px; }
.tc-goalseg { display: flex; width: 100%; max-width: 420px; }
.tc-goalseg button { flex: 1; padding-inline: 8px; }
.tc-target { max-width: 200px; }
.circle > .card { margin-top: 30px !important; }

/* Today: one line under This week */
.t-circle { display: grid; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-size: 14px; }
.tcl-top { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.tcl-top b { color: var(--ink); font-weight: 650; }
.tcl-top > span { flex: 1; min-width: 0; text-align: right; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcl-top svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.tc-seals { display: flex; gap: 4px; flex-wrap: wrap; }
.tc-seals .cseal { box-shadow: none; padding: 2px; }

/* teacher */
.tc-new { display: grid; gap: 14px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--ink); }
.tc-new .btn { justify-self: start; }
.tc-code { display: grid; gap: 14px; padding: 2px 0 22px; border-bottom: 1px solid var(--line); }
.tc-code-v { display: inline-block; font-family: var(--font-display); font-size: clamp(42px, 12vw, 58px); font-weight: 700; letter-spacing: .12em; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tc-code.fresh .tc-code-v { color: var(--accent-ink); animation: stamp .7s var(--spring) both; }
@media (min-width: 768px) { .tc-code { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.tc-week { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; text-align: center; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tc-week > span { display: grid; line-height: 1.3; }
.tc-stats .value small, .tc-sheet .value small { font-size: 17px; color: var(--muted); letter-spacing: -.02em; margin-left: 1px; }
.tc-stats, .tc-sheet .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tc-stats .label, .tc-sheet .stat .label { letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
@media (max-width: 600px) { .tc-stats .value, .tc-sheet .value { font-size: 28px; } .tc-stats .sub { font-size: 12px; } }
.teach .page-head + .path { border-top: 0; }
.tc-goal { margin: 24px 0 0; }
.tc-goal b { font-family: var(--font-display); font-size: 17px; color: var(--ink); }
.tc-quiet { margin-top: 20px; }
.tc-quiet svg { color: var(--accent-ink); }
.tc-sec h2 { font-size: 20px; }
.tc-th, .tc-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 46px 62px; gap: 12px; align-items: center; }
.tc-th { padding: 0 4px 8px; border-bottom: 1px solid var(--ink); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tc-th span:nth-child(n+3) { text-align: right; }
.tc-row { width: 100%; padding: 12px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background var(--snap) var(--ease); }
@media (hover: hover) { .tc-row:hover { background: var(--surface-2); } }
.tc-row:active { background: var(--surface-2); }
.tc-who { display: grid; gap: 6px; min-width: 0; }
.tc-who b { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-n { text-align: right; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.tc-n small { font-size: 12px; color: var(--muted); letter-spacing: 0; }
.tc-wz { font-size: 30px; line-height: 1.1; min-width: 46px; }
.tc-weak .list-row { padding: 8px 4px; gap: 12px; }
.tc-who-missed { white-space: nowrap; }
@media (max-width: 420px) { .tc-weak .grow .small { display: none; } }

/* ---------- situation packs (v1.10): the situations library and the conversation club ---------- */
.pk-next { background: var(--mint); margin: 0 calc(-1 * var(--gutter)); padding: 24px var(--gutter) 26px; }
.pk-next .label-caps { color: var(--mint-ink); margin: 0; }
.pk-next h2 { font-size: clamp(26px, 7vw, 34px); letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 6px; }
.pk-next-when { margin: 0 0 18px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.pk-list { border-top: 1px solid var(--line); }
.pk-ses { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background var(--snap) var(--ease); }
a.pk-ses:active { background: var(--surface-2); }
@media (hover: hover) { a.pk-ses:hover { background: var(--surface-2); } }
.pk-ses .sub { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.pk-ses.none b { font-weight: 600; color: var(--ink-2); }
.pk-ses.past { opacity: .55; }
.pk-date { display: grid; justify-items: center; line-height: 1; }
.pk-date b { font-family: var(--font-display); font-size: 28px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pk-date small { margin-top: 4px; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.pk-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); }
.pk-mark .zh { font-size: 30px; line-height: 1; }
.pk-mark svg { width: 16px; height: 16px; color: var(--ok); }
.pk-past > summary { list-style: none; cursor: pointer; padding: 14px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pk-past > summary::-webkit-details-marker { display: none; }
.pk-past > summary::after { content: " +"; }
.pk-past[open] > summary::after { content: " −"; }
.pk-head .lh-hz { position: relative; }
.pk-seal { position: absolute; right: -16px; bottom: -8px; width: 44px; height: 44px; font-size: 24px; }
.pk-seal.still { animation: none; }
.pk-when { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.pk-when svg { width: 16px; height: 16px; color: var(--accent-ink); flex: none; }
.pk-phrase .ruby-line { font-size: 24px; }
.pk-tip { margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.pk-tip::before { content: ""; display: inline-block; width: 10px; height: 1px; margin: 0 6px 4px 0; background: var(--accent); vertical-align: middle; }
.pk-talk { scroll-margin-top: calc(var(--top-h, 60px) + 16px); }
.pk-note { margin: 30px 0 0; padding: 16px 18px; background: var(--mint-soft); border-radius: var(--r); }
.pk-note .label-caps { margin: 0 0 6px; color: var(--mint-ink); }
.pk-note p:last-child { margin: 0; }
.pk-pulse { animation: pkPulse 1.5s var(--ease) 1; }
@keyframes pkPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); } 40% { box-shadow: 0 0 0 10px transparent; } }
.ln-card .big-hz.ph, .flash .big-hz.ph { font-size: clamp(34px, 9.5vw, 54px); line-height: 1.3; max-width: 100%; overflow-wrap: anywhere; }

/* ---------- Daily Session: the card on Today and the one flow ---------- */
.t-mast { padding-bottom: 62px; }
@media (max-width: 767px) { .t-mast .t-hz { font-size: min(36vw, 230px); } }
h1.t-greet { margin: 18px 0 0; }
.t-session { position: relative; z-index: 2; margin-top: -40px; padding: 0 0 28px; border-bottom: 1px solid var(--line); }
.ts-card { position: relative; background: var(--surface); border-radius: 10px; box-shadow: 0 22px 44px -26px rgba(40, 30, 20, .42), 0 0 0 1px rgba(40, 30, 20, .06); padding: 20px 18px 18px; }
.ts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 22px; }
.ts-head .label-caps { margin: 0; }
.ts-min { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ts-min svg { width: 15px; height: 15px; }
.ts-card h2 { font-size: clamp(22px, 5.6vw, 28px); font-weight: 700; letter-spacing: -.03em; line-height: 1.18; margin: 10px 0 16px; max-width: 24ch; text-wrap: balance; }
.ts-card.done h2 { color: var(--ink-2); padding-right: 54px; }
.ts-meta { color: var(--muted); font-size: 15px; margin: -8px 0 16px; }
/* the route: Path's red line with ring stops, a red character on each stop */
.ts-route { --n: 5; list-style: none; margin: 2px 0 20px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: relative; }
.ts-route::before { content: ""; position: absolute; top: 7px; height: 2px; left: calc(50% / var(--n)); right: calc(50% / var(--n)); background: var(--accent); transform-origin: left; animation: growX .8s var(--ease) both .15s; }
.ts-route li { display: grid; justify-items: center; align-content: start; text-align: center; gap: 2px; min-width: 0; padding: 0 2px; }
.ts-dot { position: relative; z-index: 1; width: 16px; height: 16px; margin-bottom: 7px; border-radius: 50%; border: 2.5px solid var(--accent); background: var(--surface); }
.ts-route.filled .ts-dot { background: var(--accent); }
.ts-route .zh { font-size: 16px; font-weight: 400; line-height: 1.15; color: var(--accent-ink); }
.ts-route strong { font-size: 12.5px; font-weight: 650; line-height: 1.2; text-wrap: balance; }
.ts-route small { font-size: 11.5px; color: var(--muted); line-height: 1.25; font-variant-numeric: tabular-nums; }
.ts-seal { position: absolute; right: 16px; top: -14px; width: 54px; height: 54px; font-size: 30px; }
.ts-card .t-short { margin-top: 14px; }
@media (min-width: 768px) {
  .t-session { margin-top: -48px; }
  .ts-card { padding: 26px 26px 24px; }
  .ts-route strong { font-size: 13.5px; } .ts-route small { font-size: 12.5px; } .ts-route .zh { font-size: 19px; }
}
@media (min-width: 1024px) {
  .t-mast { padding-bottom: 34px; }
  .t-session { grid-column: 8 / -1; align-self: end; margin-top: 0; border-bottom: 0; padding-bottom: 34px; }
}

.sx .session-bar { gap: 14px; }
.sx-track { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.sx-seg { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.sx-seg i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .45s var(--ease); }
.sx-seg.done i { background: var(--ink); }
.sx-head { min-height: 34px; }
.sx-kicker { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; font-size: 13px; color: var(--muted); min-width: 0; }
.sx-kicker .zh { font-size: 26px; line-height: 1; color: var(--accent-ink); }
.sx-kicker b { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.sx-kicker span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sx-host, .sx-step { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sx-step { animation: rise .4s var(--ease) both; }
.sx-card { display: grid; gap: 12px; justify-items: center; text-align: center; }
.sx-pad { width: 100%; display: grid; justify-items: center; margin-top: 4px; }
.sx-ph { font-size: clamp(25px, 7vw, 34px); line-height: 2.1; max-width: 100%; overflow-wrap: anywhere; }
.sx-en { font-family: var(--font-display); font-size: clamp(20px, 5.2vw, 25px); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; max-width: 24ch; }
.sx-when { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.sx-when svg { width: 16px; height: 16px; color: var(--accent-ink); flex: none; }
.sx-done .flash { justify-items: center; text-align: center; }
.sx-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 12px 16px; width: min(480px, 100%); margin: 20px auto 0; text-align: left; }
.sx-class { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--mint-ink); font-weight: 600; }
.sx-class svg { width: 16px; height: 16px; }

/* ---------- Me: profile, library, settings ---------- */
.me-head { align-items: center; }
.me-seal { display: grid; justify-items: center; gap: 8px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
@media (hover: hover) { .me-seal:hover { color: var(--ink); } }
.me-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 6px; }
.me-stats .value { font-size: clamp(22px, 6.4vw, 34px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.link { display: block; text-decoration: none; color: inherit; transition: border-color var(--snap) var(--ease); }
@media (hover: hover) { .stat.link:hover { border-top-color: var(--accent); } }
.me-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; transition: background var(--snap) var(--ease); }
.me-row:active { background: var(--surface-2); }
@media (hover: hover) { .me-row:hover { background: var(--surface-2); } }
.me-row svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.me-row span { flex: 1; min-width: 0; }
.me-row span + svg { color: var(--faint); width: 17px; height: 17px; }
.me-row.out, .me-row.out svg { color: var(--bad); }
.me > .me-row { border-top: 1px solid var(--line); margin-top: 18px; }
.me-set .t-sec-head + .me-row { border-top: 1px solid var(--line); }
.me-lib .label-caps { margin: 26px 0 8px; }

/* ---------- Class tab: the hub that ties the app to the learner's class ---------- */
.cl-hub .page-head { margin-bottom: 0; }
.cl-join { background: var(--mint); margin: 0 calc(-1 * var(--gutter)); padding: 26px var(--gutter) 28px; border-bottom: 0; }
.cl-join .t-sec-head h2 { font-size: clamp(22px, 5.6vw, 28px); letter-spacing: -.03em; }
.cl-join p.small { color: var(--ink-2) !important; max-width: 44ch; }
.t-sec-head .cl-exam { color: var(--accent-ink); }
.cl-exam b { font-weight: 700; }
.cl-chat { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background var(--snap) var(--ease); }
.cl-chat:active { background: var(--surface-2); }
@media (hover: hover) { .cl-chat:hover { background: var(--surface-2); } }
.cl-chat .sub { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.cl-hub .t-circle { margin-top: 0; padding-top: 0; border-top: 0; }
/* this week: the quiz week, up front */
.cl-week { padding: 0 0 28px; border-bottom: 1px solid var(--line); }
.clw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.clw-top .label-caps { margin: 0; color: var(--accent-ink); }
.clw-exam { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.clw-exam.soon { background: var(--accent-soft); color: var(--accent-ink); }
.clw-exam svg { width: 15px; height: 15px; }
.clw-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; margin: 12px 0 20px; }
.clw-hz { font-family: var(--font-zh); font-size: clamp(84px, 24vw, 120px); line-height: 1; }
.clw-head h2 { font-size: clamp(22px, 5.8vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 6px; text-wrap: balance; }
.clw-head .zh-sub { margin: 0; font-size: 15px; color: var(--muted); }
.clw-l { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.clw-l span { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.clw-chars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.clw-chars span { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-family: var(--font-zh); font-size: 29px; line-height: 1; }
.clw-chars span.ok { border-color: color-mix(in srgb, var(--ok) 55%, transparent); color: var(--ok); }
.clw-chars span.ok::after { content: ""; position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.clw-prog { display: grid; gap: 7px; margin-bottom: 20px; }
.clw-prog span { font-size: 13px; font-weight: 600; color: var(--muted); }
.clw-actions { display: grid; gap: 8px; }
.clw-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.clw-more svg { width: 16px; height: 16px; }
@media (hover: hover) { .clw-more:hover { color: var(--ink); } }
@media (min-width: 768px) { .clw-actions { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); } }

/* ---------- survey (pilot M6) ---------- */
.me-survey { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 22px 0 4px; padding: 16px; border-radius: 10px; background: var(--amber-soft); text-decoration: none; color: inherit; }
.me-survey .zh { font-size: 34px; line-height: 1; color: var(--amber-ink); text-align: center; }
.me-survey b { display: block; font-size: 15.5px; }
.me-survey .small { display: block; margin-top: 2px; }
.me-survey > svg { width: 18px; height: 18px; color: var(--muted); }
.cl-hub .me-survey { margin: 0 0 6px; }
.sv-card { text-align: center; justify-items: center; }
.sv-q { font-size: clamp(22px, 5.8vw, 30px); font-weight: 650; letter-spacing: -.025em; line-height: 1.25; margin: 14px auto 0; max-width: 22ch; text-wrap: balance; }
.sv-scale { display: grid; gap: 8px; }
.sv-opt { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 52px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; transition: border-color var(--snap) var(--ease), background var(--snap) var(--ease); }
.sv-opt b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.sv-opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sv-opt[aria-checked="true"] b { background: var(--accent); color: #fff; }
@media (hover: hover) { .sv-opt:hover { border-color: var(--ink-2); } }
@media (min-width: 768px) { .sv-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); } .sv-opt { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 12px 8px; min-height: 96px; font-size: 13.5px; } }

/* ---------- teacher: monthly report ---------- */
.tc-report-link { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 4px 0 20px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none; color: inherit; background: var(--surface); }
.tc-report-link b { display: block; font-size: 15px; }
.tc-report-link .small { display: block; }
.tc-report-link svg { width: 20px; height: 20px; color: var(--accent-ink); }
.tc-report-link > svg:last-child { color: var(--faint); width: 17px; height: 17px; }
.rp-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; margin: 6px 0 8px; }
.rp-kpi { position: relative; border-top: 1px solid var(--ink); padding: 12px 0 2px; min-width: 0; }
.rp-kpi .value { font-family: var(--font-display); font-size: clamp(28px, 7vw, 38px); font-weight: 650; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rp-kpi .value small { font-size: .5em; letter-spacing: 0; margin-left: 2px; color: var(--muted); }
.rp-kpi .label { margin-top: 6px; font-size: 13px; font-weight: 600; line-height: 1.3; }
.rp-kpi .sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.rp-tag { position: absolute; right: 0; top: 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--accent-ink); }
.rp-table { border-top: 1px solid var(--line); }
.rp-tr { display: grid; grid-template-columns: 62px minmax(0, 1.6fr) repeat(4, minmax(0, .8fr)); gap: 8px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rp-tr > span:not(:first-child):not(.rp-bar) { text-align: right; }
.rp-th { min-height: 34px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rp-bar { position: relative; display: flex; align-items: center; gap: 8px; }
.rp-bar i { display: block; height: 8px; flex: 1; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--w), var(--surface-3) var(--w)); }
.rp-bar b { min-width: 38px; text-align: right; font-size: 13px; }
.rp-src { margin: 22px 0 0; line-height: 1.5; }
@media (min-width: 768px) { .rp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media print {
  @page { margin: 14mm; }
  body, .main, .page { background: #fff !important; }
  .side, .top, .tabbar, .no-print, .skip, .toast, #boot { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .page { max-width: none !important; padding: 0 !important; }
  .rp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rp-tr, .rp-kpi, .list-row { break-inside: avoid; }
  .rp-month { display: block !important; padding: 0 0 14px !important; } .rp-month .icon-btn { display: none !important; } .rp-month b { font-size: 20px; }
  * { animation: none !important; transition: none !important; }
}
.rp-weak .list-row { padding: 8px 4px; gap: 12px; }
.rp-gl { display: block; line-height: 1.35; }
@media (max-width: 480px) { .rp-tr { grid-template-columns: 50px minmax(0, 1.25fr) repeat(4, minmax(0, .75fr)); gap: 6px; font-size: 13px; } .rp-bar i { display: none; } .rp-bar b { min-width: 0; text-align: left; } .rp-th { font-size: 10px; letter-spacing: .04em; } }
.cl-teach { margin: 14px 0 0; color: var(--ink-2); } .cl-teach a { color: var(--ink); font-weight: 600; }

/* ---------- test prep: drill by TOCFL level ---------- */
.tp-lv-grid { display: grid; gap: 8px; }
.tp-lv-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none; color: inherit; background: var(--surface); transition: border-color var(--snap) var(--ease); }
.tp-lv-card .zh { font-size: 36px; line-height: 1; color: var(--accent-ink); text-align: center; }
.tp-lv-card strong { display: block; font-size: 15px; }
.tp-lv-card small { display: block; color: var(--muted); font-size: 13px; }
.tp-lv-card > svg { width: 17px; height: 17px; color: var(--faint); }
@media (hover: hover) { .tp-lv-card:hover { border-color: var(--ink-2); } }
@media (min-width: 768px) { .tp-lv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- session: grammar and dialogue beats ---------- */
.sx-card.sx-left { justify-items: start; text-align: left; }
.sx-gt { font-size: clamp(22px, 6vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin: 4px 0 0; }
.sx-gx { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.sx-ex { width: 100%; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sx-ex .ruby-line { font-size: 23px; line-height: 2.1; }
.pattern.sm { font-size: 13px; padding: 2px 8px; }
.sx-cue { font-size: clamp(24px, 7vw, 32px); margin: 6px 0 0; }
.sx-ans { width: 100%; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line-strong); animation: rise .35s var(--ease) both; }
.sx-card .sx-ans .row { justify-content: center; }
.sx-chk { font-size: clamp(24px, 7vw, 32px); margin: 0; }
.sx-cleared { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; width: min(420px, 100%); margin: 16px auto 0; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none; color: inherit; text-align: left; background: var(--surface); }
.sx-cleared .seal { width: 46px; height: 46px; font-size: 26px; }
.sx-cleared b { display: block; } .sx-cleared small { display: block; color: var(--muted); font-size: 13px; }
.sx-cleared > svg { width: 17px; height: 17px; color: var(--faint); }
.sx-next { width: min(460px, 100%); margin: 16px auto 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.sx-next .label-caps { display: block; margin: 0 0 4px; color: var(--accent-ink); }

/* ---------- onboarding: placement check and finish ---------- */
.ob-place { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
/* the optional class code on the goal step: closed by default, so the question stays one choice */
.ob-code { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.ob-code > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--ink-2); min-height: 44px; }
.ob-code > summary::-webkit-details-marker { display: none; }
.ob-code > summary svg { width: 16px; height: 16px; transition: transform var(--reveal) var(--ease); }
.ob-code[open] > summary svg { transform: rotate(180deg); }
.ob-code .field { margin-top: 6px; max-width: 300px; }
.ob-code .cj-code { font-size: 24px; min-height: 58px; }
.ob-words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.ob-wd { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; transition: border-color var(--snap) var(--ease), background var(--snap) var(--ease); }
.ob-wd .zh { font-size: 24px; line-height: 1.1; }
.ob-wd .py { font-size: 12.5px; color: var(--muted); }
.ob-wd[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
#obLevel { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-ink); }
#obLevel svg { width: 16px; height: 16px; }
@media (min-width: 768px) { .ob-words { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.f-later { display: block; margin-top: 14px; text-align: center; color: rgba(255, 255, 255, .86); font-weight: 600; font-size: 15px; }
.ts-coming { display: grid; grid-template-columns: 18px minmax(0, 1fr) 16px; gap: 10px; align-items: center; margin: 14px -18px -18px; padding: 12px 18px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; background: var(--surface-2); }
.ts-coming svg { width: 16px; height: 16px; color: var(--accent-ink); }
.ts-coming > svg:last-child { color: var(--faint); }
.ts-coming span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 768px) { .ts-coming { margin: 16px -26px -24px; padding: 12px 26px; } }

/* desktop sidebar: the library stays one click away, closed by default, so the three tabs lead */
.side-lib > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.side-lib > summary::-webkit-details-marker { display: none; }
.side-lib > summary svg { width: 14px; height: 14px; transition: transform var(--reveal) var(--ease); }
.side-lib[open] > summary svg { transform: rotate(180deg); }

/* ---------- retention (v1.13): the day's seal in a brush circle, the real-life mission, milestones, the weekly recap, readiness ---------- */
.rt-enso { position: relative; width: 132px; height: 132px; margin: 0 auto; display: grid; place-items: center; }
.rt-enso svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rt-enso-p { fill: none; stroke: var(--accent); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; opacity: .9; animation: rt-draw 1s var(--ease) .15s forwards; }
@keyframes rt-draw { to { stroke-dashoffset: 0; } }
.rt-mission { margin-top: 18px; text-align: left; display: grid; gap: 10px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-xl); background: var(--surface); }
.rt-mission .label-caps .zh, .rt-check .label-caps .zh, .rt-mile .label-caps .zh { font-family: var(--font-zh); letter-spacing: 0; margin-right: 4px; color: var(--accent); }
.rt-phrase { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rt-phrase > div { min-width: 0; }
.rt-zh { font-size: 24px; line-height: 1.5; }
.rt-en { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.rt-where { margin: 0; }
.rt-mission .btn { justify-self: start; }
.sx-done .rt-mission, .sx-done .rt-nudge { width: min(480px, 100%); }
.rt-stamped { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); text-align: left; }
.rt-stamped .seal { width: 46px; height: 46px; font-size: 26px; flex: none; }
.rt-stamp { animation: rt-slam .45s var(--spring) both; }
@keyframes rt-slam { 0% { transform: scale(2.1) rotate(-14deg); opacity: 0; } 60% { transform: scale(.93) rotate(-5deg); opacity: 1; } 100% { transform: scale(1) rotate(-6deg); } }
.rt-nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-xl); background: var(--mint-soft); font-size: 14px; text-align: left; }
.rt-check { display: grid; gap: 10px; }
.rt-check h2 { margin: 2px 0 0; }
.rt-check.today { padding: 16px 18px; border-radius: var(--r-xl); background: var(--mint-soft); }
.rt-actions { gap: 8px; }
.rt-out { opacity: 0; transform: translateY(-6px); transition: opacity var(--reveal) var(--ease), transform var(--reveal) var(--ease); }
.rt-mile { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--band) 94%, transparent); color: var(--band-ink); opacity: 0; transition: opacity .3s var(--ease); }
.rt-mile.on { opacity: 1; }
.rt-mile.off { opacity: 0; }
.rt-mile-ink { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 58%); opacity: 0; }
.rt-mile.on .rt-mile-ink { animation: rt-bloom 1.6s var(--ease) .2s forwards; }
@keyframes rt-bloom { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }
.rt-mile-in { position: relative; max-width: 440px; display: grid; gap: 8px; justify-items: center; text-align: center; transform: translateY(18px) scale(.97); transition: transform .6s var(--spring); }
.rt-mile.on .rt-mile-in { transform: none; }
.rt-mile .label-caps { color: var(--band-muted); }
.rt-mile-n { font-family: var(--font-display); font-weight: 800; font-size: clamp(92px, 27vw, 164px); line-height: .9; letter-spacing: -.045em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.rt-mile-zh { font-size: clamp(28px, 8vw, 40px); color: var(--amber); margin: 2px 0 6px; }
.rt-mile h2 { color: var(--band-ink); margin: 0; font-size: 26px; text-wrap: balance; }
.rt-mile-can { color: var(--band-muted); max-width: 34ch; margin: 0; font-size: 16px; line-height: 1.5; text-wrap: balance; }
.rt-mile-next { color: var(--band-muted); margin: 4px 0 0; }
.rt-mile .btn { margin-top: 16px; }
.rt-recap .rt-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 2px 0 16px; max-width: 360px; }
.rt-days span { display: grid; justify-items: center; gap: 6px; }
.rt-days i { width: 100%; max-width: 30px; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.rt-days span.on i { background: var(--ink); border-color: var(--ink); animation: rt-pop .4s var(--spring) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes rt-pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.rt-days small { font-size: 11px; color: var(--muted); }
.rt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; }
.rt-stats .stat { min-width: 0; }
.rt-verdict { margin: 14px 0 12px; font-size: 15px; line-height: 1.5; max-width: 52ch; }
.rt-ready { margin: 14px 0 0; max-width: 420px; display: grid; gap: 8px; }
.rt-miles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rt-mile-chip { display: grid; justify-items: center; gap: 2px; min-width: 66px; padding: 8px 10px; border-radius: var(--r); border: 1px dashed var(--line-strong); color: var(--faint); font-variant-numeric: tabular-nums; }
.rt-mile-chip b { font-size: 15px; }
.rt-mile-chip small { font-size: 12px; }
.rt-mile-chip.got { border-style: solid; border-color: var(--ink); color: var(--ink); background: var(--surface-2); }
.rt-mile-chip.next { border-color: var(--accent); border-style: solid; color: var(--accent-ink); }
.rt-used { display: grid; margin-top: 8px; }
.rt-used-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rt-used-row .zh { font-size: 20px; }
@media (prefers-reduced-motion: reduce) {
  .rt-enso-p { animation: none; stroke-dashoffset: 0; }
  .rt-stamp, .rt-days span.on i, .rt-mile.on .rt-mile-ink { animation: none; }
  .rt-mile.on .rt-mile-ink { opacity: 1; }
  .rt-mile, .rt-mile-in, .rt-out { transition: none; }
}
