/* Shared by index.html and player.html (and the sign-in pages): colours, fonts, base elements, the sidebar menu, buttons and tags.
   Design: design/homepage/project/Mix.dc.html (homepage) and Player.dc.html (player). Light only for now. */
:root {
  --ink: #111111; --soft: #6b6b6b; --mute: #737373; --line: #ececec; --bg: #f4f4f3; --page: #e7e7e6;
  --lime: #e4ef4a; --green: #4f7d4a; --bad: #b8325a; --red: #e5484d;
  --ui: "Inter", "Segoe UI", system-ui, sans-serif;
  --zh: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
/* traditional characters chosen (zh.js): Taiwan's shapes; Noto Sans TC is fetched only then. "ZH Punct" is Noto
   Sans SC's ，。、；：？！, so punctuation sits at the foot of the line as in simplified, not mid-square */
:root[data-script="t"] { --zh: "ZH Punct", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans SC", sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 14px/1.45 var(--ui); }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.zh { font-family: var(--zh); }
.muted { color: var(--soft); }
.lbl { font-size: 12px; color: var(--soft); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.soon { font-size: 11px; color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: auto; white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: flex; gap: 24px; align-items: stretch; padding: 24px; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side {
  width: 264px; flex: none; background: #fff; border-radius: 26px; padding: 22px 16px;
  display: flex; flex-direction: column; position: sticky; top: 24px; align-self: flex-start;
  height: calc(100vh - 48px); overflow-y: auto;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.brand { display: flex; align-items: center; gap: 8px; font: 600 17px var(--ui); }
.brand svg { width: 24px; height: 24px; flex: none; }
.brand-zh { font: 500 15px var(--zh); color: #8a8a8a; margin-left: 6px; }
.collapse {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--soft); display: grid; place-items: center; cursor: pointer; flex: none;
}
.collapse:hover { color: var(--ink); }
.find {
  margin-top: 22px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 14px; padding: 0 10px 0 12px; color: var(--soft);
}
.find:focus-within { border-color: var(--ink); color: var(--ink); }
.find input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 10px 0; font: 14px var(--ui); color: var(--ink); }
.find input::placeholder { color: var(--soft); }
/* the menu's Search box is a button that opens the search pop-up (search.js) */
button.find { width: 100%; background: #fff; font: 14px var(--ui); color: var(--soft); text-align: left; cursor: pointer; padding: 10px 10px 10px 12px; }
button.find:hover { border-color: #d5d5d2; color: var(--ink); }
button.find .t { flex: 1; min-width: 0; }
.kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; color: var(--soft); }
.lab { font-size: 11px; letter-spacing: 0.06em; color: var(--mute); text-transform: uppercase; margin: 22px 10px 8px; display: flex; justify-content: space-between; }
.nav {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px;
  color: var(--soft); font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left;
}
.nav:hover { color: var(--ink); background: #fafaf9; }
.nav.on { background: var(--bg); color: var(--ink); font-weight: 600; }
.nav .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--zh); color: #111; flex: none; overflow: hidden; background: var(--bg); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me { margin-top: auto; padding-top: 18px; }
/* the privacy policy and terms under the account card, and under the account screen (LegalPages.dc.html) */
.me-legal, .acc-legal { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 0; padding: 0 6px; font-size: 12px; }
.me-legal a, .acc-legal a { color: var(--soft); text-decoration: none; }
.me-legal a:hover, .acc-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.acc-legal { gap: 16px; padding: 20px 0 0; border-top: 1px solid var(--line); }
/* the weekly goal and the streak (common.js renderGoal; design: GoalStreak.dc.html) */
:root { --flame: #e8743b; }
.goal-box { margin-top: auto; padding-top: 18px; }
.goal-box + .me { margin-top: 0; padding-top: 12px; }
.goal { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.goal:hover { border-color: #d5d5d2; }
.goal .gh { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.goal .gh .reached { color: var(--ink); font-weight: 600; }
.goal .amt { white-space: nowrap; }
.goal .amt b { font-weight: 600; font-size: 13px; }
.goal .track { display: block; height: 6px; border-radius: 3px; margin-top: 8px; }
.goal .track i { border-radius: 3px; }
.track.done i, .goal-pill .mini.done i { background: var(--lime); }
.goal .gs { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.streak b { font-weight: 700; }
.fl { width: 16px; height: 16px; fill: var(--flame); flex: none; }
.fl.cold { fill: #cfcfcb; }
.gdots { display: flex; gap: 1px; }
.gd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 2px; border-radius: 7px; }
.gd i { width: 10px; height: 10px; border-radius: 50%; background: #eeeeed; display: block; }
.gd.on i { background: var(--flame); }
.gd.future i { background: #f6f6f5; }
.gd b { font: 500 8px var(--ui); color: #9a9a9a; }
.gd.today { background: #efefed; }
.gd.today b { color: var(--ink); font-weight: 700; }
.gd.today:not(.on) i { background: #fff; box-shadow: inset 0 0 0 1.5px #bdbdb9; }
.g-signin { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; }
.goal-ring { display: none; flex-direction: column; align-items: center; gap: 3px; color: var(--ink); text-decoration: none; font-size: 12px; }
.goal-ring .ring { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ink) 0 var(--p), #eeeeed var(--p) 100%); }
.goal-ring .ring.done { background: var(--lime); }
.goal-ring .ring > span { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.goal-ring .fl { width: 15px; height: 15px; }
.goal-pill { display: none; align-items: center; gap: 6px; margin-left: auto; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; color: var(--ink); text-decoration: none; }
.goal-pill .fl { width: 14px; height: 14px; }
.goal-pill .mini { width: 34px; height: 4px; border-radius: 2px; background: #eeeeed; overflow: hidden; }
.goal-pill .mini i { display: block; height: 100%; background: var(--ink); }
.g-toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 10px; background: var(--ink);
  color: #fff; border-radius: 14px; padding: 12px 16px; font-size: 14px; box-shadow: 0 14px 30px -14px rgba(0,0,0,.5);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); }
.g-toast.show { opacity: 1; transform: translate(-50%, 0); }
.g-toast .fl { width: 20px; height: 20px; }
@media (prefers-reduced-motion: reduce) { .g-toast { transition: none; } }
/* a show you follow with an episode you haven't opened yet (Your shows, plans/11-podcasts-page.md) */
.new { display: inline-block; font: 600 11px/1.5 var(--ui); background: var(--lime); color: var(--ink); border-radius: 999px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; flex: none; }
/* in the menu: a small red dot next to a show or channel you follow that has an episode or video you haven't seen
   (it goes when you open its page); on the picture's corner when the menu is folded */
.nav { position: relative; }
.nav .unseen { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; margin-left: auto; }
.collapsed .side .unseen { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; box-shadow: 0 0 0 2px #fff; }
.track { height: 4px; background: #eeeeed; border-radius: 2px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--ink); border-radius: 2px; transition: width 0.6s; }

/* collapsed sidebar: icons only */
.collapsed .side { width: 76px; padding: 22px 12px; }
.collapsed .side .goal-ring { display: flex; }
.collapsed .goal-box + .me { padding-top: 14px; }
.collapsed .side .t, .collapsed .side .lab, .collapsed .side .goal,
.collapsed .side .brand span, .collapsed .side .find input, .collapsed .side .kbd, .collapsed .side .find .t,
.collapsed .side .me-who, .collapsed .side .me-chev, .collapsed .side .soon, .collapsed .side .me-legal { display: none; }
.collapsed .brand-row { flex-direction: column; gap: 0; padding: 0; }
.collapsed .find { justify-content: center; padding: 10px; cursor: pointer; }
.collapsed .nav { justify-content: center; padding: 10px; }
.collapsed .me-card { justify-content: center; padding: 8px; border-color: transparent; }
/* collapsed: a short line between Words and the Following list, in place of its heading */
@media (min-width: 861px) {
  .collapsed .side #follow-lab:not([hidden]) { display: block; height: 1px; margin: 14px 14px 10px; background: var(--line); font-size: 0; }
}
/* folded: the pages start a little below the expand button (there is no Search box between them any more) */
@media (min-width: 861px) { .collapsed .side nav { margin-top: 22px; } }

/* ---------- main panel, buttons, tags ---------- */
.main { flex: 1; min-width: 0; background: #fff; border-radius: 26px; padding: 32px 38px 32px; display: flex; flex-direction: column; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 10px 16px;
  font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #d5d5d2; }
.btn.black { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.black:hover { background: #2a2a2a; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--soft); background: #fff; }
button.tag { cursor: pointer; }
button.tag.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- account: the card at the bottom of the menu and the menu it opens ----------
   Design: design/homepage/project/AccountMenu.dc.html. Drawn by account.js. */
.me-card {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 12px; background: #fff; text-align: left; cursor: pointer;
}
.me-card:hover { border-color: #d5d5d2; }
.me-av { width: 36px; height: 36px; font: 600 14px var(--ui); background: #c9d6ff; }
.me-av.in, .me-mini.in { background: var(--lime); }
.me-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chev { color: var(--soft); }
.me-card.on { background: var(--bg); border-color: var(--bg); }
/* free and paid (design: PlanLimits.dc.html, D, approved 21 Nov): Upgrade under a free account's card */
.me-up { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; border-radius: 12px; background: var(--bg); padding: 9px 12px; font-size: 13px; text-decoration: none; color: var(--ink); }
.me-up:hover { background: #ececea; }
.me-up b { font-weight: 600; }
.collapsed .me-up { display: none; }
.me-mini { display: none; width: 32px; height: 32px; font: 600 13px var(--ui); background: #c9d6ff; margin-left: auto; }
.me-mini.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
/* the phone's top bar: search as a round button beside your profile (the menu's Search box is hidden there) */
.find-mini { display: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  place-items: center; padding: 0; margin-left: auto; cursor: pointer; flex: none; }
.find-mini:hover { border-color: #d5d5d2; }
.find-mini .ico { width: 16px; height: 16px; }

/* the account screen (index.html #account; design: design/homepage/project/AccountRedo.dc.html, B, chosen 22 Nov):
   your name on top, the settings in boxes on the left, the plan card and the streak card on the right */
.acc-h1 { font: 500 28px/1.2 var(--ui); letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.acc-head { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.acc-head .av { width: 64px; height: 64px; font: 600 24px var(--ui); background: var(--lime); }
.acc-who { flex: 1; min-width: 0; }
.acc-who .lbl { font-size: 13px; overflow-wrap: anywhere; }
.acc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; margin-top: 28px; align-items: start; max-width: 1080px; }
.acc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; margin-top: 24px; }   /* level with the first box: the heading above it is 14 + 10 px */
#acc-plan:empty { display: none; }                 /* paywall off: no plan card */
.acc-sec { font: 500 11px/14px var(--ui); letter-spacing: 0.06em; color: var(--mute); text-transform: uppercase; margin: 32px 0 10px 4px; }
.acc-sec:first-child { margin-top: 0; }
.acc-grp { border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.acc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 12px 20px; min-height: 64px; }
.acc-row + .acc-row { border-top: 1px solid var(--line); }
.acc-row .st { font-weight: 600; }
.acc-row input { width: 280px; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.acc-row input:focus { outline: none; border-color: var(--ink); }
.acc-row .dd { width: 280px; max-width: 100%; }
.btn.badtext { border-color: transparent; color: var(--bad); padding-left: 10px; padding-right: 10px; }
.btn.badtext:hover { border-color: #ecc6d2; }
.acc-grid .acc-legal { margin-top: 24px; padding: 0 0 0 4px; border-top: 0; }
/* the plan card: Free or Sips Plus, and what's used this month (was the Plan row, PlanLimits.dc.html, C) */
.acc-plan { background: var(--bg); border-radius: 20px; padding: 20px 22px; }
.acc-plan-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.acc-plan-h .lbl, .acc-mt .lbl { font-size: 13px; }
.acc-planline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.acc-badge { font: 600 12px var(--ui); border-radius: 999px; padding: 3px 10px; background: #fff; }
.acc-badge.plus { background: var(--ink); color: #fff; }
.acc-dots { display: inline-flex; gap: 5px; }
.acc-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.acc-dots i.used { background: #cfcfcb; }
.acc-meters { display: grid; gap: 14px; margin-top: 18px; }
.acc-meters:empty { display: none; }
.acc-mt { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.acc-mt b { font: 600 15px var(--ui); }
.acc-meter .track { background: #e4e4e2; margin-top: 7px; }
.acc-meter .track.full i { background: var(--bad); }
.acc-plan > .btn { width: 100%; margin-top: 18px; }
.acc-plan .btn.lime { background: var(--lime); border-color: var(--lime); color: var(--ink); }
/* the streak card: the streak, a square per day for the last 17 weeks, and this week against the goal */
.acc-streak { border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; background: #fff; }
.acc-streak h2 { font: 600 15px var(--ui); margin: 0; }
.acc-big { display: flex; align-items: center; gap: 8px; font: 600 28px var(--ui); margin-top: 10px; }
.acc-big .fl { width: 26px; height: 26px; }
.hm-wrap { --c: 13px; margin-top: 16px; max-width: 100%; overflow-x: auto; }
.hm-mon { position: relative; height: 14px; margin-left: 17px; font-size: 11px; color: var(--soft); }
.hm-mon span { position: absolute; top: 0; left: calc(var(--w) * (var(--c) + 3px)); }
.hm { display: flex; gap: 3px; margin-top: 4px; }
.hm-days, .hm-wk { display: flex; flex-direction: column; gap: 3px; }
.hm-days b { height: var(--c); width: 14px; font: 500 9px/var(--c) var(--ui); color: #8a8a86; }
.hm i, .hm-key i { display: block; width: var(--c); height: var(--c); border-radius: 3px; }
@media (max-width: 400px) { .hm-wrap { --c: 12px; } }
/* the flame's orange, light to deep: more listening, darker square */
.hm .l0, .hm-key .l0 { background: #eeeeed; }
.hm .l1, .hm-key .l1 { background: #f8d5bd; }
.hm .l2, .hm-key .l2 { background: #f0a370; }
.hm .l3, .hm-key .l3 { background: var(--flame); }
.hm .l4, .hm-key .l4 { background: #a9461a; }
.hm i.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.hm i.later { background: none; }
.hm-key { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 8px; font-size: 11px; color: var(--soft); }
.hm-key span { margin: 0 3px; }
.acc-week { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; font-size: 13px; }
.acc-week b { font-weight: 600; }
.acc-streak .track { height: 6px; border-radius: 3px; margin-top: 8px; }
/* a narrower window: the two cards go on top, side by side, then the boxes; on a phone everything is one column */
@media (max-width: 1180px) {
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
  .acc-side { order: -1; margin-top: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}

/* the upgrade page (index.html #upgrade, upgrade.js; design: UpgradePage.dc.html, approved 21 Nov) */
#upgrade a.back { text-decoration: none; }
.up-ctx { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: 16px; padding: 12px 16px; margin-top: 18px; font-size: 14px; max-width: 820px; }
.up-dots { display: inline-flex; gap: 5px; flex: none; }
.up-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.up-dots i.used { background: #d4d4d1; }
.up-h1 { font: 500 34px/1.15 var(--ui); letter-spacing: -0.02em; margin: 22px 0 0; }
.up-sub { font-size: 16px; color: var(--soft); margin: 10px 0 0; max-width: 640px; }
.up-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 16px; margin-top: 28px; }
.up-price { border: 1px solid var(--line); border-radius: 22px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; background: #fff; }
.up-price.best { border: 2px solid var(--ink); }
.up-nm { font: 600 15px var(--ui); }
.up-amt { font: 600 38px/1.1 var(--ui); letter-spacing: -0.02em; margin-top: 6px; }
.up-amt small { font: 500 15px var(--ui); color: var(--soft); letter-spacing: 0; }
.up-eq { font-size: 13px; color: var(--soft); }
.up-save { position: absolute; right: 18px; top: 18px; background: var(--ink); color: #fff; border-radius: 999px; padding: 3px 10px; font: 600 12px var(--ui); }
.up-price .btn { margin-top: 14px; width: 100%; justify-content: center; border-radius: 999px; min-height: 44px; }
.up-price .btn[disabled] { background: #e9e9e6; border-color: #e9e9e6; color: var(--soft); cursor: default; }
.up-fine { font-size: 12px; color: var(--soft); margin: 12px 0 0; max-width: 660px; }
.up-fine a { color: var(--ink); }
.up-sh { font: 600 17px var(--ui); margin: 40px 0 12px; }
.up-cmp { width: 100%; max-width: 820px; border-collapse: collapse; font-size: 14px; }
.up-cmp th, .up-cmp td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.up-cmp thead th { font-size: 12px; color: var(--soft); font-weight: 600; border-bottom-color: #dcdcd9; }
.up-cmp thead th.plus { color: var(--ink); }
.up-cmp td:not(:first-child) { width: 150px; }
.up-cmp td.plus { font-weight: 600; }
.up-cmp td.no { color: #8a8a87; }
.up-cmp .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.up-faq { max-width: 820px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; }
.up-faq b { display: block; font-size: 14px; margin-bottom: 4px; }
.up-faq p { margin: 0; font-size: 14px; color: var(--soft); }
.up-mine { display: flex; align-items: center; gap: 16px; border: 2px solid var(--ink); border-radius: 22px; padding: 20px 22px; margin-top: 26px; max-width: 820px; flex-wrap: wrap; }
.up-mine .w { flex: 1; min-width: 240px; }
.up-mine .lbl { font-size: 14px; margin-top: 4px; }
@media (max-width: 720px) {
  .up-h1 { font-size: 26px; margin-top: 16px; }
  .up-sub { font-size: 14px; }
  .up-prices { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; }
  .up-amt { font-size: 32px; }
  .up-cmp { font-size: 13px; }
  .up-cmp td:not(:first-child) { width: auto; }
  .up-faq { grid-template-columns: minmax(0, 1fr); }
  .up-ctx { font-size: 13px; align-items: flex-start; }
}
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.seg button { padding: 7px 14px; border-radius: 9px; border: 0; background: none; font: 500 13px var(--ui); color: var(--soft); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile b { font: 600 20px var(--ui); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.tile .fl { width: 18px; height: 18px; }
.btn.badline { color: var(--bad); border-color: #ecc6d2; }
.btn.badline:hover { border-color: var(--bad); }
/* the level list: a button and a list box */
.dd { position: relative; }
.dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer; text-align: left;
}
.dd-btn:hover { border-color: #d5d5d2; }
.dd-btn[aria-expanded="true"] { border-color: var(--ink); }
.dd-btn .ico { color: var(--soft); }
.dd-btn .unset { color: var(--soft); }
.dd-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,0.10);
  max-height: min(440px, 60vh); overflow-y: auto;
}
.dd-list:focus { outline: none; }
.dd-grp { font: 600 15px var(--ui); padding: 12px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.dd-opt { padding: 6px 10px 6px 18px; border-radius: 8px; cursor: pointer; }
.dd-opt.none { padding-left: 10px; color: var(--soft); }
.dd-opt.dd-on { background: #f1f1ef; }   /* not ".act": index.html's dark action buttons use that name */
.dd-opt[aria-selected="true"] { background: var(--bg); font-weight: 600; }
.dd-list:focus-visible .dd-opt.dd-on { box-shadow: inset 0 0 0 2px var(--ink); }
.acct-dlg { border: 0; border-radius: 22px; padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,0.2); color: var(--ink); }
.acct-dlg::backdrop { background: rgba(17,17,17,0.35); }
.acct-dlg h2 { font: 600 20px var(--ui); margin: 0; }
.acct-dlg p { margin: 10px 0 0; }
.acct-dlg ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.acct-dlg .btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.acct-dlg .err { color: var(--bad); font-size: 13px; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.bad:hover { background: #a02a4e; }

/* Upload your own audio (site/upload.js; design: UploadAudio.dc.html, approved 21 Nov) */
.up-dlg { width: min(520px, calc(100vw - 32px)); }
.up-dlg .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.up-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.up-h h2 { font: 600 18px var(--ui); margin: 0; }
.up-h .btn.ic { padding: 7px; border-color: transparent; color: var(--soft); }
.up-drop { border: 1.5px dashed #c9c9c6; border-radius: 18px; padding: 30px 20px; margin-top: 16px; display: flex; flex-direction: column;
  align-items: center; gap: 10px; text-align: center; color: var(--soft); cursor: pointer; }
.up-drop.over, .up-drop:hover { border-color: var(--ink); }
.up-drop > .ico { width: 30px; height: 30px; color: var(--ink); }
.up-drop b { color: var(--ink); font-size: 15px; }
.up-file { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-top: 16px; }
.up-cv { width: 44px; height: 44px; border-radius: 10px; background: var(--bg); color: var(--soft); display: grid; place-items: center; flex: none; }
.up-cv .ico { width: 22px; height: 22px; }
.up-fn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.up-fn .nm { font: 600 14px var(--zh); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-change { cursor: pointer; }
.up-fld { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.up-fld label { font: 600 13px var(--ui); }
.up-fld .opt { font-weight: 400; color: var(--soft); }
.up-fld .lbl { margin: 0; }
.up-inp { border: 1px solid #d4d4d1; border-radius: 12px; padding: 10px 12px; font: 15px var(--zh); color: var(--ink); background: #fff; width: 100%; box-sizing: border-box; }
.up-inp:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.up-facts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; background: var(--bg); border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.up-facts > div { display: flex; gap: 9px; align-items: flex-start; }
.up-facts .ico { width: 16px; height: 16px; margin-top: 1px; color: var(--soft); }
.up-facts a { text-decoration: underline; text-underline-offset: 0.2em; }
.up-f { display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.up-f .lbl { margin-right: auto; flex: 1 1 160px; min-width: 0; }
.up-bar { height: 6px; background: #eeeeed; border-radius: 3px; overflow: hidden; margin-top: 14px; }
.up-bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width 0.3s; }
.up-keep { margin: 12px 0 0; }
.up-msg { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 14px; }
.up-msg .ico { width: 16px; height: 16px; margin-top: 1px; }
.up-msg.bad { background: #fbeef2; color: #7d1f3d; }
.up-btn .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.up-btn.ic-only { width: 40px; height: 40px; padding: 0; }
.up-plus { font: 700 10px var(--ui); letter-spacing: 0.04em; background: var(--lime); color: var(--ink); border-radius: 999px; padding: 2px 7px; }
.up-over { outline: 2px dashed var(--ink); outline-offset: -8px; border-radius: 26px; }
@media (max-width: 760px) {
  /* a sheet from the bottom, as the save pop-up */
  .up-dlg { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; padding: 18px 18px 22px; }
  .up-f .btn { flex: 1; min-height: 44px; }
  .up-f .lbl { flex-basis: 100%; }
}

/* ---------- sign in / create an account (signin.html, signup.html; drawn by signin.js) ----------
   Design: design/homepage/project/SignIn.dc.html */
.au-page { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 56px 24px; }
.au-card { background: #fff; border-radius: 26px; padding: 32px; width: 100%; max-width: 460px; }
.au-card.wide { max-width: 860px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 32px; align-items: start; }
.au-card h1 { font: 500 30px/1.2 var(--ui); letter-spacing: -0.02em; margin: 28px 0 0; }
.au-sub { margin: 8px 0 0; color: var(--soft); }
.au-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border-radius: 12px; padding: 12px 16px;
  font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-align: center;
}
.au-btn:hover { border-color: #d5d5d2; }
.au-btn.black { background: var(--ink); color: #fff; border-color: var(--ink); margin-top: 12px; }
.au-btn.black:hover { background: #2a2a2a; }
.au-btn.lime { background: var(--lime); border-color: var(--lime); }
.au-btn.lime:hover { background: #dbe63f; }
.au-btn[disabled] { opacity: 0.6; cursor: default; }
.au-btn .g { width: 18px; height: 18px; flex: none; }
#google { margin-top: 22px; }
.au-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; color: var(--soft); font-size: 12px; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.au-field { display: block; margin-top: 18px; }
.au-field span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.au-field input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; }
.au-field input:focus { outline: none; border-color: var(--ink); }
.au-field input[aria-invalid="true"] { border-color: var(--bad); }
.au-err { color: var(--bad); font-size: 13px; margin: 8px 0 0; }
.au-fix { margin-top: 12px; }
/* Turnstile's checkbox, only when Cloudflare doubts the browser (site/signin.js) */
#ts:not(:empty) { margin-top: 12px; }
.au-note { font-size: 12px; color: var(--soft); margin: 16px 0 0; }
.au-note a, .au-link { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.au-link { background: none; border: 0; padding: 0; font-size: inherit; cursor: pointer; }
.au-other { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.au-other p { margin: 0 0 10px; font-weight: 500; }
.au-why { background: var(--bg); border-radius: 18px; padding: 22px; }
.au-why-h { font-weight: 600; margin: 0; }
.au-why ul { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.au-why li { display: flex; gap: 12px; align-items: flex-start; }
.au-why .ico { width: 20px; height: 20px; margin-top: 1px; }
.au-why-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 20px; }
.au-mail { width: 44px; height: 44px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; margin-top: 28px; }
.au-mail svg { width: 20px; height: 20px; fill: none; stroke: #111; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.au-card h1.au-sent-h { font-size: 26px; margin-top: 18px; }
.au-p { margin: 10px 0 0; }
#other { margin-top: 20px; }

/* ---------- HSK level ladders: the player's dictionary panel and the Words page ----------
   One row per list (3.1, 2.0) with the word's level filled in; the list you study with is in plum. */
:root { --hsk: #b8325a; }
.levels { display: grid; gap: 12px; margin-top: 16px; }
.lvhead { display: flex; justify-content: space-between; font-size: 12px; color: var(--soft); }
.lvhead b { color: var(--ink); font-weight: 600; }
.lvrow.mine .lvhead b { color: var(--hsk); }
.scale { display: grid; gap: 3px; margin-top: 6px; font-size: 10px; text-align: center; line-height: 18px; }
.scale span { background: #f1f1ef; border-radius: 4px; color: var(--soft); }
.scale span.below { background: #e9e9e6; }
.scale span.at { background: var(--ink); color: #fff; font-weight: 700; }
.lvrow.mine .scale span.below { background: #f3e3e9; color: var(--hsk); }
.lvrow.mine .scale span.at { background: var(--hsk); }

/* ---------- words (plan 05): the Words page (/#words) and the player's save card ----------
   Design: design/homepage/project/WordsPage.dc.html, and for the page's layout WordsRedo.dc.html (B, the side
   column; approved 22 Nov). Drawn by words.js and player.html. */
/* your words on the left; on the right one column: today's review, your words, the week, or the word you picked */
.wd-grid.has-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.wd-side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; border: 1px solid var(--line); border-radius: 24px; background: #fff; }
.wd-side.picking { border: 0; border-radius: 0; background: none; }
.wd-side.picking .wd-rv { display: none; }
.wd-side.picking .wd-panel { background: none; }
.wd-side.picking .wp-in { border: 1px solid var(--line); border-radius: 24px; background: #fff; }
.wd-side:not(.picking) .wd-panel { display: none; }
.wd-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wd-top h1 { font: 500 30px/1.2 var(--ui); margin: 0 auto 0 0; letter-spacing: -0.02em; }
.wd-sets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.wd-sets .tag { display: inline-flex; align-items: center; gap: 6px; }
.wd-sets .tag:hover { border-color: #d5d5d2; color: var(--ink); }
.wd-sets .tag.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.wd-sets .n { opacity: 0.6; font-variant-numeric: tabular-nums; }
.wd-seth { display: flex; align-items: center; gap: 10px; margin-top: 18px; position: relative; }
.wd-seth h2 { font: 600 18px var(--ui); margin: 0; }
.wd-tools { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.wd-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; color: var(--soft); }
.wd-search:focus-within { border-color: var(--ink); color: var(--ink); }
.wd-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 9px 0; }
.wd-tools select { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; font-size: 13px; cursor: pointer; }
.wd-md { margin-top: 14px; }
.wl-h, .wl { display: grid; grid-template-columns: 84px 116px minmax(0, 1fr) 48px; gap: 12px; align-items: center; padding: 11px 10px; }
.wl-h { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); padding-top: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wl { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; }
#wd-rows > .wl:first-child { border-top: 0; }
.wl:hover { background: #fafaf9; }
.wl.on { background: var(--bg); border-radius: 12px; border-top-color: transparent; }
.wl.on + .wl { border-top-color: transparent; }
.wl .w { font: 600 18px var(--zh); overflow-wrap: anywhere; }
.wl .py { font-size: 14px; }
.wl .def { font-size: 14px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvn { justify-self: end; font-size: 12px; font-weight: 600; color: var(--bad); background: rgba(184,50,90,0.08); border-radius: 999px; padding: 1px 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lvn.none { color: var(--soft); background: none; }
.wd-panel { background: #fff; }
.wp-in { padding: 20px 22px 22px; }
.wp-head { display: flex; align-items: flex-start; gap: 8px; }
.wp-w { font: 600 40px/1.1 var(--zh); letter-spacing: 0.03em; overflow-wrap: anywhere; margin-right: auto; }
.wp-py { font-size: 20px; margin-top: 4px; }
.wp-hsk { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.hskp { font-size: 11px; font-weight: 600; color: var(--bad); background: rgba(184,50,90,0.08); border-radius: 999px; padding: 1px 8px; }
.hskp.two { color: var(--ink); background: #efefed; }
.wd-panel ol { margin: 14px 0 0; padding-left: 20px; line-height: 1.6; }
.wp-sec { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.wp-sent { margin: 4px 0 0; font: 400 17px/1.8 var(--zh); color: #333; }
.wp-sent mark { background: var(--lime); border-radius: 4px; padding: 0 2px; color: var(--ink); }
.wp-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wp-x { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
.wp-x:hover { background: #ebebe9; }
.btn.pill { border-radius: 999px; padding: 8px 14px; font-size: 13px; }
.btn.pill .ico { width: 14px; height: 14px; }
.btn.ic { padding: 8px; border-radius: 10px; }
.btn.ic .ico { width: 16px; height: 16px; }
.btn.danger { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips .tag { cursor: pointer; }
.chips .tag:hover { border-color: #d5d5d2; color: var(--ink); }
.chips .tag.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips .tag.add { border-style: dashed; }
.chips input { border: 1px solid var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12px; width: 150px; outline: none; }
.wd-empty { border: 1px dashed #dcdcda; border-radius: 18px; padding: 26px; margin-top: 22px; color: var(--soft); max-width: 620px; }
.wd-empty b { color: var(--ink); font-weight: 600; font-size: 16px; display: block; }
.wd-empty div b { display: inline; font-size: inherit; }
.wd-menu { position: absolute; right: 0; top: 44px; z-index: 5; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,0.1); padding: 6px; width: 200px; }
.wd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; text-align: left; }
.wd-menu button:hover { background: var(--bg); }
.wd-menu .bad { color: var(--bad); }
.wd-input { width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 14px var(--ui); }
.wd-input:focus { outline: none; border-color: var(--ink); }
select.wd-input { background: #fff; cursor: pointer; margin-top: 6px; }
.chips .tag[disabled] { cursor: default; }
/* the save pop-up (＋ Word list): the sentence, then the set */
.wsave { width: min(400px, calc(100vw - 32px)); }
.wsave h2 .zh, .wsave h2 [lang] { font-family: var(--zh); }
.wsave-sent { margin: 8px 0 0; font: 400 15px/1.7 var(--zh); color: #444; }
.wsave-sent mark { background: var(--lime); border-radius: 4px; padding: 0 2px; color: var(--ink); }
.wsave-l { display: block; margin-top: 14px; }
.wsave .wd-input { margin-top: 6px; }
@media (max-width: 860px) {
  /* on a phone the pop-up comes up from the bottom */
  .wsave { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; padding-bottom: 28px; }
  .wsave .btns .btn { flex: 1; }
}
.wd-ep { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bg); border-radius: 14px; padding: 10px 14px; margin-top: 16px; font-size: 13px; }
.wd-ep span { flex: 1; min-width: 200px; }
.wd-ep a { color: var(--ink); font-weight: 600; }
.wd-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; display: flex; gap: 14px; align-items: center; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,0.25); font-size: 13px; }
.wd-toast button { background: none; border: 0; color: var(--lime); font-weight: 600; cursor: pointer; padding: 0; }
/* the player's card after ＋ Word list */
.wcard { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; box-shadow: 0 18px 40px -20px rgba(0,0,0,0.35); }
.wcard-h { display: flex; align-items: center; gap: 8px; }
.wcard-h b { font-size: 13px; }
.wcard-x { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; }
.wcard .err { color: var(--bad); font-size: 13px; margin: 8px 0 0; }
.wcard .rm { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; }
.linkbtn.bad { color: var(--bad); }
#wordlist.in { border-color: var(--ink); }
/* when the Words area is narrow (a phone, or a small window next to the menu; words.js sets .narrow below
   720 px): two short lines per word, and the panel opens as a sheet from the bottom */
.narrow .wd-grid.has-side { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.narrow .wd-mainc { display: contents; }
.narrow .wd-mainc > :not(.wd-top) { order: 2; }
.narrow .wd-side { order: 1; position: static; max-height: none; overflow: visible; border: 0; border-radius: 0; background: none; margin-top: 14px; }
.narrow .wd-side.picking .wd-rv { display: block; }
.narrow .wd-side.picking .wd-panel { background: #fff; }
.narrow .wd-side.picking .wp-in { border: 0; border-radius: 0; background: none; }
.narrow .wd-rv { background: var(--bg); border-radius: 18px; padding: 16px; }
.narrow .wd-rv:has(> .rvs-sec.first:only-child) { display: none; }
.narrow .rvs-today, .narrow .rvs-sec { padding: 0; background: none; border: 0; }
.narrow .rvs-sec { margin-top: 14px; }
.narrow .rvs-wk, .narrow .rvs-ghostsec, .narrow .rvs-sec .rvs-h .kick, .narrow .rvs-slim { display: none; }
.narrow .rvs-piles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.narrow .rvs-pile { width: auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; gap: 6px; color: var(--soft); }
.narrow .rvs-pile b { margin-left: 0; color: var(--ink); }
.narrow .rvs-pile.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.narrow .rvs-pile.on b { color: #fff; }
.narrow .wl-h { display: none; }
.narrow .wl { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "w py lv" "def def def"; gap: 2px 10px; padding: 10px 4px; align-items: baseline; }
.narrow .wl .w { grid-area: w; } .narrow .wl .py { grid-area: py; } .narrow .wl .lvn { grid-area: lv; } .narrow .wl .def { grid-area: def; }
.narrow .wd-panel { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; max-height: 72vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 -12px 40px rgba(0,0,0,0.18); z-index: 40; display: none; }
.narrow .wd-panel.open { display: block; }
/* a middling width (a small window, or the menu open): a narrower column, two lines per word */
.mid .wd-grid.has-side { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.mid .wl-h { display: none; }
.mid .wd-list .wl { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "w py . lv" "def def def def"; gap: 2px 10px; align-items: baseline; }
.mid .wd-list.pgcol .wl { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "w py pg lv" "def def def def"; }
.mid .wl .w { grid-area: w; } .mid .wl .py { grid-area: py; } .mid .wl .lvn { grid-area: lv; } .mid .wl .def { grid-area: def; }
.mid .wl .pg { grid-area: pg; justify-self: end; }
.narrow .wp-w { font-size: 32px; }
@media (max-width: 860px) { .wd-top h1 { font-size: 24px; } }

/* ---------- reviewing saved words (Plus; review.js; design: WordsReview.dc.html and ReviewSession.dc.html) ----------
   one colour per pile: teal the review pile, violet learning, lime today */
:root { --rev: #0f766e; --lrn: #5b3cc4; --lrnbg: #f2eefd; --ok: #1d6b3f; --okbg: #e7f3eb; --nobg: #fbeef2; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kick { font: 600 11px var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.btn.big { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 999px; }
.btn.big .ico { width: 15px; height: 15px; }

/* the review column on the Words page (WordsRedo.dc.html, B) */
.rvs-today { background: var(--bg); padding: 20px 22px; }
.rvs-sec { padding: 18px 22px; border-top: 1px solid var(--line); }
.rvs-sec.first { border-top: 0; }
.rvs-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rvs-go { width: 100%; margin-top: 16px; }
.rvs-piles { display: grid; margin: 8px -8px 0; }
.rvs-pile { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 10px; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.rvs-pile:hover { background: #fafaf9; }
.rvs-pile.on { background: var(--bg); font-weight: 600; }
.rvs-pile .sw { margin: 0; }
.rvs-pile b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.rvs-slim { display: flex; align-items: center; gap: 10px; background: var(--bg); padding: 12px 14px 12px 18px; font-size: 14px; border-radius: 18px; margin-bottom: 12px; }
.rvs-slim b { font-weight: 600; }
.rvs-slim .rvb-tick { width: 24px; height: 24px; }
.rvb-num { font: 500 40px/1.1 var(--ui); letter-spacing: -0.02em; margin-top: 6px; }
.rvb-num small { font-size: 17px; color: var(--soft); font-weight: 500; letter-spacing: 0; }
.rvb-split { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--soft); }
.rvb-split b { color: var(--ink); font-weight: 600; }
.rvb-acts { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.rvb-done { display: flex; align-items: center; gap: 12px; margin-top: 8px; font: 500 26px var(--ui); letter-spacing: -0.01em; }
.rvb-tick, .rvb-check { border-radius: 50%; background: var(--rev); display: grid; place-items: center; flex: none; }
.rvb-tick { width: 30px; height: 30px; }
.rvb-tick svg, .rvb-check svg { width: 55%; height: 55%; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.rvb-new select { border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 12px; background: #fff; cursor: pointer; }
.rvb-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin-top: 12px; background: #ededeb; }
.rvb-bar i, .sw { display: block; }
.rvb-bar i.rev, .sw.rev { background: var(--rev); }
.rvb-bar i.lrn, .sw.lrn { background: #9a7cf0; }
.rvb-bar i.new, .sw.new { background: #ededeb; }
.sw.new { box-shadow: inset 0 0 0 1px #d8d8d5; }
.sw { width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; display: inline-block; }
.rvb-week, .rvb-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rvb-week { align-items: end; height: 58px; margin-top: 12px; }
.rvb-week i { display: block; background: var(--rev); border-radius: 3px; }
.rvb-week i.lt { background: #dcdcd9; }
.rvb-days { font-size: 10px; color: var(--soft); text-align: center; margin-top: 4px; }
.rvb-wk { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.rvb-wk b { font-weight: 600; }
.rvb-title { font: 500 24px/1.25 var(--ui); letter-spacing: -0.01em; margin-top: 6px; }
.rvb-list { display: grid; gap: 8px; margin-top: 12px; font-size: 14px; }
.rvb-list > div { display: flex; gap: 10px; align-items: flex-start; }
.rvb-check { width: 18px; height: 18px; margin-top: 1px; }
.rvb-ghost { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: #fafaf9; opacity: 0.75; }
.rvb-ghost .wp-sent { margin: 0 0 6px; }
.rvb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.rvb-opts span { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 13px; background: #fff; }
/* the Progress column */
.wd-list.pgcol .wl-h, .wd-list.pgcol .wl { grid-template-columns: 84px 116px minmax(0, 1fr) 128px 48px; }
.pg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--soft); white-space: nowrap; }
.pg.rev { color: var(--rev); }
.pg.rev.due { font-weight: 600; }
.pg.lrn { color: var(--lrn); }
.pg-new { font-size: 11px; border: 1px dashed #c9c9c6; border-radius: 999px; padding: 0 8px; color: var(--soft); }
.pg-dots { display: inline-flex; gap: 4px; }
.pg-dots i { width: 8px; height: 8px; border-radius: 50%; background: #dededb; }
.pg-dots i.ok { background: var(--lrn); }
.narrow .wl .pg { grid-area: pg; justify-self: end; }
.narrow .wd-list.pgcol .wl { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "w py pg" "def def def"; }
.narrow .wd-list.pgcol .wl .lvn { display: none; }
}

/* the review screen (/#review) */
.rv-screen { display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
.rv-head { display: flex; align-items: center; gap: 18px; }
.rv-back { color: var(--soft); font-size: 14px; white-space: nowrap; }
.rv-back:hover { color: var(--ink); }
.rv-prog { flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-prog .tr { flex: 1; height: 6px; border-radius: 3px; background: #eeeeed; overflow: hidden; }
.rv-prog .tr i { display: block; height: 100%; background: var(--rev); border-radius: 3px; transition: width 0.3s; }
.rv-piles { display: flex; gap: 6px; }
.rv-piles span { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--soft); white-space: nowrap; }
.rv-piles b { color: var(--ink); font-weight: 600; }
.rv-end { min-height: 36px; padding: 0 14px; font-size: 13px; }
/* the word in full comes in on the right after an answer; its column is kept from the start, so the card doesn't move */
.rv-stage { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; margin-top: 26px; align-items: start; }
.rv-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 10px 10px; min-width: 0; }
.rv-meta { display: flex; align-items: center; gap: 10px; justify-content: center; }
.rv-chip { font: 600 11px var(--ui); letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; background: var(--lrnbg); color: var(--lrn); }
.rv-chip.new { background: #fff; box-shadow: inset 0 0 0 1px #c9c9c6; color: var(--lrn); }
.rv-chip.rev { background: var(--rev); color: #fff; }
.rv-dots { display: inline-flex; gap: 5px; }
.rv-dots i { width: 9px; height: 9px; border-radius: 50%; background: #dededb; }
.rv-dots i.ok { background: var(--lrn); }
.rv-dots i.at { background: #fff; box-shadow: inset 0 0 0 2px var(--lrn); }
/* a right answer: this step's circle fills up, with a small pop (review.js, dots) */
.rv-dots i.at.full { box-shadow: inset 0 0 0 5px var(--lrn); }
.rv-dots i.at.fill { animation: rv-fill 0.5s cubic-bezier(0.3, 0.7, 0.4, 1) forwards; }
@keyframes rv-fill {
  0% { box-shadow: inset 0 0 0 2px var(--lrn); transform: scale(1); }
  60% { box-shadow: inset 0 0 0 5px var(--lrn); transform: scale(1.5); }
  100% { box-shadow: inset 0 0 0 5px var(--lrn); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .rv-dots i.at.fill { animation: none; box-shadow: inset 0 0 0 5px var(--lrn); } }
.rv-src { font-size: 12px; color: var(--soft); margin-top: 22px; }
.rv-sline { display: flex; align-items: center; gap: 18px; margin-top: 10px; justify-content: center; max-width: 900px; }
.rv-play { width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; border: 0; cursor: pointer; }
.rv-play .ico { width: 20px; height: 20px; }
.rv-sent { font: 400 30px/1.6 var(--zh); letter-spacing: 0.03em; margin: 0; text-align: left; }
.rv-sent mark { background: var(--lime); border-radius: 5px; padding: 0 3px; color: var(--ink); }
/* a video word's line: YouTube's player in a layer of its own, laid over its place on the card (review.js) */
.rv-vslot { width: 400px; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: #111; margin-top: 10px; flex: none; }
.rv-vlayer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 30; }
.rv-vwrap { position: absolute; border-radius: 14px; overflow: hidden; background: #000; }
.rv-vwrap.off { left: -10000px !important; top: 0 !important; width: 400px; height: 225px; }
.rv-vwrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.rv-vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.35); pointer-events: none; }
.rv-vbar i { display: block; height: 100%; width: 0; background: #fff; }
/* Play again sits under the video, never on it (Kobe, 21 Nov) */
.rv-vagain { margin-top: 10px; min-height: 34px; padding: 0 14px; font-size: 13px; }
.rv-en { margin: 10px 0 0; font-size: 15px; color: #444; max-width: 640px; }
.rv-q { font-size: 17px; margin-top: 22px; }
.rv-q b { font-family: var(--zh); font-weight: 600; }
.rv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 720px; margin-top: 18px; }
.rv-op { display: flex; align-items: center; gap: 12px; min-height: 62px; border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px; font-size: 15px; background: #fff; text-align: left; color: var(--ink); cursor: pointer; }
.rv-op:hover:not(:disabled) { border-color: var(--ink); }
.rv-op:disabled { cursor: default; }
.rv-op.ok { background: var(--okbg); border-color: #9fcfb0; color: var(--ok); font-weight: 600; }
.rv-op.no { background: var(--nobg); border-color: #e7b3c4; color: var(--bad); }
.rv-op.dim { opacity: 0.45; }
.rv-op .mk { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-size: 12px; }
.rv-op.ok .mk { background: var(--ok); }
.rv-op.no .mk { background: var(--bad); }
.rv-screen .key { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; border: 1px solid #d8d8d5; font: 600 11px var(--ui); color: var(--soft); background: #fff; }
.rv-screen .btn.black .key { background: transparent; border-color: rgba(255,255,255,0.35); color: rgba(255,255,255,0.8); }
.rv-hint { font-size: 12px; color: var(--soft); margin-top: 18px; display: flex; gap: 14px; align-items: center; justify-content: center; }
.rv-next { margin-top: 22px; min-height: 54px; padding: 0 26px; font-size: 15px; border-radius: 999px; }
.rv-big { font: 600 84px/1.1 var(--zh); letter-spacing: 0.05em; margin: 18px 0 0; }
/* pinyin above each character (review.js, rubyHtml), as on the homepage's lines: each character in a box as wide as
   its syllable, the syllable drawn above it; the row is kept while it's empty (before Show), so nothing moves */
.rv-screen .zi { display: inline-block; position: relative; text-align: center; line-height: 1.15; padding-top: var(--pyh, 14px); }
.rv-screen .zi::before { content: attr(data-py); display: block; height: 0; overflow: hidden; visibility: hidden; font: 400 var(--pys, 11px)/1.2 var(--ui); letter-spacing: 0; white-space: nowrap; margin: 0 1px; }
.rv-screen .zi::after { content: attr(data-py); position: absolute; top: 0; left: 50%; transform: translateX(-50%); font: 400 var(--pys, 11px)/1.2 var(--ui); color: var(--pyc, var(--soft)); letter-spacing: 0; white-space: nowrap; }
.rv-big { --pys: 22px; --pyh: 30px; --pyc: var(--ink); }
.rp-w { --pys: 15px; --pyh: 20px; --pyc: var(--ink); }
.rp-ex .zh { --pys: 11px; --pyh: 13px; }
.rv-mean { font-size: 17px; margin-top: 6px; }
.rv-think { font-size: 14px; margin-top: 14px; }
.rv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 560px; margin-top: 22px; }
.rv-two .btn { min-height: 64px; border-radius: 18px; font-size: 16px; }
.rv-card .error { margin-top: 14px; }
.rv-panel { border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px; max-height: calc(100vh - 200px); overflow-y: auto; position: sticky; top: 24px; }
.rp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rp-w { font: 600 44px/1.1 var(--zh); letter-spacing: 0.04em; }
.rp-hsk { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rv-hsk { font-size: 11px; font-weight: 600; color: var(--hsk); background: rgba(184,50,90,0.08); border-radius: 999px; padding: 2px 9px; }
.rv-hsk.none { color: var(--soft); background: var(--bg); }
.rv-panel ol { margin: 12px 0 0; padding-left: 20px; line-height: 1.6; font-size: 15px; }
.rp-mw { margin-top: 10px; font-size: 14px; }
.rp-en { margin: 4px 0 0; font-size: 13px; color: #555; }
.rp-ex { padding: 8px 0; }
.rp-ex + .rp-ex { border-top: 1px solid var(--line); }
.rp-ex .zh { font: 400 16px/1.5 var(--zh); }
.rp-ex mark { background: var(--lime); border-radius: 4px; padding: 0 2px; color: var(--ink); }
.rp-exen { font-size: 13px; color: #555; }
.rv-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 0; }
.rv-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--rev); display: grid; place-items: center; }
.rv-tick svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rv-done h1 { font: 500 34px var(--ui); letter-spacing: -0.02em; margin: 18px 0 0; }
.rv-streak { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; }
.rv-streak .fl { width: 18px; height: 18px; fill: var(--flame); }
.rv-tiles { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.rv-tiles > div { width: 180px; border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-align: left; }
.rv-tiles b { display: block; font: 500 30px var(--ui); letter-spacing: -0.01em; }
.rv-tom { font-size: 14px; margin-top: 20px; }
.rv-acts { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 980px) {
  .rv-stage { grid-template-columns: minmax(0, 1fr); }
  .rv-panel { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .rv-piles { display: none; }
  .rv-head { gap: 10px; }
  .rv-card { padding-top: 18px; }
  .rv-sline { flex-direction: column; gap: 12px; }
  .rv-sent { font-size: 21px; text-align: center; }
  .rv-opts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rv-op { min-height: 52px; }
  .rv-big { font-size: 60px; }
  .rv-hint, .rv-screen .key { display: none; }
  .rv-next, .rv-two { width: 100%; }
}

/* ---------- smaller screens: the menu becomes a bar on top ---------- */
@media (max-width: 860px) {
  .shell { flex-direction: column; padding: 12px; gap: 12px; }
  .side { width: auto; position: static; height: auto; max-height: none; padding: 10px 12px 6px; align-self: stretch; min-width: 0; }
  /* the shows and channels you follow stay in the wide menu only: on the bar they take too much room */
  .side .lab, .side .goal-box, .side .me, #shows, #chans, .collapse { display: none; }
  .goal-pill { display: inline-flex; }
  .goal-pill + .me-mini, .goal-pill + .find-mini, .find-mini + .me-mini { margin-left: 8px; }
  .me-mini { display: grid; }
  .find-mini { display: grid; }
  .side .find { display: none; }
  .acc-h1 { font-size: 22px; }
  .acc-head { margin-top: 14px; gap: 12px; }
  .acc-head .av { width: 52px; height: 52px; font-size: 20px; }
  .acc-out { padding: 0 11px; }
  .acc-out span { display: none; }
  .acc-grid { margin-top: 18px; gap: 12px; }
  .acc-side { gap: 12px; }
  .acc-plan, .acc-streak { padding: 16px; }
  .acc-sec { margin-top: 24px; }
  .acc-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px; }
  .acc-row.inline { grid-template-columns: minmax(0, 1fr) auto; }
  .acc-row input, .acc-row .dd { width: 100%; }
  .acc-row .seg { display: flex; }
  .acc-row .seg button { flex: 1; padding: 8px 6px; }
  .au-page { padding: 12px; }
  .au-card { padding: 22px; border-radius: 22px; }
  .au-card.wide { grid-template-columns: minmax(0, 1fr); }
  .au-card h1 { font-size: 24px; margin-top: 20px; }
  .side nav { display: flex; gap: 4px; overflow-x: auto; margin-top: 12px; }
  .side nav .nav { width: auto; flex: none; }
  .side nav .soon { display: none; }
  .collapsed .side { width: auto; padding: 14px; }
  .collapsed .side .t, .collapsed .side .find input, .collapsed .side .find .t, .collapsed .side .brand span { display: revert; }
  .collapsed .find { justify-content: flex-start; padding: 10px 10px 10px 12px; }
  .find .kbd { display: none; }
  .collapsed .brand-row { flex-direction: row; gap: 0; }
  .main { padding: 22px 16px; border-radius: 20px; }
}
/* a phone: the menu's pages as icons only, so they fit without scrolling (the names stay for screen readers) */
@media (max-width: 640px) {
  .side nav { overflow: visible; gap: 4px; }
  /* the buttons share the row equally (no loose gaps between them); .shell .side beats the pages' own flex: none */
  .shell .side nav > .nav { flex: 1 1 0; min-width: 0; min-height: 44px; justify-content: center; padding: 0; }
  .side nav .nav .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .side nav .nav .ico { width: 22px; height: 22px; }
}

/* ---------- the search pop-up (search.js; design: design/homepage/project/SearchPopup.dc.html, layout B) ---------- */
html.sq-open { overflow: hidden; }
.sq {
  width: min(1040px, calc(100vw - 32px)); max-width: none; max-height: min(760px, calc(100vh - 64px)); margin: 7vh auto auto;
  padding: 0; border: 0; border-radius: 22px; background: #fff; color: var(--ink); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.sq:not([open]) { display: none; }
.sq::backdrop { background: rgba(17, 17, 17, 0.40); }
.sq.narrow { width: min(720px, calc(100vw - 32px)); }
.sq-in { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 20px; flex: none; }
.sq-ico .ico { width: 22px; height: 22px; color: var(--soft); display: block; }
.sq-in input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 400 21px var(--zh); color: var(--ink); padding: 0; }
.sq-in input::placeholder { color: #8a8a8a; font-family: var(--ui); }
.sq-x { border: 0; background: var(--bg); color: var(--soft); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.sq-x:hover { color: var(--ink); }
.sq-x .ico { width: 15px; height: 15px; }
.sq-cancel { display: none; border: 0; background: none; font: 500 15px var(--ui); color: var(--ink); padding: 4px; cursor: pointer; }
.sq-bar { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px; flex: none; }
.sq.link .sq-bar { display: none; }
.sq-seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 3px; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sq-seg button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; font: 500 13px var(--ui); color: var(--soft); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }
.sq-seg button:hover { color: var(--ink); }
.sq-seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10); }
.sq-seg .ico { width: 15px; height: 15px; }
.sq-seg .n { font-weight: 500; color: var(--mute); font-variant-numeric: tabular-nums; }
.sq-zi { font-size: 13px; line-height: 1; }
.sq-fbtn { display: none; margin-left: auto; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font: 600 13px var(--ui); background: #fff; color: var(--ink); white-space: nowrap; flex: none; cursor: pointer; }
.sq-fbtn .ico { width: 15px; height: 15px; }
.sq-fbtn .c { background: var(--ink); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; }
.sq-fl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); background: #fcfcfb; flex: none; }
.sq .tag { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--ui); padding: 5px 11px; white-space: nowrap; }
.sq .tag:hover { border-color: #d5d5d2; color: var(--ink); }
.sq .tag.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.sq .tag .ico { width: 13px; height: 13px; }
.sq-clr { margin-left: auto; font-size: 12px; color: var(--soft); border: 0; background: none; cursor: pointer; padding: 4px; }
.sq-clr:hover { color: var(--ink); }
.sq-more { margin-left: 6px; }
.sq-body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; border-top: 1px solid var(--line); flex: 1; min-height: 0; }
.sq.narrow .sq-body, .sq.link .sq-body, .sq.nopv .sq-body { grid-template-columns: minmax(0, 1fr); }
.sq.narrow .sq-pv, .sq.link .sq-pv, .sq.nopv .sq-pv { display: none; }
.sq-res { padding: 4px 8px 10px; overflow-y: auto; min-height: 120px; }
.sq-pv { border-left: 1px solid var(--line); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.sq-gh { display: flex; align-items: baseline; gap: 8px; font: 600 11px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 10px 4px; }
/* With At your level on: the results without a level yet, under their own heading */
.sq-sub { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 6px 10px 0; padding: 10px 0 4px; border-top: 1px solid var(--line); font: 600 11px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; }
.sq-note { text-transform: none; letter-spacing: 0; font: 400 12px var(--ui); color: var(--soft); }
.sq-see { margin-left: auto; text-transform: none; letter-spacing: 0; font: 500 12px var(--ui); color: var(--soft); background: none; border: 0; cursor: pointer; padding: 0; }
.sq-see:hover { color: var(--ink); text-decoration: underline; }
.sq-r { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 10px; border-radius: 12px; width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.sq-r.sel { background: var(--bg); }
.sq-cw { display: flex; justify-content: center; }
.sq-cv { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font: 600 17px var(--zh); color: #fff; flex: none; position: relative; overflow: hidden; }
.sq-cv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sq-cv.vid { width: 72px; height: 40px; border-radius: 8px; }
.sq-cv.vid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.4)); }
.sq-cv .dur { position: absolute; right: 4px; bottom: 2px; z-index: 1; font: 600 10px var(--ui); color: #fff; }
.sq-cv.wd { background: var(--bg); color: var(--ink); font-size: 18px; }
.sq-cv.go { background: var(--bg); color: var(--ink); }
.sq-tx { min-width: 0; }
.sq-t { display: block; font: 600 14px/1.4 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-t.zh { font-family: var(--zh); }
.sq-py { font: 400 13px var(--ui); color: var(--soft); }
.sq-m { display: block; font-size: 12px; color: var(--soft); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-rt { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.sq-lv { display: inline-flex; font: 600 11px var(--ui); color: var(--hsk, #b8325a); background: rgba(184, 50, 90, 0.08); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.sq-lrn { display: inline-flex; font: 500 11px var(--ui); color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.sq mark { background: rgba(228, 239, 74, 0.75); color: inherit; border-radius: 3px; padding: 0 1px; }
.sq kbd { display: inline-block; font: 600 11px/1.5 var(--ui); border: 1px solid #dddddb; border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: #fff; color: var(--ink); }
.sq-wait { padding: 14px 10px; color: var(--soft); font-size: 13px; }
.sq-empty { padding: 24px 14px 20px; }
.sq-empty > b { display: block; font-size: 16px; font-weight: 600; }
.sq-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.sq-tip { margin-top: 12px; }
.sq-tip b { color: var(--ink); font-weight: 600; }
.sq .pill { border-radius: 999px; }
.sq .btn .play { width: 12px; height: 12px; fill: currentColor; }
.sq-goto { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 10px 8px; }
/* the preview */
.sq-thumb { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 14px; position: relative; overflow: hidden; color: #fff; font: 600 28px var(--zh); flex: none; }
.sq-thumb img, .sq-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sq-thumb .pl { position: relative; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); display: grid; place-items: center; }
.sq-thumb .pl .play { width: 18px; height: 18px; fill: #111; margin-left: 3px; }
.sq-thumb .dur { position: absolute; right: 10px; bottom: 8px; font: 600 12px var(--ui); color: #fff; background: rgba(0, 0, 0, 0.5); border-radius: 6px; padding: 1px 6px; }
.sq-art { align-self: center; width: 160px; height: 160px; border-radius: 18px; position: relative; overflow: hidden; display: grid; place-items: center; color: #fff; font: 600 48px var(--zh); flex: none; }
.sq-word { height: 150px; border-radius: 18px; background: var(--bg); display: grid; place-items: center; font-size: 56px; font-weight: 500; flex: none; }
.sq-pv-h { display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 0; }
.sq-pv-h h3 { font: 600 17px/1.4 var(--ui); margin: 0; }
.sq-pv-h h3.zh { font-family: var(--zh); }
.sq-ch { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sq-av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 10px var(--ui); color: #fff; flex: none; }
.sq-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sq-facts > div { background: var(--bg); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.sq-facts .k { display: block; font-size: 11px; color: var(--soft); }
.sq-facts .v { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; font-size: 13px; line-height: 1.3; overflow: hidden; overflow-wrap: anywhere; }
.sq-facts a.v { text-decoration: underline; text-underline-offset: 0.2em; }
.sq-go { width: 100%; padding: 10px; }
.sq-pv-none { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--soft); font-size: 13px; text-align: center; }
.sq-pv-none .ico { width: 26px; height: 26px; }
/* a pasted YouTube link */
.sq-link { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px 10px 10px; }
.sq-link-tx { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sq-link-tx > b { font-size: 16px; line-height: 1.4; }
.sq-link .sq-btns { margin-top: 6px; }
.sq-err { color: var(--bad); font-size: 13px; }
/* episodes and channels (design: EpisodeSearch.dc.html, round 2) */
.sq-cv.ch { border-radius: 50%; }
.sq-trn { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font: 500 12px var(--ui); white-space: nowrap; }
.sq-trn i { width: 7px; height: 7px; border-radius: 50%; background: #b9c41f; box-shadow: 0 0 0 3px rgba(228, 239, 74, 0.5); }
.sq-fol { display: inline-flex; font: 600 11px var(--ui); color: var(--ink); background: var(--bg); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.sq-none { padding: 4px 10px 10px; font-size: 12px; color: var(--soft); }
.sq-loading { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.sq-r.busy { opacity: 0.6; pointer-events: none; }
.sq-rt .sq-note, .sq-rt .sq-err { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-spin.dark { border-color: #dcdcda; border-top-color: var(--ink); flex: none; }
.sq-ep-h { display: flex; gap: 14px; align-items: flex-start; }
.sq-art.sq-art-s { align-self: flex-start; width: 112px; height: 112px; border-radius: 16px; font-size: 40px; }
.sq-art.sq-art-s.ch { border-radius: 50%; }
.sq-ep-h .sq-pv-h { min-width: 0; }
.sq-showlink { font-size: 13px; text-decoration: underline; text-underline-offset: 0.2em; }
.sq-desc { margin: 0; font-size: 13px; color: #444; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sq-two { display: flex; gap: 8px; }
.sq-two .sq-go { flex: 1; width: auto; }
.sq-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: sq-spin 0.8s linear infinite; }
@keyframes sq-spin { to { transform: rotate(360deg); } }
/* a filter's menu */
.sq-menu { position: absolute; z-index: 5; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12); padding: 6px; min-width: 220px; max-width: 320px; max-height: 320px; overflow-y: auto; }
.sq-menu .it { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; width: 100%; border: 0; background: none; font: 13px var(--ui); color: var(--ink); text-align: left; cursor: pointer; }
.sq-menu .it:hover, .sq-menu .it:focus-visible { background: #fafaf9; }
.sq-menu .it.on { background: var(--bg); font-weight: 600; }
.sq-menu .it .n { margin-left: auto; color: var(--mute); font-weight: 400; font-variant-numeric: tabular-nums; }
.sq-mh { font-size: 12px; color: var(--soft); padding: 6px 8px; }
.sq-mlv { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 8px 8px; }
/* phone: the whole screen; the filters in a sheet */
.sq-sheet-wrap { position: absolute; inset: 0; background: rgba(17, 17, 17, 0.38); z-index: 6; display: flex; align-items: flex-end; }
.sq-sheet { width: 100%; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 16px 18px; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16); max-height: 85%; overflow-y: auto; }
.sq-grab { width: 40px; height: 4px; border-radius: 2px; background: #dcdcda; margin: 0 auto 10px; }
.sq-sheet-h { display: flex; align-items: center; }
.sq-sheet-h b { font-size: 16px; }
.sq-sh { font: 600 12px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; margin: 16px 0 8px; }
.sq-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sq-done { width: 100%; margin-top: 18px; padding: 12px; }
@media (max-width: 640px) {
  .sq, .sq.narrow { width: 100vw; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .sq-seg .ico, .sq-zi { display: none; }
  .sq-seg button { padding: 6px 10px; }
  .sq-in { padding: 14px 14px 10px; }
  .sq-in input { font-size: 18px; }
  .sq-x { display: none; }
  .sq-cancel { display: block; }
  .sq-bar { padding: 0 14px 10px; }
  .sq-fbtn { display: inline-flex; }
  .sq-fbtn[hidden] { display: none; }
  .sq-r { grid-template-columns: 64px minmax(0, 1fr); padding: 7px 6px; }
  .sq-r .sq-rt { display: none; }
  .sq-cv.vid { width: 64px; height: 36px; }
  .sq-link { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .sq-spin { animation: none; } }

/* ---------- the welcome steps for a new account (welcome.html, drawn by welcome.js; plans/16-onboarding.md) ----------
   Design: design/homepage/project/Onboarding.dc.html; the Follow list is layout B of OnboardingFollowOptions.dc.html.
   Picked tiles are light grey with a dark outline (not lime, not black: Kobe, 20 Nov). */
.wel-page { min-height: 100vh; padding: 0 24px 32px; }
.wel-top { height: 72px; display: flex; align-items: center; justify-content: space-between; max-width: 1360px; margin: 0 auto; }
.wel-brand { display: flex; align-items: center; gap: 8px; font: 600 17px var(--ui); width: 180px; }
.wel-brand svg { width: 24px; height: 24px; }
.wel-spacer { width: 180px; }
.wel-prog { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.wel-prog li { width: 120px; font-size: 12px; color: var(--soft); }
.wel-prog li::before { content: ""; display: block; height: 4px; border-radius: 2px; background: #cfcfce; margin-bottom: 7px; }
.wel-prog li.done, .wel-prog li.on { color: var(--ink); }
.wel-prog li.on { font-weight: 600; }
.wel-prog li.done::before, .wel-prog li.on::before { background: var(--ink); }
/* every step's card has the same height, with the buttons always in the same place */
.wel-card { width: 100%; max-width: 960px; height: min(672px, calc(100vh - 96px)); min-height: 520px; margin: 12px auto 0; background: #fff;
  border-radius: 26px; padding: 36px 48px 28px; display: flex; flex-direction: column; }
.wel-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: flex-start; }
.wel-body > * { align-self: stretch; }
.wel-body > .wel-hi, .wel-body > .wel-seg { align-self: flex-start; }
.wel-hi { display: inline-block; background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.wel-h { font: 500 30px/1.2 var(--ui); letter-spacing: -0.02em; margin: 0 0 18px; outline: none; }
.wel-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 20px; margin-top: 16px; border-top: 1px solid var(--line); }
.wel-foot-r { display: flex; align-items: center; gap: 12px; }
.wel-foot .btn { min-height: 44px; padding: 10px 20px; }
.wel-foot .btn.wel-back { border-color: transparent; padding-left: 4px; display: inline-flex; align-items: center; gap: 6px; }
.wel-back .ico { width: 16px; height: 16px; }
/* segmented choices: grey, the picked one white */
.wel-seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.wel-seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px 14px; font: 500 13px var(--ui); color: var(--soft); cursor: pointer; min-height: 36px; }
.wel-seg button:hover { color: var(--ink); }
.wel-seg button[aria-checked="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
/* tiles: level, script, topic, goal */
.wel-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: 16px; padding: 14px 16px; cursor: pointer; color: var(--ink); }
.wel-tile:hover { border-color: #d5d5d2; }
.wel-tile[aria-checked="true"], .wel-tile[aria-pressed="true"] { background: var(--bg); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.wel-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.wel-lv { min-height: 104px; }
.wel-lv b { font-size: 16px; font-weight: 600; }
.wel-lv .zh { font-size: 16px; margin-top: auto; letter-spacing: 0.02em; }
.wel-lv.unsure { background: var(--bg); border-style: dashed; border-color: #cfcfce; justify-content: center; }
.wel-lv.unsure[aria-checked="true"] { border-style: solid; border-color: var(--ink); }
.wel-scripts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wel-sc { padding: 16px 20px; }
.wel-sc .big { font-size: 22px; font-weight: 500; }
.zh-t { font-family: "ZH Punct", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", var(--zh); }
.wel-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wel-scripts + .wel-row { margin-top: 8px; }
.wel-row .st { font-weight: 600; }
.wel-prev { margin-top: 10px; background: var(--bg); border-radius: 16px; padding: 16px 20px; }
/* its title above the grey box, like the rows above it (Show pinyin…, Show English…) */
.wel-prev-h { display: block; font-weight: 600; color: var(--ink); margin-top: 18px; }
.wel-prev .line { font-size: 22px; line-height: 1.9; margin: 0; }
.wel-prev rt { font: 12px var(--ui); color: var(--soft); }
.wel-prev .above, .wel-prev .above rt { color: var(--hsk); }
.wel-prev .en { color: var(--soft); margin: 0; }
.wel-topics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.wel-tp { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; min-height: 62px; border-radius: 14px; }
.wel-tp .ico { width: 22px; height: 22px; }
.wel-tp b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.wel-tp .zh { display: block; font-size: 12px; color: var(--soft); }
.wel-goals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 6px; width: 100%; }
.wel-goal { padding: 24px 22px 20px; gap: 8px; min-height: 168px; justify-content: space-between; }
.wel-goal b { font: 500 44px/1 var(--ui); letter-spacing: -0.02em; }
.wel-goal .lbl { font-size: 14px; }
/* a saying for the level studied for, in the space under the goals */
.wel-say { margin: auto 0; width: 100%; text-align: center; padding: 24px 0; }
.wel-say p { margin: 0; }
/* what it is and why it's there: a wish for the way to your level */
.wel-say-h { display: block; margin-bottom: 12px; font-size: 15px; color: #4a4a4a; }
.wel-say .zh, .wel-say .zh-t { font-size: 48px; line-height: 1.3; letter-spacing: 0.08em; color: var(--ink); }
.wel-say .py { margin-top: 8px; font-size: 15px; color: var(--soft); }
.wel-say figcaption { margin-top: 4px; font-size: 14px; color: var(--soft); }
/* the Follow list: rows on the left, the one you point at or click on the right (on a phone: a sheet) */
.wel-lp { display: grid; grid-template-columns: 400px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 28px; align-items: start; flex: 1; min-height: 0; }
.wel-card[data-step="list"] .wel-body { overflow: hidden; }
.wel-lp > .wel-list { max-height: 100%; overflow: auto; }
.wel-list { display: flex; flex-direction: column; gap: 2px; }
/* a row: pointing at it shows it on the right, clicking it follows it (the whole row is the follow button) */
.wel-li { display: flex; align-items: center; border-radius: 12px; border: 1px solid transparent; width: 100%; }
.wel-li-f { display: flex; align-items: center; gap: 12px; padding: 8px 10px; flex: 1; min-width: 0; border: 0; border-radius: 12px;
  background: transparent; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
/* the › that opens the row as a sheet: phones only */
.wel-li-more { display: none; width: 36px; height: 36px; flex: none; border: 0; background: transparent; border-radius: 50%; place-items: center; cursor: pointer; color: var(--soft); }
.wel-li-more .ico { width: 16px; height: 16px; transform: rotate(180deg); }
.wel-li:hover { background: #fafaf9; }
.wel-li[aria-current="true"] { background: var(--bg); border-color: #d6d6d5; }
.wel-li .tx { flex: 1; min-width: 0; }
.wel-li .t { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--ui), var(--zh); }
.wel-ok { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; }
.wel-ok .ico { width: 12px; height: 12px; stroke-width: 2.4; }
.wel-ok.off { background: transparent; border: 1.5px solid #cfcfce; }
.wel-ok.off .ico { display: none; }
.wel-cov { flex: none; border-radius: 10px; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 600; font-family: var(--zh); background: var(--bg); }
.wel-cov.ch { border-radius: 50%; }
.wel-kind { display: flex; width: max-content; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #3d3d3d; background: var(--bg);
  border-radius: 6px; padding: 1px 7px 1px 5px; margin-top: 3px; }
.wel-kind svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wel-pv { background: var(--bg); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; min-height: min(380px, 100%); max-height: 100%; overflow: auto; position: relative; }
.wel-pv .wel-kind { background: #fff; }
.wel-pv-hd { display: flex; gap: 16px; align-items: center; }
.wel-pv-hd .nm { flex: 1; min-width: 0; }
.wel-pv-hd > .wel-fol { align-self: flex-start; width: auto; min-width: 116px; flex: none; }
.wel-pv-name { font: 600 20px/1.3 var(--ui); font-family: var(--ui), var(--zh); }
.wel-desc { font-size: 13px; color: #4a4a4a; line-height: 1.45; margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-family: var(--ui), var(--zh); }
/* the description in the panel: six lines, then "… read more" over the end of the last one; opened, all of it scrolls */
.wel-dw { position: relative; min-height: 0; }
.wel-dw:not(.open) .wel-desc { max-height: 8.7em; overflow: hidden; }
.wel-dw.open { overflow: auto; scrollbar-width: thin; padding-right: 4px; }
.wel-more { position: absolute; right: 0; bottom: 0; border: 0; padding: 0 0 0 36px; font: 13px/1.45 var(--ui); color: var(--ink); cursor: pointer;
  background: linear-gradient(to right, rgba(244, 244, 243, 0), var(--bg) 30px); }
.wel-more u { text-underline-offset: 2px; }
.wel-pv-foot { margin-top: auto; }
.wel-fol { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d6d6d5; background: #fff; border-radius: 999px;
  padding: 7px 10px; font: 600 13px var(--ui); color: var(--ink); cursor: pointer; min-height: 40px; width: 160px; }
.wel-fol .ico { width: 14px; height: 14px; stroke-width: 2; }
.wel-fol[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.wel-empty { background: var(--bg); border-radius: 16px; padding: 20px; max-width: 560px; }
.wel-empty p { color: var(--soft); margin: 4px 0 14px; }
.wel-page .skel { background: linear-gradient(90deg, #f3f3f2, #fafaf9, #f3f3f2); border-radius: 12px; }
.wel-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.wel-sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 20; }
.wel-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: #fff; border-radius: 22px 22px 0 0; padding: 24px 20px 28px;
  display: flex; flex-direction: column; gap: 12px; max-height: 85vh; overflow: auto; }
.wel-sheet .wel-desc { max-height: none; }
.wel-sheet .wel-fol { width: 100%; }
@media (max-width: 1100px) {
  .wel-lp { grid-template-columns: 320px minmax(0, 1fr); }
  .wel-topics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* a narrow window: one column, the card fills the screen, the buttons stay at the bottom */
@media (max-width: 760px) {
  .wel-page { padding: 0; background: #fff; }
  .wel-top { height: auto; flex-wrap: wrap; padding: 16px 20px 0; gap: 12px; }
  .wel-spacer { display: none; }
  .wel-prog { order: 3; width: 100%; gap: 6px; }
  .wel-prog li { flex: 1; width: auto; font-size: 0; }
  .wel-card { height: auto; min-height: calc(100vh - 80px); border-radius: 0; padding: 18px 20px 0; margin: 0; }
  .wel-body { overflow: visible; }
  .wel-h { font-size: 24px; }
  .wel-foot { position: sticky; bottom: 0; background: #fff; margin: 16px -20px 0; padding: 12px 20px 20px; }
  .wel-foot .btn { padding: 10px 14px; }
  .wel-levels, .wel-topics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wel-lv { min-height: 78px; padding: 10px 12px; }
  .wel-lv .lbl { display: none; }
  .wel-lv .zh { font-size: 14px; }
  .wel-scripts { grid-template-columns: 1fr; }
  .wel-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wel-goals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wel-goal { min-height: 112px; padding: 16px 14px; }
  .wel-goal b { font-size: 32px; }
  .wel-goal .lbl { font-size: 12px; }
  .wel-say .zh, .wel-say .zh-t { font-size: 28px; }
  .wel-lp { display: block; }
  .wel-card[data-step="list"] .wel-body, .wel-lp > .wel-list { overflow: visible; max-height: none; }
  .wel-pv { display: none; }
  .wel-li-more { display: grid; }
  .wel-hide-s { display: none; }
}

/* ---------- welcome step 5, Try it: the first episode in a card like the homepage's top card ----------
   (site/welcome-try.js; design: design/homepage/project/OnboardingTryIt.dc.html; the homepage's own card is in
   site/index.html, "now playing") */
.wel-why { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 999px; padding: 4px 12px;
  font-size: 13px; font-weight: 600; margin-top: 12px; font-family: var(--ui), var(--zh); }
.wel-why svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wel-np { --unsaid: #bcbcb9; --hsk-unsaid: #dba3b5; margin-top: 18px; width: 100%; flex: 1; min-height: 0; max-height: 440px; border: 1px solid var(--line);
  border-radius: 22px; display: grid; grid-template-columns: 0.9fr 1.1fr; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.wel-np.video { grid-template-columns: 1fr 1fr; }
.wel-np-l { padding: 22px 24px; display: flex; flex-direction: column; min-width: 0; }
.wel-np.video .wel-np-l { padding: 0; }
.wel-np-r { background: #fafaf9; border-left: 1px solid var(--line); padding: 14px 24px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.wel-np-state { display: flex; align-items: center; gap: 8px; }
.wel-np .dot { width: 7px; height: 7px; border-radius: 50%; background: #c9c9c5; flex: none; }
.wel-np.playing .dot { background: var(--lime); box-shadow: 0 0 0 3px rgba(228,239,74,0.45); }
.wel-np-hd { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.wel-np .orb { width: 84px; height: 84px; border-radius: 50%; flex: none; overflow: hidden; background: radial-gradient(circle at 42% 38%, #fff 0, #e4e7df 50%, #b9cfa9 100%); }
.wel-np .orb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wel-np-title { display: block; font: 600 21px/1.25 var(--ui); font-family: var(--ui), var(--zh); letter-spacing: -0.01em; margin-top: 2px; overflow-wrap: anywhere; }
.wel-np-title.one { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wel-np-ctl { margin-top: auto; padding-top: 16px; }
.wel-np-v { aspect-ratio: 16 / 9; background: #000; position: relative; }
.wel-np-v iframe, .wel-np-v #wel-yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wel-np-err { position: absolute; inset: 0; margin: 0; padding: 20px; display: grid; place-content: center; text-align: center; color: #fff; background: #222; }
.wel-np-i { padding: 12px 22px 14px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wel-np .tl { position: relative; height: 18px; margin-top: 10px; display: flex; align-items: center; cursor: pointer; touch-action: pan-y; }
.wel-np .tl .tr { position: relative; width: 100%; height: 4px; border-radius: 2px; background: #e6e6e3; }
.wel-np .tl .played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--ink); }
.wel-np .tl .knob { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.18); transform: translate(-50%, -50%); }
.wel-np .tl:hover .tr { height: 6px; border-radius: 3px; }
.wel-np .tl-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--soft); margin-top: 4px; font-variant-numeric: tabular-nums; }
.wel-np .tl-times .np-cur { color: var(--ink); font-weight: 600; }
.wel-np .ctl { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.wel-np .ctl .btn { padding: 8px 11px; }
/* −5, play and +5 together on the left; speed and repeat sentence on the right */
.wel-np .ctl [data-np="rate"] { margin-left: auto; }
.wel-np .play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.wel-np .play svg { width: 18px; height: 18px; fill: #fff; }
/* the lines, as on the homepage: the one before, the current one (the word being said moves through it), then the
   ones to come; HSK words in colour, pinyin above, English under */
.wel-np .lines { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.wel-np .ln { display: block; padding: 7px 0; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; border-radius: 12px; flex: none; font: inherit; }
.wel-np .ln .txt { display: block; font: 400 18px/1.75 var(--zh); letter-spacing: 0.03em; color: #b0b0b0; }
.wel-np .ln.next .txt { color: var(--unsaid); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wel-np .ln:hover .txt { color: var(--ink); }
.wel-np .ln.now { background: #fff; border: 1px solid var(--line); margin: 2px -12px; padding: 8px 12px; width: calc(100% + 24px); cursor: default; }
.wel-np .ln.now .txt { color: var(--ink); }
.wel-np .ln .tk { transition: color 0.16s linear; }
.wel-np .ln.now .tk.at ~ .tk { color: var(--unsaid); }
.wel-np .ln .h { color: var(--hsk-unsaid); }
.wel-np .ln.now .h { color: var(--hsk); }
.wel-np .ln.now .tk.at ~ .tk .h { color: var(--hsk-unsaid); }
.wel-np .ln .en { display: block; font: 400 13px/1.45 var(--ui); color: #b0b0b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.wel-np .ln.next .en { color: var(--unsaid); }
.wel-np .ln.now .en { white-space: normal; color: #555; }
.wel-np .lines.fade::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(to top, #fafaf9, rgba(250,250,249,0)); pointer-events: none; }
.wel-np .lines.py .tk { display: inline-block; }
.wel-np .lines.py .zi { display: inline-block; position: relative; line-height: 1.3; text-align: center; padding-top: 13px; }
.wel-np .lines.py .zi::before { content: attr(data-py); display: block; height: 0; overflow: hidden; visibility: hidden; font: 400 11px/1.2 var(--ui); letter-spacing: 0; white-space: nowrap; margin: 0 1px; }
.wel-np .lines.py .zi::after { content: attr(data-py); position: absolute; top: 0; left: 50%; transform: translateX(-50%); font: 400 11px/1.2 var(--ui); color: var(--soft); letter-spacing: 0; white-space: nowrap; }
.wel-np .lines.py .ln.past .zi::after, .wel-np .lines.py .ln.next .zi::after, .wel-np .lines.py .ln.now .tk.at ~ .tk .zi::after { color: var(--unsaid); }
.wel-np .lines.py .ln .zi.h::after, .wel-np .lines.py .ln.now .tk.at ~ .tk .zi.h::after { color: var(--hsk-unsaid); }
.wel-np .lines.py .ln.now .zi.h::after { color: var(--hsk); }
.wel-card[data-step="try"] .wel-body { overflow: hidden; }
.wel-foot .btn .ico { width: 16px; height: 16px; }
@media (max-width: 760px) {
  /* A phone: the step is exactly one screen tall, so whatever is left under the episode and its controls goes to the
     lines; why this episode moves into the card (in place of the show's name), a video's title is left to YouTube's
     picture, and the three buttons share one row at the bottom */
  .wel-page:has(.wel-card[data-step="try"]) { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .wel-card[data-step="try"] { flex: 1; min-height: 0; height: auto; padding-top: 12px; }
  .wel-card[data-step="try"] .wel-body { overflow: hidden; }
  .wel-card[data-step="try"] .wel-h { font-size: 20px; margin: 0; }
  .wel-card[data-step="try"] .wel-why { display: none; }
  .wel-np, .wel-np.video { display: flex; flex-direction: column; max-height: none; flex: 1 1 auto; min-height: 0; margin-top: 10px; border-radius: 16px; }
  .wel-np-l { padding: 10px 14px 8px; flex: none; }
  .wel-np.video .wel-np-l { padding: 0; }
  .wel-np-state { display: none; }
  .wel-np-hd { margin-top: 0; gap: 12px; }
  .wel-np .orb { width: 44px; height: 44px; border-radius: 10px; }
  .wel-np-title { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .wel-np.video .wel-np-title { display: none; }
  .wel-card .wel-np .np-by { display: none; }
  .wel-card .wel-np .np-why { display: block; }
  .wel-np-i { padding: 6px 14px 8px; flex: none; }
  .wel-np-ctl { padding-top: 6px; }
  .wel-np .tl { margin-top: 4px; }
  .wel-np .tl-times { margin-top: 0; }
  .wel-np .ctl { margin-top: 4px; }
  .wel-np .ctl .btn { min-height: 36px; padding: 6px 10px; }
  .wel-np .play { width: 40px; height: 40px; }
  .wel-np-r { border-left: 0; border-top: 1px solid var(--line); padding: 6px 14px 4px; flex: 1 1 auto; min-height: 96px; height: auto; }
  .wel-np-hint { margin-bottom: 2px; }
  .wel-np .ln .txt { font-size: 17px; }
  /* Back, Full player and Go to the app on one row */
  .wel-foot.try { position: static; display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "back open app"; gap: 6px;
    margin: 10px -20px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .wel-foot.try > div, .wel-foot.try .wel-foot-r { display: contents; }
  .wel-foot.try [data-act="back"] { grid-area: back; font-size: 0; padding: 10px 6px; gap: 0; }
  .wel-foot.try [data-act="back"] .ico { width: 20px; height: 20px; }
  .wel-foot.try [data-act="open"] { grid-area: open; padding: 10px 12px; }
  .wel-foot.try [data-act="app"] { grid-area: app; justify-content: center; padding: 10px 12px; }
}

/* Try it: a word can be clicked for its definition (it opens the full player with the word looked up) */
.wel-np-hint { margin: 0 0 8px; font-size: 12px; color: var(--soft); }
.wel-np-hint .ico { width: 14px; height: 14px; vertical-align: -3px; margin-right: 5px; }
.wel-show-s { display: none; }
.wel-np .np-by { display: block; }
.wel-np .np-why { display: none; }
.wel-np .lines .tk { cursor: pointer; border-radius: 4px; }
.wel-np .lines .tk:hover { background: rgba(17, 17, 17, 0.07); }
.wel-np .ln.now { cursor: auto; }
@media (max-width: 760px) { .wel-show-s { display: inline; } }
