/* Deck pages (/decks/…, mobile.atomtranslate.com/community/…) and the /decks catalog.
   Rendered by functions/_lib/deck-page.js. Colours are the app's own themes: dark matches
   style.css / DarkTheme.xaml, light matches LightTheme.xaml. --text-muted in the light theme
   is mixed from TextPrimary and TextSecondary because TextSecondary alone is too faint for
   small text (WCAG AA). The theme attribute is set before first paint by the inline script in
   <head>; deck.js switches it and remembers the choice. */

:root,
[data-theme="dark"] {
  /* DarkTheme.xaml */
  --bg: #121316;            /* AppBackground */
  --surface: #1c1d22;       /* Surface */
  --surface-alt: #2a2925;   /* SurfaceAlt */
  --border: rgba(255, 255, 255, 0.15); /* CardBorder #26FFFFFF */
  --border-strong: #33353b; /* StrokeColor */
  --text: #f0f0ec;          /* TextPrimary */
  --text-muted: #a8a79e;    /* TextSecondary */
  --accent: #378add;        /* Accent */
  --accent-text: #5ba3e8;   /* InfoText */
  --accent-soft: #1b3349;   /* AccentLight */
  --info-strong: #185fa5;   /* InfoStrong */
  --accent-alt: #e8944a;    /* AccentAlt */
  --accent-alt-soft: #3a2a19; /* AccentAltLight */
  --on-accent: #ffffff;
  --success: #5dcaa5;       /* Success */
  --success-soft: #223019;  /* SuccessTint */
  --success-text: #6fcb3e;  /* SuccessText */
  --warning: #fac775;       /* Warning */
  --warning-soft: #3a2e14;  /* WarningTint */
  --warning-text: #e8b563;  /* WarningText */
  --danger: #f09595;        /* Danger */
  --danger-soft: #3a1f1f;   /* DangerTint */
  --danger-text: #e8837d;   /* DangerText */
  --shadow: 0 24px 48px -32px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

[data-theme="light"] {
  /* LightTheme.xaml */
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-alt: #f1efe8;
  --border: rgba(44, 44, 42, 0.10); /* CardBorder #1A2C2C2A */
  --border-strong: #e8e9eb;
  --text: #2c2c2a;
  /* TextSecondary (#888780) is too faint for small text on white (WCAG AA); mixed with
     TextPrimary rather than inventing a new grey. */
  --text-muted: color-mix(in srgb, #2c2c2a 72%, #888780);
  --accent: #378add;
  --accent-text: #185fa5;   /* InfoText */
  --accent-soft: #ebf4fd;
  --info-strong: #185fa5;
  --accent-alt: #c9660f;
  --accent-alt-soft: #fbf0e4;
  --on-accent: #ffffff;
  --success: #5dcaa5;
  --success-soft: #eaf3de;
  --success-text: #27500a;
  --warning: #fac775;
  --warning-soft: #faeeda;
  --warning-text: #854f0b;
  --danger: #f09595;
  --danger-soft: #fcebeb;
  --danger-text: #a32d2d;
  --shadow: 0 18px 40px -30px rgba(44, 44, 42, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }

/* `hidden` must win over the display rules below (banner, theme toggle, panels): those parts
   are revealed by deck.js only where they apply. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  /* The site's type (style.css): Inter for text, Space Grotesk for headings. */
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand span, .hero__name {
  font-family: "Space Grotesk", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.01em;
}

a { color: var(--accent-text); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ chrome */

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 760px; margin: 0 auto; padding: 12px 16px;
}
/* The catalog is wider than a deck page; header and footer line up with its content. */
.top.top--wide, .foot.foot--wide { max-width: 1040px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--text); text-decoration: none; font-weight: 700;
}

.brand img { border-radius: 22%; }

.top__actions { display: flex; align-items: center; gap: 8px; }

/* Compact store links: wide screens only (phones get the OS app banners and the footer). */
.top-store {
  display: none; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.top-store svg { width: 16px; height: 16px; }
.top-store:hover { border-color: var(--accent); }

/* The way into the web app: the header's one accent element, as "Log in" is elsewhere. */
.top-web {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--accent-text); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.top-web svg { width: 16px; height: 16px; }
.top-web:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent)); }

@media (min-width: 721px) {
  .top-store { display: inline-flex; }
  .foot__stores { display: none; }
}
@media (max-width: 400px) {
  .top-web svg { display: none; }
  .top__actions { gap: 6px; }
}

.foot__stores { margin-bottom: 12px; }
.foot .store { color: var(--text); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer;
}

.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="dark"] .theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.page { max-width: 760px; margin: 0 auto; padding: 0 16px 120px; }
.page--wide { max-width: 1040px; }

.crumbs { font-size: 14px; margin: 4px 0 12px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--text-muted); }
.crumbs li[aria-current] { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }

.foot { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--border); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); }

/* ------------------------------------------------------------------ hero */

.hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 24px 20px; box-shadow: var(--shadow);
}

.hero h1 { margin: 0; line-height: 1.2; min-width: 0; }
.hero__head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
/* The app's folder/section badge: pictogram on an AccentLight tile. */
.hero__icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 72px; height: 72px; border-radius: 18px; background: var(--accent-soft);
}
.hero__name { display: block; font-size: 28px; overflow-wrap: anywhere; }
/* Narrow phones: a little smaller, so a one-word name fits beside the icon. */
@media (max-width: 400px) { .hero__name { font-size: 24px; } }
.hero__sub { display: block; margin-top: 4px; font-size: 17px; font-weight: 600; color: var(--text-muted); }
.hero--message h1 { font-size: 24px; }

.hero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin: 0 0 12px; color: var(--text-muted); font-size: 15px;
}

/* Author: photo or initial + name, linking to the profile in the web app. */
.author {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-right: 4px;
  color: var(--text); text-decoration: none; border-radius: 999px;
}
.author__photo {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--surface-alt); box-shadow: 0 0 0 1px var(--border);
}
.author__photo--initial {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: 14px;
  box-shadow: none;
}
.author__text { display: flex; flex-direction: column; line-height: 1.15; }
.author__text small { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.author__name { font-weight: 700; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.author:hover .author__name { text-decoration-color: var(--accent); }
.hero__sections::before { content: "·"; margin-right: 14px; color: var(--border-strong); }
.hero__desc { margin: 12px 0; white-space: pre-line; overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-alt); color: var(--text); border: 1px solid var(--border);
}
/* Pills in the app's FolderDetailPage colours: language → success, category → accent,
   level → warning. */
.chip--language { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.chip--category { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip--level { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
/* AccentAlt alone is too light for small text on its tint in the light theme. */

.learners { margin: 12px 0 0; font-size: 14px; font-weight: 600; color: var(--success-text); }

.cta { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 14px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
/* The app's Accent blue with white text, as on the app's buttons. 19px bold counts as large
   text, where white on #378ADD meets WCAG AA. */
.btn--primary { background: var(--accent); color: var(--on-accent); font-size: 19px; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--accent); }

/* "Open in the app" only where an app can be opened. */
@media (hover: hover) and (pointer: fine) { .only-touch { display: none; } }

.stores { display: flex; gap: 8px; flex-wrap: wrap; }
.store {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-alt);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.15;
}
.store svg { width: 18px; height: 18px; }
.store small { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.hint { margin: 12px 0 0; font-size: 13px; color: var(--text-muted); }

/* ------------------------------------------------------------------ panels: quiz, leaderboard */

.panel {
  margin-top: 16px; padding: 20px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border);
}
.panel h2 { margin: 0 0 8px; font-size: 20px; }
.panel p { margin: 0 0 12px; }

.quiz__progress { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.quiz__question { font-size: 18px; font-weight: 700; margin: 0 0 12px; overflow-wrap: anywhere; }
.quiz__options { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.quiz__option {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; text-align: left;
  font: inherit; color: var(--text); background: var(--surface-alt); border: 1px solid var(--border-strong);
  cursor: pointer; overflow-wrap: anywhere;
}
.quiz__option:hover:not(:disabled) { border-color: var(--accent); }
.quiz__option:disabled { cursor: default; }
.quiz__option.is-correct { background: var(--success-soft); border-color: var(--success); color: var(--success-text); font-weight: 600; }
.quiz__option.is-wrong { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); font-weight: 600; }
.quiz__feedback { min-height: 24px; font-weight: 600; margin: 0 0 12px; }
.quiz__feedback.is-correct { color: var(--success-text); }
.quiz__feedback.is-wrong { color: var(--danger-text); }
.quiz__score { font-size: 32px; font-weight: 800; margin: 0 0 4px; }
.quiz__actions { display: flex; flex-direction: column; gap: 10px; }

.board__in { font-size: 14px; color: var(--text-muted); }
.board__list { margin: 8px 0 12px; padding: 0; list-style: none; }
.board__row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.board__row:last-child { border-bottom: none; }
.board__rank { width: 2ch; font-weight: 800; color: var(--accent-text); }
.board__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board__result { color: var(--text-muted); font-size: 14px; white-space: nowrap; }

/* ------------------------------------------------------------------ sections */

.sections { margin-top: 24px; }
.sections h2 { font-size: 20px; margin: 0 0 12px; }

.sec { margin-bottom: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.sec summary {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px;
  cursor: pointer; list-style: none; font-weight: 600;
}
.sec summary::-webkit-details-marker { display: none; }
.sec__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sec__count { flex-shrink: 0; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.chev { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s ease; }
.sec[open] .chev { transform: rotate(90deg); }
.sec__body { border-top: 1px solid var(--border); padding: 12px 14px 4px; }

.btn--train {
  min-height: 44px; padding: 8px 14px; margin-bottom: 8px; font-size: 15px;
  background: var(--accent-soft); color: var(--accent-text);
}
.btn--train:hover { border-color: var(--accent); }

/* Word list: cards like the app's section screen — picture, word, translation, pronounce. */
.wcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wcard {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.wcard[hidden] { display: none; }
.wcard__img {
  width: 56px; height: 56px; flex-shrink: 0; object-fit: cover;
  border-radius: 10px; background: var(--surface-alt);
}
.wcard__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wcard__orig { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.wcard__tr { font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }
.wcard__speak {
  flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 10px; background: var(--surface-alt); cursor: pointer;
}
.wcard__speak[hidden] { display: none; }
.wcard__speak:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.words-more { width: 100%; margin-top: 12px; background: var(--surface-alt); color: var(--text); font-size: 15px; }
.words-more[hidden] { display: none; }

/* ------------------------------------------------------------------ Android banner, sticky CTA */

.app-banner {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border-strong);
}
.app-banner img { border-radius: 22%; flex-shrink: 0; }
.app-banner p { flex: 1; margin: 0; font-size: 14px; line-height: 1.3; }
.app-banner__open {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; text-decoration: none; font-size: 14px;
}
.app-banner__close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: none; background: none; color: var(--text-muted); cursor: pointer;
}
.app-banner__close svg { width: 18px; height: 18px; }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border-strong);
  transform: translateY(110%); transition: transform 0.2s ease;
}
.sticky-cta.is-shown { transform: translateY(0); }
.sticky-cta .btn { width: 100%; }
@media (min-width: 721px) { .sticky-cta { display: none; } }
/* Room for the bar, so it never covers the end of the footer. */
@media (max-width: 720px) { body.has-sticky-cta { padding-bottom: 80px; } }

/* ------------------------------------------------------------------ catalog */

.catalog-head { margin: 20px 0 20px; }
.catalog-head h1 { font-size: 30px; line-height: 1.15; margin: 0 0 8px; }
.catalog-head__intro { margin: 0; color: var(--text-muted); max-width: 60ch; }

/* Search: one box with the query and the button, then the four filters in a row. */
.filters {
  display: flex; flex-direction: column; gap: 14px;
  margin: 0 0 24px; padding: 16px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}

.filters__search { display: flex; gap: 8px; }
.filters__search-box {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border-strong);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filters__search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filters__search-box svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-muted); }
.filters__search-box input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0; border: 0; outline: none;
  background: transparent; color: var(--text); font: inherit; font-size: 16px;
}
.filters__search-box input::placeholder { color: var(--text-muted); opacity: 0.8; }
.filters__search-box input::-webkit-search-cancel-button { cursor: pointer; }
.filters__submit { font-size: 16px; padding: 0 22px; min-height: 50px; }

.filters__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.field { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
/* Native selects with the system arrow replaced, so they read as the same control on every OS. */
.field select {
  width: 100%; min-height: 44px; padding: 8px 36px 8px 12px; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong);
  -webkit-appearance: none; appearance: none; cursor: pointer;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.field::after {
  content: ""; position: absolute; right: 14px; bottom: 18px; width: 7px; height: 7px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); pointer-events: none;
}
.field select:hover { border-color: var(--accent); }
/* A filter in use: tinted like the app's selected pill. */
.field.is-set select { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.field.is-set::after { border-color: var(--accent-text); }

.results__bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.found { color: var(--text-muted); margin: 0; font-weight: 600; }
.results__reset { font-weight: 600; font-size: 15px; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 40px 20px; border-radius: 20px; border: 1px dashed var(--border-strong);
}
.empty .found { max-width: 40ch; font-weight: 500; }

/* Deck cards: the app's library folder row, as a card. */
.deck-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.deck-card a {
  display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 18px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.deck-card a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.deck-card__head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.deck-card__icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft);
}
.deck-card__icon img { object-fit: contain; }
.deck-card__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deck-card__name { margin: 0; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.deck-card__count { font-weight: 500; color: var(--text-muted); font-size: 14px; }
.deck-card__desc {
  font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Pills and author sit at the bottom, so the cards in a row line up. */
.deck-card__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.deck-card__author {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.deck-card__author > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card__chips + .deck-card__author { margin-top: 0; }
.deck-card__head + .deck-card__author, .deck-card__desc + .deck-card__author { margin-top: auto; }
.deck-card__avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 800;
}

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 28px 0; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  padding: 0 12px; border-radius: 12px; border: 1px solid var(--border-strong); text-decoration: none;
  background: var(--surface); font-weight: 600;
}
.pager a:hover { border-color: var(--accent); }
.pager span[aria-current] { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }

@media (max-width: 480px) {
  .filters { padding: 12px; }
  .filters__submit { padding: 0 16px; }
  .filters__search-box svg { display: none; }
}

@media (min-width: 640px) {
  .hero { padding: 32px 36px; }
  .hero__name { font-size: 34px; }
  .cta { flex-direction: row; flex-wrap: wrap; }
  .quiz__actions { flex-direction: row; flex-wrap: wrap; }
  .catalog-head h1 { font-size: 38px; }
  .deck-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .filters__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .deck-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .chev, .sticky-cta, .deck-card a { transition: none; }
  .deck-card a:hover { transform: none; }
}

/* ------------------------------------------------------------------ stats */

.stats { margin: 12px 0 0; }
.stat--learners { font-size: 14px; font-weight: 600; color: var(--success-text); }

/* ------------------------------------------------------------------ section cards */

.sec-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sec-card {
  display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
.sec-card:hover { border-color: var(--accent); }
.sec-card__icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft);
}
.sec-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sec-card__name { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.sec-card__count { font-size: 14px; color: var(--text-muted); }
.sec-card__desc { font-size: 14px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------------ practice modes */

.modes__note { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-muted); }
.modes__note .mode__lock { position: static; margin-top: 2px; }
.modes__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.mode {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; padding: 12px; border-radius: 16px; text-decoration: none; font-weight: 700; font-size: 16px;
}
.mode img { width: 32px; height: 32px; }
.mode:hover { filter: brightness(0.97); }
.mode__lock { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; opacity: 0.75; }
/* Tints of the app's section screen (SectionHeaderContent). */
.mode--accent { background: var(--accent-soft); color: var(--accent-text); }
.mode--info { background: var(--info-strong); color: #ffffff; }
.mode--success { background: var(--success-soft); color: var(--success-text); }
.mode--muted { background: var(--surface-alt); color: var(--text-muted); }
.mode--danger { background: var(--danger-soft); color: var(--danger-text); }
.mode--warning { background: var(--warning-soft); color: var(--warning-text); }

/* ------------------------------------------------------------------ words */

.all-words__count { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-left: 6px; }
.words-panel h2 { display: flex; align-items: baseline; }
.words-panel__hint { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }

/* ------------------------------------------------------------------ section navigation */

.sec-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.sec-nav__link {
  display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; min-width: 0;
}
.sec-nav__link:hover { border-color: var(--accent); }
.sec-nav__link small { font-size: 12px; color: var(--text-muted); }
.sec-nav__link span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-nav__link--next { text-align: right; grid-column: 2; }
.back-to-deck { margin: 16px 0 0; }
.back-to-deck a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

@media (min-width: 640px) {
  .modes__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sec-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The app's pictograms are not all square; fit them inside their box instead of stretching. */
.mode img, .hero__icon img, .sec-card__icon img { object-fit: contain; }
