/* Familietavlen — bygget til at blive læst på tværs af et køkken.
   Alle farver kommer fra tokens, så et tema kun er én blok. */

/* ---------- Temaer ---------- */

/* Varm: creme og dyb petroleum. Positiv uden at være barnlig. */
:root,
body[data-theme="varm"] {
  --bg: #f2ede6;
  --panel: #ffffff;
  --panel-2: #faf7f2;
  --ink: #12383d;
  --ink-soft: #5c7276;
  --ink-faint: #9aaaad;
  --line: #e6ded2;
  --accent: #0f9b9b;
  --shadow: 0 1px 2px rgba(18, 56, 61, .05), 0 8px 24px rgba(18, 56, 61, .07);
  --radius: 18px;
}

/* Nordisk: afdæmpet, moderne, næsten grafisk. */
body[data-theme="nordisk"] {
  --bg: #ececea;
  --panel: #ffffff;
  --panel-2: #f6f6f4;
  --ink: #17171a;
  --ink-soft: #6b6b70;
  --ink-faint: #a6a6a8;
  --line: #dededa;
  --accent: #b5623a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 18px rgba(0, 0, 0, .05);
  --radius: 10px;
}

/* Leg: til væggen i børnehøjde. Blødere former, varmere lys. */
body[data-theme="leg"] {
  --bg: #fff4e4;
  --panel: #ffffff;
  --panel-2: #fff9f0;
  --ink: #33251a;
  --ink-soft: #7d6753;
  --ink-faint: #b8a99a;
  --line: #f2e2cc;
  --accent: #f2683c;
  --shadow: 0 2px 4px rgba(120, 80, 40, .06), 0 10px 28px rgba(120, 80, 40, .10);
  --radius: 26px;
}

/* Nat: køkkenet er mørkt om aftenen. */
body[data-theme="nat"] {
  --bg: #14171f;
  --panel: #1c212c;
  --panel-2: #202634;
  --ink: #f2f0ec;
  --ink-soft: #9aa3b4;
  --ink-faint: #626d80;
  --line: #2b3242;
  --accent: #e0a56f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  --radius: 18px;
}

* { box-sizing: border-box; }

/* En klasse med display: flex/grid slår browserens [hidden] på specificitet.
   Uden det her bliver "hidden" en løgn for hvert element der har et layout. */
[hidden] { display: none !important; }

/* Kun html's højde sættes til 100% — den bruges udelukkende til at give
   procent-højder (.board's min-height:100%) noget at regne ud fra. Body
   er alene om selve scroll'et; sætter man overflow på begge, får man to
   indlejrede scroll-beholdere, og browseren kan finde på at huske en
   scroll-position på den forkerte af dem ved næste indlæsning. */
html { height: 100%; }

body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Ingen vandret scroll, nogensinde. Lodret scroll er derimod altid
     tilladt som sikkerhedsnet: passer alting, ses den aldrig; passer det
     ikke (mange samtidige ændringer, en kortere skærm end ventet), er en
     synlig scrollbar altid bedre end at miste indhold bag et fast loft. */
  overflow-x: hidden;
  overflow-y: auto;
  transition: background .8s ease, color .8s ease;
}

.board {
  min-height: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2.2vw, 34px);
  gap: clamp(12px, 1.6vw, 22px);
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex: none;
}

.today-label h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 68px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1;
  text-transform: capitalize;
}

.today-label p {
  margin: .35em 0 0;
  font-size: clamp(15px, 1.5vw, 23px);
  color: var(--ink-soft);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
}

.clock {
  font-size: clamp(38px, 5vw, 76px);
  font-weight: 300;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.weather { display: flex; align-items: center; gap: 12px; }
.weather-icon { font-size: clamp(30px, 3.4vw, 50px); line-height: 1; }
.weather-text { display: flex; flex-direction: column; line-height: 1.25; }
.weather-text strong { font-size: clamp(19px, 2vw, 30px); font-weight: 600; }
.weather-text span { font-size: clamp(12px, 1.1vw, 16px); color: var(--ink-soft); }

/* ---------- Personrække ---------- */
/* Tryk på dig selv for kun at se dine egne ting. Et barn på seks skal
   ikke afkode hele familiens uge for at finde sin fodboldtræning. */

.people {
  flex: none;
  display: flex;
  gap: clamp(10px, 1.4vw, 22px);
  align-items: flex-start;
}

.person {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  transition: opacity .25s ease, transform .25s ease;
}

.person .face {
  width: clamp(42px, 4.4vw, 66px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--face);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: clamp(15px, 1.6vw, 24px);
  font-weight: 650;
  letter-spacing: .01em;
  box-shadow: 0 0 0 0 var(--face);
  transition: box-shadow .25s ease;
  overflow: hidden;
}

.person .face img { width: 100%; height: 100%; object-fit: cover; }

/* Et dyr skal fylde cirklen ud — initialer skal ikke. */
.person .face.is-figure { font-size: clamp(22px, 2.5vw, 36px); }

.person .who {
  font-size: clamp(11px, 1.05vw, 15px);
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.person[aria-pressed="true"] .face {
  box-shadow: 0 0 0 4px var(--panel), 0 0 0 7px var(--face);
}
.person[aria-pressed="true"] .who { color: var(--ink); }

/* Når nogen er valgt, træder resten af familien i baggrunden. */
.people[data-filtered="true"] .person[aria-pressed="false"] { opacity: .34; }

.person:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (hover: hover) {
  .person:hover { transform: translateY(-2px); }
}

/* ---------- Grid ---------- */

.grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) 2.6fr;
  /* Uden en eksplicit rækkehøjde har gitteret ingen defineret højde at
     fordele — det vokser i stedet til indholdets fulde højde og vælter
     ud over faneblade og knapper under sig, når vinduet ikke er helt
     så højt som den skærm, det oprindeligt blev bygget til. */
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 22px);
}

.today-panel,
.day-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Samme regel som gitteret udenom: uden den her klipper panelet ikke
     sit eget indhold, men vokser til fuld indholdshøjde og maler ud over
     fanebladene under, når "tag på"/taske/aftaler tilsammen fylder mere
     end den plads, panelet faktisk har fået tildelt. */
  overflow: hidden;
}

.today-panel { padding: clamp(18px, 1.8vw, 30px); }

.today-panel h2 {
  margin: 0 0 .6em;
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  flex: none;
}

.today-panel .events {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upcoming {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: clamp(10px, 1.2vw, 18px);
  min-height: 0;
  overflow: hidden;
}

.day-card { padding: clamp(12px, 1.15vw, 20px); overflow: hidden; }

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: .5em;
  margin-bottom: .55em;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.day-name {
  font-size: clamp(14px, 1.35vw, 21px);
  font-weight: 650;
  text-transform: capitalize;
  letter-spacing: -.01em;
}

.day-meta {
  font-size: clamp(11px, 1vw, 14px);
  color: var(--ink-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.day-card .events {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------- Påklædning ---------- */
/* Vejret oversat til tøj. Et barn kan ikke omsætte "8 grader og 60% nedbør"
   til en regnjakke, men det kan et billede af en regnjakke. */

.outfit {
  flex: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(12px, 1.3vw, 18px);
  margin-bottom: clamp(12px, 1.3vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.outfit-label {
  margin: 0;
  font-size: clamp(11px, .95vw, 14px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.outfit-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 1.2vw, 20px);
}

.outfit-items li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.outfit-items .ikon {
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.1;
}

.outfit-items .navn {
  font-size: clamp(10px, .95vw, 13.5px);
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.outfit-why {
  margin: 0;
  font-size: clamp(11px, 1vw, 14px);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Taskeliste ---------- */

.bag {
  flex: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(12px, 1.3vw, 18px);
  margin-bottom: clamp(12px, 1.3vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.bag-groups { display: flex; flex-direction: column; gap: 12px; }

.bag-group { display: flex; flex-direction: column; gap: 6px; }

.bag-for {
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  color: var(--ink-soft);
}

.bag-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(9px, 1.1vw, 18px);
}

.bag-items li { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bag-items .ikon { font-size: clamp(24px, 2.7vw, 38px); line-height: 1.1; }
.bag-items .navn { font-size: clamp(10px, .9vw, 12.5px); font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

/* ---------- Aftaler ---------- */

.event {
  --dot: var(--ink-faint);
  background: var(--panel-2);
  border-left: 4px solid var(--dot);
  border-radius: 9px;
  padding: .5em .7em;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.event .time {
  font-size: clamp(11px, .95vw, 14px);
  font-weight: 650;
  color: var(--dot);
  font-variant-numeric: tabular-nums;
}

.event .title {
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 550;
  line-height: 1.28;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.event .where {
  font-size: clamp(10px, .9vw, 13px);
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dagens aftaler er større — det er dem man læser i forbifarten. */
.today-panel .event { padding: .7em .85em; border-left-width: 5px; }
.today-panel .event .time { font-size: clamp(13px, 1.15vw, 18px); }
.today-panel .event .title { font-size: clamp(16px, 1.55vw, 24px); -webkit-line-clamp: 3; }
.today-panel .event .where { font-size: clamp(12px, 1vw, 15px); }

/* Bjælke-stil: personens farve fylder hele aftalen. Læses længere væk fra. */
body[data-event-style="bjaelke"] .event {
  background: var(--dot);
  border-left: none;
  border-radius: 8px;
  color: #fff;
}
body[data-event-style="bjaelke"] .event .time { color: #fff; opacity: .82; }
body[data-event-style="bjaelke"] .event .title { color: #fff; }
body[data-event-style="bjaelke"] .event .where { color: #fff; opacity: .78; }

.empty {
  color: var(--ink-faint);
  font-size: clamp(12px, 1.05vw, 15px);
  font-style: italic;
  padding: .3em 0;
}

.more {
  font-size: clamp(10px, .9vw, 13px);
  color: var(--ink-faint);
  font-weight: 600;
  padding-left: .2em;
}

/* ---------- Statusbar ---------- */

.statusbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: clamp(11px, .95vw, 14px);
  color: var(--ink-faint);
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; display: inline-block; }
.status.error { color: #d9534f; font-weight: 600; }

/* ---------- Portræt ---------- */
/* Hearth hænger i portræt. Dagen fylder toppen, ugen står under. */

body[data-layout="portraet"] .grid {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1.1fr) minmax(0, 1.4fr);
}

body[data-layout="portraet"] .upcoming {
  grid-template-columns: repeat(2, 1fr);
}

body[data-layout="portraet"] .today-panel .event .title {
  font-size: clamp(18px, 2.4vw, 30px);
}

body[data-layout="portraet"] .today-panel .event .time {
  font-size: clamp(14px, 1.8vw, 22px);
}

/* ---------- Telefon, og alle andre vinduer der ikke er høje nok ---------- */
/* Kiosk-gitterets to kolonner side om side forudsætter en bestemt højde.
   Er skærmen for smal (telefon) ELLER for kort (et almindeligt
   computervindue i et andet højde/bredde-forhold end den skærm, tavlen
   er bygget til), er det samme problem: der er ikke plads til begge
   kolonner ved siden af hinanden. Så lægger vi dem i stedet oven på
   hinanden i én læsevenlig kolonne, i alle de tilfælde — ikke kun under
   900px bredde. Selve scroll-tilladelsen ligger allerede globalt på
   html/body ovenfor. */

@media (max-width: 900px), (max-height: 640px) {
  .grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .upcoming { grid-template-columns: 1fr; overflow: visible; }
  .today-panel .events, .day-card .events { overflow: visible; }
  .clock { font-size: 34px; }
  .today-label h1 { font-size: 30px; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ---------- Visninger og faneblade ---------- */

.views { flex: 1; min-height: 0; display: flex; }
/* Selve kalenderen/opgaverne/listerne må aldrig blive klemt væk til
   ingenting af topbjælke, personrække og aftaleændringer over den — de
   sidste er variable i antal og skal give plads, ikke omvendt. Passer
   gulvet ikke sammen med resten, er det siden der får en scrollbar
   (se html/body ovenfor), ikke visningen der forsvinder. */
.view { flex: 1; min-height: min(320px, 42vh); }

.tabs {
  flex: none;
  display: flex;
  gap: 6px;
  align-items: center;
}

.tabs button {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  font-size: clamp(12px, 1.15vw, 16px);
  font-weight: 600;
  color: var(--ink-faint);
  padding: .55em 1.1em;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .18s ease, color .18s ease;
}

.tabs button[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.tabs button:hover:not([aria-current="page"]) { color: var(--ink-soft); }
.tabs button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.tabs .primary,
button.primary {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
}
.tabs .primary:hover { filter: brightness(1.08); }

.badge {
  background: var(--ink-faint);
  color: var(--panel);
  font-size: .75em;
  font-weight: 700;
  min-width: 1.7em;
  padding: .15em .45em;
  border-radius: 999px;
  text-align: center;
}
.tabs button[aria-current="page"] .badge { background: var(--accent); color: #fff; }

/* ---------- Ugegitter: én kolonne pr. person ---------- */
/* Formatet fra den danske papirvægkalender. Den vinder over telefonen,
   fordi man ser hvem der har hvad uden at læse en eneste linje. */

.weekgrid-scroll {
  height: 100%;
  overflow: auto;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.weekgrid { border-collapse: collapse; width: 100%; height: 100%; table-layout: fixed; }

.weekgrid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  padding: .7em .6em;
  font-size: clamp(12px, 1.2vw, 17px);
  font-weight: 650;
  border-bottom: 2px solid var(--line);
  text-align: center;
}

.weekgrid th.daycol { text-align: left; width: clamp(76px, 8vw, 132px); }

.weekgrid th .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: baseline;
}

.weekgrid td {
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: 6px;
  vertical-align: top;
}

.weekgrid td.daycell {
  border-left: none;
  font-size: clamp(11px, 1.05vw, 15px);
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  text-transform: capitalize;
}

.weekgrid tr.is-today td { background: var(--panel-2); }
.weekgrid tr.is-today td.daycell { color: var(--accent); }

.weekgrid .cellevents { display: flex; flex-direction: column; gap: 4px; }

.weekgrid .event { padding: .35em .5em; border-left-width: 3px; }
.weekgrid .event .time { font-size: clamp(9px, .85vw, 12px); }
.weekgrid .event .title { font-size: clamp(10.5px, 1vw, 14px); -webkit-line-clamp: 2; }
.weekgrid .event .where { display: none; }

/* ---------- Paneler: opgaver og lister ---------- */

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 1.8vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; }
.panel-head h2 { margin: 0; font-size: clamp(17px, 1.9vw, 26px); font-weight: 650; letter-spacing: -.02em; }

button.add {
  appearance: none;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 600;
  padding: .5em 1.1em;
  border-radius: 999px;
  cursor: pointer;
}
button.add:hover { border-color: var(--accent); color: var(--accent); }

.tasklist, .lists { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.task {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--panel-2);
  border-radius: 11px;
  padding: .7em .9em;
  border-left: 4px solid var(--dot, var(--ink-faint));
}

.tick {
  appearance: none;
  flex: none;
  width: clamp(24px, 2.4vw, 32px);
  aspect-ratio: 1;
  border: 2.5px solid var(--dot, var(--ink-faint));
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: none;
  transition: background .18s ease;
}
.tick::after { content: "✓"; color: transparent; font-size: .95em; font-weight: 800; }
.tick[aria-pressed="true"] { background: var(--dot, var(--ink-faint)); }
.tick[aria-pressed="true"]::after { color: #fff; }
.tick:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-size: clamp(14px, 1.3vw, 19px); font-weight: 550; }
.task-meta { font-size: clamp(10.5px, .95vw, 13px); color: var(--ink-faint); }
.task.done .task-title { text-decoration: line-through; color: var(--ink-faint); }

.points {
  flex: none;
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  color: var(--part, #b0710b);
  white-space: nowrap;
}

.listcard { background: var(--panel-2); border-radius: 13px; padding: clamp(12px, 1.2vw, 18px); display: flex; flex-direction: column; gap: 10px; }
.listcard h3 { margin: 0; font-size: clamp(14px, 1.35vw, 19px); font-weight: 650; }
.listcard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.listcard li { display: flex; align-items: center; gap: 11px; font-size: clamp(13px, 1.2vw, 17px); }
.listcard li.done span { text-decoration: line-through; color: var(--ink-faint); }
.listcard .tick { width: clamp(20px, 2vw, 26px); border-width: 2px; --dot: var(--accent); }

.remove {
  appearance: none; border: none; background: none; cursor: pointer;
  color: var(--ink-faint); font-size: 1.1em; line-height: 1; padding: .2em .4em; border-radius: 6px;
}
.remove:hover { color: #d9534f; }

/* ---------- Oprettelsesdialog ---------- */

.sheet {
  border: none;
  border-radius: 18px;
  padding: 0;
  background: var(--panel);
  color: var(--ink);
  max-width: min(520px, 92vw);
  width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
.sheet::backdrop { background: rgba(0, 0, 0, .45); }

.sheet form { padding: clamp(20px, 2.4vw, 30px); display: flex; flex-direction: column; gap: 18px; }
.sheet h3 { margin: 0; font-size: clamp(18px, 2vw, 25px); font-weight: 650; letter-spacing: -.02em; }

.fields { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); letter-spacing: .03em; }

.field input, .field select {
  font: inherit;
  font-size: 16px;
  padding: .6em .75em;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }

.field-row { display: flex; gap: 11px; }
.field-row .field { flex: 1; }

.checkline { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 550; }
.checkline input { width: 20px; height: 20px; accent-color: var(--accent); }

.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; }
.sheet-actions button {
  appearance: none; border: none; font: inherit; font-size: 15px; font-weight: 650;
  padding: .65em 1.5em; border-radius: 999px; cursor: pointer;
}
.ghost { background: none; color: var(--ink-soft); }
.ghost:hover { color: var(--ink); }
.sheet .primary { background: var(--accent); color: #fff; margin-left: 0; }

.sheet-error { color: #d9534f; font-size: 13.5px; font-weight: 600; }

@media (max-width: 900px), (max-height: 640px) {
  .tabs { flex-wrap: wrap; }
  .tabs .primary { margin-left: 0; width: 100%; justify-content: center; }
  .weekgrid { min-width: 560px; }
}


/* ---------- Aftaledetaljer ---------- */

.detail-body { padding: clamp(20px, 2.4vw, 30px); display: flex; flex-direction: column; gap: 20px; }
.detail-head { display: flex; flex-direction: column; gap: 5px; }

.detail-when {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 13px;
  font-weight: 650;
  color: var(--eventc, var(--accent));
  letter-spacing: .02em;
}

#detail-title { margin: 0; font-size: clamp(19px, 2.1vw, 26px); font-weight: 650; letter-spacing: -.02em; }
.detail-meta { margin: 0; font-size: 14px; color: var(--ink-soft); }

.detail-bag {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.pack-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }

.pack-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border-radius: 10px;
  padding: .55em .75em;
}

.pack-list .pack-icon { font-size: 22px; line-height: 1; }
.pack-list .pack-name { flex: 1; font-size: 15.5px; font-weight: 550; }
.pack-list li.packed .pack-name { text-decoration: line-through; color: var(--ink-faint); }
.pack-list li.packed .pack-icon { opacity: .45; }
.pack-list .tick { --dot: var(--accent); }

/* Aftaler kan trykkes på — vis det. */
.event { cursor: pointer; transition: transform .12s ease; }
.event:hover { transform: translateY(-1px); }
.event:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.bag-items li.packed .ikon { opacity: .4; }
.bag-items li.packed .navn { text-decoration: line-through; color: var(--ink-faint); }

.detail-none {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: flex-start;
}
.detail-none p { margin: 0; font-size: 14px; color: var(--ink-faint); }

/* ---------- Abonnementslinks ---------- */

.feed-links { display: flex; flex-direction: column; gap: 8px; }

.feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border-radius: 10px;
  padding: .6em .8em;
}

.feed-row .who2 { font-size: 15px; font-weight: 600; flex: none; min-width: 7em; }

.feed-row code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-row button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: .35em .9em;
  border-radius: 999px;
  cursor: pointer;
  flex: none;
}
.feed-row button:hover { border-color: var(--accent); color: var(--accent); }
.feed-row button.done { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Pauseskærm ---------- */

.rest {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: grid;
  place-items: center;
  animation: rest-in .9s ease both;
}

@keyframes rest-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .rest { animation: none; }
}

.rest-inner { text-align: center; display: flex; flex-direction: column; gap: 10px; padding: 5vw; }

.rest-clock {
  margin: 0;
  font-size: clamp(72px, 17vw, 260px);
  font-weight: 200;
  letter-spacing: -.045em;
  line-height: .95;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.rest-date {
  margin: 0;
  font-size: clamp(16px, 2.6vw, 34px);
  font-weight: 500;
  color: var(--ink-soft);
  text-transform: capitalize;
}

.rest-next {
  margin: .6em 0 0;
  font-size: clamp(14px, 1.9vw, 24px);
  font-weight: 550;
  color: var(--ink-faint);
}
.rest-next:empty { display: none; }

/* ---------- Forslag fra børnene ---------- */
/* Et forslag skal ligne noget der er på vej — ikke noget der afventer
   en afvisning. Derfor barnets egen farve, og "Ikke lige nu" frem for "Afvis". */

.proposals { flex: none; display: flex; flex-direction: column; gap: 8px; }

.proposal {
  background: var(--panel);
  border-radius: 13px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--dot, var(--accent));
  padding: clamp(11px, 1.1vw, 16px) clamp(14px, 1.3vw, 20px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 20px);
  flex-wrap: wrap;
}

.proposal-who {
  font-size: clamp(11px, 1vw, 13.5px);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dot, var(--accent));
  flex: none;
}

.proposal-what { flex: 1; min-width: 12ch; display: flex; flex-direction: column; gap: 1px; }
.proposal-title { font-size: clamp(14px, 1.3vw, 19px); font-weight: 600; }
.proposal-when { font-size: clamp(11px, 1vw, 14px); color: var(--ink-faint); }

.proposal-actions { display: flex; gap: 8px; flex: none; }

.proposal-actions button {
  appearance: none;
  border: none;
  font: inherit;
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 650;
  padding: .5em 1.2em;
  border-radius: 999px;
  cursor: pointer;
}
.proposal-yes { background: var(--dot, var(--accent)); color: #fff; }
.proposal-yes:hover { filter: brightness(1.08); }
.proposal-no { background: none; color: var(--ink-faint); }
.proposal-no:hover { color: var(--ink-soft); }

/* Barnets egen knap siger noget andet end en voksens. */
#add-event.proposing { background: var(--ink-soft); }

/* ---------- Indstillinger ---------- */

.settings-sheet { max-width: min(720px, 94vw); }

.settings { display: flex; flex-direction: column; max-height: min(84vh, 760px); }

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 2vw, 26px) clamp(20px, 2.4vw, 30px) 0;
  flex: none;
}
.settings-head h3 { margin: 0; font-size: clamp(19px, 2vw, 25px); font-weight: 650; letter-spacing: -.02em; }
.settings-head .remove { font-size: 1.6em; }

.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 14px clamp(20px, 2.4vw, 30px) 0;
  border-bottom: 1px solid var(--line);
  flex: none;
  overflow-x: auto;
}

.settings-tabs button {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-faint);
  padding: .6em 1em;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}
.settings-tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.settings-body { overflow-y: auto; padding: clamp(18px, 2vw, 26px) clamp(20px, 2.4vw, 30px) clamp(20px, 2.4vw, 30px); }
.settings-body section { display: flex; flex-direction: column; gap: 14px; }

/* Rækker */

.row {
  background: var(--panel-2);
  border-radius: 13px;
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-top { display: flex; align-items: center; gap: 12px; }

.row-figure {
  width: 40px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 650;
  flex: none;
}

.row-name {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: .35em .5em;
  background: none;
  color: var(--ink);
}
.row-name:hover { border-color: var(--line); }
.row-name:focus { outline: none; border-color: var(--accent); background: var(--panel); }

.row-sub { font-size: 13px; color: var(--ink-faint); }
.row-sub.bad { color: #d9534f; font-weight: 600; }

/* Farve- og figurvælgere */

.swatches { display: flex; flex-wrap: wrap; gap: 7px; }

.swatch-btn {
  appearance: none;
  width: 26px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2.5px solid transparent;
  background: var(--c);
  cursor: pointer;
  padding: 0;
}
.swatch-btn[aria-pressed="true"] { border-color: var(--ink); }
.swatch-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.figures { display: flex; flex-wrap: wrap; gap: 5px; }

.figure-btn {
  appearance: none;
  border: 2px solid transparent;
  background: var(--panel);
  border-radius: 9px;
  font-size: 19px;
  line-height: 1;
  padding: 5px 6px;
  cursor: pointer;
}
.figure-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft, var(--panel-2)); }

/* Skiftere */

.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 550; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.toggle-help { font-size: 12.5px; color: var(--ink-faint); font-weight: 400; }

.seg { display: inline-flex; background: var(--panel-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  appearance: none; border: none; background: none; font: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--ink-faint);
  padding: .4em 1em; border-radius: 999px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

.setting-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.setting-line > span { font-size: 14.5px; font-weight: 600; }

/* Guides */

.guide { background: var(--panel-2); border-radius: 13px; overflow: hidden; }

.guide-head {
  width: 100%;
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  cursor: pointer;
  color: var(--ink);
}
.guide-head .ic { font-size: 22px; line-height: 1; flex: none; }
.guide-head .tx { flex: 1; min-width: 0; }
.guide-head strong { display: block; font-size: 15.5px; font-weight: 650; }
.guide-head span { display: block; font-size: 13px; color: var(--ink-faint); }
.guide-head .chev { color: var(--ink-faint); font-size: 15px; transition: transform .2s ease; }
.guide[open] .chev { transform: rotate(90deg); }

.guide-body { padding: 0 17px 17px 52px; display: flex; flex-direction: column; gap: 12px; }
.guide-body ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.guide-body li { font-size: 14px; color: var(--ink-soft); }

.callout { font-size: 13.5px; border-left: 3px solid var(--line); padding: 2px 0 2px 11px; color: var(--ink-soft); }
.callout.warn { border-left-color: #d9534f; }
.callout b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 2px; }

#show-schedule[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---------- Ændringer i importerede kalendere ---------- */
/* Afvigelsen er informationen. En aftale der flytter sig drukner mellem
   tredive andre, hvis tavlen bare opdaterer stille. */

.changes { flex: none; display: flex; flex-direction: column; gap: 6px; }

.change {
  background: var(--panel);
  border-radius: 11px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--kind, var(--accent));
  padding: clamp(9px, .95vw, 14px) clamp(13px, 1.2vw, 18px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 16px);
  flex-wrap: wrap;
}

.change-kind {
  font-size: clamp(10px, .92vw, 12.5px);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--kind, var(--accent));
  flex: none;
  min-width: 7em;
}

.change-what { flex: 1; min-width: 12ch; display: flex; flex-direction: column; gap: 1px; }
.change-title { font-size: clamp(13px, 1.2vw, 17px); font-weight: 600; }
.change-when { font-size: clamp(11px, .98vw, 13.5px); color: var(--ink-faint); }
.change.cancelled .change-title { text-decoration: line-through; color: var(--ink-soft); }

.change-seen {
  appearance: none; border: none; background: none; font: inherit;
  font-size: clamp(11px, 1vw, 14px); font-weight: 650; color: var(--ink-faint);
  padding: .4em .9em; border-radius: 999px; cursor: pointer; flex: none;
}
.change-seen:hover { color: var(--ink); background: var(--panel-2); }

/* ---------- Vejret time for time ---------- */
/* Ligger i topbaren mellem datoen og uret. "22 grader nu" siger ikke om
   det regner klokken tre, når børnene skal hjem — det gør den her. */

.hours {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: clamp(1px, .35vw, 6px);
  align-self: center;
  overflow: hidden;
}

.hour {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 3px clamp(3px, .45vw, 8px);
  border-radius: 8px;
}

.hour-time {
  font-size: clamp(9px, .78vw, 12px);
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.hour-icon { font-size: clamp(14px, 1.35vw, 21px); line-height: 1.25; }

.hour-temp {
  font-size: clamp(10px, .92vw, 14px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.hour-rain {
  font-size: clamp(8px, .7vw, 10px);
  font-weight: 700;
  color: #2f7fc4;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.hour-rain:empty { display: none; }

/* Timer med regn skal springe i øjnene — det er dem man planlægger efter. */
.hour.wet { background: color-mix(in srgb, #2f7fc4 14%, transparent); }
.hour.now .hour-time,
.hour.now .hour-temp { color: var(--accent); }

@media (max-width: 900px) {
  /* På telefonen er der ikke plads i topbaren — så får den sin egen linje. */
  .topbar { flex-wrap: wrap; }
  .hours { order: 3; flex-basis: 100%; justify-content: space-between; overflow-x: auto; }
}

/* ---------- Fejring ---------- */
/* Et barn krydser ikke af, fordi listen bliver kortere. Det gør det,
   fordi der sker noget. Derfor en kvittering ved hvert flueben og en
   rigtig fejring, når hele tasken er pakket. */

@keyframes tick-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.32); }
  100% { transform: scale(1); }
}

.tick.just-done { animation: tick-pop .34s cubic-bezier(.34, 1.56, .64, 1); }

.bag-items li.just-done .ikon,
.pack-list li.just-done .pack-icon { animation: tick-pop .34s cubic-bezier(.34, 1.56, .64, 1); }

/* Konfetti */

.party {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  will-change: transform, opacity;
  animation: fall var(--dur, 1.5s) cubic-bezier(.2, .6, .5, 1) forwards;
}

@keyframes fall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--spin)); opacity: 0; }
}

.cheer {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 91;
  pointer-events: none;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: .7em 1.6em;
  font-size: clamp(18px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .5em;
  animation: cheer-in .3s cubic-bezier(.34, 1.56, .64, 1), cheer-out .4s ease 1.5s forwards;
}

@keyframes cheer-in  { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }
@keyframes cheer-out { to   { transform: translate(-50%, -70%) scale(.95); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .tick.just-done,
  .bag-items li.just-done .ikon,
  .pack-list li.just-done .pack-icon { animation: none; }
  .confetti { display: none; }
  .cheer { animation: none; }
}

/* ---------- Gavepåmindelser ---------- */
/* En fødselsdag hjælper ikke, hvis man opdager den samme morgen.
   Forpligtelsen er gaven, og den skal købes inden. */

.gifts { flex: none; display: flex; flex-direction: column; gap: 6px; }

.gift {
  background: var(--panel);
  border-radius: 11px;
  box-shadow: var(--shadow);
  border-left: 5px solid #c77b9e;
  padding: clamp(9px, .95vw, 14px) clamp(13px, 1.2vw, 18px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 16px);
}

.gift-icon { font-size: clamp(18px, 1.7vw, 24px); line-height: 1; flex: none; }
.gift-text { flex: 1; min-width: 0; font-size: clamp(13px, 1.2vw, 17px); font-weight: 600; }
.gift-when { font-size: clamp(11px, .98vw, 13.5px); color: var(--ink-faint); font-weight: 500; }

/* Fødselsdage i kalenderen får deres eget udtryk */
.event.birthday { --dot: #c77b9e; }
.event .age { font-weight: 400; opacity: .8; }

/* ---------- Skema-valg ved tilføjelse af ny kilde ---------- */
/* Ligner en ny kilde et skema, skal valget stilles åbent i samme
   sekund — ikke gemmes stille væk som en fane man aldrig finder. */

.schedule-choice {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.schedule-choice p { margin: 0; font-size: 13.5px; color: var(--ink); }
.schedule-choice p.row-sub { color: var(--ink-faint); }

.schedule-choice-actions { display: flex; gap: 8px; margin-top: 4px; }

.schedule-choice-actions button {
  appearance: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: .5em 1.1em;
  border-radius: 999px;
  cursor: pointer;
}

.schedule-choice-yes {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.schedule-choice-yes:hover { filter: brightness(1.08); }

.schedule-choice-no {
  border: 1px solid var(--line-strong, var(--line));
  background: var(--panel);
  color: var(--ink-soft);
}
.schedule-choice-no:hover { border-color: var(--ink-soft); color: var(--ink); }

.schedule-choice-pick {
  border: 1px dashed var(--accent);
  background: none;
  color: var(--accent);
}
.schedule-choice-pick:hover { background: var(--accent-soft, var(--panel-2)); }

/* ---------- Fagvalg — én linje pr. distinkt titel ---------- */
/* "Dansk" fylder én linje her, uanset om den optræder 2 eller 200
   gange i selve kalenderen — antallet står ved siden af, ikke gentaget. */

.subject-picker { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.subject-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--panel);
}

.subject-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: 6px;
}
.subject-row:hover { background: var(--panel-2); }

.subject-row input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.subject-name { flex: 1; font-size: 13.5px; color: var(--ink); }
.subject-count { font-size: 11.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---------- Lokationsvalg ---------- */

.location-picker { display: flex; flex-direction: column; gap: 8px; }

.location-results { display: flex; flex-direction: column; gap: 4px; }

.location-result {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  padding: .5em .75em;
  border-radius: 8px;
  cursor: pointer;
}
.location-result:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Velkomst ---------- */
/* En ny familie skal kunne komme i gang uden at nogen kører et script
   for dem. Det er hele grunden til denne skærm findes. */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 20px;
}

.welcome-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.welcome-card h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.welcome-card > .row-sub { margin: -8px 0 0; font-size: 14.5px; }

.welcome-card button.primary {
  margin-left: 0;
  width: 100%;
  padding: .75em 1em;
  font-size: 16px;
  border-radius: 12px;
}
