:root {
  /* ---- surfaces ---------------------------------------------------- */
  --page: #FDF9F3;          /* warm cream, the whole-site canvas */
  --cream: #F7F0E4;         /* alternating band */
  --white: #fff;
  --line: #E8DFCE;

  /* ---- type -------------------------------------------------------- */
  --ink: #1A1A2E;           /* near-black, high contrast on cream */
  --grey: #5A5A72;
  --purple: #4C2E72;        /* display headings */
  --purple-bright: #6B3FA0;

  --navy: #4C2E72;          /* legacy aliases, kept so older rules still */
  --navy-deep: #2E1B4A;     /* resolve to the new palette */
  --gold: #E8913A;

  --radius: 18px;
  --radius-lg: 26px;

  /* ---- pastel card system ----------------------------------------- */
  /* Each pair is a soft fill plus a bold, AA-contrast ink for its text. */
  --lav: #E4DEF9;      --lav-ink: #4A2E8F;    --lav-line: #C9BDF0;
  --pink: #FBDCE8;     --pink-ink: #B0326E;   --pink-line: #F3BDD3;
  --green: #D4F0E0;    --green-ink: #16704A;  --green-line: #A9E0C3;
  --orange: #FBE2CC;   --orange-ink: #B0541C; --orange-line: #F2C69E;
  --yellow: #FBF2D2;   --yellow-ink: #866312; --yellow-line: #F0E0A8;
  --blue: #D9EBFB;     --blue-ink: #14568C;   --blue-line: #AFD5F2;
  --teal: #D2EFEC;     --teal-ink: #12706A;   --teal-line: #A5DFD9;

  /* subject accents, re-pointed at the pastel system */
  --maths: #4A2E8F;
  --physics: #16704A;
  --cs: #B0326E;
  --maths-light: var(--lav);
  --physics-light: var(--green);
  --cs-light: var(--pink);
  --maths-glow: rgba(74,46,143,.22);
  --physics-glow: rgba(22,112,74,.22);
  --cs-glow: rgba(176,50,110,.22);
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The UA rule for [hidden] is display:none, but any author `display` value
   beats it — .lib-empty (flex) and .lib-panes (grid) both stayed on screen
   when toggled with el.hidden. Force it. */
[hidden] { display: none !important; }

body {
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

/* Display serif for the big statements, grotesk for everything functional -
   the contrast is what gives the page its editorial feel. */
h1, h2, .section-title, .display { font-family: "Playfair Display", Georgia, serif;
  letter-spacing: -.01em; }
h3, .brand span { font-family: "Archivo", sans-serif; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 22px; }

/* ============ header ============ */
.site-header { background: var(--page); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); background: rgba(245,241,234,.94); }
.header-row { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 56px; width: 56px; object-fit: contain; border-radius: 14px;
  transition: transform .3s ease; }
.brand img:hover { transform: scale(1.08) rotate(-3deg); }
.brand span { font-weight: 800; font-size: 1.4rem; color: var(--navy); }
.header-nav { display: flex; align-items: center; gap: 22px; }
.nav-link { text-decoration: none; color: var(--ink); font-weight: 600;
  font-size: .93rem; padding-bottom: 2px; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .3s; }
.nav-link:hover { color: var(--navy); border-bottom-color: var(--gold); }
.nav-link.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ============ buttons ============ */
.btn { display: inline-block; border: 0; cursor: pointer; border-radius: 999px;
  padding: 11px 24px; font: 600 0.95rem "Hanken Grotesk", sans-serif;
  text-decoration: none; transition: transform .15s ease, opacity .15s, box-shadow .3s; }
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(135deg, var(--gold) 0%, #f0c040 100%);
  color: var(--navy-deep); box-shadow: 0 4px 18px rgba(244,166,50,.3); }
.btn-gold:hover { box-shadow: 0 6px 28px rgba(244,166,50,.45); transform: translateY(-1px); }
.btn-dark { background: var(--ink);
  color: #F5F1EA; padding: 13px 32px; box-shadow: 0 4px 18px rgba(26,26,26,.22); }
.btn-dark:hover { box-shadow: 0 8px 28px rgba(26,26,26,.34); transform: translateY(-3px); }
.btn-white { background: #fff; color: var(--navy-deep); }
.btn-white:hover { box-shadow: 0 6px 24px rgba(0,0,0,.1); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--navy-deep);
  border: 1.5px solid var(--navy-deep); }
.btn-outline:hover { background: var(--navy-deep); color: #fff; }
.btn[disabled] { opacity: .5; cursor: wait; }

/* ============ CTA shimmer ============ */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.btn-gold { position: relative; overflow: hidden; }
.btn-gold::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  background-size: 200% 100%; animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

/* ============ hero ============ */
.hero { background: linear-gradient(160deg, var(--cream) 0%, #E5DDD0 60%, #DDD4C2 100%);
  padding: 64px 0 48px; border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -120px; right: -120px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244,166,50,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-slim { padding: 56px 0 44px; }
.eyebrow { font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  font-size: .78rem; color: var(--gold); margin-bottom: 14px; }
.hero h1, .section-title { font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 900; line-height: 1.08; color: var(--navy); }
.hero h1 em, .section-title em { font-style: normal; color: var(--gold); }
.hero .sub { max-width: 560px; margin-top: 18px; color: #3a3a3a; }
.hero-ctas { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 10px 36px;
  margin-top: 34px; width: fit-content; }
.hero-stats b { display: block; font-family: "Archivo", sans-serif;
  font-size: 1.6rem; color: var(--navy); }
.hero-stats span { font-size: .85rem; color: var(--grey); max-width: 170px;
  display: block; }

.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px;
  align-items: center; }
.hero-3d { position: relative; min-height: 460px; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; }

/* ============ sections ============ */
.section { padding: 72px 0; position: relative; }
.section-cream { background: linear-gradient(160deg, var(--cream) 0%, #E0D9CC 100%);
  border-block: 1px solid var(--line); }
.section-navy { background: linear-gradient(160deg, var(--navy-deep) 0%, #1a2650 50%, #22304a 100%); }
.section-title { margin-bottom: 34px; }
.section-title.light { color: #fff; }
.centered { text-align: center; }

/* section gradient dividers */
.section + .section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  opacity: .3;
}

/* ============ reveal animations ============ */
.reveal { opacity: 0; transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--delay, 0ms); }
.reveal.in { opacity: 1; transform: none; }

.reveal-left { opacity: 0; transform: translateX(-50px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--delay, 0ms); }
.reveal-left.in { opacity: 1; transform: none; }

.reveal-right { opacity: 0; transform: translateX(50px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--delay, 0ms); }
.reveal-right.in { opacity: 1; transform: none; }

.reveal-scale { opacity: 0; transform: scale(.88);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--delay, 0ms); }
.reveal-scale.in { opacity: 1; transform: none; }

/* ============ why cards ============ */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.why-card { background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  border-top: 4px solid var(--gold);
  transition: transform .25s ease, box-shadow .25s ease; }
.why-card:hover { transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(26,26,26,.12); }
/* Tinted variants: the border-top accent picks up each card's own ink so the
   three boxes read as a set rather than three unrelated colours. */
.why-card[class*="tint-"] { border-width: 1.5px; border-top-width: 5px; }
.why-card.tint-lav    { border-top-color: var(--lav-ink); }
.why-card.tint-pink   { border-top-color: var(--pink-ink); }
.why-card.tint-green  { border-top-color: var(--green-ink); }
.why-card.tint-blue   { border-top-color: var(--blue-ink); }
.why-card.tint-orange { border-top-color: var(--orange-ink); }
.why-card.tint-yellow { border-top-color: var(--yellow-ink); }
.why-num { font-family: "Archivo", sans-serif; font-weight: 800;
  font-size: .95rem; color: var(--gold); }
.why-card.tint-lav    .why-num { color: var(--lav-ink); }
.why-card.tint-pink   .why-num { color: var(--pink-ink); }
.why-card.tint-green  .why-num { color: var(--green-ink); }
.why-card h3 { margin: 10px 0 8px; color: var(--navy); font-size: 1.1rem; }
.why-card p { font-size: .92rem; color: var(--ink); opacity: .88; }

/* photo placeholders */
.photo-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 16px;
  align-items: stretch; }
.photo-ph { border: 2px dashed #d8cfae; border-radius: var(--radius);
  background: #fffdf4; min-height: 220px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--grey); }
.photo-ph.tall { min-height: 300px; }
.photo-ph span { font-size: 2rem; }
.photo-ph figcaption { font-size: .85rem; }

.hint { font-size: .84rem; color: var(--grey); margin-top: 14px; }

/* ============ testimonials ============ */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.quote { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 28px; color: #dfe4f0;
  backdrop-filter: blur(8px);
  transition: transform .3s ease, box-shadow .3s ease, background .3s; }
.quote:hover { transform: translateY(-4px);
  background: rgba(255,255,255,.12);
  box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.quote .stars { color: var(--gold); font-size: 1rem; letter-spacing: 2px;
  margin-bottom: 14px; display: block; }
.quote p { font-size: .95rem; font-style: italic; line-height: 1.6; }
.quote footer { display: flex; align-items: center; gap: 10px; margin-top: 18px;
  font-size: .85rem; color: #aab3c9; }
.quote footer strong { color: #fff; font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, #f0c040 100%);
  color: var(--navy-deep); display: inline-flex; align-items: center;
  justify-content: center; font-weight: 800; font-family: "Archivo", sans-serif;
  font-size: .9rem; }
.section-navy .eyebrow { color: var(--gold); }

/* board preview cards */
.board-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.board-card { background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; text-decoration: none;
  color: var(--ink); transition: transform .2s ease, box-shadow .2s ease,
  border-color .2s ease; }
.board-card:hover { transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(26,26,46,.13); }
.board-card h3 { margin-bottom: 8px; }
.board-card p { font-size: .88rem; color: var(--ink); opacity: .8; }
.board-card.tint-blue   h3, .board-card.tint-blue   .go { color: var(--blue-ink); }
.board-card.tint-orange h3, .board-card.tint-orange .go { color: var(--orange-ink); }
.board-card.tint-yellow h3, .board-card.tint-yellow .go { color: var(--yellow-ink); }
.go { display: inline-block; margin-top: 14px; font-weight: 700;
  color: var(--gold); font-size: .9rem; transition: transform .2s; }
.board-card:hover .go { transform: translateX(4px); }
.go.muted { color: var(--grey); }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--navy-deep) 0%, #1a2650 50%, #293860 100%);
  color: #fff; padding: 52px 0; margin-top: 40px; position: relative; overflow: hidden; }
.cta-band::before {
  content: ''; position: absolute; top: -60px; left: -60px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244,166,50,.1) 0%, transparent 70%);
  pointer-events: none;
}
.cta-band::after {
  content: ''; position: absolute; bottom: -80px; right: -80px;
  width: 350px; height: 350px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.08) 0%, transparent 70%);
  pointer-events: none;
}
.cta-row { display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; position: relative; z-index: 1; }
.cta-band h2 { font-size: 1.8rem; }
.cta-band p { color: #b9c1d6; margin-top: 6px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ subjects page ============ */
.board-section { padding: 56px 0 8px; }
.board-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; gap: 20px; }
.board-head h2 { color: var(--navy); font-size: 1.7rem; }
.board-head p { color: var(--grey); margin: 6px 0 0; }
.board-head-left { display: flex; flex-direction: column; }
.subject-grid {
  display: flex !important;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 18px;
  padding: 10px 4px 24px 4px;
  margin-inline: -4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) #f1f1ee;
}

/* Custom scrollbars */
.subject-grid::-webkit-scrollbar {
  height: 8px;
}
.subject-grid::-webkit-scrollbar-track {
  background: #f1f1ee;
  border-radius: 999px;
}
.subject-grid::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 999px;
  transition: background 0.2s;
}
.subject-grid::-webkit-scrollbar-thumb:hover {
  background: #d8812c;
}

/* Scroll navigation controls */
.scroll-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.scroll-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--grey);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
}
.scroll-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--cream);
  transform: scale(1.05);
}
.scroll-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.scroll-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* colorful subject cards */
.subject-card { background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  border-left: 5px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease,
  border-color .25s ease, color .25s ease;
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between; }
.subject-grid .res-card {
  flex: 0 0 320px;
}
.subject-card:hover { transform: scale(1.03) translateY(-3px); }
.subject-card:hover h3, .subject-card:hover p, .subject-card:hover .code { color: #fff !important; }
.subject-card:hover .chip.live { background: #fff; color: var(--navy); border-color: #fff; }
.subject-card:hover .chip.soon { background: rgba(255,255,255,.2); color: #fff; }

/* Mathematics cards */
.subject-card.math { border-left-color: var(--maths); }
.subject-card.math:hover { background: var(--maths);
  box-shadow: 0 14px 36px var(--maths-glow); border-color: var(--maths); }
.subject-card.math .code { color: var(--maths); }

/* Physics cards */
.subject-card.physics { border-left-color: var(--physics); }
.subject-card.physics:hover { background: var(--physics);
  box-shadow: 0 14px 36px var(--physics-glow); border-color: var(--physics); }
.subject-card.physics .code { color: var(--physics); }

/* Computer Science cards */
.subject-card.cs { border-left-color: var(--cs); }
.subject-card.cs:hover { background: var(--cs);
  box-shadow: 0 14px 36px var(--cs-glow); border-color: var(--cs); }
.subject-card.cs .code { color: var(--cs); }

.subject-card .code { font-family: "Archivo", sans-serif; font-weight: 800;
  color: var(--gold); letter-spacing: .04em; font-size: 1.1rem;
  transition: color .25s; }
.subject-card h3 { color: var(--navy); margin: 6px 0 8px; font-size: 1.08rem; transition: color .25s; }
.subject-card p { font-size: .88rem; color: var(--grey); transition: color .25s; }
.subject-links { margin-top: 16px; }
.chip { display: inline-block; border-radius: 999px; padding: 6px 14px;
  font-size: .82rem; font-weight: 700; text-decoration: none;
  transition: transform .2s, box-shadow .2s; }
.chip:hover { transform: translateY(-1px); }
.chip.live { background: var(--cream); color: var(--navy);
  border: 1px solid var(--gold); }
.chip.live:hover { box-shadow: 0 4px 14px rgba(244,166,50,.3); }
.chip.soon { background: #f1f1ee; color: var(--grey); }

/* ============ resources page ============ */
.resource-section { padding: 44px 0 6px; }
.resource-section h2 { color: var(--navy); font-size: 1.6rem;
  margin-bottom: 20px; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.resource-card { background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; text-decoration: none;
  color: var(--ink); transition: transform .2s ease, box-shadow .2s ease; }
a.resource-card:hover { transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(41,53,84,.10); }
.resource-card.featured { grid-column: 1 / -1; background: linear-gradient(135deg, var(--navy-deep) 0%, #2a3f6e 100%);
  color: #e6eaf4; border-color: var(--navy-deep); }
.resource-card.featured h3 { color: #fff; font-size: 1.3rem; }
.resource-card.featured .tag { background: var(--gold); color: var(--navy-deep); }
.resource-card.soon { opacity: .8; }
.resource-card .tag { display: inline-block; background: var(--cream);
  color: var(--navy); font-size: .75rem; font-weight: 700; border-radius: 999px;
  padding: 4px 12px; margin-bottom: 12px; }
.resource-card h3 { color: var(--navy); margin-bottom: 8px; }
.resource-card p { font-size: .9rem; opacity: .85; }

/* ============ generator (papers page) ============ */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px; margin: -26px 0 48px; box-shadow: 0 14px 40px rgba(26,26,26,.10); }
.card h2 { color: var(--navy); font-size: 1.5rem; margin-bottom: 22px; }

.field { margin-bottom: 24px; }
.field-label { display: block; font-weight: 700; font-size: .82rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--navy);
  margin-bottom: 10px; }
.field-label-row { display: flex; justify-content: space-between;
  align-items: baseline; }
.mini { border: 0; background: none; color: var(--gold); font-weight: 600;
  cursor: pointer; font-size: .82rem; }

/* subject-group styles are overridden at bottom of file by the board-grouped picker styles */
.subject-groups { display: grid; gap: 18px; }

.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 18px; cursor: pointer; font: 600 .9rem "Hanken Grotesk", sans-serif;
  color: var(--ink); transition: all .15s; }
.pill:hover { border-color: var(--gold); transform: translateY(-2px); }
.pill.active { background: var(--navy-deep); border-color: var(--navy-deep);
  color: #fff; box-shadow: 0 4px 14px rgba(46,27,74,.25); }
.pill small { color: inherit; opacity: .65; font-weight: 500; }

/* component filter pills — gold accent when active */
.pill.component.active { background: var(--gold); border-color: var(--gold);
  color: var(--navy-deep); }
.pill.component small { margin-left: 4px; }

/* "15 topics examined in P3 · Pure 3" beside the Topics step label */
.topic-note { margin-left: 10px; font-weight: 500; font-size: .78rem;
  letter-spacing: 0; text-transform: none; color: var(--grey); }

/* subject-card component chips */
.comp-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip-comp { display: inline-block; border-radius: 999px; padding: 3px 10px;
  font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  background: var(--page); color: var(--navy); border: 1.5px solid var(--line); }
.subject-card:hover .chip-comp { background: rgba(255,255,255,.18); color: #fff;
  border-color: rgba(255,255,255,.35); }

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 8px; }
.topic { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 8px 12px; cursor: pointer; font-size: .9rem;
  background: #fff; transition: all .15s; }
.topic:hover { border-color: var(--green-line); background: var(--green); }
.topic.on { background: var(--green); border-color: var(--green-ink); color: var(--green-ink); font-weight: 600; }
.topic.on .n { color: var(--green-ink); opacity: .7; }
.topic input { accent-color: var(--green-ink); }
.topic .n { margin-left: auto; color: var(--grey); font-size: .78rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.inline { display: flex; align-items: center; gap: 10px; }
.dash { color: var(--grey); }
select, input[type="number"] { border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font: 500 .95rem "Hanken Grotesk", sans-serif; background: #fff;
  color: var(--ink); width: 100%; max-width: 140px; }
.check { display: flex; gap: 9px; align-items: center; font-size: .95rem; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }
.hidden { display: none !important; }

.actions { display: flex; align-items: center; gap: 18px; margin-top: 6px; }
.status { font-size: .92rem; color: var(--grey); }
.status.err { color: #b4231f; }
.status.ok { color: #0e7a4c; }

/* papers page how-steps */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-bottom: 64px; }
.step { background: var(--cream); border-radius: var(--radius); padding: 24px;
  transition: transform .25s ease; }
.step:hover { transform: translateY(-3px); }
.step:nth-child(2) { background: var(--navy-deep); color: #edf0f7; }
.step:nth-child(2) h3 { color: #fff; }
.step:nth-child(3) { background: #fff; border: 1px solid var(--line); }
.step b { font-family: "Archivo", sans-serif; color: var(--gold);
  font-size: .95rem; }
.step h3 { margin: 8px 0 6px; color: var(--navy); font-size: 1.05rem; }
.step p { font-size: .9rem; opacity: .85; }

/* ============ announce bar ============ */
@keyframes announce-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.announce { background: linear-gradient(90deg, var(--navy-deep), #1a2650, #293860, var(--navy-deep));
  background-size: 300% 100%; animation: announce-gradient 8s ease infinite;
  color: #cfd6e6; font-size: .86rem; text-align: center; padding: 10px 0; }
.announce b { color: #fff; }
.announce a { color: var(--gold); font-weight: 700; text-decoration: none;
  transition: color .2s; }
.announce a:hover { color: #f7c44a; }

/* ============ numbers band ============ */
.numbers-band { background: linear-gradient(135deg, var(--navy-deep) 0%, #1a2650 50%, #22304a 100%);
  padding: 48px 0; position: relative; overflow: hidden; }
.numbers-band::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .5;
}
.numbers-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.numbers-row b { display: block; font-family: "Archivo", sans-serif;
  font-weight: 900; font-size: 2.3rem; color: var(--gold); }
.numbers-row span { color: #b9c1d6; font-size: .86rem; display: block;
  max-width: 200px; }

/* ============ includes checklist ============ */
.includes { list-style: none; display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 12px 26px; }
.includes li { background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 16px 13px 44px; position: relative;
  font-size: .95rem; transition: transform .2s ease, box-shadow .2s ease; }
.includes li:hover { transform: translateX(4px);
  box-shadow: 0 4px 14px rgba(41,53,84,.06); }
.includes li:nth-child(odd) { background: #fffef8; }
.includes li::before { content: "✓"; position: absolute; left: 16px;
  color: var(--gold); font-weight: 800; font-family: "Archivo", sans-serif; }

/* ============ tutor section ============ */
.tutor-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px;
  align-items: start; }
.tutor-photo { min-height: 380px; position: sticky; top: 90px; }
.tutor-copy p { margin-bottom: 14px; color: #4a5266; }
.tutor-points { list-style: none; margin-top: 20px; }
.tutor-points li { padding: 10px 0 10px 26px; position: relative;
  font-size: .95rem; border-bottom: 1px dashed var(--line);
  transition: transform .2s, background .2s; }
.tutor-points li:hover { transform: translateX(6px); }
.tutor-points li::before { content: "→"; position: absolute; left: 0;
  color: var(--gold); font-weight: 800; }
.tutor-points b { color: var(--navy); }

/* ============ FAQ accordion ============ */
.faq-wrap { max-width: 760px; margin-inline: auto; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 14px;
  margin-bottom: 10px; overflow: hidden;
  transition: border-color .3s, box-shadow .3s; }
.faq[open] { border-left: 4px solid var(--gold);
  box-shadow: 0 4px 18px rgba(244,166,50,.08); }
.faq summary { cursor: pointer; padding: 17px 20px; font-weight: 700;
  color: var(--navy); list-style: none; position: relative; user-select: none;
  transition: color .2s; }
.faq summary:hover { color: var(--gold); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 14px;
  font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.2rem;
  color: var(--gold); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq[open] summary { border-bottom: 1px solid var(--line); }
.faq p { padding: 15px 20px; font-size: .93rem; color: #4a5266; }


/* ============ footer ============ */
.site-footer { background: linear-gradient(180deg, var(--navy-deep) 0%, #141c30 100%);
  color: #c8cede; font-size: .88rem; padding-top: 0; }

/* WhatsApp strip */
.footer-wa-strip { background: rgba(0,0,0,.22); border-bottom: 1px solid rgba(255,255,255,.07); }
.footer-wa-inner { display: flex; align-items: center; justify-content: space-between;
  padding: 22px 22px; gap: 20px; flex-wrap: wrap; }
.footer-wa-head { font-weight: 700; color: #fff; font-size: .95rem; margin-bottom: 3px; }
.footer-wa-sub { color: #8893ad; font-size: .83rem; }
.footer-wa-btn { display: inline-flex; align-items: center; gap: 8px;
  background: #25D366; color: #fff; text-decoration: none;
  padding: 11px 22px; border-radius: 10px; font-weight: 700;
  font-size: .88rem; white-space: nowrap; flex-shrink: 0;
  transition: background .15s, transform .15s; }
.footer-wa-btn:hover { background: #1ebe5c; transform: translateY(-1px); }

.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1fr;
  gap: 36px; padding: 52px 22px 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; text-decoration: none; }
.footer-brand img { height: 44px; width: 44px; object-fit: contain;
  border-radius: 10px; }
.footer-brand span { font-family: "Archivo", sans-serif; font-weight: 800;
  font-size: 1.2rem; color: #fff; }
.footer-tagline { color: #8893ad; font-size: .85rem; line-height: 1.65; max-width: 28ch; }
.footer-socials { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.footer-social-link { display: flex; align-items: center; gap: 8px; color: #8893ad; text-decoration: none; font-size: .83rem;
  transition: color .2s; }
.footer-social-link:hover { color: var(--gold); }
.footer-contact-icon { font-size: .95rem; line-height: 1; flex-shrink: 0; }

.footer-col h4 { font-family: "Archivo", sans-serif; color: #fff;
  font-size: .82rem; margin-bottom: 16px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; }
.footer-col a { display: block; color: #8893ad; text-decoration: none;
  padding: 4px 0; font-size: .86rem; transition: color .2s, transform .2s; }
.footer-col a:hover { color: var(--gold); transform: translateX(3px); }
.footer-link-accent { color: var(--gold) !important; }
.footer-link-accent:hover { color: #f5c36e !important; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.07);
  display: flex; justify-content: space-between; padding: 18px 22px;
  flex-wrap: wrap; gap: 8px; font-size: .8rem; color: #4d5a72; }

/* ============ Booking Choice Modal ============ */
.bk-choice {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .2s; }
.bk-choice.open { opacity: 1; pointer-events: all; }
.bkc-backdrop {
  position: absolute; inset: 0;
  background: rgba(41,53,84,.58); backdrop-filter: blur(5px); }
.bkc-inner {
  position: relative; z-index: 1;
  background: var(--page); border-radius: 22px;
  padding: 38px 34px 32px; max-width: 570px; width: 100%;
  box-shadow: 0 28px 80px rgba(41,53,84,.22);
  transform: translateY(10px); transition: transform .2s; }
.bk-choice.open .bkc-inner { transform: translateY(0); }
.bkc-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--grey); line-height: 1; padding: 2px 7px;
  border-radius: 7px; transition: background .12s, color .12s; }
.bkc-close:hover { background: var(--cream); color: var(--navy); }
.bkc-head { text-align: center; margin-bottom: 26px; }
.bkc-head h3 {
  font-family: "Archivo", sans-serif; font-size: 1.4rem; font-weight: 800;
  color: var(--navy); margin: 0 0 7px; }
.bkc-head p { color: var(--grey); font-size: .91rem; line-height: 1.55; margin: 0; }
.bkc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.bkc-opt {
  background: var(--page); border: 2px solid var(--line); border-radius: 14px;
  padding: 22px 18px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color .14s, background .14s, transform .14s, box-shadow .14s; }
.bkc-opt:hover {
  border-color: var(--gold); background: var(--cream);
  transform: translateY(-3px); box-shadow: 0 10px 28px rgba(244,166,50,.15); }
.bkc-opt.primary { border-color: var(--gold); background: var(--cream); }
.bkc-opt.primary:hover { box-shadow: 0 12px 32px rgba(244,166,50,.22); }
.bkc-icon { font-size: 1.8rem; display: block; margin-bottom: 5px; }
.bkc-opt b { font-size: .97rem; font-weight: 800; color: var(--navy); }
.bkc-opt p { font-size: .82rem; color: var(--grey); line-height: 1.5; margin: 0; flex: 1; }
.bkc-opt .bkc-badge {
  font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: var(--gold); color: #1d2740; border-radius: 5px;
  padding: 2px 8px; width: fit-content; margin-bottom: 2px; }
.bkc-opt .bkc-note {
  font-size: .76rem; color: var(--grey); font-style: italic; margin-top: 4px; }
.bkc-cta { font-size: .82rem; font-weight: 700; color: var(--gold); margin-top: 8px; display: block; }
@media (max-width: 500px) {
  .bkc-options { grid-template-columns: 1fr; }
  .bkc-inner { padding: 28px 18px 22px; }
  .bkc-head h3 { font-size: 1.18rem; } }

/* ============ Demo Booking Side Panel ============ */
.bk-panel {
  position: fixed; right: -420px; top: 50%; transform: translateY(-50%);
  width: 400px; max-height: 92vh; overflow-y: auto;
  background: var(--page); border: 1.5px solid var(--line); border-radius: 20px 0 0 20px;
  box-shadow: -6px 0 32px rgba(29,39,64,.18);
  padding: 28px 24px 28px 28px;
  z-index: 950;
  transition: right .32s cubic-bezier(.4,0,.2,1);
}
.bk-panel.open { right: 0; }
.bk-panel .fb-panel-head { margin-bottom: 20px; }
.bk-panel .fb-panel-head h3 { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin: 0; }
.bk-panel .fb-panel-head p { font-size: .8rem; color: var(--grey); margin: 4px 0 0; }

.bk-field { margin-bottom: 14px; }
.bk-field label { display: block; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); margin-bottom: 5px; }
.req { color: #c62828; font-weight: 900; }
.bk-opt { text-transform: none; font-weight: 400; font-size: .78rem; color: var(--grey); }
.bk-field input, .bk-field select, .bk-field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 12px;
  font: 500 .9rem "Hanken Grotesk", sans-serif; background: var(--page); color: var(--ink);
  transition: border-color .2s, box-shadow .2s; }
.bk-field input:focus, .bk-field select:focus, .bk-field textarea:focus {
  border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(244,166,50,.12); }
.bk-input-err { border-color: #c62828 !important; box-shadow: 0 0 0 3px rgba(198,40,40,.12) !important; }

.bk-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.bk-check { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--ink); cursor: pointer; }
.bk-check input { accent-color: var(--gold); width: 15px; height: 15px; }

.bk-err { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.bk-err span { display: block; color: #c62828; font-size: .82rem; font-weight: 600; line-height: 1.5; }

.bk-submit { width: 100%; padding: 12px; background: var(--gold); color: #1d2740; font: 700 .95rem "Archivo", sans-serif;
  border: none; border-radius: 10px; cursor: pointer; transition: opacity .2s, transform .15s; margin-top: 6px; }
.bk-submit:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.bk-submit:disabled { opacity: .55; cursor: not-allowed; }

.bk-thanks { display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px; min-height: 280px; }
.bk-thanks-icon { font-size: 3rem; margin-bottom: 16px; }
.bk-thanks h4 { font-size: 1.2rem; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.bk-thanks p { font-size: .9rem; color: var(--grey); line-height: 1.5; margin: 0; }

.input-err { border-color: #c62828 !important; box-shadow: 0 0 0 3px rgba(198,40,40,.12) !important; }
.field-error { display: block; color: #c62828; font-size: .78rem; margin-top: 4px; font-weight: 600; }

/* Inline booking card (homepage backup) */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
.booking-card { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 40px;
  box-shadow: 0 16px 48px rgba(0,0,0,.15); border: 1px solid var(--line); }
.booking-card h3 { color: var(--navy); font-size: 1.6rem; margin-bottom: 12px; }

.photo-img { width: 100%; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.04); transition: transform .3s ease; }
.photo-img:hover { transform: scale(1.02); }
.photo-img.tall { height: 100%; min-height: 300px; }

/* ============ Meet Tee section ============ */
.meet-tee-wrap { display: flex; align-items: center; gap: 60px; flex-wrap: wrap; }
.meet-tee-photo { position: relative; flex-shrink: 0; width: 260px; }
.meet-tee-circle {
  width: 240px; height: 260px; border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  overflow: hidden; border: 5px solid var(--gold);
  box-shadow: 0 12px 40px rgba(244,166,50,.22); }
.meet-tee-circle img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.meet-tee-label {
  position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
  font-family: "Playfair Display", serif; font-size: 1.4rem; font-style: italic;
  color: var(--navy); writing-mode: vertical-rl; text-orientation: mixed;
  transform: translateY(-50%) rotate(180deg); }
.meet-tee-bubble {
  position: absolute; top: -18px; right: -24px;
  background: #fff; border: 2px solid var(--navy);
  border-radius: 18px 18px 18px 4px;
  padding: 9px 14px; font-weight: 700; font-size: .88rem; color: var(--navy);
  box-shadow: 3px 3px 0 var(--navy); white-space: nowrap; }
.meet-tee-bubble::after {
  content: ''; position: absolute; bottom: -10px; left: 14px;
  border: 5px solid transparent; border-top-color: var(--navy); }
.meet-tee-copy { flex: 1; min-width: 260px; }

/* ============================================================
   PASTEL SYSTEM  —  soft fill + bold ink, used by the comparison
   tiles, testimonial cards and the "Still confused?" band.
   ============================================================ */
.tint-lav    { background: var(--lav);    border-color: var(--lav-line); }
.tint-pink   { background: var(--pink);   border-color: var(--pink-line); }
.tint-green  { background: var(--green);  border-color: var(--green-line); }
.tint-orange { background: var(--orange); border-color: var(--orange-line); }
.tint-yellow { background: var(--yellow); border-color: var(--yellow-line); }
.tint-blue   { background: var(--blue);   border-color: var(--blue-line); }
.tint-teal   { background: var(--teal);   border-color: var(--teal-line); }
.tint-lav    h3, .tint-lav    .tint-ink { color: var(--lav-ink); }
.tint-pink   h3, .tint-pink   .tint-ink { color: var(--pink-ink); }
.tint-green  h3, .tint-green  .tint-ink { color: var(--green-ink); }
.tint-orange h3, .tint-orange .tint-ink { color: var(--orange-ink); }
.tint-yellow h3, .tint-yellow .tint-ink { color: var(--yellow-ink); }
.tint-blue   h3, .tint-blue   .tint-ink { color: var(--blue-ink); }
.tint-teal   h3, .tint-teal   .tint-ink { color: var(--teal-ink); }

/* ============ "Still confused?" band (every page, above footer) ==== */
.confused-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin: 60px auto 54px; }
.confused-pair .confused { margin: 0; }
.confused { border: 1.5px solid; border-radius: var(--radius-lg);
  padding: 30px 34px; margin: 60px auto 54px; display: flex;
  align-items: center; justify-content: space-between; gap: 22px;
  flex-wrap: wrap; }
.confused h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin-bottom: 6px;
  font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -.01em; }
.confused p { font-size: .98rem; color: var(--ink); opacity: .82; max-width: 46ch; }
.confused .btn { white-space: nowrap; }
.confused .btn-tint { color: #fff; padding: 12px 26px; font-weight: 700; }
.tint-pink   .btn-tint { background: var(--pink-ink); }
.tint-lav    .btn-tint { background: var(--lav-ink); }
.tint-green  .btn-tint { background: var(--green-ink); }
.tint-orange .btn-tint { background: var(--orange-ink); }
.tint-blue   .btn-tint { background: var(--blue-ink); }
.tint-teal   .btn-tint { background: var(--teal-ink); }
.tint-yellow .btn-tint { background: var(--yellow-ink); }
.btn-tint:hover { transform: translateY(-3px); filter: brightness(1.08); }

/* ============ testimonial cards ============ */
.tcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tcard { border: 1.5px solid; border-radius: var(--radius-lg); padding: 26px;
  display: flex; flex-direction: column; min-height: 250px;
  transition: transform .25s ease, box-shadow .25s ease; }
.tcard:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(26,26,46,.10); }
.tcard .mark { font-family: Georgia, serif; font-size: 2.4rem; line-height: 1;
  height: 34px; opacity: .85; }
/* Large, near-black, generously spaced: these have to be readable first
   and decorative second. */
.tcard blockquote { font-size: 1.12rem; line-height: 1.5; font-weight: 600;
  color: var(--ink); margin: 12px 0 auto; }
.tcard .who { display: flex; align-items: center; gap: 10px; margin-top: 22px;
  font-size: .9rem; font-weight: 700; }
.tcard .who .dot { width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .95rem; background: rgba(255,255,255,.75); }
.placeholder-note { display: inline-block; margin-bottom: 14px; font-size: .78rem;
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 13px; }

/* ============ pricing ============ */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  align-items: stretch; }

/* 3D Flip Cards */
.flip-card-container {
  perspective: 1200px;
  height: 460px;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.flip-card-container:hover {
  transform: translateY(-5px);
}
.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card.is-flipped {
  transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
  position: absolute !important;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.flip-card-front {
  z-index: 2;
  transform: rotateY(0deg);
}
.flip-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  z-index: 1;
  overflow-y: auto;
}

.plan-card-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-flip-trigger {
  background: transparent;
  border: none;
  color: var(--grey);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  padding: 6px 0;
  transition: color 0.2s, transform 0.2s;
}
.btn-flip-trigger:hover { color: var(--navy); transform: translateY(-1px); }

.back-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.back-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  padding: 4px 12px;
  border-radius: 999px;
}
.btn-flip-back {
  background: rgba(0,0,0,0.08);
  border: none;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
  transition: background 0.2s;
}
.btn-flip-back:hover { background: rgba(0,0,0,0.15); }
.back-title {
  font-size: 1.25rem;
  margin-bottom: 2px;
  font-family: "Archivo", sans-serif;
  color: inherit;
}
.instructor {
  font-size: 0.84rem;
  color: inherit;
  opacity: 0.85;
  margin-bottom: 12px;
}
.back-points {
  list-style: none;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
  color: inherit;
}
.back-points li {
  font-size: 0.86rem;
  line-height: 1.4;
  padding-left: 0 !important;
  color: inherit;
}
.back-points li::before {
  display: none !important;
}

.plan { background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 22px; display: flex;
  flex-direction: column; position: relative; height: 100%; box-sizing: border-box;
  transition: transform .25s ease, box-shadow .25s ease; }
.plan:hover { box-shadow: 0 18px 40px rgba(26,26,46,.10); }

/* Explicit overrides to apply the pastel theme on backfaces */
.plan.tint-lav {
  background: var(--lav);
  border-color: var(--lav-line);
  color: var(--lav-ink);
}
.plan.tint-pink {
  background: var(--pink);
  border-color: var(--pink-line);
  color: var(--pink-ink);
}
.plan.tint-green {
  background: var(--green);
  border-color: var(--green-line);
  color: var(--green-ink);
}

.plan.featured { border-width: 2.5px; border-color: var(--lav-ink);
  background: var(--lav); }
.plan .tag { display: inline-block; margin-bottom: 8px; background: var(--lav-ink);
  color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; border-radius: 999px; padding: 5px 14px; }
.plan h3 { font-size: 1.2rem; color: var(--purple); margin-bottom: 2px; }
.plan .who-for { font-size: .85rem; color: var(--grey); min-height: 36px; line-height: 1.4; }
.plan .price { font-family: "Playfair Display", Georgia, serif; font-size: 2.2rem;
  font-weight: 800; color: var(--ink); margin: 10px 0 2px; line-height: 1; }
.plan .price small { font-family: "Hanken Grotesk", sans-serif; font-size: .85rem;
  font-weight: 600; color: var(--grey); }
.plan .per { font-size: .8rem; color: var(--grey); margin-bottom: 14px; }
.plan ul { list-style: none; margin: 0 0 16px; display: grid; gap: 8px; }
.plan li { position: relative; padding-left: 24px; font-size: .88rem; line-height: 1.4; }
.plan li::before { content: "✓"; position: absolute; left: 0; top: 1px;
  width: 17px; height: 17px; border-radius: 50%; background: var(--lav-ink);
  color: #fff; font-size: .68rem; font-weight: 900; display: flex;
  align-items: center; justify-content: center; }
.plan .btn { width: 100%; text-align: center; }

/* value comparison — "one line beats three" */
.vs-wrap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 22px;
  align-items: center; margin-top: 12px; }
.vs-badge { width: 74px; height: 74px; border-radius: 50%; background: var(--ink);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: "Archivo", sans-serif; font-weight: 900; font-size: 1.15rem; }
.vs-col { display: grid; gap: 16px; }
.vs-tile { border: 1.5px solid; border-radius: var(--radius-lg); padding: 24px 26px;
  position: relative; }
.vs-tile h3 { font-size: 1.4rem; font-family: "Archivo", sans-serif;
  font-weight: 800; margin-bottom: 2px; }
.vs-tile .amount { font-size: .98rem; font-weight: 600; opacity: .9; }
.vs-tile ul { list-style: none; margin-top: 14px; display: grid; gap: 9px; }
.vs-tile li { position: relative; padding-left: 26px; font-size: .93rem;
  color: var(--ink); }
.vs-tile li::before { content: "✓"; position: absolute; left: 0;
  font-weight: 900; }
.vs-op { position: absolute; bottom: -19px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; z-index: 2; }
.vs-total { text-align: center; font-family: "Archivo", sans-serif;
  font-weight: 900; font-size: 1.5rem; margin-top: 30px; }

/* "what's included" checklist with highlighted lead-ins */
.incl { list-style: none; display: grid; gap: 16px; max-width: 780px; margin-inline: auto; }
.incl li { position: relative; padding-left: 40px; font-size: 1.03rem;
  line-height: 1.5; }
.incl li::before { content: "✓"; position: absolute; left: 0; top: 0;
  width: 25px; height: 25px; border-radius: 50%; background: var(--lav-ink);
  color: #fff; font-size: .82rem; font-weight: 900; display: flex;
  align-items: center; justify-content: center; }
.incl mark { background: var(--green); color: var(--ink); font-weight: 700;
  padding: 2px 6px; border-radius: 5px; }

/* ============ two-column comparison ================================
   Left column stays deliberately uniform and grey; every tile on the right
   gets its own bright pastel. The colour itself carries the argument —
   one is samey, the other is alive — before a single word is read. */
/* One grid, filled column-first: the markup stays grouped per column but each
   pair shares a grid row, so "Mark schemes" on the left sits exactly level
   with "Mark schemes" on the right. Two independent columns drifted up to
   67px apart once the text lengths differed. */
.cmp { display: grid; grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(8, auto); grid-auto-flow: column;
  gap: 12px 22px; align-items: stretch; }
.cmp-head { border-radius: var(--radius-lg); padding: 22px 24px;
  text-align: center; border: 2px solid; }
.cmp-head h3 { font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 800; line-height: 1.15; }
.cmp-head p { font-size: .86rem; font-weight: 600; margin-top: 4px; opacity: .8; }
.cmp-head.them { background: #EBE8E1; border-color: #D6D2C8; color: #55524B; }
.cmp-head.us { background: var(--lav-ink); border-color: var(--lav-ink);
  color: #fff; position: relative; }
.cmp-head.us p { opacity: .85; }
.cmp-head .crown { position: absolute; top: -13px; left: 50%;
  transform: translateX(-50%); background: var(--gold); color: #3A2A05;
  font: 800 .68rem "Hanken Grotesk", sans-serif; letter-spacing: .08em;
  text-transform: uppercase; border-radius: 999px; padding: 5px 14px;
  white-space: nowrap; }

.cmp-item { border-radius: 16px; padding: 16px 18px; border: 1.5px solid;
  display: flex; gap: 12px; align-items: flex-start;
  transition: transform .22s ease, box-shadow .22s ease; }
.cmp-item .mk { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 900; margin-top: 1px; }
.cmp-item .txt { font-size: .97rem; line-height: 1.45; }
.cmp-item .txt b { display: block; font-family: "Archivo", sans-serif;
  font-size: .76rem; letter-spacing: .07em; text-transform: uppercase;
  opacity: .62; margin-bottom: 3px; font-weight: 700; }

/* the flat, interchangeable side */
.cmp-item.them { background: #F2F0EB; border-color: #E2DED5; color: #6B6862; }
.cmp-item.them .mk { background: #D8D4CB; color: #6B6862; }

/* the side that earns its colour */
.cmp-item.us { font-weight: 600; }
.cmp-item.us:hover { transform: translateX(4px);
  box-shadow: 0 10px 26px rgba(26,26,46,.10); }
.cmp-item.us .mk { background: rgba(255,255,255,.75); }

.cmp-foot { border-radius: 16px; padding: 18px 20px; text-align: center;
  border: 1.5px solid; margin-top: 4px; }
.cmp-foot .amt { font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 1.7rem); font-weight: 800; line-height: 1.1; }
.cmp-foot .sub { font-size: .84rem; margin-top: 5px; opacity: .82; }
.cmp-foot.them { background: #EBE8E1; border-color: #D6D2C8; color: #55524B; }
.cmp-foot.us { background: var(--green); border-color: var(--green-line);
  color: var(--green-ink); }

/* ============ "a system" feature boxes ============================= */
.sys-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sys-box { border-radius: 18px; border: 1.5px solid; padding: 20px 18px;
  transition: transform .25s ease, box-shadow .25s ease; }
.sys-box:hover { transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(26,26,46,.11); }
.sys-box .ico { font-size: 1.6rem; display: block; margin-bottom: 9px;
  line-height: 1; }
.sys-box h3 { font-family: "Archivo", sans-serif; font-size: .97rem;
  margin-bottom: 5px; line-height: 1.25; }
.sys-box p { font-size: .85rem; color: var(--ink); opacity: .78; line-height: 1.45; }

/* ============ paper library ============ */
/* The reading panes want every pixel, so the library breaks out of the
   1060px text column that suits the marketing pages. */
.container-wide { max-width: 1580px; margin: 0 auto; padding: 0 22px; }
.lib { display: grid; grid-template-columns: 286px 1fr; gap: 18px;
  align-items: start; }
.lib-panel { background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 14px 10px 14px 14px;
  position: sticky; top: 88px; max-height: calc(100vh - 110px);
  overflow-y: auto; }
.lib-panel h3 { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--purple); margin: 2px 0 10px 4px; }

/* File tree: folders collapse, files select. Indentation is driven by a
   --depth custom property so the markup stays flat and easy to build. */
.tree { display: block; font-size: .88rem; }
.tree-row { display: flex; align-items: center; gap: 6px; width: 100%;
  border: 0; background: none; cursor: pointer; text-align: left;
  font: 600 .87rem "Hanken Grotesk", sans-serif; color: var(--ink);
  padding: 5px 8px 5px calc(6px + var(--depth, 0) * 15px);
  border-radius: 8px; transition: background .13s, color .13s; }
.tree-row:hover { background: var(--cream); }
.tree-row .chev { width: 12px; flex: 0 0 12px; font-size: .62rem;
  color: var(--grey); transition: transform .18s; display: inline-block;
  text-align: center; }
.tree-row.open > .chev { transform: rotate(90deg); }
.tree-row .ico { width: 16px; flex: 0 0 16px; font-size: .88rem; }
.tree-row .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.tree-file .lbl { white-space: normal; overflow: visible; text-overflow: unset;
  word-break: break-all; }
.tree-row .n { font-size: .74rem; color: var(--grey); font-weight: 600; }
.tree-file { font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .8rem; font-weight: 500; }
.tree-file.on { background: var(--lav); color: var(--lav-ink); font-weight: 700; }
.tree-file.on:hover { background: var(--lav); }
.tree-file .tag { font-size: .64rem; font-weight: 800; letter-spacing: .04em;
  border-radius: 4px; padding: 1px 5px; }
.tree-file .tag.qp { background: var(--blue); color: var(--blue-ink); }
.tree-file .tag.ms { background: var(--green); color: var(--green-ink); }
.tree-kids { display: block; }
.tree-kids[hidden] { display: none; }

.lib-viewer { background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius); overflow: hidden; display: flex;
  flex-direction: column; min-height: 78vh; transition: all 0.3s ease; }
.lib-viewer.lib-fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.lib-bar { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1.5px solid var(--line);
  flex-wrap: wrap; background: var(--cream); }
.lib-bar b { font-size: .95rem; color: var(--purple); }
.lib-bar .sub { font-size: .8rem; color: var(--grey); }
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Two documents at once: stacked (paper above, scheme below with a clear
   break between) or side by side. */
.lib-panes { flex: 1; display: grid; gap: 18px; padding: 14px;
  background: var(--cream); }
.lib-panes.stacked { grid-template-columns: 1fr; }
.lib-panes.split { grid-template-columns: 1fr 1fr; }
.pane { display: flex; flex-direction: column; background: var(--white);
  border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.pane-head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px 14px; border-bottom: 1.5px solid var(--line); }
.pane-head b { font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; }
.pane-head .file { font-family: ui-monospace, Consolas, monospace;
  font-size: .74rem; color: var(--grey); }
.pane.qp .pane-head { background: var(--blue); }
.pane.qp .pane-head b { color: var(--blue-ink); }
.pane.ms .pane-head { background: var(--green); }
.pane.ms .pane-head b { color: var(--green-ink); }
.lib-toggle-btn { display: none; align-items: center; gap: 8px;
  margin-bottom: 10px; }
.lib-frame { width: 100%; border: 0; background: #f3f3f3; display: block; }
.lib-panes.stacked .lib-frame { height: 82vh; }
.lib-panes.split .lib-frame { height: 76vh; }
.pane-missing { padding: 40px 20px; text-align: center; color: var(--grey);
  font-size: .9rem; }
.lib-empty { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 80px 24px; text-align: center;
  color: var(--grey); flex: 1; }
.lib-empty span { font-size: 2.6rem; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px;
  overflow: hidden; background: var(--white); }
.seg button { border: 0; background: none; padding: 7px 16px; cursor: pointer;
  font: 700 .84rem "Hanken Grotesk", sans-serif; color: var(--grey); }
.seg button.on { background: var(--lav-ink); color: #fff; }

.seg-large {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: #fff;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.seg-large button {
  border: 0;
  background: none;
  padding: 10px 24px;
  cursor: pointer;
  font: 700 0.95rem "Hanken Grotesk", sans-serif;
  color: var(--navy-deep);
  border-radius: 999px;
  transition: all 0.25s ease;
}
.seg-large button.active {
  background: var(--physics);
  color: #fff;
}

/* ============ AI doubt solver ============ */
.ask-grid { display: grid; grid-template-columns: 380px 1fr; gap: 22px;
  align-items: start; }
/* display:block matters — a <label> is inline by default, so the drop zone's
   box bled over the field below it. */
.drop { display: block; border: 2.5px dashed var(--lav-line);
  border-radius: var(--radius-lg); background: var(--white);
  padding: 34px 22px; text-align: center; cursor: pointer; transition: all .2s; }
.drop:hover, .drop.over { border-color: var(--lav-ink); background: var(--lav); }
.drop .big { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.drop b { display: block; color: var(--purple); margin-bottom: 4px; }
.drop small { color: var(--grey); }
.drop img { max-width: 100%; max-height: 260px; border-radius: 12px;
  border: 1px solid var(--line); }
.text-input { width: 100%; max-width: 100%; border: 1.5px solid var(--line);
  border-radius: 11px; padding: 11px 13px; background: var(--white);
  color: var(--ink); font: 500 .95rem "Hanken Grotesk", sans-serif; }
.text-input:focus { outline: none; border-color: var(--lav-ink);
  box-shadow: 0 0 0 3px rgba(74,46,143,.12); }
.ask-side { display: grid; gap: 16px; }
.ask-side .status:empty { display: none; }
.ask-out { background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; min-height: 320px;
  line-height: 1.65; }
.ask-out h3 { color: var(--purple); margin: 18px 0 8px; font-size: 1.05rem; }
.ask-out h3:first-child { margin-top: 0; }
.ask-out p { margin-bottom: 11px; }
.ask-out ol, .ask-out ul { margin: 0 0 12px 20px; display: grid; gap: 7px; }
.ask-out code { background: var(--cream); border-radius: 5px; padding: 1px 5px;
  font-size: .93em; }
.ask-out .step { border-left: 3px solid var(--lav-ink); padding-left: 14px;
  margin-bottom: 14px; }
.ask-placeholder { color: var(--grey); text-align: center; padding: 60px 20px; }
.ask-placeholder span { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.spinner { width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; display: inline-block;
  vertical-align: -3px; margin-right: 8px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ responsive ============ */
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-3d { min-height: 320px; }
  .why-grid, .quotes, .board-grid, .subject-grid, .resource-grid,
  .photo-grid { grid-template-columns: 1fr; }
  .header-row { flex-wrap: wrap; row-gap: 8px; justify-content: center; }
  .header-nav { gap: 12px; flex-wrap: wrap; justify-content: center; }
  .header-nav .btn { padding: 8px 16px; font-size: .85rem; }
  .nav-link { font-size: .85rem; white-space: nowrap; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .tutor-grid { grid-template-columns: 1fr; }
  .numbers-row { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .includes { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .tcards { grid-template-columns: repeat(2, 1fr); }
  .sys-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .lib { grid-template-columns: 1fr; }
  /* On tablets, collapse panel into a toggle-able drawer */
  .lib-panel { position: static; max-height: 0; overflow: hidden; padding: 0;
    border: none; transition: max-height .3s ease, padding .2s; }
  .lib-panel.open { max-height: 52vh; overflow-y: auto; padding: 14px 10px 14px 14px;
    border: 1.5px solid var(--line); }
  .lib-toggle-btn { display: flex !important; }
  /* Side-by-side cannot work on a narrow screen — always stack. */
  .lib-panes.split { grid-template-columns: 1fr; }
  .ask-grid { grid-template-columns: 1fr; }
  /* The VS layout stacks: three separate columns can't survive a phone. */
  .vs-wrap { grid-template-columns: 1fr; gap: 30px; }
  .vs-badge { margin: 0 auto; }
}

@media (max-width: 720px) {
  .split, .how { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .footer-top { grid-template-columns: 1fr; }
  .tcards, .sys-grid { grid-template-columns: 1fr; }
  /* Two text columns at 375px leaves ~137px of readable width, which is
     unusable. Stack them — each keeps its own header, so the comparison
     still reads top to bottom. */
  .cmp { grid-template-columns: 1fr; grid-template-rows: none;
    grid-auto-flow: row; gap: 12px; }
  .cmp-head { padding: 18px 20px; }
  .cmp-head:not(:first-child) { margin-top: 22px; }
  .confused-pair { grid-template-columns: 1fr; margin: 44px auto 40px; gap: 16px; }
  .confused { flex-direction: column; align-items: flex-start; padding: 26px 22px;
    margin: 44px auto 40px; }
  .confused .btn { width: 100%; text-align: center; }
  .container { padding: 0 16px; }
  .hero { padding: 40px 0 34px; }
  .section { padding: 48px 0; }
  .lib-frame { min-height: 62vh; }
  .lib-bar { gap: 8px; }
  /* hero-stats: 2×2 grid on mobile */
  .hero-stats { grid-template-columns: repeat(2, auto); gap: 16px 28px; }
  .hero-stats b { font-size: 1.35rem; }
  /* meet-tee stacks on mobile */
  .meet-tee-wrap { gap: 32px; justify-content: center; text-align: center; }
  .meet-tee-photo { margin-inline: auto; }
  .meet-tee-label { display: none; }
  .meet-tee-copy { min-width: unset; }
  /* resources viewer stacks on mobile */
  .res-viewer.file-open { grid-template-columns: 1fr; }
  .res-viewer.file-open .res-pane { min-height: 70vh; position: static; }
  /* footer-wa: prevent text/button overlap on narrow screens */
  .footer-wa-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-wa-btn { align-self: flex-start; }
  .topics { grid-template-columns: 1fr; }
  /* Filter pills scroll sideways instead of wrapping into a tall stack. */
  .pill-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .pill-row::-webkit-scrollbar { display: none; }
  .pill { white-space: nowrap; }
  .actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .actions .btn { width: 100%; }
  select, input[type="number"] { max-width: 100%; }
  .field.split { gap: 16px; }
  .vs-tile, .tcard, .plan { padding: 22px 20px; }
  .plan .price { font-size: 2.1rem; }
  .plan-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .flip-card-container { height: auto; min-height: 460px; }
}

/* Tap targets and text scale on true phones. */
@media (max-width: 480px) {
  .hero h1, .section-title { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .tcard blockquote { font-size: 1.02rem; }
  .btn { padding: 12px 20px; }
  .header-nav { gap: 10px; }
  .brand img { height: 42px; width: 42px; }
  .brand span { font-size: 1.15rem; }
  .subject-card, .subject-grid .res-card { flex: 0 0 280px; }
}

/* ============================================================= AI Tutor === */
.tutor-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px;
  align-items: start; }
.tutor-side { position: sticky; top: 90px; display: flex; flex-direction: column;
  gap: 18px; }
.tutor-picker, .tutor-chips { background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; }
.tutor-picker select { width: 100%; }
.muted { color: var(--grey); font-weight: 500; }
.tutor-chips { display: flex; flex-direction: column; gap: 8px; }
.tutor-chips .field-label { margin: 0 0 2px; }
.tutor-chips .chip { display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--lav-line); background: var(--lav); color: var(--lav-ink);
  padding: 10px 14px; border-radius: 12px; font-size: .9rem; }
.tutor-chips .chip:nth-child(3) { background: var(--green); color: var(--green-ink);
  border-color: var(--green-line); }
.tutor-chips .chip:nth-child(4) { background: var(--blue); color: var(--blue-ink);
  border-color: var(--blue-line); }
.tutor-chips .chip:nth-child(5) { background: var(--orange); color: var(--orange-ink);
  border-color: var(--orange-line); }
.tutor-chips .chip:hover { transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(0,0,0,.08); }

.tutor-main { display: flex; flex-direction: column; min-height: 62vh; }
.chat { flex: 1; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: none;
  padding: 22px; overflow-y: auto; max-height: 66vh; }
.chat-empty { text-align: center; color: var(--grey); padding: 46px 20px; }
.chat-empty span { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.chat-empty b { color: var(--ink); font-size: 1.15rem; display: block; }
.chat-empty p { max-width: 44ch; margin: 8px auto 0; }

.msg { display: flex; margin-bottom: 16px; }
.msg.me { justify-content: flex-end; }
.msg-body { max-width: 80%; padding: 13px 17px; border-radius: 16px;
  line-height: 1.55; }
.msg.me .msg-body { background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot .msg-body { background: var(--cream); color: var(--ink);
  border: 1px solid var(--line); border-bottom-left-radius: 5px; max-width: 92%; }
.msg-body h3 { font-family: 'Hanken Grotesk', sans-serif; font-size: 1rem;
  color: var(--purple); margin: 14px 0 6px; }
.msg-body h3:first-child { margin-top: 0; }
.msg-body p { margin: 0 0 8px; }
.msg-body ol { margin: 6px 0 8px; padding-left: 22px; }
.msg-body li { margin-bottom: 10px; }
.msg-body .step { background: var(--white); border-left: 3px solid var(--gold);
  padding: 7px 12px; border-radius: 8px; margin: 6px 0; }
.msg-body .err { color: #9b2c2c; }

.dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--grey); margin-right: 4px; animation: dotpulse 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotpulse { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

.chat-bar { display: flex; gap: 10px; background: var(--white);
  border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px; }
.chat-input { flex: 1; resize: none; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; font: inherit; font-size: .96rem;
  background: var(--page); color: var(--ink); max-height: 160px; }
.chat-input:focus { outline: none; border-color: var(--purple-bright); }
.chat-bar .btn { align-self: flex-end; }

@media (max-width: 820px) {
  .tutor-grid { grid-template-columns: 1fr; }
  .tutor-side { position: static; }
}

/* ========================================================= Resources ====== */
.section-lead { color: var(--grey); max-width: 60ch; margin: -6px 0 22px; }
.res-loading, .res-empty { grid-column: 1/-1; text-align: center; color: var(--grey);
  padding: 40px 20px; }
.res-empty span { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.res-empty b { color: var(--ink); display: block; font-size: 1.1rem; }

/* category cards reuse .resource-card; the tint classes colour them */
a.res-cat { cursor: pointer; }
a.res-cat .tag { background: rgba(255,255,255,.55); }

/* detail view */
.res-detail { margin-top: 8px; }
/* The detail view breaks out of the page container to use the full viewport
   width, so the PDF gets as much room as possible. */
.res-detail { width: 100vw; margin-left: calc(50% - 50vw);
  padding: 0 26px; box-sizing: border-box; }
.res-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.res-back { background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer;
  color: var(--ink); flex: none; }
.res-back:hover { background: var(--cream); }
.res-detail-head h3 { font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem; color: var(--purple); margin: 0; }
.res-fullscreen { margin-left: auto; font-weight: 700; font-size: .9rem;
  color: var(--purple-bright); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px;
  background: var(--white); }
.res-fullscreen:hover { background: var(--cream); }

/* ---- Resources: two-mode viewer (browse = grid, file-open = split) ------- */

/* BROWSE MODE (default): pane hidden, items fill full width */
.res-viewer { display: block; }
.res-pane { display: none; }

/* FILE-OPEN MODE: split layout — narrow list left, viewer right */
.res-viewer.file-open { display: grid; grid-template-columns: 300px 1fr;
  gap: 16px; align-items: start; }
.res-viewer.file-open .res-pane { display: block; }
.res-viewer.file-open .res-files { max-height: 82vh; overflow-y: auto; }

/* Shared file list */
.res-files { list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px; }

/* File items — same in both modes */
.res-file { display: grid; grid-template-columns: 26px 1fr; gap: 3px 8px;
  align-items: center; background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 13px; cursor: pointer; transition: .15s; }
.res-file:hover { border-color: var(--purple-bright); transform: translateY(-1px); }
.res-file.active { border-color: var(--purple-bright);
  box-shadow: 0 0 0 2px rgba(107,63,160,.18); background: var(--cream); }
.res-file .fi { font-size: 1.1rem; grid-row: span 2; }
.res-file .fn { font-weight: 700; color: var(--ink); font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-file .fm { grid-column: 2; color: var(--grey); font-size: .76rem; }
/* In file-open mode: tighter */
.res-viewer.file-open .res-file { padding: 8px 11px; }

/* BROWSE MODE: folder items as wide cards in a responsive grid */
.res-viewer:not(.file-open) .res-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.res-folder { display: flex; align-items: flex-start; gap: 10px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: .15s;
  color: var(--ink); flex-direction: column; }
.res-folder:hover { border-color: var(--purple-bright); transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.07); background: var(--cream); }
.res-folder .fi { font-size: 1.8rem; line-height: 1; }
.res-folder .fn { font-weight: 700; font-size: .95rem; line-height: 1.35;
  color: var(--ink); }
.res-folder .fc { font-size: .78rem; color: var(--grey); }

/* FILE-OPEN MODE: folder items compact rows */
.res-viewer.file-open .res-folder { flex-direction: row; align-items: center;
  padding: 9px 12px; gap: 8px; }
.res-viewer.file-open .res-folder .fi { font-size: 1.1rem; }
.res-viewer.file-open .res-folder .fn { font-size: .88rem; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-viewer.file-open .res-folder .fc { display: none; }

/* Viewer pane */
.res-pane { background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; min-height: 82vh;
  position: sticky; top: 74px; }
.res-frame { width: 100%; height: 82vh; border: 0; display: block; }
.res-img-wrap { padding: 16px; text-align: center; }
.res-img-wrap img { max-width: 100%; border-radius: 10px; }
.res-pane-empty { text-align: center; color: var(--grey); padding: 70px 24px; }
.res-pane-empty span { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.res-pane-empty b { color: var(--ink); display: block; font-size: 1.1rem;
  margin-bottom: 6px; }
.res-pane-empty .btn { margin-top: 14px; }

/* Breadcrumb bar */
.res-breadcrumb { display: flex; align-items: center; gap: 0;
  margin-bottom: 14px; background: var(--cream);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px; overflow-x: auto; white-space: nowrap;
  font-size: .84rem; }
.res-breadcrumb:empty { display: none; }
.bc-back { background: var(--purple-bright); color: var(--white);
  border: none; border-radius: 7px; padding: 4px 12px 4px 9px;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  flex: none; margin-right: 8px; white-space: nowrap; }
.bc-back:hover { opacity: .85; }
.bc-seg { cursor: pointer; color: var(--purple-bright); font-weight: 600;
  padding: 2px 5px; border-radius: 6px; flex: none; }
.bc-seg:hover { background: rgba(107,63,160,.1); }
.bc-seg.bc-cur { color: var(--grey-dark, #555); cursor: default;
  font-weight: 500; }
.bc-seg.bc-cur:hover { background: none; }
.bc-sep { color: var(--grey); padding: 0 2px; user-select: none; }

@media (max-width: 820px) {
  .res-viewer.file-open { grid-template-columns: 1fr; }
  .res-viewer.file-open .res-pane { position: static; min-height: 60vh; }
  .res-frame { height: 60vh; }
  .res-viewer:not(.file-open) .res-files {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ---- Resources: filter tabs + richer cards (2026-07-24 redesign) -------- */
.res-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 24px; }
.res-tab { border: 1px solid var(--line); background: var(--white); color: var(--ink);
  border-radius: 999px; padding: 9px 20px; font-weight: 700; font-size: .9rem;
  cursor: pointer; transition: .15s; }
.res-tab:hover { border-color: var(--purple-bright); transform: translateY(-1px); }
.res-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.res-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px; }
.res-card { display: flex; flex-direction: column; padding: 22px 22px 20px;
  border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none;
  color: var(--ink); background: var(--white); min-height: 214px;
  transition: transform .18s, box-shadow .18s; }
.res-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(0,0,0,.11); }
.res-card-top { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; }
.res-icon { font-size: 2rem; line-height: 1; }
.res-count { font-size: .76rem; font-weight: 800; background: rgba(0,0,0,.07);
  padding: 4px 11px; border-radius: 999px; }
.res-card h3 { font-family: 'Hanken Grotesk', sans-serif; font-size: 1.18rem;
  margin: 0 0 7px; color: inherit; }
.res-card p { margin: 0; font-size: .9rem; color: inherit; opacity: .82; flex: 1;
  line-height: 1.5; }
.res-card-foot { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 16px; }
.res-badge { font-size: .72rem; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: rgba(255,255,255,.6); }
.res-open { font-weight: 800; font-size: .92rem; white-space: nowrap; }
.res-card.tint-blue   { background: var(--blue);   border-color: var(--blue-line);   color: var(--blue-ink); }
.res-card.tint-green  { background: var(--green);  border-color: var(--green-line);  color: var(--green-ink); }
.res-card.tint-orange { background: var(--orange); border-color: var(--orange-line); color: var(--orange-ink); }
.res-card.tint-lav    { background: var(--lav);    border-color: var(--lav-line);    color: var(--lav-ink); }
.res-card.tint-pink   { background: var(--pink);   border-color: var(--pink-line);   color: var(--pink-ink); }
.res-card.tint-teal   { background: var(--teal);   border-color: var(--teal-line);   color: var(--teal-ink); }
.res-card.tint-yellow { background: var(--yellow); border-color: var(--yellow-line); color: var(--yellow-ink); }

/* ---- Coming Soon frosted overlay (AI Tutor & Photo Solver) --------------- */
.coming-soon-wrapper {
  position: relative !important;
  min-height: 520px;
  height: 520px;
  overflow: hidden;
}
.coming-soon-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(253, 249, 243, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: var(--radius-lg);
}
.cs-card {
  max-width: 480px;
  text-align: center;
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 56px rgba(26,26,46,.14);
  border: 2px solid;
  transition: transform .25s ease;
}
.cs-card:hover { transform: translateY(-3px); }
.cs-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--lav-ink);
  color: #fff;
  margin-bottom: 16px;
}
.cs-card h2 {
  font-size: 1.85rem;
  margin-bottom: 12px;
  font-family: "Archivo", sans-serif;
}
.cs-card p {
  font-size: 0.96rem;
  line-height: 1.6;
  margin-bottom: 24px;
  opacity: .9;
}

/* ---- Topical generator: search + live summary (2026-07-24) -------------- */
.topic-search { width: 100%; margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--page);
  color: var(--ink); font: inherit; font-size: .95rem; }
.topic-search:focus { outline: none; border-color: var(--purple-bright); }

.gen-summary { background: var(--cream); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 16px; margin: 4px 0 14px; font-size: .95rem;
  color: var(--ink); line-height: 1.5; }
.gen-summary .muted { color: var(--grey); }
.actions .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- Topical generator: board-grouped subject picker — column layout ------- */
/* Board label sits on its own line, pills flow in a row below it */
.subject-groups { display: flex; flex-direction: column; gap: 20px; }
.subject-group { display: flex; flex-direction: column; gap: 10px; }
.subject-group + .subject-group { padding-top: 16px; border-top: 1px solid var(--line); }
.subject-group-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 800;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  align-self: flex-start;
  /* O Level default — overridden per board below */
  background: var(--lav); color: var(--lav-ink);
}
.subject-group-label::before { content: ''; display: none; }
.subject-group[data-board*="igcse"] .subject-group-label {
  background: var(--green); color: var(--green-ink); }
.subject-group[data-board*="a-level"] .subject-group-label {
  background: var(--blue); color: var(--blue-ink); }
/* pills wrap naturally, so no special mobile override needed */

/* ---- Download progress bar -------------------------------------------- */
.progress-wrap { height: 6px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin: 14px 0 2px; }
.progress-bar { height: 100%; width: 0%; border-radius: 999px;
  background: var(--ink); transition: width .25s linear; }
.progress-bar.indeterminate { width: 35% !important;
  animation: prog-slide 1.3s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes prog-slide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* ---- Chemistry subject cards ------------------------------------------- */
.subject-card.chem { border-left-color: var(--teal-ink); }
.subject-card.chem:hover { background: var(--teal-ink);
  box-shadow: 0 14px 36px rgba(18,112,106,.28); border-color: var(--teal-ink); }
.subject-card.chem .code { color: var(--teal-ink); }

/* ---- Islamiyat cards (gold/orange) ------------------------------------- */
.subject-card.islam { border-left-color: var(--orange-ink); }
.subject-card.islam:hover { background: var(--orange-ink) !important;
  box-shadow: 0 14px 36px rgba(176,84,28,.28) !important; border-color: var(--orange-ink) !important; }
.subject-card.islam .code { color: var(--orange-ink); }

/* ---- Pakistan Studies cards (green) ------------------------------------ */
.subject-card.pak { border-left-color: #16704A; }
.subject-card.pak:hover { background: #16704A !important;
  box-shadow: 0 14px 36px rgba(22,112,74,.28) !important; border-color: #16704A !important; }
.subject-card.pak .code { color: #16704A; }

/* ---- Resources chip on subject cards ------------------------------------ */
.chip.res { background: var(--teal); color: var(--teal-ink);
  border: 1px solid var(--teal-line); }
.chip.res:hover { box-shadow: 0 4px 14px rgba(18,112,106,.22); }
.subject-card:hover .chip.res { background: rgba(255,255,255,.22);
  color: #fff; border-color: rgba(255,255,255,.35); }
.subject-links { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; }
.subject-links .comp-chips { flex-basis: 100%; margin-top: 2px; }

/* ---- Session / variant filter + keyword search (2026-07-26) -------------- */
.filter-grid { display: flex; flex-wrap: wrap; gap: 18px 32px; }
.filter-sub-label { font-size: .78rem; font-weight: 700; color: var(--grey);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.filter-pill { padding: 7px 16px; font-size: .88rem; }
.filter-pill.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.filter-pill.active:hover { background: var(--purple-bright); border-color: var(--purple-bright); }
.field-opt { font-weight: 400; color: var(--grey); font-size: .8rem; }

/* ---- Subtopic expansion panel -------------------------------------------- */
.topic-wrapper { display: contents; }
.subtopic-toggle { margin-left: 6px; background: none; border: none; cursor: pointer;
  color: var(--grey); font-size: .88rem; line-height: 1; padding: 2px 4px;
  border-radius: 4px; transition: color .15s, background .15s; flex-shrink: 0; }
.subtopic-toggle:hover { color: var(--purple); background: var(--lav); }
.subtopic-toggle.open { color: var(--purple-bright); }
.topic.on .subtopic-toggle { color: var(--green-ink); }
.topic.on .subtopic-toggle:hover { color: var(--lav-ink); background: rgba(255,255,255,.35); }

.subtopic-panel { background: var(--cream); border: 1px solid var(--line);
  border-top: none; border-radius: 0 0 14px 14px; padding: 12px 14px 14px;
  margin-bottom: 8px; animation: panel-in .18s ease; grid-column: 1 / -1; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.subtopic-note { font-size: .79rem; color: var(--grey); margin-bottom: 10px; }

.subtopic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.subtopic-item { display: flex; align-items: flex-start; gap: 7px; padding: 6px 10px;
  border-radius: 9px; cursor: pointer; transition: background .15s; font-size: .875rem;
  line-height: 1.4; border: 1px solid transparent; }
.subtopic-item:hover { background: var(--lav); border-color: var(--lav-line); }
.subtopic-item input[type="checkbox"] { accent-color: var(--purple-bright); margin-top: 2px;
  flex-shrink: 0; width: 14px; height: 14px; }
.subtopic-item:has(input:checked) { background: var(--lav); border-color: var(--lav-line);
  color: var(--lav-ink); font-weight: 600; }
.subtopic-item .n { margin-left: auto; color: var(--grey); font-size: .75rem;
  flex-shrink: 0; padding-left: 6px; }

/* Summary filter badges */
.filter-badge { display: inline-block; background: var(--lav); color: var(--lav-ink);
  border-radius: 999px; padding: 1px 9px; font-size: .82rem; font-weight: 600;
  margin: 0 1px; white-space: nowrap; }

/* Topics grid */
#topics { display: block; }
#topics .topic-wrapper { display: flex; flex-direction: column; margin-bottom: 6px; }
#topics .topic {
  width: 100%; border-radius: 12px; min-height: 46px;
  align-items: center; /* already in .topic but ensure it's set */
}
#topics .topic > span:first-of-type { flex: 1; min-width: 0; }
#topics .topic-wrapper:has(.subtopic-panel:not([hidden])) .topic {
  border-radius: 14px 14px 0 0; border-bottom-color: var(--cream); }

@media (min-width: 580px) {
  #topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    align-items: start;
  }
  #topics .topic-wrapper { margin-bottom: 0; }
  #topics .topic-wrapper:has(.subtopic-panel:not([hidden])) { grid-column: 1 / -1; }
}

/* ---- Feedback widget ---------------------------------------------------- */
.fb-tab {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 900; display: flex; align-items: center;
}
.fb-tab-btn {
  writing-mode: vertical-rl; text-orientation: mixed;
  transform: rotate(180deg);
  background: var(--navy); color: #fff; border: none;
  padding: 14px 10px; font: 600 .78rem/1 "Hanken Grotesk", sans-serif;
  letter-spacing: .06em; cursor: pointer; border-radius: 10px 0 0 10px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: -2px 0 14px rgba(0,0,0,.14);
  transition: background .2s, box-shadow .2s;
}
.fb-tab-btn:hover { background: var(--purple-bright); }
.fb-tab-btn svg { transform: rotate(180deg); }

.fb-panel {
  position: fixed; right: -400px; top: 50%; transform: translateY(-50%);
  width: 360px; max-height: 90vh; overflow-y: auto;
  background: var(--page); border: 1.5px solid var(--line);
  border-radius: 18px 0 0 18px; box-shadow: -6px 0 40px rgba(0,0,0,.13);
  padding: 26px 24px; z-index: 901;
  transition: right .3s cubic-bezier(.4,0,.2,1);
}
.fb-panel.open { right: 0; }
.fb-panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.fb-panel-head h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0; }
.fb-panel-head p  { font-size: .8rem; color: var(--grey); margin: 4px 0 0; }
.fb-close { background: none; border: none; cursor: pointer; color: var(--grey);
  font-size: 1.4rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.fb-close:hover { background: var(--line); color: var(--ink); }

.fb-stars { display: flex; gap: 6px; margin-bottom: 16px; }
.fb-star { font-size: 1.5rem; cursor: pointer; line-height: 1; color: var(--line);
  transition: color .15s, transform .15s; }
.fb-star.lit { color: var(--gold); }
.fb-star:hover { transform: scale(1.15); }

.fb-field { margin-bottom: 14px; }
.fb-field label { display: block; font-size: .8rem; font-weight: 600; color: var(--grey);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.fb-field textarea, .fb-field input[type="text"] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 13px; font: .9rem "Hanken Grotesk", sans-serif;
  color: var(--ink); background: #fff; resize: none; transition: border-color .15s;
  box-sizing: border-box;
}
.fb-field textarea:focus, .fb-field input[type="text"]:focus {
  outline: none; border-color: var(--purple-bright); }
.fb-submit { width: 100%; padding: 11px; background: var(--navy); color: #fff;
  border: none; border-radius: 10px; font: 600 .9rem "Hanken Grotesk", sans-serif;
  cursor: pointer; transition: background .2s; }
.fb-submit:hover { background: var(--purple-bright); }
.fb-thanks { text-align: center; padding: 20px 0; }
.fb-thanks .fb-thanks-icon { font-size: 2.4rem; display: block; margin-bottom: 10px; }
.fb-thanks h4 { font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.fb-thanks p  { font-size: .85rem; color: var(--grey); margin: 0; }
.fb-type-tabs { display: flex; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; }
.fb-type-tab {
  flex: 1; padding: 9px 0; background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1.5px; font: 600 .82rem "Hanken Grotesk", sans-serif; color: var(--grey);
  cursor: pointer; letter-spacing: .02em; text-transform: uppercase; transition: color .15s, border-color .15s;
}
.fb-type-tab:hover { color: var(--ink); }
.fb-type-tab.active { color: var(--navy); border-bottom-color: var(--navy); }

/* ---- Resources search ---------------------------------------------------- */
.res-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 80px 24px; font-size: 1rem; color: var(--grey); font-weight: 500;
}
.res-spin {
  display: inline-block; font-size: 1.6rem;
  animation: hourSpin 1.4s linear infinite;
  transform-origin: center;
}
@keyframes hourSpin { to { transform: rotate(360deg); } }

.res-search-wrap {
  max-width: 640px; margin: 0 auto 40px; text-align: center;
}
.res-search-inner {
  position: relative; display: flex; align-items: center;
}
.res-search-icon {
  position: absolute; left: 18px; color: var(--grey); pointer-events: none;
  flex-shrink: 0;
}
.res-search {
  width: 100%; padding: 16px 20px 16px 52px;
  border: 2px solid var(--line); border-radius: 16px;
  font: 1rem "Hanken Grotesk", sans-serif; color: var(--ink);
  background: var(--white); box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
}
.res-search::placeholder { color: #aaa; }
.res-search:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(76,46,114,.10), 0 2px 16px rgba(0,0,0,.08);
}
.res-search-hints {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin-top: 12px;
}
.res-hint-label {
  font-size: .8rem; color: var(--grey); font-weight: 600; letter-spacing: .03em;
}
.res-hint-chip {
  font-size: .8rem; font-weight: 600; color: var(--purple-bright);
  background: rgba(107,63,160,.08); border: 1.5px solid rgba(107,63,160,.18);
  padding: 4px 12px; border-radius: 20px; cursor: pointer;
  transition: background .14s, border-color .14s;
  font-family: "Hanken Grotesk", sans-serif;
}
.res-hint-chip:hover {
  background: rgba(107,63,160,.15); border-color: rgba(107,63,160,.35);
}
/* ---- Search results ------------------------------------------------------- */
.res-search-result {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  margin-bottom: 16px; overflow: hidden;
}
.res-search-cat-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  background: var(--cream); text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line); transition: background .15s;
}
.res-search-cat-head:hover { background: var(--line); }
.res-search-cat-name { font-weight: 700; font-size: .95rem; }
.res-search-files { list-style: none; margin: 0; padding: 0; }
.res-search-files .res-file { padding: 9px 18px; cursor: pointer; transition: background .12s;
  text-decoration: none; color: inherit; border: none; border-radius: 0; background: none;
  transform: none; box-shadow: none; }
.res-search-files .res-file:hover { background: var(--cream); transform: none; }
.res-search-path { color: var(--grey); font-size: .78rem; }
.res-search-more { padding: 8px 18px; font-size: .8rem; color: var(--grey); font-style: italic; }

/* ---- Subject request section ------------------------------------------- */
.subject-request {
  background: var(--cream); border: 1.5px solid var(--line); border-radius: 20px;
  padding: 40px 44px; margin: 48px auto; max-width: 740px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px;
}
.subject-request h2 { font-size: 1.45rem; margin: 0 0 6px; color: var(--ink); }
.subject-request p  { color: var(--grey); font-size: .93rem; margin: 0 0 22px; max-width: 480px; }
.subject-request-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.subject-request-form input[type="text"] {
  flex: 1; min-width: 200px; padding: 11px 16px; border: 1.5px solid var(--line);
  border-radius: 10px; font: .95rem "Hanken Grotesk", sans-serif; color: var(--ink);
  background: #fff; box-sizing: border-box;
}
.subject-request-form input:focus { outline: none; border-color: var(--purple-bright); }
.subject-request-status { font-size: .85rem; color: var(--grey); min-height: 1.2em; }
.subject-request-status.ok  { color: var(--green-ink); font-weight: 600; }
.subject-request-status.err { color: #c33; }
@media (max-width: 600px) {
  .subject-request { padding: 28px 20px; }
  .subject-request-form { flex-direction: column; }
  .subject-request-form input[type="text"] { min-width: 0; }
  .fb-panel { width: calc(100vw - 16px); right: -100vw; border-radius: 16px 0 0 16px; }
  .fb-panel.open { right: 0; }
  .bk-panel { width: calc(100vw - 16px); right: calc(-100vw + 16px); border-radius: 16px 0 0 16px; }
  .bk-panel.open { right: 0; }
}
