/* waarstaatie.nl — publieke app. Mobile-first, licht en donker. */
:root {
    --orange: #E8590C;
    --orange-soft: #FFEDD5;
    --ink: #1F2937;
    --muted: #6B7280;
    --bg: #FFF7ED;
    --card: #FFFFFF;
    --line: #F3E8DC;
    --live: #16A34A;
    --radius: 16px;
    --shadow: 0 6px 24px rgba(31, 41, 55, .10);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #F3F4F6;
        --muted: #9CA3AF;
        --bg: #111827;
        --card: #1F2937;
        --line: #374151;
        --orange-soft: #431407;
        --shadow: 0 6px 24px rgba(0, 0, 0, .4);
    }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--orange); }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Kopbalk */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; padding-top: max(.75rem, env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 1000; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand__tld { color: var(--orange); }
.topbar__link { font-size: .9rem; font-weight: 600; text-decoration: none; }

/* Knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .6rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn--ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: wait; }
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .3rem .8rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.is-on, .chip[aria-pressed="true"] { border-color: var(--orange); color: var(--ink); background: var(--orange-soft); }
.chip--live .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--live); }

/* Overzichtskaart */
.mapapp { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.filters { display: flex; gap: .5rem; padding: .6rem 1rem; overflow-x: auto; background: var(--card); border-bottom: 1px solid var(--line); scrollbar-width: none; position: relative; z-index: 900; }
.filters::-webkit-scrollbar { display: none; }
.map { flex: 1; min-height: 240px; background: #e5e7eb; }
.is-embed .filters { padding: .4rem .6rem; }
.embed-open { position: absolute; right: .6rem; bottom: 1.8rem; z-index: 1000; background: var(--card); padding: .35rem .8rem; border-radius: 999px; box-shadow: var(--shadow); font-weight: 700; font-size: .85rem; text-decoration: none; }
.page-map.is-embed .mapapp { position: relative; }

.sheet { background: var(--card); border-top: 1px solid var(--line); max-height: 45dvh; display: flex; flex-direction: column; box-shadow: 0 -4px 16px rgba(0,0,0,.06); position: relative; z-index: 900; padding-bottom: env(safe-area-inset-bottom); }
.sheet__handle { display: flex; align-items: center; gap: .5rem; border: 0; background: none; font: inherit; font-weight: 700; padding: .7rem 1rem; color: var(--ink); cursor: pointer; }
.sheet__handle span { width: 2.2rem; height: .3rem; border-radius: 99px; background: var(--line); }
/* min-height: 0 laat de lijst krimpen en zelf scrollen, in plaats van de kaart en de knoppen weg te duwen */
.sheet__list { list-style: none; margin: 0; padding: 0 1rem 1rem; overflow-y: auto; display: none; flex: 1 1 auto; min-height: 0; }
.sheet.is-open .sheet__list { display: block; }
@media (min-width: 900px) {
    .mapapp { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto auto minmax(0, 1fr); }
    .mapapp .topbar, .mapapp .filters { grid-column: 1 / -1; }
    .sheet { max-height: none; min-height: 0; grid-row: 3; grid-column: 2; border-top: 0; border-left: 1px solid var(--line); box-shadow: none; }
    .sheet__list { display: block; }
    .sheet__handle { cursor: default; }
    .sheet__handle span { display: none; }
    .page-map.is-embed .mapapp { display: flex; }
}
.truckrow { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; border-top: 1px solid var(--line); cursor: pointer; }
.truckrow__icon { font-size: 1.6rem; line-height: 1; }
.truckrow__icon img { display: block; width: 2.2rem; height: 2.2rem; object-fit: contain; border-radius: 8px; background: #fff; }
.truckrow__name { font-weight: 700; }
.truckrow__meta { font-size: .88rem; color: var(--muted); }
.truckrow .pill { margin-left: .3rem; }
.sheet__more { padding: .7rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--orange); font-weight: 700; text-decoration: underline; cursor: pointer; }
/* Uitgelicht (pakket): bovenaan, met een accent */
.truckrow.is-featured { background: var(--orange-soft, #FFF4E6); border-radius: 10px; padding-left: .5rem; padding-right: .5rem; }
.truckrow.is-featured .truckrow__name::after { content: " ★"; color: var(--orange); }
.pill { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; padding: .1rem .5rem; border-radius: 999px; background: var(--live); color: #fff; vertical-align: middle; }

/* Kaartmarkers */
.wsi-marker { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 3px solid var(--orange); box-shadow: 0 3px 10px rgba(0,0,0,.25); font-size: 22px; line-height: 1; }
.wsi-marker.is-live { border-color: var(--live); animation: pulse 2s infinite; }
.wsi-marker.is-stale { border-color: #9CA3AF; filter: grayscale(.6); }
.wsi-marker.is-plan { width: 32px; height: 32px; font-size: 16px; border-width: 2px; opacity: .85; }
.wsi-marker.is-featured { box-shadow: 0 0 0 4px rgba(232, 89, 12, .35), 0 3px 10px rgba(0,0,0,.25); opacity: 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.55); } 70% { box-shadow: 0 0 0 16px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.leaflet-popup-content { font-family: var(--font); font-size: .95rem; margin: .8rem 1rem; }
.popup__logo { display: block; width: 64px; height: 64px; object-fit: contain; margin-bottom: .3rem; }
.popup__name { font-weight: 800; font-size: 1.05rem; }
.popup__type { color: #6B7280; font-size: .85rem; }
.popup__times { margin: .4rem 0; }
.popup a { font-weight: 700; }

/* Truckpagina */
.truckpage { max-width: 760px; margin: 0 auto; padding-bottom: 2rem; }
.hero { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: center; padding: 1.2rem 1rem .8rem; }
.hero__icon { font-size: 2.6rem; width: 3.6rem; height: 3.6rem; display: grid; place-items: center; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.hero__icon--logo { width: 4.6rem; height: 4.6rem; object-fit: contain; background: #fff; padding: .25rem; box-sizing: border-box; }
.hero h1 { font-size: 1.6rem; margin: 0; }
.hero__type { margin: 0; color: var(--muted); }
.status { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
.status__badge { font-weight: 800; font-size: .85rem; padding: .25rem .75rem; border-radius: 999px; background: var(--line); color: var(--muted); }
.status__badge.is-live { background: var(--live); color: #fff; }
.status__badge.is-live::before { content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .4rem; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.status__age { font-size: .88rem; color: var(--muted); }
.map--truck { height: 46vh; min-height: 260px; margin: 0 1rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card { background: var(--card); margin: 1rem; padding: 1.1rem 1.1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.slots { list-style: none; margin: 0; padding: 0; }
.slots__day { font-weight: 800; margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.slots__day:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.slot { display: grid; grid-template-columns: 7.2rem 1fr; gap: .1rem .6rem; padding: .35rem 0; }
.slot__time { font-variant-numeric: tabular-nums; font-weight: 700; }
.slot__note { grid-column: 2; font-size: .9rem; color: var(--muted); }
.slot.is-now .slot__time { color: var(--live); }
.slot.is-ended { opacity: .5; }
.notice { background: var(--orange-soft); padding: .6rem .8rem; border-radius: 10px; font-size: .92rem; }
.follow__push { display: flex; gap: .5rem; flex-wrap: wrap; }
.follow__msg { min-height: 1.2em; font-weight: 600; margin: .6rem 0 0; }
.follow__ios { background: var(--orange-soft); padding: .7rem .9rem; border-radius: 10px; font-size: .92rem; }
.follow__email { margin-top: .8rem; }
.follow__email summary { cursor: pointer; font-weight: 600; color: var(--orange); }
.follow__email label { display: block; font-weight: 600; margin: .6rem 0 .3rem; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form input { flex: 1 1 14rem; min-height: 44px; padding: .5rem .8rem; border-radius: 12px; border: 1.5px solid var(--line); font: inherit; background: var(--bg); color: var(--ink); }
.foot { text-align: center; font-size: .88rem; color: var(--muted); padding: 1rem; }
.message { text-align: center; padding: 2rem 1.2rem; }
.message .actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
