/* Phase 6: setup wizard, template packs, storage warnings, accessibility helpers. */

/* ---------- setup wizard ---------- */
.steps__dot { width: 2rem; }
.setup__nav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.setup__nav .btn--big { width: auto; margin-top: 0; margin-left: auto; min-width: 10rem; }
.setup--wide .setup__nav .btn--big { display: inline-flex; width: auto; }
.setup__who { display: flex; justify-content: center; margin-bottom: .5rem; }
.setup__who .avatar { --size: 5rem; }
.setup .preview { margin-top: .5rem; }
.setupkids { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.setupkids li { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem 1rem .3rem .35rem; border-radius: 999px; background: var(--primary-soft); font-weight: 800; }
.setupkids .avatar { --size: 2.75rem; box-shadow: none; }
.ideas--setup { justify-content: center; }
.idea[aria-pressed="true"] { border-style: solid; border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }

/* ---------- template packs ---------- */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; text-align: left; }
.packcard {
  display: flex; align-items: flex-start; gap: .75rem; padding: 1rem; min-height: 5.5rem;
  border: 2px solid var(--line); border-radius: 1.25rem; background: var(--surface); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; position: relative;
}
.packcard:hover { border-color: var(--primary); }
.packcard[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }
.packcard__icon { font-size: 2.25rem; line-height: 1; flex: none; }
.packcard__body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; padding-right: 2rem; }
.packcard__name { font-weight: 800; font-size: 1.2rem; }
.packcard__text { color: var(--muted); font-size: 1rem; }
.packcard__list { color: var(--muted); font-size: 1rem; line-height: 1.35; }
.packcard__check {
  position: absolute; top: .75rem; right: .75rem; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 2px solid var(--line); display: grid; place-items: center; color: transparent; background: var(--surface);
}
.packcard__check .icon { width: 1.2rem; height: 1.2rem; }
.packcard[aria-pressed="true"] .packcard__check { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
html.hc .packcard[aria-pressed="true"], html.hc .idea[aria-pressed="true"] { background: #000 !important; color: #fff !important; }
html.hc .packcard[aria-pressed="true"] .packcard__text, html.hc .packcard[aria-pressed="true"] .packcard__list { color: #fff !important; }

/* ---------- storage ---------- */
.storagewarn { display: flex; gap: .75rem; align-items: flex-start; background: var(--danger-soft); border-radius: 1rem; padding: .9rem 1.1rem; font-weight: 600; }

/* ---------- accessibility helpers ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Audit fixes: nothing under 16px, demo button 52px tall. */
.starpick__btn small { font-size: 1rem; }
.demo-banner__btn { min-height: 3.25rem; }
@media (max-width: 760px) {
  .parentnav__item { font-size: 1rem; }
  .parentnav__item .navcount { font-size: 1rem; min-width: 1.6rem; height: 1.6rem; }
}
@media (max-width: 440px) {
  .packs { grid-template-columns: 1fr; }
  .setup__nav .btn--big { min-width: 0; flex: 1; }
}

/* Day picker: on phones seven buttons in a row are too narrow to tap, so wrap to two rows. */
@media (max-width: 440px) {
  .daypick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Very narrow phones (and XL text): keep the child's name readable in the kid header. */
@media (max-width: 380px) {
  .kidbar { gap: .45rem; }
  .kidbar__who .avatar { --size: 2.75rem; }
  .kidbar__name { font-size: 1.6rem; }
  .kidbar__stars { font-size: 1.75rem; padding: .3rem .8rem .3rem .6rem; gap: .3rem; }
  .kidbar__stars .icon { width: 1.8rem; height: 1.8rem; }
}

/* Dialog buttons on phones: share rows so the form keeps most of the space. */
@media (max-width: 440px) {
  .modal__actions { gap: .5rem; padding: .6rem 0; }
  .modal__actions .btn { flex: 1 1 40%; min-width: 0; justify-content: center; }
}
@media (max-width: 380px) {
  .modal-backdrop { padding: .5rem; }
  .modal { padding: 1.25rem 1rem; max-height: calc(100dvh - 1rem); }
  .modal__actions .btn { padding: .5rem .75rem; }
}

/* ==========================================================
   Review fixes (kid screen layout, demo banner)
   ========================================================== */

/* Laptop: a compact side column so the buddy and the whole star jar fit above the dock. */
@media (min-width: 1001px) {
  .kidside { gap: .75rem; }
  .buddybox {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "buddy bubble" "buddy streak";
    align-items: center; column-gap: .9rem; row-gap: .4rem; padding: .75rem 1rem; text-align: left;
  }
  .buddybox__buddy { grid-area: buddy; }
  .buddybox__buddy svg { width: 4.5rem; height: 4.5rem; }
  .buddybox__bubble { grid-area: bubble; font-size: 1.125rem; padding: .4rem .7rem; }
  .buddybox__bubble::after { left: -.6rem; top: 50%; bottom: auto; transform: translateY(-50%) rotate(135deg); }
  .streak { grid-area: streak; align-items: flex-start; }
  .streak__days { font-size: 1.125rem; }
  .jar { flex-direction: row; align-items: center; justify-content: flex-start; gap: .9rem; padding: .9rem 1rem; text-align: left; }
  .jar__svg { width: 4.75rem; flex: none; }
  .jar__info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
  .jar__word { display: inline; }
  .jar__ask, .jar__more { margin-top: .4rem; }
}

/* Phone: tasks first. Below them, two slim cards: buddy + speech bubble, then the jar. */
@media (max-width: 700px) {
  .kidside { order: 0; display: flex; flex-direction: column; gap: .6rem; margin-top: 1.25rem; }
  .kidside .buddybox, .kidside .jar { order: 0; flex: none; }
  .buddybox { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: .75rem; padding: .5rem .9rem; }
  .buddybox__buddy { order: 1; }
  .buddybox__buddy svg { width: 3.5rem; height: 3.5rem; }
  .buddybox__bubble { display: block; order: 2; font-size: 1.125rem; padding: .35rem .7rem; line-height: 1.2; text-align: left; }
  .buddybox__bubble::after { display: block; left: -.6rem; top: 50%; bottom: auto; transform: translateY(-50%) rotate(135deg); }
  .streak { display: none; }

  .jar { flex-direction: row; align-items: center; justify-content: flex-start; gap: .75rem; padding: .6rem .9rem; text-align: left; }
  .jar__svg { width: 3.25rem; flex: none; }
  /* Goal and numbers on the left, the Rewards button on the right. */
  .jar__info { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .6rem; }
  .jar__goal, .jar__nums, .jar__ready, .jar__asked { grid-column: 1; }
  .jar__goal { font-size: 1.125rem; }
  .jar__nums { font-size: 1.125rem; white-space: nowrap; }
  .jar__word { display: none; }
  .jar__ask, .jar__more { grid-column: 2; grid-row: 1 / span 2; margin: 0; min-height: 3.5rem; padding: .4rem .9rem; font-size: 1.125rem; white-space: nowrap; }
  .jar--ready .jar__ask { grid-row: 1; }
  .jar--ready .jar__more { grid-row: 2; margin-top: .35rem; }

  /* Short labels under the Cards / First – Then / My day icons. */
  .kidbar__views .viewbtn { flex-direction: column; gap: .1rem; padding: .35rem .3rem; }
  .kidbar__views .viewbtn__label { display: block; font-size: 1rem; line-height: 1.1; text-align: center; }
}

/* Phone: the demo banner scrolls away with the page instead of covering the kid header. */
@media (max-width: 760px) {
  .demo-banner { position: static; }
  html.is-demo .kidside, html.is-demo .jar { top: 1rem; }
}

/* Narrow phones / big text: the jar's buttons go under the goal so nothing is squeezed. */
@media (max-width: 360px) {
  .jar__ask, .jar__more { grid-column: 1 / -1; grid-row: auto; margin-top: .4rem; justify-self: start; }
  .jar--ready .jar__ask, .jar--ready .jar__more { grid-row: auto; }
}
html[data-text="xl"] .jar__info { grid-template-columns: minmax(0, 1fr); }
html[data-text="xl"] .jar__ask, html[data-text="xl"] .jar__more { grid-column: 1; grid-row: auto; margin-top: .4rem; justify-self: start; }

/* Kid dock: pinned to the bottom of the window on every screen size.
   The content keeps clear of it: --dock-h is the dock's measured height (CC.kidx.fitDock). */
.screen--kid { padding-bottom: calc(var(--dock-h, 7rem) + 1.25rem); }
.screen--kid .dock { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; }
html.has-dock #toasts { bottom: calc(var(--dock-h, 7rem) + 1rem); }
