/* ============================================
   CBCResources — Design tokens
   Direction: the look of an official Kenyan curriculum document —
   bond paper, gazette-style rules, a stamped reference number —
   not a generic "friendly schoolbook" cream page.
   ============================================ */

:root {
  --ink:        #16211C;   /* near-black, cool undertone — official document ink */
  --ink-soft:   #57655E;   /* secondary text */
  --paper:      #F1EFE6;   /* bond-paper ivory — cooler and greyer than a warm cream */
  --paper-2:    #E6E2D3;   /* deeper paper, for cards resting on the page */
  --green:      #163C2E;   /* deep bottle green — the brand anchor, kept and deepened */
  --green-dark: #0E2A20;
  --ochre:      #8C6A2F;   /* muted brass, not orange — a stamp/seal tone, not a "warm accent" */
  --ochre-soft: #E9E0C9;
  --line:       #CFC9B4;   /* hairline rule, like a ruled exercise book or gazette column */
  --white:      #FFFFFF;
  --surface:    #FFFFFF;   /* card / panel background (changes in dark mode) */

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;
  --space-9: 8rem;

  /* Sharper radii for structural elements, softer for things you tap —
     creates real hierarchy instead of one rounding applied everywhere */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --shadow-card: 0 1px 1px rgba(22, 33, 28, 0.05), 0 3px 10px rgba(22, 33, 28, 0.05);
  --shadow-lift: 0 8px 24px rgba(22, 33, 28, 0.12);
}

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

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
}

/* ============================================
   Type
   ============================================ */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 900; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.15rem; font-weight: 700; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin-bottom: var(--space-2);
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
}
.eyebrow::before {
  content: "§";
  color: var(--ochre);
  font-weight: 700;
}

.section-head { max-width: 640px; margin-bottom: var(--space-6); }
.section-head h2 { margin-top: var(--space-1); }

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { background: #163d2f; box-shadow: var(--shadow-lift); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--paper-2); }

.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

/* ============================================
   Header
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg, rgba(246, 243, 234, 0.9));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-mark {
  background: var(--green);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
}

.main-nav { display: flex; gap: var(--space-5); }
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
}
.menu-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ============================================
   Hero
   ============================================ */

.hero { padding: var(--space-8) 0 var(--space-7); overflow: hidden; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-7);
  align-items: center;
}

.hero h1 { color: var(--ink); }
.hero h1 .dot { color: var(--ochre); }

.hero-sub {
  margin-top: var(--space-4);
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-search {
  margin-top: var(--space-5);
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}

.hero-select, .hero-search input {
  border: none;
  background: transparent;
  padding: 0.7rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}
.hero-select { border-right: 1px solid var(--line); flex: 0 0 auto; }
.hero-search input { flex: 1; min-width: 0; }
.hero-search input:focus, .hero-select:focus { outline: none; }

.hero-note {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Hero visual — stacked "paper" cards */
.hero-visual { position: relative; height: 420px; }

.paper-stack { position: relative; width: 100%; height: 100%; }

.paper-card {
  position: absolute;
  width: 78%;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  padding: var(--space-4);
}

.card-3 { top: 0; left: 22%; opacity: 0.55; transform: rotate(4deg); }
.card-2 { top: 70px; left: 10%; opacity: 0.8; transform: rotate(-2deg); }
.card-1 { top: 150px; left: 0; transform: rotate(1deg); }

.paper-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px dashed var(--line);
}
.paper-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--green);
}
.paper-marks {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ochre);
}

.paper-lines span {
  display: block;
  height: 8px;
  background: var(--paper-2);
  border-radius: 3px;
  margin-bottom: 8px;
}
.paper-lines span.short { width: 60%; }

.paper-check {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--green);
}

/* ============================================
   Trust strip
   ============================================ */

.trust-strip {
  background: var(--green);
  padding: var(--space-4) 0;
}
.trust-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.trust-item {
  display: flex;
  flex-direction: column;
  color: var(--white);
  text-align: center;
}
.trust-item strong { font-family: var(--font-display); font-size: 1.3rem; }
.trust-item span { font-size: 0.78rem; color: #C9D9CD; margin-top: 2px; }

/* ============================================
   Browse — level cards
   ============================================ */

.browse { padding: var(--space-8) 0; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.level-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.level-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--green);
}
.level-range {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ochre);
  letter-spacing: 0.03em;
}
.level-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.level-arrow { margin-top: var(--space-2); color: var(--ink-soft); }

/* ============================================
   How it works
   ============================================ */

.how { padding: var(--space-8) 0; background: var(--paper-2); }

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.how-step { position: relative; padding-top: var(--space-5); border-top: 2px solid var(--green); }
.how-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  display: block;
  margin-bottom: var(--space-2);
}
.how-step h3 { margin-bottom: var(--space-2); }
.how-step p { color: var(--ink-soft); font-size: 0.95rem; }

/* ============================================
   Pricing
   ============================================ */

.pricing { padding: var(--space-8) 0; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  max-width: 760px;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
}

.price-card-featured {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.price-card-featured h3 { color: var(--white); }
.price-card-featured .price-amount span { color: #C9D9CD; }
.price-card.price-card-featured ul li { color: #E4EEE6; }
.price-card.price-card-featured ul li::before { color: #E8C887; }
.price-card.price-card-featured .price-amount span { color: #C9D9CD; }

.price-badge {
  position: absolute;
  top: -12px;
  right: var(--space-4);
  background: var(--ochre);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
}

.price-amount { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; }
.price-amount span { font-size: 1rem; font-weight: 500; color: var(--ink-soft); }

.price-card ul { display: flex; flex-direction: column; gap: 0.6rem; margin: var(--space-2) 0; }
.price-card ul li {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-left: 1.4rem;
  position: relative;
}
.price-card ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* ============================================
   CTA
   ============================================ */

.cta { padding: var(--space-8) 0; }
.cta-inner {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.cta-inner h2 { color: var(--white); }

/* ============================================
   Footer
   ============================================ */

.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); padding-top: var(--space-7); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}

.footer-brand p { margin-top: var(--space-2); color: var(--ink-soft); font-size: 0.9rem; max-width: 26ch; }

.footer-links { display: flex; gap: var(--space-7); }
.footer-col { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}
.footer-col a { font-size: 0.9rem; color: var(--ink-soft); transition: color 0.15s ease; }
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: var(--space-4) 0;
}
.footer-bottom p { font-size: 0.82rem; color: var(--ink-soft); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { height: 320px; order: -1; }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .trust-inner { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: var(--space-5); }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .main-nav ~ .header-actions .btn-ghost { display: none; }
  .hero-search { flex-wrap: wrap; }
  .hero-select { border-right: none; border-bottom: 1px solid var(--line); flex: 1 1 100%; }
  .hero-search input { flex: 1 1 100%; }
  .hero-search .btn { width: 100%; }
}

@media (max-width: 480px) {
  .level-grid { grid-template-columns: 1fr; }
  .trust-inner { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   Modern resource list — overrides the older flat row design
   used on Home's content page and Teacher's Resource Library
   ============================================ */

.resource-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--space-3) !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-4) !important;
  flex-wrap: nowrap !important;
  box-shadow: 0 1px 2px rgba(27, 43, 34, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.resource-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
  border-color: #C9D9CD;
}
.resource-info { display: flex !important; align-items: center !important; gap: var(--space-3) !important; min-width: 0; flex: 1; }
.resource-icon {
  width: 46px !important; height: 46px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  background: linear-gradient(135deg, var(--paper-2), var(--paper)) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  font-size: 1.3rem !important;
  flex-shrink: 0 !important;
}
.resource-title { font-weight: 700 !important; font-size: 0.98rem !important; color: var(--ink); }
.resource-meta { font-family: var(--font-mono) !important; font-size: 0.72rem !important; color: var(--ink-soft) !important; margin-top: 0.25rem !important; letter-spacing: 0.01em; }

/* Small classification tags — reads like a stamped reference code on an
   exam paper, e.g. [GR.3] [TERM 2], rather than a plain dot-joined caption */
.meta-tags { display: inline-flex; gap: 0.35rem; margin-top: 0.3rem; flex-wrap: wrap; }
.meta-tag {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 3px; padding: 0.1rem 0.4rem;
  background: var(--paper);
}

@media (max-width: 560px) {
  .resource-row {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  .resource-info { width: 100%; }
  .resource-row .btn,
  .resource-row .lock-badge {
    width: 100%;
    text-align: center;
    margin-top: 0.4rem;
  }
}

/* ============================================
   Responsive — applies site-wide, covers Home, Teacher, and Admin pages
   (these grid/layout class names are reused across many separate files,
   so fixing them once here fixes every page that uses them)
   ============================================ */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr !important; }
  .tool-grid,
  .action-grid,
  .subject-grid,
  .stat-grid,
  .grade-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .field-row { grid-template-columns: 1fr !important; }
  .header-inner { flex-wrap: wrap; gap: var(--space-2); height: auto; padding: var(--space-2) 0; }
}

@media (max-width: 600px) {
  .tool-grid,
  .action-grid,
  .subject-grid,
  .stat-grid,
  .grade-grid,
  .role-grid { grid-template-columns: 1fr !important; }
  .content-table,
  .grades-table,
  .attendance-table,
  .users-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .wrap { padding: 0 var(--space-3); }
  h1 { font-size: clamp(1.6rem, 6vw, 2.2rem) !important; }
  .certificate { padding: var(--space-5) var(--space-3) !important; }
  .cert-name { font-size: 1.5rem !important; }
}

/* ============================================
   Shared search component — one style, used everywhere
   (landing search, content-library search, admin user/payment search)
   ============================================ */

.search-box {
  position: relative;
  width: 100%;
}

.search-box > svg,
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-faint, #8a8a7a);
  pointer-events: none;
}

.search-box input[type="text"],
.search-box input[type="search"],
input.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border, #ddd9c8);
  border-radius: 10px;
  background: var(--card-bg, #fff);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink, #1a1a14);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input[type="text"]:focus,
.search-box input[type="search"]:focus,
input.search-input:focus {
  outline: none;
  border-color: var(--green, #1E4D3B);
  box-shadow: 0 0 0 3px rgba(30, 77, 59, 0.12);
}

.search-box .search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-faint, #8a8a7a);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: none;
}

.search-box .search-clear.show {
  display: block;
}

.search-box .search-clear:hover {
  background: var(--paper-shade, #f1efe4);
  color: var(--ink, #1a1a14);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--border, #ddd9c8);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-height: 360px;
  overflow-y: auto;
  z-index: 40;
}

.search-results-dropdown .search-result-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 10px);
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink, #1a1a14);
  border-bottom: 1px solid var(--border, #ede9db);
  cursor: pointer;
}

.search-results-dropdown .search-result-row:last-child {
  border-bottom: none;
}

.search-results-dropdown .search-result-row:hover {
  background: var(--paper-shade, #f6f3ea);
}

.search-results-dropdown .search-empty {
  padding: 16px 14px;
  color: var(--ink-faint, #8a8a7a);
  font-size: 0.9rem;
  text-align: center;
}

/* ============================================
   CBC performance-level badges — EE / ME / AE / BE
   Shared across Gradebook, Report Cards, Competency Tracker
   ============================================ */
.cbc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cbc-badge.cbc-ee { background: #E3F1E8; color: #1E4D3B; }
.cbc-badge.cbc-me { background: #EAF3E0; color: #4C7A33; }
.cbc-badge.cbc-ae { background: #FDF1DC; color: #B8762A; }
.cbc-badge.cbc-be { background: #FBE6E6; color: #A03A3A; }

.cbc-legend {
  display: flex; gap: var(--space-3, 1rem); flex-wrap: wrap;
  font-size: 0.78rem; color: var(--ink-soft, #6b6b5c); margin: 0.6rem 0 var(--space-4, 1.2rem);
}
.cbc-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ============================================
   Icon system (SVG) — replaces emoji everywhere
   ============================================ */
.ico { display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }

.tool-icon, .action-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--paper-2); color: var(--green);
  border: 1px solid var(--line); margin-bottom: 0.7rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover .tool-icon, .action-card:hover .action-icon,
a:hover > .tool-icon, a:hover > .action-icon {
  background: var(--green); color: var(--white); border-color: var(--green);
}
.role-icon { display: inline-flex; vertical-align: middle; margin-right: 0.4rem; color: var(--green); }
.file-drop-icon { display: inline-flex; color: var(--green); margin-bottom: 0.5rem; }
.pulse-icon { display: inline-flex; color: var(--green); }
.doc-section-head h2 { display: flex; align-items: center; gap: 0.5rem; }
.doc-section-head h2 .ico { color: var(--green); }

/* ============================================
   Document library rows — Home + Teacher resource lists
   ============================================ */
.doc-list { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; margin-bottom: var(--space-7); }
.resource-list:has(.doc-row) { gap: 0 !important; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }

.doc-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: var(--space-4, 1.2rem);
  align-items: center; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line);
  background: var(--surface); transition: background 0.15s ease;
}
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: var(--paper); }

.doc-icon {
  width: 46px; height: 46px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: #E8F0EC; color: #1E4D3B; flex-shrink: 0;
}
.doc-icon-sm { width: 30px; height: 30px; border-radius: 7px; }
.doc-icon-holiday_assignment { background: #F6ECD9; color: #8A5A14; }
.doc-icon-notes { background: #E4ECF3; color: #2F5D7C; }
.doc-icon-marking_scheme { background: #E9E4F1; color: #5B3F7A; }
.doc-icon-scheme_of_work { background: #ECECE4; color: #5A5A3C; }

.doc-main { min-width: 0; }
.doc-title-line { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.doc-title { font-weight: 600; font-size: 1rem; color: var(--ink); line-height: 1.35; }

.doc-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.doc-tag {
  font-size: 0.72rem; font-weight: 500; color: var(--ink-soft);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 0.15rem 0.55rem; border-radius: 5px; letter-spacing: 0.01em;
}
.doc-tag-type { color: var(--green); border-color: #C9DBD1; background: #F1F6F3; font-weight: 600; }
.doc-tag-ext { font-family: var(--font-mono); font-size: 0.66rem; }

.doc-desc { font-size: 0.86rem; color: var(--ink-soft); margin: 0.5rem 0 0; line-height: 1.5; max-width: 62ch; }
.doc-foot { display: flex; gap: 1rem; margin-top: 0.5rem; font-size: 0.76rem; color: var(--ink-soft); }

.access-badge { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 4px; }
.access-badge.free { background: #E3F1E8; color: #1E4D3B; }
.access-badge.premium { background: #F6ECD9; color: #8A5A14; }

.doc-actions { display: flex; align-items: center; gap: 0.6rem; }
.doc-download { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.doc-locked {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
  font-size: 0.84rem; font-weight: 600; color: #8A5A14; background: #FBF3E4;
  border: 1px solid #EBD6AE; padding: 0.55rem 0.9rem; border-radius: 8px;
}
.doc-locked:hover { background: #F6E8CB; }
.doc-save { background: none; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); cursor: pointer; }
.doc-save:hover { border-color: var(--green); color: var(--green); }
.doc-save.is-saved { background: var(--green); border-color: var(--green); color: var(--white); }
.doc-save.is-saved svg { fill: currentColor; }

.recent-icon.doc-icon { width: 38px; height: 38px; }
.search-result-row .doc-icon-sm { margin-right: 0.2rem; }

@media (max-width: 640px) {
  .doc-row { grid-template-columns: 42px 1fr; padding: 1rem; }
  .doc-icon { width: 40px; height: 40px; }
  .doc-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ============================================
   UI layer: toasts, dialog, spinner, skeletons, offline bar, back-to-top
   ============================================ */
.btn-danger { background: #A03A3A; color: #fff; border: 1px solid #A03A3A; display: inline-flex; align-items: center; justify-content: center; padding: 0.7rem 1.2rem; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; font-size: 0.92rem; }
.btn-danger:hover { background: #862e2e; }

#toast-host { position: fixed; top: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 0.75rem; justify-content: space-between;
  background: var(--ink); color: #fff; padding: 0.85rem 1rem; border-radius: 10px; font-size: 0.9rem; line-height: 1.4;
  box-shadow: var(--shadow-lift); border-left: 4px solid var(--ochre);
  opacity: 0; transform: translateY(-8px); transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left-color: #3E8E63; }
.toast-error { border-left-color: #D05555; }
.toast-close { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 0.1rem; }
.toast-close:hover { color: #fff; }

.ui-overlay { position: fixed; inset: 0; background: rgba(14, 24, 19, 0.5); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; transition: opacity 0.2s ease; }
.ui-overlay.show { opacity: 1; }
.ui-dialog { background: var(--surface); border-radius: var(--radius-lg); padding: 1.6rem; max-width: 420px; width: 100%; box-shadow: var(--shadow-lift); transform: translateY(8px); transition: transform 0.2s ease; }
.ui-overlay.show .ui-dialog { transform: none; }
.ui-dialog-text { font-size: 0.98rem; line-height: 1.55; margin-bottom: 1.3rem; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.35); border-top-color: currentColor; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; margin-right: 0.5rem; vertical-align: -2px; }
.btn-ghost .spinner { border-color: rgba(0,0,0,0.15); border-top-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
.is-busy { opacity: 0.85; cursor: progress; }

.skeleton-row { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.sk { background: linear-gradient(90deg, #ECE9DD 25%, #F6F4EC 37%, #ECE9DD 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
.sk-icon { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.sk-line { height: 12px; } .w60 { width: 60%; } .w35 { width: 35%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

#offline-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #7A5A22; color: #fff; text-align: center; padding: 0.55rem 1rem; font-size: 0.85rem; z-index: 1050; transform: translateY(100%); transition: transform 0.25s ease; }
#offline-banner.show { transform: none; }

#back-to-top { position: fixed; right: 18px; bottom: 22px; width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease; z-index: 900; }
#back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }

mark { background: #F3E3B5; color: inherit; border-radius: 2px; padding: 0 1px; }

main { animation: pageIn 0.35s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn { transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease; }
.btn:active { transform: translateY(1px); }
.tool-card:hover, .action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.empty-state .empty-ico { display: inline-flex; width: 56px; height: 56px; border-radius: 50%; background: var(--paper-2); color: var(--green); align-items: center; justify-content: center; margin-bottom: 0.8rem; }

@media print {
  #toast-host, #offline-banner, #back-to-top { display: none !important; }
}

/* ============================================
   Landing: FAQ + legal pages
   ============================================ */
.faq { padding: var(--space-8) 0; }
.faq-list { max-width: 760px; margin: var(--space-5) auto 0; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 0; }
.faq-list summary { cursor: pointer; list-style: none; padding: 1.1rem 0; font-weight: 600; font-size: 1.02rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.4rem; color: var(--green); font-weight: 400; transition: transform 0.2s ease; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 0 1.2rem; color: var(--ink-soft); max-width: 62ch; }
.legal { max-width: 760px; margin: var(--space-6) auto var(--space-8); }
.legal h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.legal h2 { font-size: 1.15rem; margin: 1.8rem 0 0.5rem; }
.legal p, .legal li { color: var(--ink-soft); margin-bottom: 0.7rem; }
.legal ul { padding-left: 1.2rem; }
.legal .legal-date { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.footer-bottom a { text-decoration: underline; }

/* Search button attached to the search box */
.search-box .search-go {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--green); color: #fff; border: none; border-radius: 8px;
  padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.search-box .search-go:hover { background: var(--green-dark); }
.search-box:has(.search-go) input { padding-right: 110px; }
.search-box:has(.search-go) .search-clear { right: 92px; }

/* list toolbar, flags, scope note */
.list-toolbar { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; margin: var(--space-5) 0 0; }
.list-toolbar .search-box { flex: 1; min-width: 220px; }
.sort-select { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0.7rem 0.9rem; font-size: 0.88rem; color: var(--ink); }
.free-toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; color: var(--ink-soft); cursor: pointer; user-select: none; }
.search-scope { font-size: 0.85rem; color: var(--ink-soft); margin: 0.8rem 0 0; }
.flag-new, .flag-popular { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.15rem 0.45rem; border-radius: 4px; }
.flag-new { background: #DDEBF7; color: #1F4E79; }
.flag-popular { background: #FBE3E3; color: #9A2F2F; }
.more-wrap { text-align: center; margin: 0 0 var(--space-7); }

.filter-bar.is-dimmed { opacity: 0.55; }

/* admin insights */
.insights-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-3); margin: var(--space-4) 0 var(--space-5); }
.insight-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.insight-card h3 { font-size: 0.95rem; margin-bottom: var(--space-3); }
.bar-chart { display: flex; align-items: flex-end; gap: 0.6rem; height: 170px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.3rem; }
.bar { width: 100%; max-width: 38px; background: var(--green); border-radius: 5px 5px 0 0; min-height: 3px; transition: height 0.5s ease; }
.bar-val { font-size: 0.64rem; color: var(--ink-soft); font-family: var(--font-mono); }
.bar-label { font-size: 0.72rem; color: var(--ink-soft); }
.top-list { list-style: none; padding: 0; margin: 0; }
.top-list li { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.top-list li:last-child { border-bottom: none; }
.top-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .muted { color: var(--ink-soft); }
.glance { display: grid; gap: 0.7rem; margin: 0; }
.glance div { display: flex; justify-content: space-between; font-size: 0.88rem; }
.glance dt { color: var(--ink-soft); } .glance dd { font-weight: 700; margin: 0; color: var(--green); }
@media (max-width: 900px) { .insights-grid { grid-template-columns: 1fr; } }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.8rem !important; width: 100%; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--ink-soft); cursor: pointer; padding: 0.45rem; border-radius: 6px; display: inline-flex; }
.pw-eye:hover { color: var(--green); background: var(--paper-2); }
.pw-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.35rem; min-height: 1em; }
.pw-hint[data-level="0"], .pw-hint[data-level="1"] { color: #A03A3A; }
.pw-hint[data-level="4"], .pw-hint[data-level="3"] { color: #1E4D3B; }

/* Phones: keep app-page header links (Profile / Payments / Log out) visible and compact */
@media (max-width: 480px) {
  .header-actions { gap: 2px; }
  .header-actions .btn { padding: 0.45rem 0.6rem; font-size: 0.82rem; }
  .logo-word { font-size: 1.05rem; }
}

/* ============================================
   Dark mode  (screen only — printing always stays light)
   ============================================ */
@media screen {
  [data-theme="dark"] {
    color-scheme: dark;
    --ink: #ECE9DE; --ink-soft: #9FAAA3; --paper: #0E1411; --paper-2: #17201B;
    --green: #2F7F5F; --green-dark: #246450; --ochre: #D9AE5C; --ochre-soft: #2A2517;
    --line: #2B3832; --surface: #141C18;
    --header-bg: rgba(14, 20, 17, 0.88);
    --card-bg: #141C18; --paper-shade: #17201B; --border: #2B3832; --ink-faint: #6E7B74;
    --shadow-card: 0 1px 1px rgba(0,0,0,0.4), 0 3px 10px rgba(0,0,0,0.3);
    --shadow-lift: 0 10px 28px rgba(0,0,0,0.55);
  }
  [data-theme="dark"] .search-box, [data-theme="dark"] .search-input, [data-theme="dark"] .search-box input { background: var(--surface); color: var(--ink); }
  [data-theme="dark"] .cta-inner { background: #1B2822; border: 1px solid var(--line); }
  [data-theme="dark"] .price-badge { color: #1B1408; }
  [data-theme="dark"] .toast { background: #26332C; color: #ECE9DE; }
  [data-theme="dark"] #back-to-top { background: var(--surface); color: var(--ink); }
  [data-theme="dark"] .grade-card .grade-num, [data-theme="dark"] .crumb span, [data-theme="dark"] .doc-tag-type,
  [data-theme="dark"] .stat-pill .num, [data-theme="dark"] .section-label { color: #6FCBA2; }
  [data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { color: var(--ink); background-color: var(--paper); }
  [data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #6E7B74; }
  [data-theme="dark"] .cbc-badge.cbc-ee, [data-theme="dark"] .access-badge.free, [data-theme="dark"] .pill.success { background: #16382A; color: #86D9B0; }
  [data-theme="dark"] .cbc-badge.cbc-me { background: #26361A; color: #B2DB8A; }
  [data-theme="dark"] .cbc-badge.cbc-ae { background: #3A2D14; color: #E8B864; }
  [data-theme="dark"] .cbc-badge.cbc-be, [data-theme="dark"] .flag-popular, [data-theme="dark"] .pill.failed,
  [data-theme="dark"] .status-failed, [data-theme="dark"] .form-error, [data-theme="dark"] .error-banner { background: #3E1D1D; color: #F59A9A; }
  [data-theme="dark"] .error-banner { border-color: #7A3030; }
  [data-theme="dark"] .doc-icon { background: #1B2C25; color: #86D9B0; }
  [data-theme="dark"] .doc-icon-holiday_assignment, [data-theme="dark"] .access-badge.premium, [data-theme="dark"] .pill.pending,
  [data-theme="dark"] .status-pending { background: #3A2D14; color: #E8B864; }
  [data-theme="dark"] .doc-icon-notes { background: #1A2733; color: #86BCE2; }
  [data-theme="dark"] .doc-icon-marking_scheme { background: #2A2036; color: #C2A4E8; }
  [data-theme="dark"] .doc-icon-scheme_of_work { background: #26261C; color: #C9C9A2; }
  [data-theme="dark"] .doc-tag-type { background: #16241E; border-color: #2D4A3E; }
  [data-theme="dark"] .doc-locked, [data-theme="dark"] .lock-badge, [data-theme="dark"] .rate-chip.low,
  [data-theme="dark"] .status-banner.locked { background: #2A2517; color: #E8B864; }
  [data-theme="dark"] .doc-locked:hover { background: #3A2D14; }
  [data-theme="dark"] .flag-new { background: #1A2D40; color: #92C6F0; }
  [data-theme="dark"] mark { background: #6B5818; color: #fff; }
  [data-theme="dark"] .status-banner.locked .status-text strong { color: var(--ink); }
  [data-theme="dark"] .btn-ghost { color: var(--ink); }
  [data-theme="dark"] .skeleton-row .sk, [data-theme="dark"] .sk { background: linear-gradient(90deg, #1B2620, #26332C, #1B2620); background-size: 200% 100%; }
}

/* ============================================
   Floating tools (theme + quick jump), command palette, confetti
   ============================================ */
#float-tools { position: fixed; right: 18px; bottom: 76px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.float-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.float-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
@media print { #float-tools, #palette-overlay, .confetti-piece { display: none !important; } }

#palette-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(10, 16, 13, 0.55); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
#palette-overlay.show { display: flex; }
.palette { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(0,0,0,0.35); overflow: hidden; animation: palette-in 0.16s ease; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.palette-input-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.palette-input-row input { flex: 1; border: none; outline: none; background: transparent; font-size: 1rem; color: var(--ink); font-family: inherit; }
.palette-kbd { font-family: var(--font-mono); font-size: 0.68rem; border: 1px solid var(--line); border-radius: 5px; padding: 0.1rem 0.4rem; color: var(--ink-soft); }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 0.4rem; }
.palette-group { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); padding: 0.6rem 0.7rem 0.3rem; }
.palette-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; border-radius: var(--radius-md); cursor: pointer; font-size: 0.93rem; color: var(--ink); }
.palette-item small { margin-left: auto; font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-soft); }
.palette-item.active, .palette-item:hover { background: var(--paper-2); }
.palette-empty { padding: 1.4rem; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }
.palette-foot { display: flex; gap: 1rem; padding: 0.6rem 1rem; border-top: 1px solid var(--line); font-size: 0.72rem; color: var(--ink-soft); }

.confetti-piece { position: fixed; top: -14px; width: 9px; height: 14px; z-index: 500; pointer-events: none; opacity: 0.95; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); opacity: 0.9; } }

/* Gentle reveal on the landing page (class is only added by JS, so nothing hides without it) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* "Continue where you left off" card on Home */
.resume-card { display: flex; align-items: center; gap: var(--space-3); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-top: var(--space-4); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.resume-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.resume-card .resume-label { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.resume-card .resume-title { font-weight: 700; margin-top: 0.15rem; }
.resume-card .resume-go { margin-left: auto; font-weight: 600; color: var(--green); white-space: nowrap; }
[data-theme="dark"] .resume-card .resume-go { color: #6FCBA2; }
@media (max-width: 480px) { #float-tools { bottom: 72px; right: 12px; gap: 8px; } .float-btn { width: 36px; height: 36px; opacity: 0.92; } }

/* ============================================
   Exam mode
   ============================================ */
.doc-exam { padding: 0.55rem 0.9rem; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 0.4rem; }
html.exam-locked, html.exam-locked body { overflow: hidden; }
#exam-overlay { position: fixed; inset: 0; z-index: 600; display: none; background: var(--paper); overflow-y: auto; }
#exam-overlay.show { display: flex; align-items: center; justify-content: center; padding: 16px; }
#exam-overlay.show.running { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; background: #0E1411; }
.exam-card { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: var(--shadow-lift); margin: auto; }
.exam-kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ochre); }
.exam-title { font-family: var(--font-display); font-size: 1.5rem; margin: 0.4rem 0 0.6rem; line-height: 1.25; }
.exam-sub { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 1.2rem; }
.exam-label { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.5rem; }
.exam-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.4rem; }
.exam-chip { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 30px; padding: 0.5rem 1rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.exam-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.exam-custom { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; color: var(--ink-soft); }
.exam-custom input { width: 70px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 0.45rem 0.6rem; color: var(--ink); font: inherit; }
.exam-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 0.4rem; }
.exam-bar { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1rem; background: #0E2A20; color: #F1EFE6; flex-wrap: wrap; }
.exam-bar-title { font-weight: 600; font-size: 0.95rem; flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-clock { font-family: var(--font-mono); font-size: 2rem; font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.exam-clock.low { color: #F59A9A; animation: exam-pulse 1s ease-in-out infinite; }
@keyframes exam-pulse { 50% { opacity: 0.55; } }
.exam-bar .btn-ghost { color: #F1EFE6; border-color: rgba(241,239,230,0.3); }
.exam-bar .btn-ghost:hover { background: rgba(241,239,230,0.1); }
.exam-bar-actions { display: flex; gap: 0.5rem; }
.exam-bar .btn { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.exam-progress { height: 4px; background: rgba(241,239,230,0.12); }
.exam-progress-fill { height: 100%; width: 0; background: #6FCBA2; transition: width 0.3s linear; }
.exam-stage { flex: 1; min-height: 0; background: #1a1f1c; position: relative; }
.exam-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.exam-nopreview { height: 100%; display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: center; color: #F1EFE6; }
#exam-overlay.paused .exam-stage::after { content: "Paused — the clock is stopped"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(14,20,17,0.93); color: #F1EFE6; font-size: 1.3rem; font-weight: 600; }
.exam-score-row { display: flex; gap: 0.7rem; align-items: flex-end; margin-bottom: 1rem; flex-wrap: wrap; }
.exam-score-row label, .exam-name { display: block; font-size: 0.82rem; font-weight: 600; flex: 1 1 110px; }
.exam-score-row input, .exam-name input { display: block; width: 100%; margin-top: 0.3rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 0.65rem 0.8rem; color: var(--ink); font: inherit; font-size: 1rem; }
.exam-out-of { color: var(--ink-soft); padding-bottom: 0.7rem; font-size: 0.9rem; }
.exam-name { margin-bottom: 0.6rem; }
.exam-error { color: #A03A3A; font-size: 0.85rem; min-height: 1.2em; margin-bottom: 0.4rem; }
.exam-result { margin-top: 1.2rem; }
.exam-canvas { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto 1rem; border-radius: 14px; box-shadow: var(--shadow-lift); }
@media (max-width: 560px) { .exam-clock { font-size: 1.6rem; } .exam-bar { gap: 0.5rem; } .exam-bar-title { flex-basis: 100%; order: -1; } .doc-actions { flex-wrap: wrap; } }
@media print { #exam-overlay { display: none !important; } }

/* Voice search button */
.search-box .search-mic {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 50%; color: var(--ink-soft); cursor: pointer;
}
.search-box .search-mic:hover { background: var(--paper-2); color: var(--ink); }
.search-box .search-mic.listening { color: #fff; background: #A03A3A; animation: mic-pulse 1.1s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(160,58,58,0.5); } 50% { box-shadow: 0 0 0 8px rgba(160,58,58,0); } }
.search-box.has-mic input { padding-right: 84px; }
.search-box.has-mic:has(.search-go) input { padding-right: 150px; }
.search-box.has-mic:has(.search-go) .search-clear { right: 128px; }
.search-box.has-mic .search-clear { right: 42px; }
.search-box.has-mic .search-mic { right: 8px; }
.search-box.has-mic:has(.search-go) .search-mic { right: 96px; }

/* Landing hero: papers fan out when you move over them; intro splash */
.paper-stack .paper-card { transition: transform 0.45s cubic-bezier(.2,.8,.2,1), opacity 0.45s ease, top 0.45s ease, left 0.45s ease; }
.hero-visual:hover .card-3 { transform: translate(14px, -14px) rotate(6deg); opacity: 0.85; }
.hero-visual:hover .card-2 { transform: translate(2px, -4px) rotate(-4deg); opacity: 0.95; }
.hero-visual:hover .card-1 { transform: translate(-6px, 14px) rotate(-1deg); }
@keyframes paper-drop { from { opacity: 0; transform: translateY(-40px) rotate(0deg); } }
.js-intro .card-3 { animation: paper-drop 0.7s 0.15s cubic-bezier(.2,.8,.2,1) backwards; }
.js-intro .card-2 { animation: paper-drop 0.7s 0.35s cubic-bezier(.2,.8,.2,1) backwards; }
.js-intro .card-1 { animation: paper-drop 0.7s 0.55s cubic-bezier(.2,.8,.2,1) backwards; }
#intro-splash { position: fixed; inset: 0; z-index: 900; background: #0E2A20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: #F1EFE6; pointer-events: none; animation: splash-out 0.6s 1.5s ease forwards; }
#intro-splash .intro-mark { font-family: var(--font-mono); font-weight: 600; background: #2F7F5F; padding: 0.5rem 0.9rem; border-radius: 8px; font-size: 1.6rem; animation: splash-pop 0.7s ease backwards; }
#intro-splash .intro-line { font-family: var(--font-display); font-size: 1.6rem; animation: splash-pop 0.7s 0.3s ease backwards; }
@keyframes splash-pop { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { #intro-splash { display: none; } }

/* ============================================
   My study (Home), share button, tour, shortcuts
   ============================================ */
.study-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.study-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); display: flex; gap: var(--space-3); align-items: center; }
.study-icon { width: 44px; height: 44px; border-radius: 12px; background: #F6ECD9; color: #8A5A14; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.study-card:nth-child(3) .study-icon { background: #E4ECF3; color: #2F5D7C; }
.study-big { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--green); }
.study-big small { font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); margin-left: 0.25rem; }
.study-label { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.3rem; }
.study-card:nth-child(2) { flex-direction: column; align-items: stretch; gap: 0.5rem; }
.week-dots { display: flex; justify-content: space-between; gap: 0.3rem; }
.week-dot { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-soft); }
.week-dot i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: block; }
.week-dot.on i { background: var(--green); border-color: var(--green); }
.week-dot.today i { box-shadow: 0 0 0 3px rgba(47,127,95,0.25); }
.study-lists { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-3); }
.study-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.study-list h4 { font-size: 0.78rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 0.4rem; }
.study-row { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.9rem; align-items: center; }
.study-list h4 + .study-row { border-top: none; }
a.study-row:hover .study-row-title { color: var(--green); text-decoration: underline; }
.study-row-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-row-meta { font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; font-family: var(--font-mono); display: inline-flex; gap: 0.4rem; align-items: center; }
.study-note { font-size: 0.75rem; color: var(--ink-soft); margin-bottom: var(--space-5); }
[data-theme="dark"] .study-icon { background: #3A2D14; color: #E8B864; }
[data-theme="dark"] .study-card:nth-child(3) .study-icon { background: #1A2733; color: #86BCE2; }
[data-theme="dark"] .study-big { color: #6FCBA2; }
@media (max-width: 760px) { .study-grid, .study-lists { grid-template-columns: 1fr; } }

.doc-share { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.doc-share:hover { color: var(--green); border-color: var(--green); }

.tour-card { position: fixed; left: 16px; bottom: 16px; z-index: 70; width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ochre); border-radius: var(--radius-md); box-shadow: var(--shadow-lift); padding: 1rem 1.1rem; animation: palette-in 0.25s ease; }
.tour-step { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ochre); margin-bottom: 0.3rem; }
.tour-card h4 { font-size: 1rem; margin-bottom: 0.3rem; }
.tour-card p { font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 0.8rem; }
.tour-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.tour-actions .btn { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
@media print { .tour-card { display: none !important; } }

.shortcut-list { list-style: none; padding: 0; margin: 0 0 0.5rem; display: flex; flex-direction: column; gap: 0.7rem; font-size: 0.92rem; }
.shortcut-list .palette-kbd { margin-right: 0.3rem; }
.install-btn { color: var(--green); }

/* ============================================================
   LIBRARY  (home/library.html + teacher/materials.html)
   Search hub  ->  Type tiles  ->  Grade / Subject chips  ->  Results
   ============================================================ */
.lib-hero {
  position: relative; overflow: hidden; color: #F1EFE6;
  background:
    radial-gradient(900px 340px at 85% -10%, rgba(111,203,162,0.22), transparent 60%),
    radial-gradient(700px 300px at 0% 110%, rgba(232,200,135,0.14), transparent 60%),
    linear-gradient(135deg, #0B221A 0%, #163C2E 100%);
  padding: var(--space-6) 0 calc(var(--space-6) + 10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lib-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000 0%, transparent 90%); -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 90%);
}
.lib-hero .wrap { position: relative; }
.lib-kicker { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: #E8C887; margin-bottom: 0.5rem; }
.lib-title { font-family: var(--font-display); font-size: clamp(1.7rem, 4.2vw, 2.6rem); font-weight: 700; color: #F8F6EE; line-height: 1.15; margin-bottom: var(--space-4); letter-spacing: -0.01em; }

.hub { max-width: 820px; }
.hub-bar {
  display: flex; align-items: center; gap: 0.7rem; background: var(--surface); border-radius: 18px; padding: 8px 8px 8px 12px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 18px 50px rgba(0,0,0,0.35), 0 0 0 5px rgba(111,203,162,0.0);
  transition: box-shadow 0.2s ease;
}
.hub-bar:focus-within { box-shadow: 0 0 0 2px #6FCBA2, 0 18px 50px rgba(0,0,0,0.4), 0 0 0 7px rgba(111,203,162,0.22); }
.hub-input { flex: 1; min-width: 0; border: none !important; outline: none !important; background: transparent !important; box-shadow: none !important; font-size: 1.05rem; padding: 0.7rem 0.2rem !important; color: var(--ink); width: auto; border-radius: 0 !important; }
.hub-input::placeholder { color: #8A948E; }
.hub-clear { display: none; border: none; background: var(--paper-2); color: var(--ink-soft); width: 30px; height: 30px; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.hub-clear.show { display: inline-flex; align-items: center; justify-content: center; }
.hub-clear:hover { background: var(--line); color: var(--ink); }
.hub-go {
  display: inline-flex; align-items: center; gap: 0.5rem; border: none; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(180deg, #2F8C69, #1E6A4E); color: #fff; font-weight: 700; font-size: 0.98rem;
  padding: 0.85rem 1.4rem; border-radius: 12px; box-shadow: 0 4px 14px rgba(30,106,78,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.hub-go:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hub-go:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(30,106,78,0.4); }

/* The orb: a glowing ring that listens when tapped */
.hub-orb { position: relative; width: 48px; height: 48px; border-radius: 50%; border: none; background: transparent; cursor: pointer; flex-shrink: 0; color: #E8F7EE; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.hub-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #6FCBA2, #E8C887, #2F7F5F, #6FCBA2); animation: orb-spin 5s linear infinite; }
.hub-orb::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #1F5A44, #0B221A 70%); }
.hub-orb svg { position: relative; z-index: 1; }
.hub-orb:hover::before { animation-duration: 2s; }
.hub-orb.listening::before { animation-duration: 0.8s; }
.hub-orb.listening { animation: orb-pulse 1.1s ease-in-out infinite; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(111,203,162,0.55); } 50% { box-shadow: 0 0 0 14px rgba(111,203,162,0); } }

.hub-hints { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.9rem; min-height: 1.9rem; }
.hint-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(241,239,230,0.6); margin-right: 0.1rem; }
.hint { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); color: #F1EFE6; border-radius: 30px; padding: 0.35rem 0.8rem; font-size: 0.82rem; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.hint:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }
.hint-free { border-color: rgba(232,200,135,0.5); color: #E8C887; }

/* Resource TYPE tiles — the first thing you choose */
.lib-body { padding-top: var(--space-5); padding-bottom: var(--space-7); }
.lib-group-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.7rem; }
.type-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: var(--space-5); }
@media (max-width: 1100px) { .type-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.type-tile {
  display: flex; align-items: center; gap: 0.75rem; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0.7rem 0.7rem; position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.type-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--green); }
.type-tile.active { border-color: var(--green); background: linear-gradient(180deg, rgba(47,127,95,0.10), rgba(47,127,95,0.03)); box-shadow: 0 0 0 2px var(--green), 0 10px 26px rgba(22,60,46,0.18); }
.type-tile.is-empty { opacity: 0.55; }
.type-tile-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #E8F0EC; color: #1E4D3B; }
.type-tile-icon.type-exam { background: #E8F0EC; color: #1E4D3B; }
.type-tile-icon.type-notes { background: #E4ECF3; color: #2F5D7C; }
.type-tile-icon.type-scheme_of_work { background: #ECECE4; color: #5A5A3C; }
.type-tile-icon.type-marking_scheme { background: #E9E4F1; color: #5B3F7A; }
.type-tile-icon.type-holiday_assignment { background: #F6ECD9; color: #8A5A14; }
.type-tile-icon.type-__saved { background: #FBE3E3; color: #9A2F2F; }
.type-tile-icon.type-all { background: var(--green); color: #fff; }
.type-tile-text { display: flex; flex-direction: column; min-width: 0; }
.type-tile-name { font-weight: 700; font-size: 0.86rem; line-height: 1.2; }
.type-tile-count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-soft); margin-top: 0.15rem; }
.type-tile.from-search::after, .lib-chip.from-search::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: #E8C887; box-shadow: 0 0 0 2px var(--paper); }

.lib-filters { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: var(--space-4); }
.lib-row { display: flex; gap: 0.9rem; align-items: flex-start; }
.lib-row-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); width: 58px; flex-shrink: 0; padding-top: 0.55rem; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; min-width: 0; }
.lib-chip { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 30px; padding: 0.42rem 0.5rem 0.42rem 0.9rem; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease; }
.lib-chip b { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; background: var(--paper-2); color: var(--ink-soft); border-radius: 20px; padding: 0.12rem 0.5rem; min-width: 1.7rem; text-align: center; }
.lib-chip:hover { border-color: var(--green); transform: translateY(-1px); }
.lib-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.lib-chip.active b { background: rgba(255,255,255,0.2); color: #fff; }
.lib-chip.is-empty { opacity: 0.5; }

.lib-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: 0.8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: var(--space-4); }
.lib-summary { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.9rem; min-height: 2rem; }
.lib-count { color: var(--ink-soft); } .lib-count b { color: var(--ink); font-size: 1.05rem; }
.lib-understood { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-left: 0.4rem; }
.tok { display: inline-flex; align-items: center; gap: 0.15rem; background: #E8F0EC; color: #1E4D3B; border: 1px solid #C9DBD1; border-radius: 30px; padding: 0.22rem 0.2rem 0.22rem 0.7rem; font-size: 0.82rem; font-weight: 600; }
.tok-text { background: #F6ECD9; color: #8A5A14; border-color: #EBD6AE; }
.tok-x { border: none; background: rgba(0,0,0,0.08); color: inherit; width: 20px; height: 20px; border-radius: 50%; font-size: 0.95rem; line-height: 1; cursor: pointer; margin-left: 0.2rem; }
.tok-x:hover { background: rgba(0,0,0,0.18); }
.lib-clearall { border: none; background: none; color: var(--green); font-weight: 700; font-size: 0.85rem; cursor: pointer; text-decoration: underline; margin-left: 0.3rem; }
.lib-controls { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.doc-tag-subject { color: var(--ink); font-weight: 600; }

.lib-empty { text-align: center; padding: var(--space-7) var(--space-4); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.lib-empty-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--paper-2); color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.9rem; }
.lib-empty h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.lib-empty p { color: var(--ink-soft); max-width: 44ch; margin: 0 auto 1.1rem; }

[data-theme="dark"] .type-tile-icon { background: #1B2C25; color: #86D9B0; }
[data-theme="dark"] .type-tile-icon.type-notes { background: #1A2733; color: #86BCE2; }
[data-theme="dark"] .type-tile-icon.type-scheme_of_work { background: #26261C; color: #C9C9A2; }
[data-theme="dark"] .type-tile-icon.type-marking_scheme { background: #2A2036; color: #C2A4E8; }
[data-theme="dark"] .type-tile-icon.type-holiday_assignment { background: #3A2D14; color: #E8B864; }
[data-theme="dark"] .type-tile-icon.type-__saved { background: #3E1D1D; color: #F59A9A; }
[data-theme="dark"] .type-tile-icon.type-all { background: var(--green); color: #fff; }
[data-theme="dark"] .tok { background: #16382A; color: #86D9B0; border-color: #2D4A3E; }
[data-theme="dark"] .tok-text { background: #3A2D14; color: #E8B864; border-color: #5a4720; }
[data-theme="dark"] .lib-clearall { color: #6FCBA2; }
[data-theme="dark"] .hub-input::placeholder { color: #6E7B74; }

@media (max-width: 720px) {
  .lib-hero { padding: var(--space-5) 0 var(--space-5); }
  .hub-bar { padding: 6px 6px 6px 8px; gap: 0.4rem; }
  .hub-orb { width: 42px; height: 42px; }
  .hub-go { padding: 0.75rem 0.95rem; }
  .hub-go span { display: inline; font-size: 0.9rem; }
  .hub-input { font-size: 1rem; }
  .type-tiles { display: flex; overflow-x: auto; gap: 0.6rem; margin-left: -16px; margin-right: -16px; padding: 4px 16px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .type-tile { flex: 0 0 auto; min-width: 168px; scroll-snap-align: start; }
  .lib-row { flex-direction: column; gap: 0.35rem; }
  .lib-row-label { padding-top: 0; width: auto; }
  .lib-chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 2px 16px 6px; -webkit-overflow-scrolling: touch; width: calc(100% + 32px); }
  .lib-chip { flex: 0 0 auto; }
  .lib-controls { width: 100%; }
  .lib-controls .sort-select { flex: 1; }
}

.toast-xp { border-left-color: #E8C887; background: linear-gradient(90deg, #163C2E, #0E2A20); color: #F8F6EE; font-weight: 600; }

/* ============================================================
   GAME LAYER (Home): player card, level ring, XP bar, quests, badges
   ============================================================ */
.home-hero .search-results-dropdown { z-index: 40; text-align: left; color: var(--ink); }
.lib-hero { z-index: 3; }
.lib-hero { overflow: visible; }
.lib-hero::before { overflow: hidden; }

.study-grid { grid-template-columns: 1.15fr 1fr 1fr; }
.study-card.player-card { display: flex; flex-direction: row; align-items: center; gap: var(--space-4); background: linear-gradient(135deg, #0E2A20, #163C2E); color: #F1EFE6; border-color: #0E2A20; position: relative; overflow: hidden; }
.study-card.player-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(232,200,135,0.25), transparent 65%); pointer-events: none; }
.level-ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(#E8C887 calc(var(--p) * 1%), rgba(255,255,255,0.14) 0); position: relative; }
.level-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #0E2A20; }
.level-num { position: relative; font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: #F8F6EE; }
.player-info { min-width: 0; position: relative; z-index: 1; flex: 1; }
.player-rank { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.player-xp { font-size: 0.82rem; color: rgba(241,239,230,0.75); margin: 0.1rem 0 0.5rem; }
.player-xp b { color: #E8C887; }
.xp-bar { height: 8px; background: rgba(255,255,255,0.16); border-radius: 20px; overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6FCBA2, #E8C887); border-radius: 20px; transition: width 0.6s ease; }
.player-meta { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; margin-top: 0.6rem; color: rgba(241,239,230,0.85); }
.meta-flame { color: #F2A64B; display: inline-flex; }

.study-card.quest-card, .study-card.week-card { display: flex; flex-direction: column; align-items: stretch; gap: 0.55rem; }
.quest-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.92rem; }
.quest-head span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
.quest { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; }
.quest-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.quest.done .quest-check { background: var(--green); border-color: var(--green); }
.quest.done .quest-label { text-decoration: line-through; color: var(--ink-soft); }
.quest-label { flex: 1; min-width: 0; }
.quest-xp { font-family: var(--font-mono); font-size: 0.7rem; color: #8A5A14; background: #F6ECD9; padding: 0.12rem 0.5rem; border-radius: 20px; white-space: nowrap; }
.best-row { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.2rem; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.best-row .study-icon { width: 36px; height: 36px; border-radius: 10px; }
.best-row .study-big { font-size: 1.5rem; }

.badge-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: var(--space-4); }
.badge { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0.8rem 0.6rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; opacity: 0.65; transition: transform 0.15s ease; }
.badge-medal { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; }
.badge.got { opacity: 1; border-color: #E8C887; background: linear-gradient(180deg, #FFF9EA, var(--surface)); }
.badge.got:hover { transform: translateY(-2px); }
.badge.got .badge-medal { background: linear-gradient(135deg, #E8C887, #C9A227); color: #3A2D0A; box-shadow: 0 3px 10px rgba(201,162,39,0.45); }
.badge-name { font-weight: 700; font-size: 0.8rem; line-height: 1.2; }
.badge-desc { font-size: 0.68rem; color: var(--ink-soft); line-height: 1.25; }
[data-theme="dark"] .badge.got { background: linear-gradient(180deg, #2A2517, var(--surface)); border-color: #6B5818; }
[data-theme="dark"] .quest-xp { background: #3A2D14; color: #E8B864; }

.grade-chip { text-decoration: none; padding: 0.55rem 0.6rem 0.55rem 1rem; font-size: 0.92rem; }
a.type-tile { text-decoration: none; }
#home-types.type-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { #home-types.type-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } .study-grid { grid-template-columns: 1fr 1fr; } .badge-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { #home-types.type-tiles { display: flex; } .study-grid { grid-template-columns: 1fr; } .badge-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .study-card.player-card { flex-direction: row; } }
@media (max-width: 560px) { .hide-sm { display: none !important; } }

/* ============================================================
   SITE-WIDE REFURBISH — one visual language everywhere
   Dark "game hub" page bands, premium buttons, lifted cards
   ============================================================ */
body .page-header {
  position: relative; color: #F1EFE6; border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: var(--space-5) 0 calc(var(--space-5) + 6px);
  background:
    radial-gradient(700px 260px at 90% -30%, rgba(111,203,162,0.22), transparent 60%),
    radial-gradient(520px 220px at 0% 120%, rgba(232,200,135,0.13), transparent 60%),
    linear-gradient(135deg, #0B221A 0%, #163C2E 100%);
}
body .page-header::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.45;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 95%); mask-image: linear-gradient(to bottom, #000, transparent 95%);
}
body .page-header .wrap { position: relative; }
body .page-header h1 { color: #F8F6EE !important; letter-spacing: -0.01em; }
body .page-header p { color: rgba(241,239,230,0.78) !important; }
body .page-header #teacher-greeting, body .page-header p:first-child:not(:last-child) { color: #E8C887 !important; font-family: var(--font-mono); font-size: 0.74rem !important; letter-spacing: 0.1em; text-transform: uppercase; }
body .page-header .back-link { color: rgba(241,239,230,0.72) !important; transition: color 0.15s ease, transform 0.15s ease; }
body .page-header .back-link:hover { color: #E8C887 !important; transform: translateX(-2px); }
body .page-header a:not(.back-link):not(.btn) { color: #E8C887; }
body .page-header .btn-ghost { color: #F1EFE6; border-color: rgba(255,255,255,0.28); }
body .page-header .btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* Premium primary button */
.btn-primary {
  background: linear-gradient(180deg, #1D5240 0%, #163C2E 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 6px 16px rgba(22,60,46,0.28);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-18deg); transition: left 0.55s ease; pointer-events: none;
}
.btn-primary:hover { background: linear-gradient(180deg, #226049 0%, #174331 100%); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 10px 24px rgba(22,60,46,0.34); }
.btn-primary:hover::after { left: 130%; }
.btn-primary:disabled { opacity: 0.6; }

/* Cards that respond */
.tool-card, .form-card, .stat-card, .level-card, .price-card, .how-step {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tool-card:hover { border-color: #6FCBA2; }
.tool-card { position: relative; overflow: hidden; }
.tool-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(#6FCBA2, #E8C887); opacity: 0; transition: opacity 0.18s ease; }
.tool-card:hover::before { opacity: 1; }

/* Site header: glassy */
.site-header { backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }

/* Tables: cleaner */
table th { letter-spacing: 0.04em; }
table tbody tr { transition: background 0.12s ease; }
table tbody tr:hover { background: rgba(22,60,46,0.04); }
[data-theme="dark"] table tbody tr:hover { background: rgba(111,203,162,0.07); }

@media (max-width: 640px) {
  body .page-header { padding: var(--space-4) 0 var(--space-4); }
  body .page-header h1 { font-size: 1.45rem !important; }
}
@media print { body .page-header { display: none !important; } }

/* Landing hero — same dark hub look as Library */
.hero {
  position: relative; color: #F1EFE6; padding: var(--space-8) 0 var(--space-7);
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(111,203,162,0.25), transparent 60%),
    radial-gradient(640px 320px at 0% 115%, rgba(232,200,135,0.15), transparent 60%),
    linear-gradient(135deg, #0B221A 0%, #163C2E 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 92%); mask-image: linear-gradient(to bottom, #000, transparent 92%);
}
.hero .hero-inner { position: relative; }
.hero h1 { color: #F8F6EE; }
.hero h1 .dot { color: #E8C887; }
.hero .eyebrow { color: #E8C887; }
.hero .eyebrow::before { color: #6FCBA2; }
.hero .hero-sub, .hero .hero-note { color: rgba(241,239,230,0.78); }
.hero .hero-search { border: none; border-radius: 16px; padding: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 18px 50px rgba(0,0,0,0.35); }
.hero .hero-search:focus-within { box-shadow: 0 0 0 2px #6FCBA2, 0 18px 50px rgba(0,0,0,0.4), 0 0 0 7px rgba(111,203,162,0.22); }
.hero .hero-search .btn-primary { border-radius: 11px; }
.trust-strip { background: #0B221A; border-top: 1px solid rgba(255,255,255,0.08); }
.trust-item strong { color: #E8C887; }
@media (max-width: 640px) { .hero { padding: var(--space-6) 0 var(--space-5); } }
@media (max-width: 900px) { .hero-inner .hero-visual { order: 2; margin-top: var(--space-4); } .hero-inner .hero-copy { order: 1; } }

/* Phones: two-column tool layouts stack, nothing pushes the page sideways */
.layout > * { min-width: 0; }
@media (max-width: 800px) {
  body .layout { grid-template-columns: 1fr !important; }
  body .layout .form-card { position: static !important; }
  .col-card { padding: var(--space-4); }
}

/* Term dropdown + Free toggle live on the search bar */
.hub-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem; margin-top: 0.85rem; }
.hub-filter { display: inline-flex; align-items: center; gap: 0.5rem; color: rgba(241,239,230,0.85); font-size: 0.85rem; cursor: pointer; }
.hub-filter > span { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: #E8C887; }
.hub-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; color: #F8F6EE; font: inherit; font-size: 0.88rem; font-weight: 600;
  background: rgba(255,255,255,0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23E8C887' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.8rem center;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; padding: 0.45rem 2.1rem 0.45rem 0.95rem; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.hub-select:hover { background-color: rgba(255,255,255,0.16); }
.hub-select:focus { outline: none; border-color: #6FCBA2; box-shadow: 0 0 0 3px rgba(111,203,162,0.25); }
.hub-select option { color: #16211C; background: #fff; }
.hub-free input { width: 16px; height: 16px; accent-color: #6FCBA2; }
.hub-free > span { font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0; text-transform: none; color: rgba(241,239,230,0.9); }
.hub-select.has-value { background-color: rgba(111,203,162,0.22); border-color: #6FCBA2; }

/* Type tiles follow however many types the admin has set up */
.type-tiles, #home-types.type-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.type-tiles, #home-types.type-tiles { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.type-tile { padding-left: 0.7rem; padding-right: 0.7rem; gap: 0.6rem; }
.type-tile-name { font-size: 0.86rem; overflow-wrap: anywhere; line-height: 1.2; }
.type-tile-icon { width: 36px; height: 36px; flex-shrink: 0; }
.type-tile-text { min-width: 0; }
@media (min-width: 721px) {
  .type-tile { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.75rem 0.8rem; }
  .type-tile-name { overflow-wrap: normal; font-size: 0.86rem; }
  .type-tile-text { width: 100%; }
}

/* ===== Voice orb: ripples, live bars, status line ===== */
.hub-orb { transition: transform 0.15s ease; }
.hub-orb:hover { transform: scale(1.06); }
.hub-orb:focus-visible { outline: 3px solid #6FCBA2; outline-offset: 3px; }
.hub-orb .orb-bars { position: absolute; inset: 0; z-index: 2; display: none; align-items: center; justify-content: center; gap: 3px; }
.hub-orb .orb-bars i { width: 3px; height: 8px; border-radius: 2px; background: #E8F7EE; animation: orb-bar 0.9s ease-in-out infinite; }
.hub-orb .orb-bars i:nth-child(2) { animation-delay: 0.12s; } .hub-orb .orb-bars i:nth-child(3) { animation-delay: 0.24s; }
.hub-orb .orb-bars i:nth-child(4) { animation-delay: 0.36s; } .hub-orb .orb-bars i:nth-child(5) { animation-delay: 0.48s; }
@keyframes orb-bar { 0%,100% { height: 6px; } 50% { height: 20px; } }
.hub-orb.listening > svg { display: none; }
.hub-orb.listening .orb-bars { display: flex; }
.hub-orb.listening::after { background: radial-gradient(circle at 35% 30%, #2F7F5F, #0B221A 75%); }
.hub-orb.listening { animation: orb-ripple 1.4s ease-out infinite; }
@keyframes orb-ripple { 0% { box-shadow: 0 0 0 0 rgba(111,203,162,0.55), 0 0 0 0 rgba(111,203,162,0.3); } 70% { box-shadow: 0 0 0 14px rgba(111,203,162,0), 0 0 0 26px rgba(111,203,162,0); } 100% { box-shadow: 0 0 0 0 rgba(111,203,162,0), 0 0 0 0 rgba(111,203,162,0); } }
.hub-orb.no-voice { opacity: 0.55; }
.hub-input.is-live { color: #1F5A44; font-style: italic; }
.voice-status { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease; font-size: 0.88rem; color: rgba(241,239,230,0.88); }
.voice-status.show { max-height: 4.5rem; opacity: 1; margin-top: 0.7rem; }
.voice-status b { color: #E8C887; font-weight: 600; }
.voice-status em { color: #fff; font-style: normal; opacity: 0.9; }
.voice-status.live::before, .voice-status.ok::before, .voice-status.err::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.55rem; vertical-align: middle; background: #6FCBA2; }
.voice-status.live::before { animation: orb-blink 1s ease-in-out infinite; }
.voice-status.err { color: #FFD9D4; } .voice-status.err::before { background: #FF8C7E; }
@keyframes orb-blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .hub-orb.listening, .hub-orb .orb-bars i, .hub-orb::before { animation: none !important; } }

/* ===== Grade / Subject: click-to-show ===== */
.filter-toggles { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.filter-toggle { display: inline-flex; align-items: center; gap: 0.55rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.85rem 0.6rem 0.95rem; cursor: pointer; font: inherit; color: var(--ink); transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.filter-toggle:hover { border-color: var(--green); }
.filter-toggle .ft-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.filter-toggle .ft-value { font-weight: 600; font-size: 0.92rem; }
.filter-toggle .ico { transition: transform 0.2s ease; color: var(--ink-soft); }
.filter-toggle.open { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,60,46,0.12); }
.filter-toggle.open .ico { transform: rotate(180deg); }
.filter-toggle.has-value { background: var(--green); border-color: var(--green); color: #fff; }
.filter-toggle.has-value .ft-label, .filter-toggle.has-value .ico { color: rgba(255,255,255,0.75); }
.filter-panel { margin-top: 0.7rem; padding: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; animation: panel-in 0.18s ease; }
.filter-panel[hidden] { display: none; }
.filter-panel .lib-chips { flex-wrap: wrap !important; overflow: visible !important; margin: 0 !important; padding: 0 !important; width: auto !important; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.grade-more { cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; border-style: dashed; color: var(--green); background: transparent; font: inherit; }
.grade-more.open .ico { transform: rotate(180deg); }
[data-theme="dark"] .filter-toggle.has-value { background: #2F7F5F; border-color: #2F7F5F; }

/* ===== Pay-per-download: gold accents for the credit flow ===== */
.btn-gold {
  background: linear-gradient(180deg, #F3DBA0, #E8C887); color: #4A3410; border: 1px solid #D9B467;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 4px 12px rgba(138,90,20,0.18);
  font-weight: 700;
}
.btn-gold:hover { background: linear-gradient(180deg, #F6E3B4, #EFD39A); }
.btn-gold:disabled { opacity: 0.7; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto;
  background: rgba(232,200,135,0.16); border: 1px solid rgba(232,200,135,0.45); color: #E8C887;
  font-size: 0.82rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: 999px;
  text-decoration: none; transition: background 0.15s ease;
}
.credit-pill:hover { background: rgba(232,200,135,0.26); }
.credit-pill span:last-child { color: rgba(241,239,230,0.75); font-weight: 500; }
@media (max-width: 640px) { .credit-pill { margin-left: 0; width: 100%; justify-content: center; } }

/* Nudge: shown on the library when a subscription is about to lapse, or downloads have run out */
.access-nudge { background: var(--ochre-soft); border-bottom: 1px solid var(--ochre); }
.access-nudge-inner { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1.5rem; flex-wrap: wrap; }
.access-nudge-inner svg { color: var(--ochre); flex-shrink: 0; }
.access-nudge-text { color: var(--ink); font-size: 0.92rem; font-weight: 500; flex: 1; min-width: 200px; }
.access-nudge-cta {
  background: var(--ochre); color: var(--white); font-size: 0.85rem; font-weight: 700;
  padding: 0.4rem 0.9rem; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.access-nudge-cta:hover { opacity: 0.88; }
.access-nudge-close { background: none; border: none; color: var(--ink-soft); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
.access-nudge-close:hover { color: var(--ink); }
@media (max-width: 640px) { .access-nudge-inner { padding: 0.7rem 1rem; } }

/* Pricing: the pay-per-download row underneath the subscriptions */
.pricing-sub { color: var(--ink-soft); font-size: 0.95rem; margin-top: calc(-1 * var(--space-2)); margin-bottom: var(--space-5); max-width: 560px; }
.pricing-divider { display: flex; align-items: center; gap: 1rem; max-width: 760px; margin: var(--space-6) 0 var(--space-4); color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }
.pricing-divider::before, .pricing-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pricing-grid-ppd { max-width: 760px; }
.price-card-gold {
  background: linear-gradient(165deg, #FFF8E8 0%, var(--surface) 55%);
  border-color: #E8C887;
  box-shadow: 0 10px 28px rgba(138,90,20,0.1);
}
[data-theme="dark"] .price-card-gold { background: linear-gradient(165deg, rgba(232,200,135,0.1) 0%, var(--surface) 55%); }
.price-badge-gold { background: linear-gradient(135deg, #F3DBA0, #E8C887); color: #4A3410; }
.price-card-gold h3 { color: inherit; }
