/* =========================================================================
   parent.css — Kido Parent Zone + the grown-up gate (Change #9)
   Kido's colours and display font, but calmer: a readable system font for
   body text, hairline dividers, few cards, restrained motion.
   Phones: full-screen sheet, one section at a time.  ≥ 900px: side rail.
   ========================================================================= */

/* ---------------- gate ---------------- */
.pk-gate { max-width: 400px; text-align: center; }
.pk-gate__title { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 24px; color: var(--ink); }
.pk-gate__title .pk-ico { width: 26px; height: 26px; color: var(--grape); }
.pk-gate__help { margin: 6px 0 4px; color: var(--ink-soft); font-size: 16px; }
.pk-gate__q { margin: 10px 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--ink); }
.pk-gate__input {
  width: 100%; font-size: 26px; text-align: center; padding: 10px 12px; border-radius: 16px;
  border: 3px solid #CFC4F3; font-family: var(--font-display); color: var(--ink); background: #fff;
}
.pk-gate__input:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; border-color: var(--grape); }
.pk-gate__msg { min-height: 22px; margin: 8px 0 0; color: #8A2C3F; font-size: 15px; }
.pk-gate__actions { display: grid; gap: 10px; margin-top: 12px; }

/* ---------------- layer + shell ---------------- */
.modal-layer.is-zone { padding: 0; place-items: stretch; background: rgba(28, 22, 52, .55); }
.pk {
  --pk-ink: #241C45; --pk-soft: #5B547A; --pk-line: #E5E0F0; --pk-bg: #F6F4FA; --pk-card: #FFFFFF;
  --pk-accent: #5B3CC4; --pk-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; overflow: hidden;
  background: var(--pk-bg); color: var(--pk-ink); font-family: var(--pk-font); font-size: 16px; line-height: 1.45;
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: default;   /* grown-ups keep copy / paste */
  animation: pk-in .18s ease-out;
}
body.big-text .pk { font-size: 18px; }
@keyframes pk-in { from { opacity: 0; } to { opacity: 1; } }
.pk [hidden] { display: none !important; }
.pk h1, .pk h2, .pk h3 { font-family: var(--font-display); color: var(--pk-ink); margin: 0; line-height: 1.2; }
.pk p { margin: 0; }
.pk :focus-visible { outline: 3px solid var(--pk-accent); outline-offset: 2px; }
.pk .pk-title:focus, .pk .pk-title:focus-visible { outline: none; }   /* focused only so screen readers announce the section */

.pk-ico { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.pk-head {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 8px 10px; padding-top: calc(8px + var(--kido-sa-top));   /* Change #28: below the status bar */
  padding-left: max(10px, var(--kido-sa-left)); padding-right: max(10px, var(--kido-sa-right));   /* …and clear of a side camera cutout */
  background: var(--pk-card); border-bottom: 1px solid var(--pk-line);
}
.pk-iconbtn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--pk-ink); flex: 0 0 auto; }
.pk-iconbtn:hover { background: var(--pk-bg); }
.pk-brand { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: #FFE9D6; }
.pk-brand svg, .pk-avatar svg { width: 100%; height: 100%; display: block; }
.pk-head__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pk-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pk-accent); }
.pk-title { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; }

.pk-body { flex: 1 1 auto; min-height: 0; display: flex; padding-left: var(--kido-sa-left); padding-right: var(--kido-sa-right); }
.pk-rail { display: none; }
.pk-main { flex: 1 1 auto; min-width: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 16px; padding-bottom: max(28px, var(--kido-sa-bottom)); }
.pk-view { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

/* ---------------- building blocks ---------------- */
.pk-block { background: var(--pk-card); border: 1px solid var(--pk-line); border-radius: 16px; padding: 14px 16px; }
.pk-block__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; min-height: 32px; }
.pk-block__head h2 { font-size: 18px; }
.pk-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 2px 0 8px; margin: -6px -4px -6px 0;
  color: var(--pk-accent); font-family: var(--pk-font); font-weight: 600; font-size: 15px; border-radius: 10px; white-space: nowrap; }
.pk-link .pk-ico { width: 18px; height: 18px; }
.pk-view > .pk-link { align-self: flex-start; margin: 0; }
.pk-link:hover { background: var(--pk-bg); }
.pk-text { color: var(--pk-ink); }
.pk-text + .pk-text { margin-top: 8px; }
.pk-text--soft { color: var(--pk-soft); margin-top: 6px; }
.pk-text--strong { font-weight: 700; margin-top: 10px; }
.pk-text--warn { font-weight: 700; color: #8A2C3F; margin-top: 10px; }
.pk-intro { color: var(--pk-soft); }
.pk-note { color: var(--pk-soft); font-size: 14px; }
.pk-empty { color: var(--pk-soft); padding: 2px 0; }

.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 4px 0 0; padding: 0; }
.pk-chip { padding: 6px 12px; border-radius: 999px; background: var(--pk-bg); border: 1px solid var(--pk-line); font-weight: 600; font-size: 15px; }
.pk-chips--summary { margin: 0; }
.pk-chips--summary .pk-chip { background: var(--pk-card); }

.pk-list { list-style: none; margin: 0; padding: 0; }
.pk-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--pk-line); }
.pk-list > .pk-row:first-child { border-top: 0; }
.pk-row--tight { padding: 8px 0; }
.pk-row--skill { align-items: flex-start; }
.pk-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pk-row__title { font-weight: 600; overflow-wrap: anywhere; }
.pk-row__text { color: var(--pk-ink); font-size: 15px; }
.pk-row__meta { color: var(--pk-soft); font-size: 14px; }
.pk-row__extra { color: #6A4A00; font-size: 14px; }
.pk-kind { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
  background: #EEE9FB; color: var(--pk-accent); }
.pk-kind--story { background: #FDEFE4; color: #9A4B12; }
.pk-kind--discovery { background: #E4F4EC; color: #1F6B45; }
.pk-kind--game { background: #FFF4D6; color: #7A5300; }
.pk-kind--reward { background: #FDE8EE; color: #9B2C4C; }
.pk-day { font-family: var(--pk-font); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pk-soft); margin: 12px 0 2px; }
.pk-block__head + .pk-day { margin-top: 2px; }
.pk-emoji { font-size: 24px; line-height: 1; width: 38px; text-align: center; flex: 0 0 auto; }

/* Descriptive state pills: words carry the meaning; colour only supports it. */
.pk-pill { flex: 0 0 auto; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent; background: #EFEDF5; color: #3F3A5A; }
.pk-pill--growing { background: #EEE9FB; color: #4A2FB0; border-color: #DCD2F7; }
.pk-pill--strong, .pk-pill--complete { background: #E3F4EA; color: #1C6A3F; border-color: #C8E8D5; }
.pk-pill--practicing, .pk-pill--in-progress { background: #FFF2D9; color: #7A4B00; border-color: #F5DFB0; }
.pk-pill--start, .pk-pill--not-started { background: #F0EEF5; color: #4A4566; border-color: #E2DEEC; }

/* ---------------- overview ---------------- */
.pk-profile { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px;
  background: var(--pk-card); border: 1px solid var(--pk-line); border-radius: 16px; font-family: var(--pk-font); color: var(--pk-ink); }
.pk-profile:hover { border-color: #CFC4F3; }
.pk-avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #FFE9D6; flex: 0 0 auto; }
.pk-avatar--lg { width: 72px; height: 72px; }
.pk-profile__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pk-profile__name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.pk-profile__meta { color: var(--pk-soft); font-size: 15px; }
.pk-profile__go, .pk-more__go { color: var(--pk-soft); }

.pk-more { display: flex; flex-direction: column; background: var(--pk-card); border: 1px solid var(--pk-line); border-radius: 16px; padding: 4px 12px; }
.pk-more__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; min-height: 56px; text-align: left;
  border-top: 1px solid var(--pk-line); font-family: var(--pk-font); color: var(--pk-ink); }
.pk-more__item:first-child { border-top: 0; }

/* ---------------- profile ---------------- */
.pk-hero { display: flex; align-items: center; gap: 16px; }
.pk-hero__name { font-size: 22px; }
.pk-facts { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; margin: 4px 0 14px; }
.pk-facts dt { color: var(--pk-soft); }
.pk-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------------- rewards ---------------- */
.pk-stickers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.pk-sticker { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; background: var(--pk-bg); text-align: center; }
.pk-sticker__name { font-size: 12px; color: var(--pk-soft); line-height: 1.2; overflow-wrap: anywhere; }

/* ---------------- settings ---------------- */
.pk-field { padding: 8px 0 12px; }
.pk-field + .pk-field { border-top: 1px solid var(--pk-line); padding-top: 12px; }
.pk-field__label { display: block; font-weight: 700; margin-bottom: 6px; }
.pk-field__help { color: var(--pk-soft); font-size: 14px; margin-top: 6px; }
.pk-input { width: 100%; max-width: 420px; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 2px solid #D8D0F0;
  background: #fff; color: var(--pk-ink); font-family: var(--pk-font); font-size: 17px; }
.pk-input:focus-visible { border-color: var(--pk-accent); }
.pk .sound-panel { margin: 0; padding: 0; background: none; }
.pk .modal__row { font-family: var(--pk-font); }
.pk .modal__label { font-weight: 600; }
.pk .modal__label small { font-size: 13px; color: var(--pk-soft); }
.pk .switch input:focus-visible + .switch__track { outline: 3px solid var(--pk-accent); outline-offset: 2px; }
.pk-btn { font-family: var(--pk-font); font-size: 16px; font-weight: 700; min-height: 48px; padding: 0 20px; box-shadow: none; margin-top: 6px; }
.pk-btn.btn--ghost { background: var(--pk-bg); color: var(--pk-accent); border: 1px solid var(--pk-line); }
.pk-btn--danger { background: #B4233D; color: #FFFFFF; }
.pk-confirm { margin-top: 10px; padding: 12px; border-radius: 12px; background: #FFF6F7; border: 1px solid #F3D3DA; }
.pk-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.pk-actions .pk-btn { margin-top: 0; }

/* ---------------- dialog + status ---------------- */
.pk-dialog-wrap { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(28, 22, 52, .45); }
.pk-dialog { width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; background: #FFFFFF; border-radius: 18px; padding: 20px;
  box-shadow: 0 20px 60px rgba(20, 14, 40, .35); }
.pk-dialog h2 { font-size: 21px; margin-bottom: 6px; }
.pk-bullets { margin: 6px 0 0; padding-left: 20px; }
.pk-bullets li { margin: 3px 0; }
.pk-status { position: absolute; left: 50%; bottom: max(16px, var(--kido-sa-bottom)); z-index: 6; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: #241C45; color: #FFFFFF; font-weight: 600; text-align: center;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.pk-status.is-on { opacity: 1; transform: translate(-50%, 0); }

/* High contrast: firmer lines everywhere. */
.high-contrast .pk { --pk-line: #8E86AE; --pk-soft: #3B3557; }
.high-contrast .pk-pill { border-color: currentColor; }

/* Reduced motion. */
.reduce-motion .pk, .reduce-motion .pk-status { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) { .pk, .pk-status { animation: none; transition: none; } }

/* ---------------- wider screens: a side rail, the panel floats ---------------- */
@media (min-width: 900px) {
  .modal-layer.is-zone { padding: 24px; place-items: center; }
  .pk { width: min(1120px, 100%); height: min(880px, 100%); border-radius: 22px; box-shadow: 0 30px 80px rgba(20, 14, 40, .35); }
  .pk-head { padding: 12px 18px; }   /* the floating panel already sits inside the layer's 24px (>= status bar) */
  .pk-back { display: none !important; }
  .pk-rail { display: flex; flex-direction: column; gap: 2px; width: 248px; flex: 0 0 auto; padding: 14px 10px; overflow-y: auto;
    background: var(--pk-card); border-right: 1px solid var(--pk-line); }
  .pk-rail__item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; text-align: left;
    font-family: var(--pk-font); font-weight: 600; font-size: 15px; color: var(--pk-ink); }
  .pk-rail__item:hover { background: var(--pk-bg); }
  .pk-rail__item[aria-current="page"] { background: #EEE9FB; color: var(--pk-accent); }
  .pk-more { display: none; }
  .pk-main { padding: 24px 28px 32px; }
  .pk-view { max-width: 820px; }
  .pk-view--home { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .pk-view--home > .pk-profile, .pk-view--home > .pk-block:nth-of-type(3) { grid-column: 1 / -1; }
}

/* Short landscape phones: a slimmer header leaves room for content. */
@media (max-height: 460px) {
  .pk-head { padding-top: calc(4px + var(--kido-sa-top)); padding-bottom: 4px; }
  .pk-kicker { display: none; }
  .pk-main { padding-top: 10px; }
  /* the grown-up gate fits a 360px-tall phone without scrolling: buttons side by side, tighter question */
  .pk-gate { padding: 14px 20px; }
  .pk-gate__help { margin: 2px 0 0; font-size: 14px; }
  .pk-gate__q { margin: 4px 0; font-size: 26px; }
  .pk-gate__input { padding-top: 6px; padding-bottom: 6px; }
  .pk-gate__msg { min-height: 18px; margin-top: 4px; font-size: 14px; }
  .pk-gate__actions { grid-template-columns: 1fr 1fr; margin-top: 6px; }
}
