/* PretPlanner — mobiel-eerst, sprookjesthema */
:root {
  --groen: #1c4a34;
  --groen-d: #143726;
  --goud: #e9b949;
  --goud-d: #c9992b;
  --creme: #f6f1e7;
  --papier: #fffdf7;
  --inkt: #2a2a24;
  --inkt-zacht: #6b675c;
  --rood: #c0392b;
  --oranje: #e67e22;
  --ok: #2e8b57;
  --radius: 16px;
  --schaduw: 0 3px 14px rgba(38, 32, 14, 0.09);
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -220px, #24573d 0%, transparent 70%),
    var(--creme);
  color: var(--inkt);
  min-height: 100dvh;
  padding-bottom: 90px;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }

/* ---------- header ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(160deg, var(--groen) 0%, var(--groen-d) 100%);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 44px; height: 44px; flex: 0 0 auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.app-header h1 { margin: 0; font-size: 1.35rem; letter-spacing: .3px; color: var(--goud); }
.tagline { margin: 0; font-size: .74rem; opacity: .85; }
.pill {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff;
  padding: 7px 12px; border-radius: 999px; font-size: .78rem; display: flex; align-items: center; gap: 7px;
  cursor: pointer; white-space: nowrap; max-width: 46vw; flex: 0 1 auto;
}
.pill span:last-child { overflow: hidden; text-overflow: ellipsis; }
.pill:active { transform: scale(.96); }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: #9aa; display: inline-block; }
.dot-live.groen { background: #57d98a; box-shadow: 0 0 6px #57d98a; }
.dot-live.oranje { background: var(--goud); box-shadow: 0 0 6px var(--goud); }
.dot-live.rood { background: #ff7b6b; box-shadow: 0 0 6px #ff7b6b; }

/* ---------- banners ---------- */
.banner {
  margin: 10px 14px 0; padding: 10px 14px; border-radius: 12px; font-size: .86rem;
  background: #fdf3d7; border: 1px solid #eddaa2; color: #6b5313;
}
.banner.warn { background: #fdebe7; border-color: #f2c4ba; color: #8a2f21; }
.linkbtn { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---------- stepper ---------- */
.stepper {
  display: flex; gap: 6px; padding: 12px 14px 4px; max-width: 640px; margin: 0 auto; width: 100%;
}
.step {
  flex: 1; border: 0; background: #e7dfd0; color: var(--inkt-zacht); border-radius: 10px;
  padding: 7px 4px; font-size: .72rem; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.step span {
  width: 20px; height: 20px; border-radius: 50%; background: #cfc4ad; color: #fff;
  display: grid; place-items: center; font-size: .7rem;
}
.step.active { background: var(--groen); color: #fff; }
.step.active span { background: var(--goud); color: var(--groen-d); }
.step.done span { background: var(--ok); }

/* ---------- panels & cards ---------- */
#app { max-width: 640px; margin: 0 auto; padding: 8px 14px 20px; }
.panel { display: none; }
.panel.active { display: block; animation: verschijn .25s ease; }
@keyframes verschijn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

.card {
  background: var(--papier); border-radius: var(--radius); box-shadow: var(--schaduw);
  padding: 16px; margin: 12px 0; border: 1px solid #efe7d5;
}
.card h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--groen); }
.hint { font-size: .78rem; color: var(--inkt-zacht); margin: 8px 0 0; }
.skeleton { color: var(--inkt-zacht); font-size: .9rem; }
.hidden { display: none !important; }

/* ---------- velden ---------- */
.field-row { display: flex; gap: 12px; }
.field-row.center { align-items: center; }
.field { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: .8rem; color: var(--inkt-zacht); }
.field input[type="time"], .field select, .select-inline {
  font-size: 1.05rem; padding: 10px; border: 1.5px solid #ddd2ba; border-radius: 10px;
  background: #fff; color: var(--inkt); width: 100%; font-family: inherit;
}
.select-inline { width: auto; font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 1.5px solid #ddd2ba; background: #fff; border-radius: 999px; padding: 7px 13px;
  font-size: .82rem; cursor: pointer; color: var(--inkt);
}
.chip.active { background: var(--groen); border-color: var(--groen); color: #fff; }
.chips.realms .chip { border-width: 2px; font-weight: 600; }
.chips.realms .chip.uit { opacity: .45; text-decoration: line-through; }

/* ---------- tellers ---------- */
.counter-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px dashed #eadfc8;
}
.counter-row:last-of-type { border-bottom: 0; }
.counter-label { font-size: .95rem; }
.counter-label small { color: var(--inkt-zacht); }
.counter { display: flex; align-items: center; gap: 12px; }
.counter span { min-width: 26px; text-align: center; font-size: 1.15rem; font-weight: 700; }
.cnt-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; font-size: 1.3rem; font-weight: 700;
  background: var(--creme); color: var(--groen); cursor: pointer; box-shadow: inset 0 0 0 1.5px #ddd2ba;
}
.cnt-btn:active { background: var(--goud); }
.subfield { margin-top: 12px; padding: 12px; background: var(--creme); border-radius: 12px; }

/* ---------- switches ---------- */
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #cfc4ad; border-radius: 999px; transition: .2s; cursor: pointer;
}
.slider::before {
  content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: .92rem; padding: 6px 0; cursor: pointer;
}
.switch-row small { color: var(--inkt-zacht); }

/* ---------- segmented ---------- */
.seg { display: flex; background: var(--creme); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 10px 4px; border-radius: 9px;
  font-size: .88rem; cursor: pointer; color: var(--inkt);
}
.seg button.active { background: var(--groen); color: #fff; font-weight: 600; }

/* ---------- range ---------- */
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--groen); height: 30px; }
.range-row output { font-weight: 700; color: var(--groen); min-width: 62px; text-align: right; }

/* ---------- attractielijst ---------- */
.search {
  width: 100%; padding: 10px 12px; border: 1.5px solid #ddd2ba; border-radius: 10px;
  font-size: .95rem; margin-bottom: 10px; background: #fff;
}
.realm-group { margin: 14px 0 4px; }
.realm-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  display: flex; align-items: center; gap: 7px; margin-bottom: 6px;
}
.realm-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--rc, #999); }
.att-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; cursor: pointer;
}
.att-row:active { background: var(--creme); }
.att-row.uit { opacity: .45; }
.att-row input[type="checkbox"] { width: 21px; height: 21px; accent-color: var(--groen); flex: 0 0 auto; }
.att-ico { font-size: 1.15rem; flex: 0 0 auto; }
.att-main { flex: 1; min-width: 0; }
.att-name { display: block; font-size: .93rem; font-weight: 600; }
.att-sub { display: block; font-size: .74rem; color: var(--inkt-zacht); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wait-badge {
  font-size: .78rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; flex: 0 0 auto; min-width: 44px; text-align: center;
}
.w-groen { background: #e0f2e6; color: #1d6b40; }
.w-oranje { background: #fdf0d4; color: #8f6400; }
.w-rood { background: #fde3dd; color: #a2311f; }
.w-grijs { background: #eee9dd; color: #8a857a; }
.must-star {
  border: 0; background: none; font-size: 1.35rem; cursor: pointer; color: #cfc4ad; flex: 0 0 auto;
  padding: 4px; line-height: 1;
}
.must-star.aan { color: var(--goud-d); }

/* ---------- route ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat {
  background: var(--groen); color: #fff; border-radius: 12px; padding: 10px 6px; text-align: center;
}
.stat b { display: block; font-size: 1.15rem; color: var(--goud); font-family: Georgia, serif; }
.stat span { font-size: .66rem; opacity: .9; }

.tl { position: relative; margin: 6px 0 0; padding-left: 24px; }
.tl::before {
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px;
  border-left: 3px dotted #cfc4ad;
}
.tl-item { position: relative; margin: 14px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 8px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--tlc, var(--groen)); border: 2.5px solid var(--papier);
  box-shadow: 0 0 0 2px var(--tlc, var(--groen));
}
.walk-leg { font-size: .78rem; color: var(--inkt-zacht); margin: 10px 0 10px 2px; }
.tl-card {
  background: #fff; border: 1px solid #efe7d5; border-left: 5px solid var(--tlc, var(--groen));
  border-radius: 12px; padding: 10px 12px; box-shadow: var(--schaduw);
}
.tl-top { display: flex; align-items: baseline; gap: 8px; }
.tl-tijd { font-weight: 800; font-size: .95rem; color: var(--groen); font-variant-numeric: tabular-nums; }
.tl-naam { font-weight: 700; font-size: .98rem; flex: 1; }
.tl-sub { font-size: .78rem; color: var(--inkt-zacht); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tl-flags { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.flag {
  font-size: .68rem; background: var(--creme); border: 1px solid #e2d8c2; padding: 2px 8px; border-radius: 999px;
}
.flag.warn { background: #fdf0d4; border-color: #eddaa2; color: #6b5313; }
.tl-done { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--inkt-zacht); margin-top: 7px; cursor: pointer; }
.tl-done input { width: 17px; height: 17px; accent-color: var(--ok); }

#map { height: 320px; border-radius: var(--radius); z-index: 0; }
.mapnum {
  background: var(--mc, var(--groen)); color: #fff; border-radius: 50%; width: 26px; height: 26px;
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.mapflag { font-size: 1.3rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

.route-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.notes { margin: 10px 0 0; padding: 0 0 0 2px; }
.notes li { font-size: .8rem; color: #6b5313; background: #fdf3d7; border: 1px solid #eddaa2; border-radius: 10px; padding: 8px 10px; margin: 6px 0; list-style: none; }
.share-out { margin-top: 10px; font-size: .85rem; word-break: break-all; background: var(--creme); padding: 10px; border-radius: 10px; }

/* ---------- knoppen ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 13px 18px; font-size: .95rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--goud); color: var(--groen-d); box-shadow: 0 3px 0 var(--goud-d); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--goud-d); }
.btn.ghost { background: #fff; color: var(--groen); box-shadow: inset 0 0 0 1.5px #ddd2ba; }
.btn.klein { padding: 10px 12px; font-size: .84rem; }
.btn:disabled { opacity: .5; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 10px; z-index: 500;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--creme) 30%);
  max-width: 640px; margin: 0 auto;
}
.bottom-nav .btn { flex: 1; }
#btnBack { flex: 0 0 34%; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 600;
  background: var(--groen-d); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: .86rem; box-shadow: 0 4px 14px rgba(0,0,0,.3); max-width: 88vw; text-align: center;
}

/* ---------- footer ---------- */
.app-footer { max-width: 640px; margin: 24px auto 0; padding: 0 18px 24px; text-align: center; }
.app-footer p { font-size: .72rem; color: var(--inkt-zacht); margin: 4px 0; }
.app-footer a { color: var(--groen); }

/* ---------- park status ---------- */
.park-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .88rem; }
.badge { padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.b-open { background: #e0f2e6; color: #1d6b40; }
.b-dicht { background: #eee9dd; color: #8a857a; }
.b-rustig { background: #e0f2e6; color: #1d6b40; }
.b-normaal { background: #eaf3d9; color: #55701c; }
.b-druk { background: #fdf0d4; color: #8f6400; }
.b-zeerdruk { background: #fde3dd; color: #a2311f; }
.status-meta { font-size: .72rem; color: var(--inkt-zacht); width: 100%; }

/* ---------- groter scherm ---------- */
@media (min-width: 700px) {
  .app-header { border-radius: 0 0 20px 20px; }
  #map { height: 420px; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- print ---------- */
@media print {
  .app-header, .stepper, .bottom-nav, .banner, .route-btns, .app-footer, #map, .tl-done { display: none !important; }
  body { background: #fff; padding: 0; }
  .panel { display: none; }
  #panel4 { display: block !important; }
  .card, .tl-card { box-shadow: none; }
}

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