:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2f6fed;
  --ok: #3aa76d;
  --warn: #e0a100;
  --over: #d9534f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --card: #1a1f26;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --line: #2a313b;
    --accent: #6d9cff;
  }
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 72px;
}
main { padding: 16px; max-width: 640px; margin: 0 auto; }
h1 { font-size: 1.3rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 20px 0 8px; color: var(--muted); font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.big { font-size: 1.6rem; font-weight: 700; }
.bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.over > span { background: var(--over); }
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav a { color: var(--muted); font-size: 0.8rem; text-align: center; flex: 1; }
.nav a.active { color: var(--accent); font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pager a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
form.inline { display: inline; }
input, select, button {
  font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); width: 100%;
}
button { background: var(--accent); color: #fff; border: none; cursor: pointer; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: transparent; color: var(--over); border: 1px solid var(--over); padding: 6px 10px; width: auto; font-size: 0.85rem; }
button.small { padding: 6px 10px; width: auto; font-size: 0.85rem; }
.grid { display: grid; gap: 8px; }
.grid.two { grid-template-columns: 1fr 1fr; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 6px 0 4px; }
.error { color: var(--over); margin-bottom: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .hd { text-align: center; font-size: 0.75rem; color: var(--muted); }
.cal a, .cal div.cell {
  display: block; min-height: 52px; border-radius: 8px; padding: 4px; font-size: 0.8rem;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
}
.cal .out { opacity: 0.35; }
.cal .today { border-color: var(--accent); }
.cal .ok { background: color-mix(in srgb, var(--ok) 22%, var(--card)); }
.cal .warn { background: color-mix(in srgb, var(--warn) 28%, var(--card)); }
.cal .over { background: color-mix(in srgb, var(--over) 25%, var(--card)); }
.cal .k { display: block; font-weight: 600; margin-top: 4px; }
details summary { cursor: pointer; color: var(--accent); }
.tag { font-size: 0.75rem; color: var(--muted); }
canvas { max-width: 100%; }

/* Åbningsbillede på login-siden */
.hero {
  position: relative; border-radius: 16px; overflow: hidden; margin: -4px 0 14px;
  aspect-ratio: 4 / 3; background: #1a1f26;
}
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; display: block; }
.hero-text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px 14px;
  background: linear-gradient(to top, rgba(10, 14, 20, 0.85), rgba(10, 14, 20, 0));
  color: #fff;
}
.hero-text h1 { color: #fff; margin: 0 0 4px; font-size: 1.5rem; }
.hero-text p { margin: 0; opacity: 0.9; font-size: 0.95rem; }

/* PWA / app-fornemmelse */
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.nav { padding-bottom: calc(10px + env(safe-area-inset-bottom)); user-select: none; -webkit-user-select: none; }
.nav a { padding: 4px 2px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.nav .ic { font-size: 1.05rem; line-height: 1; }
a, button, .cal a, details summary { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; transition: transform 80ms ease, opacity 80ms ease; }
button:active { transform: scale(0.97); opacity: 0.85; }
button.small, button.danger { min-height: 36px; }
input, select { min-height: 44px; font-size: 16px; } /* 16px forhindrer auto-zoom på iOS */
.card { transition: none; }
.install { position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 20; }
.install .card { box-shadow: 0 8px 24px rgba(0,0,0,0.25); margin: 0; }
@media (display-mode: standalone) {
  .hero { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* Tale og tekst */
.mic {
  width: 64px; height: 64px; min-height: 64px; border-radius: 50%; font-size: 1.6rem;
  background: var(--accent); color: #fff; flex: none; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.mic.rec { background: var(--over); animation: pulse 1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,83,79,0.5); } 100% { box-shadow: 0 0 0 14px rgba(217,83,79,0); } }
.bubble { margin-top: 8px; padding: 10px 12px; border-radius: 12px; white-space: pre-wrap; font-size: 0.95rem; }
.bubble.me { background: color-mix(in srgb, var(--accent) 15%, var(--card)); }
.bubble.bot { background: var(--bg); border: 1px solid var(--line); }
.bubble.alert { background: color-mix(in srgb, var(--warn) 25%, var(--card)); font-weight: 600; }
