/* Site chrome and standalone pages (catalog, pricing, sign-in, account). */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .brand { font-weight: 800; font-size: 17px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.current { color: var(--accent); background: var(--surface-2); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-actions .btn { white-space: nowrap; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px 30px;
  margin-top: 48px;
  color: var(--muted);
  background: var(--surface);
}
.site-footer > nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.site-footer > nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.site-footer > nav a:hover { text-decoration: underline; }
.site-footer .fine { margin: 0; font-size: 13px; }

/* standalone pages */
main.page {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 28px 48px;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.page-hero { margin-bottom: 26px; width: 100%; box-sizing: border-box; }
.page-hero h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 8px; }
.page-hero .lead { margin: 0; color: var(--muted); max-width: 70ch; }
.text-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.plain-list { margin: 0; padding-left: 20px; }
.plain-list li { margin: 6px 0; }

/* About, terms, privacy */
.prose-doc {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 18px);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
/* Readable measure for body copy without narrowing the card */
.prose-doc p,
.prose-doc ul,
.prose-doc ol {
  max-width: 75ch;
}
.prose-doc h2 {
  font-size: 20px;
  margin: 28px 0 10px;
  letter-spacing: -0.01em;
  color: var(--heading, var(--text));
}
.prose-doc h2:first-child { margin-top: 0; }
.prose-doc p { margin: 0 0 14px; color: var(--text); line-height: 1.65; font-size: 15px; }
.prose-doc ul, .prose-doc ol { margin: 0 0 14px; padding-left: 22px; color: var(--text); font-size: 15px; line-height: 1.65; }
.prose-doc li { margin: 6px 0; }
.prose-doc .meta-updated { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.prose-doc a { color: var(--accent); font-weight: 600; text-decoration: none; }
.prose-doc a:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .prose-doc { padding: 20px 18px; }
}

.notice {
  display: block;
  border: 1px solid var(--border);
  border-left: 4px solid #d97706;
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 18px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* catalog */
.catalog-page { max-width: 1240px; padding-top: 28px; }
.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px 32px;
  align-items: center;
  padding: 32px 32px 28px;
  margin-bottom: 28px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    radial-gradient(420px 200px at 0% 0%, rgba(98, 84, 232, 0.12), transparent 70%),
    radial-gradient(360px 180px at 100% 100%, rgba(71, 120, 232, 0.1), transparent 70%),
    linear-gradient(135deg, #f0ebff 0%, #f7f6ff 50%, #eaf2ff 100%);
  box-shadow: var(--shadow-lift);
}
.catalog-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.catalog-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--heading, var(--text));
}
.catalog-hero .lead { margin: 0 0 18px; max-width: 48ch; color: var(--muted); font-size: 16px; line-height: 1.55; }
.catalog-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.catalog-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.catalog-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  box-shadow: var(--shadow);
  text-align: center;
}
.catalog-stat b { display: block; font-size: 24px; color: var(--accent); line-height: 1.1; }
.catalog-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.catalog-toolbar { margin-bottom: 28px; }
.catalog .catalog-search { margin-bottom: 14px; }
.catalog-search .field--count { justify-content: flex-end; }
.catalog-search .field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.catalog-search .search-count { margin: 0; font-size: 15px; font-weight: 800; color: var(--heading, var(--text)); }
.path-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.path-jump__chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--heading, var(--text));
  text-decoration: none;
  box-shadow: var(--shadow);
}
.path-jump__chip:hover { border-color: var(--accent); color: var(--accent); }
.path-groups { display: flex; flex-direction: column; gap: 36px; }
.path-group {
  scroll-margin-top: 88px;
  padding: 22px 22px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.path-group__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px 16px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.path-group__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--brand-soft, var(--lavender));
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.path-group__titles h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.01em; color: var(--heading, var(--text)); }
.path-group__titles .lead { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 62ch; }
.path-group__count {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 4px;
}
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px; }
.course-card {
  position: relative;
  overflow: hidden;
  background: var(--bg, var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}
.course-card__bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--brand-gradient, linear-gradient(90deg, var(--accent), var(--blue, #4778e8)));
  opacity: 0.85;
}
.course-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}
.course-card__num {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
}
.course-card__chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.meta-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.course-card h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.course-card h3 a { color: var(--heading, var(--text)); text-decoration: none; }
.course-card h3 a:hover { color: var(--accent); }
.course-card .meta { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; flex: 1; }
.course-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.catalog-empty {
  text-align: center;
  padding: 28px 20px;
  border-radius: 16px;
  border: 1px dashed var(--border-strong, var(--border));
  background: var(--surface);
  margin-bottom: 20px;
}
.catalog .empty-note { font-style: normal; }
@media (max-width: 900px) {
  .catalog-hero { grid-template-columns: minmax(0, 1fr); }
  .catalog-hero__stats { grid-template-columns: repeat(3, 1fr); }
  .path-group__head { grid-template-columns: auto 1fr; }
  .path-group__count { grid-column: 1 / -1; padding-top: 0; }
}
@media (max-width: 600px) {
  .catalog-hero { padding: 22px 18px; }
  .catalog-hero__stats { grid-template-columns: minmax(0, 1fr); }
  .course-card__actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
}

/* pricing */
.billing-toggle { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan.featured { border-color: var(--accent); }
.plan h2 { margin: 0; font-size: 22px; }
.plan-price { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.plan .lead { margin: 0; font-size: 15px; color: var(--muted); }
.plan ul { margin: 6px 0 12px; padding-left: 20px; }
.plan li { margin: 4px 0; }
.plan .btn { align-self: flex-start; margin-top: auto; }
.plan .btn:disabled { opacity: 0.6; cursor: not-allowed; }
.faq { margin-top: 36px; }
.faq h2 { font-size: 20px; margin: 0 0 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.faq-item summary { cursor: pointer; font-weight: 700; }
.faq-item p { margin: 8px 0 2px; color: var(--muted); }

/* sign-in and register */
.auth { max-width: 440px; margin: 0 auto; }
.auth-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.auth-form .field { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-weight: 700; font-size: 14px; color: var(--text); }
.auth-form input {
  font: inherit;
  font-size: 15px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.auth-form input:disabled { cursor: not-allowed; }
.auth-form .btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-form .notice { margin: 0; }
.auth-switch { text-align: center; color: var(--muted); margin-top: 16px; }

/* account dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.dash-panel h2 { font-size: 17px; margin: 0 0 10px; }
.dash-panel p { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.dash-panel .btn { margin-top: 4px; }

/* focus and mobile */
.site-nav a:focus-visible, .site-footer a:focus-visible, .text-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 860px) {
  .site-header { padding: 12px 16px; }
  main.page { padding: 24px 16px 40px; }
  .page-hero h1 { font-size: 27px; }
  .header-actions { width: 100%; justify-content: flex-end; }
}

.btn { text-decoration: none; }
.site-header .btn { text-decoration: none; }

/* Google sign-in and divider on the auth form */
.auth-divider { position: relative; text-align: center; margin: 4px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.auth-divider::before, .auth-divider::after { content: ""; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.google-slot { display: grid; gap: 8px; justify-items: stretch; }
.google-slot .btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.google-slot .btn.google:disabled { opacity: 0.6; cursor: not-allowed; }
.google-button { min-height: 44px; display: flex; justify-content: center; }
.google-slot .fine { margin: 0; font-size: 13px; color: var(--muted); }
.google-icon { display: inline-flex; width: 18px; height: 18px; }
.google-icon svg { display: block; }

/* mobile menu (FR-07) */
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .site-header { flex-wrap: wrap; }
  .site-nav { display: none; width: 100%; flex-direction: column; padding-top: 6px; }
  .site-header.nav-open .site-nav { display: flex; }
  .header-actions { margin-left: auto; }
}

/* practice pages: quiz and flashcards */
.practice-page { max-width: 1240px; padding-top: 24px; }
.practice-page--quiz { padding-top: 20px; }
.practice .search-panel { grid-template-columns: minmax(0, 2fr) auto; align-items: end; }
.practice .field-action { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.practice .inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text); }

/* quiz practice (redesign) */
.practice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 22px 28px;
  align-items: center;
  padding: 30px 30px 26px;
  margin-bottom: 24px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    radial-gradient(380px 180px at 100% 0%, rgba(71, 120, 232, 0.14), transparent 70%),
    radial-gradient(320px 160px at 0% 100%, rgba(98, 84, 232, 0.12), transparent 70%),
    linear-gradient(135deg, #eaf2ff 0%, #f7f6ff 55%, #f0ebff 100%);
  box-shadow: var(--shadow-lift);
}
.practice-hero .eyebrow {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.practice-hero h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 36px); letter-spacing: -0.02em; color: var(--heading, var(--text)); }
.practice-hero .lead { margin: 0 0 16px; max-width: 50ch; color: var(--muted); line-height: 1.55; }
.practice-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.practice-hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quiz-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.quiz-setup h2 { margin: 0 0 6px; font-size: 20px; }
.quiz-setup > .lead { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.quiz-scope-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.quiz-scope-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading, var(--text));
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.quiz-scope-chip:hover { border-color: var(--accent); color: var(--accent); }
.quiz-scope-chip.is-active { background: var(--brand-soft, var(--lavender)); border-color: var(--accent); color: var(--accent); }
.quiz-setup__panel {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.quiz-setup__panel .field { display: flex; flex-direction: column; gap: 6px; }
.quiz-setup__panel label { font-size: 13px; font-weight: 700; color: var(--muted); }
.quiz-setup__panel select {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--bg));
  color: var(--text);
}
.quiz-pool-count { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.quiz-setup__panel .btn.primary { width: 100%; justify-content: center; }
.quiz-shell {
  min-height: 420px;
  padding: 0;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.quiz-shell__head {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg, var(--surface-2));
}
.quiz-shell__title { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.quiz-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.quiz-progress__fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--brand-gradient, linear-gradient(90deg, var(--accent), var(--blue, #4778e8)));
  transition: width 220ms ease;
}
.quiz-body { padding: 20px 22px 24px; }
.quiz-idle { text-align: center; padding: 28px 16px 36px; max-width: 420px; margin: 0 auto; }
.quiz-idle__art { width: 72px; height: 72px; margin: 0 auto 16px; display: block; }
.quiz-idle h2 { margin: 0 0 8px; font-size: 22px; }
.quiz-idle .lead { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.quiz-tips { margin: 0; padding-left: 20px; text-align: left; color: var(--muted); font-size: 14px; line-height: 1.55; }
.quiz-tips li { margin: 6px 0; }
.quiz-practice fieldset.quiz-question {
  border: 0;
  margin: 0 0 20px;
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg, var(--surface-2));
  min-width: 0;
}
.quiz-practice fieldset.quiz-question legend {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.45;
  color: var(--heading, var(--text));
  padding: 0;
  margin-bottom: 12px;
}
.quiz-practice .q-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  background: var(--accent);
  color: var(--accent-text, #fff);
}
.quiz-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  margin: 6px 0 0;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
}
.quiz-option:hover { background: var(--surface); border-color: var(--border); }
.quiz-option input { margin-top: 3px; accent-color: var(--accent); }
.quiz-option__text { line-height: 1.45; font-size: 15px; }
.quiz-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; padding-top: 8px; }
.quiz-results-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--lavender, #eae7ff) 0%, var(--powder, #e8f1ff) 100%);
  border: 1px solid var(--border);
}
.quiz-score-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 4px solid var(--accent);
  box-shadow: var(--shadow);
}
.quiz-score-ring__value { font-size: 22px; font-weight: 800; color: var(--accent); }
.quiz-results-copy h2 { margin: 0 0 6px; font-size: 22px; }
.quiz-results-copy .score { margin: 0 0 4px; font-weight: 800; font-size: 16px; }
.quiz-practice .muted { margin: 0; color: var(--muted); font-size: 14px; }
.quiz-result-card {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.quiz-result-card.right { border-left: 4px solid var(--ok); }
.quiz-result-card.wrong { border-left: 4px solid var(--bad); }
.quiz-result-card .result-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--muted);
}
.quiz-result-card.right .result-badge { color: var(--ok); }
.quiz-result-card.wrong .result-badge { color: var(--bad); }
.quiz-result-card .result-q { margin: 0 0 8px; font-weight: 700; color: var(--text); }
.quiz-result-card .correct-answer { color: var(--ok); font-weight: 600; margin: 0 0 6px; }
.quiz-result-card .from { margin: 0; color: var(--muted); font-size: 14px; }
.quiz-result-card .from a { color: var(--accent); font-weight: 700; text-decoration: none; }
.quiz-result-card .from a:hover { text-decoration: underline; }
@media (max-width: 960px) {
  .practice-hero { grid-template-columns: minmax(0, 1fr); }
  .quiz-layout { grid-template-columns: minmax(0, 1fr); }
  .quiz-shell { min-height: 0; }
}
@media (max-width: 600px) {
  .practice-hero__stats { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-progress__fill { transition: none; }
}

.flashcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 30px 24px;
  box-shadow: var(--shadow-lift);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.flashcard .fc-meta { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.flashcard .fc-text { margin: 0; font-size: 20px; line-height: 1.5; font-weight: 600; color: var(--text); }
.flashcard .fc-hint { margin: 0; color: var(--muted); font-size: 15px; }
.flashcard .fc-actions, .flashcard .fc-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.flashcard .fc-nav { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 14px; }
.flashcard .btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 860px) {
  .practice .search-panel { grid-template-columns: minmax(0, 1fr); }
  .flashcard { padding: 22px 18px; }
  .flashcard .fc-text { font-size: 18px; }
}

/* footer: full width, sits at the bottom of standalone pages (fixes the gap below it) */
#app { display: flex; flex-direction: column; min-height: 100vh; }
#app > main.page { flex: 1 0 auto; width: 100%; }
.site-footer { margin-top: 0; width: 100%; box-sizing: border-box; padding: 26px 24px 28px; }
.site-footer nav, .site-footer .fine { max-width: 1200px; margin-left: auto; margin-right: auto; }
.site-footer .fine { margin-top: 8px; }

/* Modal confirm dialog (Site.confirm) */
body.has-site-dialog {
  overflow: hidden;
}
.site-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  animation: site-dialog-fade 160ms ease;
}
.site-dialog {
  width: min(100%, 420px);
  padding: 22px 22px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
  animation: site-dialog-rise 200ms ease;
}
.site-dialog__title {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--heading, var(--text));
}
.site-dialog__message {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.site-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.site-dialog__confirm--danger {
  background: #c93b4a !important;
  border-color: #c93b4a !important;
}
.site-dialog__confirm--danger:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 12px 24px -10px rgba(201, 59, 74, 0.55) !important;
}
@keyframes site-dialog-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes site-dialog-rise {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .site-dialog-backdrop,
  .site-dialog {
    animation: none;
  }
}


/* Section cover image at the top of each course card (full width, inside the card's padding). */
.course-card__art {
  display: block;
  width: calc(100% + 32px);
  height: 132px;
  margin: -16px -16px 14px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

/* Theme toggle as an icon button (moon in light mode, sun in dark mode). */
.theme-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-icon-btn svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

/* Account menu shown in the header after sign-in */
.account-menu { position: relative; }
.account-menu__toggle { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.account-menu__panel[hidden] { display: none; }
.account-menu__who { margin: 0 0 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .account-menu__panel { left: 0; right: auto; max-width: calc(100vw - 32px); }
}
.account-menu__panel a,
.account-menu__logout {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu__panel a:hover,
.account-menu__logout:hover { background: var(--brand-soft); }
.account-menu__logout:disabled { opacity: 0.6; cursor: default; }

/* Header search: pill with the shortcut keys */
.header-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.header-search:hover { border-color: var(--accent); }
.header-search__icon { display: inline-flex; color: var(--muted); }
.header-search__keys { display: inline-flex; gap: 4px; margin-left: 6px; }
.header-search kbd {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
.search-palette {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 16px;
  background: rgba(10, 12, 24, 0.55);
}
.search-palette__panel {
  width: min(640px, 100%);
  max-height: 70vh;
  overflow: auto;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.search-palette__input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.search-palette__results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.search-palette__results a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.search-palette__results a:hover,
.search-palette__results a:focus { background: var(--brand-soft); }
.search-palette__lecture { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.search-palette__title { font-weight: 700; }
.search-palette__section { grid-column: 2; color: var(--muted); font-size: 13px; }
.search-palette__empty, .search-palette__hint { margin: 10px 4px; color: var(--muted); font-size: 14px; }
.search-palette__hint[hidden] { display: none; }
@media (max-width: 900px) {
  .header-search__label, .header-search__keys { display: none; }
  .header-search { padding: 0 10px; }
}

/* Pricing: plan comparison grid */
.pricing-compare { margin: 40px 0 8px; }
.compare__title { margin: 0 0 4px; font-size: 26px; }
.compare__lead { margin: 0 0 18px; color: var(--muted); }
.compare {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.compare__row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(2, minmax(120px, 1fr));
  align-items: center;
  border-top: 1px solid var(--border);
}
.compare__row:first-child { border-top: 0; }
.compare__row--head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}
.compare__cell {
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  text-align: center;
}
.compare__cell--feature { text-align: left; font-weight: 700; }
.compare__cell--plan {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.compare__row--head .compare__cell--plan.is-featured,
.compare__cell.is-featured { background: var(--brand-soft); }
.compare__row--head .compare__cell--plan.is-featured { color: var(--accent); }
.compare__mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; font-size: 16px; font-weight: 800; }
.compare__mark--yes { background: rgba(22, 163, 74, 0.14); color: #15803d; }
.compare__mark--no { color: var(--muted); }
.compare__cell:not(.compare__cell--feature):not(.compare__cell--plan) { font-size: 14px; color: var(--muted); }
.compare__cell:not(.compare__cell--feature) .compare__mark { color: inherit; }
@media (max-width: 700px) {
  .compare__row--head { display: none; }
  .compare__row {
    grid-template-columns: 1fr;
    padding: 6px 0;
  }
  .compare__cell--feature { padding-bottom: 4px; font-size: 16px; }
  .compare__cell:not(.compare__cell--feature) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    text-align: right;
  }
  .compare__cell:not(.compare__cell--feature)::before {
    content: attr(data-plan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }
}

/* Pricing: Monthly / Annual switch */
.billing-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.billing-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.billing-switch__btn:hover { color: var(--text); }
.billing-switch__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.billing-switch__btn.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}
.billing-switch__badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.16);
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
}
.billing-switch__btn.is-active .billing-switch__badge { background: rgba(255, 255, 255, 0.22); color: #fff; }
.billing-switch__note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.billing-toggle-host { display: flex; flex-direction: column; align-items: center; margin: 8px 0 24px; text-align: center; }

/* Pricing: recommended badge and highlighted benefits */
.plan { position: relative; }
.plan.featured { border-color: rgba(79, 70, 229, 0.45); }
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, #6366f1, #8b5cf6 55%, #ec4899);
  background-size: 200% 100%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
  animation: plan-badge-shine 4s ease-in-out infinite;
}
@keyframes plan-badge-shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.plan-highlights {
  display: grid;
  gap: 8px;
  margin: 4px 0 8px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.22);
}
.plan-highlights__title {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.plan-highlight { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--text); }
.plan-highlight__icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}
.plan-list { opacity: 0.92; }
@media (prefers-reduced-motion: reduce) {
  .plan-badge { animation: none; }
}

/* Pricing: price breakdown on each card */
.price-breakdown {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--bg, transparent);
  font-size: 14px;
}
.price-breakdown__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.price-breakdown__row--tax { font-size: 13px; }
.price-breakdown__row--total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.price-breakdown__row--total strong { font-size: 18px; color: var(--accent); }

/* Pricing: plan name and Recommended badge on one line */
.plan-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.plan-title-row h2 { margin: 0; }

/* Sign-in options: Remember me and Forgot password */
.auth-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 8px; }
.auth-remember { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.auth-remember input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-forgot { font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }

/* User settings page: profile and security */
.settings { max-width: 760px; margin: 0 auto; display: grid; gap: 28px; }
.settings__section { display: grid; gap: 16px; }
.settings__title { margin: 0; font-size: 22px; font-weight: 800; }
.settings__form { display: grid; gap: 16px; }
.settings__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings__form .field input[readonly] { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.settings__plan { margin: 0; }
.settings__save { justify-self: start; min-width: 96px; }
.settings__section + .settings__section { border-top: 1px solid var(--border); padding-top: 28px; }
.settings__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; flex-wrap: wrap; }
.settings__label { font-size: 16px; font-weight: 600; }
.settings__action { min-width: 180px; }
.settings__switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #9ca3af;
  opacity: 0.7;
}
.settings__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
}
.settings__soon { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .settings__pair { grid-template-columns: 1fr; }
  .settings__action { min-width: 0; }
}

/* User settings: profile header card and section cards */
.settings__hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(236, 72, 153, 0.07)), var(--surface);
  box-shadow: var(--shadow-lift);
}
.settings__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}
.settings__hero-info { min-width: 0; display: grid; gap: 4px; }
.settings__hero-name { margin: 0; font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.settings__hero-email { margin: 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.settings__badge {
  justify-self: start;
  margin-top: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.settings__section {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.settings__section + .settings__section { border-top: 1px solid var(--border); padding-top: 24px; }
.settings__title { margin: 0; font-size: 18px; font-weight: 800; }
@media (max-width: 640px) {
  .settings__hero { flex-direction: column; text-align: center; }
  .settings__badge { justify-self: center; }
  .settings__section { padding: 18px; }
}

/* User settings: form fields and empty notices */
.settings .field { display: grid; gap: 6px; }
.settings .field label { font-size: 14px; font-weight: 600; color: var(--text); }
.settings input:not([type="checkbox"]) {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.settings input:focus { outline: 3px solid rgba(99, 102, 241, 0.35); outline-offset: 1px; border-color: var(--accent); }
.settings .notice:empty { display: none; }

/* Two-factor authentication */
.twofactor { display: grid; gap: 12px; }
.twofactor__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.twofactor__state { padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.twofactor__panel { display: grid; gap: 12px; }
.twofactor__setup { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.twofactor__qr { border-radius: 14px; border: 1px solid var(--border); background: #fff; padding: 8px; }
.twofactor__key { margin: 0; word-break: break-all; }
.twofactor__key code { font-size: 14px; }
.twofactor__codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.twofactor__codes li { padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--border); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; background: var(--bg); }
@media (max-width: 640px) {
  .twofactor__setup { grid-template-columns: 1fr; }
  .twofactor__codes { grid-template-columns: 1fr; }
}

/* Change password card */
.pw-card { gap: 14px; }
.pw-form { display: grid; gap: 14px; }
.pw-field { gap: 6px; }
.pw-control { position: relative; display: flex; align-items: center; }
.pw-control .pw-input { padding-right: 72px; }
.pw-toggle {
  position: absolute;
  right: 8px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pw-meter { display: grid; gap: 6px; }
.pw-meter__bar { display: block; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.pw-meter__fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 0.25s ease, background 0.25s ease; }
.pw-meter__fill--weak { background: #ef4444; }
.pw-meter__fill--fair { background: #f59e0b; }
.pw-meter__fill--strong { background: #16a34a; }
.pw-meter__label { font-size: 12px; font-weight: 700; color: var(--muted); }
.pw-rules { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 6px; border-radius: 12px; background: var(--bg); }
.pw-rule { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.pw-rule__mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); font-size: 12px; font-weight: 800; }
.pw-rule.is-met { color: var(--text); }
.pw-rule.is-met .pw-rule__mark { background: #16a34a; border-color: #16a34a; color: #fff; }
.pw-submit { justify-self: start; min-width: 180px; }
.notice--error { border-left-color: #ef4444; }

/* Billing page */
.billing { max-width: 880px; margin: 0 auto; display: grid; gap: 20px; }
.billing__card { display: grid; gap: 16px; padding: 24px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lift); }
.billing__summary { background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.06)), var(--surface); }
.billing__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.billing__title { margin: 0; font-size: 22px; font-weight: 800; }
.billing__title--small { font-size: 18px; }
.billing__status { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.billing__status--ok { background: rgba(22, 163, 74, 0.14); color: #15803d; }
.billing__status--warn { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.billing__status--muted { background: var(--bg); color: var(--muted); }
.billing__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.billing__fact { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.billing__fact dt { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.billing__fact dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.billing__promo { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--accent); font-weight: 600; }
.billing__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.billing__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.billing__table th, .billing__table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.billing__table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.billing__num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.billing__pill { padding: 2px 10px; border-radius: 999px; background: rgba(22, 163, 74, 0.14); color: #15803d; font-size: 12px; font-weight: 800; }

/* Billing: manage button */
.billing__manage { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Legal links under the sign-in and sign-up forms */
.auth-legal { margin: 4px 0 0; text-align: center; }

/* Link to Paddle, the payment processor */
.paddle-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; }
.paddle-link:hover { color: var(--accent); text-decoration: underline; }
.price-breakdown__row--tax span:last-child { font-style: italic; }

/* Pricing: yearly saving line */
.plan-save { display: inline-flex; align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: rgba(22, 163, 74, 0.14); color: #15803d; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }
.plan-equivalent { margin: 0; color: var(--muted); font-size: 14px; }

/* Empty notice slots take no space */
.notice:empty { display: none; }

/* Pricing: yearly price and saving on one line */
.plan-price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.plan-price-row .plan-price { margin: 0; }
.plan-price-row .plan-save { align-self: center; }

/* Checkout success: status card */
.checkout-page { display: grid; place-items: center; min-height: 60vh; padding: 40px 16px; }
.checkout-card {
  position: relative;
  width: min(560px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px 32px 32px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.06) 60%), var(--surface);
  box-shadow: var(--shadow-lift);
  text-align: center;
  overflow: hidden;
}
.checkout-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 220px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent 65%);
  pointer-events: none;
}
.checkout-card > * { position: relative; }
.checkout-card__icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.3);
}
.checkout-card__icon--pending { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.checkout-card__icon--success { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 14px 30px rgba(22, 163, 74, 0.35); }
.checkout-card__icon--lock { background: linear-gradient(135deg, #64748b, #334155); }
.checkout-card__icon--alert { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.checkout-card__spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: checkout-spin 0.9s linear infinite;
}
@keyframes checkout-spin { to { transform: rotate(360deg); } }
.checkout-card__kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.checkout-card__title { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.2; }
.checkout-card__lead { margin: 0; max-width: 42ch; color: var(--muted); font-size: 16px; line-height: 1.55; }
.checkout-track { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; gap: 12px; width: 100%; max-width: 320px; text-align: left; }
.checkout-track__step { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--muted); }
.checkout-track__dot { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg); }
.checkout-track__step.is-current { color: var(--text); }
.checkout-track__step.is-current .checkout-track__dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
.checkout-track__step.is-done { color: var(--text); }
.checkout-track__step.is-done .checkout-track__dot { background: #16a34a; border-color: #16a34a; }
.checkout-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.checkout-card__note { margin: 0; min-height: 0; font-size: 14px; color: var(--muted); }
.checkout-card__note:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .checkout-card__spinner { animation: none; }
}
@media (max-width: 640px) {
  .checkout-card { padding: 32px 22px 26px; }
  .checkout-card__title { font-size: 24px; }
}
.billing__notice { margin: 0; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.billing__notice--warn { background: rgba(245, 158, 11, 0.14); color: #92400e; border: 1px solid rgba(245, 158, 11, 0.35); }
