:root {
  --nsxl-green: #2a7f4f;
  --nsxl-green-dark: #226340;
  --nsxl-green-light: #f4faf6;
  --nsxl-ink: #1a1a1a;
  --nsxl-muted: #5a5a5a;
  --nsxl-border: #e2e2e2;
  --nsxl-radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  color: var(--nsxl-ink);
  background: #fff;
  line-height: 1.5;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

/* --- Site header --- */

.nsxl-site-header {
  border-bottom: 1px solid var(--nsxl-border);
  padding: 1rem 1.25rem;
}

.nsxl-logo {
  display: inline-block;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--nsxl-ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nsxl-logo:hover {
  color: var(--nsxl-green);
}

/* --- Site footer --- */

.nsxl-site-footer {
  border-top: 1px solid var(--nsxl-border);
  padding: 1.25rem 1.25rem 2rem;
  max-width: 720px;
  margin: 0 auto;
}

.nsxl-site-footer p {
  margin: 0.25rem 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--nsxl-muted);
}

.nsxl-footer-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.nsxl-footer-links a {
  font-size: 0.78rem;
  color: var(--nsxl-muted);
  text-decoration: underline;
}

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

/* Reserve space so the fixed bottom tray never covers the footer —
   generous enough for the tray text wrapping to two lines on narrow
   phones, plus the iOS home-indicator safe area. */
body:has(.nsxl-tray:not([hidden])) {
  padding-bottom: 6rem;
}

/* --- Home: hero --- */

body:has(.nsxl-home-hero) main {
  max-width: 960px;
}

.nsxl-home-hero {
  text-align: center;
  padding: 3rem 0 2.5rem;
}

.nsxl-home-hero .nsxl-hero-badge {
  margin-bottom: 1rem;
}

.nsxl-home-hero h1 {
  font-size: 3.25rem;
  font-weight: 800;
  margin: 0.5rem 0 1.25rem;
  letter-spacing: -0.02em;
}

.nsxl-accent {
  color: var(--nsxl-green);
}

.nsxl-home-hero-sub {
  max-width: 56ch;
  margin: 0 auto 1.75rem;
  color: var(--nsxl-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.nsxl-home-hero-ctas {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.nsxl-hero-browse-link {
  display: block;
  text-align: center;
  color: var(--nsxl-muted);
  font-size: 0.9rem;
  text-decoration: none;
  margin-bottom: 2.5rem;
}

.nsxl-hero-browse-link:hover {
  color: var(--nsxl-green);
  text-decoration: underline;
}

.nsxl-cta-secondary {
  display: inline-block;
  border: 1px solid var(--nsxl-border);
  background: #fff;
  color: var(--nsxl-ink);
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.nsxl-cta-secondary:hover {
  border-color: var(--nsxl-green);
  color: var(--nsxl-green);
}

.nsxl-home-stats {
  display: flex;
  justify-content: center;
  gap: 2.75rem;
  flex-wrap: wrap;
}

.nsxl-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nsxl-stat-num {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--nsxl-ink);
}

.nsxl-stat-label {
  font-size: 0.78rem;
  color: var(--nsxl-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}

.nsxl-hero-image-wrap {
  text-align: center;
  margin: 0 0 3rem;
}

.nsxl-hero-image {
  width: 100%;
  max-width: 720px;
  height: auto;
}

.nsxl-trust-section {
  background: var(--nsxl-green-light);
  border-radius: var(--nsxl-radius);
  padding: 2rem;
  text-align: center;
}

.nsxl-trust-section h2 {
  margin-top: 0;
}

.nsxl-trust-section p {
  max-width: 60ch;
  margin: 0 auto 0.85rem;
  color: var(--nsxl-muted);
  line-height: 1.65;
}

.nsxl-trust-section p:last-child {
  margin-bottom: 0;
}

.nsxl-deck-category {
  margin-bottom: 2rem;
}

.nsxl-deck-category-title {
  font-size: 1rem;
  color: var(--nsxl-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
}

.nsxl-deck-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin-bottom: 0.6rem;
}

.nsxl-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0 0 3rem;
}

.nsxl-feature-card {
  border: 1px solid var(--nsxl-border);
  border-radius: var(--nsxl-radius);
  padding: 1.5rem;
}

.nsxl-feature-icon {
  width: 28px;
  height: 28px;
  display: block;
  margin-bottom: 0.75rem;
  color: var(--nsxl-green);
}

.nsxl-feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.nsxl-feature-card p {
  margin: 0;
  color: var(--nsxl-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* --- Home: study path --- */

.nsxl-path-intro {
  color: var(--nsxl-muted);
  margin: 0 0 1.5rem;
}

.nsxl-path-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.nsxl-path-level h3 {
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
}

.nsxl-path-level-icon {
  font-size: 0.95rem;
}

.nsxl-path-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.nsxl-path-list li {
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--nsxl-green);
  background: #fafafa;
  border-radius: 0 8px 8px 0;
}

.nsxl-path-list a {
  display: block;
  font-weight: 700;
  color: var(--nsxl-ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.nsxl-path-list a:hover {
  color: var(--nsxl-green);
}

.nsxl-path-desc {
  display: block;
  color: var(--nsxl-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
  line-height: 1.4;
}

/* --- Home: deck library --- */

.tagline {
  color: var(--nsxl-muted);
  margin-top: -0.5rem;
}

.nsxl-deck-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.nsxl-deck-card {
  display: block;
  border: 1px solid var(--nsxl-border);
  border-radius: var(--nsxl-radius);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nsxl-deck-card:hover {
  border-color: var(--nsxl-green);
  box-shadow: 0 2px 10px rgba(42, 127, 79, 0.12);
}

.nsxl-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.nsxl-deck-count {
  color: var(--nsxl-green);
  font-weight: 600;
  margin: 0;
  font-size: 0.9rem;
}

/* --- Deck landing page --- */

.nsxl-breadcrumb {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  color: var(--nsxl-muted);
}

.nsxl-breadcrumb a {
  color: var(--nsxl-green);
  text-decoration: none;
}

.nsxl-breadcrumb a:hover {
  text-decoration: underline;
}

.nsxl-hero {
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--nsxl-border);
  margin-bottom: 2rem;
}

.nsxl-hero-badge {
  display: inline-block;
  background: var(--nsxl-green-light);
  color: var(--nsxl-green-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.nsxl-hero h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
}

.nsxl-hero-sub {
  color: var(--nsxl-muted);
  font-size: 1.05rem;
  max-width: 56ch;
  margin: 0 0 1.25rem;
}

.nsxl-section {
  margin-bottom: 2.25rem;
}

.nsxl-section h2 {
  font-size: 1.25rem;
  margin: 0 0 0.9rem;
}

.nsxl-landing-intro p {
  line-height: 1.7;
  color: #2b2b2b;
}

.nsxl-legal-page {
  padding-top: 1.5rem;
}

.nsxl-legal-page h1 {
  margin: 1rem 0 0.25rem;
}

.nsxl-legal-updated {
  color: var(--nsxl-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.nsxl-legal-page h2 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.6rem;
}

.nsxl-legal-page p,
.nsxl-legal-page li {
  line-height: 1.7;
  color: #2b2b2b;
}

.nsxl-legal-page ul {
  padding-left: 1.25rem;
}

.nsxl-legal-page a {
  color: var(--nsxl-green);
}

.nsxl-callout {
  background: var(--nsxl-green-light);
  border: 1px solid #dcefe2;
  border-radius: var(--nsxl-radius);
  padding: 1.25rem 1.5rem;
}

.nsxl-callout h2 {
  margin-top: 0;
}

.nsxl-callout p {
  margin: 0;
  color: #2b2b2b;
}

.nsxl-hero-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nsxl-cta {
  display: inline-block;
  background: var(--nsxl-green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(42, 127, 79, 0.25);
  transition: background 0.15s, transform 0.15s;
}

.nsxl-cta:hover {
  background: var(--nsxl-green-dark);
  transform: translateY(-1px);
}

.nsxl-topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nsxl-pill {
  background: #f2f2f2;
  color: #333;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

.nsxl-sample-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.nsxl-sample-card {
  border: 1px solid var(--nsxl-border);
  border-left: 3px solid var(--nsxl-green);
  border-radius: var(--nsxl-radius);
  padding: 0.9rem 1.1rem;
}

.nsxl-sample-card strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1.02rem;
}

.nsxl-sample-card p {
  margin: 0;
  color: var(--nsxl-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.nsxl-related-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.nsxl-promo-section {
  margin-top: 2.5rem;
}

.nsxl-promo {
  background: linear-gradient(135deg, var(--nsxl-green-light), #eef8f1);
  border: 1px solid #dcefe2;
  border-radius: var(--nsxl-radius);
  padding: 1.5rem;
  text-align: center;
}

.nsxl-promo p {
  margin: 0 0 0.4rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.nsxl-promo-sub {
  font-weight: 400 !important;
  color: var(--nsxl-muted);
  font-size: 0.95rem !important;
  max-width: 48ch;
  margin: 0 auto !important;
}

/* --- Study player --- */

body:has(.nsxl-player) main,
body:has(.nsxl-quiz) main {
  padding-bottom: 5rem; /* leave room for the fixed bottom tray */
}

.nsxl-back-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--nsxl-green);
  text-decoration: none;
  font-size: 0.9rem;
}

.nsxl-deck-title {
  margin: 0.5rem 0 0.75rem;
}

.nsxl-mode-nav {
  display: inline-flex;
  gap: 0.25rem;
  background: #f2f2f2;
  border-radius: 999px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.nsxl-mode-link {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--nsxl-muted);
  text-decoration: none;
}

.nsxl-mode-link:hover {
  color: var(--nsxl-ink);
}

.nsxl-mode-link.is-active {
  background: #fff;
  color: var(--nsxl-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nsxl-loading,
.nsxl-error {
  color: #555;
}

.nsxl-error button,
.nsxl-retry {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.nsxl-setup-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.nsxl-setup-options button {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.nsxl-setup-options button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nsxl-front-toggle {
  display: inline-flex;
  gap: 0.25rem;
  background: #f2f2f2;
  border-radius: 999px;
  padding: 0.25rem;
  margin: 0.75rem 0 1.5rem;
}

.nsxl-front-option {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--nsxl-muted);
  cursor: pointer;
}

.nsxl-front-option:hover {
  color: var(--nsxl-ink);
}

.nsxl-front-option.is-active {
  background: #fff;
  color: var(--nsxl-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nsxl-setup-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.5rem;
}

.nsxl-setup-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--nsxl-ink);
  cursor: pointer;
}

.nsxl-setup-check input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--nsxl-green);
  cursor: pointer;
}

.nsxl-flashcard {
  position: relative;
  perspective: 1000px;
  width: 100%;
  max-width: 420px;
  height: 340px;
  margin: 1.5rem auto;
  cursor: pointer;
}

.nsxl-rating-badge[hidden] {
  display: none;
}

.nsxl-rating-badge {
  position: absolute;
  top: -16px;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 3;
}

.nsxl-rating-badge.is-know-it {
  left: 50%;
  transform: translateX(-50%);
  background: #1f7a43;
}

.nsxl-rating-badge.is-almost-there {
  right: -10px;
  background: #b8860b;
}

.nsxl-rating-badge.is-needs-review {
  right: -10px;
  background: #b3261e;
}

.nsxl-flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.nsxl-flashcard.is-flipped .nsxl-flashcard-inner {
  transform: rotateY(180deg);
}

.nsxl-flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border: 1px solid #ddd;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
}

.nsxl-flashcard-back {
  transform: rotateY(180deg);
  background: #f4faf6;
}

.nsxl-front-text {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.nsxl-flip-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #999;
  font-size: 0.8rem;
  margin: 0.75rem 0 0;
}

.nsxl-flip-icon {
  width: 14px;
  height: 14px;
  color: var(--nsxl-green);
}

.nsxl-back-text {
  font-size: 1rem;
  margin: 0;
}

.nsxl-clinical-tip {
  font-size: 0.85rem;
  color: #2a7f4f;
  margin: 0.75rem 0 0;
}

.nsxl-ratings {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.nsxl-ratings button {
  flex: 1;
  min-width: 110px;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
}

.nsxl-ratings [data-rate="know_it"] {
  background: #e3f6ea;
  color: #1f7a43;
}

.nsxl-ratings [data-rate="almost_there"] {
  background: #fff4d9;
  color: #8a6600;
}

.nsxl-ratings [data-rate="needs_review"] {
  background: #fde3e3;
  color: #b3261e;
}

.nsxl-memory-hook {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid #ffe1a8;
  background: #fff9ec;
  border-radius: var(--nsxl-radius);
  text-align: center;
}

.nsxl-memory-hook strong {
  display: block;
  color: #8a6600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.nsxl-memory-hook-text {
  margin: 0;
  font-size: 1.02rem;
}

.nsxl-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.nsxl-nav button {
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

.nsxl-complete-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.nsxl-complete-actions button,
.nsxl-complete-actions a {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.nsxl-study .nsxl-promo {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  text-align: left;
  background: #f4faf6;
}

.nsxl-complete .nsxl-promo {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #333;
  text-align: left;
  background: #f4faf6;
  border: none;
}

.nsxl-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  color: #fff;
  text-align: center;
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
  font-size: 0.85rem;
}

/* --- Quiz mode --- */

.nsxl-question-label {
  color: var(--nsxl-muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.nsxl-question-definition {
  border: 1px solid var(--nsxl-border);
  border-radius: var(--nsxl-radius);
  background: var(--nsxl-green-light);
  padding: 1.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.nsxl-quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.nsxl-quiz-choice {
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--nsxl-border);
  background: #fff;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  width: 100%;
  cursor: pointer;
}

.nsxl-quiz-choice:hover:not(:disabled) {
  border-color: var(--nsxl-green);
}

.nsxl-quiz-choice:disabled {
  cursor: default;
}

.nsxl-quiz-choice.is-correct {
  background: #e3f6ea;
  border-color: #1f7a43;
  color: #1f7a43;
}

.nsxl-quiz-choice.is-incorrect {
  background: #fde3e3;
  border-color: #b3261e;
  color: #b3261e;
}

.nsxl-quiz-feedback {
  margin: 1rem 0 0;
  font-weight: 700;
}

.nsxl-quiz-feedback.is-correct {
  color: #1f7a43;
}

.nsxl-quiz-feedback.is-incorrect {
  color: #b3261e;
}

.nsxl-quiz-tip {
  margin: 0.85rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid #bfe0cb;
  background: var(--nsxl-green-light);
  border-radius: var(--nsxl-radius);
  text-align: center;
}

.nsxl-quiz-tip strong {
  display: block;
  color: var(--nsxl-green-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.nsxl-quiz-tip-text {
  margin: 0;
  font-size: 0.98rem;
  color: #1d4a30;
}

.nsxl-quiz-hook {
  margin: 0.85rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid #ffe1a8;
  background: #fff9ec;
  border-radius: var(--nsxl-radius);
  text-align: center;
}

.nsxl-quiz-hook strong {
  display: block;
  color: #8a6600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.nsxl-quiz-hook-text {
  margin: 0;
  font-size: 0.98rem;
  color: #5a4400;
}

.nsxl-quiz-continue {
  display: block;
  margin: 1rem auto 0;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  border: 1px solid var(--nsxl-green);
  background: var(--nsxl-green);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.nsxl-quiz-score {
  font-size: 1.3rem;
  font-weight: 800;
}

.nsxl-quiz-missed h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.75rem;
}
