
/* ==========================================================================
   Utsho — presentation.css
   The shared look of buttons, cards, borders, shadows. Depends on colors.css,
   typography.css, and spacing.css being loaded first.
   Source: Platform Blueprint v5 §2 + v6 UI Addendum §1 (colored shadows).
   ========================================================================== */

/* A subtle staggered entrance for a grid of cards — capped at 6 items
   so a long list doesn't keep animating for seconds after load, and
   fully disabled under prefers-reduced-motion via the existing global
   rule further down this file. */
.stagger-fade-in > * { animation: page-header-fade-in 0.45s ease both; }
.stagger-fade-in > *:nth-child(1) { animation-delay: 0s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.12s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.18s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.24s; }
.stagger-fade-in > *:nth-child(n+6) { animation-delay: 0.3s; }
.card {
  background: var(--card);
  border: 1px solid transparent; /* kept in the box model for layout stability; shadow alone now does the visual separation, not a hard edge */
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  box-shadow: 0 1px 2px rgba(30, 22, 15, 0.03), 0 10px 28px rgba(30, 22, 15, 0.07); /* softer than before — a card should read as floating, not boxed */
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
/* A gentle lift on hover for interactive cards (links, buttons inside a
   card, clickable cards) — matches the "lift a few pixels, not a bounce"
   rule already used for buttons (v5 §17). Cards that are purely static
   containers (no click/hover meaning) are unaffected in practice since
   nothing changes visually if the pointer never lands there meaningfully,
   but this keeps every truly clickable card across the site consistent
   without needing a separate class per page. */
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(30, 22, 15, 0.05), 0 20px 40px rgba(30, 22, 15, 0.11); }

/* Colored cards get a tinted shadow in their own hue at low opacity
   (v6 §1). Only apply these classes to cards that already carry a color
   identity — sky, gold, teal, terracotta. Plain cards keep .card above. */
.card--sky {
  background: rgba(233, 240, 245, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(93, 143, 174, 0.4);
  box-shadow: 0 8px 24px rgba(93, 143, 174, 0.18);
}
.card--gold {
  background: rgba(247, 239, 220, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(156, 122, 46, 0.4);
  box-shadow: 0 8px 24px rgba(156, 122, 46, 0.18);
}
.card--accent {
  background: rgba(231, 240, 235, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(47, 107, 90, 0.35);
  box-shadow: 0 8px 24px rgba(47, 107, 90, 0.18);
}
.card--primary {
  background: rgba(248, 228, 214, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 69, 29, 0.35);
  box-shadow: 0 8px 24px rgba(168, 69, 29, 0.2);
}
.card--mint {
  background: rgba(227, 243, 240, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(108, 194, 192, 0.45);
  box-shadow: 0 8px 24px rgba(108, 194, 192, 0.2);
}
.card--violet {
  background: rgba(237, 233, 250, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(106, 90, 205, 0.4);
  box-shadow: 0 8px 24px rgba(106, 90, 205, 0.18);
}

.tag--violet { background: var(--violet); }

/* Gradient border — for one special highlight card per page at most. Uses
   a masked pseudo-element so the border itself is a gradient ring while
   the card's actual background/radius stay untouched. */
.gradient-border { position: relative; }
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--mint-4), var(--primary), var(--violet));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ==========================================================================
   Page-header — a contained, rounded card. Color variety across
   page-headers now comes from the ink-spread system (see colors.css
   and the .ink-spread utilities below) rather than tinted backgrounds
   or brush-stroke shapes — a soft, corner-anchored glow that fades to
   full transparency well before reaching the text column, so it can
   never clip awkwardly or overlap content the way a fixed shape could.
   ========================================================================== */
.page-header {
  /* Contained, rounded card. */
  border-radius: var(--radius-xl);
  margin: 0 0 var(--space-2);
  padding: var(--space-12) var(--space-8) !important;
  position: relative;
  overflow: hidden;
  animation: page-header-fade-in 0.5s ease both;
  background: var(--card);
}
.page-header > * { position: relative; z-index: 1; }
.page-header > h1, .page-header > p { max-width: 46ch; }

@keyframes page-header-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page-header, .hero, .section-band { animation: none; }
  .stagger-fade-in > * { animation: none; }
  .card:hover { transform: none; }
}
/* Subject/course overview pages — plain card background, matching the
   rest of the site's neutral surfaces. No tinted washes ("blue box"
   backgrounds) and no decorative shapes — removed per direct request. */
/* Each existing variant class now carries a different ink-spread color
   automatically — no per-page HTML changes needed, same as before. */
.page-header--mint,
.page-header--violet,
.page-header--warm,
.page-header--mesh,
.page-header--gold { background: var(--card); position: relative; overflow: hidden; }
.page-header--mint::before,
.page-header--violet::before,
.page-header--warm::before,
.page-header--mesh::before,
.page-header--gold::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -10%;
  width: 40%;
  height: 90%;
  pointer-events: none;
  z-index: 0;
}
.page-header--mint::before    { background: var(--ink-mint); }
.page-header--violet::before  { background: var(--ink-violet); }
.page-header--warm::before    { background: var(--ink-terracotta); }
.page-header--mesh::before    { background: var(--ink-gold); }
.page-header--gold::before    { background: var(--ink-gold); }

/* ---- Ink-spread utilities (Sep 2026) ----
   For anywhere else a soft color glow is wanted (feature cards, extra
   sections) — add the base class plus one color modifier directly.
   Always fades to full transparency, so it's safe behind text: there
   is never a hard edge to clip or overlap. Never stack two on the
   same element. */
.ink-spread { position: relative; overflow: hidden; }
.ink-spread::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -10%;
  width: 45%;
  height: 90%;
  pointer-events: none;
  z-index: 0;
}
.ink-spread > * { position: relative; z-index: 1; }
.ink-spread--terracotta::before { background: var(--ink-terracotta); }
.ink-spread--teal::before       { background: var(--ink-teal); }
.ink-spread--violet::before     { background: var(--ink-violet); }
.ink-spread--gold::before       { background: var(--ink-gold); }
.ink-spread--sky::before        { background: var(--ink-sky); }
.ink-spread--mint::before       { background: var(--ink-mint); }

/* ==========================================================================
   Section background band — a full-bleed strip behind a section, used
   to create visual rhythm between sections. Color variety now comes
   from the ink-spread system below, not tinted backgrounds.
   ========================================================================== */
.section-band {
  margin: var(--space-16) calc(50% - 50vw);
  padding: var(--space-16) calc(50vw - 50% + var(--page-padding-x));
  background: var(--card);
  position: relative;
  overflow: hidden;
}
.section-band > * { position: relative; z-index: 1; }
.section-band--mint,
.section-band--violet-glow,
.section-band--gold-glow,
.section-band--mesh { background: var(--card); }
.section-band--mint::before,
.section-band--violet-glow::before,
.section-band--gold-glow::before,
.section-band--mesh::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -8%;
  width: 35%;
  height: 90%;
  pointer-events: none;
  z-index: 0;
}
.section-band--mint::before        { background: var(--ink-mint); }
.section-band--violet-glow::before { background: var(--ink-violet); }
.section-band--gold-glow::before   { background: var(--ink-gold); }
.section-band--mesh::before        { background: var(--ink-terracotta); }

/* ---- Note / callout boxes (left-border accent style, used throughout blueprint) ---- */
.note {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-small);
  color: var(--muted);
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); } /* "lift a few pixels, not a bounce" — v5 §17 */

.btn--primary {
  background: var(--gradient-primary);
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(168, 69, 29, 0.32);
}
.btn--primary:hover { box-shadow: 0 14px 30px rgba(168, 69, 29, 0.4); }
.btn--secondary {
  background: var(--card);
  color: var(--primary);
  border-color: var(--primary);
}
.btn--accent {
  background: var(--gradient-accent);
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(47, 107, 90, 0.28);
}

/* ---- Tags / pills ---- */
.tag {
  display: inline-block;
  background: var(--secondary);
  color: #FFFFFF;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.tag--gold {
  background: var(--gold);
  color: #FFFFFF;
}
.tag--soon {
  background: var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ---- Locked / unlocked content indicator (v6 §4) ----
   Distinct from .tag--soon: a lock means "exists, finish the prior step
   first." tag--soon means "doesn't exist in the build yet." Never mix these. */
.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: 9px;
  color: #FFFFFF;
}
.lock-icon--open   { background: var(--accent); }
.lock-icon--closed { background: var(--border-strong); }

/* ---- Progress bar (animates on load — v5 §17) ---- */
.progress-track {
  background: var(--border);
  border-radius: var(--radius-pill);
  height: 14px;
  overflow: hidden;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

/* ---- Accordion note card ----
   Structure expected in HTML:
   <div class="accordion-item">
     <h3><button class="accordion-header" aria-expanded="false" aria-controls="ID">
       <span class="accordion-header__title"><span class="accordion-chevron" aria-hidden="true">▸</span>Title</span>
     </button></h3>
     <div class="accordion-body" id="ID" hidden><div class="accordion-body__inner">...</div></div>
   </div>
*/
.accordion-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.accordion-item--open { border-color: var(--primary); }

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: none;
  border: none;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}
.accordion-header__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.02rem;
}
.accordion-chevron {
  display: inline-block;
  color: var(--primary);
  transition: transform 0.2s ease;
  font-size: 0.8em;
}
.accordion-item--open .accordion-chevron { transform: rotate(90deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.accordion-item--open .accordion-body { max-height: 600px; } /* generous cap; content is short */
.accordion-body__inner {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}
.accordion-body__inner p { margin: 0 0 var(--space-3); }
.accordion-body__inner p:last-child { margin-bottom: 0; }

/* Context card — small cross-link callout under a note (v5 §5) */
.context-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  background: var(--accent-tint);
  border: 1px solid var(--sky);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: var(--space-2);
}

/* ---- Fine print ---- */
.sub { color: var(--muted); font-size: 0.88rem; }

/* ---- Accessibility: visible keyboard focus everywhere ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip-to-content link — hidden until focused, first thing a keyboard/
   screen-reader user can activate on every page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #FFFFFF;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 100;
  text-decoration: none;
  font-size: 0.85rem;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Site header / primary navigation
   Same markup + classes on every page — see pages/home.html for the
   reference implementation. Mobile-first: hamburger below 640px, full
   inline nav from 640px up.
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 238, 223, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--page-padding-x);
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
@media (max-width: 420px) {
  .site-header__inner { gap: var(--space-2); }
  .site-logo__img { height: 19px; }
}
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  margin-right: auto; /* pins logo left; nav/auth/toggle group together on the right */
}
.site-logo__img {
  height: 22px;
  width: auto;
  display: block;
}
@media (min-width: 640px) {
  .site-logo__img { height: 26px; }
}

/* Inline nav — desktop/tablet only */
.site-nav { display: none; }
.site-nav ul { list-style: none; display: flex; gap: var(--space-6); margin: 0; padding: 0; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { border-color: var(--primary); color: var(--primary); }

/* Hamburger toggle — mobile only */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 16px; height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  border-top: 1px solid var(--border);
  background: rgba(246, 238, 223, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav ul { list-style: none; margin: 0; padding: var(--space-2) var(--page-padding-x) var(--space-4); }
.mobile-nav a {
  display: block;
  padding: var(--space-3) 0;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a[aria-current="page"] { color: var(--primary); font-weight: 600; }

@media (min-width: 640px) {
  .site-nav { display: block; }
  .nav-toggle, .mobile-nav { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: var(--space-16) calc(50vw - 50% + var(--page-padding-x)) var(--space-12);
  margin: 0 calc(50% - 50vw) var(--space-6);
  background: var(--gradient-hero-bg);
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  align-items: center;
  text-align: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  animation: page-header-fade-in 0.5s ease both;
}
.hero::before {
  content: "";
  position: absolute;
  top: -12%;
  left: -8%;
  width: 40%;
  height: 90%;
  background: var(--ink-terracotta);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  max-width: 16ch;
  margin: var(--space-3) 0;
}
.hero p.lede {
  max-width: 52ch;
  font-size: 1.1rem;
  color: var(--muted);
}
.hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* Card-stack "product preview" visual — replaces the old ray-mark SVG */
.hero__visual {
  position: relative;
  width: min(400px, 85vw);
  height: 340px;
}
.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 56px rgba(30, 22, 15, 0.22);
  display: block;
}

/* Floating glass card — genuine glassmorphism: translucent background +
   backdrop blur, so the photo shows through softly behind it. Used here
   and nowhere else on the hero, keeping the effect a deliberate accent
   rather than applied everywhere (see also: sticky header, avatar menu). */
.hero__visual-card--floating {
  position: absolute;
  bottom: -28px;
  right: -20px;
  width: 240px;
  background: rgba(255, 253, 249, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(30, 22, 15, 0.2);
  padding: var(--space-5);
  text-align: left;
}

/* Small floating decorative shapes around the hero visual — echoes the
   "celebration/achievement" feeling from the reference photos without
   using literal photography. Purely decorative, aria-hidden. */
.hero__visual-shape {
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}
.hero__visual-shape--2 { width: 30px; height: 30px; background: var(--gold); top: -14px; left: -14px; opacity: 0.85; }
.hero__visual-shape--3 { width: 18px; height: 18px; background: var(--violet); top: 40%; right: -18px; opacity: 0.75; }

@media (max-width: 639px) {
  .hero__visual-card--floating { position: static; width: 100%; margin-top: var(--space-4); }
}

.hero__visual-eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
.hero__visual-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: var(--space-2) 0 0;
}
.hero__visual-tags { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.hero__visual-tags .tag { color: #FFFFFF; }

@media (min-width: 900px) {
  .hero { flex-direction: row; text-align: left; justify-content: space-between; padding-top: var(--space-16); padding-bottom: var(--space-16); }
  .hero__content { flex: 1; }
  .hero__actions { justify-content: flex-start; }
  .hero p.lede { margin-left: 0; }
}

/* ==========================================================================
   Site footer
   ========================================================================== */
.site-footer {
  margin-top: var(--space-16);
  border-top: 1px solid var(--border);
  background: var(--card);
}
/* Multi-tonal wash + faint dot grid — sits behind the contact content
   only. Scoped to .site-footer__inner specifically (not the outer
   .site-footer) so it never reaches .site-footer__bottom's separate
   legal-links row, which the reference clearly shows on a clean plain
   background below. */
.site-footer__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-12) var(--page-padding-x) var(--space-8);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}
@media (min-width: 780px) {
  .site-footer__inner { grid-template-columns: 1.3fr 1fr 1fr; gap: var(--space-8); }
}

.site-footer__brand { display: flex; flex-direction: column; gap: var(--space-3); max-width: 34ch; }
.site-footer__brand-row { display: flex; align-items: center; gap: var(--space-2); }

.site-footer__social { display: flex; gap: var(--space-3); margin-top: var(--space-2); }
.site-footer__social a {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.site-footer__social a:hover { background: var(--primary); color: #FFFFFF; }
.site-footer__social svg { width: 16px; height: 16px; }

.site-footer__col h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}
.site-footer__links { display: flex; flex-direction: column; gap: var(--space-3); }
.site-footer__links a { color: var(--text); text-decoration: none; font-size: 0.92rem; }
.site-footer__links a:hover { color: var(--primary); }

.site-footer__contact-email {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.92rem;
  display: block;
  margin-bottom: var(--space-4);
}

.site-footer__bottom {
  border-top: 1px solid var(--border);
}
.site-footer__bottom-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--page-padding-x);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: 0.82rem;
  color: var(--muted);
}
@media (min-width: 640px) {
  .site-footer__bottom-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}
.site-footer__legal-links { display: flex; gap: var(--space-5); }
.site-footer__legal-links a { color: var(--muted); text-decoration: none; }
.site-footer__legal-links a:hover { color: var(--primary); }

/* ==========================================================================
   Breadcrumb (Learn → Subject → Course → Lesson hierarchy)
   ========================================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: var(--space-4);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb__current { color: var(--text); font-weight: 500; }
.breadcrumb__sep { opacity: 0.6; }

/* ==========================================================================
   Chapter cards (Subject page — list of chapters within one subject)
   ========================================================================== */
.chapter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 640px) { .chapter-grid { grid-template-columns: repeat(2, 1fr); } }

.chapter-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chapter-card--available:hover { transform: translateY(-2px); }
.chapter-card--locked {
  opacity: 0.65;
  cursor: default;
  background: var(--bg);
}
.chapter-card__title { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.chapter-card__meta { display: flex; align-items: center; gap: var(--space-2); }

/* ==========================================================================
   Course map — chapter-level path across a subject (v5 §6).
   IMPORTANT: before accounts exist (Module 6), this shows CONTENT
   AVAILABILITY (published / not yet written), never fake personal
   progress. Do not add a "you are here" marker until real per-user state
   exists — a visitor who has never logged in must never be shown progress
   that implies the site recognizes them.
   ========================================================================== */
.course-map { padding: var(--space-6) var(--space-4) var(--space-3); overflow-x: auto; }
.course-map__track { position: relative; }
.course-map__line {
  position: absolute;
  left: 28px; right: 28px; top: 19px;
  height: 3px;
  background: var(--border);
  z-index: 0;
}
.course-map__line-fill {
  position: absolute;
  left: 28px; top: 19px;
  height: 3px;
  background: var(--accent);
  z-index: 1;
}
.course-map__nodes {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
}
.course-map__node { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); width: 84px; }
.course-map__dot {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  color: #FFFFFF;
  border: 3px solid var(--card);
}
.course-map__dot--published { background: var(--accent); }
.course-map__dot--current   { background: var(--primary); width: 44px; height: 44px; font-weight: 700; }
.course-map__dot--locked    { background: var(--border-strong); }
.course-map__label { font-size: 0.78rem; text-align: center; color: var(--text); }
.course-map__label--muted { color: var(--muted); }
.course-map__legend { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-5); font-size: 0.82rem; color: var(--muted); }
.course-map__legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: var(--space-1); vertical-align: middle; }

/* ==========================================================================
   Lesson list rows (Course/chapter page)
   ========================================================================== */
.lesson-list { display: flex; flex-direction: column; gap: var(--space-2); }
.lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}
.lesson-row__label { display: flex; align-items: center; gap: var(--space-3); }
.lesson-row__number {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 2ch;
}
.lesson-row__title { font-weight: 500; }
.lesson-row__desc { color: var(--muted); font-size: 0.85rem; margin: 2px 0 0; }

/* ==========================================================================
   Lesson page layout (Module 3)
   Mobile: single column, everything stacks (notes → video → practice).
   Desktop (≥900px): two columns — notes+video left, practice preview right.
   ========================================================================== */
.lesson-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
@media (min-width: 900px) {
  .lesson-layout { flex-direction: row; align-items: flex-start; }
  .lesson-layout__main { flex: 1 1 60%; min-width: 0; }
  .lesson-layout__side { flex: 1 1 34%; position: sticky; top: 88px; }
}
.lesson-notes { display: flex; flex-direction: column; gap: var(--space-3); }

/* Video placeholder — honest state: no real video embedded yet */
.video-placeholder {
  background: var(--text);
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--bg);
  margin-top: var(--space-5);
}
.video-placeholder__play {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(251,246,238,0.5);
  display: flex; align-items: center; justify-content: center;
}

/* Practice & Solutions preview panel */
.practice-preview__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  font-size: 0.88rem;
}
.practice-preview__item:last-child { margin-bottom: 0; }

/* Prev/Next lesson navigation */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}
.lesson-nav__btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: var(--card);
  transition: transform 0.15s ease;
}
.lesson-nav__btn:hover { transform: translateY(-2px); }
.lesson-nav__btn--disabled {
  border-color: var(--border);
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   Practice & Solutions (Module 4) — split-screen question/explanation
   pattern from v5 §13. Question and explanation are separate cards so the
   explanation can be hidden behind a reveal toggle until the student wants
   it — practice value comes from attempting first, not reading the answer
   immediately alongside the question.
   ========================================================================== */
.practice-item { margin-bottom: var(--space-8); scroll-margin-top: 90px; }
.practice-item:last-child { margin-bottom: 0; }

.practice-split {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: stretch;
}
@media (min-width: 900px) {
  .practice-split { flex-direction: row; }
  .practice-split > * { flex: 1 1 50%; min-width: 0; }
}

.question-card, .solution-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.solution-card { border-color: var(--accent); }

.practice-panel-label {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  color: #FFFFFF;
}
.practice-panel-label--question { background: var(--sky); }
.practice-panel-label--solution { background: var(--accent); }

.question-card__stem p { margin: 0 0 var(--space-3); }
.question-card__part { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.question-card__part:last-child { margin-bottom: 0; }
.question-card__marks { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.reveal-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.solution-card__body[hidden] { display: none; }
.marking-guide {
  background: var(--accent-tint);
  border: 1px solid var(--sky);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: 0.9rem;
}
.marking-guide ul { margin: 0; padding-left: 18px; }
.marking-guide li { margin-bottom: var(--space-2); }
.marking-guide li:last-child { margin-bottom: 0; }

/* ==========================================================================
   Nav auth area (Module 6) — sign-in state shown in every header.
   Populated entirely by auth.js via createElement/textContent, never
   innerHTML, since a signed-in user's display name is technically
   attacker-influenceable (it comes from their Google profile).
   ========================================================================== */

/* ==========================================================================
   Dashboard (Module 6)
   ========================================================================== */
.dash-signed-out {
  text-align: center;
  padding: var(--space-16) 0;
  max-width: 46ch;
  margin: 0 auto;
}
.dash-welcome {
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.dash-welcome h1 { margin-bottom: var(--space-1); }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
@media (min-width: 720px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
.dash-card { display: flex; flex-direction: column; gap: var(--space-3); }
.dash-card h3 { font-size: 1rem; margin: 0 0 var(--space-1); }
.dash-empty-state {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Mark-complete button on a lesson page */
.lesson-complete-btn { display: inline-flex; align-items: center; gap: var(--space-2); }
.lesson-complete-btn[data-completed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* ==========================================================================
   Form fields — used by onboarding, account settings, feedback
   ========================================================================== */
.field-group { margin-bottom: var(--space-5); text-align: left; }
.field-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.field-group .field-hint { font-size: 0.8rem; color: var(--muted); margin-top: var(--space-1); }
.field-input, .field-select, .field-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(168, 69, 29, 0.12);
}
.field-input[disabled] { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.field-textarea { resize: vertical; min-height: 120px; font-family: var(--font-body); }
.field-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237C6D57' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--space-4) center; padding-right: var(--space-8); }
.form-error { color: var(--primary); font-size: 0.85rem; margin-top: var(--space-2); }
.form-success { color: var(--accent); font-size: 0.9rem; margin-top: var(--space-3); }

/* ==========================================================================
   Nav auth — avatar-only with dropdown menu (replaces the text-based
   sign-in/sign-out area from Module 6)
   ========================================================================== */
.nav-auth { position: relative; }
.nav-auth__avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #FFFFFF;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.nav-auth__avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.nav-auth__signin-btn { font-size: 0.82rem; padding: var(--space-1) var(--space-4); }

.nav-auth__menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: rgba(255, 253, 249, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(30, 22, 15, 0.16);
  padding: var(--space-2);
  z-index: 60;
}
.nav-auth__menu[hidden] { display: none; }
.nav-auth__menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.nav-auth__menu-item:hover { background: var(--bg); }
.nav-auth__menu-item--danger { color: var(--primary); }
.nav-auth__menu-divider { height: 1px; background: var(--border); margin: var(--space-2) var(--space-1); }

/* ==========================================================================
   Onboarding / auth-callback pages
   ========================================================================== */
.onboarding-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
  text-align: center;
}
.onboarding-card { text-align: left; padding: var(--space-8); margin-top: var(--space-8); }
.auth-loading-wrap {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  text-align: center;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Notification bell (Batch D)
   ========================================================================== */
.nav-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  border-radius: var(--radius-md);
}
.nav-bell:hover { background: var(--bg-deep); }
.nav-bell svg { width: 19px; height: 19px; }
.nav-bell__badge {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  background: var(--acid-mint);
  color: var(--forest-graphite);
  font-size: 0.62rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.nav-bell__badge[hidden] { display: none; }

.notification-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  align-items: flex-start;
}
.notification-item--unread { border-color: var(--sky); background: var(--sky-tint); }
.notification-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sky);
  margin-top: 6px;
  flex-shrink: 0;
}
.notification-item__dot--read { background: transparent; }
.notification-item__title { font-weight: 600; margin: 0 0 var(--space-1); }
.notification-item__body { color: var(--muted); font-size: 0.92rem; margin: 0; }
.notification-item__date { color: var(--muted); font-size: 0.78rem; margin-top: var(--space-2); }

/* ==========================================================================
   Rating popup (Batch H)
   ========================================================================== */
.rating-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 22, 15, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 200;
  animation: rating-fade-in 0.25s ease;
}
@keyframes rating-fade-in { from { opacity: 0; } to { opacity: 1; } }

.rating-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 64px rgba(30, 22, 15, 0.3);
  padding: var(--space-8) var(--space-6) var(--space-6);
}
.rating-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg-deep);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  line-height: 1;
}
.rating-modal__close:hover { background: var(--border); color: var(--text); }

.rating-modal h2 { font-size: 1.3rem; margin: 0 0 var(--space-2); text-align: center; }
.rating-modal__sub { color: var(--muted); font-size: 0.9rem; text-align: center; margin: 0 0 var(--space-5); }

.rating-stars { display: flex; justify-content: center; gap: var(--space-2); margin-bottom: var(--space-5); }
.rating-star {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  color: var(--border-strong);
  transition: transform 0.1s ease;
}
.rating-star svg { width: 34px; height: 34px; }
.rating-star:hover { transform: scale(1.12); }
.rating-star[data-active="true"] { color: var(--gold); }

.rating-modal textarea {
  width: 100%;
  min-height: 90px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.92rem;
  resize: vertical;
  background: var(--card);
  margin-bottom: var(--space-5);
}
.rating-modal textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.rating-modal__actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }
.rating-modal__links { display: flex; gap: var(--space-5); font-size: 0.82rem; }
.rating-modal__links button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); text-decoration: underline; padding: 0;
  font-size: inherit; font-family: inherit;
}
.rating-modal__links button:hover { color: var(--primary); }
.rating-modal__thanks { text-align: center; padding: var(--space-4) 0; }

/* ==========================================================================
   Notes rebuild (Batch L)
   ========================================================================== */

/* ---- Subject cards (notes.html hub) ---- */
.notes-subject-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 640px) { .notes-subject-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .notes-subject-grid { grid-template-columns: repeat(4, 1fr); } }

.notes-subject-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}
.notes-subject-card--available:hover { transform: translateY(-3px); }
.notes-subject-card--locked { opacity: 0.55; cursor: default; }
.notes-subject-card__icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notes-subject-card__icon svg { width: 30px; height: 30px; }
.notes-subject-card__code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.03em; }
.notes-subject-card__name { font-family: var(--font-display); font-size: 1.15rem; margin: 0; }

/* ---- Chapter cards (per-level chapter grid page) ---- */
.notes-chapter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 640px) { .notes-chapter-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .notes-chapter-grid { grid-template-columns: repeat(3, 1fr); } }

.notes-chapter-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  padding-top: var(--space-6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.notes-chapter-card--available:hover { transform: translateY(-2px); }
.notes-chapter-card--locked { background: var(--bg-deep); cursor: default; }
.notes-chapter-card--locked .notes-chapter-card__title,
.notes-chapter-card--locked .notes-chapter-card__index { color: var(--muted); }
.notes-chapter-card__index {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--border-strong);
  line-height: 1;
  margin-bottom: var(--space-1);
}
.notes-chapter-card__number {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--primary); text-transform: uppercase;
}
.notes-chapter-card__title { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.notes-chapter-card__status {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-pill--open { background: var(--primary-tint); color: var(--primary); }
.status-pill--open::before { background: var(--primary); }
.status-pill--locked { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.status-pill--locked::before { display: none; }
.status-pill--drafting { background: var(--gold-tint); color: #8A6A1E; }
.status-pill--drafting::before { background: var(--gold); }
.status-pill--in-progress { background: var(--sky-tint); color: var(--sky); }
.status-pill--in-progress::before { background: var(--sky); }
.notes-chapter-card__lock {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  color: var(--muted);
  display: flex;
}
.notes-chapter-card__lock svg { width: 15px; height: 15px; }

/* ---- Selection popup (Level choice / Topic choice) ---- */
.notes-popup-backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 22, 15, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-5);
  z-index: 200;
  animation: rating-fade-in 0.2s ease;
}
.notes-popup {
  position: relative;
  width: 100%; max-width: 620px;
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 64px rgba(30, 22, 15, 0.3);
  padding: var(--space-8) var(--space-6) var(--space-6);
  max-height: 80vh;
  overflow-y: auto;
}
.notes-popup__close {
  position: absolute; top: var(--space-4); right: var(--space-4);
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--bg-deep); color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; line-height: 1;
}
.notes-popup__close:hover { background: var(--border); color: var(--text); }
.notes-popup h2 { font-size: 1.25rem; margin: 0 0 var(--space-5); text-align: center; }
.notes-popup__options {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
.notes-popup__options--pair { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .notes-popup__options--pair { grid-template-columns: 1fr; } }
.notes-popup__option {
  display: block;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.notes-popup__option:hover { border-color: var(--primary); transform: translateY(-2px); }
.notes-popup__option--locked { opacity: 0.5; cursor: default; }
.notes-popup__option--locked:hover { transform: none; border-color: var(--border); }
.notes-popup__option-title { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 var(--space-1); }
.notes-popup__option-sub { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---- Note content rendering ---- */
.notes-content-body { font-size: 1rem; line-height: 1.75; color: var(--text); }
.notes-content-body h2 { font-size: 1.3rem; margin-top: var(--space-8); }
.notes-content-body h3 { font-size: 1.1rem; margin-top: var(--space-6); }
.notes-content-body p { margin: 0 0 var(--space-4); }
.notes-content-body ul, .notes-content-body ol { padding-left: 24px; margin: 0 0 var(--space-4); }
.notes-content-body li { margin-bottom: var(--space-2); }
.notes-content-body code {
  background: var(--bg-deep); padding: 2px 6px; border-radius: 4px;
  font-size: 0.9em; font-family: 'Courier New', monospace;
}
.notes-content-body hr { border: none; border-top: 1px solid var(--border); margin: var(--space-8) 0; }

.notes-figure { margin: var(--space-6) 0; }
.notes-figure img {
  width: 100%; border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgba(30, 22, 15, 0.12);
}
.notes-figure figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: var(--space-2); }

.notes-video {
  position: relative; width: 100%; padding-top: 56.25%; /* 16:9 */
  margin: var(--space-6) 0; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 12px 28px rgba(30, 22, 15, 0.12);
}
.notes-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.notes-block-equation {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  text-align: center;
}
.notes-inline-equation { display: inline-block; }

.notes-content-body[style*="user-select: none"] { cursor: default; }

/* ---- Topic nav footer (prev/next, mark complete, was-this-useful) ---- */
.notes-topic-footer { margin-top: var(--space-10); display: flex; flex-direction: column; gap: var(--space-6); }
.notes-useful-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.notes-useful-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--card); cursor: pointer; font-size: 0.88rem; color: var(--text);
}
.notes-useful-btn:hover { border-color: var(--primary); }
.notes-useful-btn[data-selected="true"] { background: var(--gradient-mint); border-color: transparent; }

/* ==========================================================================
   My Notes side panel (Batch I) — slides in from the right on any note page
   ========================================================================== */
.my-notes-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 90;
  background: var(--gradient-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: var(--space-4) var(--space-2);
  cursor: pointer;
  writing-mode: vertical-rl;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: -6px 0 20px rgba(30, 22, 15, 0.18);
}
.my-notes-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: -24px 0 48px rgba(30, 22, 15, 0.22);
  z-index: 150;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.my-notes-panel[data-open="true"] { transform: translateX(0); }
.my-notes-panel__header { display: flex; align-items: center; justify-content: space-between; }
.my-notes-panel__close {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--bg-deep); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.my-notes-panel textarea {
  width: 100%; min-height: 220px; flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 0.92rem; resize: vertical;
  background: var(--card);
}
.my-notes-panel__image-preview { max-width: 100%; border-radius: var(--radius-md); margin-top: var(--space-2); }
.my-notes-panel__upload-row { display: flex; align-items: center; gap: var(--space-3); font-size: 0.85rem; }
.my-notes-panel__status { font-size: 0.8rem; color: var(--muted); }

/* ==========================================================================
   Dashboard cards (Batch I rebuild)
   ========================================================================== */
.dash-progress-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: var(--space-2); font-size: 0.9rem;
}
.dash-progress-item:last-child { margin-bottom: 0; }
.dash-note-item {
  display: block; padding: var(--space-3); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: var(--space-2);
  text-decoration: none; color: inherit; font-size: 0.9rem;
}
.dash-note-item:last-child { margin-bottom: 0; }
.dash-note-item:hover { border-color: var(--primary); }


