:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --paper: #f5efe3;
  --surface: #fffdf8;
  --surface-soft: #faf6ed;
  --ink: #142139;
  --muted: #637083;
  --line: #ddd4c5;
  --navy: #183d61;
  --navy-dark: #102b47;
  --teal: #2e766f;
  --teal-soft: #dbece5;
  --gold: #f1bc4c;
  --gold-soft: #fae8b5;
  --coral: #d96549;
  --coral-soft: #f8e0d8;
  --brick: #a94f43;
  --brick-dark: #843a32;
  --brick-soft: #f5e3de;
  --blue-soft: #e1eaf3;
  --radius-sm: 11px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow: 0 2px 3px rgba(20, 33, 57, 0.04), 0 18px 48px rgba(20, 33, 57, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

body::before {
  top: 90px;
  right: -130px;
  width: 360px;
  height: 360px;
  background: #deebe4;
}

body::after {
  bottom: -190px;
  left: -160px;
  width: 390px;
  height: 390px;
  background: #f4ddb0;
}

button,
input,
select { font: inherit; }

button,
select,
input[type="time"] { cursor: pointer; }

button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 50;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 36px));
  min-height: 86px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(20, 33, 57, 0.13);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  box-shadow: 0 6px 18px rgba(20, 33, 57, 0.18);
}

.brand-mark svg { width: 29px; height: 29px; }
.brand-mark svg .logo-house { fill: var(--gold); }
.brand-mark svg .logo-door { fill: var(--ink); }
.brand-mark svg .logo-palm { fill: #69a99a; }

.brand-copy { display: grid; line-height: 1.08; }
.brand-copy strong { font-size: 15px; letter-spacing: -0.02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }

.header-actions,
.mode-switch,
.local-note {
  display: flex;
  align-items: center;
}

.header-actions { gap: 20px; }

.mode-switch {
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.8);
}

.mode-switch button {
  min-height: 36px;
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.mode-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
  box-shadow: 0 4px 12px rgba(20, 33, 57, 0.14);
}

.local-note {
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.local-note span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.page-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.page-intro,
.child-topline {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { overflow-wrap: break-word; }

h1 {
  margin: 0;
  font-size: clamp(38px, 5.3vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 { margin: 0; font-size: 24px; line-height: 1.12; letter-spacing: -0.035em; }
h3 { margin: 0; }

.intro-copy {
  max-width: 620px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.profile-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-button {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 50px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.76);
}

.profile-button[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(20, 33, 57, 0.08);
}

.profile-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: #7c5a08;
  font-size: 12px;
  font-weight: 850;
}

.profile-button[data-child="older"] .profile-avatar {
  background: var(--blue-soft);
  color: var(--navy);
}

.profile-button span:last-child { display: grid; text-align: left; line-height: 1.1; }
.profile-button strong { font-size: 13px; }
.profile-button small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.profile-item { position: relative; display: flex; }
.profile-item .profile-button { padding-right: 34px; }
.child-profiles .profile-item .profile-button { padding-right: 13px; }
.profile-edit {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--teal);
  font-size: 15px;
}
.profile-edit:hover { background: var(--teal-soft); }

.parent-intro h1 { font-size: clamp(40px, 4.5vw, 54px); }

.parent-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 760px;
  margin: 0 0 22px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 8px 25px rgba(20, 33, 57, 0.06);
}

.parent-tabs button {
  min-height: 43px;
  padding: 8px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.parent-tabs button span { margin-right: 6px; }
.parent-tabs button[aria-pressed="true"] { background: var(--ink); color: white; box-shadow: 0 5px 14px rgba(20, 33, 57, 0.17); }
.parent-section-panel { min-height: 420px; }

.family-page { display: grid; gap: 20px; }
.family-cover {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 560px;
  height: clamp(560px, calc(100svh - 28px), 780px);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(117, 79, 42, 0.24);
  border-radius: 30px;
  background: #e8b969;
  box-shadow: 0 24px 70px rgba(33, 43, 37, 0.2);
}
.family-cover > img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.family-cover::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(46, 32, 20, 0.04), transparent 54%, rgba(46, 32, 20, 0.14));
  content: "";
  pointer-events: none;
}
.family-cover-copy {
  width: min(46%, 520px);
  padding: clamp(24px, 4vw, 46px);
  text-align: center;
  transform: translateY(-45px);
}
.family-cover-kicker {
  margin: 0 0 9px;
  color: #9b4b2d;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.family-cover-copy h2 {
  margin: 0;
  color: #3c2e20;
  font-family: var(--display-font);
  font-size: clamp(34px, 3.7vw, 54px);
  line-height: 0.96;
}
.family-cover-rules {
  display: grid;
  gap: 7px;
  margin: 22px 0 0;
  padding: 0;
  color: #4d3a28;
  list-style: none;
  text-align: left;
}
.family-cover-rules li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  font-size: clamp(12px, 1.25vw, 15px);
  font-weight: 760;
  line-height: 1.25;
}
.family-cover-rules li span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: #f2bd62;
  color: #70431f;
  font-size: 11px;
  font-weight: 900;
}
.family-content { scroll-margin-top: 18px; }
.family-rules-card { scroll-margin-top: 18px; }

.schedule-section { display: grid; gap: 18px; }
.week-planner { overflow: hidden; }
.planner-heading { margin-bottom: 18px; }
.week-toolbar { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 10px; align-items: center; margin-bottom: 12px; }
.week-toolbar strong { text-align: center; font-size: 15px; }
.week-toolbar button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--teal); font-size: 20px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.week-day { display: grid; gap: 2px; min-width: 0; min-height: 78px; padding: 8px 4px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); }
.week-day span { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.week-day strong { color: var(--ink); font-size: 20px; }
.week-day small { display: grid; min-width: 22px; height: 20px; padding-inline: 5px; place-items: center; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 800; }
.week-day.is-today { border-color: #bfaa60; }
.week-day.is-selected { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.week-day.is-selected small { background: var(--teal); color: white; }
.planner-date-jump { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin: 12px 0 4px; color: var(--muted); font-size: 11px; font-weight: 750; }
.planner-date-jump input { min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.planner-day { margin-top: 17px; padding: 18px; border-radius: 18px; background: var(--surface-soft); }
.planner-day-heading { display: flex; gap: 15px; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.planner-day-heading h3 { font-size: 20px; text-transform: capitalize; }
.planner-tasks { display: grid; }
.planner-task { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto 34px; gap: 11px; align-items: center; min-height: 66px; padding: 10px 0; border-top: 1px solid var(--line); }
.planner-task time { color: var(--navy); font-weight: 850; font-variant-numeric: tabular-nums; }
.planner-task strong,
.planner-task div span { display: block; }
.planner-task strong { font-size: 14px; }
.planner-task div span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.planner-task-status { padding: 4px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--navy); font-size: 10px; font-weight: 780; white-space: nowrap; }
.planner-task.is-one-off .planner-task-status { background: var(--gold-soft); color: #70520d; }
.planner-task > button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--teal); }
.planner-empty { display: grid; gap: 4px; padding: 22px 10px 10px; border-top: 1px solid var(--line); text-align: center; }
.planner-empty span { color: var(--muted); font-size: 12px; }

.overview-heading { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.overview-heading .text-button { white-space: nowrap; }
.today-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 23px 0; }
.today-stats div { padding: 14px; border-radius: 14px; background: var(--surface-soft); }
.today-stats strong,
.today-stats span { display: block; }
.today-stats strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.today-stats span { margin-top: 2px; color: var(--muted); font-size: 11px; }

.parent-next {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.parent-next-time { color: var(--teal); font-size: 19px; font-weight: 850; font-variant-numeric: tabular-nums; }
.parent-next small,
.parent-next strong { display: block; }
.parent-next small { margin-bottom: 3px; color: var(--muted); }

.active-goal { padding: 23px; }
.goal-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; }
.goal-heading h2 { font-size: 18px; }
.goal-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.goal-progress { height: 9px; overflow: hidden; margin-top: 18px; border-radius: 999px; background: #e6e2d9; }
.goal-progress span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.goal-numbers { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.goal-numbers strong { font-size: 21px; }
.goal-numbers span { color: var(--muted); font-size: 11px; }
.section-help { max-width: 660px; margin: -8px 0 18px; color: var(--muted); font-size: 13px; }

.template-strip { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: -4px 0 22px; padding: 12px; border-radius: 14px; background: var(--blue-soft); }
.template-strip > span { margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 750; }
.template-strip button { min-height: 34px; padding: 6px 10px; border: 1px solid rgba(27, 70, 106, 0.15); border-radius: 9px; background: white; color: var(--navy); font-size: 12px; font-weight: 780; }

.task-row-actions { display: flex; gap: 6px; }
.reopen-task { min-height: 36px; padding: 6px 9px; border: 1px solid #e5b8ac; border-radius: 9px; background: #fff7f4; color: #a34331; font-size: 11px; font-weight: 760; }

.parent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  align-items: start;
}

.parent-main,
.parent-side { display: grid; gap: 18px; }

.parent-side {
  position: sticky;
  top: 18px;
}

.panel,
.review-panel,
.hero-summary,
.pause-card {
  border: 1px solid rgba(221, 212, 197, 0.94);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.panel { padding: 26px; }

.panel-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 21px;
}

.compact-heading { align-items: flex-start; margin-bottom: 17px; }

.button,
.icon-button,
.text-button,
.reset-button,
.quest-action,
.reward-action {
  border: 0;
  font-weight: 760;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

.button span { margin-right: 4px; font-size: 19px; line-height: 0; }

.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: var(--teal); }
.button:disabled,
.punish-button:disabled { cursor: not-allowed; opacity: 0.5; }
.button-light { border: 1px solid var(--line); background: var(--surface); color: var(--teal); }
.button-light:hover { border-color: var(--teal); background: var(--teal-soft); }
.full-button { width: 100%; }

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}

.review-panel { overflow: hidden; }

.review-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px 25px;
  background: var(--gold-soft);
}

.review-count {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  font-size: 18px;
  font-weight: 850;
}

.review-head h2 { font-size: 20px; }
.review-head p { margin: 3px 0 0; color: #665728; font-size: 13px; }

.review-empty {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 21px 24px;
}

.review-empty-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 900;
}

.review-empty strong,
.review-empty span { display: block; }
.review-empty strong { font-size: 14px; }
.review-empty span { margin-top: 2px; color: var(--muted); font-size: 12px; }

.discipline-action-card { padding: 22px; }
.discipline-action-card h2 { font-size: 19px; }
.discipline-action-card > p:not(.section-kicker) { margin: 8px 0 17px; color: var(--muted); font-size: 12px; }
.punish-button {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 47px;
  padding: 10px 15px;
  border: 0;
  border-radius: 12px;
  background: var(--brick);
  color: white;
  font-weight: 820;
  box-shadow: 0 8px 20px rgba(132, 58, 50, 0.18);
}
.punish-button:hover { background: var(--brick-dark); }
.punish-button span { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 50%; }

.day-close-card { padding: 22px; border-color: #d8c887; background: #fffaf0; }
.day-close-card h2 { font-size: 19px; }
.day-close-card > p:not(.section-kicker):not(.day-praise) { margin: 8px 0 15px; color: var(--muted); font-size: 12px; }
.day-close-button { min-height: 47px; background: var(--navy); color: white; font-weight: 820; }
.day-close-button:hover:not(:disabled) { background: var(--navy-dark); }
.day-close-button:disabled { cursor: not-allowed; background: #d7d1c6; color: #746f67; }
.day-praise { margin: 10px 0 8px; color: var(--navy); font-size: 15px; font-weight: 750; }
.day-earned { color: #70520d; font-size: 12px; font-weight: 800; }

.discipline-history { padding-block: 23px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.history-heading h2 { font-size: 20px; }
.history-empty { margin: 0; color: var(--muted); font-size: 13px; }
.discipline-history-list { display: grid; }
.discipline-history-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.history-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: var(--brick-soft); color: var(--brick-dark); font-weight: 900; }
.discipline-history-item strong,
.discipline-history-item span,
.discipline-history-item small { display: block; }
.discipline-history-item strong { font-size: 14px; }
.discipline-history-item div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.discipline-history-item small { margin-top: 4px; color: var(--brick-dark); font-size: 10px; font-weight: 760; }
.discipline-history-item.status-cancelled { opacity: 0.7; }
.discipline-history-item.status-cancelled .history-mark { background: var(--blue-soft); color: var(--navy); }
.discipline-history-item.status-corrected .history-mark,
.discipline-history-item.status-closed .history-mark { background: var(--teal-soft); color: var(--teal); }
.history-actions { display: grid; gap: 5px; justify-items: end; }
.history-close,
.history-undo { min-height: 34px; padding: 6px 10px; border: 1px solid #d7aaa2; border-radius: 9px; background: white; color: var(--brick-dark); font-size: 11px; font-weight: 780; }
.history-close { border-color: #add0c5; color: var(--teal); }

.review-items { padding: 5px 22px 10px; }

.review-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}

.review-item:last-child { border-bottom: 0; }
.review-item strong,
.review-item span { display: block; }
.review-item span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.review-actions { display: flex; gap: 7px; }

.quest-action,
.reward-action {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 12px;
}

.approve-button { background: var(--teal); color: white; }
.support-button { background: var(--navy); color: white; }
.return-button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.help-review-item { margin-inline: -2px; padding-inline: 12px; border-radius: 13px; background: #f3f7fb; }

.quest-list { display: grid; gap: 22px; }

.time-group { display: grid; }
.time-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 2px 9px;
  border-bottom: 2px solid var(--ink);
}
.time-group-heading h3 { font-size: 17px; }
.time-group-heading span { color: var(--muted); font-size: 11px; }

.quest-row {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  min-height: 78px;
  border-top: 1px solid var(--line);
}

.time-group .quest-row:nth-child(2) { border-top: 0; }
.quest-row.not-today { opacity: 0.64; }

.time-control {
  display: grid;
  grid-template-columns: 30px 58px 30px;
  gap: 4px;
  align-items: center;
}

.time-control button {
  width: 30px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--teal);
  font-size: 18px;
  font-weight: 800;
}

.time-control button:hover { background: var(--teal-soft); }

.quest-time {
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.quest-copy { min-width: 0; }
.quest-copy strong { display: block; font-size: 15px; }
.quest-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 7px; }

.points-pill,
.status-pill,
.type-pill,
.days-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 780;
}

.points-pill { background: var(--gold-soft); color: #70520d; }
.type-pill.required { background: #e9edf4; color: var(--navy); }
.type-pill.bonus { background: var(--gold-soft); color: #70520d; }
.days-pill { border: 1px solid var(--line); color: var(--muted); }
.status-pill.open { background: var(--blue-soft); color: var(--navy); }
.status-pill.waiting { background: var(--coral-soft); color: #8c3c2b; }
.status-pill.approved { background: var(--teal-soft); color: var(--teal); }
.status-pill.skipped { background: #eeeae0; color: #6b665d; }
.status-pill.not-today { background: #ece9e1; color: var(--muted); }

.edit-quest {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 750;
}

.empty-state {
  padding: 28px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.hero-summary {
  position: relative;
  overflow: hidden;
  overflow: clip;
  min-height: 245px;
  padding: 25px;
  background: var(--navy);
  color: white;
}

.hero-summary::after,
.child-stage::after {
  position: absolute;
  right: -52px;
  bottom: -67px;
  width: 180px;
  height: 180px;
  border: 28px solid rgba(241, 188, 76, 0.15);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.summary-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.summary-top .section-kicker { color: var(--gold); }
.summary-top h2 { max-width: 210px; color: white; }

.score-badge {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin: 26px 0 22px;
}

.score-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
  text-align: left;
}
.score-button:hover small { color: white; }

.score-badge strong {
  font-size: 62px;
  line-height: 0.8;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.score-badge span { color: #bdcad5; font-size: 13px; }
.score-badge small { align-self: center; margin-left: 8px; color: var(--gold); font-size: 11px; font-weight: 800; }

.parent-bank-button {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 15px;
  align-items: center;
  width: 100%;
  margin: 20px 0 18px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: left;
}
.parent-bank-button:hover { background: rgba(255, 255, 255, 0.12); }
.parent-bank-copy { display: grid; }
.parent-bank-copy strong { color: var(--gold); font-size: 34px; line-height: 1; }
.parent-bank-copy span { margin-top: 3px; color: #c4d0da; font-size: 11px; }
.parent-bank-copy small { margin-top: 6px; color: white; font-size: 10px; font-weight: 780; }

.savings-jar { position: relative; display: block; flex: 0 0 auto; width: 82px; height: 98px; }
.jar-lid { position: absolute; z-index: 3; top: 0; left: 13px; width: 56px; height: 13px; border: 3px solid #c98e23; border-radius: 6px 6px 3px 3px; background: var(--gold); box-shadow: inset 0 -3px 0 rgba(112, 82, 13, 0.18); }
.jar-glass { position: absolute; right: 5px; bottom: 0; left: 5px; height: 86px; overflow: hidden; border: 3px solid rgba(255, 255, 255, 0.68); border-radius: 15px 15px 24px 24px; background: rgba(225, 234, 243, 0.12); box-shadow: inset 7px 0 0 rgba(255, 255, 255, 0.09); }
.jar-fill { position: absolute; right: 0; bottom: 0; left: 0; min-height: 8%; background: linear-gradient(180deg, rgba(241, 188, 76, 0.24), rgba(241, 188, 76, 0.55)); transition: height 260ms ease; }
.jar-coins { position: absolute; inset: 10px 7px 5px; }
.jar-coins i { position: absolute; bottom: 0; left: 0; width: 20px; height: 10px; border: 2px solid rgba(112, 82, 13, 0.35); border-radius: 50%; background: #d6cba9; opacity: 0.28; }
.jar-coins i.is-filled { background: var(--gold); opacity: 1; box-shadow: 0 2px 0 #b7811e; }
.jar-coins i:nth-child(1) { left: 0; bottom: 0; transform: rotate(-8deg); }
.jar-coins i:nth-child(2) { left: 19px; bottom: 0; transform: rotate(7deg); }
.jar-coins i:nth-child(3) { left: 38px; bottom: 0; transform: rotate(-3deg); }
.jar-coins i:nth-child(4) { left: 8px; bottom: 13px; transform: rotate(5deg); }
.jar-coins i:nth-child(5) { left: 31px; bottom: 13px; transform: rotate(-6deg); }
.jar-coins i:nth-child(6) { left: 15px; bottom: 26px; transform: rotate(4deg); }
.jar-coins i:nth-child(7) { left: 35px; bottom: 26px; transform: rotate(-4deg); }
.savings-jar.is-compact { width: 55px; height: 67px; }
.savings-jar.is-compact .jar-lid { left: 9px; width: 38px; height: 9px; border-width: 2px; }
.savings-jar.is-compact .jar-glass { height: 59px; border-width: 2px; border-radius: 10px 10px 16px 16px; }
.savings-jar.is-compact .jar-coins { inset: 8px 4px 3px; transform: scale(0.63); transform-origin: left bottom; }

.progress-track {
  position: relative;
  z-index: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.summary-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #b9c7d2;
  font-size: 11px;
}

.reward-list,
.reward-shop { display: grid; gap: 4px; }

.reward-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.reward-row:first-child { border-top: 0; }
.reward-row.is-goal { padding-inline: 10px; border-radius: 13px; background: #fff7dc; }

.reward-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--gold-soft);
  color: #79570b;
  font-size: 18px;
  font-weight: 900;
}

.reward-copy { min-width: 0; }
.reward-copy strong,
.reward-copy span { display: block; }
.reward-copy strong { font-size: 13px; }
.reward-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.reward-cost { color: var(--teal); font-size: 12px; font-weight: 800; white-space: nowrap; }

.editable-rewards .reward-row { grid-template-columns: 42px minmax(0, 1fr) auto auto; padding-block: 15px; }
.reward-edit-actions { display: flex; gap: 6px; }
.reward-edit-actions button { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--teal); font-size: 11px; font-weight: 780; }
.reward-edit-actions button:disabled { cursor: default; background: var(--teal-soft); color: var(--teal); opacity: 1; }

.cash-exchange-panel {
  margin: 8px 0 25px;
  padding: 20px;
  border: 1px solid #dfc66f;
  border-radius: 18px;
  background: #fff8df;
}
.exchange-heading { display: flex; gap: 15px; align-items: flex-start; justify-content: space-between; }
.exchange-heading h3 { font-size: 19px; }
.exchange-settings-button { margin-top: 0; white-space: nowrap; }
.exchange-rate { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 15px 0 9px; }
.exchange-rate strong { font-size: 22px; }
.exchange-rate > span { color: #79570b; font-size: 12px; font-weight: 780; }
.exchange-rate small { width: 100%; color: var(--muted); font-size: 11px; }
.exchange-status { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.exchange-status.is-ready { color: var(--teal); font-weight: 750; }

.family-profile-list { display: grid; gap: 8px; }
.family-profile {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}
.family-profile.is-selected { border-color: var(--teal); background: #f1f8f4; }
.family-avatar { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: var(--gold-soft); color: #70520d; font-size: 18px; font-weight: 850; }
.family-profile strong,
.family-profile div > span { display: block; }
.family-profile div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.family-profile-actions { display: flex; gap: 6px; }
.family-profile-actions button { min-height: 35px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--teal); font-size: 11px; font-weight: 780; }
.family-rules-card { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.family-rules-list { display: grid; gap: 8px; }
.family-rule-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 13px 10px 10px; border: 1px solid var(--rule-edge); border-radius: 17px; background: var(--surface); }
.family-rule-row.is-focus { border-color: var(--rule-main); background: var(--rule-soft); box-shadow: inset 4px 0 0 var(--rule-main); }
.family-rule-row strong,
.family-rule-row div > span { display: block; }
.family-rule-row strong { font-size: 14px; }
.family-rule-row div > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.family-rule-actions { display: flex; gap: 6px; }
.family-rule-actions button { min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--teal); font-size: 10px; font-weight: 780; }
.family-rule-actions button:disabled { border-color: var(--rule-main); background: var(--rule-soft); color: var(--rule-ink); }
.family-rule-art { display: block; width: 100%; overflow: hidden; border: 1px solid color-mix(in srgb, var(--rule-main) 36%, white); border-radius: 22px; background: var(--rule-art); }
.family-rule-art svg { display: block; width: 100%; height: auto; }
.family-rule-art.is-compact { width: 66px; border-radius: 14px; }
.scene-cloud { fill: var(--rule-cloud); }
.scene-cloud-two { opacity: .58; }
.scene-main { fill: var(--rule-main); }
.scene-accent { fill: var(--rule-accent); }
.scene-ink { fill: var(--rule-ink); }
.scene-white { fill: #fffaf0; }
.scene-stroke { fill: none; stroke: var(--rule-ink); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.scene-question { fill: #fffaf0; font-family: inherit; font-size: 42px; font-weight: 900; text-anchor: middle; }
.rule-tone-sun { --rule-soft: #fff4ca; --rule-art: #ffe8a1; --rule-main: #f1b832; --rule-accent: #ef805f; --rule-ink: #6c4c14; --rule-edge: #e8cf7c; --rule-cloud: #fff9e3; }
.rule-tone-mint { --rule-soft: #e5f4ed; --rule-art: #cceadd; --rule-main: #4fa58f; --rule-accent: #f0b948; --rule-ink: #164f4a; --rule-edge: #afd5c7; --rule-cloud: #f4fbf8; }
.rule-tone-sky { --rule-soft: #e7f1f7; --rule-art: #cfe6f2; --rule-main: #579bb8; --rule-accent: #f2bd4e; --rule-ink: #183f5a; --rule-edge: #b6d4e2; --rule-cloud: #f6fbfd; }
.rule-tone-coral { --rule-soft: #fce9e3; --rule-art: #f6cfc3; --rule-main: #d87561; --rule-accent: #f0ba45; --rule-ink: #71372f; --rule-edge: #e8b9ae; --rule-cloud: #fff6f2; }
.rule-tone-violet { --rule-soft: #eee9f8; --rule-art: #ddd3f2; --rule-main: #8872b7; --rule-accent: #e9b84d; --rule-ink: #463a6c; --rule-edge: #cabde4; --rule-cloud: #faf8fd; }
.family-rule-preview { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--rule-edge); border-radius: 17px; background: var(--rule-soft); }
.family-rule-preview .family-rule-art { width: 92px; }
.family-rule-preview small,
.family-rule-preview strong,
.family-rule-preview div > span { display: block; }
.family-rule-preview small { color: var(--rule-ink); font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.family-rule-preview strong { margin-top: 4px; font-size: 15px; }
.family-rule-preview div > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.parent-access-card { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-top: 24px; padding: 20px; border-radius: 18px; background: var(--blue-soft); }
.parent-access-card h3 { font-size: 18px; }
.parent-access-card p:not(.section-kicker) { max-width: 650px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.pause-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 15px;
  padding: 21px;
}

.pause-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: var(--coral-soft);
}

.pause-icon svg { width: 24px; height: 24px; fill: var(--coral); }
.pause-card.is-open .pause-icon { background: var(--teal-soft); }
.pause-card.is-open .pause-icon svg { fill: var(--teal); }
.pause-card h2 { font-size: 18px; }
.pause-card p:not(.section-kicker) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.text-button { margin-top: 10px; padding: 0; background: transparent; color: var(--teal); font-size: 12px; text-decoration: underline; }

.reset-button {
  justify-self: center;
  padding: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline;
}

/* Детский режим */
.child-view { max-width: 980px; margin: 0 auto; }
.child-topline h1 { font-size: clamp(38px, 6vw, 58px); }

.child-stage {
  position: relative;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  overflow: hidden;
  overflow: clip;
  min-height: 330px;
  padding: 30px;
  border-radius: 34px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
}

.hero-identity,
.current-quest { position: relative; z-index: 1; }

.hero-portrait {
  display: grid;
  width: 150px;
  height: 150px;
  margin-bottom: 22px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.hero-portrait svg { width: 92px; height: 105px; }
.hero-portrait .home { fill: var(--gold); }
.hero-portrait .door { fill: var(--navy); }
.hero-portrait .palm { fill: #69a99a; }
.hero-name { margin: 0; font-size: 25px; letter-spacing: -0.03em; }
.hero-level { margin: 5px 0 0; color: #bfccd7; font-size: 13px; }

.child-bank-button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-top: 18px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: left;
}
.child-bank-button:hover { background: rgba(255, 255, 255, 0.12); }
.child-bank-button > span:last-child { display: grid; min-width: 0; }
.child-bank-button small { color: #c4d0da; font-size: 10px; font-weight: 780; text-transform: uppercase; letter-spacing: .07em; }
.child-bank-button strong { margin-top: 2px; color: var(--gold); font-size: 18px; }
.child-bank-button em { margin-top: 4px; color: white; font-size: 10px; font-style: normal; font-weight: 750; }

.hero-score {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-top: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
  font-weight: 850;
}

.hero-score-button { border: 0; }
.hero-score-button small { margin-left: 5px; color: #c6d2dc; font-size: 10px; font-weight: 750; }
.hero-score-button:hover small { color: white; }

.current-quest {
  align-self: center;
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
}

.current-label { margin: 0 0 9px; color: var(--gold); font-size: 11px; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }
.current-quest h2 { max-width: 520px; color: white; font-size: clamp(29px, 4vw, 43px); }
.current-meta { display: flex; gap: 10px; margin: 14px 0 24px; color: #c4d0da; font-size: 13px; }

.done-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: var(--gold);
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(241, 188, 76, 0.2);
}

.done-button:hover { background: #ffd477; }
.done-button:disabled { cursor: not-allowed; opacity: 0.58; }

.help-button {
  width: 100%;
  min-height: 45px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 13px;
  background: transparent;
  color: white;
  font-size: 13px;
  font-weight: 800;
}
.help-button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.help-button:disabled { cursor: not-allowed; color: #b8c5d0; }

.waiting-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(248, 224, 216, 0.14);
  color: #f6d1c8;
  font-size: 12px;
}

.support-note {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(219, 236, 229, 0.14);
  color: #cceade;
  font-size: 12px;
}
.support-note span { color: #f5a898; font-size: 17px; }

.child-grid {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 18px;
  margin-top: 18px;
}

.child-grid.rewards-only { grid-template-columns: 1fr; }
.rewards-only .child-rewards { width: 100%; }

.child-goal {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(180px, 0.45fr);
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 19px 22px;
  border: 1px solid #e4cc81;
  border-radius: 22px;
  background: #fff7dc;
  box-shadow: var(--shadow);
}
.goal-star { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 17px; background: var(--gold); color: #70520d; font-size: 26px; }
.child-goal-copy .section-kicker { margin-bottom: 4px; color: #8a6510; }
.child-goal-copy h2 { font-size: 20px; }
.child-goal-copy > span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.child-goal-meter strong { display: block; margin-top: 7px; color: #70520d; font-size: 12px; text-align: right; }

.child-consequence {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 19px 22px;
  border: 1px solid #dfb8b1;
  border-radius: 22px;
  background: #fff8f6;
  box-shadow: var(--shadow);
}
.child-consequence-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: var(--brick-soft); color: var(--brick-dark); font-size: 20px; font-weight: 900; }
.child-consequence .section-kicker { color: var(--brick-dark); }
.child-consequence h2 { font-size: 21px; }
.child-consequence-copy > p:not(.section-kicker) { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.correction-path { display: flex; gap: 10px; align-items: center; margin-top: 13px; padding: 11px 12px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); }
.correction-path > span { font-size: 18px; font-weight: 900; }
.correction-path strong,
.correction-path div span { display: block; }
.correction-path strong { font-size: 12px; }
.correction-path div span { margin-top: 2px; font-size: 11px; }
.correction-path.is-done { background: #e6f2dc; color: #456b32; }

.child-day-summary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid #e2cb82;
  border-radius: 22px;
  background: #fff8df;
  box-shadow: var(--shadow);
}
.day-summary-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 17px; background: var(--gold); color: #70520d; font-size: 25px; }
.child-day-summary .section-kicker { margin-bottom: 4px; color: #8a6510; }
.child-day-summary h2 { font-size: 21px; }
.child-day-summary p:not(.section-kicker) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.child-family-rule {
  display: grid;
  grid-template-columns: minmax(230px, .82fr) minmax(0, 1.18fr);
  gap: 0;
  align-items: stretch;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--rule-edge);
  border-radius: 28px;
  background: var(--rule-soft);
  box-shadow: 0 18px 44px rgba(28, 39, 54, .12);
}
.child-family-rule .family-rule-art { min-height: 210px; border: 0; border-radius: 0; }
.child-family-rule .family-rule-art svg { width: 100%; height: 100%; object-fit: cover; }
.family-rule-poster-copy { position: relative; display: flex; min-height: 210px; padding: 29px 30px; flex-direction: column; justify-content: center; }
.family-rule-poster-copy::after { position: absolute; top: 18px; right: 21px; width: 34px; height: 34px; border: 2px solid var(--rule-main); border-radius: 50%; color: var(--rule-ink); content: "⌂"; display: grid; place-items: center; font-size: 17px; font-weight: 900; }
.child-family-rule .section-kicker { margin-bottom: 7px; color: var(--rule-ink); }
.child-family-rule h2 { max-width: 520px; color: var(--rule-ink); font-size: clamp(27px, 3.2vw, 42px); line-height: 1.02; }
.child-family-rule p:not(.section-kicker) { max-width: 560px; margin: 10px 0 0; color: color-mix(in srgb, var(--rule-ink) 78%, #52606d); font-size: 15px; line-height: 1.45; }
.family-rule-poster-note { display: inline-flex; align-self: flex-start; margin-top: 18px; padding: 7px 10px; border: 1px solid var(--rule-edge); border-radius: 999px; background: rgba(255, 255, 255, .54); color: var(--rule-ink); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.consequence-rule { padding: 9px 11px; border-radius: 11px; background: var(--gold-soft); color: #70520d !important; }

.child-exchange {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.exchange-calendar { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 15px; background: var(--gold-soft); color: #70520d; font-weight: 900; }
.child-exchange h2 { font-size: 18px; }
.child-exchange p:not(.section-kicker) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.child-exchange > strong { color: var(--teal); font-size: 13px; white-space: nowrap; }

.achievement-banner {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 14px;
  background: #fff3c6;
  color: var(--ink);
  animation: achievement-in 420ms ease-out;
}
.achievement-star { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--gold); color: #70520d; font-size: 20px; }
.achievement-banner strong,
.achievement-banner span { display: block; }
.achievement-banner strong { font-size: 16px; }
.achievement-banner div span { margin-top: 2px; color: #70520d; font-size: 11px; }
.achievement-banner button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #70520d; font-size: 20px; }

@keyframes achievement-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.next-preview {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
}

.next-preview span { color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.next-preview strong { color: white; font-size: 13px; }

.entertainment-rule {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 750;
}

.entertainment-rule.locked { background: rgba(248, 224, 216, 0.14); color: #f6d1c8; }
.entertainment-rule.unlocked { background: rgba(211, 234, 226, 0.16); color: #ccebdd; }

.progress-copy { color: var(--muted); font-size: 12px; font-weight: 750; }

.quest-route { position: relative; }
.quest-route::before { position: absolute; top: 17px; bottom: 17px; left: 17px; width: 2px; background: var(--line); content: ""; }

.route-step {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 61px;
}

.route-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 0 0 1px var(--line);
}

.route-step.approved .route-marker { background: var(--teal); color: white; box-shadow: 0 0 0 1px var(--teal); }
.route-step.waiting .route-marker { background: var(--gold); color: var(--ink); box-shadow: 0 0 0 1px var(--gold); }
.route-copy strong,
.route-copy span { display: block; }
.route-copy strong { font-size: 14px; }
.route-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.route-points { color: var(--teal); font-size: 11px; font-weight: 800; }

.reward-shop .reward-row { grid-template-columns: 42px minmax(0, 1fr); }
.reward-shop .reward-action { grid-column: 1 / -1; width: 100%; margin: 3px 0 7px; background: var(--ink); color: white; }
.reward-shop .reward-action:disabled { cursor: not-allowed; background: #d9d8d2; color: #7c8490; }

.celebration { text-align: center; }
.celebration-symbol { display: block; margin-bottom: 12px; font-size: 46px; }
.celebration p { color: #c4d0da; }

/* Диалоги */
.app-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(10, 24, 41, 0.3);
}

.app-dialog::backdrop { background: rgba(13, 29, 46, 0.58); backdrop-filter: blur(3px); }
.app-dialog form,
.info-dialog { padding: 27px; }
.app-dialog form { display: grid; gap: 18px; }
.discipline-dialog { width: min(620px, calc(100% - 28px)); }
.dialog-lead { margin: -5px 0 0; color: var(--muted); font-size: 13px; }

.dialog-heading,
.dialog-actions,
.dialog-actions > div {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.dialog-actions-right { justify-content: flex-end; }

.field { display: grid; gap: 7px; }
.field > span { color: var(--muted); font-size: 13px; font-weight: 720; }
.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #cdc4b5;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.weekday-field { margin: 0; padding: 0; border: 0; }
.weekday-field legend { margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 720; }
.weekday-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekday-picker label { position: relative; cursor: pointer; }
.weekday-picker input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-picker span {
  display: grid;
  min-height: 39px;
  place-items: center;
  border: 1px solid #cdc4b5;
  border-radius: 10px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.weekday-picker input:checked + span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.weekday-picker input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.danger-button { min-height: 44px; padding: 9px 13px; border: 1px solid #e5b8ac; border-radius: var(--radius-sm); background: #fff7f4; color: #a34331; font-weight: 760; }
.info-dialog p { color: var(--muted); }
.dialog-note { padding: 14px; border-radius: 12px; background: var(--blue-soft); font-size: 13px; }
.discipline-submit { background: var(--brick); color: white; }
.discipline-submit:hover { background: var(--brick-dark); }
.discipline-preview { display: grid; gap: 4px; padding: 15px; border-left: 4px solid var(--brick); border-radius: 4px 12px 12px 4px; background: var(--brick-soft); }
.discipline-preview span { color: var(--brick-dark); font-size: 11px; font-weight: 780; text-transform: uppercase; letter-spacing: 0.06em; }
.discipline-preview strong { font-size: 17px; }
.discipline-preview small { color: var(--muted); font-size: 11px; }
.pin-input { text-align: center; letter-spacing: 0.45em; font-size: 24px; font-weight: 850; }
.pin-hint { margin: -6px 0 0; color: var(--teal); font-size: 12px; font-weight: 750; text-align: center; }
.field-error { margin: -6px 0 0; color: var(--brick-dark); font-size: 12px; font-weight: 750; }

.points-dialog-body { display: grid; gap: 18px; padding: 27px; }
.points-balance { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 16px; background: var(--navy); color: white; }
.points-balance > div { display: grid; }
.points-balance span { color: #c5d1db; font-size: 12px; }
.points-balance strong { margin-top: 2px; color: var(--gold); font-size: 25px; }
.points-balance small { margin-top: 5px; color: white; font-size: 10px; }
.points-history-list { display: grid; max-height: min(420px, 52vh); overflow: auto; border-top: 1px solid var(--line); }
.points-history-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.points-history-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: var(--teal-soft); color: var(--teal); font-weight: 900; }
.points-history-item.is-minus .points-history-icon { background: var(--brick-soft); color: var(--brick-dark); }
.points-history-item strong,
.points-history-item small { display: block; }
.points-history-item strong { font-size: 13px; }
.points-history-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.points-history-item b { color: var(--teal); font-size: 13px; white-space: nowrap; }
.points-history-item.is-minus b { color: var(--brick-dark); }
.day-close-preview { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 13px; align-items: center; padding: 15px; border-radius: 15px; background: #fff7dc; }
.day-close-preview strong,
.day-close-preview small { display: block; }
.day-close-preview strong { font-size: 18px; }
.day-close-preview small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.toast {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  display: flex;
  gap: 16px;
  align-items: center;
  max-width: min(440px, calc(100% - 32px));
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  box-shadow: 0 18px 50px rgba(13, 29, 46, 0.25);
  font-size: 14px;
}

.toast button { padding: 0; border: 0; background: transparent; color: var(--gold); font-weight: 800; text-decoration: underline; }

@media (max-width: 900px) {
  .site-header { align-items: flex-start; padding: 15px 0; }
  .header-actions { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }
  .local-note { font-size: 10px; }
  .parent-layout { grid-template-columns: 1fr; }
  .parent-side { position: static; grid-template-columns: 1fr 1fr; }
  .hero-summary { grid-row: 1; }
  .rewards-panel { grid-row: span 2; }
  .child-stage { grid-template-columns: 220px minmax(0, 1fr); }
  .family-cover-copy { width: min(58%, 480px); }
}

@media (max-width: 640px) {
  .site-header,
  .page-shell { width: min(100% - 24px, 560px); }

  .site-header { min-height: 76px; align-items: center; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small { display: none; }
  .header-actions { align-items: center; flex-direction: row; }
  .local-note { display: none; }
  .mode-switch button { min-height: 34px; padding: 6px 9px; font-size: 11px; }

  .page-shell { padding: 30px 0 112px; }
  .page-intro,
  .child-topline { display: grid; gap: 20px; margin-bottom: 22px; }
  h1 { font-size: 38px; overflow-wrap: normal; }
  .intro-copy { font-size: 15px; }
  .profile-switch { justify-content: stretch; }
  .profile-item { flex: 1; min-width: 0; }
  .profile-button { width: 100%; justify-content: center; min-width: 0; padding: 7px 8px; }
  .profile-item .profile-button { padding-right: 31px; }
  .child-profiles .profile-item .profile-button { padding-right: 8px; }
  .profile-button small { display: none; }

  .parent-tabs {
    position: fixed;
    z-index: 45;
    right: 12px;
    bottom: 10px;
    left: 12px;
    max-width: none;
    margin: 0;
    border-color: rgba(20, 33, 57, 0.2);
    box-shadow: 0 14px 45px rgba(20, 33, 57, 0.24);
  }
  .parent-tabs button { padding-inline: 5px; font-size: 11px; }
  .parent-tabs button span { display: block; margin: 0 0 2px; font-size: 10px; }

  .overview-heading { display: grid; }
  .overview-heading .text-button { justify-self: start; margin-top: 0; }
  .week-planner { padding-inline: 12px; }
  .planner-heading { padding-inline: 4px; }
  .week-strip { gap: 4px; }
  .week-day { min-height: 69px; padding-inline: 2px; border-radius: 11px; }
  .week-day strong { font-size: 18px; }
  .planner-date-jump { justify-content: space-between; padding-inline: 4px; }
  .planner-day { padding: 15px 12px; }
  .planner-day-heading { display: grid; }
  .planner-day-heading .button { width: 100%; }
  .planner-task { grid-template-columns: 48px minmax(0, 1fr) 32px; gap: 7px; }
  .planner-task-status { grid-column: 2; justify-self: start; }
  .planner-task > button { grid-column: 3; grid-row: 1 / span 2; }
  .today-stats { gap: 6px; margin: 18px 0; }
  .today-stats div { padding: 11px 8px; }
  .today-stats strong { font-size: 24px; }
  .parent-next { grid-template-columns: 50px minmax(0, 1fr); }
  .parent-next .type-pill { grid-column: 2; justify-self: start; }

  .parent-main,
  .parent-side { gap: 14px; }
  .parent-side { display: grid; grid-template-columns: 1fr; }
  .hero-summary,
  .rewards-panel,
  .pause-card { grid-row: auto; }
  .hero-summary { min-height: 225px; }
  .panel { padding: 20px 16px; border-radius: 22px; }
  .family-page { gap: 14px; }
  .family-cover {
    min-height: 620px;
    height: clamp(620px, calc(100svh - 22px), 760px);
    border-radius: 24px;
  }
  .family-cover-copy {
    width: min(88%, 410px);
    padding: 27px 20px 25px;
    border-radius: 19px;
    transform: translateY(-28px);
  }
  .family-cover-copy h2 { font-size: clamp(36px, 12vw, 49px); }
  .family-cover-rules { gap: 6px; margin-top: 18px; }
  .family-cover-rules li { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 12px; }
  .family-cover-rules li span { width: 22px; height: 22px; font-size: 10px; }
  .review-panel,
  .hero-summary,
  .pause-card { border-radius: 22px; }
  .review-head { padding: 18px; }
  .review-items { padding-inline: 15px; }
  .review-item { grid-template-columns: 1fr; }
  .review-actions { width: 100%; }
  .review-actions button { flex: 1; }
  .discipline-history-item { grid-template-columns: 34px minmax(0, 1fr); }
  .history-actions { grid-column: 2; justify-self: start; justify-items: start; }
  .panel-heading { align-items: flex-start; }
  .panel-heading .button { padding-inline: 11px; font-size: 12px; }
  .quest-row { grid-template-columns: 104px minmax(0, 1fr) auto; gap: 8px; min-height: 96px; padding: 4px 0; }
  .time-control { grid-template-columns: 24px 48px 24px; gap: 2px; }
  .time-control button { width: 24px; height: 32px; font-size: 16px; }
  .quest-time { padding-inline: 4px; font-size: 12px; }
  .quest-meta { flex-wrap: wrap; gap: 5px; }
  .edit-quest { width: 38px; padding: 0; overflow: hidden; color: transparent; }
  .edit-quest::after { display: grid; color: var(--teal); content: "•••"; place-items: center; }
  .task-row-actions { align-items: flex-end; flex-direction: column; }
  .reopen-task { width: 58px; padding-inline: 3px; font-size: 10px; }
  .template-strip > span { width: 100%; }

  .editable-rewards .reward-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .editable-rewards .reward-edit-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .exchange-heading { display: grid; }
  .exchange-settings-button { justify-self: start; }
  .family-profile { grid-template-columns: 42px minmax(0, 1fr); }
  .family-profile-actions { grid-column: 2; flex-wrap: wrap; }
  .family-rule-row { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .family-rule-art.is-compact { width: 54px; }
  .family-rule-actions { grid-column: 2; flex-wrap: wrap; }
  .parent-access-card { align-items: stretch; flex-direction: column; }

  .child-topline h1 { font-size: 39px; }
  .child-stage { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; border-radius: 26px; }
  .hero-identity { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
  .hero-portrait { grid-row: span 2; width: 76px; height: 76px; margin: 0; }
  .hero-portrait svg { width: 48px; height: 57px; }
  .hero-name { align-self: end; font-size: 21px; }
  .hero-level { align-self: start; }
  .hero-score { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
  .child-bank-button { grid-column: 1 / -1; margin-top: 2px; }
  .child-bank-button .savings-jar { width: 64px; height: 77px; }
  .child-bank-button .jar-lid { left: 10px; width: 44px; height: 10px; border-width: 2px; }
  .child-bank-button .jar-glass { height: 68px; border-width: 2px; border-radius: 12px 12px 18px 18px; }
  .child-bank-button .jar-coins { transform: scale(.77); transform-origin: left bottom; }
  .current-quest { padding: 20px 17px; }
  .current-quest h2 { font-size: 30px; }
  .child-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .child-goal { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; margin-top: 14px; padding: 17px; }
  .goal-star { width: 46px; height: 46px; border-radius: 14px; }
  .child-goal-meter { grid-column: 1 / -1; }
  .child-consequence { grid-template-columns: 42px minmax(0, 1fr); padding: 17px; }
  .child-consequence-icon { width: 40px; height: 40px; }
  .child-day-summary { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; margin-top: 14px; padding: 17px; }
  .day-summary-icon { width: 44px; height: 44px; border-radius: 14px; font-size: 21px; }
  .child-family-rule { grid-template-columns: 1fr; margin-top: 14px; border-radius: 24px; }
  .child-family-rule .family-rule-art { min-height: 0; aspect-ratio: 1.78 / 1; }
  .family-rule-poster-copy { min-height: 0; padding: 22px 19px 21px; }
  .family-rule-poster-copy::after { top: 15px; right: 16px; width: 30px; height: 30px; }
  .child-family-rule h2 { padding-right: 32px; font-size: 29px; }
  .child-family-rule p:not(.section-kicker) { font-size: 13px; }
  .family-rule-poster-note { margin-top: 14px; }
  .family-rule-preview { grid-template-columns: 76px minmax(0, 1fr); }
  .family-rule-preview .family-rule-art { width: 72px; }
  .child-exchange { grid-template-columns: 48px minmax(0, 1fr); padding: 16px; }
  .exchange-calendar { width: 44px; height: 44px; }
  .child-exchange > strong { grid-column: 2; }
  .route-step { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; }
  .quest-route::before { left: 16px; }
  .route-marker { width: 34px; height: 34px; }

  .field-row { grid-template-columns: 1fr; }
  .weekday-picker { gap: 4px; }
  .weekday-picker span { min-height: 36px; border-radius: 8px; font-size: 11px; }
  .app-dialog form,
  .info-dialog { padding: 22px 18px; }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .danger-button { width: 100%; }
  .dialog-actions-right { align-items: flex-end; }
  .dialog-actions-right > div { width: 100%; }
  .points-dialog-body { padding: 22px 18px; }
  .points-history-item { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; }
  .toast { right: 16px; bottom: 16px; left: 16px; max-width: none; }
}

@media (max-width: 385px) {
  .brand { gap: 7px; }
  .brand-copy strong { font-size: 12px; }
  .mode-switch button { padding-inline: 7px; }
  .quest-copy strong { font-size: 14px; }
}

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