/* FORGETmenot huisstijl: de kleuren van de reis.
   Zandkleurig papier als ondergrond, het diepe groen van de dennen in de
   vallei als hoofdkleur, en vier vaste statuskleuren: nu (rode rots),
   vandaag (dennengroen), voorbereiden (het blauw van de lucht boven de canyon)
   en geweest (steengrijs). Kleur staat nooit alleen: er hoort altijd een woord bij. */

:root {
  --serif: ui-serif, 'New York', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --dock-h: 66px;
  color-scheme: light;
}

:root[data-theme='light'] {
  --bg: #F6F0E6;
  --surface: #FFFFFF;
  --surface-2: #EEE5D7;
  --line: #DED2C0;
  --ink: #1F2A2B;
  --muted: #5E6663;
  --forest: #2C5A55;
  --on-forest: #FFFFFF;
  --nu: #B2451F;
  --vandaag: #2F6B4F;
  --voorbereiden: #2F5F9E;
  --geweest: #8D8A84;
  --bell: #A8650E;
  --shadow: 0 1px 2px rgba(31, 42, 43, 0.06), 0 4px 14px rgba(31, 42, 43, 0.05);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #10191C;
  --surface: #18252A;
  --surface-2: #21323A;
  --line: #2E424A;
  --ink: #EEEDE6;
  --muted: #A3B1B2;
  --forest: #7FC7B6;
  --on-forest: #0E1C1D;
  --nu: #F28B5E;
  --vandaag: #7FC7A0;
  --voorbereiden: #8DB4EA;
  --geweest: #7C8587;
  --bell: #F0BE62;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.sheet-open { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }

svg.icon, svg.flower { display: block; flex: none; }

:focus-visible { outline: 3px solid var(--voorbereiden); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: calc(var(--dock-h) + 44px + env(safe-area-inset-bottom));
}

/* ---- Statuskleuren ---- */

.st-nu { --st: var(--nu); }
.st-vandaag { --st: var(--vandaag); }
.st-voorbereiden { --st: var(--voorbereiden); }
.st-later { --st: var(--line); }
.st-geweest { --st: var(--geweest); }

.dot {
  display: inline-block; flex: none;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--st, var(--forest));
}

/* ---- Bovenkant: landschap, stand van zaken, wandelpad ---- */

.scene {
  position: relative;
  height: calc(176px + env(safe-area-inset-top));
  background: var(--surface-2);
  overflow: hidden;
  border-radius: 0 0 22px 22px;
}
.scene-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 45%; }
.scene-img.ochtend { object-position: center 30%; }
.scene-img.avond { object-position: center 35%; }
.scene-img.nacht { filter: brightness(0.5) saturate(0.75); }
:root[data-theme='dark'] .scene-img:not(.nacht) { filter: brightness(0.82); }

.scene-text {
  position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
  padding: 7px 14px 9px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.brand {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted);
}
.scene-text h1 {
  font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.15;
}

.round {
  flex: none; width: 42px; height: 42px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink);
}
.round.glass {
  position: absolute; right: 12px; top: calc(10px + env(safe-area-inset-top));
  border-color: transparent;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.round.confirm { width: auto; padding: 0 12px; border-radius: 21px; font-size: 14px; font-weight: 600; color: var(--nu); }

.calm { padding: 12px 16px 4px; display: grid; gap: 10px; }

.state { display: flex; align-items: baseline; gap: 9px; font-size: 17px; font-weight: 600; }
.state .dot { transform: translateY(-1px); }
.state.nu { --st: var(--nu); }
.state.rust { --st: var(--vandaag); }

.trail {
  display: grid; gap: 8px; width: 100%; padding: 12px 14px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: left;
}
.trail-line {
  position: relative; display: block; height: 6px; margin: 8px 8px 4px;
  border-radius: 3px; background: var(--surface-2);
}
.trail-line .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--forest); transition: width 0.8s ease; }
.trail-line .wp {
  position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--line);
}
.trail-line .wp.on { border-color: var(--forest); background: var(--forest); }
.trail-line .walker { position: absolute; top: 50%; margin: -9px 0 0 -9px; transition: left 0.8s ease; }
.trail-text { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.filters {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  margin-top: calc(-1 * env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---- Inhoud ---- */

.main { padding: 6px 16px 0; display: grid; gap: 22px; }

.block-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.block[class*='st-'] .block-title { color: var(--st); }
.block-title .hint { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.block-title.day { justify-content: space-between; }
.block-title.day .day-date { letter-spacing: 0.02em; }
.count {
  min-width: 20px; padding: 0 6px; border-radius: 10px;
  font-size: 12px; letter-spacing: 0; text-align: center;
  background: var(--surface-2); color: var(--ink);
}

.page-title { font-family: var(--serif); font-size: 26px; font-weight: 600; }

.list { display: grid; gap: 8px; }

.row {
  display: flex; align-items: stretch;
  min-height: 58px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.row .bar { flex: none; width: 5px; background: var(--st, var(--line)); }
.row.st-nu { background: color-mix(in srgb, var(--nu) 7%, var(--surface)); border-color: color-mix(in srgb, var(--nu) 35%, var(--line)); }
.row.st-geweest { box-shadow: none; background: transparent; }
.row.st-geweest .row-title, .row.st-geweest .row-time { color: var(--muted); }
.row.leaving { opacity: 0; transform: translateX(18px); }

.row-time {
  flex: none; align-self: center; width: 58px; padding-left: 12px;
  font-size: 15px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.row-time small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.row-time.small { font-size: 12px; font-weight: 500; color: var(--muted); }

.check {
  flex: none; align-self: center;
  width: 32px; height: 32px; margin: 0 2px 0 12px; padding: 0;
  display: grid; place-items: center;
  border: 2px solid var(--muted); border-radius: 50%;
  background: transparent; color: transparent;
}
.row.st-nu .check { border-color: var(--nu); }
.check:active { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }

.row-body {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px 9px 10px; border: 0; background: none; text-align: left;
}
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub {
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row.task.st-nu .row-sub { color: var(--nu); }
.marks { flex: none; display: flex; gap: 6px; color: var(--muted); }
.mark.bell { color: var(--bell); }

.later {
  flex: none; width: 46px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted);
}

.row.log { width: 100%; align-items: center; gap: 12px; padding: 9px 12px; text-align: left; box-shadow: none; }
.log-icon {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
}
.log-icon.task { background: color-mix(in srgb, var(--forest) 16%, var(--surface)); color: var(--forest); }

.empty, .rest {
  padding: 22px 16px; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); text-align: center;
}
.rest img { border-radius: 50%; object-fit: cover; }
.rest { display: grid; justify-items: center; gap: 10px; border-style: solid; background: var(--surface); font-family: var(--serif); font-size: 18px; color: var(--ink); }

.past summary {
  display: flex; align-items: center; gap: 8px; padding: 4px 0 9px; cursor: pointer; list-style: none;
  --st: var(--geweest);
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.past summary::-webkit-details-marker { display: none; }
.past summary::after { content: 'toon'; margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; text-decoration: underline; }
.past[open] summary::after { content: 'verberg'; }

.legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center;
  font-size: 12px; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); }

/* ---- Kaarten en formulieren ---- */

.card, .notice {
  display: grid; gap: 12px;
  padding: 16px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.notice { gap: 8px; border-color: color-mix(in srgb, var(--voorbereiden) 45%, var(--line)); }
.notice.warn { border-color: var(--nu); }
.notice .btn { justify-self: start; }

.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.lead { font-size: 16px; margin-bottom: 12px; }
.err { color: var(--nu); font-size: 14px; font-weight: 600; }
.version { text-align: center; }

.stack { display: grid; gap: 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair.wide-first { grid-template-columns: 2fr 1fr; }

label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }

input:not([type='checkbox']), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg); color: var(--ink);
  font-size: 16px; font-weight: 400;
}
textarea { resize: vertical; min-height: 68px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.85; }

.switch {
  grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.switch input[type='checkbox'] { width: 24px; height: 24px; accent-color: var(--forest); }
.switch input[type='time'] { width: auto; min-height: 40px; padding: 6px 8px; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.grow { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--ink);
  font-weight: 600;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn.primary, .btn.go { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }
.btn.big { min-height: 54px; font-size: 18px; }
.btn.wide { width: 100%; }
.btn.mic.rec { background: var(--nu); border-color: var(--nu); color: #fff; }

.link {
  padding: 0; border: 0; background: none;
  color: var(--voorbereiden); font-weight: 600; text-decoration: underline;
}
.link.danger { justify-self: center; padding: 8px; color: var(--nu); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 4px 15px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
}
.chip.on { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }

.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.seg.three { grid-template-columns: 1fr 1fr 1fr; }
.seg-btn { min-height: 42px; border: 0; background: var(--bg); font-weight: 600; color: var(--muted); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--forest); color: var(--on-forest); }

.toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 46px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--muted); font-weight: 600; text-align: left;
}
.toggle.on { border-color: var(--bell); background: color-mix(in srgb, var(--bell) 14%, var(--surface)); color: var(--ink); }
.toggle.on svg { color: var(--bell); }
.notify { display: grid; gap: 6px; }

.feeds, .fbs, .facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.feed select { width: auto; min-height: 40px; padding: 6px 8px; }
.feed-main { flex: 1; min-width: 0; display: grid; }
.feed-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-main small.err { color: var(--nu); white-space: normal; }
.fb {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 14px;
}
.fb span { flex: 1; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.facts li { display: flex; align-items: center; gap: 10px; }
.facts svg { color: var(--forest); }

details { font-size: 14px; }
.card summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
details p, details ol { margin: 8px 0 0; color: var(--muted); }
details ol { padding-left: 20px; display: grid; gap: 6px; }
code {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  padding: 1px 5px; border-radius: 5px; background: var(--surface-2); color: var(--ink);
  overflow-wrap: anywhere;
}
.token { display: flex; gap: 8px; align-items: center; }
.token code { flex: 1; padding: 10px; border: 1px dashed var(--forest); }

.search {
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted);
}
.search input { border: 0; background: none; padding-left: 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--voorbereiden); outline-offset: 2px; }

/* ---- Dock ---- */

.dock {
  position: fixed; left: 50%; bottom: 0; z-index: 10;
  transform: translateX(-50%);
  width: min(100%, 560px);
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.dock-tab {
  display: grid; justify-items: center; gap: 2px;
  min-height: 52px; padding: 6px 0 2px; border: 0; background: none;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.dock-tab.on { color: var(--forest); }
.new {
  justify-self: center;
  width: 60px; height: 60px; margin-top: -24px; padding: 0;
  display: grid; place-items: center;
  border: 4px solid var(--bg); border-radius: 50%;
  background: var(--forest); color: var(--on-forest);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--forest) 40%, transparent);
}
.new:active { transform: scale(0.94); }

/* ---- Sheets ---- */

.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(14, 22, 18, 0.45); animation: fade 0.2s ease; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 21;
  transform: translateX(-50%);
  width: min(100%, 560px); max-height: 92dvh; overflow-y: auto;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -8px 30px rgba(14, 22, 18, 0.2);
  animation: rise 0.24s ease;
}
@keyframes rise { from { transform: translate(-50%, 28px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; background: color-mix(in srgb, var(--st) 14%, var(--surface));
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--st);
}
.status.st-later { color: var(--muted); }

.parsed {
  display: grid; gap: 12px; padding: 12px;
  border: 1px dashed var(--line); border-radius: 12px;
}

.detail { display: grid; gap: 8px; }
.detail-title { font-family: var(--serif); font-size: 21px; font-weight: 600; overflow-wrap: anywhere; }
.meta { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 15px; }
.meta svg { margin-top: 3px; }
.note-text { padding: 10px 12px; border-radius: 11px; background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }

.options { display: grid; gap: 8px; }
.option {
  display: grid; gap: 1px; padding: 12px 14px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.option small { color: var(--muted); font-size: 13px; }

.trail-now { margin: 0 0 12px; font-size: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.card-tile {
  display: grid; gap: 4px; padding: 0 0 6px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25;
}
.card-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.card-tile span { padding: 0 4px; }
.card-tile.locked { align-content: center; justify-items: center; min-height: 118px; padding: 8px 4px; color: var(--muted); border-style: dashed; }
.card-tile.locked small { font-weight: 400; }
.card-tile .lock { opacity: 0.55; }
.postcard figure { margin: 0; display: grid; gap: 8px; }
.postcard img { width: 100%; max-height: 66dvh; object-fit: cover; border-radius: 14px; display: block; }
.postcard figcaption { font-family: var(--serif); font-size: 20px; font-weight: 600; text-align: center; }
.center { text-align: center; }
.facts { margin-bottom: 12px; }

/* ---- Toasts ---- */

.toasts {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; z-index: 40;
  transform: translateX(-50%);
  width: min(92%, 500px); display: grid; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 12px; border-left: 5px solid var(--muted);
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(14, 22, 18, 0.25);
  pointer-events: auto;
  animation: drop 0.22s ease;
}
.toast span { flex: 1; }
.toast button {
  flex: none; min-height: 34px; padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--bg) 45%, transparent); border-radius: 9px;
  background: none; color: var(--bg); font-weight: 700;
}
.toast.good { border-left-color: var(--vandaag); }
.toast.bad { border-left-color: var(--nu); }
.toast.out { opacity: 0; transition: opacity 0.3s; }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } }

.float {
  position: fixed; z-index: 50; pointer-events: none;
  transform: translate(-50%, -100%);
  font-size: 14px; font-weight: 700; color: var(--forest);
  animation: float-up 1.1s ease-out forwards;
}
@keyframes float-up { to { transform: translate(-50%, -300%); opacity: 0; } }

/* ---- Inloggen ---- */

.login { min-height: 100dvh; max-width: 560px; margin: 0 auto; display: grid; grid-template-rows: 38dvh auto; }
.login-scene { position: relative; overflow: hidden; border-radius: 0 0 28px 28px; }
.login-body { max-width: 380px; width: 100%; margin: 0 auto; padding: 26px 24px; display: grid; align-content: start; gap: 12px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--serif); font-size: 28px; font-weight: 600; }
.tagline { text-align: center; color: var(--muted); margin-bottom: 8px; }

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