/* Spec 017: kid profiles in the grown-ups area. Colours are tokens only (tokens.css). */

/* Spec 148: every row is as tall as the tallest (a grid of equal rows), whoever is active and however the words wrap. */
.kid-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-rows: 1fr;
  gap: var(--space-3);
}

.kid-list > li {
  display: flex;
}

/* Spec 063: the row is one button: a tap, a click or Enter anywhere on it opens the profile. */
.kid-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  min-height: var(--touch-kid);
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: var(--elevation-raised);
}

.kid-row:hover,
.kid-row:active {
  background: var(--accent-soft);
}

/* Spec 148: the kid using Xocana now in this browser, as on the phone: an accent edge, a ring round the circle and a check
   on its corner. Each is a shadow or sits over the circle, so the row is exactly as big as the others. */
.kid-row.is-active {
  box-shadow: inset 0 0 0 3px var(--accent), var(--elevation-raised);
}

.kid-row.is-active .avatar {
  position: relative;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent);
}

.avatar .kid-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 26px;
  height: 26px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--surface);
}

.kid-words {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.kid-words strong {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

/* The initial on its crayon: a kid's own circle, 64 px like every kid target. */
.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--touch-kid);
  height: var(--touch-kid);
  border-radius: 50%;
  background: var(--crayon-purple);
  color: var(--on-crayon);
  font-weight: 700;
  font-size: 1.75rem;
}

.avatar-large {
  width: calc(var(--touch-kid) * 1.5);
  height: calc(var(--touch-kid) * 1.5);
  font-size: 2.5rem;
  align-self: center;
}

.avatar[data-color="purple"],
.swatch[data-color="purple"] .swatch-dot {
  background: var(--crayon-purple);
}

.avatar[data-color="yellow"],
.swatch[data-color="yellow"] .swatch-dot {
  background: var(--crayon-yellow);
}

.avatar[data-color="teal"],
.swatch[data-color="teal"] .swatch-dot {
  background: var(--crayon-teal);
}

.avatar[data-color="pink"],
.swatch[data-color="pink"] .swatch-dot {
  background: var(--crayon-pink);
}

.avatar[data-color="blue"],
.swatch[data-color="blue"] .swatch-dot {
  background: var(--crayon-blue);
}

.avatar[data-color="green"],
.swatch[data-color="green"] .swatch-dot {
  background: var(--crayon-green);
}

.avatar[data-color="orange"],
.swatch[data-color="orange"] .swatch-dot {
  background: var(--crayon-orange);
}

.avatar[data-color="red"],
.swatch[data-color="red"] .swatch-dot {
  background: var(--crayon-red);
}

.kid-add {
  min-height: var(--touch-kid);
  align-self: flex-start;
}

.kid-editor fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.kid-editor legend {
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.swatch {
  position: relative;
  cursor: pointer;
}

.swatch-dot {
  display: block;
  width: var(--touch-kid);
  height: var(--touch-kid);
  border-radius: 50%;
  border: 4px solid transparent;
}

.swatch input:checked + .swatch-dot {
  border-color: var(--text);
}

.swatch input:focus-visible + .swatch-dot {
  outline: var(--focus-width, 3px) solid var(--focus);
  outline-offset: 2px;
}

.consent-card h3 {
  margin: var(--space-2) 0 0;
}

.consent-card p {
  margin: 0;
}

/* Spec 083: what a profile is, on /app/kids (spec 169 took it off Settings, whose Kid profiles row opens this page).
   Tokens only. */
.kids-about {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.kids-about p {
  margin: 0;
}

/* Spec 169: Settings' KIDS card starts with the family's kids, each circle a link to the kid's profile (the kid using Xocana
   now ringed, as in the kid profiles list), and "Add a kid" as the last circle, a "+" on the soft accent. Each is a 48 px
   wide target or more; a name wraps under its circle rather than widen the card at 320 px. */
.kid-circles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-1) var(--space-3);
  list-style: none;
}

.kid-chip {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  width: calc(var(--touch-kid) + var(--space-4));
  min-height: var(--space-7);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.kid-chip:hover,
.kid-chip:active {
  background: var(--accent-soft);
}

.kid-chip.is-active .avatar {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent);
}

.kid-chip-add .avatar {
  box-sizing: border-box;
  border: 2px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.75rem;
  line-height: 1;
}

.avatar-small {
  width: var(--space-7);
  height: var(--space-7);
  font-size: 1.25rem;
}

.kid-chip-name {
  max-width: 100%;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Spec 111: a kid's row says "Edit" with a pencil (the whole row stays the button). */
.row-edit {
  pointer-events: none;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-inline-start: auto;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text);
}

.row-edit .icon {
  width: 22px;
  height: 22px;
}

/* Spec 165: whose Xocana it is, in Home's header beside "My orders" and the gear (the phone's top bar, spec 083): the
   kid's circle, the initial on their crayon in dark ink (--on-crayon, checked on every crayon in light, dark and Moon),
   ringed in the header's own white so it reads on every theme's gradient; one 44 px target. The chevron's little badge
   shows while there is a choice. Tokens only. */
.nav-kid {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--touch-standard);
  height: var(--touch-standard);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--on-nav);
  font: inherit;
  cursor: pointer;
}

.nav-kid[hidden] {
  display: none;
}

/* Home is where the circle shows. On a narrow screen its Home pill gives way to it (Home is the page on screen, and the
   phone's Home has no Home button), so the wordmark, the circle, "My orders" and the gear fit one line down to 320 px in
   every language; the wordmark is never cut. */
@media (max-width: 440px) {
  .nav-group.with-kid > a[href="/app"] {
    display: none;
  }
}

.nav-kid .nav-kid-avatar {
  width: var(--touch-standard);
  height: var(--touch-standard);
  font-size: 1.375rem;
  line-height: 1;
  box-shadow: inset 0 0 0 3px var(--on-nav);
}

.nav-kid:hover .nav-kid-avatar {
  box-shadow: inset 0 0 0 3px var(--on-nav), 0 0 0 2px var(--on-nav);
}

.nav-kid:focus-visible {
  outline: 3px solid var(--on-nav);
  outline-offset: 2px;
}

.nav-kid-more {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-purple);
  box-shadow: 0 0 0 1.5px var(--hairline);
}

.nav-kid-more[hidden] {
  display: none;
}

.nav-kid-more .icon {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
}

/* "Who's using Xocana?": the kids two across and big (the phone's TileGrid), a third centred under the first two; every
   card the same size whoever is using Xocana now (spec 148): the ring, the check and the accent edge take no room. */
.kid-picker {
  max-width: 480px;
}

.kid-picker-prompt {
  margin: 0;
  text-align: center;
  font-size: var(--font-lg);
  font-weight: 700;
}

.kid-picker-list {
  list-style: none;
  margin: 0;
  padding: var(--space-1);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.kid-picker-list > li {
  display: flex;
  flex: 0 1 calc(50% - var(--space-3) / 2);
  min-width: 0;
}

.kid-picker-list.is-one > li {
  flex-basis: 60%;
}

.kid-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: calc(var(--touch-kid) * 2.5);
  padding: var(--space-4) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--hairline), var(--elevation-raised);
}

.kid-pick:hover,
.kid-pick:active {
  background: var(--accent-soft);
}

.kid-pick:focus-visible {
  outline: var(--focus-width, 3px) solid var(--focus);
  outline-offset: 2px;
}

.kid-pick.is-active {
  box-shadow: inset 0 0 0 4px var(--accent), var(--elevation-raised);
}

.avatar-pick {
  position: relative;
  width: 80px;
  height: 80px;
  font-size: 2.375rem;
}

.kid-pick.is-active .avatar-pick {
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--accent);
}

.avatar-pick .kid-badge {
  width: 32px;
  height: 32px;
  padding: 5px;
}

.kid-pick-name {
  max-width: 100%;
  font-size: var(--font-lg);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.kid-picker-about {
  margin: 0;
  padding: var(--space-4);
}

.kid-picker-about p {
  margin: 0;
  font-size: var(--font-md);
}

.kid-picker-about .button {
  align-self: flex-start;
  min-height: var(--touch-kid);
}

/* /app/kids: how the website switches, and the button that opens the same card. */
.kids-switch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.kids-switch[hidden] {
  display: none;
}

.kids-switch p {
  margin: 0;
}

/* Spec 175 (the owner, 2026-10-15: "Make 'The Family plan' more impactful, a nice UI"): the Family card on Free, in spec
   141's pitch style: the rainbow edge of the header, an orange family chip and the headline, one line, the perks each in
   its crayon circle, then the price and Get Family. On a wide screen the perks sit two a row and the price beside the
   pill, so the card uses the page's width; at 320 px and in German everything wraps. Tokens only, so light, dark, Moon
   and the holiday themes repaint it. */
.kids-family[hidden],
.family-card-checkout[hidden] {
  display: none;
}

.family-card {
  position: relative;
  overflow: hidden;
  gap: var(--space-4);
  margin-bottom: 0;
  padding-top: calc(var(--space-5) + 6px);
}

.family-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--gradient-rainbow);
}

.family-card:focus {
  outline: none;
}

.family-card:focus-visible {
  outline: var(--focus-width, 3px) solid var(--focus);
  outline-offset: 2px;
}

.family-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.family-card-head h2 {
  margin: 0;
  font-size: var(--font-xl);
  line-height: 1.2;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.family-card-chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--crayon-orange);
  color: var(--on-crayon);
}

.family-card-chip .icon {
  width: 32px;
  height: 32px;
}

.family-card .family-card-line {
  margin: 0;
  color: var(--text-secondary);
}

.family-card-perks {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.family-card-perks li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  font-weight: 600;
}

.family-card-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--on-crayon);
}

.family-card-dot .icon {
  width: 24px;
  height: 24px;
}

.family-card-dot[data-crayon="orange"] { background: var(--crayon-orange); }
.family-card-dot[data-crayon="blue"] { background: var(--crayon-blue); }
.family-card-dot[data-crayon="pink"] { background: var(--crayon-pink); }
.family-card-dot[data-crayon="green"] { background: var(--crayon-green); }

.family-card-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 2px solid var(--hairline);
}

.family-card-price {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: var(--font-md);
}

.family-card-get,
.family-card-checkout .button {
  min-height: var(--touch-kid);
}

.family-card-checkout {
  flex-wrap: wrap;
  gap: var(--space-2);
}

.family-card-checkout .button {
  flex: 1 1 12rem;
}

@media (min-width: 720px) {
  .family-card-perks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-5);
  }

  .family-card-foot {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .family-card-price {
    text-align: left;
  }

  .family-card-get {
    min-width: 14rem;
  }
}
