/* ==========================================================================
   Tokens — sampled from the business card
   ========================================================================== */
:root {
  --paper: #F5F3ED;
  --paper-deep: #EDEAE2;
  --navy: #0A3860;
  --navy-deep: #082C4B;
  --ink: #4B6079;
  --terra: #C96F67;
  --terra-btn: #B4544C;
  --terra-btn-hover: #9C443D;
  --terra-text: #AA4A42;
  --chop: #BF5852;
  --mist: #E8EEF3;
  --mist-line: #CFDAE4;
  --card: #FBFAF7;
  --rule: #D8DEE4;
  --serif: 'Lora', Georgia, 'Songti SC', serif;
  --sans: 'Poppins', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --py: 'Noto Sans', 'Poppins', sans-serif;
  --cjk: 'Noto Serif SC', 'Noto Serif CJK SC', 'Songti SC', 'STSong', serif;
  --script: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
  --shadow-sm: 0 1px 2px rgba(10,56,96,.06), 0 6px 14px -8px rgba(10,56,96,.18);
  --shadow-md: 0 4px 6px -1px rgba(10,56,96,.10), 0 10px 24px -12px rgba(10,56,96,.25);
  --shadow-lg: 0 26px 50px -22px rgba(10,56,96,.38), 0 4px 10px rgba(10,56,96,.08);
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2rem);

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 84px); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .32 0 0 0 0 .25 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
img, svg { max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.16; letter-spacing: -0.008em; margin: 0; color: var(--navy); text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 1.4rem + 3.3vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 1.25rem + 1.8vw, 2.6rem); }
h3 { font-size: 1.3rem; line-height: 1.25; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
/* Anchor jumps (About, Reviews, Pocket Guide) land on the section's content, not its top padding; html's scroll-padding already clears the header. */
.section[id] { scroll-margin-top: calc(1.5rem - clamp(3.5rem, 8vw, 6.5rem)); }
.lead-magnet[id] { scroll-margin-top: calc(1.5rem - clamp(3.5rem, 7vw, 5.5rem)); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: var(--paper); padding: .75rem 1rem; z-index: 200; }
.skip:focus { left: 1rem; top: 1rem; }
h1[tabindex="-1"]:focus { outline: none; }

/* small brand devices lifted from the card */
.caps { font: 600 .72rem/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.rule { display: block; width: 170px; height: 2px; margin-top: 1.4rem; background: linear-gradient(90deg, var(--terra), rgba(201,111,103,0)); }
.script { font-family: var(--script); font-weight: 500; color: var(--terra-text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: 1rem 1.6rem;
  font: 600 .95rem/1.25 var(--sans); text-align: center; text-decoration: none;
  border: 2px solid transparent; border-radius: 10px; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -10px rgba(10,56,96,.5); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-rose { background: var(--terra-btn); color: #FAF7F2; }
.btn-rose:hover { background: var(--terra-btn-hover); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #F5F3ED; }
.btn-lg { min-height: 60px; padding: 1.2rem 2.25rem; font-size: 1.05rem; }
.btn-sm { min-height: 42px; padding: .6rem 1.2rem; font-size: .85rem; border-radius: 8px; }

/* ---------- chop seal ---------- */
.chop {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 4px;
  background: var(--chop); color: #F8EDEA; font: 600 1.3rem/1 var(--cjk);
  box-shadow: inset 0 0 0 2px var(--chop), inset 0 0 0 3.5px rgba(248,237,234,.55); transform: rotate(-3deg);
}
.chop.sm { width: 26px; height: 26px; font-size: 1rem; box-shadow: inset 0 0 0 1.5px var(--chop), inset 0 0 0 2.5px rgba(248,237,234,.55); }
.chop.lg { width: 44px; height: 44px; font-size: 1.7rem; }

/* ---------- decorative art ---------- */
.art { position: absolute; pointer-events: none; }
.art svg { display: block; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 100;
  background: rgba(245,243,237,.93); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, rgba(201,111,103,.7), rgba(201,111,103,0) 70%) 1;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; position: relative; }
.logo { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-name { font: 700 1.2rem/1.1 var(--serif); letter-spacing: .13em; color: var(--navy); text-transform: uppercase; }
.logo-sub { font: 500 .58rem/1.2 var(--sans); letter-spacing: .24em; color: var(--ink); text-transform: uppercase; margin-top: .3rem; }
.site-nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.6vw, 2.1rem); }
.site-nav a:not(.btn) { font: 500 .88rem/1.2 var(--sans); color: var(--ink); text-decoration: none; padding: .4rem 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.site-nav a:not(.btn):hover { color: var(--navy); }
.site-nav a[aria-current="page"]:not(.btn) { color: var(--navy); border-bottom-color: var(--terra); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 46px; height: 46px; background: none; border: 1px solid var(--rule); border-radius: 10px; color: var(--navy); cursor: pointer; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; overflow: hidden; padding-block: clamp(2.75rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.hero .mtn { right: 0; bottom: 0; width: min(1080px, 88%); opacity: 1; }
.hero .bam { right: -34px; bottom: -10px; height: clamp(300px, 46vw, 520px); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-bottom: clamp(3.5rem, 8vw, 6.5rem); }
.hero .place { color: var(--terra-text); margin-bottom: 1.4rem; }
.hero h1 { max-width: none; }
.hero .sub { margin-top: 1.5rem; max-width: 50ch; font-size: 1.05rem; color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.25rem; }
.hero-visual { position: relative; }
.photo-frame {
  position: relative; aspect-ratio: 4 / 4.5; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.6);
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.55), transparent 60%),
    linear-gradient(165deg, #DDE4EB 0%, #C6D2DD 50%, #AEBDCC 100%);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .75rem; text-align: center; padding: 2rem; color: #3B4F66; font-size: .9rem; }
.ph svg { width: 52px; height: 52px; opacity: .7; }
.phrase-card { position: absolute; left: -1.75rem; bottom: 2.25rem; max-width: 260px; background: var(--card); border: 1px solid var(--mist-line); border-radius: 18px 18px 18px 5px; padding: 1.1rem 1.4rem 1rem; box-shadow: var(--shadow-lg); }
.phrase-card .zh { font: 600 2rem/1.15 var(--cjk); color: var(--navy); }
.phrase-card .py { margin-top: .3rem; font: 500 1rem/1.2 var(--py); color: var(--terra-text); }
.phrase-card .en { margin-top: .15rem; font-size: .85rem; color: var(--ink); }
.hero-seal { display: none; flex-direction: column; align-items: center; gap: 1rem; align-self: start; }
.hero-seal .zh { writing-mode: vertical-rl; font: 600 2.7rem/1.2 var(--cjk); color: var(--navy); letter-spacing: .05em; }

.strip { position: relative; padding-bottom: clamp(1.75rem, 4vw, 2.5rem); }
.strip .wrap { padding-top: 1.1rem; border-top: 1px solid transparent; border-image: linear-gradient(90deg, rgba(201,111,103,.75), rgba(201,111,103,0) 78%) 1; }
.strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; color: var(--navy); }
.strip li { display: inline-flex; align-items: center; gap: 1.6rem; }
.strip li + li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--terra); margin-left: -.05rem; }

/* ==========================================================================
   Problem & solution
   ========================================================================== */
.problem { text-align: center; }
.problem .lede { max-width: 64ch; margin: 1.5rem auto 0; color: var(--ink); font-size: 1.05rem; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; margin-top: 3.5rem; text-align: left; }
.card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 2rem 1.75rem 2.25rem; box-shadow: var(--shadow-sm); }
.card .corner { right: -26px; top: -22px; width: 150px; opacity: .5; transform: rotate(-8deg); }
.card .tile { position: relative; display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 1.25rem; background: var(--mist); border: 1px solid var(--mist-line); border-radius: 14px; color: var(--navy); }
.card .tile svg { width: 32px; height: 32px; }
.card h3 { margin-bottom: .6rem; position: relative; }
.card p { color: var(--ink); font-size: .95rem; position: relative; }

/* ==========================================================================
   Instructor
   ========================================================================== */
.instructor { background: linear-gradient(180deg, transparent, rgba(207,218,228,.32) 18%, rgba(207,218,228,.32) 82%, transparent); }
.instructor-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.headshot { position: relative; max-width: 380px; margin-inline: auto; width: 100%; }
.headshot .frame { position: relative; z-index: 1; aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); background: linear-gradient(170deg, #E6EAEE, #C9D2DB); display: grid; place-content: center; justify-items: center; gap: .6rem; color: #3B4F66; font-size: .88rem; text-align: center; }
.headshot .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.headshot .frame svg { width: 96px; height: 96px; opacity: .55; }
.headshot .art { right: -70px; top: -60px; width: 220px; z-index: 0; opacity: .8; transform: rotate(4deg); }
.nameplate { margin-top: 1.5rem; text-align: center; }
.nameplate b { display: block; font: 700 1.3rem/1.2 var(--serif); letter-spacing: .13em; text-transform: uppercase; }
.nameplate span { display: block; margin-top: .4rem; color: var(--ink); }
.instructor h2 { margin-bottom: 1.25rem; }
.instructor .intro { color: var(--ink); font-size: 1.02rem; max-width: 58ch; }


/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing h2 { text-align: center; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; max-width: 1120px; margin: 3rem auto 0; }
.price-card { display: flex; flex-direction: column; padding: 2.25rem 1.9rem; border-radius: 20px; }
.price-card .tag { position: relative; margin: -.5rem 0 1rem; }
.price-card h3 { font-size: 1.45rem; position: relative; }
.price-card .price { position: relative; margin: 1.25rem 0 1rem; font: 600 3rem/1 var(--serif); color: var(--navy); }
.price-card .price small { font: 500 .95rem var(--sans); color: var(--ink); margin-left: .35rem; }
.price-card .price.free { font-size: 2.1rem; }
.price-card p.details { position: relative; color: var(--ink); margin-bottom: 2rem; font-size: .95rem; }
.price-card .btn { position: relative; margin-top: auto; align-self: flex-start; }
.price-card.featured { background: var(--card); border: 2px solid var(--navy); box-shadow: var(--shadow-lg); }
.price-card.muted { background: var(--paper-deep); border: 1px solid var(--rule); box-shadow: none; }

/* ==========================================================================
   Lead magnet — navy band, mirrors the back of the card
   ========================================================================== */
.lead-magnet { position: relative; overflow: hidden; background: var(--navy); color: #F5F3ED; padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.lead-magnet .mtn { right: 0; bottom: 0; width: min(900px, 90%); opacity: .55; }
.lead-magnet .bam { right: -40px; bottom: -20px; height: clamp(260px, 34vw, 420px); opacity: .5; }
.lead-magnet .wrap { position: relative; }
.magnet-top { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }
.lead-magnet .label { color: #EDB9B2; }
.lead-magnet h2 { margin-top: .8rem; color: #F5F3ED; font-weight: 500; }
.lead-magnet .copy { max-width: 56ch; margin-top: 1.1rem; color: #D5E0EA; font-size: 1.02rem; }
.lead-magnet .rule { background: linear-gradient(90deg, #E9A69E, rgba(233,166,158,0)); }
.guide-cover { position: relative; width: clamp(170px, 20vw, 235px); margin-right: clamp(0rem, 6vw, 5rem); transform: rotate(3deg); border-radius: 6px; box-shadow: 0 30px 50px -18px rgba(0,0,0,.6), 0 6px 14px rgba(0,0,0,.25); }
.guide-cover img { display: block; width: 100%; height: auto; border-radius: 6px; }
.lead-form { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 1rem; align-items: end; margin-top: 2.5rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .82rem; font-weight: 500; color: #E4ECF3; }
.field input, .field select { width: 100%; min-height: 52px; padding: .8rem 1rem; font: 400 .95rem var(--sans); color: var(--navy); background: #F8F6F1; border: 2px solid transparent; border-radius: 10px; appearance: none; -webkit-appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%234B6079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.field input:focus-visible, .field select:focus-visible { outline: 3px solid #F5F3ED; outline-offset: 2px; }
.lead-form .btn-rose { box-shadow: 0 0 0 2px rgba(245,243,237,.35); }
.lead-form .btn-rose:hover { box-shadow: 0 0 0 2px rgba(245,243,237,.6), 0 12px 22px -10px rgba(0,0,0,.6); }
.lead-fine { margin-top: 1.1rem; max-width: 62ch; font-size: .82rem; line-height: 1.55; color: #D5E0EA; }
.lead-fine a, .contact-form .fine a { text-underline-offset: 3px; }
.lead-fine a { color: #F5F3ED; }
.contact-form .fine a { color: var(--terra-text); }
.legal h2 { font-size: 1.4rem; margin: 2.1rem 0 .65rem; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--ink); font-size: 1rem; line-height: 1.7; }
.legal p + p, .legal ul + p, .legal p + ul { margin-top: .8rem; }
.legal ul { margin: .5rem 0 0; padding-left: 1.25rem; display: grid; gap: .5rem; }
.legal strong { color: var(--navy); }
.legal a { color: var(--terra-text); text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal .biz-details { list-style: none; padding-left: 0; gap: .25rem; }
.policy-note { max-width: 62ch; margin: 1.75rem auto 0; padding: .9rem 1.2rem; text-align: left; font-size: .9rem; line-height: 1.6; color: var(--ink); background: var(--card); border: 1.5px solid var(--rule); border-left: 4px solid var(--terra-btn); border-radius: 10px; box-shadow: var(--shadow-sm); }
.policy-note strong { color: var(--navy); }
.policy-note a { color: var(--terra-text); font-weight: 600; text-underline-offset: 3px; }

/* ==========================================================================
   Resources / booking / thank-you
   ========================================================================== */
.page-head { text-align: center; padding-block: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head .rule { margin-inline: auto; background: linear-gradient(90deg, rgba(201,111,103,0), var(--terra), rgba(201,111,103,0)); }
.page-head p { max-width: 62ch; margin: 1.4rem auto 0; color: var(--ink); font-size: 1.05rem; }
/* Compact header for the three booking pages (audit, book, hsk) — less space above the calendar */
.page-head-cal { padding-block: clamp(1.75rem, 4vw, 3rem) clamp(1rem, 2vw, 1.5rem); }
.page-head-cal .price-line { margin-top: 1rem; }
.page-head-cal .price-meta { margin-top: .5rem; }
.page-head-cal p { margin-top: .9rem; font-size: 1rem; }
.page-head-cal .fine { margin-top: .5rem; }
.lib { padding-bottom: clamp(3rem, 6vw, 5rem); }
.lib-row { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; padding-block: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--rule); }
.lib-row:first-child { border-top: 0; }
.lib-row h2 { font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2rem); margin-bottom: 1.25rem; padding-left: 1rem; border-left: 5px solid var(--terra); }
.guide-links { list-style: none; margin: 0; padding: 0; }
.guide-links li { border-top: 1px solid var(--rule); }
.guide-links li:last-child { border-bottom: 1px solid var(--rule); }
.guide-links a { display: flex; align-items: center; gap: .85rem; padding: .95rem .25rem; text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--navy); transition: color .15s, padding-left .15s; }
.guide-links a:hover { color: var(--terra-text); padding-left: .6rem; }
.guide-links svg { width: 20px; height: 20px; flex: none; color: var(--ink); }
.embed-ph { min-height: 250px; display: grid; place-items: center; text-align: center; padding: 1.5rem; border: 2px dashed #B3C1CF; border-radius: 16px; background: rgba(207,218,228,.3); color: var(--ink); font-weight: 500; font-size: .95rem; }

.cal-wrap { padding-bottom: clamp(3rem, 6vw, 5rem); }
.cal-shell { position: relative; width: 100%; max-width: 1000px; min-height: 700px; margin-inline: auto; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid var(--rule); }
.cal-frame { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 700px; border: 0; opacity: 0; transition: opacity .3s; }
.cal-frame.ready { opacity: 1; }
.cal-state { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; padding: 2rem; color: var(--ink); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--navy); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cal-state .hint { max-width: 46ch; font-size: .92rem; }
.cal-mount { width: 100%; min-height: 700px; overflow: auto; }
.cal-state { background: var(--card); z-index: 2; }
.cal-fallback strong { color: var(--navy); font: 600 1.35rem/1.3 var(--serif); }
.cal-fallback .hint { max-width: 44ch; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-wrap { max-width: 760px; padding-bottom: clamp(3rem, 6vw, 5rem); }
.contact-card { background: var(--card); border: 1.5px solid var(--navy); border-radius: 20px; box-shadow: var(--shadow-md); padding: clamp(1.5rem, 4vw, 2.5rem); }
.contact-form { display: grid; gap: 1.25rem; }
.contact-form .field { display: grid; gap: .4rem; }
.contact-form .field label { font-size: .88rem; font-weight: 600; color: var(--navy); }
.contact-form .opt { margin-left: .35rem; font-weight: 400; font-size: .8rem; color: var(--ink); }
.contact-form input, .contact-form textarea { width: 100%; box-sizing: border-box; padding: .85rem 1rem; font: 400 1rem/1.5 var(--sans); color: var(--navy); background: #fff; border: 1.5px solid var(--rule); border-radius: 10px; }
.contact-form textarea { min-height: 9.5rem; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid rgba(180,84,76,.28); border-color: var(--terra-btn); }
.contact-form .count { text-align: right; font-size: .75rem; color: var(--ink); }
.contact-form .btn { justify-self: start; align-self: auto; margin-top: 0; }
.contact-form .fine { margin: 0; font-size: .82rem; line-height: 1.55; color: var(--ink); }
.cf-status { min-height: 1.3em; font-size: .9rem; font-weight: 600; color: var(--terra-text); }
.contact-thanks { text-align: center; padding: 1.5rem 0 1rem; }
.contact-thanks p { max-width: 46ch; margin: 1rem auto 1.5rem; color: var(--ink); }
.social { margin-top: 2.5rem; text-align: center; }
.social-label { margin: 0 0 1rem; font: 600 .74rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--terra-text); }
.social-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; }
.soc { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--navy); border: 2px solid var(--navy); color: #F5F3ED; text-decoration: none; transition: transform .18s ease, background-color .18s ease, border-color .18s ease; }
.soc svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.soc:hover, .soc:focus-visible { transform: translateY(-2px); background: var(--terra-btn); border-color: var(--terra-btn); }
.soc-mail { background: var(--terra-btn); border-color: var(--terra-btn); }
.soc-mail:hover, .soc-mail:focus-visible { background: var(--terra-btn-hover); border-color: var(--terra-btn-hover); }
.soc.soon { background: transparent; color: var(--navy); opacity: .55; cursor: default; }
.soc.soon:hover, .soc.soon:focus-visible { transform: none; background: transparent; border-color: var(--navy); }
@media (prefers-reduced-motion: reduce) { .soc { transition: none; } .soc:hover { transform: none; } }
.social .fine { margin-top: 1rem; font-size: .85rem; color: var(--ink); }
.cal-state code { background: var(--paper-deep); padding: .1rem .4rem; border-radius: 4px; font-size: .9em; }

.thanks { position: relative; min-height: 68vh; display: grid; place-items: center; text-align: center; padding-block: clamp(3rem, 8vw, 6rem); }
.thanks .inner { position: relative; max-width: 640px; }
.thanks .guide-cover { width: 190px; margin: 0 auto 2.5rem; }
.thanks p { margin: 1.5rem auto 2.5rem; color: var(--ink); font-size: 1.05rem; }
.thanks .rule { margin-inline: auto; background: linear-gradient(90deg, rgba(201,111,103,0), var(--terra), rgba(201,111,103,0)); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { position: relative; overflow: hidden; border-top: 1px solid var(--rule); padding: 3.5rem 0 clamp(6rem, 12vw, 9rem); }
.site-footer .mtn { right: 0; bottom: 0; width: min(860px, 100%); }
.site-footer .bam { right: -26px; bottom: 0; height: clamp(220px, 28vw, 330px); opacity: .85; }
.footer-grid { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2.5rem 4rem; align-items: start; }
.footer-brand { display: flex; gap: .85rem; align-items: center; }
.footer-brand .logo-name { font-size: 1.1rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; justify-content: flex-start; }
.footer-nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .9rem; }
.footer-nav a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }
.where { position: relative; display: flex; align-items: center; gap: .75rem; margin-top: 2rem; color: var(--navy); font-size: .9rem; }
.where i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #F5F3ED; flex: none; }
.where i svg { width: 17px; height: 17px; }
.tagline { position: relative; display: inline-block; margin-top: 2rem; font-size: 2rem; line-height: 1.1; }
.tagline svg { display: block; width: 100%; height: 10px; margin-top: 4px; }
.copyright { position: relative; margin-top: 1.5rem; font-size: .8rem; color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--navy); color: #F5F3ED; padding: .8rem 1.2rem; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300; max-width: calc(100% - 2rem); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: 1.25fr .8fr auto; }
  .hero-seal { display: flex; }
}
@media (max-width: 960px) {
  .hero-grid, .instructor-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; margin-inline: auto; width: 100%; }
  .phrase-card { left: 1rem; bottom: 1rem; }
  .cards-3 { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .price-grid { grid-template-columns: 1fr; max-width: 560px; }
  .lead-form { grid-template-columns: 1fr 1fr; }
  .lead-form .btn { grid-column: 1 / -1; }
  .lib-row { grid-template-columns: 1fr; }
  .magnet-top { grid-template-columns: 1fr; }
  .guide-cover { margin: 1rem auto 0; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: .25rem; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 1rem var(--gutter) 1.5rem; box-shadow: var(--shadow-md); }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
  .site-nav .btn { margin-top: .75rem; }
}
@media (max-width: 560px) {
  .lead-form { grid-template-columns: 1fr; }
  .cta-row .btn { width: 100%; }
  .price-card { padding: 2rem 1.5rem; }
  .price-card .btn { align-self: stretch; }
  .cal-shell, .cal-frame { min-height: 640px; }
  .logo-sub { display: none; }
  .strip ul { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: .7rem 1rem; }
  .strip li + li::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .btn:hover { transform: none; }
}

/* ---------- equal-size hero buttons ---------- */
.cta-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 560px; }
.cta-row .btn { width: 100%; min-height: 64px; text-align: center; justify-content: center; }
@media (max-width: 640px) { .cta-row { grid-template-columns: 1fr; } }

/* ---------- hero carousel ---------- */
.hero-visual { position: relative; }
.photo-frame { background: linear-gradient(165deg, #DDE4EB 0%, #C6D2DD 50%, #AEBDCC 100%); }
.slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .9s ease; }
.slide svg { display: block; width: 100%; height: 100%; transform: scale(1.05); transition: transform 10s ease-out; }
.slide.is-active { opacity: 1; z-index: 1; }
.slide.is-active svg { transform: scale(1); }
.hero-visual { margin-bottom: 4.5rem; }
.phrases { position: absolute; left: -1.75rem; bottom: -4.5rem; width: 320px; height: 140px; z-index: 3; pointer-events: none; }
.phrases .phrase-card { position: absolute; left: 0; bottom: 0; max-width: none; opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.phrases .phrase-card.is-active { opacity: 1; transform: none; transition-delay: .35s; }
.phrase-card .zh { font-size: 1.7rem; white-space: nowrap; }
.phrase-card .py, .phrase-card .en { white-space: nowrap; }
.hero .place { text-wrap: balance; }
.car-ui { position: absolute; top: 1rem; right: 1rem; z-index: 4; display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem .35rem .4rem; background: rgba(245,243,237,.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 999px; box-shadow: var(--shadow-sm); }
.car-toggle { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--navy); color: #F5F3ED; cursor: pointer; }
.car-toggle svg { width: 12px; height: 12px; }
.car-toggle .i-play { display: none; }
.car-toggle[aria-pressed="true"] .i-play { display: block; }
.car-toggle[aria-pressed="true"] .i-pause { display: none; }
.dots { display: flex; gap: .3rem; }
.dot { position: relative; width: 22px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.dot::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: rgba(10,56,96,.22); }
.dot .fill { position: absolute; left: 0; top: 50%; height: 5px; margin-top: -2.5px; width: 0; border-radius: 3px; background: var(--terra); }
.dot[aria-current="true"] .fill { width: 100%; }
.dot[aria-current="true"].run .fill { width: 0; animation: dotfill 10s linear forwards; }
@keyframes dotfill { to { width: 100%; } }

/* scene motion (only the visible slide animates) */
.slide svg .blink { transform-box: fill-box; transform-origin: center; }
.slide.is-active .blink { animation: blink 4.8s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.slide svg .breathe { transform-box: fill-box; transform-origin: 50% 100%; }
.slide.is-active .breathe { animation: breathe 4.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.024); } }
.slide.is-active .reach { animation: reach 3.6s ease-in-out infinite; }
@keyframes reach { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3.5deg); } }
.slide.is-active .gesture { animation: gesture 2.8s ease-in-out infinite; }
@keyframes gesture { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(5deg); } }
.slide.is-active .pain { animation: pain 1.6s ease-in-out infinite; }
@keyframes pain { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.slide.is-active .airs { animation: airs 4.2s ease-in-out infinite; }
@keyframes airs { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.slide.is-active .needle { animation: needle 4s ease-in-out infinite; }
@keyframes needle { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(38deg); } }
.slide.is-active .sweep { animation: sweep 3.2s ease-in-out infinite alternate; transform-origin: 128px 84px; }
@keyframes sweep { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
.slide.is-active .trace { stroke-dasharray: 240; animation: trace 3s linear infinite; }
@keyframes trace { from { stroke-dashoffset: 240; } to { stroke-dashoffset: -240; } }
.slide.is-active .swing { animation: swing 5s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) {
  .slide, .phrases .phrase-card { transition: none; }
  .slide svg { transform: none; transition: none; }
  .slide.is-active * { animation: none !important; }
}
@media (max-width: 960px) { .phrases { left: 1rem; } }

/* ---------- bio stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin-top: 1.75rem; max-width: 640px; }
.stats > div { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--terra); border-radius: 12px; padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); }
.stats b { display: block; font: 600 1.05rem/1.25 var(--serif); color: var(--navy); }
.stats span { display: block; margin-top: .25rem; font-size: .8rem; line-height: 1.45; color: var(--ink); }
.stats-6 { max-width: 100%; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }

/* ---------- HSK chip / fine print ---------- */
.price-card .hsk { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin: -.75rem 0 2rem; padding: .9rem 1rem; background: var(--mist); border: 1px solid var(--mist-line); border-radius: 12px; font-size: .88rem; color: var(--ink); }
.chip { display: inline-block; padding: .2rem .65rem; border-radius: 999px; background: var(--terra-btn); color: #FAF7F2; font: 600 .68rem/1.5 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.page-head .fine { margin-top: .9rem; font-size: .85rem; color: var(--ink); opacity: .9; }
.disclaimer { position: relative; margin-top: 1.5rem; max-width: 62ch; font-size: .8rem; line-height: 1.6; color: var(--ink); }
.page-head .kicker { color: var(--terra-text); margin: 0 0 1.1rem; }
.cal-alt { max-width: 1000px; margin: 1rem auto 0; text-align: center; font-size: .85rem; color: var(--ink); opacity: .85; }
.cross { max-width: 1000px; margin: .6rem auto 0; text-align: center; font-size: .9rem; color: var(--ink); }
.policy-note + .cross { margin-top: 1.75rem; }
.cal-alt a, .cross a { color: var(--navy); font-weight: 600; text-underline-offset: 3px; }
.cal-alt a:hover, .cross a:hover { color: var(--terra-text); }
.proof { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .3rem .7rem; margin-top: 1.4rem; text-decoration: none; font-size: .88rem; color: var(--ink); }
.proof:hover strong { color: var(--terra-text); }
.proof strong { color: var(--navy); font-weight: 600; transition: color .15s; }
.stars { display: inline-flex; gap: 2px; color: var(--terra); }
.stars svg { width: 16px; height: 16px; }

.reviews { text-align: center; }
.reviews .rule { margin-inline: auto; background: linear-gradient(90deg, rgba(201,111,103,0), var(--terra), rgba(201,111,103,0)); }
.rating-sum { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin: 2rem auto 0; }
.rating-sum .big { font: 600 3.6rem/1 var(--serif); color: var(--navy); }
.rating-sum .stars svg { width: 22px; height: 22px; }
.rating-sum p { font-size: .92rem; color: var(--ink); }
.review { display: flex; flex-direction: column; gap: 1rem; padding: 1.75rem 1.75rem 1.5rem; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow-sm); }
.review header { display: flex; align-items: center; gap: .85rem; }
.review .avatar { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--mist); border: 1px solid var(--mist-line); font: 600 1.15rem/1 var(--serif); color: var(--navy); }
.review .who b { display: block; font: 600 1.05rem/1.2 var(--serif); color: var(--navy); }
.review .who span { font-size: .8rem; color: var(--ink); }
.review blockquote { margin: 0; font-size: .96rem; line-height: 1.7; color: var(--navy); }
.review footer { margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--rule); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.review-carousel { position: relative; max-width: 900px; margin: 2.75rem auto 0; text-align: left; }
.review-track { display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: .5rem .5rem 1.5rem; margin: 0 -.5rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.review-track::-webkit-scrollbar { display: none; }
.review-track.few { justify-content: center; }
.review-track .review { flex: 0 0 calc((100% - 1.5rem - 1rem) / 2); scroll-snap-align: start; }
.review-track.few .review { flex-basis: calc((100% - 1.5rem - 1rem) / 2); }
@media (max-width: 700px) { .review-track .review, .review-track.few .review { flex-basis: calc(100% - 1rem); } }
.review blockquote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; line-clamp: 7; overflow: hidden; }
.review.open blockquote { -webkit-line-clamp: unset; line-clamp: unset; display: block; }
.review .rm { align-self: flex-start; margin-top: -.4rem; padding: .2rem 0; border: 0; background: none; font: 600 .85rem var(--sans); color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.review .rm:hover { color: var(--terra-text); }
.rc-ui { display: flex; align-items: center; justify-content: center; gap: .9rem; margin-top: .25rem; }
.rc-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 1.5px solid var(--navy); border-radius: 50%; background: transparent; color: var(--navy); cursor: pointer; transition: background-color .15s, color .15s, transform .15s; }
.rc-btn:hover { background: var(--navy); color: #F5F3ED; transform: translateY(-1px); }
.rc-btn svg { width: 18px; height: 18px; }
.rc-toggle svg { width: 12px; height: 12px; }
.rc-toggle .i-play { display: none; }
.rc-toggle[aria-pressed="true"] .i-play { display: block; }
.rc-toggle[aria-pressed="true"] .i-pause { display: none; }
.rc-dots { display: flex; gap: .45rem; }
.rc-count { min-width: 3.5rem; text-align: center; font: 600 .9rem var(--sans); color: var(--navy); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .rc-ui { gap: .6rem; } .rc-dot { width: 16px; } .rc-dots { gap: .3rem; } }
.rc-dot { width: 26px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.rc-dot::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: rgba(10,56,96,.22); transition: background-color .2s; }
.rc-dot[aria-current="true"]::before { background: var(--terra); }
.reviews .more { margin-top: 1.5rem; }
.price-line { display: flex; align-items: baseline; justify-content: center; gap: .75rem; margin-top: 1.75rem; }
.price-line .amt { font: 600 clamp(3.25rem, 2.3rem + 3.4vw, 4.75rem)/1 var(--serif); color: var(--navy); letter-spacing: -.01em; }
.price-line .per { font: 500 1.25rem/1.2 var(--sans); color: var(--ink); }
.page-head .price-meta { margin: .75rem auto 0; font: 600 .74rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--terra-text); }
.price-card .corner { width: 105px; right: -22px; top: -16px; opacity: .38; }
/* ==========================================================================
   Service + course cards (shared)
   ========================================================================== */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; max-width: 1120px; margin: 3rem auto 0; }
.svc {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 2.5rem 1.9rem 2rem; background: var(--card); border: 1.5px solid var(--navy); border-radius: 20px; box-shadow: var(--shadow-md);
  transition: transform .2s ease, box-shadow .2s ease;
}
.svc:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.svc .svc-art { position: absolute; top: -40px; right: -50px; width: 190px; opacity: .4; pointer-events: none; }
.svc .svc-art svg { display: block; width: 100%; height: auto; }
.svc > *:not(.svc-art) { position: relative; }
.svc h3 { font-size: 1.4rem; line-height: 1.25; min-height: 2.5em; display: grid; align-content: center; }
.svc .svc-big { margin: 1rem 0 .35rem; font: 600 3.1rem/1 var(--serif); color: var(--navy); }
.svc .svc-big small { display: block; margin-top: .45rem; font: 500 .95rem/1.3 var(--sans); color: var(--ink); }
.svc .svc-tag { margin: .6rem 0 1.1rem; min-height: 1.6rem; }
.svc .svc-desc { flex: 1; color: var(--ink); font-size: .95rem; line-height: 1.7; margin-bottom: 1.75rem; }
.svc .btn { width: 100%; }
.svc .btn[aria-disabled="true"] { background: var(--paper-deep); color: var(--ink); border-color: var(--rule); cursor: default; }
.svc .btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; background: var(--paper-deep); }
/* course library cards: every card the same size, with the same three areas in the same places:
   the name (one line, with its Chinese name in small type under it), the topics, and the button along the bottom */
.catalog-grid { margin-top: 1rem; grid-auto-rows: 1fr; }
.catalog-grid .svc { padding: 2.25rem 1.9rem 2rem; container-type: inline-size; }
.catalog-grid .svc h3 { display: block; width: 100%; min-height: 0; margin: 0; font: 600 2.15rem/1.3 var(--serif); color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* names stay on one line: keep them short (at most about 8em wide in Lora, e.g. "Physical Therapy"),
   and every name shrinks together on narrow cards so the longest still fits */
.catalog-grid .svc h3 { font-size: min(2.15rem, 12.3cqi); }
.catalog-grid .svc .svc-zh { margin: .3rem 0 0; font: 600 1rem/1.4 var(--cjk); letter-spacing: .12em; color: var(--terra-text); }
.catalog-grid .svc .svc-desc { width: 100%; margin: .9rem 0 1.5rem; }
.catalog-grid .svc .svc-actions { width: 100%; margin-top: auto; }
@media (max-width: 960px) { .svc-grid { grid-template-columns: 1fr; max-width: 520px; } }
@media (max-width: 400px) { .catalog-grid .svc h3 { font-size: 1.75rem; font-size: min(1.95rem, 12.3cqi); } }

/* ==========================================================================
   Course player
   ========================================================================== */
.cm-wrap { max-width: 1280px; margin-inline: auto; padding: 1.25rem var(--gutter) 4rem; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cm-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 92px); max-height: calc(100vh - 112px); overflow: auto; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 1.1rem 1rem 1.25rem; scrollbar-width: thin; }
.cm-side-head { padding: .25rem .5rem 1rem; border-bottom: 1px solid var(--rule); margin-bottom: .75rem; }
.cm-side-head a { display: block; text-decoration: none; }
.cm-side-head .zh { font: 600 1.6rem/1.2 var(--cjk); color: var(--navy); }
.cm-side-head .en { font-size: .82rem; color: var(--ink); }
.cm-bar { height: 6px; margin-top: .8rem; border-radius: 4px; background: rgba(10,56,96,.12); overflow: hidden; }
.cm-bar i { display: block; height: 100%; width: 0; background: var(--terra); border-radius: 4px; transition: width .4s ease; }
.cm-bar-txt { display: flex; justify-content: space-between; gap: .5rem; margin-top: .4rem; font-size: .75rem; color: var(--ink); }
.cm-bar-txt b { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.cm-side-x { display: none; }
.cm-grp { margin-top: .5rem; }
.cm-grp > .cm-gh { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; padding: .55rem .5rem; border: 0; background: none; text-align: left; font: 700 .72rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--navy); cursor: pointer; border-radius: 8px; }
.cm-grp > .cm-gh:hover { background: var(--mist); }
.cm-gh .zh { font: 600 .95rem/1 var(--cjk); letter-spacing: 0; text-transform: none; margin-left: .4rem; }
.cm-gh-t { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem 0; flex: 1; min-width: 0; }
.cm-grp > .cm-gh .cm-cnt { margin-left: 0; flex: none; }
.cm-gh-t .en { flex-basis: 100%; font: 500 .8rem/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); }
.cm-gh .chev { width: 14px; height: 14px; transition: transform .2s; flex: none; }
.cm-grp:not(.open) .chev { transform: rotate(-90deg); }
.cm-grp:not(.open) > .cm-items { display: none; }
.cm-part { margin: .7rem .5rem .15rem; font: 600 .68rem/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--terra-text); }
.cm-item { display: flex; align-items: flex-start; gap: .65rem; width: 100%; padding: .5rem .5rem .5rem .75rem; border: 0; background: none; text-align: left; font: 500 .88rem/1.4 var(--sans); color: var(--ink); border-radius: 10px; cursor: pointer; text-decoration: none; }
.cm-item:hover { background: var(--mist); color: var(--navy); }
.cm-item[aria-current="page"] { background: var(--mist); color: var(--navy); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--navy); }
.cm-dot { flex: none; width: 18px; height: 18px; margin-top: .12rem; border-radius: 50%; border: 1.6px solid #9FB1C3; display: grid; place-items: center; color: transparent; }
.cm-dot svg { width: 10px; height: 10px; }
.cm-item.done .cm-dot { background: var(--terra); border-color: var(--terra); color: #fff; }
.cm-item[aria-current="page"] .cm-dot { border-color: var(--navy); }
.cm-soon { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .5rem .5rem .75rem; margin-top: .15rem; font: 500 .84rem/1.3 var(--sans); color: #7A8CA0; border-radius: 10px; }
.cm-soon .zh { font: 600 .9rem/1 var(--cjk); margin-right: .4rem; }
.cm-soon em { font: 600 .62rem/1 var(--sans); font-style: normal; letter-spacing: .12em; text-transform: uppercase; padding: .25rem .5rem; border-radius: 999px; background: var(--paper-deep); color: #6E7F92; }
.cm-menu-btn { display: none; }

.cm-main { min-width: 0; }
.cm-panel { background: var(--card); border: 1px solid var(--rule); border-radius: 22px; box-shadow: var(--shadow-sm); padding: clamp(1.4rem, 3vw, 2.5rem); }
.cm-eyebrow { font: 600 .72rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--terra-text); }
.cm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; }
.cm-meta { display: inline-flex; align-items: center; gap: .6rem; font: 500 .78rem/1.3 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.cm-donechip { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem .22rem .45rem; border-radius: 999px; background: #E4F0E4; color: #2F6B3F; font: 600 .72rem/1.2 var(--sans); }
.cm-donechip svg { display: block; width: 12px; height: 12px; }
.cm-title { margin-top: .5rem; font: 600 clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem)/1.15 var(--serif); color: var(--navy); }
.cm-title[tabindex="-1"]:focus { outline: none; }
.cm-sub { margin-top: .7rem; max-width: 62ch; color: var(--ink); font-size: 1.02rem; }
.cm-body { margin-top: 1.75rem; display: grid; gap: 1.5rem; }
.cm-body > * { min-width: 0; }
.cm-zh { font-family: var(--cjk); font-weight: 600; color: var(--navy); }
.cm-py { font: 500 1rem/1.4 var(--py); color: var(--terra-text); }
.cm-en { font-size: .95rem; color: var(--ink); }
.cm-body.hide-py .cm-py { display: none; }
.cm-body.hide-en .cm-en { display: none; }
.cm-scene { width: 100%; max-height: 340px; object-fit: cover; border-radius: 16px; display: block; background: #F7EFE3; }
.cm-note { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.15rem; background: var(--mist); border-radius: 14px; color: var(--navy); font-size: .95rem; }
.cm-note b { color: var(--terra-text); font: 700 .68rem/1.6 var(--sans); letter-spacing: .16em; text-transform: uppercase; flex: none; padding-top: .1rem; }
.cm-note.warn { background: #F8E4E0; }
.cm-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cm-chipbtn { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border: 1.5px solid var(--navy); border-radius: 999px; background: transparent; color: var(--navy); font: 600 .8rem/1 var(--sans); cursor: pointer; transition: background-color .15s, color .15s; }
.cm-chipbtn:hover { background: var(--mist); }
.cm-chipbtn[aria-pressed="true"], .cm-chipbtn.on { background: var(--navy); color: #F5F3ED; }
.cm-say { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--navy); background: var(--card); color: var(--navy); cursor: pointer; transition: background-color .15s, color .15s, transform .15s; }
.cm-say:hover { background: var(--navy); color: #F5F3ED; transform: translateY(-1px); }
.cm-say svg { width: 18px; height: 18px; }
.cm-say.lg { width: 48px; height: 48px; }
.cm-say.lg svg { width: 22px; height: 22px; }
.cm-say.playing { background: var(--terra); border-color: var(--terra); color: #fff; }

/* phrase rows */
.cm-lines { display: grid; gap: .8rem; }
.cm-line { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 1rem 1.15rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; }
.cm-line .cm-zh { font-size: 1.55rem; line-height: 1.4; }
.cm-line.covered .cm-en { visibility: hidden; }
.cm-line .cm-en { margin-top: .15rem; }
.cm-line .rowimg { grid-column: 1 / -1; }
.cm-line.has-img { grid-template-columns: 76px 1fr auto; }
.cm-line .thumb { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: #FBF6EC; }
.cm-scene.tall { max-height: 460px; object-position: 50% 22%; }
.cm-scene.fit { max-height: 440px; object-fit: contain; }
.cm-gloss { font: 500 .78rem/1.4 var(--sans); color: var(--ink); }

/* flash cards */
.cm-flash { display: grid; gap: 1.1rem; }
.cm-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.cm-fc-wrap { display: grid; justify-items: center; gap: 1rem; }
.cm-fc { perspective: 1200px; width: min(440px, 100%); height: 380px; border: 0; background: none; padding: 0; cursor: pointer; }
.cm-fc-in { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.cm-fc.flipped .cm-fc-in { transform: rotateY(180deg); }
.cm-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; padding: 1.25rem; border-radius: 22px; border: 1.5px solid var(--navy); background: var(--paper); box-shadow: var(--shadow-md); text-align: center; }
.cm-face.back { transform: rotateY(180deg); background: var(--mist); }
.cm-face img { width: 100%; max-height: 190px; object-fit: contain; border-radius: 12px; background: #FBF6EC; }
.cm-face .cm-zh { font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1.15; }
.cm-face .cm-py { font-size: 1.35rem; }
.cm-face .cm-en { font-size: 1.2rem; color: var(--navy); font-weight: 500; }
.cm-face .hint { font: 500 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #7A8CA0; }
.cm-face .say { position: absolute; top: .8rem; right: .8rem; }
.cm-fc-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.cm-fc-count { font: 600 .85rem/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.cm-prog { width: min(440px, 100%); height: 6px; border-radius: 4px; background: rgba(10,56,96,.12); overflow: hidden; }
.cm-prog i { display: block; height: 100%; background: var(--terra); width: 0; transition: width .3s; }
.cm-quiz { display: grid; gap: 1rem; justify-items: center; }
.cm-q { width: min(520px, 100%); text-align: center; display: grid; gap: .8rem; justify-items: center; padding: 1.2rem; border: 1.5px solid var(--navy); border-radius: 20px; background: var(--paper); }
.cm-q img { max-height: 170px; border-radius: 12px; background: #FBF6EC; }
.cm-q .cm-zh { font-size: 2.6rem; }
.cm-opts { width: min(520px, 100%); display: grid; gap: .6rem; }
.cm-opt { padding: .85rem 1rem; text-align: left; border: 1.5px solid var(--mist-line); background: var(--card); border-radius: 12px; font: 500 .98rem/1.4 var(--sans); color: var(--navy); cursor: pointer; transition: border-color .15s, background-color .15s; }
.cm-opt:hover:not(:disabled) { border-color: var(--navy); }
.cm-opt.right { background: #E4F0E4; border-color: #6FA27A; }
.cm-opt.wrong { background: #F8E1DD; border-color: var(--terra); }
.cm-score { font: 600 1.4rem/1.3 var(--serif); color: var(--navy); text-align: center; }

/* dialogue */
.cm-dlg { display: grid; gap: .9rem; }
.cm-bub { display: grid; grid-template-columns: 1fr auto; gap: .9rem; align-items: center; max-width: min(720px, 94%); padding: 1rem 1.2rem; border-radius: 20px 20px 20px 6px; background: var(--mist); border: 1px solid var(--mist-line); }
.cm-bub.you { justify-self: end; border-radius: 20px 20px 6px 20px; background: var(--navy); border-color: var(--navy); }
.cm-bub .who { grid-column: 1 / -1; font: 700 .64rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--terra-text); }
.cm-bub.you .who { color: #EDB9B2; }
.cm-bub .cm-zh { font-size: 1.45rem; line-height: 1.45; }
.cm-bub.you .cm-zh { color: #F5F3ED; }
.cm-bub.you .cm-py { color: #EDB9B2; }
.cm-bub.you .cm-en { color: #D5E0EA; }
.cm-bub.you .cm-say { background: transparent; color: #F5F3ED; border-color: rgba(245,243,237,.6); }
.cm-bub.you .cm-say:hover { background: #F5F3ED; color: var(--navy); }
.cm-bub.playing { box-shadow: 0 0 0 3px rgba(201,111,103,.55); }
.cm-bub.masked .cm-zh, .cm-bub.masked .cm-py { display: none; }
.cm-bub .reveal { grid-column: 1 / -1; justify-self: start; }
.cm-bub:not(.masked) .reveal { display: none; }
.cm-bub.masked .cm-say { display: none; }

/* compare / choice */
.cm-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.cm-vs > div { padding: 1.5rem 1.2rem; border-radius: 20px; border: 1.5px solid var(--navy); text-align: center; display: grid; gap: .5rem; justify-items: center; background: var(--paper); }
.cm-vs > div.pro { background: var(--navy); }
.cm-vs .tag { font: 700 .66rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--terra-text); }
.cm-vs .pro .tag { color: #EDB9B2; }
.cm-vs .cm-zh { font-size: 3rem; line-height: 1.1; }
.cm-vs .pro .cm-zh { color: #F5F3ED; } .cm-vs .pro .cm-py { color: #EDB9B2; } .cm-vs .pro .cm-en { color: #D5E0EA; }
.cm-choose { display: grid; gap: 1rem; justify-items: center; text-align: center; padding: 1.4rem; border-radius: 20px; background: var(--paper); border: 1px solid var(--rule); }
.cm-scn { font: 600 1.25rem/1.4 var(--serif); color: var(--navy); min-height: 3.6rem; display: grid; align-items: center; }
.cm-pick { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }
.cm-pick button { min-width: 150px; padding: .9rem 1.4rem; border-radius: 14px; border: 1.5px solid var(--navy); background: var(--card); font: 600 1.5rem/1.2 var(--cjk); color: var(--navy); cursor: pointer; transition: background-color .15s, transform .15s; }
.cm-pick button:hover:not(:disabled) { background: var(--mist); transform: translateY(-2px); }
.cm-pick button.right { background: #E4F0E4; border-color: #6FA27A; }
.cm-pick button.wrong { background: #F8E1DD; border-color: var(--terra); }
.cm-fb { min-height: 1.5rem; font-weight: 600; color: var(--navy); }

/* builder / patterns / scramble */
.cm-build { padding: 1.4rem; border-radius: 20px; background: var(--paper); border: 1px solid var(--rule); display: grid; gap: 1rem; }
.cm-sent { font: 600 clamp(1.5rem, 1rem + 1.6vw, 2.1rem)/1.5 var(--cjk); color: var(--navy); }
.cm-sent .blank { display: inline-block; min-width: 3em; padding: 0 .3em; border-bottom: 3px dashed var(--terra); color: var(--terra-text); }
.cm-sent .add { color: var(--terra-text); }
.cm-frame { padding: 1.3rem; border-radius: 20px; border: 1.5px solid var(--navy); background: var(--paper); display: grid; gap: .9rem; }
.cm-frame .row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cm-input { padding: .65rem .9rem; border: 1.5px solid var(--mist-line); border-radius: 10px; background: var(--card); font: 500 1rem var(--sans); color: var(--navy); min-width: 0; }
.cm-input:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.cm-bank, .cm-answer { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 3.2rem; padding: .7rem; border-radius: 14px; }
.cm-answer { border: 2px dashed var(--mist-line); background: var(--card); }
.cm-tok { padding: .55rem .9rem; border-radius: 10px; border: 1.5px solid var(--navy); background: var(--card); font: 600 1.25rem/1.2 var(--cjk); color: var(--navy); cursor: pointer; }
.cm-tok:hover { background: var(--mist); }

/* personalise bar */
.cm-me { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; padding: .8rem 1rem; border-radius: 14px; background: var(--mist); font-size: .88rem; color: var(--navy); }
.cm-me label { font-weight: 600; }
.cm-me select { padding: .5rem .7rem; border: 1.5px solid var(--mist-line); border-radius: 10px; background: var(--card); font: 500 .9rem var(--sans); color: var(--navy); }

/* date reader */
.cm-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.cm-mo { display: grid; gap: .1rem; padding: .7rem .5rem; text-align: center; border: 1.5px solid var(--mist-line); border-radius: 12px; background: var(--card); cursor: pointer; }
.cm-mo:hover { border-color: var(--navy); background: var(--mist); }
.cm-mo .cm-zh { font-size: 1.3rem; } .cm-mo .cm-py { font-size: .8rem; } .cm-mo .cm-en { font-size: .78rem; }
.cm-datebox { display: grid; gap: 1rem; padding: 1.4rem; border-radius: 20px; border: 1.5px solid var(--navy); background: var(--paper); }
.cm-datebox .ctl { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; }
.cm-datebox .ctl label { display: grid; gap: .25rem; font: 600 .74rem/1 var(--sans); color: var(--ink); letter-spacing: .08em; text-transform: uppercase; }
.cm-datebox .out .cm-zh { font-size: clamp(1.6rem, 1rem + 2.2vw, 2.4rem); line-height: 1.4; }
.cm-fmt { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.cm-fmt > div { padding: 1rem 1.15rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule); }
.cm-fmt .cm-zh { font-size: 1.5rem; }

/* mouth map */
.cm-mm { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 1.5rem; align-items: start; }
.cm-mm-fig { position: relative; border-radius: 18px; overflow: hidden; border: 1.5px solid var(--navy); background: #FBF6EC; }
.cm-mm-fig img { display: block; width: 100%; height: auto; }
.cm-mm-fig svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cm-hs { fill: rgba(201,111,103,0); stroke: rgba(201,111,103,0); stroke-width: 3; transition: fill .2s, stroke .2s; cursor: pointer; }
.cm-hs:hover { fill: rgba(201,111,103,.18); }
.cm-hs.on { fill: rgba(201,111,103,.42); stroke: #B4544C; }
.cm-hs.ok { fill: rgba(111,162,122,.5); stroke: #4E8A5B; }
.cm-hs.no { fill: rgba(201,111,103,.55); stroke: #9C443D; }
.cm-mm-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.cm-mm-info { margin-top: 1rem; padding: 1.1rem 1.2rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule); display: grid; gap: .3rem; min-height: 130px; }
.cm-mm-info .cm-zh { font-size: 2.2rem; line-height: 1.2; }

/* roadmap */
.cm-road { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.6rem .5rem; position: relative; }
.cm-stop { position: relative; display: grid; justify-items: center; text-align: center; gap: .15rem; padding-top: 1.7rem; }
.cm-stop::before { content: ""; position: absolute; top: calc(1.7rem + 26px); left: 50%; width: 100%; border-top: 2.5px dotted #A5B8C6; z-index: 0; }
.cm-stop:nth-child(6n)::before { display: none; }
.cm-stop:last-child::before { display: none; }
.cm-node { position: relative; z-index: 1; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 2.5px solid var(--navy); background: var(--card); font: 700 1.1rem/1 var(--serif); color: var(--navy); cursor: pointer; padding: 0; transition: transform .15s; }
.cm-node:hover { transform: scale(1.08); }
.cm-stop.done .cm-node { background: var(--navy); color: #fff; }
.cm-stop.here .cm-node { background: var(--terra); border-color: var(--terra); color: #fff; box-shadow: 0 0 0 6px rgba(201,111,103,.25); animation: cm-pulse 2.2s ease-in-out infinite; }
.cm-stop.soon .cm-node { border-style: dashed; border-color: #A5B8C6; color: #8DA0B3; cursor: default; }
.cm-stop.soon .cm-node:hover { transform: none; }
.cm-flag { position: absolute; top: 0; left: 50%; transform: translateX(-50%); padding: .25rem .55rem; border-radius: 999px; background: var(--terra-btn); color: #fff; font: 700 .58rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; z-index: 2; }
.cm-stop .zh { margin-top: .55rem; font: 600 1.15rem/1.2 var(--cjk); color: var(--navy); }
.cm-stop .en { font: 600 .82rem/1.2 var(--sans); color: var(--navy); }
.cm-stop .bl { font-size: .72rem; line-height: 1.4; color: var(--ink); max-width: 15ch; }
.cm-stop.soon .zh, .cm-stop.soon .en { color: #7A8CA0; }
@keyframes cm-pulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(201,111,103,.25); } 50% { box-shadow: 0 0 0 11px rgba(201,111,103,.08); } }
.cm-roadbox { position: relative; overflow: hidden; padding: 1.6rem 1.2rem 1.8rem; border-radius: 20px; background: var(--paper); border: 1px solid var(--rule); }
.cm-roadbox .mtn { position: absolute; right: 0; bottom: 0; width: 70%; opacity: .55; pointer-events: none; }
.cm-roadbox > *:not(.mtn) { position: relative; }

/* tones */
.cm-tones { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.cm-tone { display: grid; gap: .35rem; justify-items: center; text-align: center; padding: 1.2rem 1rem; border: 1.5px solid var(--navy); border-radius: 18px; background: var(--paper); cursor: pointer; }
.cm-tone:hover { background: var(--mist); }
.cm-tone .mark { font: 600 3rem/1 var(--cjk); color: var(--navy); }
.cm-tone svg { width: 110px; height: 60px; }
.cm-tone svg path:not(.guide) { stroke-dasharray: 200; stroke-dashoffset: 0; }
.cm-tone.go svg path:not(.guide) { animation: cm-draw 1.1s ease forwards; }
@keyframes cm-draw { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
.cm-tone .ex { margin-top: .3rem; padding-top: .6rem; border-top: 1px solid var(--rule); width: 100%; display: grid; gap: .1rem; }
.cm-tone .ex .cm-zh { font-size: 1.6rem; }

/* goals, checklist, timer, sheet */
.cm-goals { display: grid; gap: .7rem; counter-reset: g; }
.cm-goal { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule); }
.cm-goal .n { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #F5F3ED; font: 600 1.1rem/1 var(--serif); }
.cm-check { display: inline-flex; align-items: center; gap: .5rem; font: 600 .82rem/1 var(--sans); color: var(--navy); cursor: pointer; user-select: none; }
.cm-check input { width: 22px; height: 22px; accent-color: var(--terra-btn); cursor: pointer; }
.cm-steps { display: grid; gap: .7rem; }
.cm-step { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; padding: 1rem 1.2rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule); }
.cm-step.done { background: #EEF5EE; border-color: #B7D3BC; }
.cm-step .peek { margin-top: .5rem; display: none; }
.cm-step.peeking .peek { display: block; }
.cm-timer { display: inline-flex; align-items: center; gap: .8rem; padding: .6rem 1rem; border-radius: 999px; border: 1.5px solid var(--navy); background: var(--card); }
.cm-timer .t { font: 700 1.4rem/1 var(--serif); min-width: 3.4ch; font-variant-numeric: tabular-nums; color: var(--navy); }
.cm-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: 1.2rem; border: 1.5px dashed var(--navy); border-radius: 18px; background: #fff; }
.cm-sheet .cell { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; padding: .7rem .8rem; border: 1px solid var(--rule); border-radius: 12px; }
.cm-sheet .no { font: 700 .8rem/1.6 var(--sans); color: var(--terra-text); }
.cm-sheet .cm-zh { font-size: 1.25rem; line-height: 1.35; } .cm-sheet .cm-py { font-size: .8rem; } .cm-sheet .cm-en { font-size: .82rem; }
.cm-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.cm-prev { display: grid; gap: .15rem; max-width: 46%; min-width: 0; padding: .6rem 1rem .65rem .8rem; border: 1.5px solid var(--rule); border-radius: 12px; text-decoration: none; color: var(--navy); transition: border-color .15s, background-color .15s; }
.cm-prev:hover { border-color: var(--navy); background: var(--mist); }
.cm-prev .k { display: inline-flex; align-items: center; gap: .2rem; font: 600 .68rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.cm-prev .k svg { display: block; width: 14px; height: 14px; }
.cm-prev .t { font: 600 .9rem/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-next { display: grid; justify-items: end; gap: .4rem; margin-left: auto; text-align: right; }
.cm-next .btn { min-height: 48px; padding: .8rem 1.5rem; }
.cm-next .t { font-size: .8rem; line-height: 1.4; color: var(--ink); max-width: 34ch; }
.cm-hero { position: relative; overflow: hidden; border-radius: 20px; }
.cm-hero img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.cm-hero .cap { position: absolute; left: 1.2rem; bottom: 1.2rem; padding: .9rem 1.2rem; border-radius: 14px; background: rgba(251,250,247,.94); box-shadow: var(--shadow-md); }
.cm-hero .cap .cm-zh { font-size: 2.2rem; line-height: 1.1; }
.cm-two { display: grid; grid-template-columns: 1.05fr .95fr; gap: 1.5rem; align-items: center; }
.cm-two img { width: 100%; border-radius: 18px; display: block; }

@media (max-width: 1000px) {
  /* block (not grid) so the lesson bar can stay stuck under the site header all the way down the page */
  .cm-wrap { display: block; }
  .cm-side { position: static; max-height: none; display: none; }
  .cm-side.open { display: block; position: fixed; z-index: 130; top: 0; bottom: 0; left: 0; width: min(360px, 88vw); max-height: none; margin: 0; border-radius: 0 18px 18px 0; border-left: 0; padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 2rem); overflow: auto; overscroll-behavior: contain; box-shadow: var(--shadow-lg); animation: cm-drawer .24s cubic-bezier(.2,.7,.2,1); }
  .cm-side.open .cm-side-head { padding-right: 2.75rem; }
  .cm-side.open .cm-side-x { display: grid; place-items: center; position: absolute; top: calc(env(safe-area-inset-top, 0px) + .85rem); right: .8rem; width: 40px; height: 40px; border: 1.5px solid var(--mist-line); border-radius: 50%; background: var(--card); color: var(--navy); cursor: pointer; }
  .cm-side-x svg { width: 18px; height: 18px; }
  .cm-scrim { position: fixed; inset: 0; z-index: 120; background: rgba(8,44,75,.42); animation: cm-fade .2s ease; }
  html.cm-lock, html.cm-lock body { overflow: hidden; }
  .cm-menu-btn { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); z-index: 60; display: flex; align-items: center; gap: .75rem; width: 100%; margin-bottom: 1rem; padding: .55rem .6rem .55rem 1rem; border: 1px solid var(--rule); border-radius: 14px; background: rgba(251,250,247,.95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: var(--shadow-sm); color: var(--navy); text-align: left; cursor: pointer; }
  .cm-mb-txt { display: grid; gap: .1rem; flex: 1; min-width: 0; }
  .cm-mb-kicker { font: 600 .64rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--terra-text); }
  .cm-mb-kicker:empty { display: none; }
  .cm-mb-title { font: 600 .92rem/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cm-mb-icon { display: inline-flex; align-items: center; gap: .4rem; flex: none; padding: .55rem .8rem; border-radius: 10px; background: var(--navy); color: #F5F3ED; font: 600 .78rem/1 var(--sans); }
  .cm-mb-icon svg { width: 16px; height: 16px; }
  .cm-road { grid-template-columns: repeat(3, 1fr); }
  .cm-stop:nth-child(6n)::before { display: block; } .cm-stop:nth-child(3n)::before { display: none; }
  .cm-two { grid-template-columns: minmax(0, 1fr); }
  .cm-mm { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .cm-meta > span:not(.cm-donechip) { display: none; }   /* the sticky lesson bar already shows the position */
}
@media (max-width: 640px) {
  .cm-hero .cap { position: static; border-radius: 0 0 14px 14px; box-shadow: none; background: #FBFAF7; }
  .cm-hero img { max-height: 210px; }
  .cm-vs { grid-template-columns: 1fr; }
  /* roadmap keeps three stops per row on phones (four short rows instead of six long ones) */
  .cm-road { gap: 1.3rem .25rem; }
  .cm-roadbox { padding: 1.3rem .6rem 1.4rem; }
  .cm-stop .bl { font-size: .66rem; }
  .cm-sheet { grid-template-columns: 1fr; }
  .cm-goal { grid-template-columns: auto 1fr; } .cm-goal .cm-check { grid-column: 1 / -1; }
  .cm-fc { height: 340px; }
}
@keyframes cm-drawer { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes cm-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cm-fc-in { transition: none; } .cm-stop.here .cm-node { animation: none; } .cm-tone.go svg path { animation: none; } .cm-side.open, .cm-scrim { animation: none; } }
/* Printing a phrase sheet prints just the sheet, on one page (other pages print normally) */
@media print {
  body:has([data-page="course"]:not([hidden]) .cm-sheet) { background: #fff; }
  body:has([data-page="course"]:not([hidden]) .cm-sheet) > :not(main),
  body:has([data-page="course"]:not([hidden]) .cm-sheet) .cm-side,
  body:has([data-page="course"]:not([hidden]) .cm-sheet) .cm-menu-btn,
  body:has([data-page="course"]:not([hidden]) .cm-sheet) .cm-panel > :not(.cm-body),
  body:has([data-page="course"]:not([hidden]) .cm-sheet) .cm-body > :not(.cm-sheet) { display: none !important; }
  body:has([data-page="course"]:not([hidden]) .cm-sheet) .cm-wrap,
  body:has([data-page="course"]:not([hidden]) .cm-sheet) .cm-body { display: block; max-width: none; margin: 0; padding: 0; }
  body:has([data-page="course"]:not([hidden]) .cm-sheet) .cm-panel { padding: 0; border: 0; box-shadow: none; background: none; }
  .cm-sheet { border: 0; padding: 0; }
}

.cm-datebox select { padding: .65rem .7rem; border: 1.5px solid var(--mist-line); border-radius: 10px; background: var(--card); font: 500 1rem var(--sans); color: var(--navy); }

.cm-gh .cm-cnt { margin-left: .6rem; font: 600 .68rem/1 var(--sans); letter-spacing: .06em; color: var(--ink); background: var(--paper-deep); padding: .2rem .45rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.cm-gh .cm-cnt.part { background: #F8E4E0; color: var(--terra-text); }
.cm-gh .cm-cnt.full { background: var(--terra-btn); color: #fff; }
.cm-optzh { font-family: var(--cjk); font-size: 1.15rem; }

/* modules 2-4 components */
.cm-tagchip { display: inline-block; padding: .25rem .6rem; border-radius: 999px; background: var(--terra-btn); color: #fff; font: 700 .62rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.cm-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; }
.cm-stage { display: grid; gap: .25rem; justify-items: center; text-align: center; padding: 1rem .6rem; border: 1.5px solid var(--mist-line); border-radius: 16px; background: var(--card); cursor: pointer; transition: border-color .15s, background-color .15s; }
.cm-stage:hover { border-color: var(--navy); }
.cm-stage.on { border-color: var(--navy); background: var(--mist); box-shadow: inset 0 0 0 1.5px var(--navy); }
.cm-stage .n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #F5F3ED; font: 700 .8rem var(--sans); }
.cm-stage .e { font: 600 .78rem/1.2 var(--sans); color: var(--ink); }
.cm-pwords { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .7rem; }
.cm-pw { display: grid; gap: .35rem; justify-items: center; text-align: center; padding: .9rem .6rem; border: 1.5px solid var(--navy); border-radius: 16px; background: var(--paper); cursor: pointer; }
.cm-pw:hover { background: var(--mist); }
.cm-pw .tones { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.cm-pw .tn { display: grid; justify-items: center; gap: .1rem; }
.cm-pw .tn svg { width: 44px; height: 24px; }
.cm-soft { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cm-sc { display: grid; gap: .4rem; padding: 1.2rem; border-radius: 18px; border: 1.5px solid var(--mist-line); background: var(--paper); align-content: start; transition: background-color .2s; }
.cm-sc.pro { background: var(--navy); border-color: var(--navy); }
.cm-sc .tag { font: 700 .64rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--terra-text); }
.cm-sc .cm-zh { font-size: 1.7rem; line-height: 1.3; }
.cm-sc.pro .tag, .cm-sc.pro .cm-py { color: #EDB9B2; }
.cm-sc.pro .cm-zh { color: #F5F3ED; } .cm-sc.pro .cm-en { color: #D5E0EA; }
.cm-sc.pro .cm-chipbtn, .cm-sc.pro .cm-say { color: #F5F3ED; border-color: rgba(245,243,237,.6); background: transparent; }
.cm-sc.pro .cm-say:hover, .cm-sc.pro .cm-chipbtn:hover { background: #F5F3ED; color: var(--navy); }

/* ---------- module knowledge check ---------- */
.cm-exam { display: grid; gap: 1rem; justify-items: center; }
.cm-exam > *, .cm-exam > .cm-q, .cm-exam > .cm-opts { width: min(560px, 100%); }
.cm-exam-top { display: flex; justify-content: space-between; align-items: center; font: 600 .85rem/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.cm-exam .cm-prog { width: min(560px, 100%); }
.cm-exam .cm-q .cm-zh.sent { font-size: 1.7rem; line-height: 1.35; }
.cm-exam-tag { font: 700 .66rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--terra-text); background: #F8E4E0; padding: .35rem .6rem; border-radius: 999px; }
.cm-exam-ask { font: 600 1.08rem/1.45 var(--serif); color: var(--navy); }
.cm-opt.zh { font: 600 1.2rem/1.4 var(--cjk); }
.cm-streak { color: var(--ink); transition: color .2s; }
.cm-streak.hot { color: var(--terra-text); }
.cm-exam-fb { display: grid; gap: .35rem; justify-items: center; text-align: center; padding: 1rem 1.1rem; border-radius: 16px; }
.cm-exam-fb.ok { background: #E4F0E4; }
.cm-exam-fb.no { background: #F8E4E0; }
.cm-exam-fb > b { font: 700 1.05rem/1.3 var(--sans); color: var(--navy); }
.cm-exam-fb .cm-zh { font-size: 1.2rem; }
.cm-exam-order { display: grid; gap: .8rem; }
.cm-answer.right { border-color: #6FA27A; background: #E4F0E4; }
.cm-answer.wrong { border-color: var(--terra); background: #F8E4E0; }
.cm-exam-card { position: relative; display: grid; gap: .8rem; justify-items: center; text-align: center; padding: 1.8rem 1.4rem; border-radius: 20px; background: var(--paper); border: 1px solid var(--rule); }
.cm-exam-card p { max-width: 44ch; color: var(--ink); }
.cm-exam-stats { display: flex; gap: 1.6rem; flex-wrap: wrap; justify-content: center; }
.cm-exam-stats div { display: grid; gap: .15rem; font: 500 .8rem/1.2 var(--sans); color: var(--ink); }
.cm-exam-stats b { font: 700 1.9rem/1 var(--serif); color: var(--navy); }
.cm-exam-best { font: 600 .9rem/1.3 var(--sans); color: var(--navy); background: var(--mist); padding: .45rem .9rem; border-radius: 999px; }
.cm-big-score { font: 700 3.2rem/1 var(--serif); color: var(--navy); font-variant-numeric: tabular-nums; }
.cm-stamp { position: absolute; top: 1rem; right: 1rem; font: 600 1.35rem/1 var(--cjk); color: var(--chop); border: 3px solid var(--chop); border-radius: 8px; padding: .4rem .5rem; transform: rotate(8deg); opacity: .9; animation: cm-stamp .45s cubic-bezier(.2,.7,.2,1.4) both; }
@keyframes cm-stamp { from { transform: rotate(8deg) scale(1.8); opacity: 0; } to { transform: rotate(8deg) scale(1); opacity: .9; } }
.cm-review { display: grid; gap: .6rem; }
.cm-review > div { display: grid; gap: .25rem; padding: .8rem 1rem; border-radius: 12px; background: var(--card); border: 1px solid var(--rule); text-align: left; }
.cm-review > div > div:last-child { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cm-review .cm-zh { font-size: 1.15rem; }
@media (prefers-reduced-motion: reduce) { .cm-stamp { animation: none; } }

/* lessons with a tall (portrait) picture: narrower picture column that stays in view while you read */
@media (min-width: 1001px) {
  .cm-two:has(> .cm-scene.tall) { grid-template-columns: minmax(0, .72fr) 1.28fr; align-items: start; }
  /* a picture beside a list of phrases: give the phrases the wider column so long sentences don't wrap mid-phrase */
  .cm-two:has(> .cm-lines):not(:has(> .cm-scene.tall)) { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
  /* pictures stay in view while you read; offset clears the sticky site header */
  .cm-two > .cm-scene.tall { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); }
  .cm-two > .cm-scene { align-self: start; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); }
}

/* ==========================================================================
   Course player: shared lesson components
   ========================================================================== */
/* view options (top of a lesson): Pinyin / English on or off, and the cover-the-English self-test */
.cm-body > .cm-view { order: -1; }
.cm-view { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .45rem; margin-bottom: -.4rem; }
.cm-view .lbl { margin-right: .1rem; font: 600 .66rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.cm-view .sep { width: 1px; height: 1.3rem; margin: 0 .2rem; background: var(--rule); }
.cm-vt { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem .4rem .45rem; border: 1.5px solid var(--mist-line); border-radius: 999px; background: var(--card); color: var(--ink); font: 600 .78rem/1 var(--sans); cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
.cm-vt:hover { border-color: var(--navy); color: var(--navy); }
.cm-vt .box { display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #9FB1C3; background: var(--card); color: transparent; transition: background-color .15s, border-color .15s; }
.cm-vt .box svg { width: 10px; height: 10px; }
.cm-vt[aria-pressed="true"] { border-color: var(--navy); color: var(--navy); }
.cm-vt[aria-pressed="true"] .box { background: var(--navy); border-color: var(--navy); color: #fff; }
.cm-vt.cover[aria-pressed="true"] { background: var(--navy); color: #F5F3ED; }
.cm-vt.cover[aria-pressed="true"] .box { background: var(--terra); border-color: var(--terra); }
.cm-peekbtn { display: none; }
.cm-body.covering .cm-line { cursor: pointer; }
.cm-body.covering .cm-line:not(.peek) .cm-en { display: none; }
.cm-body.covering .cm-line:not(.peek) .cm-peekbtn { display: inline-flex; margin-top: .35rem; padding: .3rem .65rem; border: 1.5px dashed #A5B8C6; border-radius: 8px; background: transparent; font: 600 .76rem/1.2 var(--sans); color: var(--ink); cursor: pointer; }
.cm-body.covering .cm-line:not(.peek) .cm-peekbtn:hover { border-color: var(--navy); color: var(--navy); }
.cm-body.covering .cm-line.peek .cm-en { animation: cm-fade .25s ease; }

/* the learner's own name / role inside a phrase */
.cm-slot { border-bottom: 2px dotted rgba(201,111,103,.7); }
.cm-bub.you .cm-slot { border-bottom-color: rgba(237,185,178,.85); }
.cm-line .txt, .cm-bub .txt { min-width: 0; }

/* "Practising as …" bar */
.cm-me { gap: .6rem .9rem; padding: .65rem .8rem .65rem .7rem; }
.cm-me .av { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #F5F3ED; font: 600 1rem/1 var(--serif); }
.cm-me .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; flex: 1; min-width: 0; }
.cm-me .k { font: 600 .66rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.cm-me .who b { font: 600 1rem/1.3 var(--sans); color: var(--navy); }
.cm-me .role { color: var(--ink); }
.cm-me.editing { padding: .8rem .9rem; }
.cm-me.editing > .k { flex-basis: 100%; }
.cm-me-fields { display: flex; flex-wrap: wrap; gap: .5rem; flex: 1 1 18rem; min-width: 0; }
.cm-me-fields input { flex: 1 1 9rem; min-width: 0; }
.cm-me-fields select { flex: 1 1 12rem; min-width: 0; }
.cm-me .btn-sm { min-height: 44px; }
.cm-linkbtn { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .15rem; border: 0; background: none; font: 600 .82rem/1.2 var(--sans); color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cm-linkbtn:hover { color: var(--terra-text); }
.cm-linkbtn svg { display: block; width: 14px; height: 14px; }

/* segmented control */
.cm-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-deep); border: 1px solid var(--rule); }
.cm-seg button { padding: .5rem 1rem; border: 0; border-radius: 999px; background: transparent; font: 600 .8rem/1.1 var(--sans); color: var(--ink); cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s; }
.cm-seg button:hover { color: var(--navy); }
.cm-seg button[aria-pressed="true"] { background: var(--card); color: var(--navy); box-shadow: 0 1px 2px rgba(10,56,96,.14), 0 0 0 1px rgba(10,56,96,.14); }
.cm-seg.sm button { padding: .42rem .8rem; font-size: .76rem; }

/* flash-card deck */
.cm-deck { gap: 1rem; }
.cm-settabs { display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; border-bottom: 1.5px solid var(--rule); }
.cm-settab { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: -1.5px; padding: .55rem .1rem .65rem; border: 0; border-bottom: 3px solid transparent; background: none; font: 600 .88rem/1.2 var(--sans); color: var(--ink); cursor: pointer; }
.cm-settab:hover { color: var(--navy); }
.cm-settab[aria-pressed="true"] { color: var(--navy); border-bottom-color: var(--terra); }
.cm-settab .n { min-width: 1.5rem; padding: .15rem .4rem; border-radius: 999px; background: var(--paper-deep); font-size: .7rem; text-align: center; }
.cm-settab[aria-pressed="true"] .n { background: var(--navy); color: #fff; }
.cm-deckbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.cm-fc-box { position: relative; width: min(440px, 100%); }
.cm-fc-box .cm-fc { width: 100%; }
.cm-fc-say { position: absolute; top: .8rem; right: .8rem; z-index: 2; }
.cm-known { position: absolute; top: 1rem; left: .95rem; z-index: 2; padding: .22rem .55rem; border-radius: 999px; background: #E4F0E4; color: #2F6B3F; font: 700 .66rem/1.3 var(--sans); letter-spacing: .06em; pointer-events: none; }
.cm-fc-grade { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; }
.cm-iconbtn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1.5px solid var(--mist-line); border-radius: 50%; background: var(--card); color: var(--navy); cursor: pointer; transition: border-color .15s, background-color .15s; }
.cm-iconbtn:hover { border-color: var(--navy); background: var(--mist); }
.cm-iconbtn svg { width: 18px; height: 18px; }
.cm-fc-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem .8rem; width: min(440px, 100%); }
.cm-fc-meta .cm-prog { flex: 1 1 70px; width: auto; }
.cm-deckdone { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem; width: min(520px, 100%); padding: .8rem 1rem; border-radius: 14px; background: #EEF5EE; border: 1px solid #B7D3BC; color: var(--navy); font-size: .9rem; text-align: center; }
.cm-en.big { font-size: 1.3rem; font-weight: 600; line-height: 1.35; color: var(--navy); }
.cm-face .cm-en.big { font-size: 1.45rem; text-align: center; }
.cm-q .cm-en.big { text-align: center; }

/* dialogue */
.cm-dlg-wrap { display: grid; gap: .85rem; }
.cm-dlg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.cm-dlg-hint { margin-top: -.25rem; font-size: .85rem; color: var(--ink); }
.cm-play svg { display: block; width: 11px; height: 11px; }
.cm-bub { justify-self: start; }
.cm-bub.masked .cm-en::before { content: "Your line · "; font-weight: 600; color: #EDB9B2; }
.cm-body.hide-en .cm-bub.masked .cm-en { display: block; }

/* sentence builder */
.cm-build-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cm-build > .cm-en.big { font-size: 1.12rem; }
.cm-tok:disabled { cursor: default; }
.cm-tools .btn:disabled, .cm-chipbtn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* timer */
.cm-timer { gap: .7rem; padding: .5rem .6rem .5rem 1.1rem; }
.cm-timer .cm-gloss { margin-left: -.35rem; }
.cm-timer.over .t { color: var(--terra-text); }

/* roadmap: a ring shows how far into a module you are */
.cm-stop.started .cm-node::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: conic-gradient(var(--terra) calc(var(--p, 0) * 1turn), rgba(10,56,96,.1) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
.cm-stop.here.started .cm-node { animation: none; box-shadow: none; }

/* mobile: more room for the lesson itself */
@media (max-width: 640px) {
  .cm-wrap { padding: .75rem .75rem 3rem; }
  .cm-menu-btn { top: calc(env(safe-area-inset-top, 0px) + 80px); }
  .cm-panel { padding: 1.25rem 1rem 1.4rem; border-radius: 18px; }
  .cm-body { margin-top: 1.25rem; gap: 1.2rem; }
  .cm-line { padding: .85rem .9rem; gap: .75rem; }
  .cm-line .cm-zh { font-size: 1.35rem; }
  .cm-bub { max-width: 100%; padding: .85rem 1rem; }
  .cm-bub .cm-zh { font-size: 1.3rem; }
  .cm-build, .cm-frame, .cm-datebox, .cm-choose { padding: 1rem; }
  .cm-view { justify-content: flex-start; }
  .cm-nav { flex-direction: column-reverse; align-items: stretch; }
  .cm-next { justify-items: stretch; text-align: center; margin-left: 0; }
  .cm-next .btn { width: 100%; }
  .cm-next .t { max-width: none; }
  .cm-prev { max-width: none; }
  .cm-scene { max-height: 230px; }
  .cm-scene.tall { max-height: 300px; }
  .cm-deckbar { justify-content: center; }
  .cm-fc-grade { flex-wrap: nowrap; gap: .45rem; }
  .cm-fc-grade .btn { flex: 1 1 0; min-width: 0; padding-inline: .35rem; font-size: .78rem; white-space: nowrap; }
  .cm-fc-grade .cm-iconbtn { width: 36px; height: 36px; }
  /* card-set tabs scroll sideways instead of wrapping */
  .cm-settabs { flex-wrap: nowrap; overflow-x: auto; padding-right: 2.5rem; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent); }
  .cm-settabs::-webkit-scrollbar { display: none; }
  .cm-settab { flex: none; white-space: nowrap; }
}

/* ==========================================================================
   Course player: Start Here + Module 1 page layouts
   (sizes follow the width of the lesson itself, not the window)
   ========================================================================== */
.cm-body { container: lesson / inline-size; }
.cm-slot { border-bottom-width: 1.5px; }

/* section heading inside a lesson */
.cm-sec { display: grid; gap: .25rem; margin-bottom: .85rem; }
.cm-sec h3 { font-size: 1.2rem; }
.cm-sec.row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; }
.cm-count { padding: .22rem .65rem; border-radius: 999px; background: var(--paper-deep); font: 600 .76rem/1.3 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 1001px) {
  .cm-two.wide-r { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
}

/* welcome */
.cm-resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; padding: 1.1rem 1.3rem; border-radius: 18px; background: var(--navy); color: #F5F3ED; box-shadow: var(--shadow-md); }
.cm-resume .k { font: 600 .7rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #EDB9B2; }
.cm-resume .t { margin-top: .25rem; font: 600 1.3rem/1.25 var(--serif); color: #fff; }
.cm-resume .cm-gloss { margin-top: .25rem; color: #D5E0EA; }
.cm-resume .btn { box-shadow: 0 0 0 2px rgba(245,243,237,.25); }
.cm-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.cm-facts li { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; border-radius: 14px; background: var(--paper); border: 1px solid var(--rule); font-size: .84rem; line-height: 1.35; color: var(--ink); }
.cm-facts b { display: grid; place-items: center; flex: none; min-width: 2.6rem; height: 2.6rem; padding: 0 .45rem; border-radius: 12px; background: var(--mist); font: 700 1.15rem/1 var(--serif); color: var(--navy); }
.cm-facts b svg { width: 20px; height: 20px; }
@container lesson (min-width: 700px) { .cm-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cm-wgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@container lesson (min-width: 720px) { .cm-wgrid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); } }
.cm-howlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.cm-howlist li { display: grid; grid-template-columns: auto 1fr; gap: .85rem; align-items: start; }
.cm-howlist .n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #F5F3ED; font: 600 .95rem/1 var(--serif); }
.cm-howlist b { display: block; font: 600 1rem/1.35 var(--sans); color: var(--navy); }
.cm-howlist p { margin-top: .15rem; font-size: .92rem; line-height: 1.55; color: var(--ink); }
.cm-mine { gap: .8rem; border-color: var(--mist-line); }
.cm-mine .cm-line { background: var(--card); }
.cm-mine .cm-line .cm-zh { font-size: 1.3rem; }
.cm-skip { font-size: .9rem; color: var(--ink); }
.cm-skip a { font-weight: 600; color: var(--terra-text); text-underline-offset: 3px; }

/* journey */
.cm-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: -.6rem; font-size: .78rem; color: var(--ink); }
.cm-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.cm-legend i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--navy); background: var(--card); }
.cm-legend i.here { background: var(--terra); border-color: var(--terra); }
.cm-legend i.started { border-color: var(--terra); background: conic-gradient(var(--terra) 0 .45turn, var(--card) 0); }
.cm-legend i.done { background: var(--navy); }
.cm-upnext { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.2rem; align-items: center; padding: 1.2rem 1.3rem; border-radius: 18px; background: var(--mist); border: 1px solid var(--mist-line); }
.cm-upnext .num { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--terra); color: #fff; font: 700 1.35rem/1 var(--serif); box-shadow: 0 0 0 6px rgba(201,111,103,.2); }
.cm-upnext .k { font: 600 .7rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--terra-text); }
.cm-upnext .t { margin-top: .15rem; font: 600 1.2rem/1.3 var(--serif); color: var(--navy); }
.cm-upnext .t .zh { margin-right: .5rem; font-family: var(--cjk); }
.cm-upnext p { margin-top: .3rem; font-size: .92rem; color: var(--ink); }
.cm-upnext .btn { grid-column: 1 / -1; justify-self: start; }
@container lesson (min-width: 700px) { .cm-upnext { grid-template-columns: auto 1fr auto; } .cm-upnext .btn { grid-column: auto; } }

/* tones: four across when there is room, two by two otherwise (never three and an orphan) */
.cm-tones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
@container lesson (min-width: 640px) { .cm-tones { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
button.cm-tone { position: relative; width: 100%; font: inherit; color: inherit; gap: .3rem; padding: .9rem .8rem 1rem; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.cm-tone > span { display: block; }
.cm-tone > .top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.cm-tone .top .cm-gloss { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cm-tone .spk { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--mist-line); color: var(--navy); transition: background-color .15s, color .15s, border-color .15s; }
.cm-tone .spk svg { width: 15px; height: 15px; }
.cm-tone:hover .spk, .cm-tone.playing .spk { background: var(--navy); border-color: var(--navy); color: #fff; }
.cm-tone.playing { border-color: var(--terra); box-shadow: 0 0 0 3px rgba(201,111,103,.3); }
.cm-tone .shape { width: 100%; }
.cm-tone .shape svg { display: block; width: 100%; max-width: 120px; height: auto; margin-inline: auto; }
.cm-tone .d { font-size: .86rem; line-height: 1.35; min-height: 2.7em; }
.cm-pick .cm-tonepick { display: grid; justify-items: center; gap: .15rem; min-width: 0; width: 88px; padding: .55rem .4rem .5rem; font: 600 .78rem/1.2 var(--sans); }
.cm-tonepick .shape svg { display: block; width: 64px; height: 35px; }
.cm-tonepick .l { color: var(--ink); }
.cm-sandhi { grid-template-columns: 1fr; }
@container lesson (min-width: 560px) { .cm-sandhi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-sandhi > div { display: grid; gap: .2rem; align-content: start; }
.cm-sandhi .row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.cm-sandhi .cm-en { font-size: .88rem; }
.cm-fmt.cm-sandhi .k { text-transform: none; letter-spacing: .04em; font-size: .8rem; }
.cm-fmt .cm-zh { font-size: 1.3rem; line-height: 1.35; }
.cm-fmt .k { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--terra-text); }

/* checklists: the whole row is the tick box */
.cm-checklist { display: grid; gap: .55rem; }
.cm-checkrow { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: center; padding: .8rem 1rem; border-radius: 14px; background: var(--paper); border: 1.5px solid var(--rule); color: var(--navy); cursor: pointer; transition: background-color .15s, border-color .15s; }
.cm-checkrow:hover { border-color: #A5B8C6; }
.cm-checkrow input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cm-checkrow .box { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #9FB1C3; background: var(--card); color: transparent; transition: background-color .15s, border-color .15s; }
.cm-checkrow .box svg { width: 14px; height: 14px; }
.cm-checkrow input:focus-visible + .box { outline: 3px solid var(--navy); outline-offset: 2px; }
.cm-checkrow.on { background: #EEF5EE; border-color: #B7D3BC; }
.cm-checkrow.on .box { background: #4E8A5B; border-color: #4E8A5B; color: #fff; }
.cm-checkrow .t { font-size: .95rem; line-height: 1.5; }
.cm-checkrow.goal .t { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: center; }
.cm-checkrow.goal .ican { font: 700 .64rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #9FB1C3; white-space: nowrap; }
.cm-checkrow.goal.on .ican { color: #2F6B3F; }
.cm-checkrow.sm { justify-self: start; padding: .45rem .9rem .45rem .6rem; font-weight: 600; }
.cm-checkrow.sm .box { width: 20px; height: 20px; border-radius: 6px; }

/* module overview on the goal page */
.cm-modmap { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
@container lesson (min-width: 620px) { .cm-modmap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-modmap a { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; height: 100%; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--paper); text-decoration: none; color: var(--navy); transition: border-color .15s, background-color .15s; }
.cm-modmap a:hover { border-color: var(--navy); background: var(--mist); }
.cm-modmap .p { font: 700 .64rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--terra-text); white-space: nowrap; }
.cm-modmap .t { font: 600 .9rem/1.3 var(--sans); }
.cm-modmap .c { font-size: .76rem; color: var(--ink); white-space: nowrap; }
.cm-modmap li.done .c { color: #2F6B3F; font-weight: 600; }
.cm-modmap li.part .c { color: var(--terra-text); font-weight: 600; }

/* sample answers drawer */
.cm-samples { margin-top: .55rem; }
.cm-samples summary { display: inline-flex; align-items: center; gap: .4rem; font: 600 .8rem/1.3 var(--sans); color: var(--terra-text); cursor: pointer; list-style: none; }
.cm-samples summary::-webkit-details-marker { display: none; }
.cm-samples summary::before { content: "+"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; font-size: .85rem; line-height: 1; }
.cm-samples[open] summary::before { content: "–"; }
.cm-samples-in { display: grid; gap: .5rem; margin-top: .6rem; }
.cm-sample { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; padding: .6rem .75rem; border-radius: 12px; background: var(--card); border: 1px dashed var(--mist-line); }
.cm-line .cm-sample .cm-zh { font-size: 1.15rem; line-height: 1.4; }
.cm-sample .cm-py { font-size: .85rem; }
.cm-sample .cm-en { font-size: .82rem; }
.cm-line:has(.cm-samples[open]) { align-items: start; }

/* key patterns */
.cm-patterns { display: grid; gap: 1rem; }
.cm-pat { gap: .8rem; border: 1px solid var(--rule); }
.cm-pat-head { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; align-items: center; }
.cm-pat-head .num { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #F5F3ED; font: 600 1rem/1 var(--serif); }
.cm-pat-head .formula { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.cm-pat-head .formula .cm-zh { font-size: 1.3rem; line-height: 1.2; }
.cm-pat-head .plus { font-weight: 600; color: var(--ink); }
.cm-pat-head .slot { padding: .12rem .6rem; border: 2px dashed var(--terra); border-radius: 8px; font: 600 .78rem/1.3 var(--sans); color: var(--terra-text); }
.cm-pat-out { display: grid; gap: .3rem; padding-top: .8rem; border-top: 1px solid var(--rule); }
.cm-pat-out .cm-tools { margin-top: .5rem; }

/* dates */
.cm-datebox .out .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cm-datebox .ctl .cm-seg { align-self: end; margin-bottom: 2px; }
@container lesson (max-width: 520px) {
  .cm-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cm-datebox .out .cm-zh { font-size: 1.25rem; }
}

/* mouth map */
.cm-mm { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.5rem; }
.cm-mm-figwrap { display: grid; gap: .4rem; align-self: start; }
.cm-mm-sides { display: flex; justify-content: space-between; font: 600 .64rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.cm-mm-sides span:first-child::before { content: "← "; }
.cm-mm-sides span:last-child::after { content: " →"; }
/* two views side by side (Dermatology body chart: front · back): each label sits over its own half, no arrows */
.cm-mm-sides.plain { display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
.cm-mm-sides.plain span::before, .cm-mm-sides.plain span::after { content: none; }
.cm-mm.wide { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.cm-mm-fig { cursor: pointer; }
.cm-mm-fig .cm-hs { pointer-events: none; }
.cm-mm-side, .cm-mm-panel { display: grid; gap: .9rem; align-content: start; }
.cm-mm-chips .cm-chipbtn { gap: .35rem; }
.cm-mm-chips .z { font: 600 .95rem/1 var(--cjk); }
.cm-mm-chips .p { font-weight: 500; opacity: .85; }
.cm-mm-info { margin-top: 0; min-height: 0; }
.cm-mm-word { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cm-mm-info .cm-mm-word .cm-zh { font-size: 2.2rem; line-height: 1.15; }
.cm-mm-game { display: grid; gap: .6rem; padding: 1.1rem 1.2rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule); }
.cm-mm-game .cm-mm-word .cm-zh { font-size: 2.4rem; line-height: 1.15; }
.cm-mm-game .cm-prog { width: 100%; }
@media (min-width: 1001px) { .cm-mm-figwrap { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); } }

/* allergy answers */
.cm-words { display: grid; gap: .6rem; }
@container lesson (min-width: 600px) { .cm-words { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-word { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; padding: .8rem .9rem; border-radius: 14px; background: var(--paper); border: 1px solid var(--rule); }
.cm-word .cm-zh { font-size: 1.25rem; line-height: 1.35; }
.cm-word .cm-py, .cm-word .cm-en { font-size: .85rem; }

/* role-plays */
.cm-brief { display: grid; gap: .6rem; align-content: start; padding: 1.2rem 1.3rem; border-radius: 18px; background: var(--mist); }
.cm-brief p { font-size: .95rem; color: var(--navy); }
.cm-brief .cm-timer { justify-self: start; margin-top: .2rem; }
.cm-rules { margin: 0; padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .95rem; color: var(--navy); }
.cm-step-t { margin-bottom: .55rem; }
.cm-step.done .cm-step-t { color: #2F6B3F; }
.cm-step .peek .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border-radius: 12px; background: var(--card); border: 1px dashed var(--mist-line); }
.cm-step .peek .cm-zh { font-size: 1.3rem; line-height: 1.4; }
.cm-rounds { display: grid; gap: .8rem; }
.cm-round { display: grid; gap: .65rem; padding: 1rem 1.15rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule); }
.cm-round-h { display: flex; align-items: center; gap: .6rem; }
.cm-round-h .lvl { font: 600 .8rem/1 var(--sans); color: var(--ink); }
.cm-round-b { display: grid; gap: .6rem; color: var(--navy); }
.cm-round-b p { font-size: .96rem; }
.cm-round-b .cm-timer { justify-self: start; }
.cm-quote { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: center; padding: .8rem 1rem; border-radius: 16px 16px 16px 5px; background: var(--mist); border: 1px solid var(--mist-line); }
.cm-quote .cm-zh { font-size: 1.35rem; line-height: 1.4; }
.cm-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; padding: 1rem 1.2rem; border-radius: 16px; border: 1.5px dashed var(--mist-line); background: var(--card); }
.cm-cta b { font: 600 1.05rem/1.3 var(--serif); color: var(--navy); }
.cm-cta p { margin-top: .15rem; max-width: 52ch; font-size: .9rem; color: var(--ink); }

/* homework */
.cm-task { display: grid; gap: .8rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.cm-task-h { display: flex; align-items: center; gap: .7rem; }
.cm-task-h h3 { font-size: 1.2rem; }
.cm-task > .cm-gloss { margin-top: -.35rem; }

/* phrase sheet */
.cm-sheet-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; padding: 0 .2rem .6rem; border-bottom: 1px solid var(--rule); }
.cm-sheet-head .cm-zh { font-size: 1.2rem; }
.cm-sheet-head span:last-child { font: 600 .68rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.cm-sheet .cell { grid-template-columns: auto 1fr auto; }
.cm-sheet .cell .cm-say { width: 34px; height: 34px; align-self: center; }
.cm-sheet .cell .cm-say svg { width: 15px; height: 15px; }
@media print {
  .cm-sheet .cm-say { display: none; }
  .cm-sheet .cell { grid-template-columns: auto 1fr; break-inside: avoid; }
  .cm-sheet .cm-slot { border: 0; }
}

/* module finish */
.cm-finale { display: grid; gap: .3rem; align-content: center; }
.cm-finale .row { display: flex; align-items: center; gap: 1rem; }
.cm-finale .row .cm-zh { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.4rem); line-height: 1.15; }
.cm-finale .cm-py { font-size: 1.15rem; }
.cm-finale p { margin-top: .8rem; max-width: 44ch; color: var(--ink); }
.cm-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
@container lesson (min-width: 600px) { .cm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-stats li { display: grid; gap: .3rem; align-content: start; padding: .9rem 1rem; border-radius: 14px; background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--terra); }
.cm-stats b { font: 700 1.6rem/1 var(--serif); color: var(--navy); font-variant-numeric: tabular-nums; }
.cm-stats span { font-size: .84rem; line-height: 1.4; color: var(--ink); }

/* phones: mouth map stacks as mode → picture → word → chips, so a tapped word and its highlight share one screen */
@media (max-width: 640px) {
  .cm-mm { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .cm-mm-side, .cm-mm-panel { display: contents; }
  .cm-mm-side > .cm-seg { order: 1; justify-self: center; }
  .cm-mm-figwrap { order: 2; width: min(240px, 72%); justify-self: center; }
  .cm-mm.wide { grid-template-columns: minmax(0, 1fr); }
  .cm-mm.wide .cm-mm-figwrap { width: min(440px, 100%); }
  .cm-mm-info, .cm-mm-game { order: 3; }
  .cm-mm-chips { order: 4; }
  .cm-resume .btn { width: 100%; }
  .cm-upnext .num { width: 44px; height: 44px; font-size: 1.15rem; }
  .cm-brief { padding: 1rem; }
}
.cm-frame, .cm-build, .cm-datebox, .cm-choose { grid-template-columns: minmax(0, 1fr); }
.cm-frame > *, .cm-build > *, .cm-datebox > * { min-width: 0; }
.cm-line .cm-zh.long { font-size: 1.32rem; }
@media (max-width: 640px) { .cm-line .cm-zh.long { font-size: 1.2rem; } }
/* notes: a long label (e.g. "Safety question · never skip it") moves above the text when there isn't room beside it */
.cm-note { flex-wrap: wrap; row-gap: .3rem; }
.cm-note b { max-width: 100%; }
.cm-note > span { flex: 1 1 16rem; min-width: 0; }
/* English text with short Chinese phrases in it (notes, glosses, feedback, finish-page tips): keep each Chinese phrase
   in one piece so it wraps at a space or after punctuation, never mid-word; a phrase too long for the line may still break */
.cm-note > span, .cm-gloss, .cm-fb, .cm-finale p { word-break: keep-all; overflow-wrap: break-word; }
@media (max-width: 640px) { .cm-view .sep { display: none; } }

/* ==========================================================================
   Course player: Modules 2–12 and the Nursing course (shared lesson engine)
   ========================================================================== */
.cm-count.full { background: #E4F0E4; color: #2F6B3F; }
.cm-sec.row .full { flex-basis: 100%; }
.cm-brief .strong, .cm-round-b .strong { font-weight: 600; color: var(--navy); }
.cm-en.strong { font-weight: 600; color: var(--navy); }
.cm-seg.flow { flex-wrap: wrap; border-radius: 16px; row-gap: 2px; }   /* not ".wrap": that is the page-width container class */

/* a small label above a phrase (First · Then · After) */
.cm-linetag { display: inline-block; margin-bottom: .4rem; padding: .22rem .6rem; border-radius: 999px; background: var(--mist); color: var(--terra-text); font: 700 .62rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.cm-seq .cm-line { border-left: 4px solid var(--terra); }

/* module cover on the goal page */
.cm-cover img { max-height: 280px; object-position: 50% 42%; }
.cm-cover .cap { display: grid; gap: .1rem; }
.cm-cover .cap .k { font: 700 .66rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--terra-text); }
.cm-cover .cap .cm-zh { font-size: 2rem; line-height: 1.15; }
.cm-cover .cap .cm-en { font-weight: 600; color: var(--navy); }

/* pattern frames: the slot pickers under the sentence */
.cm-pat-sent { display: grid; gap: .3rem; }
.cm-slotpick { display: grid; gap: .55rem; margin-top: .45rem; }
.cm-slotpick .row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; }
.cm-slotpick .lbl { min-width: 4.2rem; font: 700 .64rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.cm-pat-head .formula .cm-zh.short { white-space: nowrap; }   /* short frames stay on one line; long ones may wrap */

/* the patient says → you respond */
.cm-resps { display: grid; gap: .9rem; }
.cm-resp { display: grid; gap: .55rem; justify-items: start; }
.cm-resp > .cm-quote { width: 100%; }
.cm-quote .who { margin-bottom: .3rem; font: 700 .62rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--terra-text); }
.cm-quote.you { justify-self: end; width: min(100%, 94%); border-radius: 16px 16px 5px 16px; background: var(--navy); border-color: var(--navy); animation: cm-fade .25s ease; }
.cm-quote.you .who { color: #EDB9B2; }
.cm-quote.you .cm-zh { color: #F5F3ED; } .cm-quote.you .cm-py { color: #EDB9B2; } .cm-quote.you .cm-en { color: #D5E0EA; }
.cm-quote.you .cm-say { background: transparent; color: #F5F3ED; border-color: rgba(245,243,237,.6); }
.cm-quote.you .cm-say:hover { background: #F5F3ED; color: var(--navy); }
.cm-quote .txt { min-width: 0; }

/* the visit map (Module 2) */
.cm-stagemap { display: grid; gap: 1rem; }
.cm-stages { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
@container lesson (min-width: 480px) { .cm-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container lesson (min-width: 760px) { .cm-stages { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cm-stages li { position: relative; display: grid; }
.cm-stages li::after { content: ""; position: absolute; top: 50%; right: -.7rem; width: .7rem; border-top: 2px dotted #A5B8C6; }
.cm-stages li:nth-child(2n)::after, .cm-stages li:last-child::after { display: none; }
@container lesson (min-width: 480px) { .cm-stages li:nth-child(2n)::after { display: block; } .cm-stages li:nth-child(3n)::after, .cm-stages li:last-child::after { display: none; } }
@container lesson (min-width: 760px) { .cm-stages li:nth-child(3n)::after { display: block; } .cm-stages li:nth-child(6n)::after, .cm-stages li:last-child::after { display: none; } }
.cm-stage { width: 100%; height: 100%; font: inherit; color: inherit; padding: .9rem .5rem; }
.cm-stage .cm-zh { font-size: 1.2rem; line-height: 1.25; }
.cm-stage[aria-pressed="true"] { border-color: var(--navy); background: var(--mist); box-shadow: inset 0 0 0 1.5px var(--navy); }
.cm-stage[aria-pressed="true"] .n { background: var(--terra-btn); }
.cm-stage-info { display: grid; gap: .55rem; padding: 1.1rem 1.25rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule); }
.cm-stage-info .k { font: 700 .64rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--terra-text); }
.cm-stage-info .cm-zh { font-size: 2rem; line-height: 1.2; }
.cm-stage-info p { color: var(--ink); }
.cm-stage-info .cm-tools .next { margin-left: auto; }

/* self-check scorecard */
.cm-scorecard { display: grid; gap: 1rem; }
.cm-sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.cm-scrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem .9rem; align-items: start; padding: .9rem 1rem; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--rule); transition: background-color .2s, border-color .2s; }
.cm-scrow .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #F5F3ED; font: 600 .9rem/1 var(--serif); }
.cm-scrow p { align-self: center; font-size: .98rem; line-height: 1.5; color: var(--navy); }
.cm-scrow .cm-seg { grid-column: 2; justify-self: start; }
@container lesson (min-width: 800px) { .cm-scrow { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; } .cm-scrow .cm-seg { grid-column: auto; } }
.cm-seg.lv button { display: inline-flex; align-items: center; gap: .4rem; }
.cm-seg.lv button b { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--card); font-size: .72rem; }
.cm-seg.lv button[aria-pressed="true"]:nth-child(1) b { background: var(--terra-btn); color: #fff; }
.cm-seg.lv button[aria-pressed="true"]:nth-child(2) b { background: #9A6B12; color: #fff; }
.cm-seg.lv button[aria-pressed="true"]:nth-child(3) b { background: #3F7A4C; color: #fff; }
.cm-scrow.s1 { background: #FBEDEA; border-color: #EDC3BC; }
.cm-scrow.s2 { background: #FBF4E4; border-color: #E6D2A2; }
.cm-scrow.s3 { background: #EEF5EE; border-color: #B7D3BC; }
@container lesson (max-width: 540px) {
  .cm-scrow .cm-seg { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border-radius: 14px; }
  .cm-seg.lv button { flex-direction: column; gap: .25rem; padding: .5rem .3rem; font-size: .72rem; line-height: 1.2; border-radius: 11px; }
}
.cm-sc-total { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 16px; background: var(--mist); }
.cm-sc-total .k { grid-column: 1 / -1; font: 700 .66rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--terra-text); }
.cm-sc-total .big { font: 700 2rem/1 var(--serif); color: var(--navy); font-variant-numeric: tabular-nums; }
.cm-sc-total .big span { font-size: 1rem; font-weight: 600; color: var(--ink); }
.cm-sc-total .cm-prog { width: 100%; }
.cm-sc-total p, .cm-sc-total .cm-linkbtn { grid-column: 1 / -1; }
.cm-sc-total .cm-linkbtn { justify-self: start; }
.cm-levels { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cm-levels li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; align-items: start; font-size: .9rem; line-height: 1.45; color: var(--navy); }
.cm-levels b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font: 700 .78rem/1 var(--sans); }
.cm-levels .s1 b { background: var(--terra-btn); } .cm-levels .s2 b { background: #9A6B12; } .cm-levels .s3 b { background: #3F7A4C; }
.cm-levels strong { display: block; font-weight: 700; }

/* pronunciation */
.cm-tips { margin: 0; padding: 0; list-style: none; counter-reset: tip; display: grid; gap: .65rem; }
.cm-tips li { counter-increment: tip; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; font-size: .93rem; line-height: 1.55; color: var(--navy); }
.cm-tips li::before { content: counter(tip); display: grid; place-items: center; width: 24px; height: 24px; margin-top: .05rem; border-radius: 50%; background: var(--navy); color: #F5F3ED; font: 600 .8rem/1 var(--serif); }
.cm-pwords { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
/* columns follow the number of words, so a row never ends with a lone orphan */
@container lesson (min-width: 560px) { .cm-pwords { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cm-pwords:is([data-n="4"], [data-n="8"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container lesson (min-width: 780px) {
  .cm-pwords { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cm-pwords[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cm-pwords:is([data-n="3"], [data-n="6"], [data-n="9"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cm-pw { font: inherit; color: inherit; border-color: var(--mist-line); padding: 1rem .6rem .85rem; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.cm-pw:hover { border-color: var(--navy); background: var(--mist); }
.cm-pw.playing { border-color: var(--terra); box-shadow: 0 0 0 3px rgba(201,111,103,.3); }
.cm-pw .cm-zh { font-size: 1.85rem; line-height: 1.2; }
.cm-pw .tn .cm-py { font-size: .85rem; }
.cm-pw > .cm-en { font-size: .8rem; line-height: 1.35; }
.cm-pw .tones:has(> .tn:nth-child(3)) { gap: .3rem; flex-wrap: nowrap; }   /* three-syllable words (量血压) keep one row on a phone */
.cm-pw .tones:has(> .tn:nth-child(3)) .tn svg { width: 34px; }
.cm-stagepick { display: grid; gap: .9rem; }
.cm-breath .row { border-radius: 12px; padding: .35rem .6rem; transition: background-color .2s ease; }   /* the breath-hold rhythm: the step being said lights up */
.cm-breath .row.on { background: #F6E3DA; }
.cm-abd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .4rem 0 1rem; }   /* the abdomen's nine regions */
.cm-abd-grid button { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .7rem .3rem; border-radius: 14px; border: 1px solid #E6D8C3; background: #F7EFE3; font: inherit; color: inherit; cursor: pointer; min-height: 76px; }
.cm-abd-grid button.on { background: #F6E3DA; border-color: #C8694F; }
.cm-abd-grid .zh { font-size: 1.12rem; font-weight: 600; }
.cm-abd-grid .py, .cm-abd-grid .en { font-size: .74rem; line-height: 1.25; opacity: .85; }
.cm-abd-sides { display: flex; justify-content: space-between; font-size: .78rem; opacity: .8; margin-top: -.3rem; }
.cm-two:has(> .cm-art-pending) { grid-template-columns: minmax(0, 1fr) !important; }   /* a picture still being drawn: the text takes the full width */   /* the stage picker: stage buttons above, that stage's lines below */
.cm-rungs { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.cm-rungs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; padding: .55rem .85rem; border-radius: 12px; border: 1px dashed var(--mist-line); animation: cm-fade .25s ease; }
.cm-rungs li .cm-zh { font-size: 1.2rem; color: #7A8CA0; }
.cm-rungs li .cm-py { font-size: .85rem; opacity: .75; }
.cm-rungs li.on { border: 1.5px solid var(--navy); background: var(--card); }
.cm-rungs li.on .cm-zh { font-size: 1.75rem; color: var(--navy); }
.cm-rungs li.on .cm-py { font-size: 1rem; opacity: 1; }
.cm-ladder .cm-tools .cm-gloss { margin-left: auto; }

/* homework: the task list in the brief */
.cm-hwlist { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .25rem; }
.cm-hwlist button { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; align-items: center; width: 100%; padding: .45rem .5rem; border: 0; border-radius: 10px; background: none; text-align: left; font: 600 .92rem/1.35 var(--sans); color: var(--navy); cursor: pointer; }
.cm-hwlist button:hover { background: rgba(251,250,247,.75); }
.cm-hwlist .n { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #9FB1C3; background: var(--card); }
.cm-hwlist .n svg { position: absolute; width: 13px; height: 13px; color: #fff; opacity: 0; }
.cm-hwlist .n span { font: 700 .72rem/1 var(--sans); color: var(--ink); }
.cm-hwlist li.on .n { background: #3F7A4C; border-color: #3F7A4C; }
.cm-hwlist li.on .n svg { opacity: 1; }
.cm-hwlist li.on .n span { visibility: hidden; }
.cm-hwlist li.on button > span:last-child { color: #2F6B3F; }
.cm-zhlist { display: flex; flex-wrap: wrap; gap: .45rem; }
.cm-zhlist .cm-zh { padding: .35rem .7rem; border-radius: 10px; background: var(--paper); border: 1px solid var(--rule); font-size: 1.1rem; }
.cm-task .cm-checkrow.sm { margin-top: .2rem; }

/* listening: separate patient → you exchanges */
.cm-dlg-wrap.pairs .cm-dlg { gap: .8rem; }
.cm-sit { display: grid; gap: .6rem; padding: .9rem; border-radius: 18px; border: 1px solid var(--rule); background: var(--paper); }
.cm-sit-n { font: 700 .64rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.cm-sit .cm-bub:not(.you) { background: var(--card); }

/* roadmap and menu: modules that are not open yet */
.cm-flag.soon { background: #7E91A5; }
.cm-legend i.soon { border-style: dashed; border-color: #A5B8C6; }
.cm-soonlist { margin-top: .9rem; padding-top: .45rem; border-top: 1px solid var(--rule); }
.cm-soonlist > .cm-part { color: #6E7F92; }
.cm-soon .n { display: inline-block; min-width: 1.5rem; font-weight: 700; color: #8DA0B3; }

/* shorter cards for a set without pictures */
.cm-deck.noimg .cm-fc { height: 250px; }
@media (max-width: 640px) { .cm-deck.noimg .cm-fc { height: 230px; } }

/* 你 / 您 cards with a whole sentence */
.cm-vs .cm-zh.long { font-size: clamp(1.45rem, 1.05rem + 1.3vw, 1.85rem); line-height: 1.4; }

/* bare → professional cards: two by two */
.cm-soft { grid-template-columns: minmax(0, 1fr); }
@container lesson (min-width: 560px) { .cm-soft { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-sc { gap: .35rem; }
.cm-sc .top { display: flex; align-items: center; gap: .55rem; margin-bottom: .2rem; }
.cm-sc .top .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--paper-deep); color: var(--navy); font: 700 .76rem/1 var(--sans); }
.cm-sc.pro .top .n { background: rgba(245,243,237,.16); color: #F5F3ED; }
.cm-sc .cm-tools { margin-top: .45rem; }

/* picture map: words that are not on the picture */
.cm-mm-chips .cm-chipbtn.nomap { border-style: dashed; }

/* nicer line breaks for short paragraphs (no one-word last lines) */
.cm-sub, .cm-cta p, .cm-brief p, .cm-note > span, .cm-finale p, .cm-stage-info p { text-wrap: pretty; }
/* roadmap stops: keep every label at the same height, however many lines the blurb under it takes */
.cm-stop { align-content: start; }
.cm-finale .row .cm-zh.long { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.5rem); }

/* ==========================================================================
   Course pages for search engines (/courses/…, made by tools/build-pages.js)
   ========================================================================== */
.site-nav a.here:not(.btn) { color: var(--navy); border-bottom-color: var(--terra); }
.seo-crumbs { padding-top: 1.25rem; }
.seo-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem .5rem; font-size: .82rem; color: var(--ink); }
.seo-crumbs li + li::before { content: "›"; margin-right: .5rem; color: #8DA0B3; }
.seo-crumbs a { color: var(--ink); text-underline-offset: 3px; }
.seo-crumbs a:hover { color: var(--navy); }
.seo-crumbs [aria-current] { color: var(--navy); font-weight: 500; }
.seo-head { padding-top: clamp(2rem, 5vw, 3.5rem); }

.seo-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: center; padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(1.5rem, 3vw, 2.25rem); }
.seo-kicker { font: 600 .74rem/1.5 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--terra-text); }
.seo-kicker a { color: inherit; text-decoration: none; }
.seo-kicker a:hover { text-decoration: underline; text-underline-offset: 3px; }
.seo-hero h1 { margin-top: .75rem; font-size: clamp(2.1rem, 1.35rem + 2.7vw, 3.3rem); }
.seo-zh { display: block; margin-bottom: .3rem; font-family: var(--cjk); font-weight: 600; font-size: .8em; letter-spacing: .03em; color: var(--terra-text); }
.seo-lede { margin-top: 1.1rem; max-width: 58ch; font-size: 1.06rem; color: var(--ink); text-wrap: pretty; }
.seo-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.seo-meta { margin-top: 1rem; font-size: .85rem; color: var(--ink); }
.seo-hero-img { display: block; width: 100%; height: auto; border-radius: 20px; box-shadow: var(--shadow-md); border: 1px solid rgba(255,255,255,.6); }

.seo-sec { padding-block: clamp(1.75rem, 4vw, 2.75rem); }
.seo-sec h2 { font-size: clamp(1.55rem, 1.2rem + 1.1vw, 2.1rem); }
.seo-sec h3 { margin: 1.6rem 0 .8rem; font: 600 .76rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.seo-gloss { margin: .55rem 0 1.3rem; max-width: 68ch; font-size: .95rem; color: var(--ink); text-wrap: pretty; }
.seo-gloss + h3 { margin-top: .4rem; }

.seo-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.seo-facts li { display: grid; gap: .35rem; align-content: start; padding: 1.1rem 1.15rem; border-radius: 16px; background: var(--card); border: 1px solid var(--rule); }
.seo-facts b { font: 600 1.8rem/1 var(--serif); color: var(--navy); }
.seo-facts li:nth-child(3) b { font-family: var(--cjk); }
.seo-facts span { font-size: .86rem; line-height: 1.45; color: var(--ink); }

.seo-mods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.seo-mods li > a, .seo-mods li > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; row-gap: .35rem; height: 100%; padding: 1.1rem 1.2rem; border-radius: 16px; text-decoration: none; color: inherit; }
.seo-mods .n { grid-row: span 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font: 700 1rem/1 var(--serif); }
.seo-mods .t { font: 600 1.12rem/1.3 var(--serif); color: var(--navy); }
.seo-mods .t .k { display: block; margin-bottom: .15rem; font: 600 .68rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.seo-mods .t .zh { font-family: var(--cjk); margin-right: .3rem; }
.seo-mods .d { font-size: .9rem; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.seo-mods .st { font: 600 .78rem/1.4 var(--sans); color: var(--terra-text); }
.seo-mods .open > a { background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.seo-mods .open > a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--mist-line); }
.seo-mods .open .n { background: var(--navy); color: #F5F3ED; }
.seo-mods .soon > div { border: 1.5px dashed var(--mist-line); background: transparent; }
.seo-mods .soon .n { border: 1.5px dashed #A5B8C6; color: #7E91A5; }
.seo-mods .soon .t { color: #4F6479; }
.seo-mods .soon .st { color: #6E7F92; }

.seo-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.75rem, 5vw, 4rem); align-items: start; }
.seo-two .seo-gloss { margin: 1rem 0 0; }
.seo-ticks { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.seo-ticks li { position: relative; padding-left: 2rem; color: var(--navy); line-height: 1.55; }
.seo-ticks li::before { content: ""; position: absolute; left: 0; top: .15rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--mist) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A3860' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 62% no-repeat; }
.seo-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 2rem; }
.seo-how { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .9rem; counter-reset: how; }
.seo-how li { position: relative; display: grid; gap: .15rem; padding-left: 2.6rem; counter-increment: how; }
.seo-how li::before { content: counter(how); position: absolute; left: 0; top: .05rem; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--terra-btn); color: #FAF7F2; font: 700 .85rem/1 var(--sans); }
.seo-how b { color: var(--navy); font-weight: 600; }
.seo-how span { font-size: .93rem; color: var(--ink); }

.seo-words { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: .75rem; }
.seo-words li { position: relative; display: grid; gap: .2rem; align-content: start; padding: 1rem 3.4rem 1rem 1.1rem; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); }
.seo-words .zh { font: 600 1.55rem/1.25 var(--cjk); color: var(--navy); word-break: keep-all; }
.seo-words .py { font: 500 .95rem/1.35 var(--py); color: var(--terra-text); }
.seo-words .en { font-size: .9rem; line-height: 1.45; color: var(--ink); }
.seo-words .seo-say { position: absolute; top: .85rem; right: .85rem; }

.seo-phrases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; counter-reset: ph; }
.seo-phrases li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .9rem 1rem; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); counter-increment: ph; }
.seo-phrases li::before { content: counter(ph, decimal-leading-zero); align-self: start; padding-top: .25rem; font: 700 .8rem/1.6 var(--sans); color: var(--terra-text); }
.seo-phrases .txt { display: grid; gap: .15rem; }
.seo-phrases .zh { font: 600 1.3rem/1.35 var(--cjk); color: var(--navy); }
.seo-phrases .py { font: 500 .88rem/1.4 var(--py); color: var(--terra-text); }
.seo-phrases .en { font-size: .88rem; line-height: 1.45; color: var(--ink); }

.seo-parts { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.seo-parts li { display: grid; grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: .3rem 1.5rem; padding: .85rem .1rem; border-bottom: 1px solid var(--rule); }
.seo-parts b { font: 600 .95rem/1.5 var(--serif); color: var(--navy); }
.seo-parts span { font-size: .92rem; line-height: 1.6; color: var(--ink); }
.seo-parts a { color: var(--ink); text-decoration: none; }
.seo-parts a:hover { color: var(--terra-text); text-decoration: underline; text-underline-offset: 3px; }

.seo-say { display: none; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1.5px solid var(--navy); background: var(--card); color: var(--navy); cursor: pointer; transition: background-color .15s, color .15s; }
.seo-say svg { width: 18px; height: 18px; }
.seo-say:hover { background: var(--mist); }
.seo-say.playing { background: var(--terra); border-color: var(--terra); color: #fff; }
.tts .seo-say { display: inline-grid; }
.seo-tts-hint { display: none; }
.tts .seo-tts-hint { display: inline; }

.seo-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.seo-perk { display: grid; gap: .6rem; align-content: start; justify-items: start; padding: 1.4rem 1.35rem; border-radius: 18px; background: var(--card); border: 1px solid var(--rule); }
.seo-perk h2 { font-size: 1.25rem; }
.seo-perk p { font-size: .93rem; color: var(--ink); text-wrap: pretty; }
.seo-perk .btn { margin-top: .4rem; }
.seo-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: 22px; background: var(--navy); color: #F5F3ED; box-shadow: var(--shadow-md); }
.seo-band h2 { color: #F5F3ED; font-size: clamp(1.4rem, 1.15rem + .8vw, 1.8rem); }
.seo-band p { margin-top: .45rem; max-width: 60ch; color: #D5E0EA; font-size: .98rem; text-wrap: pretty; }
.seo-band .btn-rose { box-shadow: 0 0 0 2px rgba(245,243,237,.35); }

.seo-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; padding-block: .5rem clamp(3rem, 6vw, 4.5rem); }
.seo-pager a { display: grid; gap: .2rem; padding: 1rem 1.2rem; border-radius: 16px; border: 1px solid var(--rule); background: var(--card); text-decoration: none; color: var(--navy); transition: border-color .15s, box-shadow .15s; }
.seo-pager a:hover { border-color: var(--mist-line); box-shadow: var(--shadow-sm); }
.seo-pager .next { text-align: right; }
.seo-pager .k { font: 600 .72rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--terra-text); }
.seo-pager .t { font: 600 1rem/1.35 var(--serif); }

.seo-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.seo-cards a { display: grid; gap: .5rem; align-content: start; height: 100%; padding: 1.75rem 1.6rem; border-radius: 20px; background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.seo-cards a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.seo-card-zh { font: 600 1.15rem/1.3 var(--cjk); color: var(--terra-text); letter-spacing: .04em; }
.seo-card-t { font: 600 2.3rem/1.1 var(--serif); color: var(--navy); }
.seo-card-st { font: 600 .95rem/1.35 var(--serif); color: var(--navy); }
.seo-card-d { margin-top: .35rem; font-size: .93rem; line-height: 1.65; color: var(--ink); }
.seo-card-go { margin-top: .7rem; font: 600 .9rem/1.4 var(--sans); color: var(--terra-text); }

@media (max-width: 960px) {
  .seo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-perks, .seo-cards { grid-template-columns: minmax(0, 1fr); }
  .seo-cards { max-width: 560px; }
}
@media (max-width: 860px) {
  .seo-hero { grid-template-columns: minmax(0, 1fr); }
  .seo-hero-img { max-width: 560px; }
  .seo-mods, .seo-two, .seo-goals, .seo-phrases { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .seo-parts li { grid-template-columns: minmax(0, 1fr); }
  .seo-pager { grid-template-columns: minmax(0, 1fr); }
  .seo-pager .next { text-align: left; }
  .seo-actions .btn { flex: 1 1 100%; }
  .seo-facts b { font-size: 1.55rem; }
  .seo-words { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .seo-words li { padding: .8rem 2.7rem .8rem .85rem; }
  .seo-words .zh { font-size: 1.35rem; }
  .seo-words .en { font-size: .84rem; }
  .seo-words .seo-say { top: .6rem; right: .6rem; width: 34px; height: 34px; }
  .seo-words .seo-say svg { width: 16px; height: 16px; }
}

/* ==========================================================================
   "Phrase of the Week" sign-ups: Resources page, Phrase of the Week page
   ========================================================================== */
.svc .svc-more { display: block; margin-top: .85rem; text-align: center; font: 500 .88rem/1.4 var(--sans); color: var(--terra-text); text-underline-offset: 3px; }
.svc .svc-more:hover { color: var(--navy); }
.updates-card { position: relative; overflow: hidden; display: grid; gap: 1.1rem 2.5rem; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: 22px; background: var(--navy); color: #F5F3ED; box-shadow: var(--shadow-lg); }
.updates-card .label { color: #EDB9B2; }
.updates-card h2 { margin-top: .5rem; color: #F5F3ED; font-weight: 500; font-size: clamp(1.55rem, 1.2rem + 1.1vw, 2.1rem); }
.updates-card .upd-copy > p:not(.label) { margin-top: .7rem; max-width: 46ch; color: #D5E0EA; }
.updates-wide { margin-top: clamp(2.5rem, 5vw, 3.5rem); grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; }
.updates-form { display: grid; grid-template-columns: 1fr 1.25fr auto; gap: .9rem; align-items: end; }
.updates-form .btn-rose { box-shadow: 0 0 0 2px rgba(245,243,237,.35); }
.updates-form .upd-status { grid-column: 1 / -1; min-height: 0; font-size: .9rem; color: #FFD9D3; }
.updates-form .upd-status:empty { display: none; }
.updates-card .lead-fine { margin-top: .9rem; }
.upd-thanks { padding: 1rem 1.2rem; border-radius: 14px; background: rgba(245,243,237,.1); border: 1px solid rgba(245,243,237,.25); }
.upd-thanks:focus { outline: none; }
.upd-thanks h3 { color: #F5F3ED; font-size: 1.3rem; }
.upd-thanks p { margin-top: .35rem; color: #D5E0EA; font-size: .95rem; }
.pow { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 2.5rem); align-items: start; padding-bottom: clamp(3rem, 6vw, 5rem); }
.pow-sample { margin: 0; padding: 1.6rem 1.5rem; border-radius: 20px; background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow-sm); transform: rotate(-1.2deg); }
.pow-sample figcaption { font: 600 .72rem/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }
.pow-zh { margin-top: 1rem; font: 600 2.3rem/1.25 var(--cjk); color: var(--navy); }
.pow-py { margin-top: .3rem; font: 500 1.1rem/1.4 var(--py); color: var(--terra-text); }
.pow-en { margin-top: .15rem; color: var(--ink); }
.pow-tip { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--mist-line); font-size: .92rem; color: var(--navy); text-wrap: pretty; }
.pow-tip b { margin-right: .4rem; font: 700 .68rem/1.6 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--terra-text); }
.pow .updates-form { grid-template-columns: 1fr 1fr; }
.pow .updates-form .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 960px) {
  .updates-wide, .pow { grid-template-columns: minmax(0, 1fr); }
  .pow-sample { transform: none; }
}
@media (max-width: 640px) {
  .updates-form, .pow .updates-form { grid-template-columns: minmax(0, 1fr); }
  .updates-form .btn { width: 100%; }
}

/* ==========================================================================
   Course certificates (finish pages) and the sign-up box inside the courses
   ========================================================================== */
.cm-certsec { display: grid; gap: .9rem; }
.cm-certsec .cm-sec { margin-bottom: 0; }
.cm-certlock { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem 1rem; align-items: center; padding: 1.1rem 1.2rem; border-radius: 16px; border: 1.5px dashed var(--mist-line); background: var(--card); }
.cm-certlock .ic, .cm-upd-copy .ic, .cm-upd-done .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--mist); color: var(--navy); }
.cm-certlock .ic svg, .cm-upd-copy .ic svg, .cm-upd-done .ic svg { width: 22px; height: 22px; }
.cm-certlock h3 { font-size: 1.1rem; }
.cm-certlock p { margin-top: .2rem; font-size: .9rem; color: var(--ink); text-wrap: pretty; }
.cm-certnote a { color: var(--terra-text); font-weight: 600; text-underline-offset: 3px; }
.cm-certscroll { container-type: inline-size; }

.cm-cert { --gold: #C96F67; position: relative; aspect-ratio: 1.414; width: 100%; padding: 2.2cqw; border-radius: 6px; background: #FFFDF8; color: var(--navy); box-shadow: var(--shadow-md); border: 1px solid #E6E0D4; font-size: 1.6cqw; }
.cm-cert-in { height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3cqw 5cqw 2.4cqw; border: .45cqw double var(--navy); outline: .12cqw solid var(--gold); outline-offset: -1.3cqw; }
.cm-cert-top { align-self: stretch; display: flex; justify-content: space-between; align-items: flex-start; gap: 2cqw; text-align: left; }
.cm-cert-brand { display: flex; align-items: center; gap: 1.2cqw; }
.cm-cert-brand .chop { display: grid; place-items: center; width: 4.4cqw; height: 4.4cqw; border-radius: .5cqw; background: var(--chop); color: #FBF1EE; font: 600 2.8cqw/1 var(--cjk); }
.cm-cert-brand b { display: block; font: 700 1.9cqw/1.1 var(--serif); letter-spacing: .13em; text-transform: uppercase; }
.cm-cert-brand small { display: block; margin-top: .4cqw; font: 500 .95cqw/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.cm-cert-id { font: 600 1.3cqw/1.3 var(--sans); text-align: right; letter-spacing: .03em; }
.cm-cert-id small { display: block; font-size: .95cqw; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.cm-cert-k { margin-top: auto; font: 600 1.7cqw/1.3 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--terra-text); }
.cm-cert-to { margin-top: 1.6cqw; font: italic 400 2.1cqw/1.3 var(--serif); color: var(--ink); }
.cm-cert-name { margin-top: .8cqw; padding: 0 3cqw .6cqw; min-width: 45%; border-bottom: .16cqw solid var(--gold); font: 600 5.4cqw/1.15 var(--serif); color: var(--navy); overflow-wrap: anywhere; }
.cm-cert-name.empty { color: #B9C3CE; font-style: italic; font-weight: 500; }
.cm-cert-what { margin-top: 2cqw; display: grid; gap: .45cqw; font: 500 2cqw/1.35 var(--serif); }
.cm-cert-what b { font-weight: 600; }
.cm-cert-what > div:last-child { color: var(--ink); font-size: 1.8cqw; }
.cm-cert-what .zh { font-family: var(--cjk); }
.cm-cert-foot { margin-top: auto; align-self: stretch; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 3cqw; }
.cm-cert-foot > div:not(.cm-cert-seal) { display: grid; justify-items: center; }
.cm-cert-foot .v { padding: 0 1.5cqw .5cqw; min-width: 70%; border-bottom: .12cqw solid #9FB0C2; font: 500 1.7cqw/1.3 var(--serif); }
.cm-cert-foot .v.sig { font: 500 3.6cqw/1 var(--script); padding-bottom: .2cqw; white-space: nowrap; }
.cm-cert-foot .l { margin-top: .6cqw; font: 500 1.05cqw/1.3 var(--sans); color: var(--ink); }
.cm-cert-seal { display: grid; place-items: center; width: 9cqw; height: 9cqw; border-radius: 50%; border: .45cqw solid var(--chop); box-shadow: inset 0 0 0 .5cqw #FFFDF8, inset 0 0 0 .62cqw var(--chop); color: var(--chop); font: 600 2.6cqw/1 var(--cjk); transform: rotate(-7deg); }
.cm-cert-fine { margin-top: 1.4cqw; max-width: 90%; font: 400 1cqw/1.4 var(--sans); color: #6B7D90; }
.cm-certform { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.cm-certform label { font: 600 .9rem/1.3 var(--sans); color: var(--navy); }
.cm-certform .cm-input { flex: 1 1 16rem; max-width: 26rem; }
.cm-cert-hint { margin-top: -.35rem; }
.cm-certtools .cm-li { gap: .5rem; }
.cm-certtools .cm-li .ic { display: inline-grid; }
.cm-certtools .cm-li .ic svg { width: 16px; height: 16px; }
.cm-certlink { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; margin: .2rem auto .4rem; font: 600 .95rem/1.3 var(--sans); color: var(--terra-text); text-underline-offset: 3px; }
.cm-certlink svg { width: 20px; height: 20px; }

.cm-updates { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; padding: 1.2rem 1.3rem; border-radius: 18px; background: var(--card); border: 1.5px solid var(--mist-line); }
.cm-upd-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; align-items: start; }
.cm-upd-copy h3 { font-size: 1.12rem; }
.cm-upd-copy p { margin-top: .25rem; font-size: .9rem; color: var(--ink); text-wrap: pretty; }
.cm-upd-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: .5rem; }
.cm-upd-form .cm-input { width: 100%; }
.cm-upd-status { font-size: .88rem; color: var(--terra-text); }
.cm-upd-status:empty { display: none; }
.cm-upd-fine { font-size: .78rem; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.cm-upd-fine a { color: var(--navy); text-underline-offset: 3px; }
.cm-upd-done { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; align-items: center; }
.cm-upd-done .ic { background: #E4F0E6; color: #2F6B3F; }
.cm-upd-done h3 { font-size: 1.1rem; }
.cm-upd-done h3:focus { outline: none; }
.cm-upd-done p { margin-top: .2rem; font-size: .9rem; color: var(--ink); }
@container lesson (max-width: 520px) {
  .cm-upd-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cm-upd-form { grid-template-columns: minmax(0, 1fr); }
  .cm-certlock { grid-template-columns: auto minmax(0, 1fr); }
  .cm-certlock .btn { grid-column: 1 / -1; justify-self: start; }
}

/* printing the certificate: only the certificate, one landscape page */
@page cert { size: landscape; margin: .35in; }
@media print {
  html.print-cert body { background: #fff; }
  html.print-cert body > :not(main), html.print-cert .cm-side, html.print-cert .cm-menu-btn, html.print-cert .cm-scrim,
  html.print-cert .cm-panel > :not(.cm-body), html.print-cert .cm-body > :not(.cm-certsec), html.print-cert .cm-certsec > :not(.cm-certscroll) { display: none !important; }
  html.print-cert main > [data-page]:not([data-page="course"]) { display: none !important; }
  html.print-cert .cm-wrap, html.print-cert .cm-main, html.print-cert .cm-body, html.print-cert .cm-panel, html.print-cert .cm-certsec { display: block; max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
  html.print-cert .cm-certscroll { page: cert; break-inside: avoid; max-width: 10.4in; margin: .15in auto 0; }
  html.print-cert .cm-cert { box-shadow: none; border: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* a narrow screen: the certificate preview keeps its look but gets bigger type, and grows taller instead of shrinking the words */
@container (max-width: 620px) {
  .cm-cert { aspect-ratio: auto; padding: 3cqw; }
  .cm-cert-in { padding: 5cqw 4.5cqw 4cqw; outline-offset: -2cqw; border-width: .8cqw; }
  .cm-cert-brand .chop { width: 7cqw; height: 7cqw; font-size: 4.4cqw; border-radius: 1cqw; }
  .cm-cert-brand b { font-size: 3.1cqw; }
  .cm-cert-brand small { font-size: 1.8cqw; }
  .cm-cert-id { font-size: 2.3cqw; }
  .cm-cert-id small { font-size: 1.7cqw; }
  .cm-cert-k { margin-top: 8cqw; font-size: 2.9cqw; letter-spacing: .22em; }
  .cm-cert-to { margin-top: 3cqw; font-size: 3.8cqw; }
  .cm-cert-name { font-size: 8.4cqw; }
  .cm-cert-what { margin-top: 3.5cqw; gap: 1cqw; font-size: 3.7cqw; }
  .cm-cert-what > div:last-child { font-size: 3.4cqw; }
  .cm-cert-foot { margin-top: 8cqw; gap: 3cqw; }
  .cm-cert-foot .v { font-size: 3.1cqw; }
  .cm-cert-foot .v.sig { font-size: 6.2cqw; }
  .cm-cert-foot .l { margin-top: 1cqw; font-size: 2.1cqw; }
  .cm-cert-seal { width: 14cqw; height: 14cqw; font-size: 4.3cqw; border-width: .7cqw; box-shadow: inset 0 0 0 .8cqw #FFFDF8, inset 0 0 0 1cqw var(--chop); }
  .cm-cert-fine { margin-top: 3cqw; font-size: 2.1cqw; }
}

/* ---------- quick feedback card on finish pages (feedbackBox in js/course-kit.js) ---------- */
.cm-rate { margin: 1.25rem 0; padding: 1rem 1.15rem; border: 1px solid var(--mist-line); border-radius: 14px; background: var(--mist); }
.cm-rate-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; }
.cm-rate-q { margin: 0; font: 600 1.05rem/1.3 var(--serif); color: var(--navy); }
.cm-rate-sub { margin: .15rem 0 0; font-size: .82rem; color: var(--ink); }
.cm-rate-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.cm-rate-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .5rem 1rem; border: 1.5px solid var(--navy); border-radius: 999px; background: #fff; color: var(--navy); font: 600 .9rem/1 var(--sans); cursor: pointer; transition: background .15s, color .15s; }
.cm-rate-btn .ic { display: inline-flex; width: 20px; height: 20px; }
.cm-rate-btn .ic svg { width: 100%; height: 100%; }
.cm-rate-btn.down .ic { transform: rotate(180deg); }
.cm-rate-btn:hover { background: var(--paper); }
.cm-rate-btn[aria-pressed="true"].up { background: var(--navy); color: #fff; }
.cm-rate-btn[aria-pressed="true"].down { background: var(--terra-btn); border-color: var(--terra-btn); color: #fff; }
.cm-rate-more { display: grid; gap: .35rem; margin-top: .9rem; }
.cm-rate-more label { margin-top: .3rem; font-size: .88rem; font-weight: 600; color: var(--navy); }
.cm-rate-more textarea, .cm-rate-more input { width: 100%; box-sizing: border-box; padding: .6rem .75rem; border: 1px solid var(--mist-line); border-radius: 10px; background: #fff; color: var(--navy); font: 400 .95rem/1.45 var(--sans); }
.cm-rate-more textarea { min-height: 4.6rem; resize: vertical; }
.cm-rate-fine { margin: .1rem 0 0; font-size: .78rem; color: var(--ink); }
.cm-rate-fine a { color: var(--terra-text); }
.cm-rate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .35rem; }
.cm-rate-status { margin: .5rem 0 0; font-size: .85rem; color: var(--ink); }
.cm-rate-status:empty { margin: 0; }
.cm-rate.done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding: .7rem 1rem; }
.cm-rate-thanks { margin: 0; font-size: .92rem; color: var(--navy); }
.cm-rate-thanks:focus { outline: none; }
.cm-rate-thanks .ok { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; margin-right: .5rem; border-radius: 50%; background: #2E7D5B; color: #fff; font-size: .8rem; vertical-align: -.1em; }

/* ---------- dropdowns (js/select.js swaps the phone's built-in picker for these) ---------- */
.cm-sel { position: relative; display: inline-block; max-width: 100%; min-width: 0; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.cm-sel > select.cm-sel-native { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
.cm-sel-btn {
  position: relative; display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 48px; padding: .6rem .6rem .6rem 1rem;
  font: 500 .95rem/1.3 var(--sans); color: var(--navy); text-align: left; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  background: var(--card); border: 1.5px solid var(--mist-line); border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.cm-sel-btn:hover { border-color: #9FB3C6; box-shadow: var(--shadow-md); }
.cm-sel-btn:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; border-radius: 12px; }
.cm-sel.is-open .cm-sel-btn { border-color: var(--navy); background: #fff; }
.cm-sel.is-disabled .cm-sel-btn { opacity: .55; cursor: not-allowed; box-shadow: none; }
.cm-sel-val { display: grid; flex: 1 1 auto; min-width: 0; }
.cm-sel-val > span { grid-area: 1 / 1; visibility: hidden; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-sel-val > span.on { visibility: visible; }
.cm-sel-chev { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mist); color: var(--navy); transition: transform .2s ease, background-color .18s ease, color .18s ease; }
.cm-sel-btn:hover .cm-sel-chev { background: #DCE5EE; }
.cm-sel.is-open .cm-sel-chev { transform: rotate(180deg); background: var(--navy); color: var(--paper); }

.cm-sel-pop {
  position: fixed; z-index: 300; padding: 6px; background: #fff; border: 1px solid var(--mist-line); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px); transition: opacity .14s ease, transform .14s ease;
}
.cm-sel-pop.is-up { transform: translateY(4px); }
.cm-sel-pop.is-in { opacity: 1; transform: none; }
.cm-sel-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.cm-sel-list:focus { outline: none; }
.cm-sel-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 42px; padding: .55rem .8rem;
  font: 500 .93rem/1.3 var(--sans); color: var(--navy); border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.cm-sel-opt + .cm-sel-opt { margin-top: 2px; }
.cm-sel-opt.is-active { background: var(--mist); }
.cm-sel-opt[aria-selected="true"] { font-weight: 600; background: #F6E9E6; color: var(--terra-text); }
.cm-sel-opt[aria-selected="true"].is-active { background: #F0DCD8; }
.cm-sel-opt[aria-disabled="true"] { opacity: .45; cursor: default; }
.cm-sel-tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--terra-btn); visibility: hidden; }
.cm-sel-opt[aria-selected="true"] .cm-sel-tick { visibility: visible; }

/* phones: the list rises from the bottom of the screen */
.cm-sel-scrim { position: fixed; inset: 0; z-index: 299; background: rgba(8,44,75,.42); animation: cm-sel-fade .2s ease; }
.cm-sel-pop.is-sheet {
  left: 0; right: 0; bottom: 0; top: auto; display: flex; flex-direction: column; max-height: 72vh; max-height: 72dvh;
  padding: .5rem .75rem calc(.9rem + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 22px 22px 0 0; background: var(--paper);
  transform: translateY(100%); opacity: 1; transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.cm-sel-pop.is-sheet.is-in { transform: none; }
.cm-sel-grip { align-self: center; width: 40px; height: 4px; margin: .2rem 0 .7rem; border-radius: 4px; background: var(--mist-line); }
.cm-sel-head { padding: 0 .5rem .7rem; font: 600 .74rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: .5rem; }
.cm-sel-pop.is-sheet .cm-sel-list { flex: 1 1 auto; min-height: 0; }
.cm-sel-pop.is-sheet .cm-sel-opt { min-height: 52px; padding: .7rem 1rem; font-size: 1rem; white-space: normal; background: transparent; }
.cm-sel-pop.is-sheet .cm-sel-opt.is-active { background: transparent; }
.cm-sel-pop.is-sheet .cm-sel-opt[aria-selected="true"] { background: var(--card); box-shadow: var(--shadow-sm); }
@keyframes cm-sel-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cm-sel-btn, .cm-sel-chev, .cm-sel-pop, .cm-sel-pop.is-sheet { transition: none; }
  .cm-sel-scrim { animation: none; }
}

/* where the old controls sat */
.field .cm-sel, .gm-field .cm-sel { display: block; }
.cm-me-fields .cm-sel { flex: 1 1 12rem; }
.cm-me .cm-sel-btn { min-height: 44px; font-size: .9rem; }

/* ---------- Accounts (#/account, js/account.js) ---------- */
.site-nav a.nav-account:not(.btn) { display: inline-flex; align-items: center; gap: .4rem; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-nav a.nav-account::before { content: ""; flex: none; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.acct-card { display: grid; gap: 1.25rem; }
.acct-card > p { margin: 0; color: var(--ink); line-height: 1.6; }
.acct-card > p .btn { margin: .25rem .4rem .25rem 0; }
.acct-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .3rem; background: #F2EFE7; border-radius: 12px; }
.acct-tab { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font: 600 .92rem/1.2 var(--sans); color: var(--ink); cursor: pointer; }
.acct-tab[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(18,38,63,.14); }
.acct-h { margin: 0; font-size: 1.35rem; }
.acct-h strong { color: var(--terra-text); overflow-wrap: anywhere; }
.acct-hint { margin: 0; font-size: .82rem; line-height: 1.5; color: var(--ink); }
.acct-form .field { position: relative; }
.acct-make { position: absolute; top: -.3rem; right: 0; }
.acct-check { display: flex; align-items: flex-start; gap: .6rem; font-size: .92rem; line-height: 1.45; color: var(--ink); cursor: pointer; }
.acct-check input { width: 20px !important; height: 20px; flex: none; margin: .1rem 0 0; accent-color: var(--terra-btn); }
.acct-saved { display: block; margin-top: .35rem; font-size: .85rem; color: var(--ink); }
.acct-more { border-top: 1.5px solid var(--rule); padding-top: 1rem; }
.acct-more summary { cursor: pointer; font: 600 1rem/1.3 var(--sans); color: var(--navy); }
.acct-more[open] summary { margin-bottom: 1rem; }
.acct-danger { border-color: #9B2C24; color: #9B2C24; }
.acct-danger:hover { background: #9B2C24; color: #fff; }
/* buttons and the small links under them sit in the middle, like every other button on the site */
.contact-form.acct-form .btn { justify-self: center; }
.acct-form .fine, .acct-card > p.acct-go { text-align: center; }
