@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   flashBAC.ro -- Editorial design tokens
   No gradients. Solid ink-on-paper.
   ============================================================ */
:root {
  /* Type */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;

  /* Surfaces (neutral, near-white) */
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-dark: #1d1d1f;
  --bg-input: #ffffff;
  --bg-input-alt: #f2f2f1;
  --bg-section-alt: #f0f0ef;

  /* Lines */
  --neutral: #e8e8e6;
  --neutral-dark: #d2d2cf;
  --border: #e3e3e0;
  --border-light: #ececea;
  --border-card: #e3e3e0;
  --rule: #d9d9d6;
  --rule-soft: #e6e6e3;

  /* Ink */
  --text: #1d1d1f;
  --text-heading: #111113;
  --muted: #6e6e73;
  --muted-strong: #48484d;

  /* Accent (oxblood) */
  --primary: #b4332a;
  --primary-light: #faeae8;
  --primary-dark: #8a261f;
  --primary-ink: #5a1b16;

  /* States */
  --notice-bg: #faf6ec;
  --notice-border: #e8dcb8;

  /* Geometry */
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(27,26,24,.05);
  --shadow: 0 2px 6px rgba(27,26,24,.04), 0 12px 32px rgba(27,26,24,.06);
  --transition: .2s cubic-bezier(.25,.46,.45,.94);

  /* Hero / dark backgrounds (solid, no gradient) */
  --hero-bg: #1d1d1f;
  --hero-text: #f5f5f7;
  --hero-muted: rgba(245,245,247,.62);
  --hero-subtle: rgba(245,245,247,.08);

  font-size: 16px;
}

/* ====== DARK THEME ====== */
[data-theme="dark"] {
  --bg: #111113;
  --bg-card: #1b1b1d;
  --bg-dark: #060607;
  --bg-input: #202022;
  --bg-input-alt: #18181a;
  --bg-section-alt: #18181a;
  --neutral: #2c2c2e;
  --neutral-dark: #3c3c3f;
  --border: #2f2f31;
  --border-light: #242426;
  --border-card: #2c2c2e;
  --rule: #38383b;
  --rule-soft: #2c2c2e;
  --primary: #d8584c;
  --primary-light: #2a1614;
  --primary-dark: #f08074;
  --primary-ink: #f5f5f7;
  --text: #e6e6e8;
  --text-heading: #f5f5f7;
  --muted: #98989d;
  --muted-strong: #b4b4b9;
  --notice-bg: #1f1a10;
  --notice-border: #3a2f1a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow: 0 2px 6px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
  --hero-bg: #060607;
  --hero-text: #f5f5f7;
  --hero-muted: rgba(245,245,247,.5);
  --hero-subtle: rgba(245,245,247,.06);
}

/* ====== GIMFY THEME ====== */
[data-theme="gimfy"] {
  --bg: #f7f3f3;
  --bg-card: #ffffff;
  --bg-dark: #4a3a3a;
  --bg-input: #ffffff;
  --bg-input-alt: #f0e8e8;
  --bg-section-alt: #ede4e4;
  --neutral: #ead8d8;
  --neutral-dark: #c8aeae;
  --border: #d4bcbc;
  --border-light: #ebd8d8;
  --border-card: #d4bcbc;
  --rule: #4a3a3a;
  --rule-soft: #c8aeae;
  --primary: #6b4444;
  --primary-light: #f0e0e0;
  --primary-dark: #4a2828;
  --primary-ink: #2e1818;
  --text: #2e1818;
  --text-heading: #1f0f0f;
  --muted: #7a5e5e;
  --muted-strong: #5a4040;
  --notice-bg: #f5ebe6;
  --notice-border: #d4bcbc;
  --shadow-sm: 0 1px 2px rgba(74,58,58,.06);
  --shadow: 0 2px 6px rgba(74,58,58,.05), 0 12px 32px rgba(74,58,58,.07);
  --hero-bg: #4a3a3a;
  --hero-text: #fafafa;
  --hero-muted: rgba(255,255,255,.62);
  --hero-subtle: rgba(255,255,255,.1);
}
*,*::before,*::after{box-sizing:border-box}

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }

h1,h2,h3,h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
  color: var(--text-heading);
}
p { margin: 0 0 .6rem; color: var(--muted); line-height: 1.5; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .7rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: .3rem;
}

/* ====== USER BAR ====== */
.user-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: .6rem;
}
.user-bar > div {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.user-bar__email {
  font-size: .82rem;
  color: var(--hero-muted);
  font-weight: 500;
}
.user-bar__btn {
  border-color: var(--hero-subtle) !important;
  color: var(--hero-muted) !important;
  font-size: .78rem !important;
  padding: .35rem .8rem !important;
}
.user-bar__btn:hover {
  border-color: var(--hero-muted) !important;
  color: var(--hero-text) !important;
}

/* ====== HERO ====== */
.hero {
  padding: 2.5rem clamp(1.2rem, 3vw, 3rem) 2rem;
  background: var(--hero-bg);
  color: var(--hero-text);
  text-align: center;
}
.hero__inner {
  max-width: 960px;
  margin: 0 auto;
}
.hero__text {
  margin-bottom: .4rem;
}
.hero h1 {
  color: var(--hero-text);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: .2rem;
}
.hero .eyebrow { color: var(--hero-muted); }

/* ====== TAB NAV ====== */
.tab-nav {
  display: inline-flex;
  gap: .35rem;
  margin-top: 1.4rem;
  background: var(--hero-subtle);
  padding: .3rem;
  border-radius: 999px;
}
.tab-nav--icons {
  border-radius: var(--radius);
  gap: .2rem;
  padding: .35rem;
}
.tab-link {
  border: none;
  background: transparent;
  color: var(--hero-muted);
  font-weight: 600;
  font-size: .88rem;
  padding: .55rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}
.tab-nav--icons .tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .55rem .9rem;
  border-radius: 14px;
  font-size: .7rem;
  font-weight: 500;
  min-width: 64px;
}
.tab-nav--icons .tab-link svg {
  flex-shrink: 0;
  opacity: .7;
  transition: opacity var(--transition);
}
.tab-nav--icons .tab-link.active svg { opacity: 1; }
.tab-link:hover { color: var(--hero-text); }
.tab-link.active {
  background: var(--bg);
  color: var(--text-heading);
}
.tab-link--math {
  position: relative;
}
.tab-link--premium {
  position: relative;
}
.premium-chip {
  display: inline-block;
  vertical-align: middle;
  margin-left: .3rem;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--primary);
  color: #fff;
  padding: .12rem .5rem;
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
}

.tab-link__badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--primary);
  color: #fff;
  padding: .1rem .45rem;
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}
.tab-link__notif {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  background: #c9463d;
  color: #fff;
  border-radius: 999px;
  padding: 0 .3rem;
  line-height: 1;
  pointer-events: none;
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  border-radius: 999px;
  padding: .7rem 1.5rem;
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary.danger { background: #b5312a; }
.btn.secondary { background: var(--bg-dark); color: #fff; }
.btn.secondary:hover { opacity: .85; }
.btn.ghost {
  background: transparent;
  border: 1.5px solid var(--neutral-dark);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--text); }
.btn.ghost.danger { border-color: rgba(201,70,61,.35); color: var(--primary); }
.btn.small { padding: .5rem 1rem; font-size: .82rem; }
.btn:disabled { opacity: .4; cursor: default; }

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.btn-file {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--neutral);
  color: var(--bg-dark);
  padding: .5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: .82rem;
  font-family: inherit;
  transition: background var(--transition);
}
.btn-file:hover { background: var(--neutral-dark); }
.btn-file input { display: none; }

/* ====== LAYOUT ====== */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.8rem clamp(1.2rem, 3vw, 3rem) 3rem;
}
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: panel-in .4s cubic-bezier(.25,.46,.45,.94) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tab-panel.active { animation: none; }
}

/* Panels are open canvases now -- no card box, just breathing room. */
.panel {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(1.4rem, 4vw, 2.75rem) 0 0;
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-light);
}
.panel__header h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -.02em;
  line-height: 1.05;
  margin: 0 0 .25rem;
}
.panel__header p { margin: 0; }
.panel__actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ====== EDIT NOTICE ====== */
.edit-notice {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: var(--radius);
  padding: .7rem 1.1rem;
  margin-bottom: 1.2rem;
  font-size: .9rem;
}
.edit-notice__badge {
  background: var(--primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .2rem .6rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.edit-notice__title {
  flex: 1;
  font-weight: 600;
  color: var(--text-heading);
}

/* ====== AI IMPORT ====== */
.ai-import {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.ai-import__header {
  text-align: center;
  padding: 1.5rem 1.5rem .75rem;
}
.ai-import__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.ai-import__title svg {
  color: var(--primary);
  flex-shrink: 0;
}
.ai-import__desc {
  margin: .35rem 0 0;
  font-size: .85rem;
  color: var(--muted);
}
.ai-import__hint {
  margin: .5rem auto 0;
  max-width: 380px;
  font-size: .75rem;
  color: var(--muted);
  opacity: .7;
  line-height: 1.4;
}
.ai-import__body {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.ai-import__dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  width: 100%;
}
.ai-import__dropzone:hover,
.ai-import__dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.ai-import__dropzone svg {
  display: block;
  margin: 0 auto .5rem;
  opacity: .5;
}
.ai-import__dropzone p { margin: 0; font-size: .9rem; }
.ai-import__browse {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.ai-import__filename {
  display: inline-block;
  margin-top: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary);
}
.ai-import__camera-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-size: .82rem;
  padding: .45rem .9rem;
  margin-top: -.25rem;
}
.ai-import__previews {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.ai-preview-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg-dark);
}
.ai-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ai-preview-remove:hover {
  background: var(--primary);
}
.ai-preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: .6rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,.5);
  padding: 1px 0;
}

.ai-import__divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .8rem;
  width: 100%;
}
.ai-import__divider::before,
.ai-import__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.ai-import__textarea {
  width: 100%;
  padding: .75rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
  background: var(--bg-input);
  color: var(--text);
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.ai-import__textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.ai-import__submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-size: .95rem;
  padding: .7rem 1rem;
}
.ai-import__submit svg {
  flex-shrink: 0;
}
.ai-import__status {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  border-radius: 10px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  font-size: .85rem;
  color: var(--muted);
}
.ai-import__status.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.ai-import__status.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.ai-import__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ai-spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-import__status.error .ai-import__spinner,
.ai-import__status.success .ai-import__spinner { display: none; }

/* Uncertain field highlight */
.field-uncertain {
  position: relative;
}
.field-uncertain input,
.field-uncertain textarea {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
}
.field-uncertain::after {
  content: 'AI nesigur. Verifica!';
  position: absolute;
  top: 0;
  right: 0;
  font-size: .7rem;
  font-weight: 600;
  color: #d97706;
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 6px;
}

/* Welcome empty state */
.welcome-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}
.welcome-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
}
.welcome-empty h3 {
  margin: 0 0 .4rem;
  color: var(--text-heading);
  font-size: 1.1rem;
}
.welcome-empty p {
  margin: 0 0 1rem;
  font-size: .9rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ====== FORM WIZARD ====== */
.form-wizard { display: flex; flex-direction: column; gap: 1.2rem; }

.stepper-head {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .2rem;
}
.step-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: .5rem 1rem;
  background: var(--neutral);
  font-weight: 600;
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.08);
  font-size: .75rem;
  font-weight: 700;
}
.step-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.step-pill.active .step-num {
  background: var(--primary);
  color: #fff;
}

.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.stepper-nav {
  display: flex;
  justify-content: center;
  gap: .8rem;
  padding-top: .6rem;
}

/* ====== CARD ====== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.4rem;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.card h3 { color: var(--primary); font-size: 1.1rem; }

/* ====== FORM FIELDS ====== */
label {
  display: flex;
  flex-direction: column;
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  gap: .25rem;
}
.field-pair {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .6rem;
  align-items: end;
}
.label-sm { font-size: .72rem; }
.label-sm input {
  background: var(--bg-input-alt);
  border-color: var(--border);
}

input, textarea, select {
  padding: .65rem .85rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: .92rem;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
}
textarea { resize: vertical; min-height: 80px; }

/* ====== OPERA LIST ====== */
.opera-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  grid-column: 1 / -1;
}

.opera-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.3rem;
  border: 1.5px solid var(--border-card);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.opera-card:hover {
  border-color: var(--neutral-dark);
  box-shadow: var(--shadow-sm);
}
.opera-card__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .3rem 0 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  gap: .3rem;
  transition: color var(--transition);
}
.opera-card__toggle svg {
  transition: transform var(--transition);
}
.opera-card.expanded .opera-card__toggle svg {
  transform: rotate(180deg);
}
.opera-card__details {
  display: none;
}
.opera-card.expanded .opera-card__details {
  display: block;
}
.opera-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}
.opera-card__head h4 { font-size: 1.05rem; margin: 0; color: var(--text-heading); }
.opera-card__actions {
  display: flex;
  gap: .3rem;
  flex-shrink: 0;
}
.opera-card__actions button {
  background: none;
  border: 1.5px solid var(--neutral);
  border-radius: 10px;
  padding: .3rem .65rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--muted);
}
.opera-card__actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.opera-card__actions button.delete-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.opera-meta { font-size: .85rem; color: var(--muted); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.chip {
  background: var(--neutral);
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
}

.opera-steps { display: flex; flex-direction: column; gap: .6rem; margin-top: .4rem; }
.opera-step { border-top: 1px solid var(--border-light); padding-top: .5rem; }
.opera-step strong { color: var(--text-heading); font-size: .85rem; }
.detail-list {
  list-style: none;
  padding: 0;
  margin: .3rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.detail-list li { font-size: .85rem; color: var(--muted); line-height: 1.4; }
.detail-list strong { color: var(--primary-dark); font-weight: 600; }

/* ====== DYNAMIC COMP FIELDS ====== */
.comp-row {
  position: relative;
}
.comp-remove-btn {
  position: absolute;
  top: 0;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 1;
}
.comp-remove-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ====== DYNAMIC CARACTERIZARI FIELDS ====== */
.caracterizare-row {
  position: relative;
  padding: 1rem;
  margin-bottom: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft, rgba(0, 0, 0, .02));
}
.caracterizare-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.caracterizare-row__head label {
  flex: 1;
  margin: 0;
}
.caracterizare-row__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}
.caracterizare-row__grid label {
  margin: 0;
}
.caracterizare-remove-btn {
  position: static;
  flex-shrink: 0;
}
.caracterizare-detail {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--border);
}
.caracterizare-detail:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.caracterizare-detail > strong {
  display: block;
  margin-bottom: .35rem;
  color: var(--primary-dark);
}

/* ====== FLASHCARD ====== */
.fc-toolbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
/* ====== OPERA MULTISELECT ====== */
.opera-multiselect {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.opera-multiselect__trigger {
  width: 100%;
  text-align: left;
  padding: .55rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opera-multiselect__trigger:hover { border-color: var(--primary); }
.opera-multiselect__trigger:disabled { opacity: .5; cursor: default; }
.opera-multiselect__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 20;
  padding: .3rem 0;
}
.opera-multiselect__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text);
  transition: background var(--transition);
}
.opera-multiselect__item:hover { background: var(--bg-tertiary); }
.opera-multiselect__item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.opera-multiselect__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opera-multiselect__empty {
  padding: .6rem .75rem;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}
.fc-toggles {
  display: flex;
  gap: .8rem;
  align-items: center;
}

/* ====== QUIZ MODE ====== */
.fc-quiz-options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .8rem;
}
.quiz-option {
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: .7rem 1rem;
  color: #f0e9e0;
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  transition: all var(--transition);
}
.quiz-option:hover:not(.quiz-option--locked) {
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.12);
}
.quiz-option--correct {
  border-color: #4caf50 !important;
  background: rgba(76,175,80,.2) !important;
  color: #a5d6a7 !important;
}
.quiz-option--wrong {
  border-color: #ef5350 !important;
  background: rgba(239,83,80,.15) !important;
  color: #ef9a9a !important;
}
.quiz-option--locked {
  cursor: default;
  opacity: .7;
}
.quiz-option--locked.quiz-option--correct,
.quiz-option--locked.quiz-option--wrong { opacity: 1; }

.fc-quiz-score {
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin: .6rem 0 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.toggle input[type='checkbox'] {
  width: 40px;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--neutral-dark);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  background: var(--bg);
  transition: all var(--transition);
  flex-shrink: 0;
}
.toggle input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--neutral-dark);
  transition: transform var(--transition), background var(--transition);
}
.toggle input[type='checkbox']:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle input[type='checkbox']:checked::after {
  transform: translateX(18px);
  background: #fff;
}

.fc-card {
  perspective: 1000px;
  min-height: 220px;
  position: relative;
  cursor: pointer;
}
.fc-card__inner {
  position: relative;
  width: 100%;
  min-height: 220px;
  transition: transform .6s ease;
  transform-style: preserve-3d;
}
.fc-card.no-flip-transition .fc-card__inner {
  transition: none;
}
.fc-card.flipped .fc-card__inner {
  transform: rotateY(180deg);
}
.fc-card__front,
.fc-card__back {
  background: var(--bg-dark);
  color: #f0e9e0;
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.8rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .8rem;
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.fc-card__back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transform: rotateY(180deg);
}
.fc-card__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,255,255,.35);
  margin: 0;
}
.fc-card__prompt {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  line-height: 1.4;
  margin: 0;
  color: #faf6f1;
}
.fc-card__answer {
  font-size: .95rem;
  line-height: 1.55;
  color: #d4ccc3;
  white-space: pre-line;
  margin: 0;
}
.fc-card__answer-text {
  font-size: .95rem;
  line-height: 1.55;
  color: #d4ccc3;
  white-space: pre-line;
  margin: 0;
}

.fc-actions {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 1rem;
}
.fc-actions .btn { min-width: 0; }
.fc-counter {
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
  margin-top: .8rem;
}

/* ====== FLASHCARD GATE ====== */
.fc-gate {
  text-align: center;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}
.fc-gate__lock {
  color: var(--muted);
  opacity: .5;
  margin-bottom: .4rem;
}
.fc-gate h2 {
  margin-bottom: .2rem;
}
.fc-gate > p {
  max-width: 420px;
  line-height: 1.55;
}
.fc-gate__buttons {
  display: flex;
  gap: .6rem;
  margin-top: .6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.fc-gate__status {
  font-size: .85rem;
  margin-top: .6rem;
  min-height: 1.3em;
}
.fc-gate__status.error { color: var(--primary); }
.fc-gate__status.success { color: #2e7d32; }
.fc-gate__status.loading { color: var(--muted); }

.fc-content { display: flex; flex-direction: column; }

/* ====== SUBSCRIPTION ====== */
.fc-subscription {
  display: flex;
  justify-content: center;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--neutral);
}

/* ====== CONFIRM / AUTH DIALOG ====== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}
.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow);
  text-align: center;
}
.confirm-dialog p {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1.4rem;
  line-height: 1.45;
}
.confirm-actions {
  display: flex;
  gap: .6rem;
  justify-content: center;
}

/* ====== AUTH DIALOG ====== */
.auth-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow);
  position: relative;
}
.auth-close {
  position: absolute;
  top: .8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: .2rem;
  transition: color var(--transition);
}
.auth-close:hover { color: var(--text); }
.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
  padding-top: .15rem;
}
.auth-brand__icon {
  display: block;
  height: 52px;
  width: auto;
  aspect-ratio: 1024 / 682;
  object-fit: contain;
}
.auth-tabs {
  display: flex;
  gap: .3rem;
  background: var(--neutral);
  border-radius: 999px;
  padding: .25rem;
  margin-bottom: 1.4rem;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: .55rem .8rem;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--muted);
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.auth-form .btn {
  margin-top: .4rem;
  width: 100%;
}
.auth-status {
  font-size: .85rem;
  text-align: center;
  min-height: 1.3em;
  margin-top: .6rem;
  margin-bottom: 0;
}
.auth-status.error { color: var(--primary); }
.auth-status.success { color: #2e7d32; }
.auth-status.loading { color: var(--muted); }

.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-bottom: .85rem;
}
.auth-google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 600;
}
.auth-google-btn:hover {
  background: #f8f9fa;
  border-color: #c6c9cc;
}
.auth-google-btn__icon {
  flex-shrink: 0;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  text-transform: lowercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-form__row {
  display: flex;
  justify-content: flex-end;
  margin-top: -.25rem;
}
.auth-form__hint {
  margin: 0 0 .2rem;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--muted);
}
.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .8rem;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
}
.auth-link-btn--block {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: .35rem;
}
.auth-link-btn:hover { opacity: .85; }

/* ====== PREMIUM BANNER ====== */
.premium-banner {
  background: var(--hero-bg);
  padding: clamp(2.25rem, 4vw, 3rem) clamp(1.2rem, 3vw, 3rem);
  text-align: center;
  border-radius: var(--radius-lg);
  max-width: 1100px;
  margin: 0 auto 2rem;
  width: calc(100% - 2rem);
}
.premium-banner__inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}
.premium-banner__text h2 {
  color: var(--hero-text);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.2;
  margin-bottom: .4rem;
}
.premium-banner__text p {
  color: var(--hero-muted);
  margin: 0;
}
.premium-banner__text .eyebrow {
  color: var(--hero-muted);
}
.premium-banner__buttons {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  justify-content: center;
}
.premium-banner__buttons .btn.ghost {
  border-color: var(--hero-subtle, rgba(255,255,255,.25));
  color: var(--hero-muted, #ccc);
}
.premium-banner__buttons .btn.ghost:hover {
  border-color: var(--hero-muted, #ddd);
  color: var(--hero-text, #fff);
}
.premium-btn {
  padding: .85rem 2.4rem;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(201,70,61,.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.premium-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201,70,61,.45);
}

/* ====== FOOTER ====== */
footer {
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
  font-size: .8rem;
  border-top: 1px solid var(--neutral);
  margin-top: 1rem;
}
.footer__credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .5rem;
  font-size: .78rem;
  color: var(--muted);
}
.footer__credit a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition);
}
.footer__credit a:hover { opacity: .7; }
.footer__logo {
  height: 18px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

/* ====== NAVBAR ====== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.navbar__inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem clamp(1rem, 3vw, 2rem);
}

@media (min-width: 1400px) {
  .navbar__inner {
    max-width: none;
    margin: 0;
    padding-left: clamp(1rem, 2vw, 3rem);
    padding-right: clamp(1rem, 2vw, 3rem);
  }
}
.navbar__logo {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
  cursor: pointer;
}
.navbar__right {
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* ====== PROFILE DROPDOWN ====== */
.profile-dropdown {
  position: relative;
}
.profile-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: .3rem .7rem .3rem .3rem;
  cursor: pointer;
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.profile-dropdown__trigger:hover {
  border-color: var(--primary);
  background: var(--neutral);
}
.profile-dropdown__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .78rem;
  flex-shrink: 0;
}
.profile-dropdown__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .8rem;
  min-width: 220px;
  z-index: 200;
}
.profile-dropdown__email {
  font-size: .78rem;
  color: var(--muted);
  margin: 0 0 .6rem;
  word-break: break-all;
}
.profile-dropdown__section {
  margin-bottom: .6rem;
}
.profile-dropdown__label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin: 0 0 .35rem;
}
.profile-dropdown__divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: .5rem 0;
}
.profile-dropdown__logout {
  width: 100%;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .45rem .8rem;
  font-family: inherit;
  font-size: .82rem;
  color: var(--primary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-align: center;
}
.profile-dropdown__logout:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.profile-dropdown__logout.premium-glow {
  border-color: #d4649a;
  color: #d4649a;
}

/* ====== THEME SWITCHER ====== */
.theme-switcher {
  display: flex;
  gap: .25rem;
  background: var(--neutral);
  padding: .2rem;
  border-radius: 999px;
}
.theme-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  background: transparent;
}
.theme-btn::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: block;
}
.theme-btn[data-theme-val="default"]::after { background: #c9463d; }
.theme-btn[data-theme-val="dark"]::after { background: #333; }
.theme-btn[data-theme-val="gimfy"]::after { background: #846A6A; }
.theme-btn.active {
  border-color: var(--primary);
  background: var(--bg-card);
}

/* ====== NAVBAR AUTH ====== */
.nav-login-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .45rem 1.1rem;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}
.nav-login-btn:hover { background: var(--primary-dark); }

/* ====== LANDING PAGE ====== */
.landing { overflow: hidden; }

.landing-hero {
  background: var(--hero-bg);
  padding: clamp(3rem, 8vw, 6rem) clamp(1.2rem, 3vw, 3rem) clamp(4rem, 9vw, 7rem);
  position: relative;
}
.premium-badge {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .35rem 1.2rem;
  border-radius: 999px;
  background: var(--bg-dark);
  color: var(--bg);
  font-weight: 700;
  letter-spacing: .08em;
  font-size: .75rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  animation: premium-pulse 5s ease-in-out infinite;
}
@keyframes premium-pulse {
  0%,100% { filter: drop-shadow(0 0 10px rgba(255,255,255,.4)); opacity: 1; }
  50% { filter: drop-shadow(0 0 18px rgba(255,255,255,.5)); opacity: .8; }
}
.landing-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: clamp(30px, 5vw, 60px);
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

[data-theme="dark"] .landing-hero {
  background: #1a1a1f;
}
.landing-hero h1 {
  color: var(--hero-text);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  line-height: 1.05;
  margin: 0 0 1.2rem;
  letter-spacing: -.02em;
}
.landing-hero__sub {
  color: var(--hero-muted);
  font-size: clamp(.92rem, 1.6vw, 1.05rem);
  max-width: 380px;
  margin: 0 0 1.8rem;
  line-height: 1.6;
}
.landing-cta-group {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.landing-cta-group .btn { padding: .75rem 2rem; font-size: .95rem; }
.landing-cta-group .landing-quick-link {
  padding: .55rem 1rem;
  font-size: .82rem;
}
.landing-cta-group .btn.ghost {
  border-color: var(--hero-subtle);
  color: var(--hero-muted);
}
.landing-cta-group .btn.ghost:hover {
  border-color: var(--hero-muted);
  color: var(--hero-text);
}

/* ====== LANDING QUICK LINKS ====== */
.landing-quick-links {
  display: flex;
  gap: .6rem;
  justify-content: center;
  margin-top: 1.2rem;
}
.landing-quick-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  color: var(--hero-muted);
  cursor: pointer;
  transition: all .2s;
}
.landing-quick-link:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.3);
  color: var(--hero-text);
  transform: translateY(-1px);
}

/* ====== SCROLL REVEAL ANIMATION ====== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ====== LANDING HERO ANIMATIONS ====== */
.landing-hero h1 {
  animation: slideUp .8s cubic-bezier(.22,1,.36,1) both;
}
.landing-hero__sub {
  animation: slideUp .8s cubic-bezier(.22,1,.36,1) .15s both;
}
.landing-cta-group {
  animation: slideUp .8s cubic-bezier(.22,1,.36,1) .3s both;
}
.landing-quick-links {
  animation: fadeIn .8s cubic-bezier(.22,1,.36,1) .45s both;
}
.bac-countdown {
  animation: slideUp .8s cubic-bezier(.22,1,.36,1) .5s both;
}
.bac-countdown--inline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1.2rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--hero-muted);
  font-size: .75rem;
}
.bac-countdown--inline svg {
  color: var(--hero-muted);
  flex-shrink: 0;
  opacity: .7;
}
.bac-countdown__inline-text strong {
  color: var(--hero-text);
  font-family: var(--font-heading);
  font-size: .88rem;
}
.landing-hero__right {
  animation: slideUp .8s cubic-bezier(.22,1,.36,1) .55s both;
}
.landing-flashcard-preview {
  animation: slideUp .8s cubic-bezier(.22,1,.36,1) .4s both;
}

/* Hero two-column layout */
.landing-hero__row {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 1000px;
  margin: 0 auto;
}
.landing-hero__left {
  flex: 1;
  text-align: left;
  min-width: 0;
}
.landing-hero__right {
  width: 340px;
  flex-shrink: 0;
  text-align: left;
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.08);
}
.hero-leaderboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .8rem;
  gap: .5rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.hero-leaderboard__title {
  margin: 0;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}
.landing-hero__right .landing-leaderboard__tabs {
  margin-bottom: 0;
}
.landing-hero__right .landing-leaderboard__tab {
  font-size: .65rem;
  padding: .25rem .65rem;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.12);
}
.landing-hero__right .landing-leaderboard__tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.landing-hero__right .landing-leaderboard__tab:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.landing-hero__right .landing-leaderboard__list {
  max-height: 280px;
  overflow-y: auto;
}
/* Row overrides inside hero */
.landing-hero__right .lb-row {
  background: transparent;
  border-radius: 10px;
  padding: .5rem .6rem;
  margin-bottom: 2px;
  transition: background .15s;
}
.landing-hero__right .lb-row:hover {
  background: rgba(255,255,255,.06);
}
.landing-hero__right .lb-row--gold {
  background: rgba(251,191,36,.1);
}
.landing-hero__right .lb-row--silver {
  background: rgba(148,163,184,.08);
}
.landing-hero__right .lb-row--bronze {
  background: rgba(180,83,9,.08);
}
.landing-hero__right .lb-rank {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
}
.landing-hero__right .lb-row--gold .lb-rank {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.4);
}
.landing-hero__right .lb-row--silver .lb-rank {
  background: #94a3b8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(148,163,184,.3);
}
.landing-hero__right .lb-row--bronze .lb-rank {
  background: #b45309;
  color: #fff;
  box-shadow: 0 2px 8px rgba(180,83,9,.3);
}
.landing-hero__right .lb-name {
  color: #fff;
  font-weight: 600;
  font-size: .88rem;
}
.landing-hero__right .lb-score {
  color: #fbbf24;
  font-size: .95rem;
  font-weight: 700;
}
.landing-hero__right .lb-unit {
  color: rgba(255,255,255,.5);
}
.landing-hero__right .lb-empty {
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  padding: 1rem 0;
  text-align: center;
}
.landing-hero__right .lb-more {
  color: rgba(255,255,255,.4);
  font-size: .75rem;
  text-align: center;
  padding: .4rem 0;
}
.hero-leaderboard__cta {
  margin: .7rem 0 0;
  padding-top: .6rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .78rem;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  text-align: center;
}

/* Dark theme hero leaderboard */
[data-theme="dark"] .landing-hero__right {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}

/* Gimfy theme hero leaderboard */
[data-theme="gimfy"] .landing-hero__right {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 8px 32px rgba(132,106,106,.3), inset 0 1px 0 rgba(255,255,255,.12);
}
[data-theme="gimfy"] .landing-hero__right .lb-score {
  color: #fcd34d;
}

@media (max-width: 768px) {
  .landing-hero__row {
    flex-direction: column;
    text-align: center;
  }
  .landing-hero__left { text-align: center; }
  .landing-hero__right { width: 100%; max-width: 400px; }
}

/* ====== HOW IT WORKS ====== */
.landing-how {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem clamp(1.2rem, 3vw, 3rem) 1.5rem;
}
.landing-how h2 {
  text-align: center;
  margin-bottom: .3rem;
}
.landing-how__sub {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 1.5rem;
}

/* ====== DEMO PREVIEW ====== */
.landing-demo {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem clamp(1.2rem, 3vw, 3rem) 2.5rem;
  text-align: center;
}
.landing-demo h2 { margin-bottom: .3rem; }
.landing-demo__sub {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 1.5rem;
}
.landing-demo__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}
.landing-demo__card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  position: relative;
  transition: transform .25s, box-shadow .25s;
}
.landing-demo__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}
.landing-demo__badge {
  position: absolute;
  top: -.55rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .15rem .55rem;
  border-radius: 999px;
}
.landing-demo__mockup {
  margin: .8rem 0;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-demo__card h4 {
  margin: 0 0 .2rem;
  font-size: .9rem;
}
.landing-demo__card p {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
}
/* Demo mockups */
.demo-upload-mock {
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1rem;
  width: 100%;
  text-align: center;
}
.demo-upload-mock p {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  margin: .4rem 0 .3rem;
}
.demo-tag {
  font-size: .65rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: .15rem .5rem;
  border-radius: 999px;
}
.demo-form-mock {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.demo-field {
  display: flex;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .35rem .6rem;
  font-size: .72rem;
}
.demo-field span:first-child {
  color: var(--muted);
  font-weight: 500;
}
.demo-field span:last-child {
  font-weight: 600;
  color: var(--text);
}
.demo-field--uncertain {
  border-color: #f59e0b;
  background: #fffbeb;
}
.demo-field--uncertain span:last-child { color: #d97706; }
.demo-quiz-mock {
  width: 100%;
  text-align: left;
}
.demo-q {
  font-size: .78rem;
  font-weight: 600;
  margin: 0 0 .4rem;
  color: var(--text);
}
.demo-opt {
  font-size: .72rem;
  padding: .3rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: .25rem;
  color: var(--text);
}
.demo-opt--correct {
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
}
.demo-opt--wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
  text-decoration: line-through;
  opacity: .7;
}
@media (max-width: 640px) {
  .landing-demo__steps { grid-template-columns: 1fr; gap: 1.5rem; }
}
.landing-how__grid {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.landing-how__step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  position: relative;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.landing-how__step:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}
.landing-how__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
}
.landing-how__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.landing-how__step h3 {
  font-size: .88rem;
  margin: 0;
  line-height: 1.3;
}
.landing-how__step p {
  font-size: .78rem;
  color: var(--muted);
  margin: .1rem 0 0;
  line-height: 1.4;
}
.landing-how__step-text {
  flex: 1;
  min-width: 0;
}

/* ====== PRICING SECTION ====== */
.landing-pricing {
  padding: 3rem clamp(1.2rem, 3vw, 3rem);
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}
.landing-pricing__title {
  margin-bottom: .3rem;
}
.landing-pricing__sub {
  color: var(--muted);
  font-size: .9rem;
  margin: 0 auto 2rem;
  max-width: 420px;
}
.landing-pricing__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  text-align: left;
}
.landing-pricing__plan {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .3s, box-shadow .3s;
}
.landing-pricing__plan:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.landing-pricing__plan--premium {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.landing-pricing__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .2rem .7rem;
  border-radius: 999px;
}
.landing-pricing__plan-header {
  margin-bottom: 1.2rem;
}
.landing-pricing__trial {
  font-size: .75rem;
  color: var(--primary);
  margin: .4rem 0 0;
  font-weight: 600;
}
.landing-pricing__plan-header h3 {
  font-size: 1.1rem;
  margin: 0 0 .3rem;
}
.landing-pricing__price {
  display: flex;
  align-items: baseline;
  gap: .2rem;
}
.landing-pricing__amount {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.landing-pricing__period {
  font-size: .85rem;
  color: var(--muted);
}
.landing-pricing__features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  flex: 1;
}
.landing-pricing__features li {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--border-light);
}
.landing-pricing__features li:last-child {
  border-bottom: none;
}
/* Feature icons */
.feat-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}
.feat-icon--yes {
  background: #dcfce7;
  color: #16a34a;
}
.feat-icon--yes::after { content: '\2713'; }
.feat-icon--no {
  background: #f3f4f6;
  color: #9ca3af;
}
.feat-icon--no::after { content: '\2015'; }
.feat-icon--star {
  background: #fef3c7;
  color: #d97706;
}
.feat-icon--star::after { content: '\2605'; }
.landing-pricing__features li.included svg,
.landing-pricing__features li.included .feat-icon {
  flex-shrink: 0;
}
.landing-pricing__features li.excluded {
  color: var(--muted);
}
.landing-pricing__features li.highlight {
  font-weight: 600;
  color: #d97706;
}

/* Price bump urgency banner */
.price-bump-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem 1rem;
  margin-bottom: 1.2rem;
  border-radius: 10px;
  background: #fef3c7;
  border: 1.5px solid #fbbf24;
  color: #92400e;
  font-size: .82rem;
  font-weight: 500;
  animation: pulseBanner 2s ease-in-out infinite;
}
.price-bump-banner svg { flex-shrink: 0; color: #d97706; }
@keyframes pulseBanner {
  0%,100% { box-shadow: 0 0 0 0 rgba(251,191,36,.3); }
  50% { box-shadow: 0 0 0 6px rgba(251,191,36,0); }
}
.landing-pricing__plan .btn {
  width: 100%;
  margin-top: auto;
}

/* ====== PANEL BACK BUTTON ====== */
.panel-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .8rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all .15s;
}
.panel-back-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ====== BAC COUNTDOWN ====== */
.bac-countdown {
  margin-top: 2rem;
  text-align: center;
}
.bac-countdown__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 600;
  color: var(--hero-muted);
  margin-bottom: .5rem;
}
.bac-countdown__timer {
  display: inline-flex;
  gap: .5rem;
}
.bac-countdown__unit {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: .5rem .7rem;
  min-width: 54px;
  text-align: center;
}
.bac-countdown__unit span {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--hero-text);
  line-height: 1.2;
}
.bac-countdown__unit small {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--hero-muted);
}
.bac-countdown--app {
  margin-top: .8rem;
  margin-bottom: .4rem;
}
.bac-countdown--app .bac-countdown__unit {
  padding: .35rem .5rem;
  min-width: 44px;
  border-radius: 10px;
}
.bac-countdown--app .bac-countdown__unit span {
  font-size: 1rem;
}
.bac-countdown--app .bac-countdown__label {
  font-size: .65rem;
  margin-bottom: .3rem;
}

/* ====== CATEGORY BAR ====== */
.category-bar {
  margin-bottom: 1.2rem;
}
.category-bar__add {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.category-bar__add input {
  flex: 1;
  padding: .5rem .75rem;
  font-size: .85rem;
}

/* ====== CATEGORY GROUPS ====== */
.cat-group {
  margin-bottom: 1.4rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.cat-group__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  background: var(--neutral);
  cursor: pointer;
}
.cat-group__toggle {
  background: none;
  border: none;
  padding: .2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: transform var(--transition), color var(--transition);
  flex-shrink: 0;
}
.cat-group__toggle:hover {
  color: var(--text);
}
.cat-group.collapsed .cat-group__toggle {
  transform: rotate(-90deg);
}
.cat-group.collapsed .cat-group__drop {
  display: none;
}
.cat-group__title {
  font-size: .88rem;
  margin: 0;
  flex: 1;
}
.cat-group__count {
  font-size: .72rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: .1rem .45rem;
  border-radius: 999px;
}
.cat-group__delete {
  background: none;
  border: 1.5px solid transparent;
  border-radius: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}
.cat-group__delete:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.cat-group__drop {
  padding: .8rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  transition: background var(--transition);
}
.cat-group__drop.drag-over {
  background: var(--primary-light);
}
.cat-group__empty {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  padding: .8rem 0;
  margin: 0;
  border: 2px dashed var(--border);
  border-radius: 12px;
}
.cat-group--default .cat-group__head {
  background: var(--bg-input-alt);
}
.opera-card.dragging {
  opacity: .4;
  transform: scale(.97);
}
.opera-card[draggable] {
  cursor: grab;
}
.opera-card[draggable]:active {
  cursor: grabbing;
}

/* ====== FC FILTER GROUP ====== */
.fc-filter-group {
  display: flex;
  gap: .5rem;
  flex: 1;
  min-width: 0;
}
.fc-filter-group .opera-multiselect {
  flex: 1;
  min-width: 140px;
}

/* ====== PREMIUM LOGIN ANIMATION ====== */
.navbar__logo {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.navbar__logo-badge {
  font-family: var(--font-heading);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
}
.navbar__logo-badge--premium {
  opacity: 1;
  transform: translateX(0);
}
.navbar__logo-badge--active {
  opacity: 1;
  transform: translateX(0);
  animation: premLoginIn .5s ease forwards, premLoginShimmer 2.5s linear infinite;
}
.navbar__logo-badge--morph {
  animation: premLoginMorph 1s ease forwards;
}
@keyframes premLoginIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes premLoginShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes premLoginMorph {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  50% { opacity: .7; transform: translateX(-8px) scale(.6); }
  100% { opacity: 0; transform: translateX(-20px) scale(0); }
}

/* ====== LANDING FLASHCARD PREVIEW ====== */
.landing-flashcard-preview {
  max-width: 520px;
  margin: -1rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}
.landing-flashcard-preview__hint {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .8rem;
}
.fc-card--preview {
  pointer-events: none;
}
.fc-card--preview .fc-card__front,
.fc-card--preview .fc-card__back {
  min-height: 160px;
  padding: 1.5rem;
}

/* ====== OPERA CARD SCORE BADGE ====== */
.opera-card__score {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: .1rem .45rem;
  border-radius: 999px;
  margin-left: .35rem;
  vertical-align: middle;
}

/* ====== OPERA CARD CATEGORY SELECT ====== */
.opera-card__cat-row {
  padding: .3rem 0;
}
.opera-card__cat-select {
  width: 100%;
  padding: .35rem .5rem;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.opera-card__cat-select:hover,
.opera-card__cat-select:focus {
  border-color: var(--primary);
  outline: none;
}

/* ====== FRIENDS PANEL ====== */
.friends-panel {
  max-width: 640px;
  margin: 0 auto;
}
.friends-section {
  margin-bottom: 2rem;
}
.friends-section h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-heading);
  margin: 0 0 .4rem;
}
.friends-section__desc {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 .8rem;
}
.friends-add {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.friends-add input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: .85rem;
}
.friends-add input:focus {
  border-color: var(--primary);
  outline: none;
}
.friends-add__status {
  font-size: .78rem;
  color: var(--muted);
  margin: .4rem 0 0;
  min-height: 1.2em;
}
.friends-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  transition: border-color var(--transition);
}
.friend-card:hover {
  border-color: var(--primary);
}
.friend-card__info {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}
.friend-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}
.friend-card__email {
  font-size: .85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-card__meta {
  font-size: .78rem;
  color: var(--muted);
}
.friend-card__actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.friend-card__opera-select {
  padding: .3rem .5rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: .75rem;
  max-width: 160px;
  cursor: pointer;
}
.friend-card__opera-select:focus {
  border-color: var(--primary);
  outline: none;
}

@media (max-width: 600px) {
  .friends-add { flex-direction: column; }
  .friends-add input { width: 100%; }
  .friend-card { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .friend-card__actions { width: 100%; justify-content: flex-start; }
}

/* ====== SUBSCRIPTION END INFO ====== */
.fc-subscription__end {
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  padding: .4rem 0;
}

/* ====== SUBSCRIPTION END BANNER ====== */
.sub-end-banner {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--notice-bg);
  border: 1.5px solid var(--notice-border);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  margin-bottom: 1rem;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.4;
}
.sub-end-banner__icon {
  flex-shrink: 0;
  color: var(--primary);
  display: flex;
}

/* ====== QUIZ RESULTS ====== */
.quiz-results {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}
.quiz-results__card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow);
}
.quiz-results__title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-heading);
  margin: 0 0 1.2rem;
}
.quiz-results__ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}
.quiz-results__ring {
  width: 100%;
  height: 100%;
}
.quiz-results__ring circle:last-child {
  transition: stroke-dashoffset .8s ease;
}
.quiz-results__pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
}
.quiz-results__score {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 .4rem;
}
.quiz-results__msg {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}
.quiz-results__actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.quiz-results__actions .btn {
  width: 100%;
}

/* ====== PROGRESS DASHBOARD ====== */
.progress-dash__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.progress-dash__card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}
.progress-dash__card-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0;
}
.progress-dash__card-sub {
  font-size: .78rem;
  color: var(--muted);
  margin: 0;
}
.progress-dash__ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: .2rem 0;
}
.progress-dash__ring {
  width: 100%;
  height: 100%;
}
.progress-dash__ring circle:last-child {
  transition: stroke-dashoffset .8s ease;
}
.progress-dash__ring-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}
.progress-dash__streak-num,
.progress-dash__today-num {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.progress-dash__section {
  margin-bottom: 2rem;
}
.progress-dash__section h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: .8rem;
  color: var(--text-heading);
}
.progress-dash__leitner-desc {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 .8rem;
}

/* Activity chart */
.progress-dash__chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: .5rem 0;
  border-bottom: 1.5px solid var(--border-light);
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 4px;
}
.chart-bar {
  width: 100%;
  max-width: 28px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .3s ease;
}
.chart-bar-label {
  font-size: .6rem;
  color: var(--muted);
  text-transform: uppercase;
}

/* Opera progress rows */
.opera-progress-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-light);
}
.opera-progress-row:last-child {
  border-bottom: none;
}
.opera-progress-row__info {
  flex: 1;
  min-width: 0;
}
.opera-progress-row__info strong {
  display: block;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opera-progress-row__meta {
  font-size: .72rem;
  color: var(--muted);
}
.opera-progress-row__bar-wrap {
  width: 120px;
  height: 8px;
  background: var(--neutral);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.opera-progress-row__bar {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .4s ease;
}
.opera-progress-row__pct {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-heading);
  min-width: 32px;
  text-align: right;
}
.opera-progress-row__detail {
  font-size: .68rem;
  color: var(--muted);
  min-width: 48px;
  text-align: right;
}

/* Leitner boxes */
.progress-dash__boxes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .6rem;
}
.leitner-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: .8rem .5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
}
.leitner-box__num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.leitner-box small {
  font-size: .68rem;
  color: var(--muted);
}
.leitner-box__hint {
  font-size: .6rem;
  color: var(--primary);
  opacity: .7;
}
.leitner-box[data-box="5"] {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ====== MOBILE TAB DROPDOWN ====== */
.tab-nav-mobile {
  display: none;
  margin: 1.2rem auto 0;
  width: 100%;
  max-width: 300px;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--hero-subtle);
  background: rgba(255,255,255,.08);
  color: var(--hero-text);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,.5)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.tab-nav-mobile option {
  background: var(--bg-card);
  color: var(--text);
}

/* ====== PROFILE DROPDOWN LINKS ====== */
.profile-dropdown__link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: none;
  padding: .5rem .6rem;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--transition);
  text-align: left;
  position: relative;
  text-decoration: none;
  box-sizing: border-box;
}
.profile-dropdown__link:hover {
  background: var(--neutral);
}
.profile-dropdown__link svg {
  flex-shrink: 0;
  color: var(--muted);
}
.profile-dropdown__link--premium {
  color: var(--primary);
}
.profile-dropdown__link--premium svg {
  color: var(--primary);
}
.profile-dropdown__notif {
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  background: #c9463d;
  color: #fff;
  border-radius: 999px;
  padding: 0 .25rem;
  line-height: 1;
  margin-left: auto;
}

/* ====== PROFILE TRIGGER BADGE ====== */
.profile-trigger__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  background: #c9463d;
  color: #fff;
  border-radius: 999px;
  padding: 0 .25rem;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

/* ====== COMBINED PROGRESS SUMMARY ====== */
.progress-dash__summary {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-evenly;
  gap: 1rem;
  padding: .8rem 1.2rem;
}
.progress-dash__summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .25rem;
  flex: 1;
  min-width: 0;
}
.progress-dash__stat-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.progress-dash__stat-label {
  font-size: .65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ====== OPERA PROGRESS SHOW ALL ====== */
.opera-progress-show-all {
  display: flex;
  justify-content: center;
  margin-top: .6rem;
}
.opera-progress-show-all button {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: .4rem 1.2rem;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}
.opera-progress-show-all button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ====== SESSION START / QUIT ====== */
.fc-start-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  padding: 2.5rem 1rem;
  text-align: center;
}
.fc-start-hint {
  font-size: .88rem;
  color: var(--muted);
  margin: 0;
  max-width: 400px;
}
.fc-start-wrap .btn {
  padding: .7rem 2.5rem;
  font-size: .95rem;
}
.fc-session {
  position: relative;
}
.fc-quit-btn {
  display: block;
  margin: 0 auto 1rem auto;
  z-index: 2;
  font-size: .8rem !important;
  padding: .4rem 1.2rem !important;
  border: 1.5px solid var(--primary) !important;
  color: var(--primary) !important;
  background: transparent !important;
  border-radius: 6px;
  opacity: .85;
  transition: opacity var(--transition), background var(--transition);
}
.fc-quit-btn:hover {
  opacity: 1;
  background: var(--primary-light) !important;
}

/* ====== PUBLIC SUGGESTIONS LIST ====== */
.sug-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1.2rem;
}
.sug-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color .2s, box-shadow .2s;
}
.sug-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.sug-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  flex-shrink: 0;
  min-width: 42px;
  padding-top: .15rem;
}
.sug-votes__btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .8rem;
  transition: all .2s;
  padding: 0;
}
.sug-votes__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.1);
}
.sug-votes__btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201,70,61,.25);
}
.sug-votes__btn.active-down {
  background: #6c757d;
  border-color: #6c757d;
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,117,125,.25);
}
.sug-votes__count {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.sug-body {
  flex: 1;
  min-width: 0;
}
.sug-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .74rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.sug-meta strong {
  color: var(--text);
  font-weight: 600;
  font-size: .78rem;
}
.sug-badge {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--neutral);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.sug-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.sug-badge--implemented { background: #d4edda; color: #155724; }
.sug-badge--planned { background: #cce5ff; color: #004085; }
.sug-badge--rejected { background: var(--primary-light); color: var(--primary); }
.sug-text {
  font-size: .88rem;
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.sug-admin {
  display: flex;
  gap: .4rem;
  margin-top: .55rem;
  flex-wrap: wrap;
  padding-top: .45rem;
  border-top: 1px solid var(--border-light);
}
.sug-admin .btn {
  font-size: .65rem;
  padding: .25rem .55rem;
}
.suggestions-panel__sub {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 .8rem;
  line-height: 1.5;
}

/* ====== FLIP COMPLETE ====== */
.flip-complete {
  text-align: center;
  padding: 2rem 1rem;
}
.flip-complete__card {
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}
.flip-complete__icon {
  margin-bottom: .4rem;
}
.flip-complete__title {
  font-size: 1.5rem;
  margin: 0;
}
.flip-complete__msg {
  color: var(--muted);
  margin: 0;
}
.flip-complete__count {
  font-weight: 600;
  color: var(--text-heading);
  font-size: .9rem;
  margin: 0;
}
.flip-complete__actions {
  display: flex;
  gap: .5rem;
  margin-top: .8rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ====== SUGGESTIONS PANEL ====== */
.suggestions-panel {
  max-width: 620px;
  margin: 0 auto;
}
.suggestions-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
}
.suggestions-header h2 {
  margin: 0;
}
.suggestions-incentive {
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  font-size: .88rem;
  color: var(--text);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}
.suggestion-form {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.suggestion-form .btn {
  align-self: flex-start;
}
.suggestion-status {
  font-size: .85rem;
  min-height: 1.3em;
}
.suggestion-status.success { color: #2e7d32; }
.suggestion-status.error { color: var(--primary); }

/* ====== MOBILE BOTTOM TAB BAR ====== */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: .35rem .2rem calc(.35rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: .6rem;
  font-weight: 500;
  padding: .3rem .2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: color var(--transition);
  min-width: 0;
  flex: 1;
}
.mobile-tab svg {
  flex-shrink: 0;
  opacity: .6;
  transition: opacity var(--transition);
}
.mobile-tab.active {
  color: var(--primary);
}
.mobile-tab.active svg {
  opacity: 1;
  stroke: var(--primary);
}
.mobile-tab--math.active {
  color: var(--primary);
}
.mobile-tab--math.active svg {
  stroke: var(--primary);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .hero { padding: 2rem 1rem 1.6rem; }
  .hero h1 { font-size: 1.4rem; }

  .tab-nav {
    display: none;
  }
  .tab-nav-mobile {
    display: none;
  }
  .mobile-tab-bar {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
  }

  main { padding: 1.2rem .9rem 2rem; }
  .panel { padding: .85rem 0 0; border-radius: 0; }

  .panel__header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .panel__actions {
    justify-content: center;
    width: 100%;
  }

  .stepper-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
  }
  .step-pill {
    font-size: .75rem;
    padding: .45rem .7rem;
    justify-content: center;
    text-align: center;
  }
  .step-num { width: 20px; height: 20px; font-size: .7rem; }

  .stepper-nav { flex-wrap: wrap; }
  .stepper-nav .btn { flex: 1; min-width: 120px; }

  .field-pair { grid-template-columns: 1fr; }
  .card { padding: 1rem; }

  .opera-list { grid-template-columns: 1fr; }
  .opera-card { padding: 1rem; }
  .opera-card__head { flex-direction: column; gap: .4rem; }
  .opera-card__actions { align-self: flex-end; }

  .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .opera-multiselect { width: 100%; min-width: 0; }
  .fc-toggles { width: 100%; justify-content: center; }
  .toggle { justify-content: center; }

  .fc-card { min-height: 180px; }
  .fc-card__inner { min-height: 180px; }
  .fc-card__front, .fc-card__back { padding: 1.4rem 1.2rem; min-height: 180px; border-radius: 20px; }
  .fc-card__prompt { font-size: 1.05rem; }
  .profile-dropdown__name { display: none; }
  .landing-flashcard-preview { margin-bottom: 2rem; }

  .fc-actions { flex-direction: row; flex-wrap: wrap; }
  .fc-actions .btn { flex: 1; min-width: 0; font-size: .82rem; padding: .6rem .5rem; }

  .confirm-dialog { margin: 1rem; padding: 1.5rem; }

  .edit-notice { flex-wrap: wrap; justify-content: center; text-align: center; }

  .fc-gate { padding: 2rem 1rem; }
  .fc-gate__buttons { width: 100%; }
  .fc-gate__buttons .btn { flex: 1; min-width: 0; }

  .premium-banner { padding: 2rem 1rem; }
  .premium-btn { width: 100%; }

  .user-bar { justify-content: center; }

  footer { padding: 1.5rem 1rem; }

  .navbar__inner { padding: .6rem .8rem; }
  .navbar__logo { font-size: .92rem; }
  .theme-switcher { gap: .15rem; padding: .15rem; }
  .theme-btn { width: 24px; height: 24px; }
  .theme-btn::after { width: 12px; height: 12px; }

  .bac-countdown__unit { min-width: 46px; padding: .4rem .5rem; }
  .bac-countdown__unit span { font-size: 1.1rem; }
  .bac-countdown--app .bac-countdown__unit { min-width: 38px; }
  .bac-countdown--app .bac-countdown__unit span { font-size: .85rem; }

  .category-bar__add { flex-direction: column; }
  .category-bar__add input { width: 100%; }

  .cat-group__head { padding: .55rem .75rem; }
  .cat-group__drop { padding: .6rem; }

  .fc-filter-group { flex-direction: column; width: 100%; }
  .fc-filter-group .opera-multiselect { width: 100%; min-width: 0; }

  .progress-dash__summary { gap: .5rem; padding: .6rem .8rem; }
  .progress-dash__stat-num { font-size: 1.4rem; }
  .progress-dash__boxes { grid-template-columns: repeat(5, 1fr); gap: .4rem; }
  .leitner-box { padding: .5rem .3rem; }
  .leitner-box__num { font-size: 1.2rem; }
  .opera-progress-row { flex-wrap: wrap; gap: .4rem; }
  .opera-progress-row__bar-wrap { width: 100%; order: 3; }
  .opera-progress-row__pct { order: 4; }
  .opera-progress-row__detail { order: 5; }
  .progress-dash__chart { height: 90px; }

  .landing-hero { padding: 2.5rem 1rem 3.5rem; }
  .landing-hero h1 { font-size: 1.8rem; }
  .landing-hero__sub { max-width: 100%; }
  .landing-cta-group { justify-content: center; gap: .5rem; }
  .landing-cta-group .btn.primary { width: 100%; max-width: 280px; }
  .landing-hero__left .bac-countdown--inline { margin-left: auto; margin-right: auto; }

  .landing-how { padding: 1.5rem 1rem; }
  .landing-how__grid { gap: .6rem; }

  .landing-pricing { padding: 2rem 1rem; }
  .landing-pricing__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .landing-pricing__amount { font-size: 1.6rem; }

  .ai-import__header { padding: 1.2rem 1rem .6rem; }
  .ai-import__title { font-size: .95rem; }
  .ai-import__desc { font-size: .8rem; }
  .ai-import__hint { font-size: .7rem; }
  .ai-import__body { padding: .8rem 1rem 1.2rem; gap: .75rem; }
  .ai-import__dropzone { padding: 1.25rem 1rem; }
  .ai-import__dropzone p { font-size: .82rem; }
  .ai-import__submit { font-size: .88rem; padding: .6rem .8rem; }

  .auth-dialog { padding: 1.5rem; margin: .5rem; max-width: calc(100vw - 1rem); }
  .auth-form label { font-size: .72rem; }
}

/* ====== ACCENT COLOR PICKER ====== */
.accent-picker {
  display: flex;
  gap: .3rem;
}
.accent-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: all .15s;
  padding: 0;
}
.accent-swatch:hover {
  transform: scale(1.15);
}
.accent-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text);
}
.accent-swatch[data-accent="#c9463d"] { background: #c9463d; }
.accent-swatch[data-accent="#2563eb"] { background: #2563eb; }
.accent-swatch[data-accent="#059669"] { background: #059669; }
.accent-swatch[data-accent="#7c3aed"] { background: #7c3aed; }
.accent-swatch[data-accent="#d97706"] { background: #d97706; }
.accent-swatch[data-accent="#db2777"] { background: #db2777; }

/* ====== LANDING LEADERBOARD TABS ====== */
.landing-leaderboard__tabs {
  display: flex;
  justify-content: center;
  gap: .3rem;
  margin-bottom: 1rem;
}
.landing-leaderboard__tab {
  background: var(--neutral);
  border: none;
  border-radius: 999px;
  padding: .35rem .9rem;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.landing-leaderboard__tab:hover {
  color: var(--text);
}
.landing-leaderboard__tab.active {
  background: var(--primary);
  color: #fff;
}
.landing-leaderboard__list {
  text-align: left;
}
.lb-empty {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 1.5rem 0;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .8rem;
  border-radius: var(--radius);
  transition: background .15s;
}
.lb-row:hover {
  background: var(--neutral);
}
.lb-row--top {
  background: var(--primary-light);
}
.lb-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
  background: var(--neutral);
  color: var(--muted);
}
.lb-row--top .lb-rank {
  background: var(--primary);
  color: #fff;
}
.lb-row--gold .lb-rank { background: #f59e0b; color: #fff; }
.lb-row--silver .lb-rank { background: #94a3b8; color: #fff; }
.lb-row--bronze .lb-rank { background: #b45309; color: #fff; }
.lb-name {
  flex: 1;
  font-size: .85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-score {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary);
}
.lb-unit {
  font-size: .65rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: .15rem;
}
.lb-more {
  text-align: center;
  padding: .7rem 0 .3rem;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 500;
}
.lb-separator {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .5rem 0 .35rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.lb-separator::before,
.lb-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.lb-row--you {
  background: var(--primary-light);
  border: 1.5px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.lb-you {
  display: inline-block;
  margin-left: .4rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--primary);
  color: #fff;
  vertical-align: middle;
}

/* ====== HOME LEADERBOARD ====== */
.home-leaderboard {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-section-alt);
}
.home-leaderboard__inner {
  max-width: 720px;
  margin: 0 auto;
}
.home-leaderboard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}
.home-leaderboard__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--text-heading);
  margin: .35rem 0 .4rem;
  letter-spacing: -.02em;
}
.home-leaderboard__sub {
  margin: 0;
  font-size: .92rem;
  color: var(--muted-strong);
  max-width: 36rem;
}
.home-leaderboard__head .landing-leaderboard__tabs {
  margin-bottom: 0;
  flex-shrink: 0;
}
.home-leaderboard__list {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .35rem .25rem;
}

/* ====== CONFETTI CANVAS ====== */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ====== FLAGGED SUGGESTION ====== */
.sug-item--flagged {
  border-left: 3px solid #e74c3c;
  opacity: .7;
}
.sug-badge--pending_review {
  background: #f0ad4e;
  color: #fff;
}
.sug-badge--flagged {
  background: #e74c3c;
  color: #fff;
}

/* ====== SESSION COMPLETE ANIMATION ====== */
@keyframes celebratePop {
  0% { transform: scale(.5); opacity: 0; }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes celebrateIcon {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
.flip-complete.celebrate .flip-complete__card {
  animation: celebratePop .5s cubic-bezier(.22,1,.36,1) both;
}
.flip-complete.celebrate .flip-complete__icon {
  animation: celebrateIcon .6s cubic-bezier(.22,1,.36,1) .15s both;
}
.quiz-results.celebrate .quiz-results__card {
  animation: celebratePop .5s cubic-bezier(.22,1,.36,1) both;
}

/* ====== SHARE SCORE BUTTON ====== */
.quiz-results__share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .75rem;
  padding: .45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.quiz-results__share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ====== STREAK DISPLAY ====== */
.streak-display {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.streak-fire {
  transition: all .3s ease;
  flex-shrink: 0;
}
.progress-dash__streak-item {
  position: relative;
}
.progress-dash__streak-item.streak-active .progress-dash__stat-num {
  color: #fb923c;
}
.progress-dash__streak-item.streak-hot .progress-dash__stat-num {
  color: #f59e0b;
}
.streak-badge {
  display: inline-block;
  margin-top: .25rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  animation: streakBadgePop .4s cubic-bezier(.22,1,.36,1);
}
@keyframes streakBadgePop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ====== STREAK TOAST ====== */
.streak-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1.2rem;
  background: var(--card-bg, #fff);
  border: 1.5px solid rgba(245,158,11,.3);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  z-index: 9998;
  opacity: 0;
  transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .4s ease;
}
.streak-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.streak-toast strong {
  display: block;
  font-size: .9rem;
  color: var(--text);
}
.streak-toast span {
  font-size: .78rem;
  color: var(--muted);
}

/* ====== EXPORT BUTTON ON OPERA CARD ====== */
.opera-card__actions .export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}
.opera-card__actions .export-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

@media (max-width: 380px) {
  .navbar__right { gap: .4rem; }
  .nav-login-btn { padding: .4rem .8rem; font-size: .75rem; }
  .profile-dropdown__trigger { padding: .2rem .5rem .2rem .2rem; font-size: .75rem; }
  .profile-dropdown__avatar { width: 24px; height: 24px; font-size: .7rem; }
}

@media (max-width: 768px) {
  #appView main { padding-bottom: 5rem; }
  footer { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
}

/* ====== LANDING CTA SUBJECT BUTTONS ====== */
.landing-cta-subject {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.6rem;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 999px;
  position: relative;
}
.landing-cta-subject--math {
  background: var(--bg-dark);
  border-color: var(--bg-dark);
  color: var(--bg);
}
.landing-cta-subject--math:hover {
  background: var(--text-heading);
  border-color: var(--text-heading);
  color: var(--bg);
}
.landing-cta-free {
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: rgba(255,255,255,.25);
  padding: .1rem .35rem;
  border-radius: 999px;
  line-height: 1.3;
}
.landing-quick-links-row {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
  justify-content: center;
  animation: fadeIn .8s cubic-bezier(.22,1,.36,1) .45s both;
}

/* ====== MATH ANNOUNCEMENT BANNER (LANDING) ====== */
.math-announce {
  max-width: 800px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}
.math-announce__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-section-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
[data-theme="dark"] .math-announce__inner {
  background: var(--bg-section-alt);
  border-color: var(--border);
}
.math-announce__badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--bg-dark);
  color: var(--bg);
  padding: .2rem .5rem;
  border-radius: 999px;
  line-height: 1.3;
}
.math-announce__text {
  flex: 1;
}
.math-announce__text strong {
  font-size: .95rem;
  color: var(--text-heading);
}
.math-announce__text p {
  margin: .2rem 0 0;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ====== MATH PANEL ====== */
.math-panel {
  max-width: 900px;
  margin: 0 auto;
}
.math-panel__announce {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1rem;
  background: var(--bg-section-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
[data-theme="dark"] .math-panel__announce {
  background: var(--bg-section-alt);
  border-color: var(--border);
}
.math-panel__announce p {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

/* ====== TRIGONOMETRIC CIRCLE ====== */
.trig-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.trig-section__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 .3rem;
  color: var(--text-heading);
}
.trig-section__desc {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  line-height: 1.4;
}
.trig-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.trig-canvas-wrap {
  width: 100%;
  max-width: 400px;
}
.trig-canvas-wrap canvas {
  display: block;
  border-radius: var(--radius);
  cursor: crosshair;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}
.trig-info {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 160px;
}
.trig-value {
  padding: .75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.trig-value__label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.trig-value__num {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
  font-family: 'Space Grotesk', monospace;
}
.trig-value__rad {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-top: .15rem;
}
.trig-value--sin {
  border-left: 3px solid #ef4444;
}
.trig-value--cos {
  border-left: 3px solid #3b82f6;
}
.trig-value--tan {
  border-left: 3px solid #8b5cf6;
}

/* ====== TRIG PRESETS ====== */
.trig-presets {
  margin-bottom: 1.5rem;
}
.trig-presets__title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 .6rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.trig-presets__grid {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.trig-preset {
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  padding: .4rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}
.trig-preset:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.trig-preset.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ====== TRIG TABLE ====== */
.trig-table h3 {
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 .75rem;
  color: var(--text-heading);
}
.trig-table__wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.trig-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.trig-table th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .55rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.trig-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  font-family: 'Space Grotesk', monospace;
  font-weight: 500;
}
.trig-table tr:last-child td { border-bottom: none; }
.trig-table tr:hover td { background: var(--bg); }

/* ====== TRIG RESPONSIVE ====== */
@media (max-width: 768px) {
  .math-panel__announce {
    padding: .6rem .8rem;
    margin-bottom: 1rem;
  }
  .math-panel__announce p {
    font-size: .78rem;
  }
  .trig-section {
    padding: .8rem;
  }
  .trig-section__title {
    font-size: 1.05rem;
    margin-bottom: .15rem;
  }
  .trig-section__desc {
    font-size: .78rem;
    margin-bottom: 1rem;
  }
  .trig-layout {
    flex-direction: column;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1rem;
  }
  .trig-info {
    flex-direction: row;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    gap: .4rem;
  }
  .trig-value {
    flex: 1;
    min-width: 0;
    padding: .4rem .5rem;
    border-radius: 10px;
  }
  .trig-value__label {
    font-size: .6rem;
    margin-bottom: .1rem;
  }
  .trig-value__num {
    font-size: .95rem;
  }
  .trig-value__rad {
    font-size: .65rem;
  }
  .trig-table h3 {
    font-size: .85rem;
    margin-bottom: .5rem;
  }
  .trig-table td,
  .trig-table th {
    padding: .4rem .5rem;
    font-size: .75rem;
  }
  .math-announce {
    padding: 0 .8rem;
    margin-bottom: 1.5rem;
  }
  .math-announce__inner {
    flex-direction: column;
    text-align: center;
    gap: .6rem;
    padding: .8rem 1rem;
  }
}

/* ============================================================
   ============================================================
                EDITORIAL DESIGN SYSTEM v2
                (new public pages, no gradients)
   ============================================================
   ============================================================ */

/* ====== GLOBAL CORRECTIONS for editorial feel ====== */
body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: sans with tight tracking, weight carries hierarchy */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
h1 { font-weight: 700; }
h2 { font-weight: 600; }

/* Buttons: editorial flat */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0;
  border: 1.5px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.secondary {
  background: var(--bg-dark);
  color: var(--bg);
  border-color: var(--bg-dark);
}
.btn.secondary:hover { background: var(--text-heading); }
.btn.ghost {
  background: transparent;
  color: var(--text-heading);
  border-color: var(--rule);
}
.btn.ghost:hover {
  background: var(--text-heading);
  color: var(--bg);
}

/* ====== NAVBAR (editorial) ====== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(140%) blur(8px);
}
body.is-app .navbar {
  position: sticky;
}
.navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .85rem clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}
.navbar__logo {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  color: var(--text-heading);
  cursor: pointer;
  flex-shrink: 0;
}
.navbar__logo-icon {
  display: block;
  height: 44px;
  width: auto;
  aspect-ratio: 1024 / 682;
  object-fit: contain;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .navbar__logo-icon { height: 36px; }
}
.navbar__primary {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: 1rem;
  flex: 1;
}
.navbar__link {
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted-strong);
  text-decoration: none;
  padding: .5rem .8rem;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.navbar__link:hover,
.navbar__link.is-active {
  color: var(--text-heading);
  background: var(--bg-section-alt);
}
.navbar__right {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}
.navbar__auth {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}
.nav-app-link {
  display: inline-flex;
  align-items: center;
  padding: .45rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--bg);
  background: var(--text-heading);
  border-radius: var(--radius-pill);
  transition: opacity var(--transition);
}
.nav-app-link:hover { opacity: .85; }
.nav-app-link--in { background: var(--primary); }
.nav-login-btn {
  background: transparent;
  border: 1.5px solid var(--rule);
  color: var(--text-heading);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .45rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-login-btn:hover {
  background: var(--text-heading);
  color: var(--bg);
}
.navbar__menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
.navbar__menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text-heading);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.navbar__menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navbar__menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.navbar__menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .navbar__primary {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: .5rem 1rem 1rem;
    display: none;
  }
  .navbar__primary.is-open { display: flex; }
  .navbar__link {
    padding: .8rem .5rem;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
  }
  .navbar__link:last-child { border-bottom: 0; }
  .navbar__menu-toggle { display: flex; }
}

/* Hide existing theme switcher in navbar on small screens (still in profile menu) */
@media (max-width: 700px) {
  #navThemeSwitcher { display: none; }
}

/* ====== PAGE SHOW/HIDE (router-driven) ====== */
.page { display: none; }
.page.is-active { display: block; }

/* ====== HERO EDITORIAL ====== */
.hero-editorial {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1rem, 3vw, 2rem) clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  border-bottom: 1px solid var(--rule);
}
.hero-editorial__inner { max-width: 640px; }
.hero-editorial__kicker {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 1.2rem;
}
.hero-editorial__title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0 0 1.4rem;
}
.hero-editorial__title em {
  font-style: italic;
  color: var(--primary);
  font-weight: 400;
}
.hero-editorial__lede {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.55;
  color: var(--muted-strong);
  max-width: 540px;
  margin: 0 0 2rem;
}
.hero-editorial__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-bottom: 1.6rem;
}
.hero-editorial__meta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }

.hero-editorial__side {
  position: relative;
  display: flex;
  justify-content: center;
}
.folio-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--primary);
  padding: 1.4rem 1.4rem 1.2rem;
  position: relative;
}
.folio-card::after {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: -8px; bottom: -8px;
  border: 1px solid var(--rule-soft);
  z-index: -1;
}
.folio-card__rule {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .65rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 .8rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border-light);
}
.folio-card__caption {
  margin: .9rem 0 0;
  padding-top: .6rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: .75rem;
  font-style: italic;
  color: var(--muted);
}
.folio-card .fc-card--preview {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  height: 200px;
}

@media (max-width: 880px) {
  .hero-editorial { grid-template-columns: 1fr; }
  .hero-editorial__side { order: -1; }
  .folio-card { max-width: 320px; }
}

/* ====== EDITORIAL SECTIONS ====== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 3vw, 2rem);
}
.editorial-section { border-bottom: 1px solid var(--rule); }
.editorial-section--alt { background: var(--bg-section-alt); }

.section__lead {
  max-width: 720px;
  margin: 0 0 2.5rem;
}
.section__label {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--primary);
  margin-bottom: 1rem;
}
.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 .8rem;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}
.section__sub {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--muted-strong);
  max-width: 640px;
  margin: 0;
}
.section__cta {
  margin-top: 2rem;
  text-align: center;
}

/* ====== THREE-COL ====== */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.three-col__item {
  background: var(--bg);
  padding: 2rem 1.6rem;
}
.editorial-section--alt .three-col__item { background: var(--bg-section-alt); }
.three-col__num {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary);
  margin: 0 0 1rem;
  letter-spacing: 0;
}
.three-col__item h3 {
  font-size: 1.25rem;
  margin: 0 0 .65rem;
  color: var(--text-heading);
}
.three-col__item p {
  font-size: .94rem;
  line-height: 1.55;
  color: var(--muted-strong);
  margin: 0;
}
@media (max-width: 800px) {
  .three-col { grid-template-columns: 1fr; }
}

/* ====== HOME OPERA INDEX ====== */
.opera-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.opera-index__item {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  background: var(--bg);
  padding: 1.4rem 1.3rem;
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
  position: relative;
}
.editorial-section--alt .opera-index__item { background: var(--bg-section-alt); }
.opera-index__item:hover { background: var(--bg-card); }
.opera-index__cat {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
}
.opera-index__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.2;
  margin: 0;
}
.opera-index__author {
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
}
.opera-index__year {
  font-size: .72rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: .8rem;
  border-top: 1px solid var(--border-light);
}

/* ====== HOW STEPS (HOME) ====== */
.how-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.how-steps__item {
  background: var(--bg);
  padding: 1.8rem 1.6rem;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.4rem;
  align-items: start;
}
.editorial-section--alt .how-steps__item { background: var(--bg-section-alt); }
.how-steps__num {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--primary);
  line-height: 1;
}
.how-steps__body h3 {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
  color: var(--text-heading);
}
.how-steps__body p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--muted-strong);
}
@media (max-width: 600px) {
  .how-steps__item { grid-template-columns: 60px 1fr; gap: 1rem; padding: 1.4rem 1.2rem; }
  .how-steps__num { font-size: 1.8rem; }
}

/* ====== PRICING BAR (homepage teaser) ====== */
.pricing-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 1.8rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--primary);
}
.pricing-bar__amount { display: flex; align-items: baseline; gap: .35rem; }
.pricing-bar__price {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 500;
  color: var(--text-heading);
}
.pricing-bar__per { color: var(--muted); font-size: .95rem; font-weight: 500; }
.pricing-bar__details p {
  font-size: .95rem;
  color: var(--muted-strong);
  line-height: 1.5;
  margin: 0;
}
.pricing-bar__details strong { color: var(--text-heading); }
@media (max-width: 800px) {
  .pricing-bar {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 1.4rem 1.4rem;
    text-align: left;
  }
}

/* ====== PAGE HEADER (general public pages) ====== */
.page-header {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem) clamp(1.4rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: 0 0 1.4rem;
  font-size: .8rem;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--muted-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.breadcrumb a:hover { border-bottom-color: var(--muted-strong); }
.breadcrumb span[aria-current] { color: var(--text-heading); font-weight: 500; }
.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--text-heading);
}
.page-header__lede {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted-strong);
  max-width: 680px;
  margin: 0;
}

/* ====== OPERA CATEGORIES (HUB PAGE) ====== */
.opera-categories {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 2rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.opera-cat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .6rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.opera-cat__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}
.opera-cat__count {
  font-size: .85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.opera-cat__desc {
  font-size: .95rem;
  color: var(--muted-strong);
  margin: 0 0 1.2rem;
  max-width: 720px;
  line-height: 1.55;
}
.opera-cat__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.opera-cat__item {
  background: var(--bg);
  padding: 1.3rem 1.3rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: background var(--transition);
}
.opera-cat__item:hover { background: var(--bg-card); }
.opera-cat__item-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0;
}
.opera-cat__item-author {
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
}
.opera-cat__item-meta {
  margin-top: auto;
  padding-top: .8rem;
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--muted);
  border-top: 1px solid var(--border-light);
  font-variant-numeric: tabular-nums;
}

/* ====== OPERA ARTICLE (per-opera page) ====== */
.opera-article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.8rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem) 4rem;
}
.opera-article__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: 0 0 1.6rem;
  font-size: .78rem;
  color: var(--muted);
}
.opera-article__breadcrumb a {
  color: var(--muted-strong);
  text-decoration: none;
}
.opera-article__breadcrumb a:hover { color: var(--text-heading); }
.opera-article__kicker {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .7rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 .6rem;
}
.opera-article__title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 .4rem;
  color: var(--text-heading);
}
.opera-article__author {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted-strong);
  margin: 0 0 2rem;
}
.opera-article__meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 0 0 2.5rem;
}
.opera-article__meta dl {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin: 0;
  padding: .9rem 1rem;
  border-right: 1px solid var(--border-light);
}
.opera-article__meta dl:last-child { border-right: 0; }
.opera-article__meta dt {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.opera-article__meta dd {
  margin: 0;
  font-size: .92rem;
  color: var(--text-heading);
  font-weight: 500;
}
.opera-article h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  margin: 2.2rem 0 .8rem;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}
.opera-article h2:first-of-type { margin-top: 0; }
.opera-article p {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 1rem;
}
.opera-article__teza {
  border-left: 3px solid var(--primary);
  padding: .6rem 0 .6rem 1.2rem;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-heading);
  margin: 0 0 1.6rem;
}
.opera-article__cards {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  margin: 1.2rem 0;
}
.opera-article__card {
  background: var(--bg-card);
  padding: 1.2rem 1.3rem;
}
.opera-article__card-q {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
  margin-bottom: .4rem;
}
.opera-article__card-prompt {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-heading);
  margin: 0 0 .6rem;
  line-height: 1.3;
}
.opera-article__card-a {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: .35rem;
}
.opera-article__card-answer {
  font-size: .95rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}
.opera-article__cta-block {
  margin-top: 2.4rem;
  padding: 1.6rem 1.8rem;
  background: var(--bg-section-alt);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.opera-article__cta-block p {
  margin: 0;
  font-size: .98rem;
  color: var(--muted-strong);
  max-width: 420px;
}
.opera-article__related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.opera-article__related h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 0 1rem;
}
.opera-article__related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.opera-article__related-item {
  background: var(--bg);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  transition: background var(--transition);
}
.opera-article__related-item:hover { background: var(--bg-card); }
.opera-article__related-item strong {
  display: block;
  color: var(--text-heading);
  font-family: var(--font-heading);
  font-weight: 500;
}
.opera-article__related-item small {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .75rem;
  font-style: italic;
}

/* ====== HOW DETAIL PAGE ====== */
.how-detail {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 2rem) 4rem;
}
.how-detail__list {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.how-detail__item {
  background: var(--bg);
  padding: 2rem;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.4rem;
}
.how-detail__num {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-style: italic;
  color: var(--primary);
  line-height: 1;
}
.how-detail__body h2 {
  font-size: 1.4rem;
  margin: 0 0 .6rem;
}
.how-detail__body p {
  margin: 0 0 .6rem;
  font-size: .98rem;
  line-height: 1.6;
  color: var(--text);
}
.how-detail__note {
  font-style: italic;
  color: var(--muted-strong);
  font-size: .92rem;
  border-left: 2px solid var(--rule-soft);
  padding-left: .9rem;
}
@media (max-width: 600px) {
  .how-detail__item { grid-template-columns: 1fr; padding: 1.5rem; }
}

/* ====== PRICING (NEW) ====== */
.pricing-grid {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 2rem) 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: stretch;
}
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 2rem 1.8rem 2.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pricing-card--premium { border-top: 3px solid var(--primary); background: var(--bg-card); }
.pricing-card__badge {
  position: absolute;
  top: -1px;
  right: 1.6rem;
  transform: translateY(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: .25rem .7rem;
  border-radius: var(--radius-pill);
}
.pricing-card__head { margin-bottom: 1.4rem; }
.pricing-card__tag {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .7rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 .4rem;
}
.pricing-card__amount {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-heading);
  margin: 0;
}
.pricing-card__per {
  font-size: .85rem;
  color: var(--muted);
  margin: .35rem 0 0;
}
.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.pricing-card__features li {
  font-size: .92rem;
  color: var(--text);
  padding-left: 1.4rem;
  position: relative;
  line-height: 1.4;
}
.pricing-card__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .5rem;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
}
.pricing-card__features li.excluded {
  color: var(--muted);
}
.pricing-card__features li.excluded::before {
  border-color: var(--rule-soft);
  background: transparent;
}
.pricing-card__features li.excluded::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 50%;
  width: 12px;
  border-top: 1px solid var(--muted);
  transform: rotate(-15deg);
}
.pricing-card__cta { width: 100%; }
.pricing-card__fineprint {
  font-size: .75rem;
  color: var(--muted);
  margin: .8rem 0 0;
  text-align: center;
}
.pricing-faq {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 2rem) 4rem;
}
.pricing-faq h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0 0 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rule);
}
.pricing-faq dl { margin: 0; }
.pricing-faq dt {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text-heading);
  margin-top: 1.4rem;
}
.pricing-faq dd {
  margin: .35rem 0 0;
  font-size: .94rem;
  line-height: 1.55;
  color: var(--muted-strong);
}
@media (max-width: 700px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ====== FAQ (collapsible) ====== */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 2rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0 1.2rem;
}
.faq-item:first-child { border-top: 1px solid var(--rule); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-heading);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  padding-right: 1.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1;
  transition: transform var(--transition);
}
.faq-item[open] summary::after {
  content: '\2013';
}
.faq-item p {
  margin: .9rem 0 0;
  font-size: .96rem;
  line-height: 1.6;
  color: var(--muted-strong);
}
.faq-item p em {
  font-style: italic;
  color: var(--text-heading);
}

/* ====== ABOUT / PROSE ====== */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 2rem) 4rem;
}
.prose p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 1.2rem;
}
.prose p:first-of-type::first-letter {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  line-height: 0.85;
  font-weight: 500;
  float: left;
  padding: .25rem .5rem .1rem 0;
  color: var(--primary);
}
.prose a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--primary);
}
.prose a:hover { background: var(--primary-light); }

.prose--legal {
  max-width: 760px;
  padding-bottom: 5rem;
}
.prose--legal p:first-of-type::first-letter {
  float: none;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
  padding: 0;
  color: inherit;
}
.prose--legal h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 2rem 0 .75rem;
  color: var(--text-heading);
}
.prose--legal h3 {
  font-size: 1rem;
  margin: 1.25rem 0 .5rem;
  color: var(--text-heading);
}
.prose--legal ul {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
}
.prose--legal li {
  margin-bottom: .45rem;
  line-height: 1.6;
  color: var(--text);
}
.prose--legal code {
  font-size: .9em;
  background: var(--bg-soft, rgba(0,0,0,.05));
  padding: .1rem .35rem;
  border-radius: 4px;
}
.legal-meta {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 1.5rem !important;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: .92rem;
}
.legal-table th,
.legal-table td {
  border: 1px solid var(--border);
  padding: .55rem .65rem;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--bg-soft, rgba(0,0,0,.03));
  font-weight: 600;
}
.legal-info-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.legal-info-list li {
  margin-bottom: .5rem;
}

.auth-legal {
  font-size: .78rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 .85rem;
}
.auth-legal a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: .85rem clamp(.75rem, 3vw, 1.25rem) calc(.85rem + env(safe-area-inset-bottom, 0px));
  background: rgba(20, 18, 16, .96);
  color: #f4ede3;
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -8px 32px rgba(0,0,0,.25);
}
.cookie-consent__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cookie-consent p {
  margin: 0;
  font-size: .85rem;
  line-height: 1.45;
  flex: 1;
  min-width: 220px;
}
.cookie-consent a {
  color: #f5c4bc;
  text-decoration: underline;
}

/* ====== MATH PUBLIC PAGE ====== */
.math-public {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 2rem) 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.math-public__card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 1.8rem;
}
.math-public__card h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin: 0 0 .6rem;
}
.math-public__card p {
  font-size: .96rem;
  line-height: 1.55;
  color: var(--muted-strong);
  margin: 0 0 1.2rem;
}
@media (max-width: 700px) {
  .math-public { grid-template-columns: 1fr; }
}

body.is-app #appView > main {
  padding: clamp(1rem, 2.5vw, 2rem) clamp(1.1rem, 3.5vw, 2.25rem) 6rem;
  max-width: 1100px;
  margin: 0 auto;
}
body.is-app.is-app-math #appView > main {
  max-width: 960px;
}

/* Legacy app-header (removed from DOM; kept minimal for safety) */
.app-header { display: none !important; }

/* Override old .hero only if it's still in DOM somewhere */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
}

/* ====== FOOTER (NEW) ====== */
.site-footer {
  background: var(--bg-dark);
  color: var(--bg);
  border-top: 1px solid var(--rule);
}
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem clamp(1rem, 3vw, 2rem) 2rem;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2rem;
}
.site-footer__col h4 {
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 500;
  color: var(--bg);
  margin: 0 0 1rem;
  letter-spacing: 0;
}
.site-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.site-footer__col a {
  color: rgba(244,237,227,.7);
  text-decoration: none;
  font-size: .88rem;
  transition: color var(--transition);
}
.site-footer__col a:hover { color: var(--bg); }
.site-footer__col p {
  font-size: .88rem;
  line-height: 1.55;
  color: rgba(244,237,227,.6);
  margin: 0;
}
.site-footer__logo {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--bg);
  text-decoration: none;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.site-footer__logo-icon {
  display: block;
  height: 40px;
  width: auto;
  aspect-ratio: 1024 / 682;
  object-fit: contain;
  flex-shrink: 0;
}
.site-footer__logo span { color: rgba(244,237,227,.5); font-weight: 400; }
.site-footer__bottom {
  border-top: 1px solid rgba(244,237,227,.12);
  padding: 1.2rem clamp(1rem, 3vw, 2rem);
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-footer__bottom p {
  font-size: .8rem;
  color: rgba(244,237,227,.55);
  margin: 0;
}
.site-footer__bottom a {
  color: rgba(244,237,227,.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,237,227,.22);
  padding-bottom: 1px;
  transition: color var(--transition), border-color var(--transition);
}
.site-footer__bottom a:hover {
  color: var(--bg);
  border-bottom-color: rgba(244,237,227,.55);
}
.site-footer__credit {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: rgba(244,237,227,.55);
}
.site-footer__credit a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: rgba(244,237,227,.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(244,237,227,.25);
  padding-bottom: 1px;
}
.site-footer__credit a:hover { color: var(--bg); border-bottom-color: var(--bg); }
.site-footer__logo-img {
  display: block;
  height: 24px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 2rem 1.4rem; }
}
@media (max-width: 500px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* ====== Hide old footer when new is used ====== */
footer:not(.site-footer) {
  display: none;
}

/* ====== fc-card preview tweaks for editorial folio ====== */
.folio-card .fc-card--preview .fc-card__front,
.folio-card .fc-card--preview .fc-card__back {
  background: var(--bg-card);
  color: var(--text);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.folio-card .fc-card--preview .fc-card__label {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .65rem;
  font-weight: 600;
  margin-bottom: .8rem;
}
.folio-card .fc-card--preview .fc-card__prompt,
.folio-card .fc-card--preview .fc-card__answer-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.35;
}

/* ====== bac-countdown polish ====== */
.bac-countdown--inline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .85rem;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-pill);
  font-size: .8rem;
  color: var(--muted-strong);
  background: var(--bg-card);
}
.bac-countdown--inline strong { color: var(--text-heading); font-weight: 600; }

/* ====== Hide leftover landing structures (legacy) ====== */
#landingPage { display: none !important; }
.landing-hero,
.landing-flashcard-preview,
.landing-how,
.landing-demo,
.landing-pricing,
.math-announce,
.price-bump-banner { display: none !important; }

/* ====== APP MODE NAVBAR ====== */
body.is-app .navbar__primary { display: none !important; }
body.is-app .navbar__inner {
  flex-wrap: wrap;
  gap: .6rem;
}
.navbar__app-shell {
  display: none;
  flex: 1 1 auto;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
body.is-app .navbar__app-shell {
  display: flex;
}
.navbar__app-zone {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.navbar__app-zone-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar__app-zone--math {
  padding-left: .65rem;
  border-left: 1px solid var(--border-light);
}
/* Boxless toolbar: active tab gets a quiet pill, nothing else has chrome */
.tab-nav--navbar {
  margin-top: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: .15rem;
  flex-wrap: nowrap;
  overflow: visible;
}
.tab-nav--navbar .tab-link {
  color: var(--muted);
  min-width: 56px;
  padding: .45rem .65rem;
}
.tab-nav--navbar .tab-link:hover { color: var(--text-heading); }
.tab-nav--navbar .tab-link.active {
  background: var(--bg-section-alt);
  color: var(--text-heading);
  box-shadow: none;
}
.tab-nav--math-only .tab-link { min-width: 64px; }
.navbar__site-link {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: .35rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.navbar__site-link:hover {
  color: var(--text-heading);
  border-color: var(--primary);
}

/* ====== APP LANDING ====== */
.app-landing {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem;
}
.app-landing__wrap {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.app-landing__intro {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.app-landing__title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  margin: 0;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}
.app-landing__countdown { align-self: flex-start; }

.app-zone {
  border: 1px solid var(--border-light);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem 1.2rem 1.35rem;
  background: var(--bg-card);
}
.app-zone--romana {
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border-light));
}
.app-zone--math {
  background: linear-gradient(135deg, var(--bg-section-alt) 0%, var(--bg-card) 100%);
  border-style: dashed;
}
.app-zone__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1rem;
}
.app-zone__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0 0 .2rem;
  color: var(--text-heading);
}
.app-zone__sub {
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.45;
}
.app-zone__desc {
  margin: -.35rem 0 1rem;
  font-size: .85rem;
  color: var(--muted-strong);
  line-height: 1.5;
}
.app-zone__badge {
  flex-shrink: 0;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: var(--bg-dark);
  color: var(--bg);
}
.app-zone__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  margin: 1rem 0;
}
.app-zone__stat {
  text-align: center;
  padding: .65rem .5rem;
  border-radius: var(--radius);
  background: var(--bg-section-alt);
  border: 1px solid var(--border-light);
}
.app-zone__stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-heading);
}
.app-zone__stat-label {
  display: block;
  font-size: .68rem;
  color: var(--muted);
  margin-top: .1rem;
}
.app-zone__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .55rem;
  margin-top: .5rem;
}
.app-zone__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 88px;
  padding: .75rem .5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-section-alt);
  color: var(--text-heading);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.app-zone__tile:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.app-zone__tile-icon {
  display: inline-flex;
  line-height: 1;
  opacity: .7;
}
.app-zone__tile-icon svg { display: block; }
.app-zone__tile--premium { position: relative; }
/* Quiet lock glyph instead of a shouty PREMIUM pill; hidden for subscribers */
.app-zone__tile--premium::after {
  content: '';
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .8;
}
body.is-premium .app-zone__tile--premium::after { display: none; }
[data-theme="dark"] .app-zone__tile--premium::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398989d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}
.app-zone__tile--math {
  flex-direction: row;
  justify-content: flex-start;
  min-height: auto;
  padding: .85rem 1rem;
  gap: .65rem;
  max-width: 360px;
}
.app-zone__tile--solo { margin-top: .25rem; }

.live-counter--compact {
  padding: .85rem 1rem;
  margin-bottom: .25rem;
}
.live-counter--compact .live-counter__num {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.app-landing__resume-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1rem 0 .5rem;
}

@media (max-width: 900px) {
  body.is-app .navbar__app-zone-label { display: none; }
  body.is-app .navbar__app-zone--math {
    padding-left: 0;
    border-left: 0;
  }
  body.is-app .navbar__app-shell {
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
  }
}
@media (max-width: 560px) {
  .app-zone__stats { grid-template-columns: 1fr; }
  .app-zone__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.is-app .navbar__site-link { display: none; }
  body.is-app .tab-nav--navbar { border-radius: 12px; }
}

[data-theme="dark"] .app-zone--romana {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border-light));
}
[data-theme="dark"] .tab-nav--navbar {
  background: transparent;
  border-color: transparent;
}
[data-theme="dark"] .tab-nav--navbar .tab-link.active {
  background: var(--bg-card);
}

/* ====== LIVE COMMUNITY COUNTER ====== */
.live-counter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.1rem 1.15rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1.5px solid var(--primary);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 55%);
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
}
.live-counter__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  align-self: flex-start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}
.live-counter__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: livePulse 1.8s ease-out infinite;
}
.live-counter__label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-counter__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem .6rem;
}
.live-counter__num {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1;
  color: var(--text-heading);
  transition: transform .25s ease, color .25s ease;
}
.live-counter__num--pulse {
  transform: scale(1.06);
  color: var(--primary);
}
.live-counter__suffix {
  font-size: .88rem;
  color: var(--muted-strong);
}
.live-counter__meta {
  margin: 0;
  font-size: .72rem;
  color: var(--muted);
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ====== OPERA MOVE MENU ====== */
.opera-card__cat-row {
  position: relative;
  padding: .35rem 0 .15rem;
}
.opera-card__move-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.opera-card__move-menu {
  position: absolute;
  left: 0;
  top: calc(100% + .25rem);
  z-index: 20;
  min-width: 180px;
  max-width: min(100%, 260px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .35rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.opera-card__move-option {
  border: 0;
  background: transparent;
  text-align: left;
  padding: .45rem .55rem;
  border-radius: 8px;
  font: inherit;
  font-size: .78rem;
  color: var(--text);
  cursor: pointer;
}
.opera-card__move-option:hover { background: var(--bg-section-alt); }
.opera-card__move-option.is-current {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.live-counter__dot--flash {
  animation: livePulse 0.6s ease-out 2;
}

.app-landing__countdown { align-self: flex-start; }

.app-landing__resume-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .5rem;
}

.resume-card { display: flex; flex-direction: column; gap: .75rem; }
.resume-card__block {
  padding: .9rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.resume-card__title {
  margin: 0 0 .25rem;
  font-weight: 600;
  color: var(--text-heading);
  font-size: .92rem;
}
.resume-card__sub {
  margin: 0 0 .65rem;
  font-size: .78rem;
  color: var(--muted);
}

.library-backup {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.library-backup__import { cursor: pointer; margin: 0; }

.library-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .65rem .75rem;
  margin-bottom: .75rem;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary-light);
}
.library-bulk-bar__count {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-right: .25rem;
}
.library-bulk-bar__select {
  padding: .35rem .5rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
  font: inherit;
  font-size: .78rem;
}

.opera-card { position: relative; }
.opera-card--selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-light);
}
.opera-card__select {
  position: absolute;
  top: .55rem;
  left: .55rem;
  z-index: 2;
  display: flex;
  align-items: center;
}
.opera-card__checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.opera-card--selectable .opera-card__head,
.opera-card--selectable .opera-card__cat-row,
.opera-card--selectable .opera-card__toggle { padding-left: 1.6rem; }
.opera-card__cat-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-section-alt);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: .1rem .45rem;
  vertical-align: middle;
  margin-left: .25rem;
}
.library-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .5rem;
}
.library-toolbar .btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.app-toast {
  position: fixed;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  max-width: min(92vw, 420px);
  padding: .7rem 1rem;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.app-toast--success { background: #15803d; color: #fff; }
.app-toast--error { background: #b91c1c; color: #fff; }
.app-toast--info { background: var(--bg-dark); color: var(--bg); }
body.is-app .app-toast {
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 560px) {
  .app-zone__stats { grid-template-columns: 1fr; }
  .app-zone__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

[data-theme="dark"] .live-counter {
  background: linear-gradient(135deg, rgba(255,255,255,.04) 0%, var(--bg-card) 60%);
  box-shadow: none;
}
[data-theme="dark"] .resume-card__block { background: var(--bg-card); }
[data-theme="dark"] .navbar { background: var(--bg); border-bottom-color: var(--neutral); }
[data-theme="dark"] .editorial-section--alt { background: var(--bg-card); }
[data-theme="dark"] .three-col__item,
[data-theme="dark"] .opera-index__item,
[data-theme="dark"] .opera-cat__item,
[data-theme="dark"] .how-steps__item,
[data-theme="dark"] .how-detail__item,
[data-theme="dark"] .opera-article__related-item { background: var(--bg-card); }
[data-theme="dark"] .opera-index__item:hover,
[data-theme="dark"] .opera-cat__item:hover,
[data-theme="dark"] .opera-article__related-item:hover { background: var(--bg-section-alt); }
[data-theme="dark"] .opera-article__cta-block { background: var(--bg-card); }
[data-theme="dark"] .pricing-bar { background: var(--bg-card); }
[data-theme="dark"] .site-footer { background: #050505; }
[data-theme="dark"] .nav-app-link { background: var(--primary); color: #fff; }
[data-theme="dark"] .nav-login-btn { color: var(--text-heading); }

/* Dark theme: improve button contrast */
[data-theme="dark"] .btn.ghost {
  border-color: #5a5a5f;
  color: var(--text-heading);
  background: rgba(255,255,255,.04);
}
[data-theme="dark"] .btn.ghost:hover {
  border-color: #8a8a90;
  background: rgba(255,255,255,.08);
}
[data-theme="dark"] .btn.secondary {
  background: #2e2e32;
  color: var(--text-heading);
  border: 1.5px solid #45454b;
}
[data-theme="dark"] .btn-file {
  background: #2a2a2e;
  color: var(--text-heading);
}
[data-theme="dark"] .opera-card__actions button {
  border-color: #5a5a5f;
  color: var(--text-heading);
  background: rgba(255,255,255,.04);
}
[data-theme="dark"] .opera-card__actions button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
}
[data-theme="dark"] .library-bulk-bar {
  background: rgba(216, 88, 76, .12);
  border-color: color-mix(in srgb, var(--primary) 55%, #444);
}
[data-theme="dark"] .profile-dropdown__link--info {
  color: var(--muted-strong);
}

/* App mobile menu (burger in app mode) */
.navbar__app-menu {
  display: none;
  flex-basis: 100%;
  flex-direction: column;
  gap: 0;
  padding: .35rem 0 .75rem;
  border-top: 1px solid var(--border-light);
}
body.is-app .navbar__app-menu.is-open {
  display: flex;
}
.navbar__app-menu-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: .85rem .25rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-heading);
  cursor: pointer;
}
.navbar__app-menu-link:hover { color: var(--primary); }
.navbar__app-menu-link--premium { color: var(--primary); }
.navbar__app-menu-link--logout {
  color: var(--primary);
  border-bottom: 0;
  margin-top: .25rem;
}
.navbar__app-menu-theme {
  padding: .75rem .25rem;
  border-bottom: 1px solid var(--border-light);
}
.navbar__app-menu-label {
  margin: 0 0 .45rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
body:not(.is-app) .navbar__app-menu { display: none !important; }

/* Send operas modal */
.send-opera-dialog { max-width: 440px; text-align: left; }
.send-opera-dialog__hint {
  margin: 0 0 .75rem;
  font-size: .85rem;
  color: var(--muted);
}
.send-opera-dialog__list {
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: .75rem;
}
.send-opera-dialog__item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.send-opera-dialog__item:last-child { border-bottom: 0; }
.send-opera-dialog__item input { margin-top: .2rem; accent-color: var(--primary); }
.send-opera-dialog__meta { font-size: .78rem; color: var(--muted); }
.send-opera-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.send-opera-dialog__status {
  margin: .5rem 0 0;
  font-size: .82rem;
  min-height: 1.2em;
}
.send-opera-dialog__status.error { color: var(--primary); }
.pricing-card__status {
  margin: .65rem 0 0;
  font-size: .82rem;
  color: var(--muted-strong);
  text-align: center;
  line-height: 1.45;
}
.profile-dropdown__link--info {
  color: var(--muted-strong);
  cursor: default;
}

/* ====== Gimfy theme tweaks ====== */
[data-theme="gimfy"] .editorial-section--alt { background: var(--bg-section-alt); }

/* ====== APP LANDING POLISH (editorial, not boxed) ====== */
body.is-app #appLanding {
  max-width: 1180px;
  padding: clamp(2rem, 5vw, 4.25rem) clamp(1rem, 3vw, 2rem) clamp(4rem, 7vw, 6rem);
}
body.is-app #appLanding .app-landing__wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: clamp(1.8rem, 4vw, 3.5rem);
  align-items: start;
}
body.is-app #appLanding .app-landing__intro {
  grid-column: 1 / -1;
  max-width: 720px;
  gap: 1rem;
  padding-bottom: clamp(.25rem, 1vw, .75rem);
}
body.is-app #appLanding .app-landing__intro .eyebrow {
  color: var(--primary);
  margin-bottom: -.15rem;
}
body.is-app #appLanding .app-landing__title {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -.03em;
}
body.is-app #appLanding .app-landing__countdown {
  margin-top: .4rem;
}
body.is-app #appLanding .app-zone {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.is-app #appLanding .app-zone--romana {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}
body.is-app #appLanding .app-zone--math {
  align-self: stretch;
  padding-left: clamp(1.25rem, 3vw, 2.4rem);
  border-left: 1px solid var(--rule);
}
body.is-app #appLanding .app-zone--leaderboard {
  grid-column: 1 / -1;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--rule);
}
body.is-app #appLanding .app-zone__head--leaderboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
body.is-app #appLanding .app-zone--leaderboard .landing-leaderboard__list {
  max-width: 720px;
}
@media (max-width: 700px) {
  body.is-app #appLanding .app-zone__head--leaderboard {
    display: block;
  }
  body.is-app #appLanding .app-zone__head--leaderboard .landing-leaderboard__tabs {
    margin-top: .85rem;
  }
}
body.is-app #appLanding .app-zone__head {
  display: block;
  margin: 0;
}
body.is-app #appLanding .app-zone__title {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  line-height: 1.05;
  margin: 0 0 .45rem;
}
body.is-app #appLanding .app-zone__sub,
body.is-app #appLanding .app-zone__desc {
  max-width: 520px;
  font-size: clamp(.95rem, 1.35vw, 1.08rem);
  line-height: 1.55;
  color: var(--muted-strong);
  margin: 0;
}
body.is-app #appLanding .live-counter {
  max-width: 520px;
  padding: 1rem 0 1.05rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
body.is-app #appLanding .live-counter__badge {
  padding: .18rem .5rem;
  margin-bottom: .15rem;
}
body.is-app #appLanding .live-counter__body {
  gap: .5rem;
}
body.is-app #appLanding .live-counter__num {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
}
body.is-app #appLanding .live-counter__suffix {
  font-size: .95rem;
}
body.is-app #appLanding .app-landing__resume-label {
  margin: .15rem 0 .6rem;
  color: var(--primary);
}
body.is-app #appLanding .resume-card {
  max-width: 560px;
}
body.is-app #appLanding .resume-card__block {
  padding: 0 0 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--rule);
}
body.is-app #appLanding .resume-card__title {
  font-size: 1rem;
}
body.is-app #appLanding .app-zone__stats {
  max-width: 560px;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 1.5rem;
  margin: .15rem 0 .2rem;
  padding: .15rem 0;
}
body.is-app #appLanding .app-zone__stat {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  min-width: 105px;
}
body.is-app #appLanding .app-zone__stat-num {
  display: inline;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
}
body.is-app #appLanding .app-zone__stat-label {
  display: inline;
  margin-left: .25rem;
  font-size: .95rem;
  color: var(--muted-strong);
}
body.is-app #appLanding .app-zone__tiles {
  max-width: 620px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .6rem;
}
body.is-app #appLanding .app-zone__tile {
  min-height: 86px;
  padding: .85rem .65rem;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--bg-card);
  color: var(--text-heading);
  text-decoration: none;
}
body.is-app #appLanding .app-zone__tile:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}
body.is-app #appLanding .app-zone__tile-icon {
  font-size: 1.3rem;
}
body.is-app #appLanding .app-zone__tile--math {
  max-width: none;
  margin-top: 1.15rem;
  min-height: 0;
  flex-direction: row;
  justify-content: flex-start;
  padding: 1rem 1.05rem;
}

@media (max-width: 900px) {
  body.is-app #appLanding .app-landing__wrap {
    grid-template-columns: 1fr;
  }
  body.is-app #appLanding .app-zone--math {
    padding-left: 0;
    padding-top: 1.5rem;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  body.is-app #appLanding .app-zone__tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  body.is-app #appLanding {
    padding-top: 1.6rem;
  }
  body.is-app #appLanding .app-zone__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   Maintenance screen
   ============================================================ */
body.maintenance-active > *:not(#maintenanceScreen) {
  display: none !important;
}

.maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-heading);
}

.maintenance-screen.hidden {
  display: none;
}

.maintenance-screen__card {
  width: min(100%, 28rem);
  padding: 2.25rem 2rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.maintenance-screen__logo {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 18%;
}

.maintenance-screen__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.maintenance-screen__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}

.maintenance-screen__lead {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted-strong);
}

.maintenance-screen__timer-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: var(--radius);
}

.maintenance-screen__timer-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.maintenance-screen__timer {
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.maintenance-screen__note {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}
