/* Start screen and coach chat. Colours and type come from tokens.css; the look follows
   reference/start-screen-options.html option 12 and reference/time-and-level-options.html option 11. */

.hs-st { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
.hs-st-screen { flex: 1; display: flex; flex-direction: column; padding: 8px max(20px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); min-width: 0; }
/* The focus ring is for keyboard users only (owner, 24 November). start.js sets data-hs-input on <html>: "pointer"
   after a click or a tap, "keys" after Tab or another key outside a text box. With a mouse or a finger, the first answer
   the focus moves to shows no ring, so it doesn't look picked already; with the keyboard there is always one, whatever
   the browser guessed. Text boxes keep their ring: that's where the typing goes. */
[data-hs-input="pointer"] .hs-st button:focus-visible, [data-hs-input="pointer"] .hs-st [role="button"]:focus-visible { outline: none; }
[data-hs-input="keys"] .hs-st button:focus:not(:focus-visible), [data-hs-input="keys"] .hs-st [role="button"]:focus:not(:focus-visible) { outline: 2px solid var(--navy-2); outline-offset: 2px; }

/* ---------- start screen ----------
   It sits high, so the box is in reach at once on a phone, and the space below goes to the examples of what Headstart
   makes (on the page: to what the learner can continue). Spacing grows with the screen (owner, 24 November). */
.hs-st-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; gap: 10px; min-width: 0;
  padding-top: clamp(4px, 7vh - 32px + 2vw, 88px); }
.hs-st-hero { font: 400 clamp(34px, 5.2vw, 72px)/1.05 var(--display); margin: 0; text-wrap: balance; }
.hs-st-sub { color: var(--ink-2); margin: 0 0 clamp(4px, 2vh - 8px, 14px); font-size: clamp(15px, 1.2vw, 17px); }
.hs-st-tabs { display: inline-flex; background: rgba(255, 255, 255, .6); border-radius: 999px; padding: 4px; gap: 4px; border: 1px solid var(--line); max-width: 100%; }
.hs-st-tabs button { border: 0; background: none; border-radius: 999px; padding: 8px 16px; font-weight: 700; color: var(--ink-3); font-size: 14px; }
.hs-st-tabs button[aria-selected="true"] { background: var(--paper); color: var(--navy); box-shadow: 0 1px 4px rgba(33, 73, 133, .15); }

.hs-st-sbar { width: min(660px, 100%); background: var(--paper); border-radius: 22px; box-shadow: var(--card); padding: 8px 8px 8px 18px; display: flex; flex-direction: column; gap: 0; text-align: left; }
.hs-st-sbar-mat { padding: 14px; gap: 10px; }
.hs-st-row { display: flex; align-items: center; gap: 8px; }
.hs-st-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; padding: 10px 0; }
.hs-st-input:focus-visible { outline: 0; }
.hs-st-sbar:focus-within { box-shadow: 0 0 0 2px var(--navy-2), var(--card); }
/* The line under the box: closed until it has something to say (a typed topic), then it opens smoothly. */
.hs-st-hint { display: grid; grid-template-rows: 0fr; font-size: 14px; color: var(--ink-2); text-align: left; padding: 0 4px; transition: grid-template-rows .15s ease-out, padding .15s ease-out; }
.hs-st-hint > div { min-height: 0; overflow: hidden; }
.hs-st-hint.on { grid-template-rows: 1fr; padding: 4px 4px 6px; }
.hs-st-hint b { color: var(--navy); }
.hs-st-arrow { color: var(--navy-2); font-weight: 800; }
.hs-st-examples { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.hs-st-ex { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .55); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

.hs-st-drop { border: 2px dashed var(--sea-deep); border-radius: 16px; padding: 22px 16px; text-align: center; color: var(--ink-2); background: rgba(255, 255, 255, .5); display: grid; gap: 8px; justify-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.hs-st-drop strong { color: var(--ink); font-size: 16px; }
.hs-st-drop.hs-st-over { background: var(--blue); border-color: var(--navy-2); }
.hs-st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-st-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--blue); color: var(--navy-ink); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13px; font-weight: 600; max-width: 100%; }
.hs-st-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-st-chip button { border: 0; background: rgba(255, 255, 255, .6); border-radius: 50%; width: 22px; height: 22px; line-height: 20px; padding: 0; font-size: 14px; color: var(--navy-ink); flex: none; }
.hs-st-field { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hs-st-field input, .hs-st-field textarea { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; background: var(--paper); font-weight: 400; font-size: 15px; width: 100%; resize: vertical; }
.hs-st-rowbtns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.hs-st-links { display: flex; gap: 4px 10px; flex-wrap: wrap; }
.hs-st-links .hs-link { font-size: 14px; }

/* ---------- coach chat ---------- */
.hs-st-chat { width: min(660px, 100%); margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hs-st-back { align-self: flex-start; border: 0; background: none; color: var(--navy); font-weight: 700; padding: 4px 0 4px; font-size: 14px; }
.hs-st-msgs { display: flex; flex-direction: column; gap: 10px; }
.hs-st-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; background: var(--paper); box-shadow: 0 1px 0 var(--line); text-align: left; overflow-wrap: anywhere; }
.hs-st-msg.hs-st-me { align-self: flex-end; background: var(--navy); color: #fff; }
.hs-st-msg.hs-st-err { background: var(--bad-bg); color: var(--bad); }
/* A new message eases in (start.js chatScreen gives the class only to messages just added, with their delay). */
.hs-st-msg.hs-st-in { animation: hs-st-in .18s ease-out both; }
@keyframes hs-st-in { from { opacity: 0; transform: translateY(6px); } }
.hs-st-who { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--navy-2); margin-bottom: 2px; }
.hs-st-foot { display: grid; gap: 8px; scroll-margin-bottom: 24px; }
.hs-st-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.hs-st-quick button { border: 1.5px solid var(--navy-2); background: var(--paper); color: var(--navy); border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: 13px; }
@media (hover: hover) and (pointer: fine) { .hs-st-quick button:hover { background: var(--blue); } }
/* A tap shows at once on a phone, where there is no hover. */
.hs-st-quick button, .hs-st-plan, .hs-st-topics button, .hs-st-tabs button, .hs-st-ex { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hs-st-quick button:active { background: var(--blue); transform: scale(.97); }
.hs-st-tabs button:active { background: rgba(255, 255, 255, .85); transform: scale(.97); }
.hs-st-topics button:active { transform: scale(.97); }
.hs-st-ex:active { transform: scale(.97); }
.hs-st-quick-sub button { border-style: dashed; font-weight: 600; }
.hs-st-reply { padding: 6px 6px 6px 16px; }
.hs-st-working { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-2); padding: 6px 2px; }
.hs-st-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--sea-deep); border-top-color: var(--navy); animation: hs-st-spin .8s linear infinite; flex: none; }
@keyframes hs-st-spin { to { transform: rotate(360deg); } }

.hs-st-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hs-st-plan { border: 1.5px solid var(--line-2); background: var(--paper); border-radius: 14px; padding: 12px; text-align: left; display: grid; gap: 4px; align-content: start; }
@media (hover: hover) and (pointer: fine) { .hs-st-plan:hover { border-color: var(--navy-2); } }
.hs-st-plan:active { border-color: var(--navy-2); background: var(--blue); transform: scale(.98); }
.hs-st-plan strong { font: 400 20px/1.1 var(--display); }
.hs-st-plan span { font-size: 13px; color: var(--ink-3); }
.hs-st-plan span b { color: var(--ink); }
.hs-st-plan .hs-st-rd { font-size: 12px; font-weight: 800; color: var(--good); }

.hs-st-levelcard { background: var(--paper); border-radius: 16px; padding: 14px; display: grid; gap: 10px; border: 1.5px dashed var(--sea-deep); text-align: left; justify-items: start; }
.hs-st-art { justify-self: stretch; height: 80px; border-radius: 12px; background: linear-gradient(180deg, var(--sea-2), var(--sea)); display: flex; align-items: center; justify-content: center; color: var(--navy-ink); font-weight: 700; font-size: 14px; text-align: center; padding: 0 12px; }
.hs-st-topicscard { border-style: solid; border-color: var(--navy-2); }
.hs-st-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-st-topics button { border: 1.5px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.hs-st-topics button[aria-pressed="true"] { background: var(--sage); border-color: var(--sage-ink); color: var(--sage-ink); }
.hs-st-ready { background: var(--paper); border-radius: 16px; padding: 14px; display: grid; gap: 8px; border: 1.5px solid var(--navy-2); text-align: left; justify-items: start; }
.hs-st-ready strong { font: 400 20px/1.1 var(--display); }
.hs-st-readyline { font-size: 14px; color: var(--ink-2); }

/* "Pick a date" (owner, 24 November): the date field takes the chip's place and looks like a chip */
.hs-st-datechip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--navy-2); background: var(--paper); color: var(--navy); border-radius: 999px; padding: 2px 8px 2px 13px; font-weight: 700; font-size: 13px; cursor: pointer; }
.hs-st-datechip input { border: 0; background: none; color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 600; padding: 4px 2px; min-height: 28px; min-width: 8.5em; cursor: pointer; }
.hs-st-datechip input:focus-visible { outline: 0; }
.hs-st-datechip:focus-within { box-shadow: 0 0 0 2px var(--navy-2); }
.hs-st-datenote { margin: 0; font-size: 13px; font-weight: 700; color: var(--bad); }
.hs-st-datenote:empty { display: none; }
@media (max-width: 520px) {
  /* A whole row, as tall as the chips; 16px text so the phone doesn't zoom in on the field. */
  .hs-st-datechip { flex: 1 1 100%; min-height: 44px; border-radius: 14px; padding: 4px 10px 4px 14px; font-size: 15px; justify-content: space-between; }
  .hs-st-datechip input { flex: 1; min-width: 0; font-size: 16px; text-align: right; }
}
/* Topics card: a ✓ in a ring marks each ticked topic; an unticked one keeps an empty ring, a dashed edge and grey text
   (owner, 24 November). The ring sits in padding both states keep, so a chip never changes width when tapped.
   Placed apart from the rules above (same specificity, so these win) to keep merges with focus-ring work clean. */
.hs-st-topics button { position: relative; padding-left: 31px; text-align: left; transition: background-color .12s, border-color .12s, color .12s; }
.hs-st-topics button::before { content: ""; position: absolute; left: 8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--paper); transition: background-color .12s, border-color .12s; }
.hs-st-topics button::after { content: ""; position: absolute; left: 14px; top: 50%; width: 4px; height: 8px; margin-top: -6px; border: solid #fff; border-width: 0 2px 2px 0; opacity: 0; transform: rotate(45deg) scale(.4); transition: opacity .12s, transform .12s; }
.hs-st-topics button[aria-pressed="true"]::before { background: var(--sage-ink); border-color: var(--sage-ink); }
.hs-st-topics button[aria-pressed="true"]::after { opacity: 1; transform: rotate(45deg) scale(1); }
.hs-st-topics button[aria-pressed="false"] { background: rgba(255, 255, 255, .55); border-style: dashed; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .hs-st-screen { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .hs-st-plans { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hs-st-hero { font-size: 36px; }
  .hs-st .hs-go { padding: 12px 16px; font-size: 16px; }
  .hs-st-tabs button { padding: 8px 12px; }
  .hs-st-msg { max-width: 92%; }
  /* Quick replies grow into big, easy-to-tap buttons on the phone. */
  .hs-st-quick { gap: 8px; }
  .hs-st-quick button { flex: 1 1 calc(50% - 4px); min-height: 44px; padding: 10px 12px; font-size: 15px; border-radius: 14px; }
  .hs-st-topics button { min-height: 36px; font-size: 14px; }
}

/* Under the search box: where the page puts what the learner can continue (onRender, owner 23 November) */
.hs-st-slot { width: min(660px, 100%); margin-top: 6px; }
.hs-st-slot:empty { display: none; }

/* What you can make: three small still examples for a new visitor, quiet so they never compete with the box. Each mini
   picture uses the pieces it stands for: the Path page's stops, a card, a map's branches. */
.hs-st-makes { width: min(900px, 100%); margin: clamp(20px, 10vh - 40px, 80px) 0 0; display: grid; gap: 12px; text-align: left; }
.hs-st-makes-h { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.hs-st-makes-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 16px); }
.hs-st-make { display: grid; gap: 10px; align-content: start; padding: 10px 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, .45); border: 1px solid var(--line); min-width: 0; }
.hs-st-make p { margin: 0; padding: 0 4px; display: grid; gap: 2px; }
.hs-st-make strong { font-size: 15px; line-height: 1.3; }
.hs-st-make p span { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.hs-st-mini { position: relative; height: clamp(72px, 9vh, 96px); border-radius: 12px; overflow: hidden; }
.hs-st-mini-path { background: var(--blue); display: flex; align-items: center; padding: 0 8px; }
.hs-st-mini-path span { position: relative; flex: 1; display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--navy-ink); white-space: nowrap; }
.hs-st-mini-path span + span::before { content: ""; position: absolute; top: 10.5px; left: -50%; right: 50%; height: 3px; background: var(--sea-deep); }
.hs-st-mini-path i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--sea-deep); background: var(--paper); font: 800 11px/18px var(--body); font-style: normal; text-align: center; color: var(--ink-3); }
.hs-st-mini-path .hs-st-now i { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgba(251, 253, 254, .7); }
.hs-st-mini-path .hs-st-exam i { background: var(--glow); border-color: var(--glow); color: var(--ink); }
.hs-st-mini-card { background: var(--amber); display: grid; place-items: center; padding: 0 18px 4px 14px; }
.hs-st-mini-card b { display: block; max-width: 230px; padding: 9px 12px; border-radius: 10px; background: var(--paper); font-size: 12.5px; line-height: 1.3; color: var(--ink); text-align: center;
  box-shadow: 0 1px 0 rgba(138, 90, 18, .18), 5px 5px 0 -1px rgba(251, 253, 254, .6); }
.hs-st-mini-map { background: var(--sage); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: center; justify-items: center; row-gap: 12px; padding: 0 6px; }
.hs-st-mini-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hs-st-mini-map path { fill: none; stroke: var(--sage-ink); stroke-opacity: .4; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.hs-st-mini-map b, .hs-st-mini-map span { position: relative; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 5px 9px; white-space: nowrap; }
.hs-st-mini-map b { grid-column: 1 / -1; background: var(--sage-ink); color: #fff; }
.hs-st-mini-map span { background: var(--paper); color: var(--sage-ink); box-shadow: 0 0 0 1px rgba(36, 82, 60, .2); }
@media (max-width: 560px) {
  /* On a phone each example is a row: the picture on the left, the words on the right. */
  .hs-st-makes { gap: 10px; }
  .hs-st-makes-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hs-st-make { grid-template-columns: 136px minmax(0, 1fr); align-items: center; padding: 6px; gap: 10px; border-radius: 16px; }
  .hs-st-make p { padding: 0; }
  .hs-st-make p span { font-size: 13px; }
  .hs-st-mini { height: 60px; border-radius: 11px; }
  .hs-st-mini-path span:nth-child(2) { display: none; }
  .hs-st-mini-path span { font-size: 11px; }
  .hs-st-mini-card { padding: 0 12px 3px 8px; }
  .hs-st-mini-card b { font-size: 11px; padding: 6px 8px; }
  .hs-st-mini-map { row-gap: 8px; padding: 0 3px; }
  .hs-st-mini-map b, .hs-st-mini-map span { font-size: 10px; padding: 4px 6px; }
}

/* Signed in here before, while the account is read (course.js, <html data-hs-acct="waiting">): the examples of what
   Headstart makes would flash and then give way to the learner's "Continue" card, so they wait. */
html[data-hs-acct="waiting"] .hs-st-makes { visibility: hidden; }

/* ---------- Juno you can talk to (owner, 24 November; reference/juno-talk) ---------- */
/* "What you'd learn": the headlines, each with a ×, then what was left out and what can be added. */
.hs-st-outline { justify-self: stretch; border-style: solid; border-color: var(--navy-2); gap: 12px; }
.hs-st-heads { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; }
.hs-st-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--shell); animation: hs-st-in .22s ease-out both; }
.hs-st-head.hs-st-flash { animation: hs-st-flash 1.1s ease-out; }
@keyframes hs-st-flash { 0% { background: var(--amber); } 100% { background: var(--shell); } }
.hs-st-head-wait { background: none; padding-left: 4px; }
.hs-st-head-t { flex: 1; min-width: 0; display: grid; }
.hs-st-head-t b { font-weight: 700; }
.hs-st-gloss { font-size: 13px; color: var(--ink-3); }
.hs-st-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .8); color: var(--navy-ink); font-size: 18px; line-height: 1; padding: 0; }
@media (hover: hover) and (pointer: fine) { .hs-st-x:hover { background: var(--bad-bg); color: var(--bad); } }
.hs-st-x[disabled] { opacity: .35; cursor: default; }
.hs-st-sub { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.hs-st-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-st-pills button { border: 1.5px dashed var(--navy-2); background: var(--paper); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; color: var(--navy); }
@media (hover: hover) and (pointer: fine) { .hs-st-pills button:hover { background: var(--blue); } }
.hs-st-pills.hs-st-off button { border-color: var(--line-2); color: var(--ink-3); text-decoration: line-through; }
.hs-st-tip { font-size: 13px; color: var(--ink-2); margin: 0; }
.hs-st-tip b { color: var(--navy); }
/* Juno's typing dots, and a reply streaming in. */
.hs-st-dots { display: inline-flex; gap: 4px; padding: 6px 0 4px; }
.hs-st-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--sea-deep); animation: hs-st-dot 1s infinite ease-in-out; }
.hs-st-dots i:nth-child(2) { animation-delay: .15s; }
.hs-st-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hs-st-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
/* "Or tell Juno in your own words", under the answers. */
.hs-st-say { display: grid; gap: 4px; margin-top: 6px; }
.hs-st-say-l { font-size: 13px; font-weight: 700; color: var(--ink-2); padding-left: 4px; }
.hs-st-say .hs-st-sbar { width: 100%; }
/* A one-page summary, in the chat. */
.hs-st-sum { justify-self: stretch; border-style: solid; border-color: var(--navy-2); gap: 8px; }
.hs-st-sum h3 { font: 400 22px/1.1 var(--display); margin: 0; }
.hs-st-sum p { margin: 0; color: var(--ink-2); }
.hs-st-sum ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.hs-st-sum h4 { margin: 6px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--navy-2); }
@media (max-width: 520px) { .hs-st-head { padding-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .hs-st-head, .hs-st-dots i { animation: none; } }
.hs-st-say-cost { margin: 2px 4px 0; font-size: 12px; color: var(--ink-3); }
.hs-st-slow { display: block; font-size: 13px; color: var(--ink-3); }
