:root {
  /* ONE palette for the whole app: a green family + calm neutrals, with a single warm accent used sparingly.
     Importance, from loudest to quietest:
       1. solid green   (--color-primary)      the main action on a page: Search, Generate new test, Buy
       2. mint + green edge (--color-mint)     something you have SELECTED or the page you are on (filters, themes, navigation, page numbers)
       3. white + green edge                    a quiet second choice: History, Login
       4. light, neutral                        who you are (the account button): no reason to catch the eye once you are logged in
       5. warm accent (--color-accent)          the few things that should stand out: favourites, days left, Logout
       6. the website's soft background        lavender, pink and mint behind every page (no colour per group), with a graphite strip for the menu */
  --color-bg: #f4f7f5;
  --color-surface: #ffffff;
  --color-primary: #1f6b50;
  --color-primary-rgb: 31, 107, 80;
  --color-primary-dark: #17513c;
  --color-primary-deep: #0f3a2b;
  --color-mint: #e3f1ea;
  --color-mint-soft: #f0f7f3;
  --color-mint-border: #9cc9b3;
  --header-h: 65px;          /* the height of the menu strip and of the footer: the home page sizes its screens with them */
  --footer-h: 61px;
  --color-success: #2e8b67;
  --color-accent: #b8470f;
  --color-text: #1b2924;
  --color-text-muted: #5c6b65;
  --color-border: #dce5e0;
  --color-border-strong: #c3d3cb;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background-color: #e7e3ee;
  background-image: radial-gradient(70% 60% at 15% 0%, #d9dcf3 0%, transparent 70%), radial-gradient(60% 70% at 100% 20%, #ecd3df 0%, transparent 70%), radial-gradient(60% 60% at 50% 110%, #d5e6df 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header: a quiet graphite strip. The handle at the far left (the same edge as the content below), the menu in the CENTRE, the account at the far right.
   Everything is plain text, no boxes or buttons: light grey, white for the page you are on or point at. On narrower screens (up to 900px) the menu drops to a second row. */
.site-header {
  background: rgba(44, 47, 52, 0.94);
  -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "brand nav auth";
  align-items: center; column-gap: 16px; padding: 10px 20px;
}
@media (max-width: 900px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand auth" "nav nav"; column-gap: 16px; row-gap: 4px; padding: 12px 20px 8px; }
}
.brand { grid-area: brand; justify-self: start; font-weight: 400; font-size: 1.5rem; letter-spacing: 0.01em; color: #eceef1; }
.brand:hover { text-decoration: none; color: #fff; }
.main-nav { grid-area: nav; display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; }
.nav-item {
  position: relative; display: flex; align-items: center; padding: 9px 18px;
  background: transparent; color: #b3b9c0; font-weight: 400; font-size: 1.08rem; letter-spacing: 0.01em;
  transition: color .2s ease;
}
.nav-item::after {      /* a fine line under the page you are on */
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 3px; height: 1px; background: #fff;
  transform: scaleX(0); transform-origin: center; transition: transform .25s ease;
}
.nav-item:hover { color: #fff; text-decoration: none; }
.nav-item[aria-current="page"], .nav-item[aria-current="page"]:hover { color: #fff; }
.nav-item[aria-current="page"]::after { transform: scaleX(1); }
.nav-item:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; border-radius: 4px; }

.auth-area { grid-area: auth; justify-self: end; min-width: 0; display: flex; align-items: center; gap: 10px; }
.hi-user { font-size: 0.9rem; color: var(--color-text-muted); margin-right: 4px; }
.inline-form { display: inline; }

/* Account dropdown */
.account-dropdown { position: relative; }
.account-toggle {
  display: flex; align-items: center; gap: 8px; padding: 8px 2px; cursor: pointer;
  background: transparent; color: #d4d8dd; border: 0;
  font-family: inherit; font-weight: 400; font-size: 0.98rem; letter-spacing: 0.01em; transition: color .2s ease;
}
/* Plain text like the rest of the menu: it only reacts when you point at it. */
.account-toggle:hover { color: #fff; }
.account-toggle:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 4px; border-radius: 4px; }
.account-toggle .caret { font-size: 0.7rem; }
/* Safety net only: the name is already shortened to a letter in code when it would not fit (accounts/display.py). */
.account-name { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-toggle.has-days .account-name { max-width: 9.5ch; }
.account-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px;
  box-shadow: var(--shadow-md); min-width: 230px; z-index: 30; overflow: hidden;
}
.account-menu.is-open { display: block; }
.account-menu form { margin: 0; }
.account-toggle-days {
  font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--color-accent); color: white; margin-left: 4px;
}
.account-menu-subscription {
  padding: 10px 16px; font-size: 0.82rem; color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border); line-height: 1.4;
}
.account-menu-item {
  display: block; width: 100%; text-align: left; padding: 11px 16px; font-size: 0.9rem;
  color: var(--color-text); background: none; border: none; cursor: pointer; font-family: inherit;
}
.account-menu-item:hover { background: var(--color-bg); text-decoration: none; }
.account-menu-button { border-top: 1px solid var(--color-border); color: var(--color-accent); }
.ext-icon { color: var(--color-text-muted); font-size: 0.85em; }
/* Subscription sub-menu: the three plans, in the same small indented style as the language switches */
.plan-link { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: baseline; padding: 6px 0; font-size: 0.8rem; color: var(--color-text-muted); }
.plan-link + .plan-link { border-top: 1px solid var(--color-border); }
.plan-link:hover { text-decoration: none; color: var(--color-primary-dark); }
.plan-link:hover .plan-name { text-decoration: underline; }
.plan-price { font-weight: 700; color: var(--color-text); }
.plan-note { grid-column: 1 / -1; font-size: 0.72rem; font-weight: 600; color: var(--color-primary); }
/* "Language settings >" opens the four switches underneath; closed by default so the menu stays small */
.account-menu-row { display: flex; align-items: center; justify-content: space-between; }
.row-chevron { font-size: 1.25rem; line-height: 1; color: var(--color-text-muted); transition: transform .15s ease; }
.account-menu-row[aria-expanded="true"] .row-chevron { transform: rotate(90deg); }
.account-menu-setting[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .row-chevron { transition: none; } }

/* Test section sub-tabs (New Test / History) */
.test-subnav { display: flex; gap: 8px; margin-bottom: 22px; }
.test-subnav-tab {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--color-border);
  font-size: 0.88rem; font-weight: 600; color: var(--color-text-muted);
}
.test-subnav-tab:hover { background: var(--color-mint-soft); border-color: var(--color-mint-border); color: var(--color-primary-dark); text-decoration: none; }
.test-subnav-tab.active { background: var(--color-mint); color: var(--color-primary-deep); border-color: var(--color-primary); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-family: inherit; font-weight: 700; font-size: 0.92rem; letter-spacing: 0.01em; cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--color-mint-border); outline-offset: 2px; }
/* The main action: solid green. Hover: darker, lifts and casts a green glow; pressed: sinks back. */
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 1px 2px rgba(15, 58, 43, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(var(--color-primary-rgb), 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.btn-primary:active { background: var(--color-primary-deep); transform: translateY(0); box-shadow: 0 1px 2px rgba(15, 58, 43, 0.3); }
/* A quiet second choice: white with a green edge. Hover: fills with mint. */
.btn-ghost { background: var(--color-surface); color: var(--color-primary-dark); border-color: var(--color-border-strong); }
.btn-ghost:hover { background: var(--color-mint); border-color: var(--color-primary); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(var(--color-primary-rgb), 0.16); }
.btn-ghost:active { transform: translateY(0); box-shadow: none; }
.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn-primary:hover, .btn-ghost:hover { transform: none; } }
.btn-block { width: 100%; }

/* Messages */
.messages { margin-top: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; font-size: 0.92rem; }
.alert-error, .alert-danger { background: #fdecea; color: #a4262c; }
.alert-success { background: #e6f4ea; color: #1e7b34; }
.alert-info, .alert-warning { background: #fff6e5; color: #8a5a00; }

.page-main { padding: 14px 20px 56px; }
.page-title { font-size: 1.6rem; margin-top: 10px; margin-bottom: 6px; }
.page-subtitle { color: var(--color-text-muted); margin-top: 0; }

/* Hero */
.hero { text-align: center; padding: 48px 12px 16px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 10px; }
.hero p { max-width: 620px; margin: 0 auto; color: var(--color-text-muted); font-size: 1.02rem; }
.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.hero-actions .btn { padding: 15px 34px; font-size: 1.05rem; }

/* Theme grid */
.section-title { text-align: center; font-size: 1.1rem; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-muted); margin: 40px 0 20px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.theme-card {
  background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 28px 18px; text-align: center; border: 1px solid var(--color-border);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  transition: box-shadow .15s ease, transform .15s ease;
}
.theme-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.theme-icon { font-size: 1.8rem; }
.theme-name { font-weight: 700; font-size: 1.02rem; color: var(--color-text); }
.theme-count { font-size: 0.85rem; color: var(--color-text-muted); }

/* Home page: a calm, full-screen flow. The first screen is "Writing & Speaking themes", the next is "Everyday Basics". Both sit on the same soft
   background as the rest of the app (no colour per group), with quiet white cards that are the same size everywhere. Each part flows in as you
   scroll (static/js/home-reveal.js), the way the website does. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.home-flow { --card-h: clamp(124px, calc((100svh - var(--header-h) - 170px) / 3), 196px); padding: 0; }
.page-main:has(.home-flow) { padding: 0; }
.page-main:has(.home-flow) + .site-footer { margin-top: 0; }
.home-section {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h));      /* each part is one screen */
  padding: 22px 0 56px; scroll-margin-top: var(--header-h);
}
.home-section .section-inner { width: 100%; }      /* the content spans the page even when a part has few cards */
.home-section:last-of-type {      /* the last screen includes the footer */
  min-height: calc(100vh - var(--header-h) - var(--footer-h)); min-height: calc(100svh - var(--header-h) - var(--footer-h)); padding-bottom: 28px;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.band-title { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; color: var(--color-text); }
.band-count { font-size: 0.85rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-section .theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }      /* its left edge is the menu's left edge */
.home-section .theme-card {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0;      /* symbol and percent on top, the name under them, the count and the bar pinned to the bottom */
  height: var(--card-h);            /* every card, in both parts, is exactly this tall */
  padding: 12px 16px 14px; text-align: left; color: var(--color-text);
  background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(30, 33, 50, 0.04), 0 10px 30px rgba(30, 33, 50, 0.06);
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.home-section .theme-card:hover { text-decoration: none; transform: translateY(-4px); background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 4px rgba(30, 33, 50, 0.05), 0 18px 40px rgba(30, 33, 50, 0.12); }
.home-section .theme-card:active { transform: translateY(-1px); }
.home-section .theme-card:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.home-section .theme-top { display: flex; align-items: flex-start; justify-content: space-between; }
.home-section .theme-icon { font-size: 1.55rem; line-height: 1; }
.home-section .theme-progress-text { font-size: 0.85rem; font-weight: 500; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.home-section .theme-name {
  margin-top: 4px; font-size: clamp(0.92rem, 0.8rem + 0.25vw, 1.08rem); font-weight: 600; line-height: 1.22; letter-spacing: -0.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home-section .theme-count { margin: auto 0 8px; padding-top: 2px; font-size: 0.85rem; color: var(--color-text-muted); }
.home-section .theme-card .theme-progress { flex: 0 0 auto; max-width: none; height: 3px; margin: 0; background: rgba(30, 33, 50, 0.09); }
/* A locked card (the subscription has ended): the card can be seen but not opened. */
.home-section .theme-card.is-locked { filter: grayscale(1); background: rgba(238, 240, 241, 0.9); cursor: not-allowed; }
.home-section .theme-card.is-locked > :not(.lock-chip) { opacity: 0.55; }
.home-section .theme-card.is-locked:hover { transform: none; box-shadow: 0 1px 2px rgba(30, 33, 50, 0.04), 0 10px 30px rgba(30, 33, 50, 0.06); }
.lock-chip { position: absolute; top: 14px; right: 40px; font-size: 0.8rem; line-height: 1; }
/* "Everyday Basics ↓": a quiet cue at the bottom of the first screen, like the website's "Explore" */
.scroll-cue {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-muted); text-decoration: none;
  animation: cue-bob 2.2s ease-in-out infinite;
}
.scroll-cue span:last-child { font-size: 1.1rem; letter-spacing: 0; line-height: 1; }
.scroll-cue:hover { color: var(--color-primary); text-decoration: none; }
@keyframes cue-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { animation: none; } .home-section .theme-card, .reveal { transition: none; } .home-section .theme-card:hover { transform: none; } }
/* Flow in as you scroll: fade and rise into place (only when the script is running) */
.js-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js-reveal .reveal { opacity: 1; transform: none; transition: none; } }
@media (min-height: 800px) { .home-section .theme-name { -webkit-line-clamp: 3; } }      /* tall windows have room for a long name on three lines */
@media (max-width: 900px) {      /* tablets: three across, natural height */
  .home-flow { --card-h: 148px; }
  .home-section, .home-section:last-of-type { min-height: 0; padding: 24px 0 28px; }
  .home-section .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .scroll-cue { display: none; }
}
@media (max-width: 640px) {      /* phones: two across */
  .home-flow { --card-h: 156px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .band-title { font-size: 1.35rem; }
  .home-section .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-section .theme-card { padding: 12px 14px 14px; border-radius: 16px; }
  .home-section .theme-icon { font-size: 1.5rem; }
  .home-section .theme-name { font-size: 0.95rem; -webkit-line-clamp: 3; }
  .lock-chip { right: 36px; top: 12px; }
}

/* The notice for an expired subscription (home page and the locked page), and everything greyed out while it applies */
.expired-banner { background: #fff1e3; border-bottom: 1px solid #f3cfa7; color: #5a2d0c; }
.expired-inner { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.expired-icon { font-size: 1.4rem; line-height: 1; }
.expired-text { margin: 0; flex: 1; font-size: 0.92rem; line-height: 1.4; }
.expired-renew { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) { .expired-inner { flex-wrap: wrap; } .expired-renew { width: 100%; text-align: center; } }
.nav-item.is-disabled, .nav-item.is-disabled:hover { color: #6d737a; cursor: not-allowed; }
.nav-item.is-disabled::after { display: none; }
.account-menu-item.is-disabled, .account-menu-item.is-disabled:hover { background: transparent; color: #a9b3ae; cursor: not-allowed; }
.account-menu-subscription.is-expired { color: var(--color-accent); font-weight: 600; }
.account-toggle-days.is-expired { background: var(--color-accent); color: #fff; }

/* Type and gender tags on one line, with a thin bar between the two groups */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.filter-sep { color: #7f8c86; font-size: 1.4rem; line-height: 1; margin: 0 6px; user-select: none; }

.test-cta { display: flex; justify-content: center; margin-top: 44px; }
.test-cta-card {
  background: var(--color-primary); color: white; border-radius: var(--radius);
  padding: 32px 40px; text-align: center; max-width: 480px; box-shadow: var(--shadow-md);
}
.test-cta-card h3 { margin-top: 0; }
.test-cta-card .btn-primary { background: white; color: var(--color-primary-dark); margin-top: 10px; }

/* Filters/tabs */
.filter-bar { display: flex; gap: 10px; margin: 18px 0; }
.filter-bar input[type=text] {
  flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--color-border); font-size: 0.95rem;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  padding: 8px 14px; border-radius: 999px; background: var(--color-surface);
  border: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 0.88rem; font-weight: 600;
}
.tab:hover { background: var(--color-mint-soft); border-color: var(--color-mint-border); color: var(--color-primary-dark); text-decoration: none; }
.tab.active { background: var(--color-mint); color: var(--color-primary-deep); border-color: var(--color-primary); font-weight: 700; text-decoration: none; }
.fav-filter { display: flex; gap: 8px; margin-bottom: 18px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); font-size: 0.82rem; color: var(--color-text-muted); transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.chip:hover { background: var(--color-mint-soft); border-color: var(--color-mint-border); color: var(--color-primary-dark); text-decoration: none; }
.chip.active { background: var(--color-mint); color: var(--color-primary-deep); border-color: var(--color-primary); font-weight: 700; text-decoration: none; }

/* Vocab table */
.vocab-table-wrap { overflow-x: auto; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); }
.vocab-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.vocab-table th, .vocab-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; }
.vocab-table th { color: var(--color-text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }
.vocab-table tr:last-child td { border-bottom: none; }
.empty-row { text-align: center; color: var(--color-text-muted); padding: 30px !important; }
.french-word { font-weight: 700; }
.gender-tag { font-size: 0.7rem; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--color-bg); color: var(--color-text-muted); }
.gender-tag.gender-pink { background: #fde2e7; color: #9c3b53; }
.gender-tag.gender-blue { background: #dbeafe; color: #2c5b8a; }
.audio-btn { border: none; background: var(--color-bg); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.audio-btn-disabled { opacity: 0.3; cursor: default; }
.fav-btn { border: none; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--color-text-muted); }
.fav-btn.is-fav { color: var(--color-accent); }
/* Done: an empty circle that fills with a tick; progress bars use the same success green */
.done-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #c3cadb; background: transparent; cursor: pointer;
  color: #fff; font-size: 0.9rem; font-weight: 800; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.done-btn:hover { border-color: var(--color-success); }
.done-btn.is-done { background: var(--color-success); border-color: var(--color-success); }
.done-btn:focus-visible { outline: 2px solid var(--color-success); outline-offset: 2px; }
.theme-progress, .progress-track { display: block; width: 100%; height: 6px; border-radius: 999px; background: #e6eae8; overflow: hidden; }
.theme-progress { max-width: 150px; margin-top: 2px; }
.theme-progress-fill, .progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--color-success); transition: width .25s ease; }
.theme-progress-text { font-size: 0.8rem; font-weight: 600; color: var(--color-success); }
.progress-line { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; max-width: 420px; }
.progress-line .progress-track { flex: 1; }
.progress-text { font-size: 0.85rem; color: var(--color-text-muted); white-space: nowrap; }
.progress-text b { color: var(--color-text); }
@media (prefers-reduced-motion: reduce) { .theme-progress-fill, .progress-fill, .done-btn { transition: none; } }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; align-items: center; padding: 16px; font-size: 0.9rem; }
.pagination-arrow, .pagination-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  color: var(--color-text-muted); font-weight: 600;
}
.pagination-arrow:hover, .pagination-page:hover { background: var(--color-bg); text-decoration: none; }
.pagination-page.current { background: var(--color-mint); color: var(--color-primary-deep); font-weight: 700; }
.pagination-ellipsis { color: var(--color-text-muted); padding: 0 4px; }

/* Mobile card layout for vocab table */
@media (max-width: 900px) {      /* cards up to tablet width; the table needs about 860px with all four language columns on */
  .vocab-table-wrap { overflow-x: visible; }
  .vocab-table { min-width: 0; }
  .vocab-table thead { display: none; }
  .vocab-table, .vocab-table tbody, .vocab-table tr, .vocab-table td { display: block; width: 100%; }
  .vocab-table tr { border-bottom: 1px solid var(--color-border); padding: 10px 0; }
  .vocab-table td {
    border: none; padding: 6px 16px; display: flex; justify-content: space-between;
    align-items: center; gap: 10px; flex-wrap: wrap; text-align: right;
  }
  .vocab-table td::before {
    content: attr(data-label); font-weight: 600; color: var(--color-text-muted);
    margin-right: 10px; text-align: left; flex-shrink: 0;
  }
}

/* Auth */
.auth-card { max-width: 400px; margin: 20px auto; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); padding: 34px; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-sub { color: var(--color-text-muted); margin-top: 0; margin-bottom: 20px; font-size: 0.9rem; }
.auth-card p, .auth-card ul { margin: 0 0 14px; }
.auth-card input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--color-border); margin-top: 4px; }
.auth-card label { font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); }
.auth-links { text-align: center; font-size: 0.88rem; margin-top: 14px; }
.auth-card input:disabled { background: var(--color-bg); color: var(--color-text-muted); }
.auth-card .helptext { display: block; font-size: 0.78rem; color: var(--color-text-muted); margin-top: 3px; }
.profile-hint { color: var(--color-text-muted); font-size: 0.9rem; }

/* Test config */
.test-config-form fieldset { border: none; padding: 0; margin: 0 0 26px; }
.test-config-form legend { font-weight: 700; margin-bottom: 10px; }
/* Very small theme cards (the theme's own icon + name): click to select. The real checkbox stays for keyboards and screen readers. */
.mini-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-card { position: relative; cursor: pointer; }
.mini-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mini-card-body {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 6px; border-radius: 12px;
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted);
  font-size: 0.88rem; font-weight: 600; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.mini-card-icon {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(var(--color-primary-rgb), 0.08);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem; line-height: 1;
}
.mini-card:hover .mini-card-body { background: var(--color-mint-soft); border-color: var(--color-mint-border); color: var(--color-primary-dark); }
.mini-card input:checked + .mini-card-body { background: var(--color-mint); border-color: var(--color-primary); color: var(--color-primary-deep); font-weight: 700; }
.mini-card input:checked + .mini-card-body .mini-card-icon { background: rgba(var(--color-primary-rgb), 0.16); }
.mini-card input:focus-visible + .mini-card-body { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.test-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.field-hint { margin: 8px 0 0; font-size: 0.85rem; color: var(--color-text-muted); }

/* Capsules (the same shape as the filter capsules): number of questions. The real checkbox/radio stays for keyboards and screen readers. */
.capsules { display: flex; flex-wrap: wrap; gap: 8px; }
.capsule { position: relative; cursor: pointer; }
.capsule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.capsule span {
  display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text-muted); font-size: 0.9rem; font-weight: 600;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.capsule:hover span { background: var(--color-mint-soft); border-color: var(--color-mint-border); color: var(--color-primary-dark); }
.capsule input:checked + span { background: var(--color-mint); border-color: var(--color-primary); color: var(--color-primary-deep); font-weight: 700; }
.capsule input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Test taking */
.answer-input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--color-border); }
.test-table td { padding: 8px 16px; }

/* Accent keyboard: a translucent green "glass" panel that floats above the page.
   Position, size, dragging and collapsing are unchanged -- only the look is new. */
.accent-keyboard {
  position: fixed; bottom: 20px; right: 20px; width: 310px; padding: 12px; z-index: 50;
  background: rgba(24, 88, 66, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(10, 40, 30, 0.35), 0 2px 6px rgba(10, 40, 30, 0.2);
  -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
}
/* Browsers without background blur get a solid green so the letters stay readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .accent-keyboard { background: rgb(24, 88, 66); }
}
.accent-keyboard-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.95); margin-bottom: 8px; cursor: grab; }
.accent-keyboard-header button { border: none; background: none; cursor: pointer; font-size: 1rem; color: #fff; padding: 0 6px; border-radius: 6px; }
.accent-keyboard-keys { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.accent-keyboard.collapsed .accent-keyboard-keys { display: none; }
.accent-key {
  border: 1px solid rgba(255, 255, 255, 0.30); background: rgba(255, 255, 255, 0.14); color: #fff;
  border-radius: 9px; padding: 7px 0; cursor: pointer; font-family: inherit; font-size: 1.4rem; line-height: 1.25;
  transition: background 0.12s ease, color 0.12s ease, transform 0.06s ease;
}
.accent-key:active { background: rgba(255, 255, 255, 0.92); color: var(--color-primary-dark); transform: scale(0.94); }
.accent-key:focus-visible, .accent-keyboard-header button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* Hover highlight only where a real mouse exists, so keys don't stay lit after a tap on phones. */
@media (hover: hover) {
  .accent-key:hover { background: rgba(255, 255, 255, 0.92); color: var(--color-primary-dark); }
  .accent-keyboard-header button:hover { background: rgba(255, 255, 255, 0.18); }
}
@media (prefers-reduced-motion: reduce) { .accent-key { transition: none; } }

/* Results */
.row-correct { background: #f2faf3; }
.row-incorrect { background: #fdf2f1; }
.result-correct { color: #1e7b34; font-weight: 700; }
.result-incorrect { color: #a4262c; font-weight: 700; }
.results-summary { margin-top: 26px; background: var(--color-surface); border-radius: var(--radius); border: 1px solid var(--color-border); padding: 26px; text-align: center; }
.results-score { display: flex; justify-content: center; gap: 50px; margin: 18px 0; }
.score-block { display: flex; flex-direction: column; }
.score-number { font-size: 1.8rem; font-weight: 800; color: var(--color-primary); }
.score-label { font-size: 0.82rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.results-actions { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }

.hint { color: var(--color-text-muted); }

.site-footer { border-top: 1px solid var(--color-border); padding: 20px 0; color: var(--color-text-muted); font-size: 0.82rem; text-align: center; margin-top: 40px; }

@media (max-width: 640px) {
  .header-inner { padding: 10px 16px 6px; }
  .main-nav { justify-content: space-between; gap: 2px; }
  .brand { font-size: 1.3rem; }
  .nav-item { padding: 8px 6px; font-size: 0.98rem; flex: 1 1 auto; justify-content: center; }
  .account-name { max-width: 17.5ch; }

  .results-score { gap: 24px; }

  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.92rem; }
  .hero-actions .btn { width: 100%; }

  .accent-keyboard {
    left: 12px; right: 12px; bottom: 12px; width: auto;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
  .accent-keyboard-keys { grid-template-columns: repeat(8, 1fr); gap: 3px; }
  .accent-key { padding: 8px 0; font-size: 1.3rem; }

  .test-config-form legend { font-size: 0.95rem; }
  .test-cta-card { padding: 24px 18px; }

  .page-main { padding: 12px 14px 48px; }
}

/* Logged-out landing page video */
.demo-video-section { text-align: center; margin: 30px 0 10px; }
.demo-video-wrap {
  max-width: 720px; margin: 0 auto; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md); border: 1px solid var(--color-border); background: #000;
}
.demo-video-wrap video { width: 100%; display: block; max-height: 420px; }
.demo-video-hint { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 14px; }
.demo-video-placeholder {
  max-width: 720px; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; margin: 0 auto;
  border-radius: var(--radius); border: 1px dashed var(--color-border);
  background: var(--color-surface); color: var(--color-text-muted); padding: 20px; font-size: 0.95rem;
}
/* The YouTube video (admin: Demo video): a frame with the right shape, the cover picture and a play button. */
.demo-video-box {
  position: relative; width: 100%; margin: 0 auto; overflow: hidden; border-radius: var(--radius);
  box-shadow: var(--shadow-md); border: 1px solid var(--color-border); background: #000;
}
.demo-shape-wide { max-width: 720px; aspect-ratio: 16 / 9; }
.demo-shape-tall { max-width: 340px; aspect-ratio: 9 / 16; }
.demo-shape-square { max-width: 480px; aspect-ratio: 1 / 1; }
.demo-video-play { position: absolute; inset: 0; display: block; }
.demo-video-play img { display: block; width: 100%; height: 100%; object-fit: cover; }
.demo-video-play-icon {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.62); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); transition: transform 0.15s ease, background 0.15s ease;
}
.demo-video-play-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; margin: -13px 0 0 -8px;
  border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent #fff;
}
.demo-video-play:hover .demo-video-play-icon, .demo-video-play:focus-visible .demo-video-play-icon { transform: scale(1.08); background: rgba(0, 0, 0, 0.8); }
.demo-video-play:focus-visible { outline: 3px solid var(--color-primary); outline-offset: -3px; }
.demo-video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@media (prefers-reduced-motion: reduce) { .demo-video-play-icon { transition: none; } }

/* ---------- Hindi (Language settings) + example sentences ---------- */
/* Everything Hindi is already in the page; it stays hidden until the learner turns "Show Hindi" on
   (language-setting.js sets data-hindi="on" on <html>). English is always shown. */
html:not([data-hindi="on"]) .hi-only { display: none !important; }
/* The two pronunciation switches (both off by default) are separate from the two meaning switches. */
html:not([data-english-pron="on"]) .ep-only { display: none !important; }
html:not([data-hindi-pron="on"]) .hp-only { display: none !important; }
/* A word's tip (e.g. "40 + 3" for numbers): a small grey line under the French word. Only words that have one show it. */
.word-tip { display: block; margin-top: 3px; font-size: 0.82rem; font-weight: 500; color: var(--color-text-muted); }
@media (max-width: 900px) { .vocab-table td .word-tip { flex-basis: 100%; } }
/* The English switch (on by default). Off hides the English meaning in word lists and the sentence box. */
html[data-english="off"] .en-only { display: none !important; }
/* Test pages can't ask a blank question: English is hidden there only when Hindi is on AND the word has a
   Hindi meaning; then the Hindi meaning becomes the prompt. In every other case the English prompt stays. */
.th-alt { display: none; }
html[data-english="off"][data-hindi="on"] .th-alt { display: inline; }
html[data-english="off"][data-hindi="on"] .th-main { display: none; }
html[data-english="off"][data-hindi="on"] .test-prompt.has-hi .en-text { display: none; }
html[data-english="off"][data-hindi="on"] .test-prompt.has-hi .hindi-sub { color: var(--color-text); font-size: 1em; margin-top: 0; }
@media (max-width: 900px) {
  html[data-english="off"][data-hindi="on"] .vocab-table td.test-prompt::before { content: attr(data-label-alt); }
}
[lang="hi"] { line-height: 1.6; }
.vocab-table td[lang="hi"] { font-size: 1rem; }   /* Devanagari reads small at the table's text size */
.vocab-table td[lang="hi"]::before { font-size: 0.92rem; }   /* ...but the phone-card label ("Hindi meaning") stays the same size as the others */
.hindi-sub { color: var(--color-text-muted); font-size: 0.95em; margin-top: 2px; }

/* The example-sentence button next to a word: a speech bubble with quotation marks, i.e. "this word, used in a sentence" */
.sentence-btn {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-left: 6px; padding: 0;
  width: 34px; height: 34px; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  background: var(--color-mint-soft); color: var(--color-primary);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.sentence-btn:hover { background: var(--color-mint); color: var(--color-primary-deep); border-color: var(--color-mint-border); }
.sentence-icon { display: block; }
.sentence-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* The example-sentence box */
.sentence-dialog { border: none; padding: 0; background: transparent; width: calc(100% - 32px); max-width: 520px; color: var(--color-text); }
.sentence-dialog::backdrop { background: rgba(16, 40, 32, 0.45); }
.sentence-dialog.is-fallback {            /* browsers without <dialog>.showModal() */
  position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 100;
  box-shadow: 0 0 0 100vmax rgba(16, 40, 32, 0.45);
}
.sentence-dialog [hidden] { display: none !important; }
.sentence-card { position: relative; background: var(--color-surface); border-radius: 16px; padding: 22px 24px 24px; box-shadow: var(--shadow-md); }
.sentence-word { margin: 0 36px 12px 0; font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sentence-fr { margin: 0 0 8px; font-size: 1rem; line-height: 1.5; }
.sentence-hit { background: rgba(var(--color-primary-rgb), 0.16); color: var(--color-primary-dark); font-weight: 700; border-radius: 4px; padding: 0 3px; }   /* just the studied word */
.sentence-en { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.5; }
.sentence-hi { margin: 0; padding-top: 10px; border-top: 1px dashed var(--color-border); font-size: 1rem; color: var(--color-primary-dark); }
.sentence-close {
  position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: none; background: none;
  border-radius: 8px; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--color-text-muted);
}
.sentence-close:hover { background: var(--color-bg); }
.sentence-close:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* "Language settings" switch in the account dropdown */
/* the sub-menu: indented under its row, with a green line down the side, in smaller type */
.account-menu-setting { margin: 0 14px 10px 24px; padding: 6px 0 6px 14px; border-left: 2px solid var(--color-mint-border); }
.account-menu-heading { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 8px; }
.lang-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; font-size: 0.8rem; color: var(--color-text-muted); }
.lang-switch + .lang-switch { margin-top: 8px; }
.lang-switch-label small { display: block; margin-top: 1px; font-size: 0.72rem; font-weight: 400; color: var(--color-text-muted); }
.lang-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }   /* hidden, but still keyboard-focusable */
.lang-switch-track { position: relative; flex: 0 0 auto; width: 32px; height: 18px; border-radius: 999px; background: #8a9692; transition: background 0.15s ease; }
.lang-switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s ease;
}
.lang-switch-input:checked + .lang-switch-track { background: var(--color-primary); }
.lang-switch-input:checked + .lang-switch-track::after { transform: translateX(14px); }
.lang-switch-input:focus-visible + .lang-switch-track { outline: 2px solid var(--color-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .lang-switch-track, .lang-switch-track::after { transition: none; } }

/* Text that is there for screen readers only (the home page's heading) */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The maintenance notice at the very top of every page (MAINTENANCE_NOTICE setting) */
.notice-bar { background: #fff4d6; color: #6b4a00; border-bottom: 1px solid #f0d58a; text-align: center; padding: 9px 16px; font-size: 0.92rem; font-weight: 600; }

/* Theme pages: a faint line-drawing background that fits the theme (Body Parts: hearts, eyes, hands ...), in a quiet grey-violet on the same soft
   background as every other page. A fixed layer behind the page. Switch it off with THEME_BACKGROUNDS=0. */
body.themed-bg { --pattern-ink: #6f7596; }
body.themed-bg::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--pattern-ink); opacity: 0.12;
  -webkit-mask-size: 380px 380px; mask-size: 380px 380px; -webkit-mask-repeat: repeat; mask-repeat: repeat;
}
body.bg-body-parts::before { -webkit-mask-image: url("../img/patterns/body-parts.2379da327d89.svg"); mask-image: url("../img/patterns/body-parts.2379da327d89.svg"); }
body.bg-colours::before { -webkit-mask-image: url("../img/patterns/colours.c8b9d8bb4653.svg"); mask-image: url("../img/patterns/colours.c8b9d8bb4653.svg"); }
body.bg-numbers::before { -webkit-mask-image: url("../img/patterns/numbers.bfcef760fd53.svg"); mask-image: url("../img/patterns/numbers.bfcef760fd53.svg"); }
body.bg-days-months::before { -webkit-mask-image: url("../img/patterns/days-months.f33d118bdc60.svg"); mask-image: url("../img/patterns/days-months.f33d118bdc60.svg"); }
body.bg-time::before { -webkit-mask-image: url("../img/patterns/time.fc5834d2ceba.svg"); mask-image: url("../img/patterns/time.fc5834d2ceba.svg"); }
body.bg-celebration::before { -webkit-mask-image: url("../img/patterns/celebration.cd758aa37737.svg"); mask-image: url("../img/patterns/celebration.cd758aa37737.svg"); }
body.bg-connectors::before { -webkit-mask-image: url("../img/patterns/connectors.90fe90e97d9a.svg"); mask-image: url("../img/patterns/connectors.90fe90e97d9a.svg"); }
body.bg-daily-life::before { -webkit-mask-image: url("../img/patterns/daily-life.72442cfa2997.svg"); mask-image: url("../img/patterns/daily-life.72442cfa2997.svg"); }
body.bg-education::before { -webkit-mask-image: url("../img/patterns/education.a7036b896703.svg"); mask-image: url("../img/patterns/education.a7036b896703.svg"); }
body.bg-family::before { -webkit-mask-image: url("../img/patterns/family.41e000637a88.svg"); mask-image: url("../img/patterns/family.41e000637a88.svg"); }
body.bg-health::before { -webkit-mask-image: url("../img/patterns/health.16a318e1f947.svg"); mask-image: url("../img/patterns/health.16a318e1f947.svg"); }
body.bg-hobbies::before { -webkit-mask-image: url("../img/patterns/hobbies.7fc6ec5c87f5.svg"); mask-image: url("../img/patterns/hobbies.7fc6ec5c87f5.svg"); }
body.bg-immigration::before { -webkit-mask-image: url("../img/patterns/immigration.4ebef8d64da0.svg"); mask-image: url("../img/patterns/immigration.4ebef8d64da0.svg"); }
body.bg-shopping::before { -webkit-mask-image: url("../img/patterns/shopping.1daa78d26195.svg"); mask-image: url("../img/patterns/shopping.1daa78d26195.svg"); }
body.bg-travel::before { -webkit-mask-image: url("../img/patterns/travel.8da7ddd49a72.svg"); mask-image: url("../img/patterns/travel.8da7ddd49a72.svg"); }
body.bg-work::before { -webkit-mask-image: url("../img/patterns/work.c0b65ed39d97.svg"); mask-image: url("../img/patterns/work.c0b65ed39d97.svg"); }
body.bg-generic::before { -webkit-mask-image: url("../img/patterns/generic.d1cd12a8bde9.svg"); mask-image: url("../img/patterns/generic.d1cd12a8bde9.svg"); }
/* app pages (round 16, Nov 17): Test (clipboards, pencils, ticks, hourglasses, trophies), Favorites (hearts, stars, bookmarks),
   Search (magnifiers, books, letters), Study plan (calendars, targets, charts, flags) */
body.bg-test::before { -webkit-mask-image: url("../img/patterns/test.45aa02048221.svg"); mask-image: url("../img/patterns/test.45aa02048221.svg"); }
body.bg-favorites::before { -webkit-mask-image: url("../img/patterns/favorites.e66f363ea5e1.svg"); mask-image: url("../img/patterns/favorites.e66f363ea5e1.svg"); }
body.bg-search::before { -webkit-mask-image: url("../img/patterns/search.cd155666e919.svg"); mask-image: url("../img/patterns/search.cd155666e919.svg"); }
body.bg-plan::before { -webkit-mask-image: url("../img/patterns/plan.3f0ccb6319dd.svg"); mask-image: url("../img/patterns/plan.3f0ccb6319dd.svg"); }
@media (max-width: 640px) { body.themed-bg::before { -webkit-mask-size: 300px 300px; mask-size: 300px 300px; } }

/* Very small phones (older 320px models): less room for the name than the 360px measurement behind accounts/display.py, so the name is
   cut sooner with a "..." and the "N days left" badge waits inside the menu (it is shown there too). */
@media (max-width: 359px) {
  .account-name, .account-toggle.has-days .account-name { max-width: 9ch; }
  .account-toggle-days { display: none; }
}

/* Library (guides and PDFs) */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.library-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 18px; padding: 18px 18px 16px; transition: box-shadow .15s ease, transform .15s ease; }
.library-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.library-name { font-size: 1.15rem; margin: 0; }
.library-desc { margin: 0; color: var(--color-text-muted); }
.library-meta { margin: 0 0 8px; font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); }
.library-empty { margin-top: 18px; padding: 22px; border: 1px dashed var(--color-border); border-radius: 18px; background: var(--color-surface); }
@media (prefers-reduced-motion: reduce) { .library-card { transition: none; } .library-card:hover { transform: none; } }

/* The logo at the top left: shown as it is (its own shape, not cropped, no mask); a square picture stays square */
.brand-has-logo { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo { display: block; height: 40px; width: auto; max-width: 160px; object-fit: contain; }
@media (max-width: 520px) { .brand-logo { height: 34px; } }

/* ===== My Plan ===== */
/* anything on My Plan with the hidden attribute stays hidden, even where a rule below sets display */
.mp-page [hidden], .mp-reset-link[hidden], .mp-trend[hidden], .mp-info-wrap[hidden], .mp-today-bar[hidden], .mp-streak[hidden], .mp-setup[hidden], .mp-setup-card[hidden], .mp-plan-area[hidden], .mp-active[hidden], .mp-complete[hidden] { display: none !important; }
.mp-intro { margin: 0 0 18px; max-width: 70ch; }
.mp-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 16px; }
.mp-h2 { font-size: 1.1rem; margin: 0; }
.mp-label { font-size: 0.74rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.mp-overall-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mp-pct { font-size: 1.5rem; font-weight: 800; color: var(--color-primary); }
.mp-progress { height: 10px; }
.mp-overall-line { margin: 10px 0 0; font-size: 0.92rem; color: var(--color-text-muted); }
.mp-overall-line strong { color: var(--color-text); }
.mp-today-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }     /* the revised target is the focus: it gets the wider side */
.mp-today-row .mp-card { margin-bottom: 0; }
.mp-today-row { margin-bottom: 16px; }
.mp-today { display: flex; flex-direction: column; justify-content: center; }
.mp-today-figure { margin: 4px 0 10px; line-height: 1; }
.mp-today-big { font-size: 3rem; font-weight: 800; color: var(--color-primary); letter-spacing: -0.02em; }
.mp-today-unit { font-size: 1.05rem; font-weight: 600; color: var(--color-text-muted); }
.mp-today-bar { height: 8px; }
.mp-today-sub { margin: 8px 0 0; font-size: 0.9rem; font-weight: 600; }
.mp-today-figure { position: relative; }
.mp-streak { margin: 4px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--color-accent); }
.mp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-content: center; }
.mp-stat { display: flex; flex-direction: column; gap: 2px; }
.mp-stat-num { font-size: 1.45rem; font-weight: 800; color: var(--color-text); }
.mp-chart-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.mp-plan-line { font-size: 0.85rem; color: var(--color-text-muted); }
.mp-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 10px 0 8px; font-size: 0.82rem; color: var(--color-text-muted); }
.mp-legend li { display: flex; align-items: center; gap: 6px; }
.mp-key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.mp-key-you { width: 18px; height: 3px; background: var(--color-success); }
.mp-key-plan { width: 18px; height: 0; border-top: 3px dotted var(--color-accent); border-radius: 0; }
.mp-key-bar { width: 28px; background: linear-gradient(90deg, hsl(4, 72%, 52%), hsl(80, 61%, 44%), hsl(157, 50%, 36%)); }
.mp-chart-wrap { position: relative; }
.mp-chart { width: 100%; min-height: 200px; }
.mp-chart svg { display: block; touch-action: pan-y; }
.pc-grid { stroke: #e8eeeb; stroke-width: 1; }
.pc-base { stroke: var(--color-border-strong); stroke-width: 1; }
.pc-week { fill: rgba(var(--color-primary-rgb), 0.035); }
.pc-axis { font-size: 11px; fill: var(--color-text-muted); font-family: var(--font); }
.pc-planline, .pc-rate { stroke: var(--color-accent); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0.1 6; fill: none; }
.pc-you { fill: none; stroke: var(--color-success); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.pc-you-area { fill: rgba(46, 139, 103, 0.10); stroke: none; }
.pc-you-dot { fill: var(--color-success); stroke: #fff; stroke-width: 2; pointer-events: none; }
.pc-plan-dot { fill: var(--color-accent); stroke: #fff; stroke-width: 2; pointer-events: none; }
.pc-bar.is-on { stroke: var(--color-text); stroke-width: 1.5; }
.pc-hover { fill: rgba(var(--color-primary-rgb), 0.08); pointer-events: none; }
.pc-guide { stroke: var(--color-text); stroke-width: 1; opacity: 0.25; pointer-events: none; }
.mp-tip .tip-ahead { color: #8fe0b5; font-weight: 700; }
.mp-tip .tip-behind { color: #ffb38a; font-weight: 700; }
.pc-today { stroke: var(--color-text); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; }
.pc-today-label { font-size: 11px; font-weight: 700; fill: var(--color-text); font-family: var(--font); }
.mp-tip { position: absolute; z-index: 5; pointer-events: none; background: #2c2f34; color: #fff; font-size: 0.8rem; line-height: 1.45; padding: 8px 11px; border-radius: 8px; box-shadow: var(--shadow-md); white-space: nowrap; }
.mp-setup-card { padding: 0; overflow: hidden; }
.mp-setup-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; }
.mp-setup-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; font-family: inherit; color: var(--color-text); cursor: pointer; }
.mp-setup-toggle:disabled { cursor: default; }
.mp-setup-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 6px; }
.mp-setup-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.mp-setup-summary { font-size: 0.88rem; color: var(--color-text-muted); }
.mp-setup-card.has-plan .mp-setup-toggle { cursor: pointer; }
.mp-reset-link { margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 0.92rem; font-weight: 600; color: var(--color-primary-dark); white-space: nowrap; }
.mp-setup-toggle:hover .mp-reset-link { text-decoration: underline; }
.mp-caret { display: inline-block; font-size: 0.8rem; transition: transform .2s ease; }
.mp-setup-card:not(.is-folded) .mp-caret { transform: rotate(180deg); }
.mp-setup { padding: 0 22px 20px; border-top: 1px solid var(--color-border); }
.mp-setup-card:not(.has-plan) .mp-setup { border-top: 0; }
.mp-setup-note.is-flash { color: var(--color-accent); font-weight: 600; animation: mp-flash .6s ease; }
@keyframes mp-flash { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.mp-plan-area.is-new { animation: mp-rise .45s ease; }
@keyframes mp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.mp-confirm { text-align: left; }
.mp-confirm h2 { font-size: 1.3rem; }
.mp-confirm .celebrate-actions { justify-content: flex-start; }
.mp-confirm-skip { display: flex; align-items: center; gap: 8px; margin: -6px 0 18px; font-size: 0.9rem; color: var(--color-text-muted); cursor: pointer; }
.mp-confirm-skip input { width: 17px; height: 17px; accent-color: var(--color-primary); }
@media (prefers-reduced-motion: reduce) { .mp-plan-area.is-new, .mp-setup-note.is-flash { animation: none; } .mp-caret { transition: none; } }
.mp-setup-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 40px; margin: 16px 0 6px; }
.mp-field { border: none; padding: 0; margin: 0; min-width: 0; }
.mp-field legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.mp-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--color-border-strong); border-radius: 12px; overflow: hidden; background: var(--color-surface); }
.mp-step { width: 42px; border: none; background: var(--color-mint-soft); color: var(--color-primary-dark); font-size: 1.3rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.mp-step:hover { background: var(--color-mint); }
.mp-step:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.mp-stepper input { width: 64px; border: none; border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); text-align: center; font-size: 1.15rem; font-weight: 700; font-family: inherit; color: var(--color-text); padding: 8px 0; -moz-appearance: textfield; appearance: textfield; }
.mp-stepper input::-webkit-outer-spin-button, .mp-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mp-stepper input:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.mp-calc { margin: 14px 0 12px; padding: 16px 18px; border-radius: 12px; background: var(--color-mint-soft); border: 1px solid var(--color-mint-border); }
.mp-calc-figure { line-height: 1.1; }
.mp-calc-rate { font-size: 2.1rem; font-weight: 800; color: var(--color-primary); }
.mp-calc-unit { font-size: 1rem; font-weight: 700; color: var(--color-primary-dark); }
.mp-calc-detail, .mp-calc-end { margin: 6px 0 0; font-size: 0.88rem; color: var(--color-text-muted); }
.mp-calc-end { margin-top: 2px; font-weight: 600; color: var(--color-text); }
.mp-setup-note { margin: 0 0 14px; }
.mp-empty p { margin: 0; }
.mp-complete { text-align: center; }
.mp-complete-emoji { font-size: 2.6rem; }
.mp-complete .mp-h2 { margin: 6px 0 4px; }
.mp-how { margin-top: 6px; font-size: 0.9rem; color: var(--color-text-muted); }
.mp-how summary { cursor: pointer; font-weight: 600; color: var(--color-primary-dark); }
.mp-how ul { margin: 8px 0 0; padding-left: 20px; }
.mp-how li { margin-bottom: 4px; }
@media (max-width: 640px) {
  .mp-card { padding: 16px; }
  .mp-setup-card { padding: 0; }
  .mp-setup-head { padding: 14px 16px; }
  .mp-setup { padding: 0 16px 16px; }
  .mp-today-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mp-today-big { font-size: 2.6rem; }
  .mp-setup-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .mp-stat-num { font-size: 1.25rem; }
}

/* Actual vs plan: green (solid) is what you did, orange (dotted) is the plan -- the same in the cards, charts and tooltips. */
.mp-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.mp-swatch { display: inline-block; width: 16px; height: 0; border-top: 3px solid var(--color-success); border-radius: 2px; }
.mp-swatch-plan { border-top: 3px dotted var(--color-accent); border-radius: 0; }
.mp-today { border-top: 3px solid var(--color-success); }
.mp-stats { border-top: 3px dotted var(--color-accent); }
.mp-stats-title { grid-column: 1 / -1; margin-bottom: -6px; }
.mp-trend { display: inline-block; margin-left: 6px; font-size: 1.6rem; font-weight: 700; vertical-align: 0.55em; line-height: 1; }
.mp-trend.is-up { color: #c8382c; }
.mp-trend.is-down { color: var(--color-success); }
.mp-tip .tip-key { display: inline-block; width: 12px; height: 0; margin-right: 6px; vertical-align: middle; }
.mp-tip .tip-plan { border-top: 3px dotted #f0a476; }
.mp-tip .tip-actual { border-top: 3px solid #8fe0b5; }

/* (i) in the top-right corner of a card; its note pops up on hover, keyboard focus or tap */
.mp-today, .mp-stats { position: relative; }
.mp-info-wrap { position: absolute; top: 14px; right: 14px; z-index: 6; }
.mp-info { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1.5px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-muted); font: italic 700 0.8rem/1 Georgia, "Times New Roman", serif; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.mp-info:hover, .mp-info-wrap.is-open .mp-info { border-color: var(--color-primary); color: var(--color-primary-dark); }
.mp-info:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.mp-pop { position: absolute; top: calc(100% + 8px); right: -6px; width: min(290px, 78vw); padding: 12px 14px; border-radius: 12px; background: #2c2f34; color: #fff; font-size: 0.84rem; line-height: 1.45; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s; }
.mp-pop::before { content: ""; position: absolute; top: -6px; right: 12px; width: 12px; height: 12px; background: #2c2f34; transform: rotate(45deg); border-radius: 2px; }
.mp-info-wrap:hover .mp-pop, .mp-info-wrap:focus-within .mp-pop, .mp-info-wrap.is-open .mp-pop { opacity: 1; visibility: visible; transform: none; }
.mp-pop-title { margin: 0 0 6px; font-weight: 700; }
.mp-pop ul { margin: 0; padding: 0; list-style: none; }
.mp-pop li { position: relative; padding-left: 20px; margin-top: 4px; }
.mp-pop li::before { content: "•"; position: absolute; left: 5px; color: #9aa3ab; }
.mp-pop li:has(.mp-pop-arrow)::before { content: none; }
.mp-pop-arrow { position: absolute; left: 0; font-weight: 800; }
.mp-pop-arrow.is-up { color: #ff8a7a; }
.mp-pop-arrow.is-down { color: #8fe0b5; }
@media (prefers-reduced-motion: reduce) { .mp-pop { transition: none; } }
/* "Your plan" is frozen: cool frosted tint, a lock, quieter numbers -- it shows what was set, not something to edit */
.mp-stats { background: linear-gradient(180deg, #f5f7f9, #eef2f4); }
.mp-stats .mp-stat-num { color: #4a5560; }
.mp-lock { color: #7d8a94; }

/* ===== Celebrations (My Plan milestones, test results) ===== */
.celebrate-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1001; }
.celebrate-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(27, 41, 36, 0.45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: celebrate-fade .2s ease; }
.celebrate-card { background: var(--color-surface); border-radius: 18px; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25); max-width: 400px; width: 100%; padding: 28px 26px 24px; text-align: center; animation: celebrate-pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate-card h2 { margin: 6px 0 8px; font-size: 1.45rem; color: var(--color-primary-deep); }
.celebrate-card p { margin: 0 0 20px; color: var(--color-text-muted); font-size: 0.95rem; }
.celebrate-card.is-big h2 { font-size: 1.7rem; }
.celebrate-card.is-soft h2 { color: var(--color-accent); }
.celebrate-emoji { font-size: 3rem; line-height: 1.1; }
.celebrate-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
@keyframes celebrate-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes celebrate-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .celebrate-overlay, .celebrate-card { animation: none; } }

/* My Plan: theme/category chips (same chips as the Test page); a finished theme is greyed out and can't be picked */
.mp-themes { margin-top: 18px; }
.mini-card.is-complete { cursor: not-allowed; }
.mini-card.is-complete .mini-card-body,
.mini-card.is-complete:hover .mini-card-body { background: var(--color-bg); border-color: var(--color-border); border-style: dashed; color: var(--color-text-muted); font-weight: 600; opacity: .7; }
.mini-card.is-complete .mini-card-icon { filter: grayscale(1); background: rgba(0, 0, 0, 0.05); }
.mini-card-done { font-size: 0.72rem; font-weight: 700; color: var(--color-primary-dark); letter-spacing: .02em; }

/* My Plan: "Your current target" is the first thing the eye should catch.
   Three looks to compare in the preview (hl-a, hl-b, hl-c); the build keeps one. --tc = the warm colour when above plan. */
.mp-target-eyebrow { color: var(--color-primary-dark); font-weight: 800; letter-spacing: .07em; }
.mp-target-icon { font-size: 1rem; line-height: 1; }
/* A spotlight: soft green card, green frame, bigger number */
.mp-today.hl-a { background: #ecf8f1; border: 2px solid var(--color-success); border-top-width: 3px; box-shadow: 0 10px 28px rgba(46, 139, 103, 0.18); }
.mp-today.hl-a .mp-today-big { font-size: 3.7rem; }
/* B solid: deep green card, white writing (turns warm when you're above plan) */
/* C badge: white card, the number sits in a big green badge */
/* the glow: twice when the page opens or a plan is saved */
.mp-today.is-glow { animation: mp-glow 1.3s ease-out 2; }
@keyframes mp-glow { 0% { box-shadow: 0 0 0 0 rgba(46, 139, 103, 0.55); } 100% { box-shadow: 0 0 0 16px rgba(46, 139, 103, 0); } }
@media (prefers-reduced-motion: reduce) { .mp-today.is-glow { animation: none; } }

/* ---- Round 16: target capsule on word lists + Study plan switches ---- */
.target-capsule { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 6px;
  border-radius: 999px; background: var(--color-surface); border: 1.5px solid var(--color-mint-border); color: var(--color-text); text-decoration: none;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.14); font-size: 0.95rem; line-height: 1; font-variant-numeric: tabular-nums; transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease; }
.target-capsule[hidden] { display: none; }
.target-capsule:hover, .target-capsule:focus-visible { border-color: var(--color-primary); }
.target-capsule:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.tc-ring { width: 28px; height: 28px; transform: rotate(-90deg); flex: 0 0 auto; }
.tc-ring circle { fill: none; stroke-width: 4; }
.tc-ring-bg { stroke: var(--color-mint); }
.tc-ring-fill { stroke: var(--color-primary); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.35s ease; }
.tc-check { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: rotate(90deg); transform-origin: 18px 18px; }
.tc-num { font-weight: 800; font-size: 1.05rem; color: var(--color-primary-deep); }
.tc-of { font-weight: 600; color: var(--color-text-muted); }
.tc-tip { position: absolute; right: 0; bottom: calc(100% + 8px); width: max-content; max-width: 240px; padding: 8px 11px; border-radius: 10px; background: var(--color-primary-deep);
  color: #fff; font-size: 0.8rem; line-height: 1.35; white-space: normal; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
.target-capsule:hover .tc-tip, .target-capsule:focus-visible .tc-tip, .target-capsule.show-tip .tc-tip { opacity: 1; transform: none; }
/* target reached: solid green capsule, ring turns into a white tick */
.target-capsule.is-hit { background: var(--color-primary); border-color: var(--color-primary); }
.target-capsule.is-hit .tc-num { color: #fff; }
.target-capsule.is-hit .tc-of { color: rgba(255, 255, 255, 0.82); }
.target-capsule.is-hit .tc-ring-bg { stroke: rgba(255, 255, 255, 0.25); }
.target-capsule.is-hit .tc-ring-fill { stroke: #fff; stroke-dashoffset: 0 !important; opacity: 0; }
.target-capsule.is-hit .tc-check { opacity: 1; }
/* a list that isn't in the plan: quieter, still shows the day's count */
.target-capsule.is-out { opacity: 0.6; border-style: dashed; filter: grayscale(1); background: #f1f3f4; border-color: #c4c9cd; }
.target-capsule.is-out .tc-num, .target-capsule.is-out .tc-of { color: #7b848c; }
.target-capsule.is-out .tc-ring-fill { stroke: #9aa2a9; }
.target-capsule.is-out:hover, .target-capsule.is-out:focus-visible { opacity: 0.85; }
/* "target reached" moment: a quick pop and a small burst, about 1 s */
.target-capsule.is-pop { animation: tc-pop 0.6s cubic-bezier(.2,.8,.2,1.4); }
@keyframes tc-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.tc-burst { position: absolute; left: 20px; top: 50%; width: 0; height: 0; pointer-events: none; }
.tc-burst i { position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; animation: tc-fly 0.9s ease-out forwards; }
@keyframes tc-fly { 0% { transform: translate(0, 0) scale(0.6); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .target-capsule, .tc-ring-fill, .tc-tip { transition: none; } .target-capsule.is-pop { animation: none; } }
@media (max-width: 600px) { .target-capsule { right: 12px; bottom: 12px; height: 38px; } }
/* Study plan switches: "Show my target" greys out while the plan is off */
.lang-switch.is-unavailable { opacity: 0.5; cursor: not-allowed; }
/* My Plan while the plan is off: only the notice */
.mp-off { border-left: 5px solid #e8a33a; background: #fff8ec; }
.mp-off-title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; color: #8a4b08; }
#mp-turn-on[hidden] { display: none !important; }
.btn-danger:disabled, .btn-danger:disabled:hover { background: #cfd3d8; color: #fff; box-shadow: none; transform: none; cursor: not-allowed; }
[data-plan="off"] #mp-setup-card, [data-plan="off"] #mp-plan-area, [data-plan="off"] #mp-active, [data-plan="off"] #mp-complete { display: none !important; }
/* room under the last word so the capsule never covers a Done tick */
body:has(.target-capsule:not([hidden])) .page-main { padding-bottom: 72px; }

/* ---- Round 16: "Only words I've studied" on the test page ---- */
.studied-box { margin: 0 0 18px; padding: 14px 16px; border: 1.5px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.studied-box.is-on { border-color: var(--color-mint-border); background: var(--color-mint-soft); }
.fav-box.is-on { border-color: var(--color-accent); background: rgba(184, 71, 15, 0.06); }
.studied-count[hidden] { display: none; }
.studied-switch { font-size: 0.95rem; color: var(--color-text); }
.studied-switch .lang-switch-label b { display: block; font-size: 1rem; }
.studied-switch .lang-switch-label small { font-size: 0.82rem; }
.studied-when { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--color-mint-border); }
.studied-when[hidden] { display: none; }
.studied-when-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); margin-bottom: 6px; }
.studied-count { margin: 10px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--color-primary-deep); }
.done-badge { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: var(--color-primary); background: var(--color-mint); border-radius: 999px; padding: 1px 7px; }
.done-badge:empty { display: none; }
.mini-card.is-empty { cursor: not-allowed; }
.mini-card.is-empty .mini-card-body, .mini-card.is-empty:hover .mini-card-body { background: var(--color-bg); border-color: var(--color-border); border-style: dashed; color: var(--color-text-muted); opacity: .6; }
.mini-card.is-empty .mini-card-icon { filter: grayscale(1); }
.mini-card.is-empty .done-badge { background: transparent; color: var(--color-text-muted); }
.capsule-all { display: none; }
.studied-on .capsule-all { display: inline-flex; }
.capsule.is-off { opacity: .4; cursor: not-allowed; }
.capsule.is-off span { text-decoration: line-through; }
#generate-btn:disabled { opacity: .5; cursor: not-allowed; }
.lang-switch.lang-switch-sep { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--color-border); }

/* ===== Round 16 (Nov 10): Study plan page simplified, one chart, test spacing, out-of-plan themes, favorites filters ===== */
.btn-danger { background: #c0392b; color: #fff; box-shadow: 0 1px 2px rgba(120, 30, 20, 0.3); }
.btn-danger:hover { background: #a93226; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(192, 57, 43, 0.28); }
.btn-danger:active { background: #922b21; transform: translateY(0); box-shadow: none; }
.btn-danger:focus-visible { outline: 3px solid #f2b8b1; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .btn-danger:hover { transform: none; } }
.mp-steps { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 0; margin: 0 0 18px; font-size: 0.95rem; font-weight: 600; color: var(--color-text); }
.mp-steps li { display: inline-flex; align-items: center; gap: 8px; }
.mp-steps span, .mp-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--color-primary); color: #fff; font-size: 0.8rem; font-weight: 800; flex-shrink: 0; }
.mp-num { width: 22px; height: 22px; margin-right: 8px; font-size: 0.75rem; vertical-align: 1px; }
.mp-steps .mp-steps-go { color: var(--color-primary-dark); }
.mp-steps[hidden], .mp-plan-actions[hidden], .mp-modal[hidden], .mp-setup-note[hidden], #mp-reset-btn[hidden] { display: none !important; }
.mp-plan-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.mp-plan-actions #mp-disable { margin-left: auto; }
.mp-modal { position: fixed; inset: 0; z-index: 900; background: rgba(27, 41, 36, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
.mp-modal-card { position: relative; background: var(--color-surface); border-radius: 18px; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25); width: min(720px, 100%); padding: 22px 24px 8px; }
.mp-modal-card .mp-setup { padding: 0; border-top: 0; }
.mp-modal-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--color-text); }
.mp-calc-line { margin: 4px 0 0; font-size: 0.95rem; font-weight: 600; color: var(--color-primary-dark); }
.mp-calc-figure { font-size: 1.05rem; font-weight: 700; color: var(--color-primary-dark); }
.mp-confirm-lines { font-weight: 600; line-height: 1.6; }
.pc-target-ahead { opacity: 0.4; }
#test-form > .btn { margin-top: 24px; }
.theme-card.is-out-of-plan { opacity: 0.45; filter: grayscale(0.85); }
.theme-card.is-out-of-plan:hover, .theme-card.is-out-of-plan:focus-visible { opacity: 0.8; filter: grayscale(0.4); }
.fav-filters .filter-row { margin-bottom: 8px; }
@media (max-width: 600px) { .mp-modal-card { padding: 18px 16px 6px; } .mp-plan-actions .btn { padding-left: 16px; padding-right: 16px; } }
.mp-syllabus { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.mp-syllabus-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-syl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--color-border-strong); font-size: 0.85rem; font-weight: 600; color: #4a5560; }

/* ===== Round 16 (Nov 16): Study plan → All-time progress ===== */
.mp-alltime { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; margin-top: 16px; align-items: stretch; }
.mp-alltime[hidden], .mp-how[hidden] { display: none; }
.mp-alltime .at-chart-card { margin: 0; }
.at-side { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.at-box { margin: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.at-num { font-size: 2.4rem; font-weight: 800; line-height: 1.05; color: #23468f; }
.at-sub { font-size: 0.85rem; color: var(--color-text-muted); }
.at-sub b { color: var(--color-text); font-size: 1rem; }
.at-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.at-range select { font: inherit; font-weight: 800; font-size: 1.15rem; color: var(--color-text); padding: 4px 34px 4px 12px; border: 1.5px solid var(--color-border); border-radius: 10px; background: var(--color-surface, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23333' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; -webkit-appearance: none; cursor: pointer; }
.at-range select:hover { border-color: var(--color-primary); }
.at-range select:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.at-key-bar { background: #3d6fd6; }
.at-key-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e8833a; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e8833a; }
.at-bar { fill: #3d6fd6; }
.at-bar.is-on { stroke: var(--color-text); stroke-width: 1.5; }
.at-dot { fill: #e8833a; stroke: #fff; stroke-width: 2; }
.at-testline { fill: none; stroke: #e8833a; stroke-width: 1.5; opacity: .55; }
.at-axis2 { fill: #c4651f; }
.at-month { stroke: var(--color-border); stroke-dasharray: 2 3; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  .mp-alltime { grid-template-columns: 1fr; }
  .at-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .at-num { font-size: 1.9rem; }
}

/* ===== Round 16 (Nov 16): Test page → "Select words" chip row + (i) help next to each filter's name ===== */
.words-set .studied-when { margin-top: 10px; padding-top: 0; border-top: 0; }
.words-set .studied-count { margin: 10px 0 0; }
.studied-count:empty { display: none; }
.words-set .mini-card-icon { font-weight: 700; }
.test-config-form legend { display: flex; align-items: center; gap: 8px; }
.hint-i { position: relative; display: inline-flex; }
.hint-btn { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--color-border-strong, #c9d2ce); background: var(--color-surface, #fff); color: var(--color-text-muted); font: italic 700 12px/1 Georgia, serif; cursor: pointer; padding: 0; }
.hint-btn:hover, .hint-i.is-open .hint-btn { border-color: var(--color-primary); color: var(--color-primary-dark); }
.hint-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.hint-pop { position: absolute; left: 50%; top: calc(100% + 8px); transform: translate(-50%, 0); z-index: 20; width: max-content; max-width: min(300px, 80vw); background: #2c2f34; color: #fff; font-size: 0.8rem; font-weight: 400; line-height: 1.45; padding: 8px 11px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: none; }
.hint-pop strong { color: #fff; }
.hint-i:hover .hint-pop, .hint-i:focus-within .hint-pop, .hint-i.is-open .hint-pop { display: block; }
@media (max-width: 600px) { .hint-pop { left: -40px; transform: none; max-width: calc(100vw - 80px); } }
.at-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); margin: 0; width: max-content; max-width: 80%; text-align: center; font-size: 0.88rem; color: var(--color-text-muted); background: var(--color-surface, #fff); padding: 6px 12px; border-radius: 8px; }
.at-empty[hidden] { display: none; }

/* ===== Round 16 (Nov 16): Study plan more compact on laptops: progress, target + plan cards and the "Words per day" chart
   fit one screen (same look, everything scaled down in proportion) ===== */
@media (min-width: 900px) {
  .mp-card { padding: 14px 18px; margin-bottom: 12px; }
  .mp-plan-actions { margin-bottom: 12px; }
  .mp-plan-actions .btn { padding-top: 8px; padding-bottom: 8px; }
  .mp-overall-head { margin-bottom: 6px; }
  .mp-pct { font-size: 1.25rem; }
  .mp-overall-line { margin-top: 6px; font-size: 0.86rem; }
  .mp-today-row { gap: 12px; margin-bottom: 12px; }
  .mp-today.hl-a .mp-today-big { font-size: 2.6rem; }
  .mp-today-unit { font-size: 0.95rem; }
  .mp-today-figure { margin: 2px 0 6px; }
  .mp-today-sub, .mp-streak { font-size: 0.84rem; }
  .mp-today-sub { margin-top: 4px; }
  .mp-stats { gap: 8px 16px; }
  .mp-stat-num { font-size: 1.1rem; }
  .mp-label { font-size: 0.68rem; }
  .mp-syllabus { gap: 4px; }
  .mp-syl-chip { font-size: 0.8rem; padding: 3px 9px; }
  .mp-legend { margin: 6px 0 4px; }
  .page-title { margin-top: 4px; margin-bottom: 4px; }
}
@media (min-width: 900px) {
  .mp-card { padding: 12px 16px; margin-bottom: 10px; }
  .mp-plan-actions { margin-bottom: 10px; }
  .mp-overall .mp-h2, .mp-chart-card .mp-h2 { font-size: 1rem; }
  .mp-progress { height: 8px; }
  .mp-today-row { margin-bottom: 10px; gap: 10px; }
  .mp-today.hl-a .mp-today-big { font-size: 2.3rem; }
  .mp-eyebrow { font-size: 0.68rem; }
  .mp-stats { gap: 6px 14px; padding-top: 12px; padding-bottom: 12px; }
  .mp-stat { gap: 0; }
  .mp-stat-num { font-size: 1.02rem; }
  .mp-syl-chip { font-size: 0.76rem; padding: 2px 8px; }
  .mp-chart-head { gap: 2px 12px; }
  .mp-legend { margin: 4px 0 2px; font-size: 0.78rem; }
  .page-title { font-size: 1.45rem; }
}
@media (min-width: 900px) { #mp-daily { min-height: 150px; } }
@media (min-width: 900px) {
  #mp-daily { min-height: 130px; }
  .page-title { margin-top: 0; margin-bottom: 2px; }
  .mp-overall { padding-top: 10px; padding-bottom: 10px; }
  .mp-overall-line { margin-top: 4px; }
  .mp-stats { gap: 4px 14px; padding-top: 10px; padding-bottom: 10px; }
  .mp-syllabus { margin-top: 2px; }
}
.mp-off-title { display: flex; align-items: center; gap: 10px; }
.mp-pause { flex: none; width: 22px; height: 22px; border-radius: 6px; background: #e8a33a; position: relative; }
.mp-pause::before, .mp-pause::after { content: ""; position: absolute; top: 6px; width: 3px; height: 10px; border-radius: 2px; background: #fff; }
.mp-pause::before { left: 7px; } .mp-pause::after { right: 7px; }
.mp-off .hint { margin: 0; }
@media (max-width: 600px) { .mp-plan-actions { gap: 8px; } .mp-plan-actions .btn { font-size: 0.85rem; padding: 9px 12px; } }

/* ===== Round 16 (Nov 16): "<Name>'s progress" is its own part of the Study plan page ===== */
.at-part { margin-top: 26px; padding-top: 22px; border-top: 2px solid var(--color-border-strong, #c9d2ce); }
.at-part-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.at-part-title { font-size: 1.6rem; margin: 0; }
.at-part .mp-alltime { margin-top: 0; }
.at-range select { font-size: 1rem; font-weight: 700; }
.at-chart-title { margin: 0; }
@media (min-width: 900px) { .at-part-title { font-size: 1.45rem; } }

/* ===== Round 16 (Nov 16): plan settings 1 · 2 · 3 one under the other (page and Reset plan pop-up); pop-up without a title ===== */
.mp-setup-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.mp-modal-card { padding-top: 26px; }
.mp-modal-card .mp-setup-grid { margin-top: 0; }
.mp-complete-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.mp-complete-actions .btn[hidden] { display: none; }

/* ===== Round 16 (Nov 17): test length "All N" always offered, and "Custom" (type a number) last in the row ===== */
.capsule-all, .studied-on .capsule-all { display: inline-flex; }
.custom-wrap { display: inline-flex; align-items: center; }
.custom-wrap[hidden] { display: none; }
.custom-count { width: 90px; font: inherit; font-weight: 700; padding: 8px 12px; border: 1.5px solid var(--color-primary); border-radius: 999px; background: var(--color-surface, #fff); text-align: center; }
.custom-count:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ===== Round 16 (Nov 17): accent keyboard folds into a floating "é Accents" capsule (always visible, drag by touch too) ===== */
.accent-keyboard[hidden], .accent-capsule[hidden] { display: none !important; }
.accent-keyboard-header { touch-action: none; user-select: none; -webkit-user-select: none; }
.accent-keyboard-btns { display: inline-flex; gap: 2px; }
.accent-keyboard-header button { min-width: 30px; min-height: 30px; font-size: 1.15rem; line-height: 1; }
/* same look as the study plan's target capsule (white pill, mint border, round badge) */
.accent-capsule { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 6px;
  border-radius: 999px; background: var(--color-surface); border: 1.5px solid var(--color-mint-border); color: var(--color-text); cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.14); font: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.accent-capsule:hover { border-color: var(--color-primary); }
.accent-capsule:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ac-badge { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--color-mint); color: var(--color-primary-deep); font-size: 1.05rem; font-weight: 800; }
.ac-label { color: var(--color-primary-deep); }
@media (max-width: 640px) { .accent-capsule { right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); } }

/* Study plan, every word done (Nov 17): only the "All words completed" card, the words-per-day chart while a plan is on, and the all-time progress */
body.mp-all-done #mp-plan-actions, body.mp-all-done #mp-off, body.mp-all-done .mp-overall, body.mp-all-done .mp-today-row, body.mp-all-done #mp-how { display: none !important; }
html[data-plan="off"] body.mp-all-done #mp-active { display: none !important; }
html[data-plan="off"] body.mp-all-done #mp-plan-area, html[data-plan="off"] body.mp-all-done #mp-complete { display: block !important; }   /* plan off: still the card */

/* ===== Round 16 (Nov 17): accent keyboard in the iPhone keyboard look (light grey tray, white rounded keys with a soft
   bottom shadow, a bigger letter pops up above the key while it is held). Same accents, same size, dragging and folding. ===== */
.accent-keyboard { background: rgba(209, 212, 219, 0.94); border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 16px; padding: 6px 8px 10px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.22), 0 2px 6px rgba(16, 24, 40, 0.10);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .accent-keyboard { background: rgb(209, 212, 219); } }
.accent-keyboard-header { color: #3c3c43; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em; margin: 0 2px 6px 4px; }
.accent-keyboard-header button { color: #3c3c43; border-radius: 8px; display: inline-grid; place-items: center; }
.accent-keyboard-header button:focus-visible { outline: 2px solid #007aff; outline-offset: 1px; }
.accent-keyboard-keys { gap: 10px 6px; }
.accent-key { position: relative; border: none; background: #fff; color: #000; border-radius: 6px; padding: 8px 0; font-weight: 400;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.30); transition: background 0.08s ease; font-family: inherit; }
.accent-key:active, .accent-key.is-pressed { background: #fff; color: #000; transform: none; }
.accent-key:focus-visible { outline: 2px solid #007aff; outline-offset: 1px; }
@media (hover: hover) {
  .accent-key:hover { background: #f4f4f6; color: #000; }
  .accent-keyboard-header button:hover { background: rgba(0, 0, 0, 0.07); }
}
/* the key preview balloon */
.accent-key.is-pressed::after { content: attr(data-ch); position: absolute; left: 50%; bottom: calc(100% - 4px); transform: translateX(-50%);
  min-width: 140%; padding: 6px 0 10px; border-radius: 10px 10px 8px 8px; background: #fff; color: #000; font-size: 2rem; line-height: 1.1;
  text-align: center; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22); pointer-events: none; z-index: 2; }
@media (max-width: 640px) {
  .accent-keyboard { padding: 6px 6px max(10px, env(safe-area-inset-bottom, 0px)); }
  .accent-keyboard-keys { gap: 9px 4px; }
}
@media (prefers-reduced-motion: reduce) { .accent-key { transition: none; } }
/* Study plan, the plan's themes done but words left elsewhere (Nov 17): "You learned ...", the themes covered; no target / "Your plan" boxes */
body.mp-plan-done #mp-today-card, body.mp-plan-done .mp-plan-nums, body.mp-plan-done #mp-info-plan { display: none !important; }   /* the plan progress stays */
body.mp-plan-done .mp-today-row { grid-template-columns: minmax(0, 1fr); }
.mp-complete-themes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin: 10px 0 4px; }
.mp-complete-themes[hidden] { display: none; }
/* Test page buttons (Nov 17): Submit answers + Cancel test */
.test-take-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
/* ===== Study plan (Nov 18): Current target · Plan progress · Your plan in one row. One system for all three cards:
   same width, same height, same padding and top line, titles at the same place and size, the same big-number and detail sizes.
   (i) at the bottom right. ===== */
.mp-today-row { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 14px; }
.mp-today-row > .mp-card { margin: 0; padding: 14px 18px; border: 1px solid var(--color-border); border-top: 3px solid var(--color-border-strong); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; justify-content: flex-start; }
.mp-today-row > .mp-today.hl-a { border-color: #b9dcc8; border-top: 3px solid var(--color-success); background: #ecf8f1; box-shadow: var(--shadow-sm); }
.mp-today-row > .mp-overall { border-top-color: var(--color-primary); }
.mp-today-row > .mp-stats { border-top: 3px dotted var(--color-accent); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 6px 16px; padding-right: 40px; }
/* the three titles: identical */
.mp-today-row .mp-eyebrow, .mp-today-row .mp-overall-head .mp-h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: .9rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); line-height: 1.2; min-height: 1.2em; }
.mp-today-row .mp-target-eyebrow { color: var(--color-primary-dark); }
.mp-today-row .mp-stats > .mp-eyebrow { grid-column: 1 / -1; margin-bottom: 4px; }
/* big numbers: the same size in the target and the progress */
.mp-today-row .mp-overall-head { display: block; margin: 0; }
.mp-today-row .mp-today-figure { margin: 0 0 10px; line-height: 1; }
.mp-today-row .mp-today .mp-today-big, .mp-today-row .mp-today.hl-a .mp-today-big, .mp-today-row .mp-pct { font-size: 2.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.mp-today-row .mp-pct { display: block; margin: 0 0 10px; }
.mp-today-row .mp-today-unit { font-size: .95rem; }
/* bars and the detail line under them: the same in both */
.mp-today-row .mp-progress, .mp-today-row .mp-today-bar { height: 8px; margin: 0; }
.mp-today-row .mp-overall-line, .mp-today-row .mp-today-sub { margin: 8px 0 0; font-size: .88rem; line-height: 1.4; }
.mp-today-row .mp-streak { font-size: .88rem; }
.mp-today-row .mp-syllabus { grid-column: 1 / -1; margin-top: 2px; }
.mp-info-wrap { top: auto; bottom: 10px; right: 10px; }
.mp-pop { top: auto; bottom: calc(100% + 8px); transform: translateY(4px); }          /* opens upwards from the corner */
.mp-pop::before { top: auto; bottom: -6px; }
@media (max-width: 899px) { .mp-today-row { grid-template-columns: minmax(0, 1fr); } }
/* plan complete (Nov 18): the progress card alone, compact (title left, % right) */
body.mp-plan-done .mp-today-row .mp-overall-head { display: flex; flex-direction: row; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
body.mp-plan-done .mp-today-row .mp-pct { font-size: 1.6rem; }
body.mp-plan-done .mp-today-row .mp-overall-line { font-size: .92rem; }
.mp-today-row > .mp-stats { padding-right: 18px; }
.mp-today-row .mp-today-sub { font-weight: 400; color: var(--color-text-muted); }
.mp-today-row .mp-stats .mp-label { letter-spacing: .02em; }
body.mp-plan-done .mp-today-row .mp-overall-head .mp-h2 { margin: 0; }
body.mp-plan-done .mp-today-row .mp-pct { margin: 0; }
/* ===== Study plan (Nov 18, v2): two cards. Current target keeps its size; "Your plan" takes the rest: the fixed numbers in one
   line and the plan progress under them. ===== */
.mp-today-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mp-today-row > .mp-plan-box { display: flex; flex-direction: column; justify-content: flex-start; padding-right: 18px; }
.mp-plan-box > .mp-eyebrow { margin-bottom: 10px; }
.mp-plan-nums { display: grid; grid-template-columns: repeat(4, max-content) minmax(0, 1fr); gap: 4px 28px; align-items: start; }
.mp-plan-nums .mp-syllabus { grid-column: auto; margin: 0; }
.mp-plan-nums .mp-syllabus-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 2px; }
.mp-plan-prog { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--color-border); }
.mp-today-row .mp-plan-prog .mp-overall-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 28px 6px 0; }
.mp-today-row .mp-plan-prog .mp-overall-head .mp-label { margin: 0; font-size: .74rem; }
.mp-today-row .mp-plan-prog .mp-pct { font-size: 1.5rem; margin: 0; }
.mp-today-row .mp-plan-prog .mp-overall-line { margin-top: 6px; }
.mp-today-row .mp-plan-prog .mp-progress { margin-right: 28px; }
body.mp-plan-done .mp-plan-prog { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 899px) {
  .mp-today-row { grid-template-columns: minmax(0, 1fr); }
  .mp-plan-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-plan-nums .mp-syllabus { grid-column: 1 / -1; }
}
.mp-plan-nums { grid-template-columns: repeat(4, max-content); gap: 8px 32px; }
.mp-plan-nums .mp-syllabus { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mp-plan-nums .mp-syllabus-chips { margin-top: 0; }
.mp-plan-prog { padding-right: 30px; margin-top: 12px; }
.mp-today-row .mp-plan-prog .mp-overall-head { margin-right: 0; }
.mp-today-row .mp-plan-prog .mp-progress { margin-right: 0; }
@media (max-width: 899px) { .mp-plan-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mp-plan-nums .mp-syllabus { justify-content: flex-start; text-align: left; flex-direction: row; }
.mp-plan-nums .mp-syllabus-chips { justify-content: flex-start; }
body.mp-plan-done .mp-plan-prog { padding-right: 0; }
/* Multiple choice test (Nov 18): 4 French options per question, tap one */
.mcq-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mcq-option { position: relative; display: flex; cursor: pointer; }
.mcq-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mcq-option span { flex: 1; padding: 9px 12px; border: 1.5px solid var(--color-border-strong); border-radius: 10px; background: var(--color-surface); font-size: .95rem; line-height: 1.3; transition: border-color .12s ease, background .12s ease; }
.mcq-option:hover span { border-color: var(--color-primary); }
.mcq-option input:checked + span { border-color: var(--color-primary); background: var(--color-mint); color: var(--color-primary-deep); font-weight: 700; }
.mcq-option input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }
@media (max-width: 640px) { .mcq-options { grid-template-columns: minmax(0, 1fr); } }
/* Progress chart (Nov 18): multiple choice tests in deep brick red, written tests stay orange; the Tests box lists both */
.at-key-dot.is-mcq { background: #b3381e; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #b3381e; }
.at-dot.is-mcq { fill: #b3381e; }
.at-testline.is-mcq { stroke: #b3381e; }
.at-by-type { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: .8rem; }
.at-by-type:empty { display: none; }
.at-type { display: inline-flex; align-items: center; gap: 6px; }
.at-type .at-key-dot { width: 8px; height: 8px; }
.at-axis2 { fill: var(--color-text-muted); }   /* two test colours now: the % axis stays neutral */
/* Test page icons (Nov 18): studied = green tick, favourites = red heart; "All" and the Vocab types have no icon */
.mini-card-icon.is-done { color: var(--color-success); font-weight: 900; }
.mini-card-icon.is-fav { color: #d6334a; }
.mini-card-body:not(:has(.mini-card-icon)) { padding-left: 14px; padding-right: 14px; }   /* chips without an icon (Nov 18) */
/* Multiple choice review (Nov 18): the 4 options with their English; right = green, a wrong pick = red */
.mcq-review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mcq-r { position: relative; display: flex; flex-direction: column; padding: 7px 10px; border: 1.5px solid var(--color-border); border-radius: 10px; background: var(--color-surface); }
.mcq-r-fr { font-weight: 600; }
.mcq-r-en { font-size: .82rem; color: var(--color-text-muted); }
.mcq-r.is-right { border-color: #1e7b34; background: #eef8f0; }
.mcq-r.is-right .mcq-r-fr { color: #1e7b34; }
.mcq-r.is-wrong { border-color: #a4262c; background: #fdf2f1; }
.mcq-r.is-wrong .mcq-r-fr { color: #a4262c; }
.mcq-r-tag { position: absolute; top: 6px; right: 8px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); }
.mcq-r-none { display: block; margin-top: 4px; font-size: .82rem; color: var(--color-text-muted); }
@media (max-width: 640px) { .mcq-review { grid-template-columns: minmax(0, 1fr); } }
/* ===== Multiple choice cards (Nov 18): compact, two per row; results green / red (also the written test rows) ===== */
.mcq-hint { margin: 0 0 10px; font-weight: 600; color: var(--color-text-muted); }
.mcq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mcq-card { margin: 0; min-width: 0; padding: 12px 14px 14px; border: 1.5px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--shadow-sm); transition: border-color .15s ease; }
.mcq-card:has(input:checked) { border-color: var(--color-primary); }
.mcq-q { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 0; margin: 0 0 10px; font-weight: 700; font-size: 1.02rem; color: var(--color-text); }
.mcq-num { flex: none; display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--color-mint); color: var(--color-primary-deep); font-size: .78rem; font-weight: 800; }
.mcq-word { display: flex; flex-direction: column; min-width: 0; }
.mcq-word .hindi-sub { font-size: .85rem; font-weight: 500; color: var(--color-text-muted); }
.mcq-card .mcq-options { gap: 8px; }
.mcq-card .mcq-option span { padding: 8px 10px; font-size: .93rem; text-align: center; }
.mcq-verdict { margin-left: auto; flex: none; font-size: .8rem; font-weight: 800; }
.mcq-card.is-correct { background: #e9f7ec; border-color: #7cc48d; }
.mcq-card.is-correct .mcq-verdict { color: #1e7b34; }
.mcq-card.is-wrong { background: #fcecea; border-color: #e3a19c; }
.mcq-card.is-wrong .mcq-verdict { color: #a4262c; }
.mcq-card .mcq-review .mcq-r { background: rgba(255, 255, 255, .85); }
.mcq-card .mcq-review .mcq-r.is-right { background: #fff; }
@media (max-width: 760px) { .mcq-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .mcq-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mcq-review { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* written test results: right = clearly green, wrong = red (Nov 18) */
.row-correct { background: #e9f7ec; box-shadow: inset 4px 0 0 #2e9c55; }
.row-incorrect { background: #fcecea; box-shadow: inset 4px 0 0 #c9443c; }
fieldset.mcq-card > legend.mcq-q { float: left; }                         /* keep the question inside the card, not on its border */
fieldset.mcq-card > .mcq-options { clear: both; }
/* Nov 18: the Tests box keeps its height: totals on the left, Write / MCQ on the right */
.at-box-tests { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.at-box-main { display: flex; flex-direction: column; min-width: 0; }
.at-box-tests .at-by-type { margin: 0; align-self: flex-end; font-size: .84rem; gap: 6px; text-align: left; }
/* Nov 18: the streak sits in the bottom-left corner of the target card, level with the (i) on the right */
.mp-today-row .mp-today .mp-streak { position: absolute; left: 18px; bottom: 12px; margin: 0; }
.mp-stat-sub { font-size: .8em; font-weight: 700; color: var(--color-text-muted); }   /* "(2/day)" after the plan's total words (Nov 18) */
.mp-confirm .celebrate-actions { justify-content: space-between; }   /* "Are you sure?" pop-ups (Nov 18): one button far left, the other far right */
/* ===== Test page (Nov 18): numbered step cards, three rows ===== */
.test-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; counter-reset: step; }
.test-steps > fieldset.step { margin: 0; min-width: 0; padding: 14px 18px 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.test-steps > fieldset.step-wide, .test-steps > .test-actions { grid-column: 1 / -1; }
.test-steps > fieldset.step > legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0; font-weight: 800; }
.test-steps > fieldset.step > legend::before { counter-increment: step; content: counter(step); flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--color-primary); color: #fff; font-size: .8rem; font-weight: 800; }
.test-steps > fieldset.step > legend + * { clear: both; }
.test-steps > .test-actions { margin-top: 4px; }
@media (max-width: 760px) { .test-steps { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================================================================
   ROUND 16 NEW LOOK (Nov 19, Parth's final): warm off-white pages, a left icon rail on computers, a top bar + bottom
   tab bar on phones, Writing & Speaking themes in one soft mint and Basics in one soft sand, rows instead of grids.
   Only the look changes: every page, link, form, id and script is the same as before.
   ===================================================================================================================== */
:root {
  --ui-bg: #f5f1ea; --ui-rail: #ebe5db; --ui-soft: #f0ebe3; --ui-line: #e7e0d5; --ui-ink: #1b2924;
  --ui-theme: #dcefe4; --ui-theme-ink: #1f6b50; --ui-basic: #f6e6d2; --ui-basic-ink: #9a4a12;
  --ui-r: 20px;
}
body { background: var(--ui-bg); background-image: none; }
body.themed-bg { --pattern-ink: #8a8f9e; }
body.themed-bg::before { opacity: 0.075; }
.page-title { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin: 6px 0 10px; color: var(--ui-ink); }
.page-subtitle { color: var(--color-text-muted); }

/* ---------- the app shell: computers ---------- */
.nav-ico { display: none; }
.brand-text { display: none; }
.account-initial { display: none; }
@media (min-width: 901px) {
  html[data-shell="app"] { --header-h: 0px; }
  html[data-shell="app"] body { padding-left: 112px; }
  html[data-shell="app"] .site-header {
    position: fixed; left: 16px; top: 16px; bottom: 16px; width: 80px; z-index: 60; padding: 0;
    background: var(--ui-rail); border: 0; border-radius: 26px; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  html[data-shell="app"] .header-inner { display: flex; flex-direction: column; align-items: center; height: 100%; padding: 16px 0; max-width: none; }
  html[data-shell="app"] .brand { margin: 0; }
  html[data-shell="app"] .brand-logo { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
  html[data-shell="app"] .main-nav { flex: 1; flex-direction: column; justify-content: center; gap: 12px; }
  html[data-shell="app"] .nav-item {
    position: relative; width: 52px; height: 52px; padding: 0; border-radius: 50%; background: #fff; color: var(--ui-ink);
    display: grid; place-items: center; transition: transform .15s ease, background .15s ease;
  }
  html[data-shell="app"] .nav-item::after { display: none; }
  html[data-shell="app"] .nav-ico { display: block; }
  html[data-shell="app"] .nav-item:hover { transform: translateY(-2px); color: var(--ui-ink); }
  html[data-shell="app"] .nav-item[aria-current="page"], html[data-shell="app"] .nav-item[aria-current="page"]:hover { background: var(--ui-ink); color: #fff; }
  html[data-shell="app"] .nav-item.is-disabled { opacity: .45; }
  /* the page name: a small dark label on the right, above everything */
  html[data-shell="app"] .nav-label {
    position: absolute; left: 64px; top: 50%; transform: translate(-4px, -50%); white-space: nowrap; pointer-events: none; opacity: 0;
    background: var(--ui-ink); color: #fff; font-size: .8rem; font-weight: 700; padding: 6px 10px; border-radius: 9px; transition: opacity .15s, transform .15s; z-index: 70;
  }
  html[data-shell="app"] .nav-label::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: var(--ui-ink); transform: translateY(-50%) rotate(45deg); }
  html[data-shell="app"] .nav-item:hover .nav-label, html[data-shell="app"] .nav-item:focus-visible .nav-label { opacity: 1; transform: translate(0, -50%); }
  html[data-shell="app"] .auth-area { justify-self: auto; }
  html[data-shell="app"] .account-toggle {
    position: relative; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 3px solid #fff;
    background: linear-gradient(135deg, #b8d8c8, #f3c9a8); color: var(--ui-ink); display: grid; place-items: center;
  }
  html[data-shell="app"] .account-toggle .account-name, html[data-shell="app"] .account-toggle .caret { display: none; }
  html[data-shell="app"] .account-initial { display: block; font-weight: 800; font-size: 1.05rem; }
  html[data-shell="app"] .account-toggle-days { position: absolute; top: -8px; right: -14px; font-size: .62rem; padding: 2px 6px; white-space: nowrap; }
  html[data-shell="app"] .account-menu { position: fixed; left: 108px; bottom: 16px; top: auto; right: auto; width: 290px; border-radius: 18px; }
  html[data-shell="app"] .page-main, html[data-shell="app"] .messages, html[data-shell="app"] .site-footer .container { max-width: 1180px; }
  html[data-shell="app"] .page-main { padding-top: 28px; }
}

/* ---------- the app shell: phones and small tablets ---------- */
@media (max-width: 900px) {
  html[data-shell="app"] { --header-h: 64px; }
  html[data-shell="app"] .site-header { background: rgba(245, 241, 234, .97); border-bottom: 1px solid var(--ui-line); -webkit-backdrop-filter: none; backdrop-filter: none; }   /* no blur here: it would trap the fixed tab bar inside the header */
  html[data-shell="app"] .header-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand auth"; padding: 10px 16px; }
  html[data-shell="app"] .brand { display: flex; align-items: center; color: var(--ui-ink); }
  html[data-shell="app"] .brand-logo { width: 40px; height: 40px; border-radius: 12px; }
  html[data-shell="app"] .brand-text { display: flex; flex-direction: column; line-height: 1.15; grid-area: brand; margin-left: 52px; align-self: center; pointer-events: none; }
  html[data-shell="app"] .brand-text b { font-size: .92rem; color: var(--ui-ink); }
  html[data-shell="app"] .brand-text small { font-size: .74rem; font-weight: 700; color: var(--color-primary-dark); }
  html[data-shell="app"] .main-nav {
    position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom, 0px)); z-index: 55; display: flex; flex-wrap: nowrap; gap: 0;
    justify-content: space-between; background: #fff; border-radius: 24px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  }
  html[data-shell="app"] .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0; border-radius: 18px; font-size: .68rem; font-weight: 700; color: var(--color-text-muted); }
  html[data-shell="app"] .nav-item::after { display: none; }
  html[data-shell="app"] .nav-ico { display: block; width: 21px; height: 21px; }
  html[data-shell="app"] .nav-item[aria-current="page"], html[data-shell="app"] .nav-item[aria-current="page"]:hover { background: var(--ui-ink); color: #fff; }
  html[data-shell="app"] .nav-item.is-disabled { opacity: .45; color: var(--color-text-muted); }
  html[data-shell="app"] .account-toggle { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: linear-gradient(135deg, #b8d8c8, #f3c9a8); color: var(--ui-ink); display: grid; place-items: center; position: relative; }
  html[data-shell="app"] .account-toggle .account-name, html[data-shell="app"] .account-toggle .caret { display: none; }
  html[data-shell="app"] .account-initial { display: block; font-weight: 800; }
  html[data-shell="app"] .account-toggle-days { position: absolute; top: -6px; right: -10px; font-size: .6rem; padding: 2px 5px; white-space: nowrap; }
  html[data-shell="app"] .account-menu { position: fixed; left: 12px; right: 12px; top: 66px; width: auto; border-radius: 18px; }
  html[data-shell="app"] body { padding-bottom: 92px; }
  html[data-shell="app"] .page-title { font-size: 1.6rem; }
  /* while taking a test the tab bar steps aside (focus mode): Submit answers / Cancel test are the way out */
  html[data-shell="app"] body.is-testing .main-nav { display: none; }
  html[data-shell="app"] body.is-testing { padding-bottom: 20px; }
}
.site-footer { border-top: 1px solid var(--ui-line); color: var(--color-text-muted); }

/* ---------- buttons, chips, capsules: one family ---------- */
.btn { border-radius: 999px; }
/* Nov 19 (Parth): buttons keep the app's green (Generate new test, Start my plan, Take a test, Submit answers ...) */
.btn-primary { background: var(--color-primary); box-shadow: none; }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: 0 8px 18px rgba(var(--color-primary-rgb), .25); }
.btn-primary:active { background: var(--color-primary-deep); }
.btn-ghost { background: #fff; color: var(--ui-ink); border-color: transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.btn-ghost:hover { background: #fff; border-color: var(--ui-line); color: var(--ui-ink); }
.btn-lg { border-radius: 999px; }
.chip, .tab { border-color: transparent; background: #fff; color: var(--ui-ink); font-weight: 600; }
.chip:hover, .tab:hover { background: #fff; border-color: var(--ui-line); color: var(--ui-ink); }
.chip.active, .tab.active { background: var(--ui-ink); color: #fff; border-color: var(--ui-ink); }
.capsule span { background: var(--ui-soft); border-color: transparent; color: var(--ui-ink); font-weight: 600; }
.capsule:hover span { background: #e9e2d6; border-color: transparent; color: var(--ui-ink); }
.capsule input:checked + span { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
.mini-card-body { background: var(--ui-soft); border-color: transparent; color: var(--ui-ink); font-weight: 600; }
.mini-card:hover .mini-card-body { background: #e9e2d6; border-color: transparent; color: var(--ui-ink); }
.mini-card input:checked + .mini-card-body { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
.mini-card input:checked + .mini-card-body .mini-card-icon { background: rgba(255, 255, 255, .16); }
.mini-card-icon { background: rgba(255, 255, 255, .7); }
.mini-card input:checked + .mini-card-body .mini-card-icon.is-done, .mini-card input:checked + .mini-card-body .mini-card-icon.is-fav { color: #fff; }
.filter-bar input[type=text], .search-form input[type=text] { border-radius: 999px; border-color: transparent; background: #fff; padding-left: 18px; }
.alert { border-radius: 14px; }

/* ---------- Vocab (home): the two parts flow one after the other; one colour per part ---------- */
.home-section, .home-section:last-of-type { min-height: 0; padding: 10px 0 30px; }
.home-section .theme-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.home-flow { --card-h: 158px; }
.band-title { font-weight: 800; font-size: clamp(1.35rem, 2vw, 1.7rem); display: flex; align-items: center; gap: 10px; }
.band-title::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--ui-theme-ink); flex: none; }
.home-section-basics .band-title::before { background: var(--ui-basic-ink); }
.home-section .theme-card { border: 0; border-radius: var(--ui-r); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.home-section-themes .theme-card, .home-section-themes .theme-card:hover { background: var(--ui-theme); }
.home-section-basics .theme-card, .home-section-basics .theme-card:hover { background: var(--ui-basic); }
.home-section .theme-card:hover { box-shadow: 0 14px 28px rgba(40, 30, 20, .11); }
.home-section .theme-icon { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .75); display: grid; place-items: center; }
.home-section .theme-progress-text { background: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 800; color: var(--ui-ink); }
.home-section .theme-name { font-weight: 700; }
.home-section .theme-progress { background: rgba(255, 255, 255, .8); }
.home-section-themes .theme-progress-fill { background: var(--ui-theme-ink); }
.home-section-basics .theme-progress-fill { background: var(--ui-basic-ink); }
.theme-card.is-out-of-plan { opacity: .66; filter: saturate(.55); }
@media (max-width: 640px) {
  .home-flow { --card-h: auto; }
  .home-section .theme-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .home-section .theme-card { height: auto; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ico name pct" "ico count count" "ico bar bar"; gap: 3px 12px; align-items: center; padding: 12px 14px; }
  .home-section .theme-top { display: contents; }
  .home-section .theme-icon { grid-area: ico; }
  .home-section .theme-progress-text { grid-area: pct; }
  .home-section .theme-name { grid-area: name; margin: 0; font-size: 1rem; }
  .home-section .theme-count { grid-area: count; margin: 0; padding: 0; font-size: .76rem; }
  .home-section .theme-progress { grid-area: bar; }
}

/* ---------- word lists, search, favourites: each word is a rounded row ---------- */
.vocab-table-wrap { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.vocab-table { border-collapse: separate; border-spacing: 0 7px; }
.vocab-table th { border: 0; padding: 4px 16px; font-weight: 800; letter-spacing: .06em; font-size: .72rem; }
.vocab-table td { background: #fff; border: 0; }
.vocab-table td:first-child { border-radius: 16px 0 0 16px; }
.vocab-table td:last-child { border-radius: 0 16px 16px 0; }
.progress-line .progress-track { background: #fff; }
@media (max-width: 900px) {
  .vocab-table tr { background: #fff; border-radius: 16px; border: 0; margin-bottom: 8px; padding: 6px 0; }
  .vocab-table td, .vocab-table td:first-child, .vocab-table td:last-child { background: transparent; border-radius: 0; }
}

/* ---------- Study plan ---------- */
.mp-card, .mp-today-row > .mp-card { border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); border-radius: var(--ui-r); }
.mp-today-row > .mp-today.hl-a { background: var(--ui-theme); border: 0; box-shadow: none; }
.mp-today-row > .mp-stats, .mp-stats { background: #fff; border-top: 0; }
.mp-plan-actions .btn-danger { border-radius: 999px; }
.mp-chart-card { padding: 18px 20px; }
.at-part { border-top-color: var(--ui-line); }
/* the two boxes next to the progress chart: label, big number + period, then label / value rows */
.at-side .at-box { padding: 18px 20px; gap: 6px; }
.at-box .at-num { color: #2a4fa3; }
.at-box-tests { flex-direction: column; align-items: stretch; justify-content: flex-start; }
.at-box-tests .at-by-type { align-self: stretch; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--ui-line); font-size: .86rem; gap: 7px; }
.at-type { display: flex; justify-content: space-between; }
.at-type b { margin-left: auto; padding-left: 8px; }

/* ---------- Build a Vocabulary Test: the test type as two big tiles, the other settings in one card ---------- */
.test-steps { display: block; counter-reset: none; }
.test-steps > fieldset.step { margin: 0; border-radius: 0; box-shadow: none; border: 0; border-top: 1px solid var(--ui-line); padding: 16px 22px; background: #fff;
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.test-steps > fieldset.step > legend { float: left; width: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 0 0; font-weight: 800; }
.test-steps > fieldset.step > legend::before { display: none; }
.test-steps > fieldset.step > legend + * { clear: none; }
.test-steps > fieldset.step:nth-of-type(2) { border-top: 0; border-radius: var(--ui-r) var(--ui-r) 0 0; margin-top: 16px; }
.test-steps > fieldset.step:last-of-type { border-radius: 0 0 var(--ui-r) var(--ui-r); }
.test-steps > fieldset.step > :not(legend) { grid-column: 2; }
.test-steps > .test-actions { margin-top: 18px; }
/* test type */
.test-steps > fieldset.step-type { display: block; background: transparent; padding: 0; border: 0; }
.test-steps > fieldset.step-type > legend { float: none; flex-direction: row; align-items: center; padding: 0; margin: 0 0 10px; font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-muted); }
.type-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-tile { position: relative; cursor: pointer; display: block; }
.type-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-tile-body { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 4px 16px; align-items: center; height: 100%; padding: 20px 22px; border-radius: var(--ui-r); background: #fff; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.type-tile:hover .type-tile-body { transform: translateY(-2px); }
.type-tile-ico { grid-row: 1 / span 2; width: 56px; height: 56px; border-radius: 18px; background: var(--ui-soft); display: grid; place-items: center; font-size: 1.6rem; }
.type-tile-ico svg { display: block; }
.type-tile-name { font-size: 1.2rem; font-weight: 800; color: var(--ui-ink); }
.type-tile-text { font-size: .9rem; color: var(--color-text-muted); line-height: 1.4; }
.type-tile-tick { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--ui-ink); color: #fff; display: grid; place-items: center; font-size: .8rem; opacity: 0; transition: opacity .15s; }
.type-tile input:checked + .type-tile-body { border-color: var(--ui-ink); }
.type-tile input:checked + .type-tile-body .type-tile-ico { background: var(--ui-theme); }
.type-tile input:checked + .type-tile-body .type-tile-tick { opacity: 1; }
.type-tile input:focus-visible + .type-tile-body { outline: 3px solid var(--color-primary); outline-offset: 2px; }
@media (max-width: 760px) {
  .type-tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .type-tile-body { grid-template-columns: 46px 1fr; padding: 14px 16px; }
  .type-tile-ico { width: 46px; height: 46px; font-size: 1.3rem; border-radius: 14px; }
  .type-tile-name { font-size: 1.05rem; } .type-tile-text { font-size: .82rem; }
  .test-steps > fieldset.step { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; }
  .test-steps > fieldset.step > legend { padding-top: 0; flex-direction: row; align-items: center; }
  .test-steps > fieldset.step > :not(legend) { grid-column: 1; }
  .test-steps > .test-actions .btn { flex: 1; }
}

/* ---------- taking a test: answered count + the two buttons stay in reach ---------- */
.test-take-actions.testbar { position: sticky; bottom: 14px; z-index: 30; margin-top: 18px; display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 999px; padding: 8px 8px 8px 20px; box-shadow: 0 10px 26px rgba(0, 0, 0, .12); }
.testbar-count { flex: 1; order: -1; font-weight: 700; font-size: .9rem; color: var(--color-text-muted); }
.testbar-count b { color: var(--ui-ink); }
.test-take-actions.testbar .btn-lg { padding: 11px 20px; font-size: .95rem; }
.test-take-actions.testbar .btn-ghost { order: 0; } .test-take-actions.testbar .btn-primary { order: 1; }
@media (max-width: 640px) { .test-take-actions.testbar { padding: 6px 6px 6px 14px; gap: 6px; } .testbar-count { font-size: .78rem; } .test-take-actions.testbar .btn-lg { padding: 10px 13px; font-size: .84rem; } }
.mcq-card { border: 2px solid transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.mcq-card:has(input:checked) { border-color: #cfe3d8; }
.mcq-option span { border-color: var(--ui-line); }
.mcq-option input:checked + span { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
.results-summary { border: 0; border-radius: var(--ui-r); }
.test-subnav-tab.active { background: var(--ui-ink); color: #fff; border-color: var(--ui-ink); }
/* New look: the accent keyboard opens above the sticky "answered / Submit / Cancel" bar, so it never covers the buttons */
html[data-shell="app"] body.is-testing .accent-keyboard { bottom: 92px; }
@media (max-width: 640px) { html[data-shell="app"] body.is-testing .accent-keyboard { bottom: 80px; } }
/* New look, Vocab page: same width and left edge as every other page; the two parts now flow one after the other,
   so the old "Basics ↓" jump cue (made for full-screen parts) is not needed and no longer sits over the cards */
@media (min-width: 901px) {
  html[data-shell="app"] .page-main:has(.home-flow) { padding: 28px 20px 56px; margin-left: auto; margin-right: auto; }
  html[data-shell="app"] .home-flow .section-inner { max-width: none; padding: 0; }
}
html[data-shell="app"] .home-flow .scroll-cue { display: none; }
/* Nov 19: Tests taken box = one small table (Total, Written, MCQ × Tests, Avg). Same box size; only this box's text is sized to fit. */
.at-box-tests { justify-content: flex-start; gap: 4px; }
.at-box-tests .mp-label .at-period { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: .8rem; }
.at-tests-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.at-tests-table th, .at-tests-table td { padding: 7px 0; text-align: right; border-top: 1px solid var(--ui-line); font-size: .95rem; white-space: nowrap; }
.at-tests-table thead th { border-top: 0; padding: 0 0 4px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.at-tests-table th[scope="row"] { text-align: left; font-weight: 600; color: var(--ui-ink); }
.at-tests-table td { padding-left: 14px; }
.at-tests-table th[scope="row"] .at-key-dot { display: inline-block; vertical-align: -2px; margin-right: 7px; }
.at-tests-table td { font-weight: 700; color: var(--ui-ink); }
.at-tests-table .at-row-total th, .at-tests-table .at-row-total td { font-size: 1.15rem; font-weight: 800; color: #2a4fa3; }
.at-tests-table .at-row-total th { color: var(--ui-ink); font-size: .95rem; }
@media (max-width: 640px) {
  .at-box-tests .mp-label .at-period { display: block; margin: 2px 0 0; }
  .at-tests-table th, .at-tests-table td { padding-top: 5px; padding-bottom: 5px; font-size: .8rem; }
  .at-tests-table td { padding-left: 10px; }
  .at-tests-table .at-row-total td { font-size: .98rem; }
  .at-tests-table th[scope="row"] .at-key-dot { margin-right: 4px; }
}
/* Nov 19: on computers the rail opens wider while the mouse is over the menu, showing each page name to the right of its icon.
   It slides over the page (the page itself does not move); the icons stay exactly where they are. */
@media (min-width: 901px) {
  html[data-shell="app"] .site-header { transition: width .22s ease, box-shadow .22s ease; overflow: visible; }
  html[data-shell="app"] .header-inner { align-items: flex-start; padding-left: 14px; padding-right: 14px; }
  html[data-shell="app"] .brand { margin-left: 2px; }
  html[data-shell="app"] .auth-area { margin-left: 2px; }
  html[data-shell="app"] .nav-item { justify-content: start; padding-left: 14px; grid-template-columns: 24px auto; column-gap: 12px; width: 52px; overflow: hidden;
    transition: width .22s ease, transform .15s ease, background .15s ease; }
  html[data-shell="app"] .nav-item .nav-ico { width: 24px; }
  html[data-shell="app"] .site-header:not(:has(.account-menu.is-open)):is(:has(.main-nav:hover), :has(.brand:hover), :has(.auth-area:hover)), html[data-shell="app"] .site-header:has(.main-nav :focus-visible) {
    width: 218px; box-shadow: 0 18px 40px rgba(40, 30, 20, .14); }
  html[data-shell="app"] .site-header:not(:has(.account-menu.is-open)):is(:has(.main-nav:hover), :has(.brand:hover), :has(.auth-area:hover)) .nav-item, html[data-shell="app"] .site-header:has(.main-nav :focus-visible) .nav-item {
    width: 190px; border-radius: 999px; }
  html[data-shell="app"] .site-header:not(:has(.account-menu.is-open)):is(:has(.main-nav:hover), :has(.brand:hover), :has(.auth-area:hover)) .nav-label, html[data-shell="app"] .site-header:has(.main-nav :focus-visible) .nav-label {
    position: static; opacity: 1; transform: none; background: none; color: inherit; padding: 0; font-size: .95rem; font-weight: 700; }
  html[data-shell="app"] .site-header:not(:has(.account-menu.is-open)):is(:has(.main-nav:hover), :has(.brand:hover), :has(.auth-area:hover)) .nav-label::before, html[data-shell="app"] .site-header:has(.main-nav :focus-visible) .nav-label::before { display: none; }
  html[data-shell="app"] .nav-item:hover { transform: none; }
  html[data-shell="app"] .nav-item:not([aria-current="page"]):hover { background: #e4ebe7; color: var(--ui-ink); }
  html[data-shell="app"] .nav-item.is-disabled:hover { background: #fff; color: var(--ui-ink); opacity: .45; }
}

/* Nov 19 (Parth): home colours from the reference design. Writing & Speaking themes = the rose of "Flutter Masterclass",
   Basics = the lavender of "Certified Six Sigma". Only the Vocab page cards; the study plan target card keeps its mint. */
:root { --ui-sec-themes: #dd9ea2; --ui-sec-themes-ink: #7c2833; --ui-sec-basics: #d5d4fb; --ui-sec-basics-ink: #4540a8; }
.band-title::before { background: var(--ui-sec-themes-ink); }
.home-section-basics .band-title::before { background: var(--ui-sec-basics-ink); }
.home-section-themes .theme-card, .home-section-themes .theme-card:hover { background: var(--ui-sec-themes); }
.home-section-basics .theme-card, .home-section-basics .theme-card:hover { background: var(--ui-sec-basics); }
.home-section-themes .theme-progress-fill { background: var(--ui-sec-themes-ink); }
.home-section-basics .theme-progress-fill { background: var(--ui-sec-basics-ink); }
.home-section .theme-progress { background: rgba(255, 255, 255, .6); }
.home-section .theme-count { color: rgba(27, 41, 36, .72); }
/* "Make a new plan": a soft green fill so it stands out from the white cards around it */
.mp-plan-actions .btn-ghost, #mp-reset-btn { background: var(--ui-theme); color: var(--color-primary-deep); border-color: transparent; }
.mp-plan-actions .btn-ghost:hover, #mp-reset-btn:hover { background: #c9e6d6; color: var(--color-primary-deep); }
/* Nov 19 (Parth): Current target narrower (it has little text) with a bigger title and number; Your plan wider.
   Both card titles the same size, numbers sized so neither card feels too big or too small next to the other. */
@media (min-width: 900px) {
  .mp-today-row { grid-template-columns: minmax(250px, .78fr) minmax(0, 2.22fr); }
}
.mp-today-row .mp-eyebrow, .mp-today-row .mp-stats > .mp-eyebrow { font-size: 1.02rem; letter-spacing: .05em; margin-bottom: 12px; }
.mp-today-row .mp-target-icon { font-size: 1.15rem; }
.mp-today-row .mp-today .mp-today-big, .mp-today-row .mp-today.hl-a .mp-today-big { font-size: 3.4rem; }
.mp-today-row .mp-today-unit { font-size: 1.15rem; font-weight: 700; color: var(--color-primary-deep); }
.mp-today-row .mp-today-sub { font-size: .95rem; }
.mp-today-row .mp-plan-box .mp-stat-num { font-size: 1.35rem; color: var(--ui-ink); }
.mp-today-row .mp-plan-box .mp-stat-sub { font-size: .9rem; font-weight: 700; color: var(--color-text-muted); }
.mp-today-row .mp-plan-box .mp-stat .mp-label { font-size: .74rem; }
.mp-plan-nums { gap: 10px 44px; }
.mp-today-row .mp-plan-prog .mp-pct { font-size: 1.9rem; }
.mp-today-row .mp-plan-prog .mp-overall-line { font-size: .95rem; }
@media (max-width: 640px) {
  .mp-today-row .mp-eyebrow, .mp-today-row .mp-stats > .mp-eyebrow { font-size: .92rem; }
  .mp-today-row .mp-today .mp-today-big, .mp-today-row .mp-today.hl-a .mp-today-big { font-size: 2.8rem; }
  .mp-today-row .mp-today-unit { font-size: 1.02rem; }
  .mp-today-row .mp-plan-box .mp-stat-num { font-size: 1.15rem; }
  .mp-plan-nums { gap: 10px 20px; }
  .mp-today-row .mp-plan-prog .mp-pct { font-size: 1.6rem; }
}
.at-tests-table td:last-child, .at-tests-table thead th:last-child { width: 3.4em; min-width: 3.4em; }
/* Nov 19: Study plan introduction pop-up (same card as the celebrations, a little wider, lists read left to right) */
.mp-intro-overlay[hidden] { display: none !important; }
.mp-intro-card { max-width: 470px; text-align: left; padding: 26px 28px 22px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.mp-intro-steps em { font-style: normal; }
.mp-intro-card .celebrate-emoji, .mp-intro-card h2 { text-align: center; }
.mp-intro-card .mp-intro-lead { margin: 0 0 16px; text-align: center; color: var(--color-text-muted); font-size: .95rem; }
.mp-intro-card .mp-intro-h { margin: 0 0 6px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--color-primary-dark); }
.mp-intro-list { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .93rem; color: var(--ui-ink); }
.mp-intro-list li { position: relative; padding-left: 22px; }
.mp-intro-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--color-primary); font-weight: 800; }
.mp-intro-steps { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .93rem; color: var(--ui-ink); }
.mp-intro-steps li { display: flex; align-items: flex-start; gap: 10px; }
.mp-intro-steps span { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--color-primary); color: #fff; font-size: .76rem; font-weight: 800; margin-top: 1px; }
.mp-intro-card .mp-intro-then { margin: 0 0 18px; padding: 10px 12px; border-radius: 12px; background: var(--ui-theme); color: var(--color-primary-deep); font-size: .9rem; }
.mp-intro-card .celebrate-actions { justify-content: center; }
.mp-intro-link { border: 0; background: none; padding: 0; font: inherit; font-size: .9rem; font-weight: 600; color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mp-intro-link:hover { color: var(--color-primary-deep); }
.mp-steps .mp-intro-li { margin-left: auto; }
@media (max-width: 640px) {
  .mp-steps .mp-intro-li { margin-left: 0; }
  .mp-intro-card { padding: 18px 18px 16px; }
  .mp-intro-card .celebrate-emoji { font-size: 2rem; }
  .mp-intro-card h2 { font-size: 1.25rem; margin: 2px 0 6px; }
  .mp-intro-card .mp-intro-lead, .mp-intro-list, .mp-intro-steps { font-size: .86rem; }
  .mp-intro-card .mp-intro-lead { margin-bottom: 12px; }
  .mp-intro-list { gap: 4px; margin-bottom: 12px; }
  .mp-intro-steps { gap: 6px; margin-bottom: 10px; }
  .mp-intro-card .mp-intro-then { font-size: .84rem; margin-bottom: 14px; }
}
/* Nov 19: "Your access ends today / tomorrow" card with the three plans */
.expiry-overlay[hidden] { display: none !important; }
.expiry-card { max-width: 430px; }
.expiry-card > p { margin-bottom: 14px; }
.expiry-plans { display: grid; gap: 8px; margin: 0 0 12px; text-align: left; }
.expiry-plans .plan-link { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 11px 14px; border-radius: 14px;
  background: var(--ui-soft); color: var(--ui-ink); text-decoration: none; border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.expiry-plans .plan-link:hover { border-color: var(--color-primary); background: #fff; text-decoration: none; }
.expiry-plans .plan-name { font-weight: 700; }
.expiry-plans .plan-price { font-weight: 800; color: var(--color-primary-dark); }
.expiry-plans .plan-note { grid-column: 1 / -1; font-size: .78rem; font-weight: 700; color: var(--color-primary); }
.expiry-card .expiry-where { font-size: .85rem; margin-bottom: 16px; }
/* Nov 20: confirm pop-ups built with the celebration card: buttons far left and far right, like the other confirms */
.celebrate-card.is-confirm .celebrate-actions { justify-content: space-between; }
/* Nov 20: "Make a new plan" in a soft amber, clearly different from the mint target card and the white cards */
.mp-plan-actions .btn-ghost, #mp-reset-btn { background: #fbe3c4; color: #7a3f0c; border-color: transparent; }
.mp-plan-actions .btn-ghost:hover, #mp-reset-btn:hover { background: #f7d3a4; color: #6a3508; }
/* Nov 20: the progress chart has the Study plan tracker's height again; the two boxes beside it are compact so that,
   stacked, they end where the chart card ends. The side column is a little wider so the Tests table never feels cramped. */
@media (min-width: 900px) {
  .mp-alltime { grid-template-columns: minmax(0, 1fr) 272px; gap: 14px; align-items: stretch; }
  .mp-alltime .at-side { grid-template-rows: auto 1fr; gap: 12px; }
  .at-side .at-box { padding: 13px 18px; gap: 2px; }
  .at-side .at-box .at-num { font-size: 1.85rem; line-height: 1.05; }
  .at-side .at-box .at-sub { font-size: .82rem; }
  .at-side .at-box-tests { padding: 12px 18px 10px; }
  .at-tests-table { margin-top: 4px; }
  .at-tests-table th, .at-tests-table td { padding-top: 5px; padding-bottom: 5px; font-size: .9rem; }
  .at-tests-table .at-row-total td { font-size: 1.05rem; }
  .at-tests-table .at-row-total th { font-size: .9rem; }
}
/* Nov 20: result-page options play their audio on click */
.mcq-r[data-audio-src] { cursor: pointer; }
.mcq-r[data-audio-src]:active { transform: scale(.98); }



/* Nov 20: a long syllabus stays inside "Your plan": the label on the left, the chips wrap in the space next to it (2 rows, then "+N more") */
.mp-plan-nums .mp-syllabus { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px 12px; width: 0; min-width: 100%; }  /* width 0 + min-width 100%: the chips never widen the card */
.mp-plan-nums .mp-syllabus > .mp-label { padding-top: 5px; white-space: nowrap; }
.mp-plan-nums .mp-syllabus-chips { min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.mp-plan-nums .mp-syl-chip { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-syl-more { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; border: 1px dashed var(--color-primary); background: var(--color-mint, #e6f5ec);
  color: var(--color-primary-dark); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.mp-syl-more:hover { background: #fff; }
.mp-syl-more:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
@media (max-width: 899px) {
  .mp-plan-nums .mp-syllabus { grid-template-columns: minmax(0, 1fr); }
  .mp-plan-nums .mp-syllabus > .mp-label { padding-top: 0; }
  .mp-syl-more { font-size: 0.8rem; padding: 3px 10px; }
}
.mp-syl-chip[hidden] { display: none !important; }

/* ===== Round 16 (Nov 20): "What's new" window, About the app page, Rate the app pop-up ===== */
body.wn-open { overflow: hidden; }
.wn-overlay { position: fixed; inset: 0; z-index: 1001; background: rgba(27, 41, 36, .45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: celebrate-fade .2s ease; }
.wn-overlay[hidden] { display: none !important; }
.wn-sheet { background: #fff; width: 100%; max-width: 620px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); border-radius: 22px; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.28); overflow: hidden; color: #151a2e; }
.wn-top { padding: 22px 26px 14px; border-bottom: 1px solid #eee9e0; text-align: center; }
.wn-badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-primary); background: #e3f1ea; border-radius: 999px; padding: 4px 10px; }
.wn-top h2 { margin: 10px 0 4px; font-size: 1.45rem; line-height: 1.2; }
.wn-top p { margin: 0; color: #5a6078; font-size: .92rem; }
.wn-list { list-style: none; margin: 0; padding: 8px 26px 18px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.wn-item { padding: 18px 0; border-bottom: 1px solid #f0ece4; }
.wn-item:last-child { border-bottom: 0; }
.wn-item.is-big { background: #fff7f7; border: 1.5px solid #f3c9cc; border-radius: 16px; padding: 16px; margin: 10px -6px; }
.wn-head { display: flex; align-items: center; gap: 12px; }
.wn-head h3 { margin: 2px 0 0; font-size: 1.08rem; }
.wn-ico { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; }
.wn-tag { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--color-primary); }
.wn-tag.is-big { color: #b4232f; }
.wn-item p { margin: 8px 0 8px; color: #3d4459; font-size: .95rem; line-height: 1.5; }
.wn-item p.wn-where { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px; background: #f4f1ea; color: #4a5560; font-size: .82rem; font-weight: 600; }
.wn-shots { display: grid; gap: 10px; }
.wn-shot { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid #e8e3da; box-shadow: 0 4px 14px rgba(21,26,46,.08); background: #faf8f4; }
.wn-shot.is-narrow { max-width: 340px; justify-self: center; }
.wn-foot { padding: 12px 26px 16px; border-top: 1px solid #eee9e0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff; }
.wn-link { color: #5a6078; font-size: .85rem; }
.wn-btns { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 600px) {
  .wn-overlay { padding: 8px; align-items: stretch; }
  .wn-sheet { border-radius: 20px; max-height: none; }
  .wn-top { padding: 18px 16px 12px; } .wn-top h2 { font-size: 1.2rem; }
  .wn-list { padding: 4px 16px 14px; }
  .wn-item.is-big { margin: 10px -4px; padding: 12px; }
  .wn-foot { padding: 10px 16px 14px; }
  .wn-link { width: 100%; text-align: center; }
  .wn-btns { width: 100%; flex-direction: column-reverse; }
  .wn-btns .btn { width: 100%; justify-content: center; text-align: center; }
}
.rate-overlay[hidden] { display: none !important; }

.wn-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.wn-compare.is-phone { max-width: 420px; margin-left: auto; margin-right: auto; }
.wn-compare figure { margin: 0; }
.wn-compare figcaption { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #7a8090; margin: 0 0 5px; }
.wn-compare figcaption.is-after { color: var(--color-primary); }
@media (max-width: 600px) { .wn-compare:not(.is-phone) { grid-template-columns: 1fr; } }

/* About the app (Nov 20, v2): a document with a sticky list of sections on the left (chips on phones) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.ab-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; max-width: 1180px; }
.ab-nav { position: sticky; top: 24px; }
.ab-nav-title { margin: 6px 0 10px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.ab-nav ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--color-border); }
.ab-nav a { display: block; margin-left: -2px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; color: var(--color-text-muted); text-decoration: none; font-size: .92rem; line-height: 1.3; }
.ab-nav a:hover { color: var(--color-text); }
.ab-nav a.is-on { border-left-color: var(--color-primary); color: var(--color-primary-dark); font-weight: 700; }
.ab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); vertical-align: middle; margin-left: 4px; }
.ab-doc { max-width: 860px; }
.ab-hero { padding-bottom: 8px; }
.ab-intro { font-size: 1.08rem; color: #3d4459; line-height: 1.6; margin: 6px 0 10px; max-width: 70ch; }
.ab-legend { font-size: .85rem; color: var(--color-text-muted); margin: 0; }
.ab-sec { padding: 34px 0 38px; border-top: 1px solid var(--color-border-strong); scroll-margin-top: 20px; }
.ab-sec h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; font-size: 1.45rem; line-height: 1.25; }
.ab-ico { font-size: 1.4rem; }
.ab-new { display: inline-block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--color-primary); border-radius: 999px; padding: 3px 9px; }
.ab-lead { font-size: 1.05rem; line-height: 1.6; color: #2b3245; margin: 0 0 10px; max-width: 72ch; }
.ab-points { margin: 0 0 18px; padding-left: 20px; color: #3d4459; line-height: 1.6; max-width: 72ch; }
.ab-points li { margin: 4px 0; }
.ab-shots { display: grid; gap: 18px; }
.ab-shots.is-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; max-width: 760px; }
.ab-shot-link { display: block; border-radius: 14px; }
.ab-shot { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid #e3ddd2; box-shadow: 0 6px 22px rgba(21,26,46,.09); background: #faf8f4; transition: transform .15s, box-shadow .15s; }
.ab-shot-link:hover .ab-shot { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(21,26,46,.14); }
.ab-end { color: var(--color-text-muted); border-top: 1px solid var(--color-border-strong); padding-top: 22px; margin-top: 0; }
@media (max-width: 899px) {
  .ab-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ab-nav { top: var(--header-h, 0px); z-index: 5; margin: 0 -16px 8px; padding: 8px 16px; background: rgba(246, 242, 234, .96); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 1px solid var(--color-border); }
  .ab-nav-title { display: none; }
  .ab-nav ol { display: flex; gap: 6px; overflow-x: auto; border: 0; scrollbar-width: none; }
  .ab-nav ol::-webkit-scrollbar { display: none; }
  .ab-nav a { white-space: nowrap; margin: 0; padding: 6px 12px; border: 1px solid var(--color-border-strong); border-radius: 999px; background: #fff; font-size: .85rem; }
  .ab-nav a.is-on { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
  .ab-nav a.is-on .ab-dot { background: #fff; }
  .ab-sec { scroll-margin-top: calc(var(--header-h, 0px) + 60px); padding: 26px 0 30px; }
  .ab-sec h2 { font-size: 1.25rem; }
  .ab-shots.is-pair { grid-template-columns: minmax(0, 1fr); }
}

/* Nov 20 (Parth): result page, Multiple choice: every option with audio looks clickable: hover lifts it a little, darkens the border and
   lights the 🔊 in its corner (on touch screens the 🔊 is always lit); while it plays the option pulses softly. */
.mcq-r[data-audio-src] { padding-right: 32px; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.mcq-r[data-audio-src]::after { content: "🔊"; position: absolute; right: 8px; bottom: 7px; font-size: .8rem; line-height: 1; opacity: .35; transition: opacity .12s ease, transform .12s ease; }
.mcq-r[data-audio-src]:hover, .mcq-r[data-audio-src]:focus-visible { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(21, 26, 46, .12); border-color: var(--color-primary); outline: none; }
.mcq-r[data-audio-src]:hover::after, .mcq-r[data-audio-src]:focus-visible::after { opacity: 1; transform: scale(1.15); }
.mcq-r.is-right[data-audio-src]:hover { border-color: #1e7b34; }
.mcq-r.is-wrong[data-audio-src]:hover { border-color: #a4262c; }
.mcq-r.is-playing::after { opacity: 1; animation: mcq-pulse .6s ease-in-out infinite alternate; }
@keyframes mcq-pulse { from { transform: scale(1); } to { transform: scale(1.3); } }
@media (hover: none) { .mcq-r[data-audio-src]::after { opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .mcq-r[data-audio-src], .mcq-r[data-audio-src]::after { transition: none; } .mcq-r.is-playing::after { animation: none; } }
.mcq-audio-hint { margin: 0 0 10px; font-size: .88rem; color: var(--color-text-muted); }

/* Nov 20 (Parth): the same 🔊 on every option while taking a Multiple choice test, so it is clear a click also plays the word */
.mcq-option[data-audio-src] span { position: relative; padding-right: 32px; }
.mcq-option[data-audio-src] span::after { content: "🔊"; position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: .8rem; line-height: 1; opacity: .35; transition: opacity .12s ease; }
.mcq-option[data-audio-src]:hover span::after, .mcq-option[data-audio-src] input:focus-visible + span::after, .mcq-option[data-audio-src] input:checked + span::after { opacity: 1; }
.mcq-option.is-playing span::after { opacity: 1; animation: mcq-pulse-y .6s ease-in-out infinite alternate; }
@keyframes mcq-pulse-y { from { transform: translateY(-50%) scale(1); } to { transform: translateY(-50%) scale(1.3); } }
@media (hover: none) { .mcq-option[data-audio-src] span::after { opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .mcq-option.is-playing span::after { animation: none; } }
/* Nov 20 fix: on phones the target card has no spare room at the bottom, so the streak sits on its own line under
   "N words studied today" instead of in the corner (it overlapped that line) */
@media (max-width: 900px) { .mp-today-row .mp-today .mp-streak { position: static; margin: 4px 36px 0 0; } }

/* Nov 20 (Parth): your answer on the Multiple choice result is shown visually, not with the words "Your pick": a thicker border and
   a round badge in the top-right corner, ✓ in green when it was right, ✕ in red when it was wrong. The right answer you did not
   choose keeps its green border only. */
.mcq-r.is-picked { border-width: 2px; padding: 6px 31px 6px 9px; }
.mcq-r-mark { position: absolute; top: 7px; right: 8px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: .7rem; font-weight: 900; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.mcq-r.is-right .mcq-r-mark { background: #1e7b34; }
.mcq-r.is-right .mcq-r-mark::before { content: "✓"; }
.mcq-r.is-wrong .mcq-r-mark { background: #a4262c; }
.mcq-r.is-wrong .mcq-r-mark::before { content: "✕"; }

/* Nov 20 (Parth): computer rail. (1) While the account menu is open, the rail does not widen and no page names pop up, so nothing
   covers the menu. (2) When the rail widens (pointer on the menu or the logo), "French Vocab / by @from.srishti" shows next to the
   logo, like the phone top bar. */
@media (min-width: 901px) {
  html[data-shell="app"] .site-header:has(.account-menu.is-open) .nav-label { visibility: hidden; opacity: 0; }
  html[data-shell="app"] .site-header .brand-text { position: absolute; left: 78px; top: 22px; display: flex; flex-direction: column; line-height: 1.15;
    opacity: 0; transform: translateX(-6px); pointer-events: none; transition: opacity .15s ease, transform .15s ease; white-space: nowrap; }
  html[data-shell="app"] .site-header .brand-text b { font-size: .95rem; color: var(--ui-ink); }
  html[data-shell="app"] .site-header .brand-text small { font-size: .76rem; font-weight: 700; color: var(--color-primary); }
  html[data-shell="app"] .site-header:not(:has(.account-menu.is-open)):is(:has(.main-nav:hover), :has(.brand:hover), :has(.auth-area:hover)) .brand-text { opacity: 1; transform: none; }
}
/* Nov 20 (Parth): the brand at the bottom of every page in the app's main colour */
.footer-brand { color: var(--color-primary); font-weight: 700; }
/* Nov 20 (Parth): Multiple choice options line up however long the words are: text starts on the left and sits in the middle of the
   box, every box in a row is as tall as the tallest, and on phones each option gets the full width (one per row). */
.mcq-card .mcq-option span, .mcq-option span { display: flex; align-items: center; min-height: 46px; text-align: left; justify-content: flex-start; }
.mcq-r { justify-content: center; min-height: 52px; }
@media (max-width: 600px) {
  .mcq-options, .mcq-review, .mcq-card .mcq-options { grid-template-columns: minmax(0, 1fr); }
}
/* Nov 20 (Parth): progress chart: both test kinds in one colour, told apart by the marker: ● Written, ■ Multiple choice (dashed line) */
.at-dot.is-mcq { fill: #e8833a; }
.at-testline.is-mcq { stroke: #e8833a; stroke-dasharray: 4 3; }
.at-key-dot.is-mcq { background: #e8833a; border-radius: 2px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e8833a; }
/* study plan tracker legend: two plain entries instead of one two-colour swatch */
.mp-key-below { width: 14px; height: 10px; border-radius: 2px; background: linear-gradient(90deg, hsl(4, 72%, 52%), hsl(60, 62%, 44%)); }
.mp-key-hit { width: 14px; height: 10px; border-radius: 2px; background: hsl(157, 50%, 36%); }

/* ===== FINAL PALETTE (Nov 21, Parth): the website's "Baseline" palette on the vocab app, STRICT: every colour below is one of the website's own:
   #ffffff #0a0a0a  #2563c9 brand  #0f2f63 navy  #173a78 navy hover  #0b1f45 deepest  #5790e6 light blue  #0b6e97 teal
   #eef1fa blue tint  #f4f4f4 surface  #717784 soft ink  #d7dae1 ghost  #e6e8ec hairline  #e8833a orange  #ffd28a gold  #ef4444 red
   Roles: brand blue = actions, "you are here", progress, the target card · navy = selected chips and tooltips · blue tint = Writing &
   Speaking cards · gold = Basics cards and below-target bars · orange = streak, days left, written-test dots · teal = Done ✓ and right
   answers (the palette has no green) · red = wrong answers and "Disable". Shadows are soft greys and do not count as colours. */
:root {
  --color-primary: #2563c9; --color-primary-rgb: 37, 99, 201; --color-primary-dark: #173a78; --color-primary-deep: #0f2f63;
  --color-mint: #eef1fa; --color-mint-soft: #eef1fa; --color-mint-border: #5790e6;
  --color-success: #0b6e97; --color-accent: #e8833a;
  --color-text: #0a0a0a; --color-text-muted: #717784;
  --color-border: #e6e8ec; --color-border-strong: #d7dae1; --color-bg: #f4f4f4; --color-surface: #ffffff;
  --ui-bg: #f4f4f4; --ui-rail: #ffffff; --ui-soft: #eef1fa; --ui-line: #e6e8ec; --ui-ink: #0a0a0a;
  --ui-theme: #eef1fa; --ui-theme-ink: #2563c9;
  --ui-sec-themes: #eef1fa; --ui-sec-themes-ink: #2563c9;
  --ui-sec-basics: #ffd28a; --ui-sec-basics-ink: #0a0a0a;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body, body.themed-bg { background: #f4f4f4; }
body.themed-bg { --pattern-ink: #717784; }
a { color: #2563c9; }

/* 4. "you are here" in brand blue; navy for hover and the labels */
@media (min-width: 901px) {
  html[data-shell="app"] .site-header { background: #ffffff; box-shadow: 0 0 0 1px #e6e8ec; }
  html[data-shell="app"] .nav-item { background: #f4f4f4; color: #0f2f63; }
  html[data-shell="app"] .nav-item:not([aria-current="page"]):hover { background: #eef1fa; color: #0f2f63; }
  html[data-shell="app"] .nav-item[aria-current="page"], html[data-shell="app"] .nav-item[aria-current="page"]:hover { background: #2563c9; color: #ffffff; }
  html[data-shell="app"] .nav-label, html[data-shell="app"] .nav-label::before { background: #0f2f63; color: #ffffff; }
}
@media (max-width: 900px) {
  html[data-shell="app"] .site-header { background: #ffffff; border-bottom-color: #e6e8ec; }
  html[data-shell="app"] .main-nav { background: #ffffff; }
  html[data-shell="app"] .nav-item { color: #717784; }
  html[data-shell="app"] .nav-item[aria-current="page"], html[data-shell="app"] .nav-item[aria-current="page"]:hover { background: #2563c9; color: #ffffff; }
  html[data-shell="app"] .brand-text small { color: #2563c9; }
}
html[data-shell="app"] .account-toggle { background: #ffd28a; color: #0a0a0a; border-color: #ffffff; }
.account-menu { background: #ffffff; }
.account-menu-item:hover { background: #eef1fa; }
.account-menu-button { color: #ef4444; }
.lang-switch-input:checked + .lang-switch-track { background: #2563c9; }

/* buttons */
.btn-primary { background: #2563c9; color: #ffffff; border-color: #2563c9; }
.btn-primary:hover { background: #173a78; border-color: #173a78; }
.btn-primary:active { background: #0f2f63; }
.btn-ghost, .btn-secondary { background: #ffffff; color: #0f2f63; border-color: #d7dae1; }
.btn-danger, #mp-off-btn, .mp-plan-actions .btn-danger { background: #ef4444; border-color: #ef4444; color: #ffffff; }

/* 2. selected chips in navy */
.capsule input:checked + span, .mini-card input:checked + .mini-card-body, .chip.active, .tab.active,
.mcq-option input:checked + span { background: #0f2f63; border-color: #0f2f63; color: #ffffff; }
.capsule span, .mini-card-body, .chip { border-color: #d7dae1; }
.type-tile input:checked + .type-tile-body { border-color: #2563c9; }
.type-tile input:checked + .type-tile-body .type-tile-ico { background: #eef1fa; }
.type-tile-tick { background: #2563c9; }
.mini-card-icon.is-done { color: #0b6e97; }
.mini-card-icon.is-fav { color: #ef4444; }
.fav-box.is-on, .studied-box.is-on { border-color: #5790e6; background: #eef1fa; }

/* 3. home cards: Writing & Speaking in the blue tint with a brand-blue % pill; Basics in gold */
.home-section-themes .theme-card, .home-section-themes .theme-card:hover { background: #eef1fa; box-shadow: inset 0 0 0 1px #d7dae1; }
.home-section-basics .theme-card, .home-section-basics .theme-card:hover { background: #ffd28a; }
.home-section-themes .theme-progress-fill { background: #2563c9; }
.home-section-basics .theme-progress-fill { background: #0a0a0a; }
.band-title::before { background: #2563c9; }
.home-section-basics .band-title::before { background: #e8833a; }
.theme-card .theme-name, .theme-card { color: #0a0a0a; }
.home-section-themes .theme-percent, .home-section-themes .theme-pct { background: #2563c9; color: #ffffff; }

/* progress bars and Done */
.theme-progress-fill, .progress-fill { background: #2563c9; }
.theme-progress-text { color: #2563c9; }
.done-btn.is-done { background: #0b6e97; border-color: #0b6e97; }
.done-btn:hover { border-color: #0b6e97; }

/* 1. the current target card: solid brand blue, white text, gold streak */
.mp-today-row > .mp-today.hl-a, .mp-today.hl-a { background: #2563c9; border: 0; box-shadow: none; color: #ffffff; }
.mp-today.hl-a .mp-today-big, .mp-today.hl-a .mp-today-unit, .mp-today.hl-a .mp-trend, .mp-today.hl-a .mp-eyebrow,
.mp-today.hl-a .mp-label, .mp-today.hl-a .mp-today-sub, .mp-today.hl-a h2, .mp-today.hl-a h3 { color: #ffffff !important; }
.mp-today.hl-a .mp-streak { color: #ffd28a; }
.mp-today.hl-a .mp-today-bar, .mp-today.hl-a .progress-track { background: #5790e6; }
.mp-today.hl-a .mp-today-bar span, .mp-today.hl-a .progress-fill { background: #ffffff; }
.mp-today.hl-a .mp-info-btn, .mp-today.hl-a .mp-info { background: #ffffff; color: #0f2f63; border-color: #ffffff; }
@keyframes mp-glow { 0% { box-shadow: 0 0 0 0 rgba(37, 99, 201, .5); } 100% { box-shadow: 0 0 0 16px rgba(37, 99, 201, 0); } }
.mp-plan-actions .btn-ghost, #mp-reset-btn { background: #ffd28a; color: #0a0a0a; border-color: #ffd28a; }
.mp-pct { color: #2563c9; }

/* charts: words in brand blue, written tests orange, multiple choice navy; tracker bars gold below the target, blue once reached */
.at-key-bar { background: #2563c9; }
.at-bar { fill: #2563c9; }
.at-key-dot { background: #e8833a; } .at-dot { fill: #e8833a; } .at-testline { stroke: #e8833a; }
.pc-bar { fill: #ffd28a; }
.pc-bar[fill="hsl(157, 50%, 36%)"] { fill: #2563c9; }
.mp-tip, .mp-pop, .mp-pop::before, .hint-pop { background: #0f2f63; color: #ffffff; }

/* right / wrong: teal and red (the palette has no green) */
.result-correct, .mcq-card.is-correct .mcq-verdict, .mcq-r.is-right .mcq-r-fr { color: #0b6e97; }
.result-incorrect, .mcq-card.is-wrong .mcq-verdict, .mcq-r.is-wrong .mcq-r-fr { color: #ef4444; }
.mcq-r.is-right, .mcq-r.is-right[data-audio-src]:hover { border-color: #0b6e97; background: #ffffff; }
.mcq-r.is-wrong, .mcq-r.is-wrong[data-audio-src]:hover { border-color: #ef4444; background: #ffffff; }
.mcq-r.is-right .mcq-r-mark { background: #0b6e97; } .mcq-r.is-wrong .mcq-r-mark { background: #ef4444; }
.mcq-card.is-correct { border-color: #0b6e97; background: #ffffff; }
.mcq-card.is-wrong { border-color: #ef4444; background: #ffffff; }
.row-correct { background: #ffffff; box-shadow: inset 4px 0 0 #0b6e97; }
.alert-error, .alert-danger { background: #ffffff; color: #ef4444; box-shadow: inset 4px 0 0 #ef4444; }
.alert-success { background: #ffffff; color: #0b6e97; box-shadow: inset 4px 0 0 #0b6e97; }

/* "What's new" window */
.wn-badge { background: #eef1fa; color: #2563c9; }
.wn-tag { color: #2563c9; } .wn-tag.is-big { color: #ef4444; }
.wn-item.is-big { background: #ffffff; border-color: #ef4444; }
.wn-item p.wn-where { background: #f4f4f4; color: #0f2f63; }

/* everything else that had its own colour, mapped onto the palette */
.audio-btn { color: #2563c9; }
.tc-ring { fill: #0a0a0a; }
.done-btn { border-color: #d7dae1; }
.theme-count { color: #717784; }
.theme-progress { background: #ffffff; }
.progress-track, .mp-progress { background: #e6e8ec; }
.mcq-card { border-color: #e6e8ec; }
.pc-grid { stroke: #e6e8ec; }
.mp-syl-chip { color: #0a0a0a; border-color: #d7dae1; }
.filter-sep { color: #d7dae1; }
.mp-lock { color: #717784; }
.at-num, .at-tests-table td { color: #2563c9; }
.lang-switch-track { background: #d7dae1; }
.brand { color: #0a0a0a; }
.gender-tag.gender-blue { background: #eef1fa; color: #0f2f63; }
.gender-tag.gender-pink { background: #ffd28a; color: #0a0a0a; }
.row-incorrect { background: #ffffff; box-shadow: inset 4px 0 0 #ef4444; }
.accent-keyboard { background: #d7dae1; border-color: #e6e8ec; color: #0a0a0a; }
.accent-keyboard-header, .accent-keyboard-btns, .accent-keyboard button { color: #0a0a0a; }
[stroke="#d4736b"] { stroke: #ef4444; } [stroke="#3b4752"] { stroke: #0f2f63; } [stroke="#2e9c55"] { stroke: #0b6e97; } [fill="#e6f5ec"] { fill: #eef1fa; }
.ab-intro, .ab-points, .ab-lead { color: #0a0a0a; }
.ab-shot { border-color: #e6e8ec; background: #f4f4f4; }
@media (max-width: 899px) { .ab-nav { background: #f4f4f4; } }
.theme-card .theme-count { color: #717784 !important; }
.theme-card .theme-progress { background: #ffffff !important; }
fieldset.mcq-card, .mcq-grid .mcq-card { border-color: #e6e8ec; }
.mcq-grid .mcq-card.is-correct { border-color: #0b6e97; } .mcq-grid .mcq-card.is-wrong { border-color: #ef4444; }
.at-num, .at-tests-table td, .at-tests-table .at-num { color: #2563c9 !important; }
.celebrate-overlay, .wn-overlay { background: rgba(10, 10, 10, .45); }
.site-header { background: #0f2f63; }
.wn-sheet, .wn-top, .wn-list, .wn-item h3 { color: #0a0a0a; }
.wn-item p, .wn-top p { color: #0a0a0a; }
.wn-link, .wn-compare figcaption { color: #717784; }
.wn-compare figcaption.is-after { color: #2563c9; }
.wn-shot { border-color: #e6e8ec; background: #f4f4f4; }
.wn-ico { background: #eef1fa !important; }
.wn-item.is-big .wn-ico { background: #ffd28a !important; }
.wn-top, .wn-foot, .wn-item { border-color: #e6e8ec; }
.mcq-card:has(input:checked) { border-color: #5790e6; }

/* charts: tests in orange, ● Written and ■ Multiple choice; tracker legend matches the bars */
.at-dot.is-mcq { fill: #e8833a; } .at-testline.is-mcq { stroke: #e8833a; }
.at-key-dot.is-mcq { background: #e8833a; box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px #e8833a; }
.mp-key-below { background: #ffd28a; } .mp-key-hit { background: #2563c9; }

/* home cards, not pale: themes in your plan are solid brand blue with white text, Basics in your plan solid gold; themes outside
   your plan are white with a coloured outline (clearly "not in the plan", but nothing washed out) */
.home-section-themes .theme-card, .home-section-themes .theme-card:hover { background: #2563c9; box-shadow: none; color: #ffffff; }
.home-section-themes .theme-card .theme-name, .home-section-themes .theme-card .theme-title { color: #ffffff; }
.home-section-themes .theme-card .theme-count { color: #eef1fa !important; }
.home-section-themes .theme-card .theme-progress { background: #5790e6 !important; }
.home-section-themes .theme-progress-fill { background: #ffffff; }
.home-section-basics .theme-card, .home-section-basics .theme-card:hover { background: #ffd28a; box-shadow: none; }
.home-section-basics .theme-card .theme-progress { background: #ffffff !important; }
.home-section-basics .theme-progress-fill { background: #0a0a0a; }
.theme-card.is-out-of-plan, .theme-card.is-out-of-plan:hover { opacity: 1; filter: none; }
.home-section-themes .theme-card.is-out-of-plan, .home-section-themes .theme-card.is-out-of-plan:hover { background: #ffffff; box-shadow: inset 0 0 0 1.5px #5790e6; }
.home-section-themes .theme-card.is-out-of-plan .theme-name, .home-section-themes .theme-card.is-out-of-plan .theme-title { color: #0a0a0a; }
.home-section-themes .theme-card.is-out-of-plan .theme-count { color: #717784 !important; }
.home-section-themes .theme-card.is-out-of-plan .theme-progress { background: #eef1fa !important; }
.home-section-themes .theme-card.is-out-of-plan .theme-progress-fill { background: #2563c9; }
.home-section-basics .theme-card.is-out-of-plan, .home-section-basics .theme-card.is-out-of-plan:hover { background: #ffffff; box-shadow: inset 0 0 0 1.5px #e8833a; }
.home-section-basics .theme-card.is-out-of-plan .theme-progress { background: #f4f4f4 !important; }
.footer-brand { color: #2563c9; }

/* ===== UI audit fixes (Nov 21): layout only, no colour or wording changes ===== */
/* Study plan › Your plan: four numbers no longer push past the card on small laptops (900–1199px) */
@media (min-width: 900px) and (max-width: 1199px) { .mp-plan-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the chart card never widens the page on narrow phones */
@media (max-width: 899px) { .mp-alltime { grid-template-columns: minmax(0, 1fr); } .mp-alltime > * { min-width: 0; } }
/* search / filter bars: the button always stays on screen */
.filter-bar input[type=text] { min-width: 0; }
.filter-bar > .btn { flex-shrink: 0; }
/* phone tab bar: five tabs fit on 320px screens */
@media (max-width: 899px) {
  html[data-shell="app"] .nav-item { min-width: 0; }
  html[data-shell="app"] .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 360px) { html[data-shell="app"] .nav-item { font-size: .6rem; } }
/* target capsule tip stays inside small screens */
@media (max-width: 420px) { .tc-tip { max-width: min(240px, calc(100vw - 40px)); } }
/* About: phone chip bar no longer makes the page 2px wide; the feedback link is visibly a link */
.ab-layout { overflow-x: clip; }
.ab-end a { text-decoration: underline; text-underline-offset: 2px; }
/* Study plan › the two all-time boxes share the row on phones, and stack on very narrow ones */
@media (max-width: 899px) { .at-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } .at-side > * { min-width: 0; } }
@media (max-width: 380px) { .at-side { grid-template-columns: minmax(0, 1fr); } }

/* ===== Nov 21 (Parth): UI touch-ups ===== */
/* Study plan › Current target: a bigger number, and the number block sits in the middle of the card (no empty space under it) */
.mp-today-row > .mp-today { justify-content: flex-start; }
.mp-today-row > .mp-today .mp-today-figure { margin-top: auto; }
.mp-today-row > .mp-today .mp-today-sub { margin-bottom: auto; }
.mp-today-row .mp-today .mp-today-big, .mp-today-row .mp-today.hl-a .mp-today-big { font-size: 4.6rem; letter-spacing: -0.03em; }
.mp-today-row .mp-today .mp-today-unit { font-size: 1.25rem; }
@media (min-width: 901px) { .mp-today-row > .mp-today { padding-bottom: 44px; } }           /* room for "N days in a row" at the bottom */
@media (max-width: 900px) {
  .mp-today-row .mp-today .mp-today-big, .mp-today-row .mp-today.hl-a .mp-today-big { font-size: 3.8rem; }
  .mp-today-row .mp-today .mp-today-unit { font-size: 1.1rem; }
}
/* Test result (written): the right / wrong mark is a small rounded bar inside the row, so the row's round corner no longer cuts it */
.row-correct, .row-incorrect { box-shadow: none; }
.row-correct td:first-child, .row-incorrect td:first-child { position: relative; padding-left: 22px; }
.row-correct td:first-child::after, .row-incorrect td:first-child::after {
  content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: #0b6e97;
}
.row-incorrect td:first-child::after { background: #ef4444; }
@media (max-width: 900px) {
  .row-correct, .row-incorrect { position: relative; }
  .row-correct td:first-child, .row-incorrect td:first-child { position: static; }
  .row-correct td:first-child::after, .row-incorrect td:first-child::after { top: 14px; bottom: 14px; left: 7px; }
}
/* Study plan: "How the study plan works" next to the title, always there (hidden while the 3 steps already show their own link) */
/* Nov 21 (Parth): the link sits on the same line as the "Study plan" title, at the other end of the line (computer and phone) */
.mp-title-row { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mp-title-row .page-title { margin-bottom: 0; }
.mp-title-row .mp-howto { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; white-space: nowrap; margin-left: auto; }
@media (max-width: 600px) { .mp-title-row .mp-howto { font-size: .8rem; } }
body:has(#mp-steps:not([hidden])) .mp-howto { display: none; }
/* Study plan › the two all-time boxes stack on phones, so the Tests table always has room for its numbers */
@media (max-width: 600px) { .at-side { grid-template-columns: minmax(0, 1fr); } }
/* small laptops (900–1199px): the target card is narrower, so the number is a little smaller and "words/day" stays on its line */
@media (min-width: 901px) and (max-width: 1199px) {
  .mp-today-row .mp-today .mp-today-big, .mp-today-row .mp-today.hl-a .mp-today-big { font-size: 3.6rem; }
  .mp-today-row .mp-today .mp-today-unit { font-size: 1.05rem; }
}

/* Nov 21 (Parth): while the plan is off, "Disable study plan" is greyed out (it was still red: the palette colour sat on top) */
.btn-danger:disabled, .btn-danger:disabled:hover, .mp-plan-actions .btn-danger:disabled, .mp-plan-actions .btn-danger:disabled:hover {
  background: #d7dae1; border-color: #d7dae1; color: #717784; box-shadow: none; transform: none; cursor: not-allowed;
}
/* Nov 22 (staging test): on phones and small tablets the tab bar floats at the bottom, so the daily-target chip sits just above it
   instead of covering Favorites / Test */
@media (max-width: 900px) {
  html[data-shell="app"] .target-capsule { bottom: calc(max(10px, env(safe-area-inset-bottom, 0px)) + 76px); }
}
/* Nov 22 (staging test): while the accent keyboard is open, the answered / Cancel / Submit bar stays at the bottom of the screen,
   under the keyboard, all the way to the end of the test (the footer steps aside, like the tab bar) */
html[data-shell="app"] body.is-testing:has(#accent-keyboard:not(.collapsed)) .site-footer { display: none; }
html[data-shell="app"] body.is-testing:has(#accent-keyboard:not(.collapsed)) .page-main { padding-bottom: 0; margin-bottom: 0; }
html[data-shell="app"] body.is-testing:has(#accent-keyboard:not(.collapsed)) { padding-bottom: 14px; }
html[data-shell="app"] body.is-testing:has(#accent-keyboard:not(.collapsed)) #test-form .vocab-table-wrap { margin-bottom: 210px; }   /* room to scroll the last answer box above the keyboard */
/* Nov 22 (Parth): no 🔊 icon on the Multiple choice options while taking the test; a tap still plays the word */
.mcq-option[data-audio-src] span { padding-right: 10px; }
.mcq-option[data-audio-src] span::after, .mcq-option.is-playing span::after { content: none; display: none; }

/* Nov 22 (Parth): "New" tags on the round 16 features, for learners who had the app before the update; each one goes away once that
   feature is used, and all of them stop 21 days after the update (accounts/engagement.py). Phone tab bar: a small pill on the icon;
   computer side menu (icons only, the pill would be cut off): a blue dot. */
.new-tag { display: inline-block; font-size: .58rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #fff; background: var(--color-primary);
  border-radius: 999px; padding: 2px 7px; line-height: 1.35; vertical-align: middle; margin-left: 7px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); white-space: nowrap; }
.nav-item { position: relative; }
.nav-item .new-tag { position: absolute; top: -2px; right: -4px; margin: 0; font-size: .52rem; padding: 2px 5px; z-index: 2; }
.account-menu-row .new-tag { margin-left: 8px; margin-right: auto; }
@media (min-width: 901px) {
  html[data-shell="app"] .nav-item .new-tag { top: 7px; right: 7px; width: 10px; height: 10px; padding: 0; font-size: 0; border-radius: 50%; border: 2px solid #fff; box-sizing: content-box; }
}

/* Nov 23 (Parth, after the round 16 push): on computers the widened rail keeps its width (it covers no more of the theme cards); the
   app name now shows right below the logo instead of beside it, so the full "TCF French Vocab App" fits. The account button gets its
   own label, "Settings", like the page buttons. Pointing at the account button also widens the rail; it closes as soon as the account
   menu opens, as before. */
.rail-label { display: none; }
@media (min-width: 901px) {
  html[data-shell="app"] .site-header .brand-text { left: 18px; top: 82px; max-width: 182px; white-space: normal; }
  html[data-shell="app"] .auth-area { position: relative; }
  html[data-shell="app"] .auth-area .rail-label { display: block; position: absolute; left: 48px; top: 50%; transform: translate(-6px, -50%); opacity: 0;
    pointer-events: none; white-space: nowrap; font-size: .95rem; font-weight: 700; color: var(--ui-ink); transition: opacity .15s ease, transform .15s ease; }
  html[data-shell="app"] .site-header:not(:has(.account-menu.is-open)):is(:has(.main-nav:hover), :has(.brand:hover), :has(.auth-area:hover)) .auth-area .rail-label,
  html[data-shell="app"] .site-header:has(.main-nav :focus-visible) .auth-area .rail-label { opacity: 1; transform: translate(0, -50%); }
}
