/* ============================================================
   ScolerAI Home — plan-builder.css (2026-11-25, the planner 2026-11-26)
   The cover's study planner (js/plan_builder.js): the visitor's words
   and ScolerAI's reply, the wizard's questions as buttons, the text
   box, and the plan taking shape beside them.
   The plan card itself is css/plan-mocks.css.

   Same materials as the cover: Layer 3 glass for everything the
   visitor presses, the app's white bento card for the plan it gets.
   ============================================================ */

/* ── The cover, and the planner it turns into (2026-11-26) ─────
   One slide, two views: the cover's input and sample topics
   (data-view="ask"), and the planner (data-view="plan"), swapped in
   place by js/plan_builder.js. `[hidden]` is only a UA rule and both
   views set `display`, so it is beaten here. */
.slide--cover .cover[hidden],
.slide--cover .plan-demo[hidden] { display: none !important; }
.slide--cover .cover__scroll { transition: opacity 220ms var(--ease); }
.slide--cover[data-view="plan"] .cover__scroll { opacity: 0; pointer-events: none; }
/* The bottom padding held the "Scroll" hint, hidden here: the planner
   gets it back, which keeps it inside a 1280x800 screen. */
@media (min-width: 900px) {
  .slide--cover[data-view="plan"] { padding-bottom: 28px; }
}

/* "Or start from a sample topic" — said once, quieter than the input. */
.cover__pick {
  margin: 18px auto 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark-muted);
  text-align: center;
}
.cover__starters--topics { margin-top: 10px; }

/* "Or plan from: Your book · Your timetable · Your curriculum" (2026-11-28):
   the learner's own material, one row under the sample topics, as low as
   they are. Same glass, each chip tinted with one of the bento's accents
   and led by a solid disc of it, so the three read as different kinds of
   start rather than three more topics. The discs carry the glyph at full
   contrast (navy on lime and lilac, white on cobalt). */
.cover__sources {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 660px;
  margin: 10px auto 0;
}
.cover__sources-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark-muted);
  margin-right: 2px;
}
.cover__source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  color: var(--on-dark);
  border-radius: var(--r-pill);
  padding: 5px 16px 5px 5px;
  border: 1px solid;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  transition: background 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.cover__source:active { transform: scale(0.97); }
.cover__source:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
.cover__source-icon {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}
.cover__source--book { background: rgba(215, 255, 95, 0.14); border-color: rgba(215, 255, 95, 0.46); }
.cover__source--book:hover { background: rgba(215, 255, 95, 0.24); }
.cover__source--book .cover__source-icon { background: #D7FF5F; color: #0F1630; }
.cover__source--school { background: rgba(157, 176, 255, 0.16); border-color: rgba(157, 176, 255, 0.5); }
.cover__source--school:hover { background: rgba(157, 176, 255, 0.26); }
.cover__source--school .cover__source-icon { background: #2347E0; color: #fff; }
.cover__source--curriculum { background: rgba(228, 216, 251, 0.14); border-color: rgba(228, 216, 251, 0.5); }
.cover__source--curriculum:hover { background: rgba(228, 216, 251, 0.24); }
.cover__source--curriculum .cover__source-icon { background: #E4D8FB; color: #0F1630; }

/* The same row under the planner's first question, left-aligned with it. */
.pb__sources { justify-content: flex-start; max-width: none; margin: 12px 0 0; }
/* The question above already says what the row is for (the group keeps its
   aria-label), so the three chips get the line to themselves. */
.pb__sources .cover__sources-label { display: none; }

/* On a phone the row would take three lines in French: the chips say what
   they are on their own, so the label leaves the screen (screen readers
   still read it, it names the group) and the chips tighten. Two lines. */
@media (max-width: 560px) {
  .cover__sources { gap: 6px; }
  .cover__sources .cover__sources-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .cover__source { font-size: 13.5px; gap: 6px; padding: 4px 13px 4px 4px; }
  .cover__source-icon { width: 26px; height: 26px; }
}

/* ── The builder ──────────────────────────────────────────────── */
.plan-demo {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(22px, 3.4vw, 48px);
  align-items: start;
  text-align: left;
}
.plan-demo__lead .s-eyebrow,
.plan-demo__lead .s-title,
.plan-demo__lead .s-sub { text-align: left; margin-left: 0; }
.plan-demo__lead .s-title { font-size: clamp(26px, 3vw, 36px); }
.plan-demo__lead .s-sub { font-size: 15.5px; margin-top: 10px; }

.pb__question { margin-top: clamp(16px, 2.4vh, 24px); }
.pb__q {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  animation: pbIn 360ms var(--ease) both;
}
@keyframes pbIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pb__qhead { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.pb__count {
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lilac);
}
.pb__back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px 6px 8px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--on-dark);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.pb__back:hover { background: rgba(255, 255, 255, 0.2); }
.pb__back:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.pb__title {
  margin: 6px 0 14px;
  font-family: Poppins, Inter, sans-serif;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.25;
  color: var(--on-dark);
}
.pb__opts { display: flex; flex-direction: column; gap: 8px; }
.pb__opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-dark);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}
.pb__opt:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.45); }
.pb__opt:active { transform: scale(0.985); }
.pb__opt:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.pb__opt.is-on { background: #FFFFFF; color: var(--ink); border-color: #FFFFFF; }
.pb__opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pb__opt-text b { font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.pb__opt-text em { font-style: normal; font-size: 13px; line-height: 1.35; color: var(--on-dark-muted); }
.pb__opt.is-on .pb__opt-text em { color: var(--ink-muted); }
.pb__opt-go { flex: none; opacity: 0.7; }

.pb__q--done .pb__count { color: #D7FF5F; }
.pb__summary { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--on-dark); }
.pb__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.pb__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: var(--r-pill);
  background: var(--violet);
  color: #FFFFFF;
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.45);
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}
.pb__cta:hover { background: var(--violet-light); transform: translateY(-1px); }
.pb__cta:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
.pb__again {
  padding: 12px 18px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-dark);
  font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer;
}
.pb__again:hover { background: rgba(255, 255, 255, 0.18); }
.pb__again:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
.pb__note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--on-dark-muted); }
/* A book's plan ends on what uploading one takes (2026-11-28): a line that
   says it is Go and Premium and the two plans' buttons, worded and coloured
   as on the pricing page in its dark theme (Go cobalt, Premium light with
   navy text). A step smaller than the call to action above, so the way on
   stays the violet button. */
.pb__plans {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 14px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.pb__plans-lead { margin: 0; flex: 1 1 180px; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--on-dark); text-wrap: balance; }
.pb__plans-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.pb__plan {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  text-decoration: none;
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}
.pb__plan:hover { transform: translateY(-1px); }
.pb__plan:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
.pb__plan--go { background: #2347E0; color: #FFFFFF; }
.pb__plan--go:hover { background: #3A5BF0; }
.pb__plan--premium { background: #EEF1FB; color: #0F1630; }
.pb__plan--premium:hover { background: #FFFFFF; }

/* "Your plan is taking shape" — the wizard's own panel, then the card. */
.pb__shape {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin-bottom: 14px;
}
.pb__shape-title {
  width: 100%;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.pb__shape-type { display: inline-flex; align-items: center; gap: 10px; }
.pb__shape-type em { font-style: normal; font-size: 13.5px; color: var(--on-dark-muted); }
.pb__shape-type b {
  font-family: 'Bricolage Grotesque', Inter, sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--on-dark);
}
.pb__shape.is-known .pb__shape-type b { background: #D7FF5F; color: #0F1630; animation: pbType 520ms cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes pbType { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.pb__shape-body { width: 100%; margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--on-dark); max-width: 56ch; }

.pb__card { position: relative; perspective: 1400px; }
/* A glow behind the card, in the bento's cobalt and lime. */
.pb__card::before {
  content: '';
  position: absolute;
  inset: 8% -4% -6% -4%;
  border-radius: 40px;
  background: radial-gradient(60% 55% at 30% 30%, rgba(35, 71, 224, 0.55), transparent 70%),
              radial-gradient(50% 45% at 80% 75%, rgba(215, 255, 95, 0.32), transparent 70%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
}
.pb__card .pc {
  position: relative;
  z-index: 1;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.pb__card.is-new .pc { animation: pbCard 640ms cubic-bezier(.2, .85, .25, 1) both; transform-origin: 50% 0; }
@keyframes pbCard {
  from { opacity: 0; transform: translateY(26px) rotateX(10deg) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.pb__card.is-new .pc__phase { animation: pbRow 460ms var(--ease) both; }
.pb__card.is-new .pc__phase:nth-of-type(1) { animation-delay: 220ms; }
.pb__card.is-new .pc__phase:nth-of-type(2) { animation-delay: 320ms; }
.pb__card.is-new .pc__phase:nth-of-type(3) { animation-delay: 420ms; }
@keyframes pbRow { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* The card before it is written. */
.pb__card--ghost .pc { background: rgba(255, 255, 255, 0.9); }
.pb__ghost-pic { display: block; width: 100%; height: 100%; border-radius: inherit; border: 2px dashed #C7CDE0; box-sizing: border-box; background: #F4F6FB; }
.pb__bone {
  display: block;
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #E9EDF7 0%, #F6F8FD 50%, #E9EDF7 100%);
  background-size: 200% 100%;
  animation: pbBone 1.6s linear infinite;
}
.pb__bone--chip { width: 38%; height: 22px; margin-top: 0; }
.pb__bone--title { width: 78%; height: 18px; }
.pb__bone--short { width: 46%; }
.pb__bone--bar { width: 100%; height: 6px; margin-top: 16px; }
.pb__bone--glyph { flex: none; width: 40px; height: 40px; margin: 0; }
.pb__bone-col { flex: 1; }
.pb__bone-col .pb__bone:first-child { margin-top: 0; }
@keyframes pbBone { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .pb__q, .pb__card.is-new .pc, .pb__card.is-new .pc__phase, .pb__shape.is-known .pb__shape-type b, .pb__bone { animation: none; }
}

/* ── Narrow ───────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .plan-demo { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .plan-demo__lead .s-eyebrow,
  .plan-demo__lead .s-title,
  .plan-demo__lead .s-sub { text-align: center; margin-left: auto; margin-right: auto; }
}
@media (max-width: 420px) {
  .pb__q { padding: 14px; }
  .pb__title { font-size: 19px; }
}

/* ── The conversation: the latest exchange only ─────────────── */
.pb__log { display: flex; flex-direction: column; gap: 10px; margin-top: clamp(14px, 2vh, 20px); }
.pb__log[hidden] { display: none; }
.pb__you { display: flex; justify-content: flex-end; }
.pb__you p {
  margin: 0;
  max-width: 88%;
  padding: 9px 15px;
  border-radius: 18px 18px 6px 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.pb__ai { display: flex; align-items: flex-start; gap: 10px; }
.pb__ai-mark {
  flex: none;
  width: 26px; height: 26px;
  margin-top: 1px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--violet);
  color: #fff;
}
.pb__ai p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--on-dark);
  overflow-wrap: anywhere;
}
.pb__ai.is-streaming p::after {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--lilac);
  vertical-align: middle;
  animation: pbPulse 1s ease-in-out infinite;
}
@keyframes pbPulse { 50% { opacity: 0.25; } }
.pb__ai--note p { color: var(--on-dark-muted); font-style: italic; }
.pb__ai--error p { color: #FFD9D9; }
.pb__help {
  margin: 0 0 0 36px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(215, 255, 95, 0.14);
  border: 1px solid rgba(215, 255, 95, 0.45);
  color: #F3FFD6;
  font-size: 14px;
  line-height: 1.5;
}

/* ── The text box, under the questions ───────────────────────── */
.pb__composer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 6px 6px 18px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.pb__composer[hidden] { display: none; }
.pb__composer:focus-within { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.18); }
.pb__input {
  flex: 1; min-width: 0;
  height: 40px;
  border: none; background: none; outline: none;
  font-family: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  color: var(--on-dark);
}
.pb__input::placeholder { color: rgba(255, 255, 255, 0.62); }
.pb__send {
  flex: none;
  width: 40px; height: 40px;
  border: none; border-radius: 999px;
  background: var(--violet);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}
.pb__send svg { width: 17px; height: 17px; }
.pb__send:hover { background: var(--violet-light); }
.pb__send:active { transform: scale(0.94); }
.pb__send:disabled, .pb__input:disabled { opacity: 0.55; cursor: default; }
.pb__send:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
.pb__closed { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--on-dark-muted); }
.pb__closed[hidden] { display: none; }
.pb__foot {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--on-dark-muted);
}
.pb__foot a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 2px; }
.pb__foot a:hover { text-decoration-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .pb__ai.is-streaming p::after { animation: none; }
}

/* The sample topics stay a wrapped row on a phone: they are short, and a
   column of five would push the input's own note off the first screen. */
@media (max-width: 900px) {
  .cover__starters--topics { flex-direction: row; align-items: center; }
  .cover__starters--topics .cover__starter { text-align: center; }
}
@media (max-width: 899px) {
  .pb__foot { justify-content: center; }
}
/* On a phone the foot's two lines wrap, and the dot between them would lead
   the second line: the underline already marks the link. */
@media (max-width: 560px) {
  .pb__foot > span[aria-hidden="true"] { display: none; }
}

/* The first question's four topics sit two by two: with the reply above
   and the text box below, a column ran the planner past a 900px screen,
   and the deck snaps a slide whole. The school week moved to the material
   chips under them (2026-11-28). */
.pb__opts--topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pb__opts--topics .pb__opt { padding: 10px 12px; }
.pb__opts--topics .pb__opt-go { display: none; }
@media (max-width: 420px) {
  .pb__opts--topics { grid-template-columns: minmax(0, 1fr); }
}
