/* Layout variations, picked with ?layout=focus or ?layout=app.
   They change structure, not colour, and work with any ?theme=. */

/* =========================== FOCUS ===========================
   One question at a time, big and centred. Past messages are hidden;
   the side panel keeps the answers. */
body.layout-focus main { max-width: 900px; justify-content: center; padding: 40px 48px; }
body.layout-focus main:has(.current) > * { display: none; }
body.layout-focus main > .current:not(.answered) { display: flex; }
body.layout-focus main > .msg.coach.intro:has(+ .current:not(.answered)) { display: flex; }
body.layout-focus main > .current ~ .msg.coach { display: flex; }
body.layout-focus main > .current.answered + .msg.user { display: flex; }
body.layout-focus main > .current.result ~ .msg.coach { display: flex; }

body.layout-focus .msg.coach:not(.wide) { padding-left: 0; align-self: stretch; max-width: 100%; align-items: center; text-align: center; }
body.layout-focus .msg.coach:not(.wide)::before { display: none; }
body.layout-focus .msg.coach .bubble { background: none; border: 0; box-shadow: none; padding: 0; }
body.layout-focus .msg.coach:not(.current) .bubble { font-size: 1.05rem; color: var(--muted); }
body.layout-focus .msg.current .bubble { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); max-width: 18em; }
body.layout-focus .msg.current .meta {
  font-size: 0.8rem; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; background: rgba(37,99,235,0.1); color: var(--accent);
}
body.layout-focus .msg.current .choices {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 680px; margin-top: 28px;
}
body.layout-focus .msg.current .choices.multi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.layout-focus .msg.current .choices.age-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.layout-focus .msg.current .choice {
  border-radius: 18px; min-height: 76px; padding: 16px 18px; font-size: 1.05rem; text-align: left; display: flex; align-items: center;
}
body.layout-focus .msg.current .choices.age-grid .choice { justify-content: center; text-align: center; }
body.layout-focus .msg.current .choices-done { grid-column: 1 / -1; justify-content: center; margin-top: 8px; }
body.layout-focus .msg.user { align-self: center; }
body.layout-focus .msg.user .bubble { font-size: 1.1rem; }
body.layout-focus .msg.user .bubble::before { content: "You chose: "; opacity: 0.75; font-weight: 500; }
body.layout-focus .typing { align-self: center; }
body.layout-focus .msg.current { animation: slidein 0.35s ease both; }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
body.layout-focus .result { width: 100%; }
body.layout-focus.is-welcome main { max-width: 1200px; padding: 0; }
body.layout-focus .progress { display: none; }
@media (max-width: 720px) {
  body.layout-focus main { padding: 24px 16px; }
  body.layout-focus .msg.current .choices, body.layout-focus .msg.current .choices.multi { grid-template-columns: 1fr; }
  body.layout-focus .msg.current .choices.age-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.layout-focus .msg.current .choice { min-height: 56px; }
}

/* =========================== APP ===========================
   The coach shown as a phone app beside the journey panel. */
@media (min-width: 900px) {
  body.layout-app .shell { justify-content: center; gap: 40px; align-items: center; }
  body.layout-app .journey { order: 2; width: 320px; max-height: 100%; }
  body.layout-app .chat {
    flex: 0 0 410px; max-width: 410px; height: min(100%, 860px); position: relative;
    border: 12px solid #0b1020; border-radius: 48px; box-shadow: 0 40px 80px -20px rgba(11,16,32,0.55), 0 0 0 2px #2a3150;
    container-type: inline-size; padding-top: 28px;
  }
  body.layout-app .chat::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 110px; height: 26px; margin-left: -55px; border-radius: 999px; background: #0b1020; z-index: 3;
  }
  body.layout-app main { padding: 16px 14px 20px; gap: 12px; }
  body.layout-app .msg.coach:not(.wide) { padding-left: 0; }
  body.layout-app .msg.coach:not(.wide)::before { display: none; }
  body.layout-app .bubble { font-size: 0.95rem; }
  body.layout-app .choices { flex-direction: column; flex-wrap: nowrap; }
  body.layout-app .choices.multi { flex-direction: row; flex-wrap: wrap; }
  body.layout-app .choice { border-radius: 14px; font-size: 0.92rem; padding: 10px 14px; }
  body.layout-app .choices.age-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.layout-app .choices.age-grid .choice:nth-child(5) { grid-column: 1; }
  body.layout-app .choices.age-grid .choice:nth-child(6) { grid-column: 2; }
  body.layout-app .cards { grid-template-columns: 1fr; }
  body.layout-app .plan-head { flex-wrap: wrap; padding: 16px; }
  body.layout-app .plan-head .save { width: 100%; }
  body.layout-app .progress { padding: 8px 14px; }
  body.layout-app footer { padding: 10px 12px 8px; }
  body.layout-app .note { font-size: 0.68rem; }
  body.layout-app #send { padding: 10px 16px; }
  body.layout-app .hero { grid-template-columns: 1fr; padding: 28px 20px; gap: 0; }
  body.layout-app .hero-art { display: none; }
  body.layout-app .hero h2 { font-size: 2.1rem; }
  body.layout-app .hero-actions .big { width: 100%; }
  body.layout-app .trust { gap: 8px 14px; }

  /* Welcome: pitch on the left of the phone */
  body.layout-app.is-welcome .shell::before {
    content: "A career coach that fits in your pocket"; order: 0; max-width: 360px; font-size: 3rem; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; color: #fff;
    text-shadow: 0 2px 20px rgba(11,31,68,0.3);
  }
}
body.layout-focus main { justify-content: safe center; }
