/* Christianlog - søster til Babylog: rolig, store knapper, alt med 1-2 tryk.
   Petrol = handling, gul = noget venter på dig (pillen), grøn = gjort. */
:root {
  --bg: #eef2f1; --panel: #ffffff; --ink: #1d2a2a; --muted: #5d6e6c; --line: #d6e0de;
  --accent: #1f6461; --accent-ink: #ffffff; --accent-soft: #dcebe9;
  --due: #a8620f; --due-soft: #fbefdc; --ok: #2f7d55; --ok-soft: #e3f2e9; --stop: #8f2f2a;
  --strong-ink: #ffffff; /* tekst på de stærke farver (gul/rød knap) */
  --head: 'Fraunces', Georgia, serif; --body: 'Source Sans 3', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111816; --panel: #1b2422; --ink: #e8efed; --muted: #9fb2af; --line: #2c3936;
    --accent: #4fa49f; --accent-ink: #0d1514; --accent-soft: #1f3431;
    --due: #e3a04a; --due-soft: #3a2a14; --ok: #6cc193; --ok-soft: #173225; --stop: #d0675f;
    --strong-ink: #160d0b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
#scroll { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
main { max-width: 560px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(96px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; }

.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 2px 2px; }
.top h1 { font-family: var(--head); font-size: 1.7rem; margin: 0; }
.top .sub { color: var(--muted); font-size: .95rem; }
.navbtn { border: 0; background: transparent; color: var(--accent); font-weight: 700; font-size: 1.3rem; min-width: 44px; min-height: 44px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: grid; gap: 10px; }
.card.due { border-color: var(--due); box-shadow: 0 0 0 1px var(--due); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.card-h small { font-weight: 400; color: var(--muted); font-size: .9rem; }

.dose { display: flex; align-items: center; gap: 12px; }
.dose-text { flex: 1; min-width: 0; }
.dose-text b { display: block; }
.dose-text small { color: var(--muted); }
.dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; }
.dot.ok { background: var(--ok-soft); color: var(--ok); }
.dot.wait { background: var(--accent-soft); color: var(--accent); }
.dot.due { background: var(--due-soft); color: var(--due); }
.bar { height: 8px; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 8px; transition: width .4s ease; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.05rem; text-decoration: none; transition: transform .08s ease, opacity .15s ease; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.due { background: var(--due); color: var(--strong-ink); }
.btn.stop { background: var(--stop); color: var(--strong-ink); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .95rem; border-radius: 12px; }
.btn.danger { background: transparent; border: 1.5px solid var(--stop); color: var(--stop); }
.btn.danger.armed { background: var(--stop); color: #fff; }
.btn:disabled { opacity: .5; }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: .9rem; padding: 6px 0; min-height: 36px; }

.work { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clock { font-family: var(--head); font-size: 2.1rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.pill.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.q { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px 8px; min-height: 72px; display: grid; gap: 4px; justify-items: center; align-content: center; font-size: .85rem; font-weight: 600; }
.q svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.q.on { border-color: var(--accent); background: var(--accent-soft); }
.q small { color: var(--muted); font-weight: 400; font-size: .75rem; }

.tl { list-style: none; margin: 0; padding: 0; display: grid; }
.tl li { border-top: 1px solid var(--line); }
.tl li:first-child { border-top: 0; }
.tl button { width: 100%; border: 0; background: none; text-align: left; display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 8px; padding: 9px 0; min-height: 44px; }
.tl span { color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); margin: 0; }

/* Uge */
.chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 130px; }
.chart div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); min-width: 0; }
.chart i { width: 100%; border-radius: 6px 6px 0 0; background: var(--accent); min-height: 2px; }
.chart b { font-size: .75rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: .75rem; color: var(--muted); }
.grid7 b { display: block; font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.grid7 .ok { color: var(--ok); } .grid7 .miss { color: var(--due); }
.spark { width: 100%; height: 80px; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--accent); }

/* Formularer */
.field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.input { font: inherit; font-weight: 600; font-size: 1.05rem; width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale button { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 700; font-size: 1.1rem; }
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scale-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.med-edit { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; min-height: 44px; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); }

/* Login */
.login { min-height: 80vh; display: grid; align-content: center; justify-items: center; gap: 14px; text-align: center; }
.login img { width: 80px; height: 80px; border-radius: 20px; }
.login h1 { font-family: var(--head); font-size: 2rem; margin: 0; }
.login p { margin: 0; color: var(--muted); }
.login form { width: 100%; max-width: 340px; display: grid; gap: 10px; }
.error { color: var(--stop); font-weight: 600; margin: 0; }

/* Bundbar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs button { border: 0; background: none; min-height: 58px; font-weight: 700; color: var(--muted); }
.tabs button.active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

/* Ark nedefra */
.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 22px 22px 0 0; background: var(--panel); color: var(--ink); max-height: 90vh; }
.sheet::backdrop { background: rgba(10, 20, 19, .45); }
.sheet-in { padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
.sheet h2 { font-family: var(--head); font-size: 1.35rem; margin: 0; }
.sheet .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet[open] { animation: up .22s ease; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }

.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-weight: 600; display: flex; gap: 14px; align-items: center; max-width: calc(100% - 32px); z-index: 10; }
.toast button { border: 0; background: none; color: var(--bg); text-decoration: underline; font-weight: 700; min-height: 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
