/* Babysøvn – al stil for appen. Farver og mål ligger som variabler øverst (lyst og mørkt tema). */
:root {
  /* Skovgrønt tema. Farverne har faste betydninger: grøn = søvn, lav = vågen om dagen,
     ler = opvågning, honning = amning. Kontrast er målt til mindst 4,5:1 for tekst. */
  --bg: #f1f4f1;
  --surface: #ffffff;
  --surface2: #e4eae5;
  --ink: #16241d;
  --muted: #56665d;
  --line: #d5ded8;
  --night: #1f4d3a;
  --nap: #86ae95;
  --wake: #9cb08c;
  --wake-track: rgba(156, 176, 140, 0.26);
  --night-track: rgba(31, 77, 58, 0.22);
  --wk-track: rgba(196, 87, 75, 0.25);
  --feed-ring: #d9a23a;
  --feed-ink: #8a5c1b;
  --wk: #c4574b;
  --danger: #b24a3a;
  --ok: #3e8a62;
  --primary: #1f4d3a;
  --on-primary: #eef4f0;
  --accent: #1f4d3a;
  --toast-bg: #ddeae1;
  --toast-line: rgba(31, 77, 58, 0.45);
  --wave: #6e8d5c;
  --wave-alpha: 0.43;
  --orb-awake: #ffffff;
  --orb-nap: #e1ece4;
  --orb-night: #ddeae1;
  --orb-night-ink: #16241d;
  --orb-wk: #f6e6df;
  --halo: rgba(31, 77, 58, 0.14);
  --glow: rgba(31, 77, 58, 0.42);
  --shadow: 0 1px 2px rgba(22, 36, 29, 0.06), 0 6px 20px rgba(22, 36, 29, 0.06);
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #132119;
    --surface: #192a21;
    --surface2: #1f3228;
    --ink: #c2cfc7;
    --muted: #8fa196;
    --line: #273b30;
    --night: #4b896a;
    --nap: #9ec4ad;
    --wake: #86a07a;
    --wake-track: rgba(134, 160, 122, 0.26);
    --night-track: rgba(75, 137, 106, 0.3);
    --wk-track: rgba(212, 111, 98, 0.3);
    --feed-ring: #e3b354;
    --feed-ink: #d9b880;
    --wk: #d46f62;
    --danger: #d07a66;
    --ok: #6db08a;
    --primary: #3d7559;
    --on-primary: #eaf2ec;
    --accent: #8cc7a6;
    --toast-bg: #24453a;
    --toast-line: rgba(140, 199, 166, 0.45);
    --wave: #a7c496;
    --wave-alpha: 0.25;
    --orb-awake: #192a21;
    --orb-nap: #1c3226;
    --orb-night: #172e22;
    --orb-night-ink: #b8c8be;
    --orb-wk: #2e2823;
    --halo: rgba(75, 137, 106, 0.16);
    --glow: rgba(120, 190, 150, 0.34);
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #132119;
  --surface: #192a21;
  --surface2: #1f3228;
  --ink: #c2cfc7;
  --muted: #8fa196;
  --line: #273b30;
  --night: #4b896a;
  --nap: #9ec4ad;
  --wake: #86a07a;
  --wake-track: rgba(134, 160, 122, 0.26);
  --night-track: rgba(75, 137, 106, 0.3);
  --wk-track: rgba(212, 111, 98, 0.3);
  --feed-ring: #e3b354;
  --feed-ink: #d9b880;
  --wk: #d46f62;
  --danger: #d07a66;
  --ok: #6db08a;
  --primary: #3d7559;
  --on-primary: #eaf2ec;
  --accent: #8cc7a6;
  --toast-bg: #24453a;
  --toast-line: rgba(140, 199, 166, 0.45);
  --wave: #a7c496;
  --wave-alpha: 0.25;
  --orb-awake: #192a21;
  --orb-nap: #1c3226;
  --orb-night: #172e22;
  --orb-night-ink: #b8c8be;
  --orb-wk: #2e2823;
  --halo: rgba(75, 137, 106, 0.16);
  --glow: rgba(120, 190, 150, 0.34);
  --shadow: none;
  color-scheme: dark;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
  height: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
input,
select,
textarea {
  font: inherit;
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
img,
svg {
  max-width: 100%;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 18px calc(92px + env(safe-area-inset-bottom, 0px));
}
h1 {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 0;
}
h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 10px;
}
.sub {
  color: var(--muted);
  font-size: 0.92rem;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.section {
  margin-top: 26px;
}
.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}

.iconbtn {
  border: 0;
  background: var(--surface);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.iconbtn svg {
  width: 22px;
  height: 22px;
}
.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  min-height: 48px;
  font-weight: 600;
  background: var(--surface2);
}
.btn.primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn.ghost {
  background: transparent;
  border: 1.5px solid var(--line);
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn.block {
  width: 100%;
}
.link {
  border: 0;
  background: none;
  padding: 10px 0;
  color: var(--accent);
  font-weight: 600;
}

/* Orb */
.orbwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 22px;
}
.orb {
  position: relative;
  width: min(74vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 26px;
  transition:
    transform 0.12s ease,
    background-color 0.4s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.orb:active {
  transform: scale(0.965);
}
.orb {
  gap: calc(12px * var(--ofs, 1));
}
.orb > span {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  line-height: 1.25;
  text-wrap: balance;
}
.orb .st {
  font-size: calc(clamp(1rem, 4.9vw, 1.1875rem) * var(--ofs, 1));
  font-weight: 600;
  opacity: 0.9;
}
.orb .big {
  font-family: var(--font-num);
  font-weight: 400;
  font-size: calc(clamp(2.2rem, 11vw, 3rem) * var(--ofs, 1));
  line-height: 1.05 !important;
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.orb .hint {
  font-size: calc(clamp(0.95rem, 4.6vw, 1.125rem) * var(--ofs, 1));
  opacity: 0.8;
}
.orb .feedl {
  font-size: calc(clamp(0.95rem, 4.6vw, 1.125rem) * var(--ofs, 1));
  color: var(--feed-ink);
}
.orb.awake {
  background: var(--orb-awake);
  box-shadow: inset 0 0 0 9px var(--wake);
}
.orb.nap {
  background: var(--orb-nap);
  box-shadow: inset 0 0 0 9px var(--nap);
}
.orb.night {
  background: var(--orb-night);
  color: var(--orb-night-ink);
  box-shadow: inset 0 0 0 9px var(--night);
}
.orb.waking {
  background: var(--orb-wk);
  box-shadow: inset 0 0 0 9px var(--wk);
}
/* Fremskridtsring: selve knappens kant, tegnet som konisk gradient, med knappens fyld ovenpå */
.orb.prog {
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--rt) 0);
}
.orb.prog::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--ofill);
  pointer-events: none;
}
/* Bølger i vågentid tegnes her (js/orbmotion.js): inden for ringen og under teksten. */
.orb > .orbfx {
  position: absolute;
  inset: 9px;
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.orb.awake.prog {
  --rc: var(--wake);
  --rt: var(--wake-track);
  --ofill: var(--orb-awake);
}
.orb.night.prog {
  --rc: var(--night);
  --rt: var(--night-track);
  --ofill: var(--orb-night);
}
.orb.waking.prog {
  --rc: var(--feed-ring);
  --rt: var(--wk-track);
  --ofill: var(--orb-wk);
}
.orb.flash {
  animation: flash 0.55s ease-out;
}
@keyframes flash {
  0% {
    transform: scale(0.94);
    filter: brightness(1.7);
  }
  100% {
    transform: scale(1);
    filter: none;
  }
}
/* Glorien ånder inde i knappen, så den aldrig rammer knapperne under den */
/* Ånde: et blødt skær inde i ringen tones op og ned, mens barnet sover. Styrken (--breath, 0–1)
   sættes af js/breath.js, så det også virker, hvis telefonen har slået browserens animationer fra.
   Skæret ligger 9 px inde, altså inden for ringen, og kan ikke ramme noget uden for knappen. */
.orb.sleeping::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 52px 20px var(--glow);
  opacity: var(--breath, 0);
  pointer-events: none;
}
@keyframes flashsoft {
  0% {
    filter: brightness(1.7);
  }
  100% {
    filter: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .orb.flash {
    animation: flashsoft 0.5s ease-out;
  }
  .orb {
    transition: none;
  }
}

.seg {
  display: inline-flex;
  background: var(--surface2);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 10px 18px;
  border-radius: 11px;
  font-weight: 600;
  min-height: 42px;
  color: var(--muted);
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.seg.full {
  display: flex;
}
.seg.full button {
  flex: 1;
}
.orbactions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.orbactions .btn {
  min-width: 220px;
}
.orbactions .sub {
  text-align: center;
  text-wrap: balance;
  max-width: 320px;
}
.chip {
  border: 1.5px solid var(--line);
  background: transparent;
  border-radius: 14px;
  min-height: 50px;
  min-width: 220px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.chip.on {
  background: var(--wake);
  border-color: var(--wake);
  color: #1a1208;
}

/* Bars */
.barbox {
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}
svg.bar {
  width: 100%;
  height: 28px;
  display: block;
}
.b-bg {
  fill: var(--surface2);
}
.b-grid {
  fill: var(--line);
}
.b-night {
  fill: var(--night);
}
.b-tick {
  fill: var(--wk);
}
.b-tick-f {
  fill: var(--feed-ring);
}
.b-nap {
  fill: var(--nap);
}
.b-wk {
  fill: var(--wk);
}
.b-now {
  fill: var(--wake);
}
.b-future {
  fill: var(--bg);
  opacity: 0.55;
}
.axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stats.three {
  grid-template-columns: repeat(3, 1fr);
}
.stat {
  background: var(--surface);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.stat .v {
  display: block;
  font-family: var(--font-num);
  font-size: 1.3rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat .l {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--surface);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-height: 56px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}
.dot.nap {
  background: var(--nap);
}
.dot.night {
  background: var(--night);
}
.item .main {
  flex: 1;
  min-width: 0;
}
.item .t {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.item .d {
  color: var(--muted);
  font-size: 0.85rem;
}
.item .r {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  white-space: nowrap;
}
.dayrow {
  display: grid;
  grid-template-columns: 78px 1fr 62px;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  padding: 6px 0;
  text-align: left;
}
.dayrow .dl {
  font-size: 0.85rem;
  line-height: 1.2;
}
.dayrow .dl b {
  display: block;
  font-weight: 600;
}
.dayrow .ds {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.band svg.bar {
  height: 18px;
}
.band .dayrow {
  padding: 7px 0;
  grid-template-columns: 72px 1fr;
} /* hver række kan trykkes: mindst 32 px høj */

textarea {
  width: 100%;
  min-height: 110px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}
.field input,
.field select {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 1rem;
}
.field input[type="datetime-local"],
.field input[type="date"],
.field input[type="time"] {
  min-width: 0;
}
.inline2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.err {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 12px;
  min-height: 1.2em;
}
.note-preview {
  white-space: pre-wrap;
}

/* Tabs */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 20;
}
.tabs .in {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.tabs button {
  border: 0;
  background: none;
  padding: 9px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  min-height: 58px;
}
.tabs button svg {
  width: 24px;
  height: 24px;
}
.tabs button[aria-current="page"] {
  color: var(--ink);
}
.tabs button[aria-current="page"] svg {
  color: var(--accent);
}

/* Toast */
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  max-width: 536px;
  margin: 0 auto;
  background: var(--toast-bg);
  color: var(--ink);
  border: 1.5px solid var(--primary);
  border-radius: 16px;
  padding: 10px 10px 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.16);
}
.toast[hidden] {
  display: none;
}
.toast .m {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
/* Beskeden efter tryk: lys skovgrøn med grøn kant. Fortryd er den vigtigste handling og er fremhævet. */
.toast button {
  border: 1.5px solid var(--toast-line);
  background: transparent;
  color: inherit;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.85rem;
  min-height: 40px;
}
.toast button[data-act="tUndo"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* Sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sheet[hidden] {
  display: none;
}
.sheet .back {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.5);
  border: 0;
}
.sheet .card {
  position: relative;
  border-radius: 22px 22px 0 0;
  max-height: 92%;
  overflow-y: auto;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
.sheet .grab {
  width: 48px;
  height: 25px;
  padding: 10px 0;
  background: var(--line);
  background-clip: content-box;
  border-radius: 3px;
  margin: -14px auto 4px;
  cursor: grab;
  touch-action: none;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.actions .btn {
  flex: 1;
}

.hist {
  width: 100%;
  height: auto;
  display: block;
}
.hist text {
  fill: var(--muted);
  font-size: 13px;
  font-family: var(--font-ui);
}
.hist .h-long {
  fill: var(--night);
}
.hist .h-mid {
  fill: var(--nap);
}
.h-short {
  fill: var(--nap);
  opacity: 0.45;
}
/* Farveprøver i forklaringen til lurenes graf (lang · mellem · kort) */
.h-long-sw,
.h-mid-sw,
.h-short-sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.h-long-sw {
  background: var(--night);
}
.h-mid-sw {
  background: var(--nap);
}
.h-short-sw {
  background: var(--nap);
  opacity: 0.45;
}
table.tt {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.tt td {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table.tt td:last-child {
  text-align: right;
}

.empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
}

/* Standalone-tilføjelser */
.syncpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.syncpill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}
.syncpill.wait i {
  background: var(--wake);
}
.syncpill.off i {
  background: var(--wk);
}
.code {
  font-family: var(--font-num);
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 4px;
  user-select: all;
  -webkit-user-select: all;
}
.onb {
  max-width: 460px;
  margin: 0 auto;
  padding-top: 28px;
}
.onb .field input {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.onb .field input#obName {
  text-transform: none;
  letter-spacing: 0;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 26px 0 6px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
body.onboarding .tabs {
  display: none;
}
.grp {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
  margin: 18px 2px 8px;
}
.seg.five button {
  padding: 10px 4px;
  font-size: 0.88rem;
}
.dt {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}
.nudge {
  border: 0;
  background: var(--surface2);
  border-radius: 12px;
  min-width: 50px;
  height: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.nudge:disabled {
  opacity: 0.45;
}
.wk {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 12px;
}

/* Foldbare grupper og lister (Seneste og Dage) */
.grp-box {
  margin-top: 6px;
}
.grp-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: none;
  padding: 10px 2px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 44px;
  text-align: left;
}
.grp-m {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}
.chev {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  flex: none;
  padding-left: 8px;
}
.item .chev {
  font-size: 1.4rem;
}
.ncard {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.item.flat {
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}
.foldline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  padding: 11px 14px;
  min-height: 46px;
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}
.foldline.feed {
  color: var(--feed-ink);
}
.wlist {
  padding: 2px 12px 12px;
}
.wrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border: 0;
  background: none;
  text-align: left;
  border-left: 4px solid var(--wk);
  padding: 6px 0 6px 10px;
  margin: 4px 0;
}
.wrow.f {
  border-color: var(--feed-ring);
}
.wrow.open {
  background: rgba(224, 112, 95, 0.08);
  border-radius: 0 10px 10px 0;
}
.wrow .tm {
  width: 92px;
  flex: none;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.wrow .l {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}
.wrow .l small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
}
.addw {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.addw b {
  font-size: 1.2rem;
  color: var(--ink);
}
/* Swipe for at slette: rækken glider til side, og en rød skraldespand kommer frem bagved. */
.swipe {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}
.swipe.wake {
  border-radius: 0;
}
.swipe-fg {
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
}
.swipe.wake .swipe-fg {
  background: var(--surface);
}
.swipe.dragging .swipe-fg {
  transition: none;
}
.swipe.open .swipe-fg {
  transform: translateX(-76px);
}
.swipe-del {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 56px;
  height: 44px;
  margin-top: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--danger);
  border-radius: 12px;
  background: transparent;
  color: var(--danger);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.swipe.open .swipe-del,
.swipe.dragging .swipe-del {
  opacity: 1;
}
.swipe.open .swipe-del {
  pointer-events: auto;
}

.empty-line {
  margin: 2px 2px 6px;
  color: var(--muted);
  font-size: 0.92rem;
}
h3.grp:first-of-type {
  margin-top: 6px;
}

/* Tidsfelt og hjulvælger */
.dtf {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 0 10px;
  font-size: 1rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.dtf:disabled {
  opacity: 0.45;
}
.sheet.picker {
  z-index: 50;
}
.wheels {
  position: relative;
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 6px;
  margin: 14px 0 4px;
  height: 200px;
}
.wband {
  position: absolute;
  left: 0;
  right: 0;
  top: 80px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface2);
  pointer-events: none;
}
.wheel {
  position: relative;
  height: 200px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel::-webkit-scrollbar {
  display: none;
}
.wpad {
  height: 80px;
}
.wopt {
  height: 40px;
  line-height: 40px;
  scroll-snap-align: center;
  font-size: 1.1rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.wopt.on {
  color: var(--ink);
  font-weight: 700;
}

/* Rapportindhold, amningsgraf, enheder */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.rchip {
  border: 1.5px solid var(--line);
  background: none;
  border-radius: 12px;
  padding: 8px 12px;
  min-height: 40px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
}
.rchip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.rchip:disabled {
  opacity: 0.4;
}
.fbars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
  margin-top: 6px;
}
.fb {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.fcol {
  width: 100%;
  max-width: 28px;
  background: var(--feed-ring);
  border-radius: 5px 5px 0 0;
}
.fv {
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fk {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}
.devrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.devrow .main {
  display: flex;
  flex-direction: column;
}
.devrow .t {
  font-weight: 600;
}
.devrow .d {
  color: var(--muted);
  font-size: 0.85rem;
}
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.stats.three .stat .v {
  font-size: clamp(1rem, 4.6vw, 1.3rem);
  white-space: nowrap;
}
.filebtn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.implist {
  margin: 14px 0 0;
  padding-left: 20px;
  line-height: 1.7;
}
/* Boble over tidslinjen */
.barbox.tap {
  position: relative;
  cursor: pointer;
  touch-action: none;
}
.barcur {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink);
  opacity: 0.8;
  pointer-events: none;
}
#bub {
  position: fixed;
  z-index: 35;
  max-width: calc(100vw - 16px);
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  font-variant-numeric: tabular-nums;
  text-align: left;
}
#bub small {
  font-weight: 500;
  opacity: 0.75;
  margin-left: 4px;
}
#bub[hidden],
#bubPtr[hidden] {
  display: none;
}
#bubPtr {
  position: fixed;
  z-index: 35;
  width: 0;
  height: 0;
  border: 7px solid transparent;
  border-top-color: var(--ink);
  border-bottom: 0;
  pointer-events: none;
}
.nextline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
.nextline b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.suggest {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 6px 2px 0;
}
/* Langt tryk på den store knap: cirklens egen ring tømmes og fyldes igen i sin egen farve,
   og fladen beholder cirklens farve. Ringen tegnes i hele pixel præcis oven på cirklens 9 px ring. */
.orb {
  -webkit-touch-callout: none;
}
.orb.night {
  --pring: var(--night);
  --ptrack: var(--night-track);
  --pfill: var(--orb-night);
}
.orb.waking {
  --pring: var(--wk);
  --ptrack: var(--wk-track);
  --pfill: var(--orb-wk);
}
.orb.pressing {
  background: var(--pfill) !important;
  box-shadow: inset 0 0 0 9px var(--ptrack) !important;
}
.orb.pressing::before,
.orb.pressing::after {
  display: none;
}
.orb .press {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--pfill);
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}
.orb .press b {
  font-family: var(--font-num);
  font-weight: 400;
  font-size: clamp(1.4rem, 6.5vw, 1.8rem);
}
.orb .press small {
  font-size: 0.9rem;
  opacity: 0.75;
}
.orb > svg.pressring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  transform: rotate(-90deg);
  pointer-events: none;
  z-index: 3;
}
.orb > svg.pressring circle {
  fill: none;
  stroke: var(--pring);
  stroke-width: 9;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: pressfill 1s linear forwards;
}
@keyframes pressfill {
  to {
    stroke-dashoffset: 0;
  }
}
.holdhint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
.holdhint b {
  color: var(--ink);
}
.holdhint.flash {
  animation: hintflash 0.9s ease;
}
@keyframes hintflash {
  0%,
  100% {
    opacity: 1;
  }
  30% {
    opacity: 0.35;
  }
  60% {
    opacity: 1;
  }
}
/* Indsigt */
.howline {
  margin: 10px 2px 6px;
}
.card.how {
  margin: 4px 0 10px;
}
.card.how p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}
.band .dayrow .dl {
  white-space: nowrap;
  font-size: 0.8rem;
}
.band .dayrow .dl b {
  display: inline;
}
.wsum {
  margin: 6px 0 4px;
  color: var(--feed-ink);
  font-size: 0.85rem;
  font-weight: 600;
}
/* Indstillinger: ens kort med rækker */
.setcard {
  padding: 2px 14px;
}
.srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  font-size: 0.95rem;
  color: var(--ink);
}
.srow:last-child {
  border-bottom: 0;
}
.srow > span:first-child {
  flex: 1;
  min-width: 0;
}
.srow input:not([type]),
.srow input[type="text"],
.srow input[type="time"],
.srow select {
  flex: none;
  box-sizing: border-box;
  width: var(--setctl);
  min-height: 42px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.95rem;
  color: var(--ink);
  font-family: inherit;
}
/* Alle felter i Indstillinger står i samme kolonne med samme bredde */
.setcard {
  --setctl: clamp(8.75rem, 41%, 12rem);
}
.sctl {
  flex: none;
  width: var(--setctl);
  display: flex;
}
.sctl.end {
  justify-content: flex-end;
}
.srow-r {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.setnote {
  margin: 6px 4px 0;
}
.sheetrow {
  border-bottom: 0;
  margin-top: 6px;
}
/* Kontakt (til/fra) */
.switch {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1.5px solid var(--line);
  position: relative;
  flex: none;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 0.2s,
    background 0.2s;
}
.switch:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.switch:checked::after {
  transform: translateX(20px);
  background: var(--on-primary);
}
/* Ark kan trækkes ned for at lukke */
.sheet .card {
  transition: transform 0.2s ease;
}
.sheet .card.dragging {
  transition: none;
}
/* Berøring: vandrette swipes tilhører appen (skift dag); lodret rulning og zoom virker som normalt.
   Uden dette overtager telefonen bevægelsen og afbryder den, før appen ser swipet. */
#view {
  touch-action: pan-y pinch-zoom;
}
/* Ark: håndtag og overskrift kan trækkes ned uden at telefonen ruller siden eller genindlæser. */
.sheet .card {
  overscroll-behavior: contain;
}
.sheet .card > h2:first-of-type {
  touch-action: none;
}
.appver {
  text-align: center;
  margin: 22px 0 4px;
  opacity: 0.75;
}
.appver .link {
  padding: 0;
}
.filerow {
  gap: 8px;
}
.filerow .btn:first-child {
  flex: 1;
}
.filerow .btn:last-child {
  flex: none;
  padding-left: 16px;
  padding-right: 16px;
}
/* Felterne under tidslinjen kan trykkes (alle tal) og holdes (vælg tal) */
.tilebtn {
  text-align: left;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* Felterne fordeles altid ligeligt; labels står på én linje og skaleres lidt ned på smalle skærme */
.stats.three.tilesnow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tilebtn {
  position: relative;
  padding: 12px 7px 12px 10px;
}
.tilebtn .l {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.68rem, 3.05vw, 0.82rem);
}
.tilebtn .v {
  font-size: clamp(0.88rem, 4.4vw, 1.3rem);
}
.tilebtn .auto {
  position: absolute;
  top: 7px;
  right: 9px;
  font-style: normal;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.9;
}
.eqrow {
  gap: 8px;
}
.eqrow .btn {
  flex: 1;
}
.tlist .trow,
.picklist .pickrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.tlist .trow span {
  flex: 1;
  color: var(--muted);
}
.tlist .trow b {
  font-variant-numeric: tabular-nums;
}
.picklist {
  margin-top: 8px;
  max-height: 46vh;
  overflow: auto;
}
.pickrow {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  min-height: 46px;
  cursor: pointer;
}
.pickrow span:first-child {
  flex: 1;
}
.pickrow .pv {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.pickrow .ck {
  width: 18px;
  color: var(--primary);
  font-weight: 700;
}
.pickrow.on span:first-child {
  font-weight: 700;
}
/* Putteritual og trøsteplan */
.chiprow {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: min(100%, 360px);
}
.chiprow .chip {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}
.chip.plan {
  color: var(--ink);
}
.plansteps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pstep {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.35;
  min-height: 52px;
  cursor: pointer;
}
.pstep .pn {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  font-weight: 700;
  font-size: 0.9rem;
}
.pstep .pt {
  padding-top: 2px;
}
.pstep.done {
  opacity: 0.55;
}
.pstep.done .pt {
  text-decoration: line-through;
}
.pstep.done .pn {
  background: var(--primary);
  color: var(--on-primary);
}
.pstep.cur {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.pstep.cur .pn {
  background: var(--primary);
  color: var(--on-primary);
}
.pedit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.perow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.perow .pn {
  flex: none;
  width: 24px;
  padding-top: 12px;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}
.perow .pin {
  flex: 1;
  min-width: 0;
  resize: none;
  field-sizing: content;
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
.pbtns {
  display: flex;
  gap: 2px;
  padding-top: 4px;
}
.pbtns button {
  width: 34px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: var(--surface2);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.pbtns button:disabled {
  opacity: 0.35;
  cursor: default;
}
.code.urlcode {
  font-size: 1.05rem;
  word-break: break-all;
  letter-spacing: 0;
}

/* ---------- Små hjælpeklasser til afstand og enkeltstående justeringer ----------
   Erstatter tidligere inline-stil i skabelonerne. !important giver dem samme forrang, som inline-stil havde. */
.box-22 {
  width: 22px !important;
  height: 22px !important;
}
.d-block {
  display: block !important;
}
.danger-list {
  color: var(--danger) !important;
  padding: 6px 0 6px 12px !important;
}
.fw-600 {
  font-weight: 600 !important;
}
.gap-8 {
  gap: 8px !important;
}
.m-0 {
  margin: 0 !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-10 {
  margin-bottom: 10px !important;
}
.mb-2 {
  margin-bottom: 2px !important;
}
.mb-6 {
  margin-bottom: 6px !important;
}
.minh-0 {
  min-height: 0 !important;
}
.ml-0 {
  margin-left: 0 !important;
}
.ml-2 {
  margin-left: 2px !important;
}
.ml-82 {
  margin-left: 82px !important;
}
.ml-88 {
  margin-left: 88px !important;
}
.mr-0 {
  margin-right: 0 !important;
}
.mr-2 {
  margin-right: 2px !important;
}
.mr-72 {
  margin-right: 72px !important;
}
.mt-0 {
  margin-top: 0 !important;
}
.mt-10 {
  margin-top: 10px !important;
}
.mt-12 {
  margin-top: 12px !important;
}
.mt-14 {
  margin-top: 14px !important;
}
.mt-16 {
  margin-top: 16px !important;
}
.mt-18 {
  margin-top: 18px !important;
}
.mt-22 {
  margin-top: 22px !important;
}
.mt-4 {
  margin-top: 4px !important;
}
.mt-6 {
  margin-top: 6px !important;
}
.mt-8 {
  margin-top: 8px !important;
}
.p-0 {
  padding: 0 !important;
}
.pl-18 {
  padding-left: 18px !important;
}
.sw-nap {
  background: var(--nap) !important;
}
.sw-night {
  background: var(--night) !important;
}
.sw-wk {
  background: var(--wk) !important;
}
/* Pilen til næste dag er dæmpet, når den ikke kan bruges (i dag) */
.iconbtn:disabled {
  opacity: 0.35;
}
