:root {
  color-scheme: light;
  font: clamp(14px, 1.041667vw, 24px)/1.25 "Trebuchet MS", "Atkinson Hyperlegible Next", Arial, sans-serif;
  --ink: #14243b;
  --quiet: #4c5e70;
  --line: #dfe3e8;
  --white: #fff;
  --today: #fbf1c8;
  --shadow: 0 .2rem .6rem #33466024;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 58% 21%, #fbe7dc 0 16%, transparent 16.4%),
    linear-gradient(152deg, #fcf1eb 0%, #fcf9f6 31%, #f7f8fa 61%, #f9f2f0 100%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
button, input, select, textarea { border: 1px solid transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #32739d;
  outline-offset: 2px;
}
button:hover { filter: brightness(.965); }
img { display: block; object-fit: contain; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.84rem; font-weight: 800; letter-spacing: -.025em; }
h3 { font-size: 1.19rem; font-weight: 800; }
i[data-glyph] {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  vertical-align: middle;
}
.glyph { width: 100%; height: 100%; }
.leaf { position: absolute; width: 6rem; z-index: 2; pointer-events: none; opacity: .8; }
.leaf-left { top: .7rem; left: 0; }
.leaf-right { top: .65rem; right: 0; }
.dashboard { position: relative; max-width: 2500px; margin: 0 auto; padding: 0 1.25rem .62rem; }
.masthead { height: 5.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.1rem 0 6rem; }
.brand, .mast-actions, .date-clock, .date-clock span { display: flex; align-items: center; }
.brand { gap: 1rem; }
.brand-house { width: 5.3rem; height: 3.7rem; }
.brand-heart { width: 2.55rem; height: 2.7rem; align-self: flex-start; margin-top: .32rem; }
h1 { font-size: 3.1rem; line-height: 1; letter-spacing: -.03em; font-weight: 850; color: #17334a; }
.mast-actions { gap: .55rem; }
.date-clock { border-radius: 2rem; background: #e8f2fb; gap: 1rem; padding: .34rem 1.45rem; font-size: 1.4rem; white-space: nowrap; }
.date-clock span { gap: .55rem; }
.date-clock span + span { border-left: 1px solid #7d8b9d; padding-left: 1rem; }
.icon-button { display: inline-grid; place-items: center; width: max(2.3rem, 44px); height: max(2.3rem, 44px); border-radius: 50%; padding: .35rem; background: transparent; }
.icon-button:hover { background: #e5edf5; }
.icon-button i[data-glyph] { width: 1.25rem; height: 1.25rem; }
.settings { color: #54697b; }

.overview { display: grid; grid-template-columns: minmax(0, 3.05fr) minmax(0, 1fr); gap: .96rem; padding: 0 .4rem; }
.panel { background: linear-gradient(#fffefa, #ffffffeb); border: 1px solid #fff; border-radius: 1.4rem; box-shadow: var(--shadow); min-width: 0; }
.calendar-panel, .today-panel { height: 21.96rem; }
.calendar-panel { display: flex; flex-direction: column; padding: .22rem .72rem .55rem; }
.calendar-header { min-height: 3.45rem; display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: 0 .87rem; }
.calendar-header h2, .today-header { display: flex; align-items: center; gap: .74rem; }
.calendar-header h2 i { width: 1.32em; height: 1.32em; }
.week-nav { display: flex; align-items: center; gap: .45rem; margin-right: 2.6rem; }
.week-nav .icon-button { box-shadow: 0 2px 4px #1c344412; }
#current-week { min-height: 44px; border-radius: 1.5rem; background: #eaf0f5; padding: .27rem 1.25rem; white-space: nowrap; }
.calendar-scroll { flex: 1; overflow: auto; border-radius: .6rem; }
.family-grid { min-width: 710px; }
.family-head, .family-day { display: grid; grid-template-columns: .71fr 1fr 1fr .96fr .96fr .9fr; }
.family-head { position: sticky; top: 0; z-index: 3; background: #fff; }
.family-head > div { padding: .43rem .1rem; display: flex; align-items: center; justify-content: center; gap: .52rem; border-radius: .68rem; font-size: 1.18rem; font-weight: 800; background: var(--head, #edf1f6); }
.family-head i { color: var(--accent); }
.person-timo { --head: #cde7fc; --wash: #e4f2ff; --accent: #1681c5; }
.person-jana { --head: #fbdae6; --wash: #fcebf1; --accent: #ae3e73; }
.person-tamme { --head: #dcf4d7; --wash: #ebf8e6; --accent: #54a044; }
.person-jarno { --head: #fdf0c5; --wash: #fff6d9; --accent: #a97308; }
.person-freda { --head: #eddcf8; --wash: #f4eafb; --accent: #9850be; }
.family-day { position: relative; grid-auto-rows: minmax(2.09rem, auto); border-bottom: 1px solid var(--line); isolation: isolate; }
.family-day:last-child { border-bottom: 0; }
.family-day.is-today { background: #fff8dd; }
.day-label { align-content: center; text-align: center; background: #fafbfd; border-right: 1px solid var(--line); white-space: nowrap; }
.is-today .day-label { background: var(--today); font-weight: 800; }
.new-family { position: relative; display: grid; place-items: center; border-radius: 0; padding: 0; border-width: 0 1px 0 0; border-color: var(--line); background: transparent; }
.new-family:last-of-type { border-right: 0; }
.new-family i { visibility: hidden; color: #516477; }
.new-family:hover i, .new-family:focus-visible i { visibility: visible; }
.event-pill {
  z-index: 1; display: flex; align-items: center; gap: .3rem;
  align-self: center; justify-self: stretch; min-width: 0; width: auto;
  min-height: 1.87rem; margin: .1rem .28rem; padding: .06rem .48rem;
  border-radius: 1.25rem; background: var(--wash, #dceffc); border-color: #fff8;
  font-size: .91rem; text-align: left;
}
.event-pill.wide { justify-content: center; }
.pill-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-pill .symbol, .today-event .symbol { width: 1.85rem; height: 1.5rem; flex: 0 0 auto; }

.today-panel { display: flex; flex-direction: column; padding: .6rem .96rem .68rem; }
.today-header { position: relative; align-items: flex-start; min-height: 4.58rem; }
.today-header > i { width: 2.4rem; height: 2.4rem; }
.today-header time { font-size: 1.13rem; }
.today-sun { position: absolute; width: 4.55rem; height: 4.05rem; right: .22rem; top: .02rem; }
.today-events, .today-tasks { overflow: auto; }
.today-events { flex: 0 1 auto; min-height: 2.1rem; max-height: 9.55rem; display: grid; align-content: start; gap: .42rem; padding: .1rem .03rem; }
.today-event {
  display: flex; align-items: center; gap: .57rem; width: 100%; min-width: 0;
  border-radius: 1.4rem; background: var(--wash, #e6eff9); border: 1px solid #dee9ef80;
  min-height: max(2.42rem, 40px); padding: .12rem .62rem; text-align: left; font-size: 1rem;
}
.today-event .pill-label { flex: 1; }
.today-event .symbol { height: 1.8rem; }
.task-header { display: flex; align-items: center; gap: .55rem; border-top: 1px solid var(--line); margin-top: .7rem; padding: .15rem .2rem 0; }
.task-header > i { color: #367749; background: #ebf5e7; border-radius: .4rem; font-size: 1.21rem; }
.task-header button { margin-left: auto; }
.today-tasks { padding: 0 .2rem; }
.task-row { display: flex; align-items: center; gap: .2rem; }
.task-row label { min-height: 44px; display: flex; align-items: center; gap: .67rem; cursor: pointer; flex: 1; }
.task-row input { width: 1.36rem; height: 1.36rem; flex: 0 0 auto; margin: 0 .2rem; accent-color: #548c54; }
.task-row input:checked + span { text-decoration: line-through; color: var(--quiet); }
.task-row .icon-button { color: var(--quiet); }
.empty-note { padding: .35rem .2rem; color: var(--quiet); font-size: .94rem; }

.child-plans { display: grid; gap: .42rem; margin-top: 1.21rem; }
.child-plan {
  display: grid; grid-template-columns: 14.6rem repeat(7, minmax(0, 1fr));
  align-items: center; gap: .46rem; min-width: 0; padding: .32rem .5rem;
  background: linear-gradient(160deg, #ffffff30, transparent 70%), var(--head);
  border: .24rem solid #ffffffde; border-radius: 1.82rem; box-shadow: var(--shadow);
}
.child-profile { display: flex; align-items: center; gap: .6rem; position: relative; padding: 0 .4rem 0 .2rem; }
.child-profile::after { content: ""; position: absolute; right: .25rem; width: 2px; height: 4.9rem; border-radius: 2px; background: var(--accent); opacity: .58; }
.avatar { width: 5.4rem; height: 5.4rem; border-radius: 50%; background: #fff9; box-shadow: 0 .2rem .4rem #27364a23; }
.child-profile h2 { font-size: 1.85rem; }
.duty-button { display: grid; place-items: center; background: transparent; padding: .05rem; width: max(2.5rem, 44px); height: max(2.5rem, 44px); margin-left: auto; border-radius: .7rem; }
.duty-button .symbol { width: 2.15rem; height: 2.15rem; }
.child-name { display: flex; flex-direction: column; align-items: end; }
.child-day {
  min-width: 0; display: grid; grid-template-rows: 1.63rem 1fr; align-items: stretch;
  gap: .16rem; height: 6.87rem; border: 2px solid #fff;
  border-radius: 1.42rem; padding: .12rem .23rem .22rem;
  background: #ffffffed; box-shadow: 0 .12rem .35rem #28384b21; font-size: 1.17rem; font-weight: 800;
}
.child-day.is-today { border-color: var(--accent); }
.child-day.is-today .day-name { color: var(--ink); }
.icon-grid { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: .13rem; min-height: 0; }
.icon-grid.count-2, .icon-grid.count-3, .icon-grid.count-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icon-grid.count-3, .icon-grid.count-4 { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.activity-slot {
  background: #fcf4e5; border-radius: .75rem; min-width: 0; min-height: 0; position: relative;
}
.activity-slot .symbol { position: absolute; width: 86%; height: 88%; left: 7%; top: 6%; }
.count-1 .activity-slot .symbol { left: 12%; width: 76%; }

dialog { width: min(46rem, calc(100% - 1.35rem)); max-height: calc(100dvh - 1.35rem); border: 0; border-radius: 1.3rem; padding: 0; background: #fffdfa; color: var(--ink); box-shadow: 0 .8rem 3rem #12243f55; }
dialog::backdrop { background: #1f344a64; }
.dialog-frame { display: flex; flex-direction: column; max-height: calc(100dvh - 1.35rem); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 1.55rem; }
.dialog-content { padding: .95rem 1.25rem 1.25rem; overflow: auto; }
.editor-form { display: grid; gap: .75rem; }
.field { display: grid; gap: .25rem; min-width: 0; font-weight: 700; }
.field input, .field select, .field textarea { background: white; border-color: #b9c7d4; border-radius: .55rem; width: 100%; min-height: 44px; padding: .35rem .56rem; font-weight: 400; }
.field textarea { resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.fields-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
fieldset { min-width: 0; margin: 0; padding: .5rem .64rem .64rem; border: 1px solid #dce4eb; border-radius: .65rem; }
legend { font-weight: 700; padding: 0 .2rem; }
.people-picker { display: flex; flex-wrap: wrap; gap: .34rem; }
.people-picker label { display: flex; min-height: 44px; align-items: center; gap: .25rem; padding: .1rem .46rem; border-radius: .52rem; background: var(--wash); cursor: pointer; }
.people-picker input { accent-color: #35779e; }
.icon-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .28rem; padding: .1rem; }
.icon-choice { display: grid; justify-items: center; align-content: center; gap: .18rem; min-height: 3.7rem; padding: .18rem; border-color: #e3e7eb; border-radius: .52rem; background: #faf5ea; font-size: .72rem; line-height: 1.1; overflow-wrap: anywhere; }
.icon-choice .symbol { width: 86%; height: 1.88rem; }
.icon-choice[aria-pressed="true"] { border-color: #2c678a; background: #dfedf8; box-shadow: inset 0 0 0 1px #2c678a; }
.icon-picker-help { margin: .25rem .1rem .4rem; }
.icon-picker-help:empty { margin: 0; }
.quick-picker-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.quick-picker-bar + fieldset .icon-choice { position: relative; }
.quick-picker-bar + fieldset .icon-choice[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: .15rem; right: .15rem;
  display: grid; place-items: center; width: 1rem; height: 1rem;
  color: white; background: #2c678a; border-radius: 50%; font-weight: 700;
}
dialog:has(.month-picker) { width: min(25rem, calc(100% - 1.35rem)); }
.month-picker { display: grid; gap: .55rem; }
.month-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; text-align: center; }
.month-toolbar .icon-button { background: #edf3f8; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .18rem; }
.month-weekdays { color: var(--quiet); text-align: center; font-size: .89rem; font-weight: 700; }
.month-day { min-height: max(2.15rem, 44px); min-width: 0; border-radius: .48rem; padding: 0; background: #f7f7f5; font-variant-numeric: tabular-nums; }
.month-day.is-other-month { color: var(--quiet); background: #fbfaf7; }
.month-day.is-viewed-week { background: #dcecf9; font-weight: 700; }
.month-day[aria-current="date"] { border: 2px solid #307098; }
details > summary { cursor: pointer; padding: .42rem 0; font-weight: 700; }
.actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: .5rem; }
.action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .35rem .72rem; border-radius: .55rem; background: #e9f0f7; border-color: #d5e0e9; text-align: center; }
.action.primary { background: #245677; border-color: #245677; color: white; font-weight: 700; }
.action.danger { color: #a12635; background: #fceef0; border-color: #f3d7dc; margin-right: auto; }
.action.text-action { background: #f8f6ef; }
.dialog-list { display: grid; gap: .32rem; }
.dialog-row { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 44px; border-radius: .55rem; padding: .28rem .55rem; background: #f0f4f8; text-align: left; }
.dialog-row .symbol { width: 2.2rem; height: 1.9rem; }
.dialog-row .row-text { flex: 1; overflow-wrap: anywhere; }
small, .muted { color: var(--quiet); font-size: .87rem; }
.error { margin: 0; color: #9a2030; font-weight: 700; }
.error:empty { display: none; }
.settings-group { display: grid; gap: .55rem; margin-bottom: .9rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.settings-group:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.settings-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.status { position: fixed; z-index: 6; bottom: .8rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1.6rem); background: #1d4560; color: white; padding: .65rem 1rem; border-radius: .7rem; box-shadow: var(--shadow); }
[hidden] { display: none !important; }

@media (max-width: 1360px) and (min-width: 1001px) {
  .masthead { padding-left: 4.6rem; }
  .week-nav { margin-right: .2rem; }
  .child-plan { grid-template-columns: 12.8rem repeat(7, minmax(0, 1fr)); gap: .35rem; }
  .avatar { width: 4.6rem; height: 4.6rem; }
}
@media (max-width: 1000px) {
  .masthead { padding-left: 3rem; padding-right: .4rem; }
  .brand { gap: .45rem; }
  .brand-house { width: 4.05rem; }
  h1 { font-size: 2.4rem; }
  .date-clock { font-size: 1.15rem; padding-inline: .7rem; gap: .55rem; }
  .date-clock span + span { padding-left: .55rem; }
  .overview { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
  .calendar-panel { height: auto; }
  .family-day { grid-auto-rows: minmax(44px, auto); }
  .event-pill { min-height: 38px; }
  .week-nav { margin-right: 0; }
  .today-panel { height: auto; min-height: 11rem; }
  .today-header { min-height: 4rem; }
  .today-events, .today-tasks { max-height: 12rem; }
  .child-plan { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .child-profile { grid-column: 1 / -1; grid-row: 1; }
  .child-profile::after { display: none; }
  .child-profile .avatar { width: 3.55rem; height: 3.55rem; }
  .child-name { flex-direction: row; align-items: center; gap: .65rem; }
}
@media (max-width: 590px) {
  .dashboard { padding-inline: .6rem; }
  .masthead { height: auto; min-height: 6.25rem; flex-wrap: wrap; justify-content: center; gap: 0; padding: .4rem 0; }
  .brand { width: 100%; justify-content: center; }
  h1 { font-size: clamp(1.53rem, 6.15vw, 2.32rem); }
  .brand-house { width: 3.15rem; height: 2.7rem; }
  .brand-heart { width: 1.38rem; height: 1.6rem; }
  .leaf { width: 3.8rem; opacity: .48; }
  .calendar-header { flex-wrap: wrap; justify-content: center; padding: .45rem .05rem .28rem; }
  .calendar-header h2 { font-size: 1.53rem; }
  .week-nav { justify-content: center; width: 100%; }
  .family-grid { min-width: 665px; }
  .family-head > div:first-child, .day-label { position: sticky; left: 0; z-index: 2; }
  .family-head > div:first-child { background: #edf1f6; }
  .child-plans { margin-top: .85rem; gap: .65rem; }
  .child-plan { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .33rem; padding: .32rem; }
  .child-profile { gap: .35rem; }
  .child-profile h2 { font-size: 1.53rem; }
  .child-profile .avatar { width: 2.8rem; height: 2.8rem; }
  .child-name { gap: .12rem; }
  .duty-button .symbol { width: 1.65rem; height: 1.65rem; }
  .child-day { height: 5.9rem; border-radius: .9rem; }
  .icon-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fields-three { grid-template-columns: 1fr; }
  .dialog-header, .dialog-content { padding-inline: .75rem; }
}

.calendar-header { position: relative; padding-right: 2.45rem; }
.add-family { position: absolute; right: 0; color: #346282; }
@media (max-width: 590px) {
  .calendar-header { padding-right: .05rem; }
  .add-family { top: .05rem; right: 0; }
}
.family-head, .family-day { grid-template-columns: minmax(4.7rem, .71fr) repeat(var(--people-count, 5), minmax(0, 1fr)); }
.family-grid { min-width: max(100%, calc(4.7rem + var(--people-count, 5) * 6rem)); }
.child-card { position: relative; min-width: 0; }
.child-card .child-day { width: 100%; }
.day-overflow {
  position: absolute; top: 0; right: 0; border: 0; border-radius: .7rem;
  padding: .25rem .4rem; min-width: 40px; min-height: 32px; font-weight: 800;
  color: #194762; background: #e6f0f8; box-shadow: 0 .1rem .3rem #22384b26;
}
.child-card:has(.day-overflow) .day-name { padding-right: 30px; }
.wall-toggle { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 700; }
.wall-toggle input { width: 1.25rem; height: 1.25rem; }
.account { display: grid; place-items: center; padding: 1rem; }
.account-card { width: min(27rem, 100%); display: grid; gap: 1rem; padding: clamp(1.35rem, 5vw, 2.4rem); }
.account-card > img { width: 6rem; height: 4.8rem; }
.account-card h1 { font-size: 2.25rem; }
.account-card form p { display: grid; gap: .35rem; }
.account-card form input {
  width: 100%; min-height: 44px; padding: .45rem .55rem; border-radius: .5rem; border: 1px solid var(--line);
}
.account-card .errorlist { color: #9a2030; padding-left: 1.15rem; }
@media (orientation: landscape) and (min-width: 720px) and (max-width: 1000px) {
  .wall .overview { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: .55rem; }
  .wall .calendar-panel, .wall .today-panel { height: 20rem; }
  .wall .calendar-header { flex-wrap: wrap; }
  .wall .calendar-header h2 { font-size: 1.35rem; }
  .wall .family-grid { min-width: max(100%, calc(4.1rem + var(--people-count, 5) * 4.4rem)); }
  .wall .family-head > div { font-size: .9rem; gap: .15rem; }
  .wall .family-day { grid-auto-rows: minmax(27px, auto); }
  .wall .child-plan { grid-template-columns: minmax(7.6rem, 1.5fr) repeat(7, minmax(0, 1fr)); gap: .3rem; }
  .wall .child-profile { grid-column: auto; grid-row: auto; padding: 0; }
  .wall .child-name { flex-direction: column; align-items: start; gap: 0; }
  .wall .child-profile h2 { font-size: 1.2rem; }
  .wall .child-profile .avatar { width: 2.8rem; height: 2.8rem; }
  .wall .child-day { height: 5rem; border-radius: .9rem; }
  .wall .child-plans { margin-top: .65rem; }
}
.settings { position: relative; z-index: 3; }
@media (max-width: 590px) {
  .family-head, .family-day { grid-template-columns: 6rem repeat(var(--people-count, 5), minmax(0, 1fr)); }
  .family-grid { min-width: calc(6rem + var(--people-count, 5) * 7rem); }
}
@media (orientation: landscape) and (min-width: 720px) and (max-width: 1250px) {
  .wall .today-sun { width: 2.4rem; height: 2.25rem; right: 0; }
}
