/* Dråber – app-specifik styling ovenpå ui.css */
:root {
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --taken: var(--ok);
  --due: var(--warn);
  --late: var(--danger);
  --ring-track: #d8dee8;
  --fridge: #0369a1;
}
html[data-theme="dark"] {
  --accent: #4d8aff;
  --accent-ink: #0b1220;
  --ring-track: #2a313c;
  --fridge: #7dd3fc;
}

/* Header-chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips:empty { display: none; }
#fridgeChip { background: color-mix(in srgb, var(--fridge) 14%, var(--surface)); color: var(--fridge); }
#fridgeChip .ic { width: 14px; height: 14px; }
body.fridge-day .top { box-shadow: inset 3px 0 0 var(--fridge); }
body.fridge-day #dateLabel { color: var(--fridge); font-weight: 650; }

/* Hjem-layout: header / scroll / dock / tabbar */
.view-home {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-bottom: var(--tab-space);
}
.home-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.home-dock { padding-top: 10px; }
.home-dock.complete #takeBtn { display: none; }
#undoBtn { margin-top: 2px; }
#firstDoseToggle { text-align: left; justify-content: flex-start; padding-left: 4px; min-height: 40px; }
#firstDoseForm { margin-bottom: 10px; }

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 12px;
  flex: 0 0 auto;
}
.ring-wrap { display: none; position: relative; width: 72px; height: 72px; flex: 0 0 72px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--ring-track); stroke-width: 7; }
.ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; }
.ring-label strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; }
.hero-copy { flex: 1; min-width: 0; }
.next {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pace { margin: 6px 0 0; color: var(--muted); font-size: 0.86rem; }
.pace.late { color: var(--late); }
.pace.due { color: var(--due); }

/* Plan-tavle: fylder resten af skærmen, men scroller hvis den ikke kan passe */
.plan-board {
  container-type: size;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.plan-groups {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.plan-groups::-webkit-scrollbar { display: none; }
.plan-board.can-scroll .plan-groups {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}
.plan-row {
  display: flex;
  flex-direction: column;
  flex: var(--rows, 1) 0 auto;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.plan-board .dose {
  list-style: none;
  flex: 1 0 auto;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-left: 3px solid transparent;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.8125rem, 3.8cqh, 1rem);
  letter-spacing: -0.01em;
}
.plan-row .dose + .dose { border-top: 1px solid var(--line); }
.dose .mark {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px;
  border: 1.8px solid var(--line);
  display: grid; place-items: center; color: var(--accent-ink);
}
.dose .mark svg { width: 11px; height: 11px; }
.dose.done { color: var(--muted); }
.dose.done .mark { background: var(--taken); border-color: var(--taken); color: #fff; }
.dose.due { color: var(--due); font-weight: 700; border-left-color: var(--due); }
.dose.due .mark { border-color: var(--due); }
.dose.late { color: var(--late); font-weight: 700; border-left-color: var(--late); }
.dose.late .mark { border-color: var(--late); }
.dose .when { flex: 1; }
.dose .tag { font-size: 0.72rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.dose.due .tag { color: var(--due); }
.dose.late .tag { color: var(--late); }
.pause-rail {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pause-rail::before, .pause-rail::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Dag fuldført */
body.day-complete .hero { justify-content: center; flex-direction: column; text-align: center; padding-top: 10vh; }
body.day-complete .ring-wrap { display: block; width: 150px; height: 150px; flex-basis: 150px; }
body.day-complete .ring-label strong { font-size: 2rem; }
body.day-complete .plan-board, body.day-complete #firstDoseWrap { display: none !important; }

/* Historik */
.page-title { font-size: 1.7rem; margin: 6px 0 14px; }
.cal-card { padding: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.cal .cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  padding: 0;
  display: grid; place-items: center;
}
.cal .cell.done { background: var(--taken); color: white; }
.cal .cell.partial { background: color-mix(in srgb, var(--due) 55%, var(--surface)); color: var(--ink); }
.cal .cell.miss { background: color-mix(in srgb, var(--late) 22%, var(--surface)); }
.cal .cell.empty { background: transparent; }
.cal .cell.selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal .cell.today { font-weight: 800; color: var(--ink); }
.cal .cell.today.done { color: #fff; }
.cal-detail { margin: 12px 2px 0; font-size: 0.84rem; min-height: 1.3em; }
.legend {
  display: flex; gap: 14px; list-style: none; padding: 12px 4px 0; margin: 0;
  color: var(--muted); font-size: 0.78rem;
}
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.swatch.done { background: var(--taken); }
.swatch.partial { background: var(--due); }
.swatch.miss { background: color-mix(in srgb, var(--late) 40%, var(--surface)); }
#statsSummary { margin: 12px 4px 0; }

/* Auth */
.view-auth .wordmark .ic { color: var(--accent); }
#authBackupWrap .surface { margin-bottom: 10px; }
