:root {
  --bg: #faf9f6;
  --bg-alt: #f3f1ec;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #5c6370;
  --border: #e7e4dd;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1fe;
  --green: #0e9f6e;
  --green-soft: #e6f6ef;
  --amber: #b45309;
  --amber-soft: #fdf1df;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.05), 0 8px 24px rgba(22, 24, 29, 0.06);
}

html.dark {
  --bg: #0f1115;
  --bg-alt: #12151b;
  --card: #171a21;
  --ink: #e8eaee;
  --muted: #9aa2b1;
  --border: #262b36;
  --accent: #5b8cff;
  --accent-ink: #0b1020;
  --accent-soft: #1a2338;
  --green: #34d399;
  --green-soft: #12271f;
  --amber: #fbbf24;
  --amber-soft: #2a2110;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Author `display` rules (flex/grid) otherwise beat the UA [hidden] rule. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 760px;
}

h1,
h2,
h3,
.brand-name,
.brand-mark,
.hero-card-title {
  font-family: "Sora", "Inter", sans-serif;
}

.mode-banner {
  background: var(--amber-soft);
  color: var(--amber);
  text-align: center;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
}

.mode-banner a {
  color: inherit;
  font-weight: 700;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-actions .btn {
  white-space: nowrap;
}

.signin-short {
  display: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

html.dark .icon-sun { display: none; }
html:not(.dark) .icon-moon { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 10px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--border);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(60% 80% at 80% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent),
    var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 28px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

.hero-points li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  margin-right: 10px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  transform: rotate(1.5deg);
}

.hero-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.hero-card-title {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
}

.hero-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--bg-alt);
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 8px;
}

.hero-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.hero-row-final {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 680px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.section-head p {
  color: var(--muted);
  font-size: 16.5px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.product-card .tagline {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 14px;
}

.product-card.featured {
  border: 2px solid var(--accent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--card)), var(--card));
}

.product-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
  padding-right: 70px;
}

.bullets {
  list-style: none;
  margin-bottom: 18px;
  flex-grow: 1;
}

.bullets li {
  font-size: 13.5px;
  color: var(--muted);
  padding-left: 20px;
  position: relative;
  margin-bottom: 5px;
}

.bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.price {
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 800;
}

.anchor {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 15px;
}

.save-pill {
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.buy-btn {
  width: 100%;
}

.pay-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 0.2px;
}

.flag {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.how-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.how-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.how-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
}

.how-step strong {
  font-family: "Sora", sans-serif;
  font-size: 15.5px;
}

.how-step p {
  color: var(--muted);
  font-size: 13.5px;
}

.guarantee-band {
  padding: 56px 0;
}

.guarantee-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.guarantee-inner h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  margin-bottom: 8px;
}

.guarantee-inner p {
  color: var(--muted);
  max-width: 62ch;
  font-size: 15.5px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-cat {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-free { background: var(--green-soft); color: var(--green); }
.badge-paid { background: var(--amber-soft); color: var(--amber); }
.badge-freemium { background: var(--accent-soft); color: var(--accent); }

#resource-grid h3 {
  font-size: 17.5px;
  margin-bottom: 8px;
}

.rating {
  font-size: 12px;
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-weight: 500;
  vertical-align: middle;
  white-space: nowrap;
}

#resource-grid .card p {
  color: var(--muted);
  font-size: 14px;
  flex-grow: 1;
  margin-bottom: 16px;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.card-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.grid-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.newsletter-box {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #111));
  color: #fff;
  border-radius: 22px;
  padding: 56px 32px;
  text-align: center;
}

.newsletter-box h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: 12px;
}

.newsletter-box p {
  max-width: 54ch;
  margin: 0 auto 28px;
  opacity: 0.92;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.95);
  color: #16181d;
}

.newsletter-form input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.7);
}

.newsletter-form .btn-primary {
  background: #fff;
  color: #16181d;
}

.newsletter-note {
  margin-top: 14px !important;
  font-size: 13px !important;
  opacity: 0.75 !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  position: relative;
  background: var(--card);
  color: var(--ink);
  border-radius: 18px;
  max-width: 480px;
  width: 100%;
  padding: 30px;
  box-shadow: var(--shadow);
}

.modal h3 {
  font-size: 21px;
  margin-bottom: 14px;
}

.modal p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 12px;
}

.modal-small {
  font-size: 13px !important;
}

.modal code {
  background: var(--bg-alt);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
}

.container-narrow details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 12px;
}

.container-narrow summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 15.5px;
  list-style-position: inside;
}

.container-narrow details p {
  color: var(--muted);
  margin-top: 10px;
  font-size: 14.5px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  background: var(--bg);
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.copyright {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-card {
    max-width: 420px;
    transform: none;
    margin: 0 auto;
  }
  .nav-links {
    display: none;
  }
  .section {
    padding: 60px 0;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .product-card h3 {
    padding-right: 0;
  }
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------------------ */
/* Cheatsheet library                                                  */
/* ------------------------------------------------------------------ */

.library-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-size: 15.5px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.library-status {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 20px;
}

.sheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.sheet-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.sheet-card {
  display: flex;
  flex-direction: column;
}

.sheet-card .tagline {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sheet-outline-wrap {
  border-top: 1px dashed var(--border);
  margin-bottom: 12px;
}

.sheet-outline-wrap summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.sheet-outline-wrap summary::-webkit-details-marker { display: none; }

.sheet-outline-wrap summary::before {
  content: "▸";
  color: var(--accent);
  font-size: 11px;
  transition: transform 0.15s ease;
}

.sheet-outline-wrap[open] summary::before {
  transform: rotate(90deg);
}

.sheet-outline-wrap summary .outline-n {
  margin-left: auto;
  font-weight: 500;
  opacity: 0.8;
}

.sheet-outline-wrap[open] summary {
  color: var(--ink);
}

.sheet-card.locked {
  background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 3%, var(--card)), var(--card));
}

.sheet-outline {
  list-style: none;
  margin: 0 0 12px;
  max-height: 210px;
  overflow-y: auto;
}
.sheet-outline li {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0 4px 18px;
  position: relative;
  border-bottom: 1px dashed var(--border);
}
.sheet-outline li:last-child {
  border-bottom: none;
}
.sheet-outline li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
  top: 5px;
}
.sec-count {
  float: right;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.sheet-meta {
  font-size: 12px;
  color: var(--muted);
}

.access-status {
  margin-top: 24px;
  text-align: center;
}
.access-granted {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--green-soft);
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
}

/* Modal sheet content */
.sheet-body {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 8px;
}

/* ---- Flashcard deck (recall-first, Anki style) ---- */
.modal-deck {
  max-width: 720px;
  width: 100%;
  border-top: 4px solid var(--accent);
  align-self: flex-start;
  margin-top: 3vh;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 22px 26px 0;
  overflow: hidden;
}

.modal-deck h3 {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 10px;
}

.modal-deck #modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.deck-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.deck-scope select {
  max-width: 300px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.deck-tools {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.deck-tool {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 9px;
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.deck-tool:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--accent);
}

.deck-tool:disabled {
  opacity: 0.6;
  cursor: default;
}

.deck-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.deck-cardno {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-chip {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.deck-chip.is-new { background: var(--bg-alt); color: var(--muted); }
.deck-chip.is-learning { background: var(--amber-soft); color: var(--amber); }
.deck-chip.is-known { background: var(--green-soft); color: var(--green); }

.deck-counter {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deck-meter {
  display: flex;
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--bg-alt);
  margin-bottom: 6px;
}

.deck-meter span {
  height: 100%;
  width: 0;
  transition: width 0.25s ease;
}

.meter-known { background: var(--green); }
.meter-learning { background: var(--amber); }

.deck-counts {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.count-known { color: var(--green); font-weight: 600; }
.count-learning { color: var(--amber); font-weight: 600; }

.deck-body {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 18px 20px;
  min-height: 170px;
}

.deck-prompt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deck-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--muted);
}

.deck-q {
  font-family: "Sora", sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
}

.deck-q code,
.deck-a code {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-feature-settings: "liga" 0, "calt" 0;
}

.deck-hint {
  font-size: 12.5px;
  color: var(--muted);
}

.deck-answer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-a {
  font-size: 14.6px;
  line-height: 1.62;
  color: var(--ink);
}

.deck-code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  white-space: pre;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0, "clig" 0, "dlig" 0;
}

.tok-com { color: var(--muted); font-style: italic; }
.tok-str { color: var(--green); }
.tok-kw { color: #7c3aed; }
.tok-num { color: var(--amber); }
html.dark .tok-kw { color: #a78bfa; }

.deck-example {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.deck-example-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.deck-controls {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 18px;
  background: linear-gradient(to top, var(--card) 72%, transparent);
}

.deck-grading {
  flex: 1;
  display: flex;
  gap: 10px;
  justify-content: center;
  min-width: 0;
}

.deck-primary,
.deck-grade {
  border-radius: 12px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.deck-primary {
  border: 2px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.deck-primary:hover { filter: brightness(1.08); }

.deck-grade {
  flex: 1;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--ink);
}

.deck-learning:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}

.deck-known:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.deck-nav {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.deck-nav:hover {
  color: var(--ink);
  border-color: var(--accent);
}

kbd {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.65;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: 1px;
}

/* Round summary */
.deck-summary {
  padding: 10px 2px 20px;
}

.summary-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
}

.summary-title {
  font-family: "Sora", sans-serif;
  font-size: 26px;
  margin: 6px 0 16px;
}

.summary-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.summary-stats li {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--bg-alt);
  color: var(--muted);
}

.summary-stats .is-known { background: var(--green-soft); color: var(--green); }
.summary-stats .is-learning { background: var(--amber-soft); color: var(--amber); }

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.deck-secondary {
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.deck-secondary:hover { border-color: var(--accent); color: var(--accent); }

.summary-clear {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}

.summary-unlock {
  margin-top: 22px;
  padding: 16px;
  border: 1px dashed var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.summary-unlock p {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

@media (max-width: 600px) {
  .modal-backdrop { padding: 0; }
  .modal-deck {
    max-width: none;
    margin-top: 0;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    padding: 14px 16px 0;
  }
  /* Fill the screen: the prompt area takes the slack, controls stay put. */
  .modal-deck { display: flex; flex-direction: column; }
  .modal-deck #modal-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .modal-deck .deck { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .modal-deck .deck-body { flex: 1; min-height: 0; overflow-y: auto; }
  .deck-toolbar { flex-wrap: wrap; gap: 8px; }
  .deck-scope { width: 100%; }
  .deck-scope select { flex: 1; max-width: none; }
  .deck-tools { width: 100%; justify-content: flex-end; }
  .deck-q { font-size: 17px; }
  .deck-body { padding: 15px 16px; }
  .deck-controls { gap: 8px; padding: 12px 0 12px; }
  .deck-grading { gap: 8px; flex-wrap: nowrap; }
  .deck-primary, .deck-grade { padding: 11px 10px; font-size: 12.5px; }
  .deck-nav { width: 36px; height: 36px; }
  kbd { display: none; }
}


/* ---- Flashcard deck (Anki/Quizlet style) ---- */
.modal-deck {
  max-width: 640px;
  border-top: 4px solid var(--accent);
}


/* Hero code block */
.hero-code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ink);
  margin-bottom: 10px;
}
.c-kw { color: var(--accent); font-weight: 600; }
.c-num { color: var(--amber); }

@media (max-width: 600px) {
  .sheet-list { grid-template-columns: 1fr; }
  .brand-name { display: none; }
  .signin-full { display: none; }
  .signin-short { display: inline; }
  .nav-inner { gap: 10px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-sm { padding: 8px 11px; font-size: 13px; }
  .container { padding: 0 18px; }
}

/* User chip (signed-in account menu) */
.user-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-chip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(120, 120, 140, 0.25));
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  max-width: 200px;
  white-space: nowrap;
}

.user-chip-trigger span:not(.avatar-fallback) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip-trigger svg { flex: none; opacity: 0.7; }

.user-chip img,
.user-chip .avatar-fallback {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
}

.user-chip .avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: var(--card, #fff);
  border: 1px solid var(--line, rgba(120, 120, 140, 0.2));
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 20, 40, 0.16);
  z-index: 60;
  overflow: hidden;
  text-align: left;
}

.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, rgba(120, 120, 140, 0.15));
}

.user-menu-head strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
}

.user-menu-head small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
}

.user-menu-plan.plan-complete { color: #1a8f3c; background: rgba(26, 143, 60, 0.08); }
.user-menu-plan.plan-languages { color: var(--accent); background: var(--accent-soft); }
.user-menu-plan.plan-free { color: var(--muted); }

.user-menu-plan a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.user-menu-plan a:hover { text-decoration: underline; }

.user-purchases {
  margin: 0;
  padding: 8px 14px;
  list-style: none;
  font-size: 12px;
  color: var(--ink);
  border-top: 1px solid var(--line, rgba(120, 120, 140, 0.12));
}

.user-menu-signout {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-top: 1px solid var(--line, rgba(120, 120, 140, 0.15));
  background: none;
  color: #d33;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.user-menu-signout:hover { background: rgba(220, 50, 50, 0.07); }

@media (max-width: 640px) {
  .user-menu { right: -8px; }
}

/* ---- Sheet preview (locked decks: 3 sample cards + unlock bar) ---- */
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-cta-ghost {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
}

.card-cta-ghost:hover {
  border-style: solid;
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.deck-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 14px;
  color: var(--muted);
}

.deck-preview-bar .card-cta {
  padding: 8px 14px;
  font-size: 13.5px;
}

.deck.is-preview .deck-progress-fill {
  background: var(--muted);
}

/* ---- Testimonials ---- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 940px) {
  .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .testimonial-grid { grid-template-columns: 1fr; }
}

.testimonial-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.testimonial-stars {
  color: var(--accent);
  letter-spacing: 2px;
  font-size: 14px;
}

.testimonial-card blockquote {
  margin: 0;
  font-size: 14.8px;
  line-height: 1.65;
  color: var(--ink);
  flex-grow: 1;
}

.testimonial-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
}

.testimonial-card .t-name {
  font-weight: 650;
  color: var(--ink);
}

.testimonial-card .t-role {
  color: var(--muted);
}
