:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1d1f24;
  --muted: #6d6f76;
  --line: #e4e0d8;
  --accent: #c46a1b;
  --accent-soft: #fbeedf;
  --wake: #e08a00;    --wake-soft: #fff1d6;
  --light: #0e9aa7;   --light-soft: #d9f4f5;
  --coffee: #8a5a3c;  --coffee-soft: #f3e6dc;
  --dusk: #d9582b;    --dusk-soft: #fde5da;
  --night: #5b4fc4;   --night-soft: #e6e3fa;
  --free: #2f9a5b;    --free-soft: #dcf2e4;
  --clock: #5f6b7a;   --clock-soft: #e7eaee;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --card: #1d2028;
    --text: #ecebe7;
    --muted: #9a9ca3;
    --line: #2c3039;
    --accent: #f0a25a;
    --accent-soft: #3a2a1b;
    --wake: #ffc04d;    --wake-soft: #3a2e14;
    --light: #4fd1dc;   --light-soft: #133236;
    --coffee: #d9a27e;  --coffee-soft: #34261d;
    --dusk: #ff8a5c;    --dusk-soft: #3b2219;
    --night: #a59bff;   --night-soft: #262245;
    --free: #5fd18e;    --free-soft: #16301f;
    --clock: #aab4c0;   --clock-soft: #262b33;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
main { max-width: 460px; margin: 0 auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
header button {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer;
}
header button:disabled { opacity: .3; cursor: default; }
.date { text-align: center; }
.date .rel { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.date h1 { font-size: 24px; margin: 2px 0 0; font-weight: 650; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dienst {
  margin: 18px 0 20px; padding: 14px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; font-size: 18px; font-weight: 550;
  display: flex; align-items: center; gap: 12px;
}
.dienst { background: var(--cs); border-color: transparent; padding: 10px 16px 10px 10px; }
.dienst .ic { background: var(--c); color: var(--card); border: 0; }
ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
li {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: 14px;
}
.ic {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
li .l { font-weight: 550; }
li .l small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
li .t { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 20px; }
li.past { opacity: .4; }
[data-k=wake]    { --c: var(--wake);   --cs: var(--wake-soft); }
[data-k=glasses] { --c: var(--light);  --cs: var(--light-soft); }
[data-k=sun]     { --c: var(--wake);   --cs: var(--wake-soft); }
[data-k=coffee], [data-k=nocoffee] { --c: var(--coffee); --cs: var(--coffee-soft); }
[data-k=lamp]    { --c: var(--dusk);   --cs: var(--dusk-soft); }
[data-k=moon], [data-k=nap] { --c: var(--night); --cs: var(--night-soft); }
[data-k=clock]   { --c: var(--clock);  --cs: var(--clock-soft); }
[data-k=vroeg]   { --c: var(--wake);   --cs: var(--wake-soft); }
[data-k=dag]     { --c: var(--light);  --cs: var(--light-soft); }
[data-k=laat]    { --c: var(--night);  --cs: var(--night-soft); }
[data-k=vrij]    { --c: var(--free);   --cs: var(--free-soft); }
li .ic, .note .ic { background: var(--cs); border-color: transparent; color: var(--c); }
li.now { background: var(--cs); }
li.now .ic { background: var(--c); color: var(--card); }
li.now .t { color: color-mix(in srgb, var(--c) 60%, var(--text)); }
.notes { margin-top: 18px; display: grid; gap: 8px; }
.note {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 15px;
}
.note .ic { width: 34px; height: 34px; flex: none; }
.note svg { width: 19px; height: 19px; }
.empty { text-align: center; color: var(--muted); margin-top: 40px; }
footer { margin-top: 28px; font-size: 13px; color: var(--muted); text-align: center; }
footer a { color: inherit; }

/* knop naar info */
.info-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 14px 8px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; font-size: 15px;
}
.info-link svg { width: 18px; height: 18px; color: var(--muted); }
footer { display: grid; justify-items: center; gap: 6px; }

/* infopagina */
.page-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.page-head a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 18px;
}
.page-head h1 { text-align: center; font-size: 22px; margin: 0; font-weight: 650; }
.lead { margin: 20px 0; font-size: 17px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 10px;
}
.card h2 { display: flex; align-items: center; gap: 12px; font-size: 18px; margin: 0 0 8px; font-weight: 650; }
.card h2 .ic { width: 36px; height: 36px; flex: none; background: var(--cs); color: var(--c); border: 0; }
.card h2 svg { width: 20px; height: 20px; }
.card p { margin: 0 0 8px; font-size: 15.5px; }
.card p:last-child { margin-bottom: 0; }
[data-k=info] { --c: var(--clock); --cs: var(--clock-soft); }
details { margin: 18px 0; font-size: 14px; color: var(--muted); }
summary { cursor: pointer; font-weight: 600; color: var(--text); padding: 6px 0; }
details ol { list-style: decimal; padding-left: 20px; display: block; }
details li { display: list-item; padding: 4px 0; border-radius: 0; }

/* doelen */
[data-k=g-slaap] { --c: var(--night); --cs: var(--night-soft); }
[data-k=g-klok]  { --c: var(--light); --cs: var(--light-soft); }
[data-k=g-fit]   { --c: var(--wake);  --cs: var(--wake-soft); }
.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 600; margin: 26px 0 10px;
}
.sub { margin: -4px 0 12px; font-size: 15.5px; color: var(--muted); }
.goals { display: grid; gap: 8px; }
.goal {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start;
  padding: 14px; border-radius: 16px; background: var(--cs);
}
.goal .ic { background: var(--c); color: var(--card); border: 0; }
.goal h3 { margin: 9px 0 4px; font-size: 17px; font-weight: 650; }
.goal p { margin: 0; font-size: 15.5px; }
.card h2 .h { display: flex; flex-direction: column; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--cs); color: color-mix(in srgb, var(--c) 60%, var(--text));
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* zwaarte van de dag en biologische klok */
[data-k=z-zwaar]  { --c: var(--dusk); }
[data-k=z-pittig] { --c: var(--wake); }
[data-k=z-licht]  { --c: var(--free); }
.chip {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; background: var(--card);
  font-size: 13px; font-weight: 650; color: color-mix(in srgb, var(--c) 60%, var(--text));
}
.chip::before, .why-head::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none;
}
.why-head { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 650; font-size: 15px; }
.why { margin: 4px 0 0; padding-left: 18px; font-size: 15px; }
.why li { display: list-item; padding: 2px 0; border-radius: 0; }
.rules { margin: 4px 0 18px; }
.rules ul { padding-left: 20px; margin: 6px 0 0; }
.rules li { display: list-item; padding: 3px 0; border-radius: 0; }

/* dienstbalk als knop met uitklappaneel */
button.dienst { width: 100%; font: inherit; font-size: 18px; font-weight: 550; color: inherit; text-align: left; cursor: pointer; }
button.dienst:disabled { cursor: default; }
.dienst[aria-expanded=true] { border-radius: 14px 14px 0 0; margin-bottom: 0; }
.chev { display: grid; place-items: center; color: var(--muted); margin-left: -4px; }
.chev svg { width: 18px; height: 18px; transition: transform .2s; }
.dienst[aria-expanded=true] .chev svg { transform: rotate(180deg); }
.dagpanel {
  margin: 0 0 20px; padding: 16px; background: var(--card);
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px;
}
.dagpanel > .why-head:first-of-type { margin-top: 14px; }

/* schuif van licht naar zwaar */
.scale .bar {
  position: relative; height: 10px; border-radius: 999px; margin: 6px 4px 0;
  background: linear-gradient(90deg, var(--free), var(--wake) 50%, var(--dusk));
}
.scale .marker {
  position: absolute; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--card); border: 4px solid var(--c); box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.scale .ends { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* tijdlijn van de biologische klok */
.klok-head { font-weight: 650; font-size: 15px; }
.why + .klok-head { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.strip { position: relative; height: 44px; margin: 10px 10px 0; }
.strip .axis { position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--line); }
.strip .tick { position: absolute; top: 10px; width: 1px; height: 10px; background: var(--line); }
.strip .tick b {
  position: absolute; top: 14px; left: 0; transform: translateX(-50%);
  font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.strip .shift { position: absolute; top: 13px; height: 4px; border-radius: 2px; background: var(--light); opacity: .45; }
.strip .op { position: absolute; top: 4px; width: 4px; height: 22px; transform: translateX(-50%); border-radius: 2px; background: var(--wake); }
.strip .dot { position: absolute; top: 9px; width: 12px; height: 12px; transform: translateX(-50%); border-radius: 50%; background: var(--light); }
.strip .dot.next, .legend .dot.next { background: var(--card); border: 2.5px solid var(--light); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--light); }
.legend .op { width: 4px; height: 14px; border-radius: 2px; background: var(--wake); }
.klok-text { margin: 10px 0 0; font-size: 15px; }

/* meldingen */
.push { margin-top: 14px; display: grid; justify-items: center; gap: 8px; max-width: 340px; }
.push button {
  font: inherit; font-size: 15px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.push .push-main { background: var(--night); border-color: var(--night); color: var(--card); font-weight: 600; }
.push button:disabled { opacity: .5; cursor: default; }
.push-row { display: flex; gap: 8px; }
.push-msg { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.push-msg:empty { display: none; }
.push button .ic, .install-steps .ic { border: 0; background: none; border-radius: 0; color: inherit; }
.push button .ic { display: inline-flex; width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }
.push button .ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-steps { margin: 4px 0 0; padding: 12px 14px 12px 32px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; text-align: left; }
.install-steps { list-style: decimal; display: block; }
.install-steps li { display: list-item; padding: 0; border-radius: 0; }
.install-steps li + li { margin-top: 6px; }
.install-steps .ic { display: inline-flex; width: 16px; height: 16px; vertical-align: -2px; }
.install-steps .ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-steps[hidden] { display: none; }
