:root {
  --bg: #f6f5ff;
  --card: #ffffff;
  --text: #1f1d3a;
  --muted: #6b6889;
  --line: #e4e2f3;
  --accent: #5b5bd6;
  --accent-soft: #ecebfd;
  --accent-text: #ffffff;
  --danger: #d93a3f;
  --danger-soft: #fdecec;
  --ok: #2f9e5f;
  --m1: #e5484d;
  --m2: #f2843a;
  --m3: #f2c230;
  --m4: #8cc152;
  --m5: #2f9e5f;
  --radius: 18px;
  --shadow: 0 2px 10px rgb(40 30 120 / 0.07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15141f;
    --card: #1f1e2d;
    --text: #edecf8;
    --muted: #a3a1bd;
    --line: #34324a;
    --accent: #8b8bf5;
    --accent-soft: #2b2a48;
    --accent-text: #15141f;
    --danger: #ff6b6f;
    --danger-soft: #3a1d22;
    --ok: #4cc584;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 640px; width: 100%; margin: 0 auto;
}
.logo {
  display: flex; align-items: center; gap: 8px; border: 0; background: none;
  font-weight: 700; font-size: 18px; cursor: pointer; padding: 4px;
}
.icon-btn {
  border: 0; background: var(--card); color: var(--muted); width: 42px; height: 42px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}
.icon-btn.on { color: var(--accent); }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px 24px; outline: none; }
.anim { animation: in .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .anim { animation: none; } }

h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 4px; }
h2 { font-size: 20px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }

/* smileys */
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 6px; }
.mood {
  border: 3px solid transparent; background: none; border-radius: 50%; padding: 4px; cursor: pointer;
  aspect-ratio: 1; display: grid; place-items: center; transition: transform .15s, border-color .15s;
}
.mood svg { width: 100%; height: 100%; max-width: 72px; }
.mood:hover { transform: scale(1.06); }
.mood[aria-pressed="true"] { border-color: var(--text); transform: scale(1.1); }
.moods.picked .mood[aria-pressed="false"] { opacity: .45; }
.mood-label { text-align: center; min-height: 1.5em; font-weight: 600; margin-bottom: 14px; }

textarea, input[type="text"], input[type="time"] {
  width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px;
}
textarea { min-height: 90px; resize: vertical; }
textarea:focus, input:focus { border-color: var(--accent); outline: none; }
label.field { display: block; font-weight: 600; margin-bottom: 6px; }

.actions { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 480px) { .actions.two { grid-template-columns: 1fr 1fr; } }
.btn {
  border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-text); text-align: center; text-decoration: none; display: block;
}
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: none; color: var(--muted); font-weight: 600; }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* week */
.week { display: flex; justify-content: space-between; gap: 4px; }
.day { text-align: center; font-size: 13px; color: var(--muted); flex: 1; }
.day .dot { width: 28px; height: 28px; margin: 4px auto 0; border-radius: 50%; background: var(--line); display: grid; place-items: center; }
.day .dot svg { width: 28px; height: 28px; }

/* vragen */
.checks { display: grid; gap: 8px; }
.check {
  display: flex; gap: 12px; align-items: center; background: var(--card); border: 2px solid var(--line);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
}
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.check.done { opacity: .7; }
.check.done span { text-decoration: line-through; }
.anders-text { margin-top: 8px; }

/* vervolg */
.step { font-size: 14px; color: var(--muted); font-weight: 600; }
.topic { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-weight: 700; margin: 4px 0 10px; }
.choice { display: grid; gap: 10px; margin: 16px 0; }
.choice .btn[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 2px; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.org { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); border-left: 5px solid var(--accent); }
.org.urgent { border-left-color: var(--danger); background: var(--danger-soft); }
.org h3 { margin: 0 0 2px; font-size: 17px; }
.org p { margin: 0 0 8px; color: var(--muted); }
.org .links { display: flex; flex-wrap: wrap; gap: 8px; }
.org .links a { font-weight: 700; text-decoration: none; background: var(--accent-soft); border-radius: 10px; padding: 6px 12px; }
.org.urgent .links a { background: var(--danger); color: #fff; }

.tip { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.tip p { margin: 0 0 4px; }
.tip small { color: var(--muted); }

.alarm { background: var(--danger-soft); border: 2px solid var(--danger); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.alarm p { margin: 0 0 10px; }

.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 12px; }
.progress div { height: 100%; background: var(--ok); transition: width .3s; }

.big { font-size: 96px; text-align: center; line-height: 1; margin: 24px 0 8px; }
.big svg { width: 120px; height: 120px; }
.center { text-align: center; }
.note { font-size: 14px; color: var(--muted); }
.status { font-weight: 600; margin: 10px 0 0; }
.status.err { color: var(--danger); }

.nood {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  font-size: 14px; border-top: 1px solid var(--line); background: var(--card);
}
.nood a { color: var(--danger); text-decoration: none; }
