/*
  Hallpass parent app.
  Colors, radii, shadows, motion and fonts come from design/tokens.css (--hp-*). The few values
  below are mixes of those tokens. Spacing is on a 4px grid. The type scale is the website's
  (type-display, type-h2, type-h3, type-label), sized for a 560px column.
*/

:root {
  --gutter: 16px;
  --column: 560px;
  --bar-h: 56px;
  --hover: color-mix(in srgb, var(--hp-ink) 6%, transparent);
  --press: color-mix(in srgb, var(--hp-ink) 11%, transparent);
  --glow: color-mix(in srgb, var(--hp-focus) 18%, transparent);
  --sk: color-mix(in srgb, var(--hp-ink) 7%, transparent);
  --sk-hi: color-mix(in srgb, var(--hp-ink) 3%, transparent);
  --pass-ring: var(--hp-calm);
  --on-accent: var(--hp-night);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pass-ring: color-mix(in srgb, var(--hp-calm) 16%, transparent);
  }
}
:root[data-theme="dark"] {
  --pass-ring: color-mix(in srgb, var(--hp-calm) 16%, transparent);
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--bar-h) + 16px);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--hp-bg);
  color: var(--hp-ink);
  font-family: var(--hp-font-sans);
  font-size: 1rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg { flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { background: var(--hp-lime); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--hp-focus);
  outline-offset: 2px;
}
h1:focus, main:focus, [tabindex="-1"]:focus { outline: none; }

.num { font-variant-numeric: tabular-nums; }

/* Type */

.t-display {
  font-family: var(--hp-font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.t-h2 {
  font-weight: 620;
  font-size: clamp(1.75rem, 1.45rem + 1.3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.028em;
}
.t-h3 {
  font-weight: 620;
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.012em;
}
.t-label {
  font-size: 0.8125rem;
  font-weight: 560;
  letter-spacing: 0.005em;
  line-height: 1.3;
  color: var(--hp-ink-2);
}
.t-lead {
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  line-height: 1.55;
  letter-spacing: -0.006em;
  color: var(--hp-ink-2);
}
.t-body { font-size: 1rem; line-height: 1.5; }
.t-small { font-size: 0.875rem; line-height: 1.45; color: var(--hp-ink-2); }
.t-fine { font-size: 0.8125rem; line-height: 1.4; color: var(--hp-ink-3); }
.ink-2 { color: var(--hp-ink-2); }

/* Shell */

.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-strong);
  color: var(--hp-on-strong);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--hp-fast) var(--hp-ease-out);
}
.skip:focus-visible { transform: none; }

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: var(--hp-bg);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow var(--hp-base) var(--hp-ease-out);
}
.bar.is-scrolled { box-shadow: 0 1px 0 var(--hp-rule); }
.bar-in {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--bar-h);
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-left: -4px;
  padding: 0 8px 0 4px;
  border-radius: var(--hp-radius-sm);
  text-decoration: none;
}
.wordmark {
  font-size: 1.1875rem;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1;
}
.logo { display: block; border-radius: 8px; }
.bar-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-calm);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.bar-settings { margin-left: auto; margin-right: -10px; }
body[data-bare="true"] .bar-settings { visibility: hidden; }

main {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
.view.is-entering { animation: view-in var(--hp-base) var(--hp-ease-out); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.wrap {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.stack > * + * { margin-top: var(--gap, 16px); }

.page-head { padding-top: 12px; padding-bottom: 24px; }
.page-top { padding-top: 12px; padding-bottom: 4px; }
.page-head .t-h2, .page-head .t-display { margin-top: 4px; }
.page-head > p { margin-top: 8px; }

.section { margin-top: 40px; }
.section:first-child { margin-top: 0; }
.wrap > .page-head ~ section.section:first-of-type { margin-top: 8px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 12px;
}
.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-surface);
  color: var(--hp-ink-2);
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.count.is-on { background: var(--hp-calm); color: var(--on-accent); }

/* Buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--hp-radius-pill);
  background: transparent;
  color: var(--hp-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background-color var(--hp-fast) var(--hp-ease-out), box-shadow var(--hp-fast) var(--hp-ease-out), transform var(--hp-fast) var(--hp-ease-out), color var(--hp-fast) var(--hp-ease-out), opacity var(--hp-fast) var(--hp-ease-out);
}
.btn .icon { margin-inline: -2px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.5; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }

.btn-primary { background: var(--hp-primary); color: var(--hp-on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--hp-primary-hover); }
.btn-primary:active:not(:disabled) { box-shadow: 0 0 0 4px var(--glow); }

.btn-strong { background: var(--hp-strong); color: var(--hp-on-strong); }
.btn-strong:hover:not(:disabled) { background: var(--hp-strong-hover); }

.btn-secondary { background: var(--hp-card); box-shadow: inset 0 0 0 1px var(--hp-rule); }
.btn-secondary:hover:not(:disabled) { background: var(--hp-surface); }
.btn-secondary:active:not(:disabled) { background: var(--hp-surface); box-shadow: inset 0 0 0 1px var(--hp-ink-3); }

.btn-quiet { color: var(--hp-ink-2); padding-inline: 12px; }
.btn-quiet:hover:not(:disabled) { background: var(--hp-surface); color: var(--hp-ink); }
.btn-quiet:active:not(:disabled) { background: var(--press); }

.btn-danger { color: var(--hp-danger); box-shadow: inset 0 0 0 1px currentColor; }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--hp-danger) 9%, transparent); }
.btn-danger:active:not(:disabled) { background: color-mix(in srgb, var(--hp-danger) 15%, transparent); }
.btn-danger-solid { background: var(--hp-danger); color: var(--hp-bg); }
.btn-danger-solid:hover:not(:disabled) { background: color-mix(in srgb, var(--hp-danger) 88%, var(--hp-ink)); }

.btn-lg { min-height: 52px; padding-inline: 24px; font-size: 1rem; }
.btn-sm { padding-inline: 16px; font-size: 0.875rem; }
.btn-block { display: flex; width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--hp-radius-pill);
  background: transparent;
  color: var(--hp-ink-2);
  transition: background-color var(--hp-fast) var(--hp-ease-out), color var(--hp-fast) var(--hp-ease-out), transform var(--hp-fast) var(--hp-ease-out);
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--hp-ink); }
.icon-btn:active:not(:disabled) { background: var(--press); transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-left: -10px;
  padding: 0 14px 0 6px;
  border: 0;
  border-radius: var(--hp-radius-pill);
  background: transparent;
  color: var(--hp-ink-2);
  font-size: 0.9375rem;
  font-weight: 560;
  text-decoration: none;
  transition: background-color var(--hp-fast) var(--hp-ease-out), color var(--hp-fast) var(--hp-ease-out);
}
.back:hover { background: var(--hover); color: var(--hp-ink); }
.back:active { background: var(--press); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-stack { display: grid; gap: 8px; }

/* Forms */

.field { display: grid; gap: 8px; }
.field > label, .field > .label { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; }
.input, .textarea, .select {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--hp-radius);
  background: var(--hp-card);
  box-shadow: inset 0 0 0 1px var(--hp-rule);
  color: var(--hp-ink);
  font-size: 1.0625rem;
  line-height: 1.4;
  transition: box-shadow var(--hp-fast) var(--hp-ease-out), background-color var(--hp-fast) var(--hp-ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--hp-ink-3); opacity: 1; }
.input:hover, .textarea:hover, .select:hover { box-shadow: inset 0 0 0 1px var(--hp-ink-3); }
.input:focus, .textarea:focus, .select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--hp-focus), 0 0 0 4px var(--glow); }
.input:disabled, .textarea:disabled, .select:disabled { opacity: 0.6; cursor: not-allowed; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--hp-danger); }
.textarea { display: block; min-height: 132px; resize: vertical; font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.45; }
.select {
  appearance: none;
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--hp-ink-2) 50%), linear-gradient(135deg, var(--hp-ink-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 17px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.code-input {
  min-height: 64px;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.code-input::placeholder { letter-spacing: 0.2em; opacity: 0.45; }
.field-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.hint { font-size: 0.875rem; line-height: 1.45; color: var(--hp-ink-3); }
.field-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--hp-danger);
}
.field-error .icon { margin-top: 1px; }

/* Chips, avatars, status */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 12px 4px 10px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-surface);
  color: var(--hp-ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.chip .icon { width: 15px; height: 15px; }
.chip-yes { background: var(--hp-lime); color: var(--on-accent); }
.chip-calm { background: var(--hp-calm); color: var(--on-accent); }
.chip-line { background: transparent; box-shadow: inset 0 0 0 1px var(--hp-rule); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
}
.avatar-calm { background: var(--hp-calm); color: var(--on-accent); }
.avatar-yes { background: var(--hp-lime); color: var(--on-accent); }
.avatar-plain { background: var(--hp-surface); color: var(--hp-ink); box-shadow: inset 0 0 0 1px var(--hp-rule); }
.avatar.is-sm { width: 24px; height: 24px; font-size: 0.75rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--hp-ink-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--hp-ink-3) 45%, transparent); }
.status.is-on .dot { background: var(--hp-evergreen); box-shadow: 0 0 0 3px var(--hp-lime); }

/* Cards */

.card {
  position: relative;
  border-radius: var(--hp-radius-lg);
  background: var(--hp-card);
  box-shadow: inset 0 0 0 1px var(--hp-rule);
  padding: 20px;
}
.card-lift { box-shadow: inset 0 0 0 1px var(--hp-rule), var(--hp-shadow-card); }
.cards { display: grid; gap: 12px; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}
.card-head .who { flex: 1; min-width: 0; font-size: 0.9375rem; font-weight: 620; letter-spacing: -0.01em; }
.card-head time { flex-shrink: 0; font-size: 0.8125rem; font-weight: 500; color: var(--hp-ink-3); font-variant-numeric: tabular-nums; }

/* A pass request */
.pass { background: var(--hp-calm-soft); box-shadow: inset 0 0 0 1px var(--pass-ring); }
.pass-note {
  margin-top: 12px;
  font-size: 1.0625rem;
  font-weight: 560;
  line-height: 1.4;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}
.pass .chips { margin-top: 12px; }
.item {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--hp-radius);
  background: var(--hp-card);
}
.item-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--hp-surface);
  color: var(--hp-ink-2);
}
.item-text { min-width: 0; }
.item-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.item-sub { margin-top: 2px; font-size: 0.8125rem; color: var(--hp-ink-3); overflow-wrap: anywhere; }
.why { margin-top: 16px; }
.why-text { margin-top: 4px; font-size: 0.9375rem; line-height: 1.45; color: var(--hp-ink-2); }

.decide {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 8px;
  margin-top: 20px;
}
.decide .btn { padding-inline: 12px; }
.decide-hint { margin-top: 10px; font-size: 0.8125rem; line-height: 1.4; color: var(--hp-ink-3); }

.answer {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: var(--hp-radius);
  background: var(--hp-card);
  animation: answer-in var(--hp-base) var(--hp-ease-out);
}
.answer-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--hp-lime);
  color: var(--on-accent);
}
.answer.is-no .answer-mark { background: var(--hp-surface); color: var(--hp-ink-2); }
.answer-text { min-width: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.answer-text span { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--hp-ink-3); }
@keyframes answer-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.card-error { margin-top: 12px; }
.card-error .btn { margin-top: 8px; }

/* Leaving the list: the card folds away */
.fold {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--hp-slow) var(--hp-ease-out), opacity var(--hp-base) var(--hp-ease-out);
}
.fold > * { min-height: 0; overflow: hidden; }
.fold.is-gone { grid-template-rows: 0fr; opacity: 0; }

/* A suggestion */
.suggest-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--hp-lime);
  color: var(--on-accent);
}
.suggest-text { margin-top: 12px; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.suggest .actions { margin-top: 16px; }
.suggest .answer { margin-top: 16px; background: var(--hp-surface); }
.suggest .actions .btn { flex: 1 1 0; }
.suggest-foot { margin-top: 12px; font-size: 0.8125rem; color: var(--hp-ink-3); }

/* Filters (kid switcher) */

.filters {
  display: flex;
  gap: 8px;
  margin: 0 calc(-1 * var(--gutter)) 24px;
  padding: 2px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 8px;
  border: 0;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-card);
  box-shadow: inset 0 0 0 1px var(--hp-rule);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--hp-fast) var(--hp-ease-out), box-shadow var(--hp-fast) var(--hp-ease-out), transform var(--hp-fast) var(--hp-ease-out);
}
.filter.is-text { padding-left: 16px; }
.filter:hover { background: var(--hp-surface); }
.filter:active { transform: scale(0.97); }
.filter[aria-pressed="true"], .filter[aria-current="page"] { background: var(--hp-strong); color: var(--hp-on-strong); box-shadow: none; }
.filter .count { height: 20px; min-width: 20px; font-size: 0.6875rem; }
.filter[aria-pressed="true"] .count { background: color-mix(in srgb, var(--hp-on-strong) 18%, transparent); color: var(--hp-on-strong); }

/* Segmented control (stages) */

.seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-surface);
}
.seg button {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--hp-radius-pill);
  background: transparent;
  color: var(--hp-ink-2);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--hp-fast) var(--hp-ease-out), color var(--hp-fast) var(--hp-ease-out), box-shadow var(--hp-fast) var(--hp-ease-out);
}
.seg button:hover:not([aria-checked="true"]):not(:disabled) { background: var(--hover); color: var(--hp-ink); }
.seg button:active:not(:disabled) { background: var(--press); }
.seg button[aria-checked="true"] { background: var(--hp-card); color: var(--hp-ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--hp-ink) 12%, transparent), inset 0 0 0 1px var(--hp-rule); }
.seg button.is-picked { background: var(--hp-calm); color: var(--on-accent); }
.seg button:disabled { cursor: not-allowed; opacity: 0.6; }

/* Stage picker (setup) */

.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 16px;
  border: 0;
  border-radius: var(--hp-radius-lg);
  background: var(--hp-card);
  box-shadow: inset 0 0 0 1px var(--hp-rule);
  text-align: center;
  transition: box-shadow var(--hp-fast) var(--hp-ease-out), background-color var(--hp-fast) var(--hp-ease-out), transform var(--hp-fast) var(--hp-ease-out);
}
.stage:hover { box-shadow: inset 0 0 0 1px var(--hp-ink-3); }
.stage:active { transform: scale(0.98); }
.stage[aria-checked="true"] { background: var(--hp-calm-soft); box-shadow: inset 0 0 0 2px var(--hp-primary); }
.stage .akita { width: 100%; max-width: 132px; height: auto; aspect-ratio: 1; }
.stage-name { font-size: clamp(0.8125rem, 3.6vw, 0.9375rem); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.stage-line { font-size: 0.8125rem; line-height: 1.35; color: var(--hp-ink-2); }
.stage-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--hp-primary);
  color: var(--hp-on-primary);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--hp-fast) var(--hp-ease-out), transform var(--hp-base) var(--hp-ease-out);
}
.stage[aria-checked="true"] .stage-check { opacity: 1; transform: none; }

/* Setup progress */

.progress { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.progress-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; flex: 1; max-width: 160px; margin-left: auto; }
.progress-bars span { height: 4px; border-radius: 2px; background: var(--hp-rule); transition: background-color var(--hp-base) var(--hp-ease-out); }
.progress-bars span.is-done { background: var(--hp-primary); }
.progress-label { font-size: 0.8125rem; font-weight: 600; color: var(--hp-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Codes */

.code-panel { display: grid; gap: 16px; }
.code-box {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px 16px 20px;
  border-radius: var(--hp-radius-lg);
  background: var(--hp-card);
  box-shadow: inset 0 0 0 1px var(--hp-rule);
}
.code {
  display: flex;
  justify-content: center;
  gap: 0.32em;
  min-height: 1.15em;
  font-size: clamp(2.5rem, 11vw, 3.5rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "ss01";
  user-select: all;
}
.code span:last-child { margin-right: -0.12em; }
.code.is-loading { width: 100%; justify-content: center; }
.sk-code { display: block; width: min(260px, 80%); height: 1em; margin-block: 0.075em; border-radius: 10px; }
.code-panel.is-expired .code { opacity: 0.35; text-decoration: line-through; text-decoration-thickness: 2px; }
.code-left { font-size: 0.875rem; font-weight: 560; color: var(--hp-ink-3); font-variant-numeric: tabular-nums; }
.code-panel.is-expired .code-left { color: var(--hp-ink); }
.code-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.steps { display: grid; gap: 12px; counter-reset: step; }
.steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  counter-increment: step;
  font-size: 1rem;
  line-height: 1.45;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--hp-surface);
  color: var(--hp-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps .t-fine { display: block; margin-top: 2px; }

.waiting {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 16px 8px 8px;
  border-radius: var(--hp-radius-lg);
  background: var(--hp-calm-soft);
  font-size: 0.9375rem;
  font-weight: 560;
}
.waiting .akita { width: 56px; height: 56px; }

/* Empty, loading, notes */

.empty { display: grid; justify-items: center; gap: 4px; padding: 24px 16px 32px; text-align: center; }
.empty .akita { width: 168px; height: 168px; margin-bottom: 4px; }
.empty .t-h3 { margin-top: 4px; }
.empty p { max-width: 34ch; }

.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--sk) 0%, var(--sk-hi) 50%, var(--sk) 100%) 0 0 / 200% 100%;
  animation: sk 1.4s ease-in-out infinite;
}
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-line { height: 14px; }
.sk-line.is-lg { height: 20px; }
.sk-line.is-short { width: 40%; }
.days span.sk { background: linear-gradient(90deg, var(--sk) 0%, var(--sk-hi) 50%, var(--sk) 100%) 0 0 / 200% 100%; }
.kid-hero-sk { width: 112px; height: 112px; border-radius: 50%; }
.sk-card { height: 260px; border-radius: var(--hp-radius-lg); }
.sk-card.is-sm { height: 140px; }
.sk-row { height: 76px; border-radius: var(--hp-radius-lg); }
.sk-title { height: 36px; width: 60%; border-radius: 10px; }

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--hp-radius);
  background: var(--hp-surface);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.note .icon { margin-top: 1px; color: var(--hp-ink-2); }
.note-strong { font-weight: 620; }
.note.is-error { background: color-mix(in srgb, var(--hp-danger) 9%, var(--hp-card)); }
.note.is-error .icon { color: var(--hp-danger); }
.note .actions { margin-top: 12px; }

/* Home */

.home { display: grid; gap: 40px; }
.home-main { display: grid; gap: 24px; align-content: start; }
.home-main > .section { margin-top: 0; }
.home-main > .section + .section { margin-top: 16px; }
.home-main .filters { margin-bottom: 0; }
.greeting { padding-top: 12px; }
.greeting p { margin-top: 8px; }
.kid-rows { display: grid; gap: 8px; }
.kid-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 8px 12px 8px 8px;
  border-radius: var(--hp-radius-lg);
  background: var(--hp-card);
  box-shadow: inset 0 0 0 1px var(--hp-rule);
  text-decoration: none;
  transition: background-color var(--hp-fast) var(--hp-ease-out), box-shadow var(--hp-fast) var(--hp-ease-out), transform var(--hp-fast) var(--hp-ease-out);
}
.kid-row:hover { box-shadow: inset 0 0 0 1px var(--hp-ink-3); }
.kid-row:active { transform: scale(0.99); background: var(--hp-surface); }
.kid-row .akita { width: 60px; height: 60px; }
.kid-row-text { flex: 1; min-width: 0; }
.kid-row-name { font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.kid-row-sub { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 2px; font-size: 0.8125rem; color: var(--hp-ink-3); }
.kid-row-sub > span + span::before { content: "·"; margin-right: 6px; color: var(--hp-ink-3); }
.kid-row .icon { color: var(--hp-ink-3); }
.kid-row.is-add { min-height: 60px; padding-left: 16px; color: var(--hp-ink-2); font-weight: 600; box-shadow: inset 0 0 0 1px var(--hp-rule); background: transparent; }
.kid-row.is-add:hover { background: var(--hp-card); color: var(--hp-ink); }
.flag { display: inline-flex; align-items: center; gap: 4px; color: var(--hp-ink-2); font-weight: 600; }

/* Kid page */

.kid-page-switch { margin-bottom: 0; }
.kid-main { margin-top: 40px; }

.kid-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 0 8px;
}
.kid-hero .akita, .kid-hero-art { width: 112px; height: 112px; }
.kid-hero-art .akita { width: 100%; height: 100%; }
.kid-hero h1 { overflow-wrap: anywhere; }
.kid-hero .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; }
.name-form { display: grid; gap: 8px; margin-top: 8px; }
.name-form .actions .btn { flex: 1 1 auto; }
.title-row { display: flex; align-items: center; gap: 4px; }
.title-row .icon-btn { margin-right: -10px; }

.stage-box { display: grid; gap: 12px; }
.confirm {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--hp-radius);
  background: var(--hp-surface);
}
.confirm p { font-size: 0.9375rem; line-height: 1.45; }
.confirm .actions .btn { flex: 1 1 auto; }

.rule { display: grid; gap: 12px; }
.rule-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; margin-top: -6px; margin-right: -10px; }
.rule-words { font-size: 1.0625rem; font-weight: 560; line-height: 1.4; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.rule-kind { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 0.8125rem; font-weight: 600; color: var(--hp-ink-2); }
.rule-kind svg { flex: none; color: var(--hp-primary); }
.rule .confirm { margin-top: 4px; }
.channels .chip { min-height: 32px; }

/* Rule composer and reading */

.result:not(:empty) { margin-top: 24px; }
.starters { display: grid; gap: 8px; }
.starter {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--hp-radius);
  background: var(--hp-card);
  box-shadow: inset 0 0 0 1px var(--hp-rule);
  color: var(--hp-ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  transition: background-color var(--hp-fast) var(--hp-ease-out), box-shadow var(--hp-fast) var(--hp-ease-out), transform var(--hp-fast) var(--hp-ease-out);
}
.starter .icon { margin-left: auto; color: var(--hp-ink-3); }
.starter:hover:not(:disabled) { background: var(--hp-surface); }
.starter:active:not(:disabled) { transform: scale(0.99); }
.starter:disabled { opacity: 0.5; cursor: not-allowed; }
.starter[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--hp-primary); }

.reading { display: grid; gap: 16px; padding: 20px; border-radius: var(--hp-radius-lg); background: var(--hp-card); box-shadow: inset 0 0 0 1.5px var(--hp-primary), 0 0 0 4px var(--glow); }
.reading-summary { font-size: 1.1875rem; font-weight: 620; line-height: 1.35; letter-spacing: -0.014em; overflow-wrap: anywhere; }
.days { display: flex; gap: 6px; }
.days span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--hp-surface);
  color: var(--hp-ink-3);
  font-size: 0.8125rem;
  font-weight: 650;
}
.days span.is-on { background: var(--hp-primary); color: var(--hp-on-primary); }
.reading-rows { display: grid; gap: 12px; }
.reading-row { display: grid; gap: 8px; }
.reading-row > .chip { justify-self: start; }
.days span { flex: none; }
@media (min-width: 420px) {
  .reading-row { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; align-items: center; }
}
.reading-row > .t-label { color: var(--hp-ink-3); }
.reading .actions .btn { flex: 1 1 0; }
.sk-reading { display: grid; gap: 16px; padding: 20px; border-radius: var(--hp-radius-lg); background: var(--hp-card); box-shadow: inset 0 0 0 1px var(--hp-rule); }

/* Settings */

.rows { border-radius: var(--hp-radius-lg); background: var(--hp-card); box-shadow: inset 0 0 0 1px var(--hp-rule); }
.row { display: grid; gap: 12px; padding: 16px 20px; }
.row + .row { box-shadow: inset 0 1px 0 var(--hp-rule); }
.row-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.row-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.row-value { margin-top: 2px; font-size: 0.875rem; color: var(--hp-ink-2); overflow-wrap: anywhere; }
.about { margin-top: 32px; text-align: center; }

/* Welcome */

.welcome { display: grid; align-content: center; min-height: calc(100dvh - var(--bar-h) - env(safe-area-inset-top) - 64px); padding-block: 8px 24px; }
.welcome-art {
  display: grid;
  grid-template-columns: 0.78fr 0.9fr 1fr;
  align-items: end;
  max-width: 360px;
  margin: 0 auto 24px;
  border-bottom: 1px solid var(--hp-rule);
}
.welcome-art .akita { width: 100%; height: auto; margin-bottom: -4px; }
.welcome h1 { text-align: center; }
.welcome .t-lead { margin: 16px auto 0; max-width: 30ch; text-align: center; }
.welcome .actions-stack { margin-top: 32px; }
.welcome .hint { margin-top: 12px; text-align: center; }

/* Toast and helpers */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 20;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-strong);
  color: var(--hp-on-strong);
  box-shadow: var(--hp-shadow-float);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--hp-base) var(--hp-ease-out), transform var(--hp-base) var(--hp-ease-out);
}
.toast:empty { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.noscript { padding: 24px; text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* Small phones */

@media (max-width: 359px) {
  .card, .reading { padding: 16px; }
  .decide { gap: 6px; }
  .decide .btn { padding-inline: 8px; font-size: 0.875rem; }
}

/* Wider screens */

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .card { padding: 24px; }
  .kid-hero { grid-template-columns: 136px minmax(0, 1fr); gap: 24px; }
  .kid-hero .akita, .kid-hero-art { width: 136px; height: 136px; }
  .kid-hero-art .akita { width: 100%; height: 100%; }
  .filters { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
}

@media (min-width: 1024px) {
  /* Home and kid pages get two columns; every other screen keeps the centered column. */
  .wrap-wide, body[data-screen-wide="true"] .bar-in { max-width: calc(1000px + 2 * var(--gutter)); }
  .home.has-aside { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
  .home-aside { position: sticky; top: calc(var(--bar-h) + 24px); }
  .home-aside .kid-row-sub { flex-direction: column; }
  .home-aside .kid-row-sub > span + span::before { content: none; }
  .kid-page { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 48px; align-items: start; }
  .kid-page .kid-side { position: sticky; top: calc(var(--bar-h) + 16px); }
  .kid-page .kid-hero { grid-template-columns: 1fr; justify-items: start; gap: 8px; }
  .kid-page .kid-hero .akita, .kid-page .kid-hero-art { width: 200px; height: 200px; margin-left: -20px; }
  .kid-page .kid-hero-art .akita { width: 100%; height: 100%; margin-left: 0; }
  .kid-page .kid-main { margin-top: 0; }
  .kid-page .kid-main > .section:first-child { margin-top: 0; }
}

/* Motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .sk { animation: none; }
}
