:root {
  font: 16px/1.5 system-ui, sans-serif;
  color-scheme: light;
  --ink: #172e35;
  --subtle: #4c5c65;
  --paper: #fffdfa;
  --line: #d6e0e0;
  --accent: #06594f;
  --accent-ink: #fff;
  --focus: var(--accent);
  --accent-soft: #d7eee6;
  --hero: #183541;
  --hero-ink: #fff;
  --background: #eef4f3;
  --warn: #852f24;
  --alert: #fff0e8;
  --hero-muted: #e4efea;
  --field-line: #8796a2;
  --earned: #825105;
  --shadow: 0 .45rem 1.65rem #192d3210;
  --nav-space: 5.75rem;
}
body[data-theme="tata"] {
  color-scheme: dark;
  --ink: #eff8fa; --subtle: #bacdd7; --paper: #172632; --line: #39505e;
  --accent: #76ddcb; --accent-ink: #10232c; --accent-soft: #25434d; --background: #101923;
  --hero: #101e2b; --hero-muted: #c1e0e8; --warn: #ffcabd; --alert: #432b33;
  --field-line: #768a97; --earned: #f5c581; --shadow: 0 .45rem 1.65rem #0004;
}
body[data-theme="mama"] {
  --ink: #412735; --subtle: #634955; --paper: #fffcfa; --line: #e8ccd1;
  --hero: #f6dce1; --hero-ink: #432836; --hero-muted: #664452;
  --accent: #8b3857; --accent-soft: #e2eee0; --background: #fbf0f2; --field-line: #9c737e;
}
body[data-theme="klara"] {
  --hero: #fbe2ec; --hero-ink: #3b254c; --hero-muted: #593851; --ink: #3b254c;
  --paper: #fffafd; --accent: #683d84; --accent-soft: #dcefe4; --background: #faf0f7; --line: #e7d4e4;
}
body[data-theme="kacper"] {
  --hero: #173c66; --accent: #245181; --accent-soft: #f7e6bd; --background: #f0f4fa; --line: #d9e2ef;
  --hero-muted: #e5eef8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); min-width: 0; }
main, .top-inner, nav > div { max-width: 76rem; padding-inline: clamp(.85rem, 3vw, 2rem); margin: 0 auto; }
main { padding-bottom: 3rem; overflow-wrap: anywhere; }
.top { background: var(--paper); color: var(--ink); padding: .65rem 0; border-bottom: 1px solid var(--line); }
.top-inner, .row, .actions, .week-controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.top-inner, .week-controls { justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .55rem; font-size: 1.15rem; font-weight: 850; letter-spacing: -.035em; min-width: 0; }
.brand-icon { display: block; width: 2.55rem; height: 2.55rem; flex: none; }
nav { background: var(--paper); border-bottom: 1px solid var(--line); }
nav > div { display: flex; gap: .35rem; padding-block: .42rem; }
nav button { flex: 1; display: flex; justify-content: center; align-items: center; gap: .35rem; background: transparent; border: 0; color: var(--subtle); }
nav button[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.nav-icon { display: block; width: 1.48rem; height: 1.48rem; flex: none; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 1.4rem; font-size: clamp(1.7rem, 4vw, 2.55rem); line-height: 1.14; letter-spacing: -.035em; }
h2 { font-size: 1.25rem; letter-spacing: -.02em; }
h3 { font-size: 1.02rem; }
.lead { color: var(--subtle); margin: .4rem 0 1.15rem; }
.muted { color: var(--subtle); }
.panel, .task, .day, .banner { background: var(--paper); border: 1px solid var(--line); border-radius: 1.15rem; padding: 1rem; }
.panel { box-shadow: var(--shadow); }
.panel, .stack { display: grid; gap: .75rem; align-content: start; }
.task, .day { min-width: 0; }
.task { display: grid; gap: .55rem; }
.task .row { flex-wrap: nowrap; align-items: flex-start; }
.task .row > div { min-width: 0; overflow-wrap: anywhere; }
.day > h3 { margin-bottom: .45rem; }
.day { display: grid; gap: .5rem; background: var(--background); }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; align-items: start; }
.compact { max-width: 31rem; margin: 0 auto; padding: clamp(1.05rem, 5vw, 2.15rem); }
.entry { padding-top: clamp(1.2rem, 5vw, 4rem); }
.entry .compact { border-top: .35rem solid var(--accent); }
.entry h1 { margin-top: 0; }
.entry .brand-icon { display: none; }
.entry .compact .lead { margin-bottom: .35rem; }
.cards { display: grid; gap: .8rem; }
.section { margin-top: 1rem; }
button, .button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--line); color: var(--ink); background: var(--paper); padding: .5rem .85rem; border-radius: .78rem; cursor: pointer; font-weight: 700; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.secondary { background: var(--accent-soft); }
button.danger { color: var(--warn); }
button:disabled { opacity: .6; cursor: default; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.top button { background: var(--background); }
.badge { display: inline-block; border-radius: 99px; padding: .15rem .55rem; color: var(--ink); background: var(--background); font-weight: 650; font-size: .88rem; }
.badge.confirmed, .badge.available, .badge.approved { color: #172e35; background: #d9f3e5; }
.badge.submitted, .badge.chosen, .badge.pending { color: #432d13; background: #fff0bf; }
.badge.returned, .badge.missed { background: var(--alert); color: var(--warn); }
.banner { margin-top: .9rem; background: var(--accent-soft); }
.banner.error { background: var(--alert); color: var(--warn); }
progress { width: 100%; accent-color: var(--accent); height: 1rem; }
fieldset { margin: 0; padding: .5rem; border: 1px solid var(--line); border-radius: .55rem; }
label { display: grid; gap: .25rem; font-weight: 650; }
label.inline { display: inline-flex; gap: .35rem; margin: .25rem; align-items: center; }
.starter-week label.inline { min-height: 48px; margin-block: 0; }
input:not([type="checkbox"]), select, textarea {
  min-height: max(48px, 2.85rem); width: 100%; min-width: 0; border: 1px solid var(--field-line); border-radius: .65rem; background: var(--paper); color: var(--ink); padding: .4rem .55rem;
}
textarea { min-height: 5rem; resize: vertical; }
summary { cursor: pointer; font-weight: 750; }
details form { margin-top: .65rem; }
.stars { display: flex; flex-wrap: wrap; gap: .4rem; }
.star { background: var(--accent-soft); border-radius: .75rem; padding: .45rem .65rem; text-align: center; min-width: 3.4rem; }
.star strong { display: block; font-size: 1.4rem; line-height: 1.15; }
.star.earned strong { color: #805100; }
#notice { position: fixed; bottom: .6rem; inset-inline: .75rem; margin-inline: auto; width: fit-content; max-width: calc(100% - 1.5rem); z-index: 4; pointer-events: none; }
#notice:empty { display: none; }
#notice p { padding: .75rem 1rem; border: 1px solid var(--line); background: var(--paper); border-radius: .7rem; box-shadow: 0 .2rem .8rem #1c283633; }
body[data-role="child"] main, body[data-role="child"] nav > div { max-width: 40rem; }
body[data-role="child"] .task button, body[data-role="child"] .panel button { min-height: 3.2rem; }
:root[data-text="large"] { font-size: 125%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
nav button { min-width: 0; overflow-wrap: anywhere; }
button, summary { min-height: max(48px, 2.85rem); }
summary { align-content: center; }
.top button, .bonus-actions .actions { max-width: 100%; }
.task { gap: .75rem; }
.task-content { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .85rem; align-items: center; }
.task-copy { overflow-wrap: anywhere; display: grid; justify-items: start; gap: .2rem; }
.task-copy strong { font-size: 1.12rem; line-height: 1.24; }
.art {
  display: block;
  width: 4.25rem;
  max-width: 22vw;
  aspect-ratio: 1;
  flex: none;
  border-radius: .75rem;
  background-color: #fff3df;
  background-image: url("illustrations.png");
  background-size: 400% 300%;
  background-position: var(--art-col, 0%) var(--art-row, 0%);
  background-repeat: no-repeat;
}
.art-col-1 { --art-col: 33.3333%; }
.art-col-2 { --art-col: 66.6667%; }
.art-col-3 { --art-col: 100%; }
.art-row-1 { --art-row: 50%; }
.art-row-2 { --art-row: 100%; }
.custom-reward { display: grid; place-items: center; background-image: none; }
.custom-reward .nav-icon { width: 60%; height: 60%; }
.art-picker { display: grid; gap: .45rem; }
.art-preview { display: flex; align-items: center; gap: .65rem; color: var(--subtle); }
.art-preview .art { width: 3rem; }
.illustration-entry .art-preview { display: inline-flex; vertical-align: middle; overflow-wrap: anywhere; max-width: 90%; }
.progress-panel { background: var(--accent-soft); gap: .5rem; border-color: transparent; }
.progress-title { justify-content: space-between; }
.progress-title h2 { font-size: 1.1rem; }
.progress-title strong { font-variant-numeric: tabular-nums; }
.progress-panel progress { height: 1.2rem; }
.stars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem; }
.star { min-width: 0; padding: .3rem .1rem; background: var(--paper); font-size: .85rem; }
.star.earned strong, .earned-marker, .earned-banner > span { color: var(--earned); }
.earned-banner { font-weight: 750; margin-bottom: .6rem; }
.earned-banner > span { font-size: 1.3em; }
.listen > span { font-size: .9em; margin-inline-end: .25em; }
.bonus-actions > button { margin: .2rem .4rem .2rem 0; }
.reward-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: .55rem;
  border: 0;
  padding: 0;
}
.reward-options legend { font-weight: 750; padding: 0 0 .45rem; }
.reward-option {
  position: relative;
  justify-items: center;
  align-content: start;
  height: 100%;
  min-width: 0;
  min-height: 48px;
  padding: .55rem .35rem;
  text-align: center;
  overflow-wrap: anywhere;
  background: var(--paper);
  border: 2px solid var(--field-line);
  border-radius: .8rem;
  cursor: pointer;
  line-height: 1.25;
}
.reward-option input { position: absolute; inset: .2rem .2rem auto auto; accent-color: var(--accent); }
.reward-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.reward-option:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.task-arrival { animation: task-arrival .32s ease-out; }
.star-arrival { animation: star-arrival .42s ease-out; transform-origin: center; }
@keyframes task-arrival {
  from { transform: translateY(3px); border-color: var(--accent); }
  to { transform: translateY(0); }
}
@keyframes star-arrival {
  0% { transform: scale(.96); }
  55% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
body[data-motion="reduced"] :is(.task-arrival, .star-arrival) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  :is(.task-arrival, .star-arrival) { animation: none; }
}
body[data-role="child"] .task .art { width: 6rem; }
body[data-role="child"] .task .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
body[data-role="child"] input[type="checkbox"] { width: 1.4rem; height: 1.4rem; margin: 0; }
body[data-role="child"] .inline { min-height: 48px; }
.day-hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 10.1rem; display: grid; align-items: end;
  padding: clamp(1rem, 4vw, 2rem); margin-top: 1.1rem; border-radius: clamp(1.1rem, 3.5vw, 1.85rem);
  background: var(--hero); color: var(--hero-ink); box-shadow: var(--shadow);
}
.hero-copy { position: relative; z-index: 1; max-width: 72%; }
.hero-copy::before {
  content: ""; position: absolute; z-index: -1; inset: -.65rem -1.25rem -.6rem -.25rem;
  background: var(--hero);
  mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.25rem), transparent);
}
.hero-date { color: var(--hero-muted); font-weight: 650; }
.hero-date::first-letter { text-transform: uppercase; }
.day-hero h1 { margin-top: .35rem; font-size: clamp(1.85rem, 5.5vw, 3.5rem); }
body[data-role="child"] .day-hero { min-height: 10.75rem; }
body[data-role="child"][data-theme="klara"] h1,
body[data-role="child"][data-theme="klara"] .today-tasks h2 { font-family: Georgia, serif; }
body[data-role="child"][data-theme="kacper"] .day-hero h1 { font-weight: 900; }
.hero-scene { position: absolute; inset: 0 0 0 auto; width: min(72%, 18rem); pointer-events: none; }
.landscape { display: block; width: 100%; height: 100%; }
.hero-scene.in-view .scene-drift { animation: scene-drift 24s ease-in-out infinite alternate; }
.hero-scene.in-view .scene-sway { transform-origin: 250px 180px; animation: scene-sway 12s ease-in-out infinite alternate; }
@keyframes scene-drift { to { transform: translateX(9px); } }
@keyframes scene-sway { to { transform: rotate(4deg); } }
body[data-inactive="true"] .hero-scene.in-view :is(.scene-drift, .scene-sway) { animation-play-state: paused; }
body[data-motion="reduced"] .hero-scene.in-view :is(.scene-drift, .scene-sway) { animation: none; }
.brand-icon { animation: brand-enter .32s ease-out both; }
body[data-navigation="visible"] .brand-icon,
body[data-motion="reduced"] .brand-icon { animation: none; }
@keyframes brand-enter { from { opacity: .7; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) {
  .hero-scene.in-view :is(.scene-drift, .scene-sway),
  .brand-icon { animation: none; }
}
.today-tasks > h2 { font-size: 1.32rem; }
.today-tasks > .muted { padding: .9rem 1rem; background: var(--paper); border-radius: 1rem; }
body[data-role="child"] .task:has(.task-details) { padding: 0; }
.task-details > summary { position: relative; list-style: none; padding: .72rem .85rem; padding-inline-end: 2.1rem; border-radius: 1.15rem; gap: .8rem; }
.task-details > summary::-webkit-details-marker { display: none; }
.task-details > summary:focus-visible { outline-offset: -3px; }
.task-chevron { position: absolute; inset-inline-end: .94rem; inset-block-start: 50%; width: .56rem; height: .56rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); }
.task-details[open] .task-chevron { transform: translateY(-30%) rotate(225deg); }
.task-expanded { display: grid; gap: .55rem; padding: .7rem .85rem .85rem; border-top: 1px solid var(--line); }
.task-guide { background: var(--background); border: 1px solid var(--line); border-radius: .75rem; }
.task-guide > summary { padding: .45rem .65rem; }
.task-guide > ol { margin: 0; padding: 0 .65rem .6rem 1.8rem; }
.task-guide li + li { margin-top: .55rem; }
.task-guide li::marker { font-weight: 750; color: var(--accent); }
.guide-step { display: grid; grid-template-columns: min(4.5rem, 27%) minmax(0, 1fr); align-items: center; gap: .55rem; }
.guide-step svg {
  display: block; width: 100%; background: #e8ecf9; border-radius: .45rem;
  stroke: #384063; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; fill: none;
}
.today-tasks .task { box-shadow: var(--shadow); }
.parent-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: .65rem; }
.summary-metric { display: grid; align-content: space-between; gap: .24rem; padding: .72rem .85rem;
  border-radius: 1rem; background: var(--paper); border: 1px solid var(--line); }
.summary-metric span { font-size: .88rem; font-weight: 680; }
.summary-metric strong { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.summary-metric:last-child { background: var(--accent-soft); }
.parent-today { display: grid; gap: 1rem; }
.approval-panel { border-inline-start: .24rem solid var(--accent); }
body[data-role="parent"] .day-hero { min-height: 7rem; margin-top: .7rem; padding: .8rem 1rem; }
body[data-role="parent"] .day-hero h1 { font-size: clamp(1.45rem, 3vw, 2.1rem); }
body[data-role="parent"] .hero-scene { width: min(51%, 13rem); }
.parent-today .panel, .approval-panel { padding: .65rem .75rem; gap: .55rem; }
:is(.parent-today, .approval-panel) .task { padding: .55rem .65rem; gap: .45rem; }
:is(.parent-today, .approval-panel) .art { width: 3rem; }
:is(.parent-today, .approval-panel) .task-copy strong { font-size: 1rem; }
.quick-plan:not([open]) { padding-block: .2rem; }
.approval-panel > .stack { gap: .35rem; }
.approval-panel button { flex: 0 1 auto; }
.workspace > .columns > .panel > h2 { padding: .35rem .2rem; }
.compact .primary, .task-expanded .primary { min-height: max(48px, 3rem); }
@media (max-width: 48rem) {
  .columns { grid-template-columns: 1fr; }
  html:has(body[data-navigation="visible"]) { scroll-padding-bottom: var(--nav-space); }
  body[data-navigation="visible"] main { padding-bottom: calc(var(--nav-space) + env(safe-area-inset-bottom)); }
  nav { position: fixed; z-index: 3; inset: auto 0 0; border-bottom: 0; border-top: 1px solid var(--line);
    box-shadow: 0 -.3rem 1.4rem #162f4017; padding-bottom: env(safe-area-inset-bottom); }
  nav > div { padding-inline: max(.5rem, env(safe-area-inset-left), env(safe-area-inset-right)); }
  nav button { flex-direction: column; gap: .14rem; padding: .34rem .1rem; line-height: 1.12; font-size: .82rem; min-height: 3rem; }
  body[data-navigation="visible"] #notice { bottom: calc(var(--nav-space) + env(safe-area-inset-bottom)); }
  .top-inner { gap: .4rem; }
  .top button { padding-inline: .55rem; font-size: .8rem; }
  body[data-role="parent"] .top .brand { flex: 1 1 7rem; font-size: 1rem; }
  body[data-role="parent"] .top .brand-icon { width: 2rem; height: 2rem; }
  body[data-role="parent"] .top .brand span { overflow-wrap: anywhere; }
  body[data-role="parent"] .top .actions { gap: .35rem; }
  .hero-copy { max-width: 76%; }
}
@media (max-width: 29rem) {
  .task, .progress-panel { padding: .72rem; }
  .task-content { gap: .65rem; }
  .top { padding-block: .5rem; }
  .parent-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
  .summary-metric { padding: .48rem; }
  .summary-metric span { font-size: .77rem; }
  .hero-copy { max-width: 82%; }
}
@media (max-width: 48rem) and (max-height: 31rem) {
  body:has(input:focus:not([type="checkbox"], [type="radio"]), select:focus, textarea:focus) nav { visibility: hidden; }
}
@media (min-width: 56rem) {
  .parent-today { grid-template-columns: minmax(17rem, .8fr) minmax(0, 1.35fr); }
}
@media (min-width: 73rem) {
  .cards.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
