/* Paklijst – opmaak (licht en donker) */
:root {
  --bg: #f5efe3;
  --card: #fffaf1;
  --ink: #23302b;
  --muted: #6f776f;
  --line: #e6dccb;
  --green: #2f6f5e;
  --green-soft: #dcebe3;
  --orange: #d9733b;
  --orange-soft: #fbe3d3;
  --danger: #b43c32;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 14px rgba(40, 30, 10, .06);
  --radius: 16px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16201c;
    --card: #1f2b26;
    --ink: #eef1ea;
    --muted: #9aa69f;
    --line: #2f3d37;
    --green: #6fc2a6;
    --green-soft: #24463b;
    --orange: #f0995f;
    --orange-soft: #4a3122;
    --danger: #ef7d72;
    --shadow: none;
  }
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding: calc(56px + var(--top)) 0 calc(84px + var(--bottom));
  min-height: 100vh;
}
a { color: var(--green); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.pad { padding: 10px 16px 14px; }
code { font-size: 13px; background: var(--line); padding: 1px 5px; border-radius: 5px; }

/* Bovenbalk */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  padding: var(--top) 8px 0; height: calc(56px + var(--top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; margin: 0 8px; font-size: 20px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 0; background: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--green); flex: none; }
.icon-btn:active { background: var(--green-soft); }

/* Tabbalk */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; padding: 6px 6px calc(6px + var(--bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 12px; }
.tabbar a span { font-size: 22px; line-height: 1.1; filter: grayscale(1); opacity: .6; }
.tabbar a.on { color: var(--green); }
.tabbar a.on span { filter: none; opacity: 1; }

/* Plusknop */
.fab {
  position: fixed; right: 18px; bottom: calc(84px + var(--bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--orange); color: #fff; box-shadow: 0 6px 18px rgba(217, 115, 59, .4);
  display: grid; place-items: center;
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.4; }
.fab:active { transform: scale(.94); }

main { max-width: 720px; margin: 0 auto; padding: 14px 14px 40px; }

/* Kaarten */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0 0 12px; }
.hint { background: var(--orange-soft); border-color: transparent; }
.done-card { background: var(--green-soft); border-color: transparent; font-weight: 600; }
.intro { margin: 2px 4px 12px; font-size: 15px; }
.section-title { margin: 26px 4px 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.trip-card { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.trip-card:active { transform: scale(.99); }
.trip-card.past { opacity: .75; }
.tpl-card { display: flex; align-items: center; gap: 14px; }
.tpl-card h2 { margin: 0 0 2px; font-size: 19px; }
.tpl-card p { margin: 0; font-size: 14px; }
.tpl-icon { font-size: 34px; width: 52px; height: 52px; border-radius: 14px; background: var(--green-soft); display: grid; place-items: center; flex: none; }
.menu button.danger-text { color: var(--danger); }
.segmented + .intro { margin-top: 12px; }
.trip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.trip-head h2 { margin: 0 0 2px; font-size: 20px; }
.trip-head p { margin: 0 0 12px; font-size: 14px; }
.trip-stats { display: flex; justify-content: space-between; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.badge { flex: none; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.badge.hot { background: var(--orange); color: #fff; }

.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .35s; }
.bar.big { height: 12px; }
.progress-row { display: flex; align-items: center; gap: 12px; margin: 14px 4px; }
.progress-row b { font-size: 18px; min-width: 48px; text-align: right; color: var(--green); }

.trip-info { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 12px; color: var(--muted); font-size: 15px; }

/* Lege staat */
.empty { text-align: center; padding: 40px 20px; }
.empty h2 { margin: 10px 0 6px; }
.empty p { color: var(--muted); margin: 0 auto 20px; max-width: 360px; }
.empty-art { font-size: 64px; line-height: 1; }
.empty-art span { margin-left: -6px; }

/* Knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 11px 18px; background: var(--green); color: #fff; font-weight: 650; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { color: #10201a; } }
.btn.big { padding: 14px 26px; font-size: 17px; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.ghost { background: var(--green-soft); color: var(--green); }
.btn.danger { background: none; color: var(--danger); border: 1px solid currentColor; width: 100%; margin-top: 22px; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 8px; }
.btn-row.wrap { flex-wrap: wrap; }

/* Keuzeschijf (Inpakken / Vouwwagen) */
.segmented { display: flex; background: var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 15px; }
.segmented a small { font-weight: 500; color: var(--muted); margin-left: 2px; }
.segmented a.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 10px; margin: 0 -14px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip { --pc: var(--green); flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.on { background: var(--pc); border-color: var(--pc); color: #fff; }
.chip.on small { color: rgba(255, 255, 255, .85); }
.chip.toggle { font-size: 13px; padding: 5px 11px; }
.chip.toggle.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips.toggles { padding-bottom: 14px; }
.check-chip { display: inline-flex; cursor: pointer; }
.check-chip input { display: none; }
.check-chip:has(input:checked) { background: var(--pc); border-color: var(--pc); color: #fff; }

.person { --pc: var(--green); display: inline-flex; align-items: center; gap: 4px; font-weight: 650; color: var(--pc); }
.person.small { font-size: 12px; background: color-mix(in srgb, var(--pc) 14%, transparent); padding: 1px 7px; border-radius: 99px; }

/* Groepen en regels */
.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.group-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 0; background: none; text-align: left; }
.gicon { font-size: 22px; width: 28px; text-align: center; }
.gname { flex: 1; font-weight: 700; font-size: 16px; }
.gname small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.gcount { font-size: 14px; color: var(--muted); font-weight: 600; }
.gcount svg { width: 20px; height: 20px; color: var(--green); stroke-width: 3; }
.chev svg { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.chev.open svg { transform: rotate(90deg); }
.group.complete .group-head { background: var(--green-soft); }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .check { flex: 1; display: flex; align-items: center; gap: 12px; padding: 11px 6px 11px 14px; border: 0; background: none; text-align: left; min-height: 52px; }
.row.plain .check, .row.add .check { padding-left: 16px; }
.row.add .check { min-height: 46px; font-size: 15px; }
.box { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.box svg { width: 16px; height: 16px; stroke-width: 3; color: #fff; opacity: 0; }
.row.checked .box { background: var(--green); border-color: var(--green); }
.row.checked .box svg { opacity: 1; }
@media (prefers-color-scheme: dark) { .row.checked .box svg { color: #10201a; } }
.row.checked .name { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.name { font-size: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12px; }
.tag { background: var(--line); color: var(--ink); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.tag.trailer { background: var(--orange-soft); }
.note { color: var(--muted); }
.by { color: var(--green); font-weight: 600; }
.row .edit { color: var(--muted); margin-right: 4px; }
.row .edit svg { width: 19px; height: 19px; }

.search { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 16px; }

.people { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.people button { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 12px; }

/* Venster van onderen */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-width: 620px; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--card); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .22s ease-out;
}
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sheet header h2 { margin: 0; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.sheet header .link:last-child { justify-self: end; }
.link { border: 0; background: none; color: var(--green); font-size: 16px; padding: 6px 4px; justify-self: start; }
.link.strong { font-weight: 700; }
.sheet-body { overflow-y: auto; padding: 8px 16px calc(24px + var(--bottom)); -webkit-overflow-scrolling: touch; }
.sheet-body > label, .sheet-body .two label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin: 14px 0 6px; }
.sheet-body input:not([type=checkbox]):not([type=radio]), .sheet-body select, .stack input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 16px; color: var(--ink);
}
.sheet-body > label > input, .sheet-body > label > select { color: var(--ink); font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-body label.switch { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--ink); margin: 16px 0 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.seg-input { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-input label { cursor: pointer; }
.seg-input input { position: absolute; opacity: 0; pointer-events: none; }
.seg-input span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 600; font-size: 15px; }
.seg-input input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.swatch { display: inline-block; width: 20px; height: 20px; border-radius: 50%; }
.menu { display: flex; flex-direction: column; padding: 6px 0; }
.menu button { border: 0; background: none; text-align: left; padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--line); }
.menu button:last-child { border-bottom: 0; }
.cat-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.cat-row input { margin-top: 0 !important; }
.cat-row .emoji-in { width: 56px !important; flex: none; text-align: center; }
.cat-row .icon-btn { width: 36px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* Melding */
.toast {
  position: fixed; left: 50%; bottom: calc(150px + var(--bottom)); transform: translate(-50%, 20px); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 15px; max-width: 86vw;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
