/* ——— Setting up a child's plan (js/screens/setup.js) ———
   A grown-up screen in the open look (css/open.css): one question per card,
   big chips, phone first. The hand-off to the child wears the child's world
   (.su-kid-palace, .su-kid-town). Also: the skill picker (.sp-, from
   js/skill-picker.js) and the Learning Loop button and plan line on "Who's
   playing?" (js/screens/profiles.js). Class prefix .su-. */

.view-setup {
  --su-line: #eadff2;
  --su-chip-shadow: #ece4f3;
  --su-note: #fff4d6;
  --su-known: #22a37f;
  --su-known-soft: #dcf6ec;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.view-setup:has(> .corner-back) { padding-top: calc(70px + env(safe-area-inset-top)); }

.su { max-width: 540px; margin: 0 auto; animation: su-in 0.35s var(--bounce); }
@keyframes su-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.su-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px 20px;
  border-radius: var(--radius);
  border: 4px solid #fff;
  background: var(--card);
  box-shadow: var(--shadow);
}
.su-center { align-items: center; text-align: center; }
.su-q {
  font-size: clamp(26px, 6.6vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}
.su-sub { font-size: 17px; line-height: 1.4; color: var(--ink-soft); }
.su-label { margin-top: 2px; font-size: 17px; font-weight: 600; }
.su-top { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.su-dots { display: flex; gap: 6px; }
.su-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--su-line); }
.su-dots i.on { background: var(--pink); }

/* Buttons and links */
.su-foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 4px; width: 100%; }
.su-foot .btn { width: 100%; }
.su-two { flex-direction: column; gap: 0; line-height: 1.15; padding-block: 12px; }
.su-two small { font-size: 16px; font-weight: 500; opacity: 0.92; }
.su-link {
  min-height: 48px;
  padding: 8px 10px;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 17px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.su-left { align-self: flex-start; padding-left: 0; text-align: left; }
.su-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; }

/* Chips */
.su-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.su-chip {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 20px;
  border: 3px solid var(--su-line);
  background: #fff;
  box-shadow: 0 4px 0 var(--su-chip-shadow);
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  transition: transform 0.15s var(--bounce), border-color 0.15s, background 0.15s;
}
.su-chip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--su-chip-shadow); }
.su-chip[aria-pressed='true'] { border-color: var(--lilac); background: var(--lilac-soft); box-shadow: 0 4px 0 var(--lilac); }
.su-chip:disabled { opacity: 0.5; }
.su-ages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.su-chip.su-age { padding: 16px 0; text-align: center; font-size: 30px; }
.su-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.su-chip.su-time { padding: 16px 8px; text-align: center; font-size: 23px; }
.su-wide { grid-column: span 2; }
.su-suggest { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--lilac-deep, #7d58d6); }

/* "What would you love Ava to get better at?" */
.su-text {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 20px;
  border: 3px solid var(--su-line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  line-height: 1.4;
  outline: none;
}
.su-text:focus { border-color: var(--lilac); box-shadow: 0 0 0 5px rgba(160, 124, 245, 0.16); }
.su-text::placeholder { color: #a996b8; }
.su-text:disabled { opacity: 0.6; }
.su-try { display: flex; flex-direction: column; align-items: stretch; gap: 6px; font-size: 15px; color: var(--ink-soft); }
.su-try-btn {
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 16px;
  border: 2px dashed var(--su-line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--lilac-deep);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
}
/* Before anything is sent: where typed words go (App Store 5.1.2(i)). */
.su-ai-note { margin-top: -6px; font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.su-inline-link {
  min-height: 32px;
  padding: 0 2px;
  border: none;
  background: none;
  color: var(--lilac-deep);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.su-reading { text-align: center; font-size: 17px; color: var(--ink-soft); }
.su-ellipsis::after { content: '…'; display: inline-block; animation: su-dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; width: 1.1em; text-align: left; }
@keyframes su-dots { from { width: 0; } to { width: 1.1em; } }

/* "Here's what we heard" */
.su-heard { font-size: 20px; font-weight: 500; line-height: 1.35; }
.su-rows { list-style: none; margin: 0; padding: 4px 16px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 var(--su-chip-shadow); }
.su-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 2px solid var(--su-line); }
.su-row:first-child { border-top: 0; }
.su-tick {
  flex: none;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--su-known-soft);
  color: var(--su-known);
  font-weight: 700;
}
.su-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.su-row-text b { font-size: 18px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.su-row-text span { font-size: 16px; color: var(--ink-soft); }
.su-row-text small { font-size: 14px; color: #a996b8; }
.su-x {
  flex: none;
  width: 48px;
  height: 48px;
  margin: -6px -10px 0 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  font-size: 28px;
  line-height: 1;
}
.su-swaps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.su-swap { font-size: 15px; padding: 8px 12px; }
.su-note { padding: 12px 14px; border-radius: 16px; background: var(--su-note); font-size: 16px; line-height: 1.4; color: var(--ink-soft); }
.su-promises { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.su-promises li { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; line-height: 1.35; }
.su-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 14px 16px;
  border: 3px solid var(--su-line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.su-toggle b { display: block; font-size: 17px; font-weight: 600; }
.su-toggle small { display: block; font-size: 15px; color: var(--ink-soft); }
.su-switch { position: relative; flex: none; width: 54px; height: 32px; border-radius: 999px; background: var(--su-line); transition: background 0.15s; }
.su-switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.su-toggle[aria-checked='true'] .su-switch { background: var(--mint); }
.su-toggle[aria-checked='true'] .su-switch::after { transform: translateX(22px); }

/* The explainer's two buddies, small, at the loop's lower corners. */
.su .lx-stage .su-mini { position: absolute; bottom: -6px; pointer-events: none; }
.su .lx-stage .su-mini-palace { left: 0; }
.su .lx-stage .su-mini-town { right: 0; }
.su .lx-stage .mascot-svg { animation: none; }

/* The hand-off: the child's world */
.su-kid { border-color: #fff; }
.su-kid-palace { background: linear-gradient(180deg, #ffe0ee 0%, #f3e6ff 60%, #e6f0ff 100%); }
.su-kid-town { background: linear-gradient(180deg, #dff1ff 0%, #e8f7e8 60%, #fff3d6 100%); }
.su-kid .su-sub { color: var(--ink); font-size: 19px; }
.su-play {
  --b: #ff5fa2;
  --d: #e0408a;
  width: 150px;
  height: 150px;
  margin: 6px 0;
  padding: 0 0 0 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 6px solid #fff;
  background: var(--b);
  color: #fff;
  font-size: 64px;
  line-height: 1;
  box-shadow: 0 8px 0 var(--d), 0 16px 30px rgba(0, 0, 0, 0.14);
  animation: su-pulse 2.2s ease-in-out infinite;
  transition: transform 0.08s;
}
.su-kid-town .su-play { --b: #3d8bff; --d: #246ad8; }
.su-play:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--d); }
@keyframes su-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.05; } }
.su-kid .su-link { color: var(--ink); }

/* The starting card */
.su-strand { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 var(--su-chip-shadow); }
.su-strand-name { font-size: 19px; font-weight: 600; }
.su-prow { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border-radius: 16px; background: #fbf8fd; font-size: 16px; line-height: 1.35; }
.su-prow b { font-weight: 600; }
.su-prow-start { background: var(--pink-soft); outline: 3px solid var(--pink); outline-offset: -3px; }
.su-pill { padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.su-pill-known { background: var(--su-known-soft); color: var(--su-known); }
.su-pill-start { background: #fff; color: var(--pink-deep); }
.su-ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.su-ladder-dots { display: flex; gap: 6px; }
.su-ladder-dots i { width: 15px; height: 15px; border-radius: 50%; background: var(--su-line); }
.su-ladder-dots i.done { background: var(--mint); }
.su-ladder-dots i.now { background: #fff; box-shadow: inset 0 0 0 4px var(--pink); }
.su-headstart { font-size: 15px; font-weight: 600; }
.su-wait { padding: 14px; border-radius: 16px; background: var(--su-note); color: var(--ink); }

/* How much time a day */
.su-nudge { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 4px; border-radius: 20px; background: var(--su-note); }
.su-nudge-icon { font-size: 26px; line-height: 1.2; }
.su-nudge b { display: block; font-size: 17px; font-weight: 600; }
.su-nudge small { display: block; font-size: 15px; color: var(--ink-soft); }

/* "Ava's plan is ready" */
.su-summary { width: 100%; margin: 0; padding: 4px 16px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 var(--su-chip-shadow); text-align: left; }
.su-summary div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 2px solid var(--su-line); font-size: 16px; }
.su-summary div:first-child { border-top: 0; }
.su-summary dt { color: var(--ink-soft); }
.su-summary dd { margin: 0; font-weight: 600; text-align: right; }

/* The picker's Done stays in reach on a long list. */
.su-sticky { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 2; }

@media (max-width: 420px) {
  .su-panel { padding: 18px 14px 16px; gap: 14px; }
  .su-chip.su-age { font-size: 26px; padding: 14px 0; }
  .su-foot .btn-big { font-size: 23px; padding-inline: 18px; }
  .su-chip { font-size: 16px; padding: 10px 13px; }
  .su-rows, .su-summary { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .su, .su-play, .su-ellipsis::after { animation: none; }
  .su-ellipsis::after { width: auto; }
}

/* ——— "See all skills" (js/skill-picker.js): strands as short ladders ——— */

.sp { display: flex; flex-direction: column; gap: 10px; }
.sp-cap { font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.sp-strand { border-radius: 20px; background: #fff; box-shadow: 0 4px 0 var(--su-chip-shadow); }
.sp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 16px;
  list-style: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
}
.sp-head::-webkit-details-marker { display: none; }
.sp-head::after { content: '›'; margin-left: auto; font-size: 26px; color: var(--ink-soft); transition: transform 0.15s; }
.sp-strand[open] > .sp-head::after { transform: rotate(90deg); }
.sp-icon { font-size: 22px; }
.sp-count { min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--lilac-soft); color: var(--lilac-deep); font-size: 15px; text-align: center; }
.sp-ladder { list-style: none; margin: 0; padding: 0 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sp-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 3px solid var(--su-line);
  background: #fff;
  cursor: pointer;
}
.sp-chip input { position: absolute; opacity: 0; pointer-events: none; }
.sp-chip::before {
  content: '';
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 3px solid var(--su-line);
  background: #fff;
}
.sp-chip.sp-on { border-color: var(--lilac); background: var(--lilac-soft); }
.sp-chip.sp-on::before { content: '✓'; display: grid; place-items: center; border-color: var(--lilac); background: var(--lilac); color: #fff; font-size: 15px; font-weight: 700; }
.sp-chip:has(input:disabled) { opacity: 0.45; cursor: default; }
.sp-chip:has(input:focus-visible) { outline: 4px solid var(--lilac); outline-offset: 2px; }
.sp-text { display: flex; flex-direction: column; min-width: 0; }
.sp-text b { font-size: 17px; font-weight: 600; line-height: 1.25; }
.sp-text small { font-size: 14px; color: var(--ink-soft); }

/* ——— On "Who's playing?" (js/screens/profiles.js) ——— */

.su-loop-btn {
  display: block;
  min-height: 52px;
  margin: 26px auto 0;
  padding: 10px 24px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--card);
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  box-shadow: 0 5px 0 #e6e0ee, var(--shadow);
  transition: transform 0.1s;
}
.su-loop-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #e6e0ee; }
.su-loop-btn:not([hidden]) + .link-btn { margin-top: 14px; }
.su-plan-line { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 500; }

/* The check: one card a screen, "Strong" or "Needs work" on each skill
   (js/screens/setup.js checkStep). Big taps for a grown-up's thumb, no dropdowns. */
.su-card-name { margin: 0 0 4px; font-weight: 700; font-size: 17px; color: var(--lilac-deep, #7d58d6); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.su-card-name small { font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.su-marks { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; gap: 12px; }
.su-mark { background: #fff; border: 3px solid var(--su-line); border-radius: 20px; padding: 12px 14px; display: grid; gap: 10px; }
.su-mark-text { display: grid; gap: 2px; }
.su-mark-text b { font-size: 18px; }
.su-mark-text span { font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
.su-mark-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.su-pill-btn {
  min-height: 48px; padding: 8px 10px; border-radius: 999px; border: 3px solid var(--su-line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  box-shadow: 0 3px 0 var(--su-chip-shadow);
}
.su-pill-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--su-chip-shadow); }
.su-strong[aria-pressed='true'] { border-color: var(--mint-deep, #22a37f); background: #e3f8f1; box-shadow: 0 3px 0 var(--mint-deep, #22a37f); }
.su-need[aria-pressed='true'] { border-color: var(--lilac); background: var(--lilac-soft); box-shadow: 0 3px 0 var(--lilac); }
.su-later small, .su-strongs small { color: var(--ink-soft); font-size: 14px; }
@media (min-width: 700px) {
  .su-mark { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .su-mark-pills { min-width: 300px; }
}
