/* Reisblog: a colourful, modern travel look. Every stop on the trip gets its own colour (--p0..--p6); the
   same colours are used for the stop badges, the route on the map and the overview. Artwork lives in assets/art/. */

/* All colours (--bg, --ink, --p0..--p6, gradients, ...) live in themes.css, one block per theme.
   This file only uses them, so a theme can change the whole look without touching the layout. */
:root {
    --danger: #b3382c;
    --radius: 22px;
    --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 14px 30px -20px rgba(20, 24, 40, .35);
    --topbar: 56px;
    --display: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --story: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --danger: #f08373;
        --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 30px -20px rgba(0, 0, 0, .8);
    }
}

.s0, .t0 { --c: var(--p0); } .s1, .t1 { --c: var(--p1); } .s2, .t2 { --c: var(--p2); } .s3, .t3 { --c: var(--p3); }
.s4, .t4 { --c: var(--p4); } .s5, .t5 { --c: var(--p5); } .s6, .t6 { --c: var(--p6); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(60rem 28rem at 105% -8%, var(--blob1), transparent 60%),
        radial-gradient(48rem 30rem at -12% 18%, var(--blob2), transparent 60%),
        radial-gradient(44rem 28rem at 55% 112%, var(--blob3), transparent 60%);
    background-repeat: no-repeat;
}
a { color: var(--link); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.015em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: .5rem 0; }
.eyebrow { margin: 0 0 .4rem; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---- top bar + colour bar ---- */
.topbar {
    position: sticky; top: 0; z-index: 1000; height: var(--topbar);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 max(16px, env(safe-area-inset-left));
    background: var(--topbar-bg); color: var(--ink);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.topbar a { color: var(--ink); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 800 1.2rem var(--display); letter-spacing: -.02em; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { width: 26px; height: 26px; flex: none; fill: url(#lg); }
.logo circle { fill: var(--card); }
.topbar nav { display: flex; gap: 16px; align-items: center; font-size: .92rem; font-weight: 600; flex: none; }
.colorbar { height: 3px; opacity: .85; background: linear-gradient(90deg, var(--p0), var(--p3), var(--p2), var(--p4), var(--p1), var(--p6), var(--p5)); }

.flash { margin: 12px 16px; padding: 10px 14px; border-radius: 14px; background: #dcf5ea; color: #0f4a34; font-weight: 500; }
.flash.err { background: #fde3df; color: #7a1d12; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.narrow { max-width: 680px; margin: 20px auto; padding: 0 16px; }
.narrow.card { padding: 22px 20px; margin: 24px auto; width: calc(100% - 24px); }
main.narrow.card { max-width: 680px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 140px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); font-weight: 600; }
input, select, textarea {
    font: inherit; font-weight: 400; color: var(--ink); background: var(--field);
    border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--p1); outline-offset: 0; }
textarea { resize: vertical; }
form.inline { display: inline; }
form.inline select { width: auto; }

.btn {
    display: inline-block; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
    padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
    transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover { box-shadow: 0 6px 16px -8px rgba(20, 24, 58, .45); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad-brand); border-color: transparent; color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.small { padding: 6px 14px; font-size: .88rem; }
.btn:disabled { opacity: .6; cursor: default; }
.topbar .btn.primary { background: var(--grad-cta); color: #fff; }
.btn.light { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); color: #fff; backdrop-filter: blur(4px); }
.btn.light:hover { background: rgba(255, 255, 255, .3); }
form.danger { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

details.trip { border-top: 1px solid var(--line); padding: 10px 0; }
details.trip summary { cursor: pointer; padding: 4px 0; font-weight: 600; }
details.trip form, details.trip > label { margin-top: 12px; }
table.users { width: 100%; border-collapse: collapse; }
table.users td { padding: 10px 0; border-top: 1px solid var(--line); vertical-align: middle; }
table.users td.actions { text-align: right; white-space: nowrap; }

/* ---- sign-in / setup: a dusk scene behind the card ---- */
body.auth { min-height: 100vh; background: var(--auth-grad); background-attachment: fixed; }
body.auth::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: url("art/scene.svg") center bottom / cover no-repeat;
}
body.auth > * { position: relative; z-index: 1; }
body.auth .topbar { background: rgba(20, 20, 50, .4); }
body.auth .topbar a { color: #fff; }
body.auth .brand span { background: none; color: #fff; }
.welcome { max-width: 440px; margin-top: 7vh; box-shadow: 0 30px 60px -30px rgba(10, 6, 50, .7); }
.welcome h1 { font-size: 2rem; }

/* ---- home: timeline + map ---- */
.split { display: flex; flex-direction: column-reverse; }
.mapwrap { position: relative; z-index: 5; height: 38vh; min-height: 220px; }
#map, .pickmap { width: 100%; height: 100%; background: #dde3f3; }
.pickmap { height: 260px; border-radius: 18px; border: 1px solid var(--line); }
.mapinfo {
    position: absolute; left: 10px; bottom: 22px; z-index: 500; font-size: .78rem; font-weight: 700;
    background: var(--card); color: var(--ink); padding: 5px 12px; border-radius: 999px; pointer-events: none;
    box-shadow: 0 4px 14px rgba(20, 24, 58, .25);
}
.mapinfo:empty { display: none; }
.timeline { padding: 16px; display: flex; flex-direction: column; gap: 20px; max-width: 760px; width: 100%; margin: 0 auto; }
@media (min-width: 900px) {
    .split { flex-direction: row; align-items: flex-start; }
    .timeline { flex: 0 0 min(590px, 46vw); margin: 0; max-width: none; padding: 20px; }
    .mapwrap { flex: 1; position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar) - 4px); }
}

.leaflet-container { font: inherit; }
/* calmer, cooler map so the coloured route and pins stand out; night version in dark mode */
.leaflet-tile-pane { filter: grayscale(.45) saturate(1.2) hue-rotate(-8deg) brightness(1.05) contrast(.94); }
@media (prefers-color-scheme: dark) {
    .leaflet-tile-pane { filter: invert(1) hue-rotate(188deg) brightness(.82) contrast(.9) saturate(.6); }
}
.pin-wrap { background: none; border: 0; }
.pin { display: block; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.pin path { stroke: #fff; stroke-width: 2; }
.pin text { fill: #fff; font: 800 13px var(--display); }
.here {
    width: 18px; height: 18px; border-radius: 50%; background: #2a7de1; border: 3px solid #fff;
    box-shadow: 0 0 0 0 rgba(42, 125, 225, .6); animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 14px rgba(42, 125, 225, 0); } 100% { box-shadow: 0 0 0 0 rgba(42, 125, 225, 0); } }

/* ---- trip header (sunset) ---- */
.hero {
    position: relative; overflow: hidden; color: #fff; border-radius: 28px; padding: 26px 22px 20px;
    background: var(--grad-sunset); box-shadow: 0 20px 38px -26px rgba(43, 46, 98, .7);
}
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: url("art/hero.svg") right bottom / auto 74% no-repeat; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: rgba(255, 255, 255, .85); }
.hero h1 { font-size: 2.15rem; margin-bottom: .3em; text-shadow: 0 2px 16px rgba(30, 10, 90, .35); }
.hero .lede { margin: 0 0 14px; color: rgba(255, 255, 255, .94); max-width: 36em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 0; }
.stats > div { display: flex; flex-direction: column-reverse; align-items: center; background: rgba(255, 255, 255, .17); border: 1px solid rgba(255, 255, 255, .22); border-radius: 18px; padding: 9px 4px; backdrop-filter: blur(3px); }
.stats dd { margin: 0; font: 800 1.5rem/1.1 var(--display); }
.stats dt { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.hero select { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .4); width: auto; max-width: 100%; border-radius: 999px; padding: 9px 14px; }
.hero select option { color: #14183a; background: #fff; }
.trip-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.trip-pills a { padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .14); color: #fff; font: 700 .85rem var(--display); text-decoration: none; }
.trip-pills a:hover { background: rgba(255, 255, 255, .28); }
.trip-pills a.on { background: #fff; color: #14183a; border-color: #fff; }
@media (max-width: 560px) {
    .hero::after { background-size: auto 62%; opacity: .85; }
    .hero h1 { max-width: none; }
    .topbar.admin .brand span { display: none; }   /* the admin buttons need the room; the logo stays */
    .topbar nav { gap: 9px; font-size: .8rem; }
    .topbar .btn.small { padding: 6px 11px; font-size: .8rem; }
    .topbar { padding: 0 12px; gap: 8px; }
    .brand { flex: none; }
}
@media (max-width: 420px) { .hero h1 { font-size: 1.8rem; } .stats dd { font-size: 1.2rem; } }

.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 28px 18px; border-style: dashed; }
.empty-icon { font-size: 2.2rem; }

/* ---- itinerary: coloured stops on a dotted trail ---- */
.posts { position: relative; display: flex; flex-direction: column; gap: 20px; padding-left: 40px; }
.posts::before { content: ''; position: absolute; left: 16px; top: 22px; bottom: 22px; border-left: 3px dotted color-mix(in srgb, var(--muted) 45%, transparent); }
.post { position: relative; border-top: 3px solid var(--c, var(--p1)); }
.post header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.post .num {
    position: absolute; left: -40px; top: 6px; z-index: 1;
    width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff;
    display: grid; place-items: center; font: 800 .95rem var(--display);
    box-shadow: 0 0 0 4px var(--bg), 0 3px 8px -3px rgba(0, 0, 0, .35);
}
.post h2 { margin: 6px 0 0; font-size: 1.4rem; }
.post .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); font-size: .82rem; font-weight: 500; }
.place {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px 3px 8px; border-radius: 999px; font-weight: 600;
    background: var(--line); color: var(--ink);
    background: color-mix(in srgb, var(--c, var(--p1)) 11%, transparent);
}
.place svg { width: 13px; height: 13px; fill: var(--c, var(--p1)); flex: none; }   /* only the little pin carries the colour */
.post .edit { margin-left: auto; font-size: .82rem; flex: none; font-weight: 600; }
.post .body, .story .body { margin-top: 14px; overflow-wrap: anywhere; font: 1.06rem/1.75 var(--story); }
.post.active { box-shadow: 0 0 0 3px var(--c), var(--shadow); }

.grid { display: grid; gap: 4px; border-radius: 16px; overflow: hidden; }
.grid a { display: block; background: var(--line); }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid.g1 a { aspect-ratio: auto; }
.grid.g1 img { height: auto; max-height: 520px; }
.grid.g2 { grid-template-columns: 1fr 1fr; }
.grid.g2 a, .grid.g4 a, .grid.g3 a, .grid.g5 a { aspect-ratio: 1; }
.grid.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.grid.g3 a:first-child { grid-row: span 2; aspect-ratio: auto; }
.grid.g4 { grid-template-columns: 1fr 1fr; }
.grid.g5 { grid-template-columns: repeat(6, 1fr); }
.grid.g5 a { grid-column: span 2; }
.grid.g5 a:nth-child(-n+2) { grid-column: span 3; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(8, 8, 28, .95); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox button {
    position: absolute; background: rgba(255, 255, 255, .14); color: #fff; border: 0; cursor: pointer;
    font-size: 2rem; width: 48px; height: 48px; border-radius: 50%; line-height: 1;
}
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---- overview / terugblik ---- */
.ov-hero {
    position: relative; color: #fff; display: flex; align-items: flex-end; min-height: 46vh; padding: 28px 18px 26px;
    background: var(--grad-sunset);
}
.ov-hero::before { content: ''; position: absolute; inset: 0; background: url("art/hero.svg") right top / auto 100% no-repeat; opacity: .9; }
.ov-hero.has-cover { background: linear-gradient(180deg, rgba(25, 14, 80, .25) 0%, rgba(25, 14, 80, .88) 100%), var(--cover) center / cover; }
.ov-hero.has-cover::before { display: none; }
.ov-hero-inner { position: relative; max-width: 1000px; width: 100%; margin: 0 auto; }
.ov-hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); text-shadow: 0 2px 22px rgba(20, 8, 80, .5); }
.ov-hero .eyebrow { color: rgba(255, 255, 255, .8); }
.ov-dates { margin: 0 0 8px; font-weight: 600; color: rgba(255, 255, 255, .92); }
.ov-hero .lede { max-width: 40em; margin: 0 0 6px; color: rgba(255, 255, 255, .94); }
.ov { max-width: 1000px; margin: 0 auto; padding: 22px 16px 60px; display: flex; flex-direction: column; gap: 26px; }
.ov h2 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.ov h2::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: var(--line); }
.ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: -48px; position: relative; z-index: 2; }
.stat-tile {
    display: flex; flex-direction: column; padding: 16px 18px; border-radius: 22px;
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-top: 3px solid var(--c);
}
.stat-tile .num { font: 800 2.3rem/1.05 var(--display); color: var(--ink); letter-spacing: -.03em; }
.stat-tile .lbl { color: var(--muted); font-weight: 600; font-size: .9rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.facts div { display: flex; flex-direction: column; }
.facts strong { font: 800 1.35rem var(--display); }
.facts span { color: var(--muted); font-size: .9rem; }
.countries { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 5px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--ink);
    background: var(--line); background: color-mix(in srgb, var(--c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.ov-map-wrap { position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.ov-map { height: 60vh; min-height: 340px; }
.ov-map-wrap .mapinfo { bottom: 24px; }

.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 130px; gap: 8px; grid-auto-flow: dense; }
.mosaic a { display: block; border-radius: 18px; overflow: hidden; background: var(--line); box-shadow: var(--shadow); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.mosaic a:hover img { transform: scale(1.05); }
.mosaic .m0 { grid-column: span 2; grid-row: span 2; }
.mosaic .m3 { grid-row: span 2; }
.mosaic .m5 { grid-column: span 2; }
@media (max-width: 640px) { .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 118px; } }

.day { margin-bottom: 30px; }
.day-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.day-no { flex: none; padding: 7px 16px; border-radius: 999px; background: var(--grad-brand); color: #fff; font: 800 .95rem var(--display); }
.day-head h3 { margin: 0; font-size: 1.25rem; }
.day-head h3::first-letter { text-transform: uppercase; }
.story { border-left: 5px solid var(--c); padding: 4px 0 4px 18px; margin: 16px 0 22px 6px; }
.story-head { display: flex; gap: 12px; align-items: flex-start; }
.story .num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 .9rem var(--display); }
.story h4 { margin: 0 0 3px; font-size: 1.2rem; }
.story .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); font-size: .82rem; }
.strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.strip a { display: block; width: 118px; height: 118px; border-radius: 14px; overflow: hidden; background: var(--line); }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- popups (RBDialog in ui.js): same look as the rest of the app, follows the person's theme ---- */
.dlg { border: 0; padding: 0; background: transparent; color: var(--ink); width: min(440px, calc(100vw - 24px)); max-width: none; overflow: visible; }
.dlg::backdrop { background: rgba(12, 14, 30, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg[open] { animation: dlg-in .18s ease-out; }
.dlg[open]::backdrop { animation: dlg-fade .18s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
.dlg-box {
    margin: 0; padding: 24px 22px 18px; display: flex; flex-direction: column; gap: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: 28px;
    box-shadow: 0 34px 70px -24px rgba(0, 0, 0, .6);
}
.dlg-icon {
    width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem;
    background: color-mix(in srgb, var(--p1) 14%, var(--field));
}
.dlg.danger .dlg-icon { background: color-mix(in srgb, var(--danger) 16%, var(--field)); }
.dlg-title { margin: 4px 0 0; font-size: 1.3rem; }
.dlg-msg { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.dlg-share { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.dlg-share input { font-size: .85rem; }
.dlg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.btn.danger.solid { background: var(--danger); border-color: transparent; color: #fff; }
@media (max-width: 560px) {
    /* on a phone the popup slides up from the bottom, like a sheet */
    .dlg { width: 100vw; margin: auto 0 0 0; max-width: 100vw; }
    .dlg-box { border-radius: 28px 28px 0 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
    .dlg[open] { animation-name: dlg-sheet; }
    @keyframes dlg-sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .dlg[open], .dlg[open]::backdrop { animation: none; } }

.badge.soft { background: var(--field); color: var(--muted); border: 1px solid var(--line); font-weight: 700; }
h3.sub { margin: 18px 0 4px; font-size: 1rem; }

/* ---- photo editor ---- */
.editor { border: 0; padding: 0; background: transparent; color: var(--ink); width: min(980px, 100vw); max-width: none; height: min(92vh, 100dvh); max-height: none; overflow: visible; }
.editor::backdrop { background: rgba(8, 9, 24, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ed-box { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: 0 34px 70px -24px rgba(0, 0, 0, .65); }
.ed-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ed-stage { position: relative; flex: 1; min-height: 0; background: color-mix(in srgb, var(--ink) 92%, var(--bg)); display: grid; place-items: center; touch-action: none; }
.ed-wrap { position: relative; line-height: 0; }
.ed-canvas { display: block; background: #222; }
.ed-crop { position: absolute; box-shadow: 0 0 0 9999px rgba(8, 9, 24, .62); border: 2px solid #fff; cursor: move; touch-action: none; }
.ed-crop .g1, .ed-crop .g2 { position: absolute; pointer-events: none; inset: 0; }
.ed-crop .g1 { background: linear-gradient(to right, transparent calc(33.3% - .5px), rgba(255, 255, 255, .45) calc(33.3% - .5px) calc(33.3% + .5px), transparent calc(33.3% + .5px), transparent calc(66.6% - .5px), rgba(255, 255, 255, .45) calc(66.6% - .5px) calc(66.6% + .5px), transparent calc(66.6% + .5px)); }
.ed-crop .g2 { background: linear-gradient(to bottom, transparent calc(33.3% - .5px), rgba(255, 255, 255, .45) calc(33.3% - .5px) calc(33.3% + .5px), transparent calc(33.3% + .5px), transparent calc(66.6% - .5px), rgba(255, 255, 255, .45) calc(66.6% - .5px) calc(66.6% + .5px), transparent calc(66.6% + .5px)); }
.ed-crop .h { position: absolute; width: 38px; height: 38px; cursor: nwse-resize; }
.ed-crop .h::after { content: ''; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 5px rgba(0, 0, 0, .5); }
.ed-crop .nw { left: -19px; top: -19px; } .ed-crop .nw::after { left: 10px; top: 10px; }
.ed-crop .ne { right: -19px; top: -19px; cursor: nesw-resize; } .ed-crop .ne::after { right: 10px; top: 10px; }
.ed-crop .sw { left: -19px; bottom: -19px; cursor: nesw-resize; } .ed-crop .sw::after { left: 10px; bottom: 10px; }
.ed-crop .se { right: -19px; bottom: -19px; } .ed-crop .se::after { right: 10px; bottom: 10px; }
.ed-tabs { display: flex; border-top: 1px solid var(--line); }
.ed-tabs button { flex: 1; padding: 11px; border: 0; background: transparent; color: var(--muted); font: 700 .95rem var(--display); cursor: pointer; border-bottom: 3px solid transparent; }
.ed-tabs button.on { color: var(--ink); border-bottom-color: var(--p1); }
.ed-panel { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 148px; max-height: 38vh; overflow: auto; }
.ed-panel[hidden] { display: none; }
.ed-row, .ed-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: 600 .88rem system-ui, sans-serif; cursor: pointer; }
.chip-btn.on { background: var(--grad-brand); border-color: transparent; color: #fff; }
.ed-slider { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.ed-slider span { width: 82px; flex: none; }
.ed-slider input { padding: 0; accent-color: var(--p1); background: transparent; border: 0; }
.editor [hidden] { display: none !important; }
.ed-textctl { display: flex; flex-direction: column; gap: 10px; }
.ed-text { width: 100%; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: 600 1rem system-ui, sans-serif; resize: vertical; }
.ed-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.ed-sw.on { outline: 3px solid var(--p1); outline-offset: 2px; }
.ed-swpick { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; background: transparent; cursor: pointer; }
.ed-label { font: 700 .74rem system-ui, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.co-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.co-tile { position: relative; width: 66px; height: 66px; padding: 0; border-radius: 14px; overflow: hidden; border: 3px solid transparent; background: var(--line); cursor: pointer; }
.co-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.co-tile.on { border-color: var(--p1); }
.co-tile i { position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--p1); color: #fff; font: 700 .75rem system-ui, sans-serif; font-style: normal; display: grid; place-items: center; }
.co-tile.co-add { display: grid; place-items: center; font-size: 1.7rem; color: var(--muted); border: 2px dashed var(--line); background: transparent; }
.co-lay { width: 52px; height: 52px; padding: 5px; border-radius: 12px; border: 2px solid var(--line); background: var(--field); cursor: pointer; }
.co-lay svg { display: block; width: 100%; height: 100%; fill: var(--muted); }
.co-lay.on { border-color: var(--p1); }
.co-lay.on svg { fill: var(--p1); }
.co-check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: .9rem; display: flex; }
.co-check input { width: auto; flex: none; accent-color: var(--p1); }
.thumb .ed {
    position: absolute; left: 4px; bottom: 6px; height: 26px; padding: 0 9px; border-radius: 999px; border: 0;
    background: rgba(0, 0, 0, .62); color: #fff; font: 700 .75rem system-ui, sans-serif; cursor: pointer;
}
.thumb.collage::after { content: '🧩 collage'; position: absolute; right: 4px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(15, 158, 138, .9); color: #fff; font: 700 .68rem system-ui, sans-serif; }
.thumb.edited::after { content: '✓ bewerkt'; position: absolute; right: 4px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(15, 158, 138, .9); color: #fff; font: 700 .68rem system-ui, sans-serif; }
@media (max-width: 700px) {
    .editor { width: 100vw; height: 100dvh; }
    .ed-box { border-radius: 0; border: 0; }
}

/* ---- server check ---- */
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; }
.check .ico { flex: none; font-size: 1.2rem; line-height: 1.4; }
.check.warn { border-color: color-mix(in srgb, var(--p3) 55%, var(--line)); }
.check.fail { border-color: var(--danger); }
.check .hint { margin-top: 3px; color: var(--ink); }

/* ---- planned stops ---- */
.planned-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.planned-head h2 { margin: 0; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.plan-list li { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.plan-list li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 32px; bottom: -12px; border-left: 2px dashed var(--line); }
.pn, .pplan {
    flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--card); color: var(--ink); border: 2px dashed var(--muted); font: 800 .85rem var(--display);
}
.pplan-wrap { background: none; border: 0; }
.pplan { box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.pplan.private { border-style: dotted; opacity: .85; }
.tmark.planned { border-style: dashed; border-color: var(--muted); }
.plan-note { margin-top: 4px; font-size: .92rem; color: var(--ink); overflow-wrap: anywhere; }
.lock { font-size: .85rem; }

/* planning page (admin) */
label.checkline { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
label.checkline input { width: auto; }
.stopcard { display: flex; gap: 12px; align-items: flex-start; }
.stopcard .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stopcard .row { margin-top: 6px; gap: 6px; }
.stopcard.past { opacity: .6; }
.results { display: flex; flex-direction: column; gap: 6px; }
.results button { text-align: left; border-radius: 14px; }

/* ---- transport ---- */
.transport { border: 0; padding: 0; margin: 0; min-width: 0; }
.transport legend { padding: 0; margin-bottom: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { position: relative; flex-direction: row; cursor: pointer; }
.tchip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.tchip span {
    display: inline-block; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--field);
    color: var(--ink); font-weight: 600; font-size: .9rem;
}
.tchip input:checked + span { background: var(--grad-brand); border-color: transparent; color: #fff; }
.tchip input:focus-visible + span { outline: 2px solid var(--p1); outline-offset: 2px; }
.transport-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.tmark-wrap { background: none; border: 0; }
.tmark {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; line-height: 1;
    background: var(--card); border: 2px solid var(--p1); box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.transport-km { display: flex; flex-wrap: wrap; gap: 8px; }
.tk { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .92rem; }
.tk .e { font-size: 1.1rem; }

/* ---- user menu (top bar) ---- */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: block; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff;
    background: var(--grad-brand); font: 800 .95rem var(--display);
}
.usermenu[open] .avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--p1) 35%, transparent); }
.usermenu .menu {
    position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 8px; z-index: 1200;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .4);
}
.usermenu .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; line-height: 1.3; }
.usermenu .who small { color: var(--muted); font-weight: 500; }
.usermenu .menu a { display: block; padding: 9px 10px; border-radius: 12px; color: var(--ink); font-weight: 600; }
.usermenu .menu a:hover { background: var(--field); }

/* ---- theme picker (account) + preview bar ---- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.theme-card {
    display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 18px;
    background: var(--card); color: var(--ink); border: 1px solid var(--line);
}
.theme-card.active { outline: 3px solid var(--p1); outline-offset: 1px; }
.theme-hero { height: 54px; border-radius: 12px; background: var(--grad-sunset); }
.theme-dots { display: flex; gap: 5px; }
.theme-dots i { width: 18px; height: 18px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.theme-card span.small { color: var(--muted); }
.theme-card .row { margin-top: 4px; gap: 6px; }
.preview-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 2600;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
    width: max-content; max-width: calc(100vw - 24px);
    padding: 10px 14px; border-radius: 18px; background: var(--ink); color: var(--bg); font-size: .92rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.preview-bar .btn { color: var(--ink); }
.preview-bar .btn.primary { color: #fff; }

/* ---- concepts ---- */
.badge { font: 800 .7rem system-ui, sans-serif; vertical-align: middle; padding: 3px 10px; border-radius: 999px; background: var(--grad-cta); color: #fff; margin-left: 6px; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap input { flex: 1; min-width: 0; }
.draft { display: flex; gap: 14px; align-items: flex-start; }
.draft > img, .draft .noimg { flex: none; width: 84px; height: 84px; border-radius: 16px; object-fit: cover; background: var(--line); display: grid; place-items: center; font-size: 1.6rem; }
.draft .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.draft .excerpt { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.draft .row { margin-top: 6px; gap: 6px; }
.draft form.inline { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---- offline outbox bar ---- */
.outbox-bar {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 2500;
    background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 18px; font-size: .92rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
}
.outbox-bar[hidden] { display: none; }
.outbox-bar a { color: #ff9a6b; }
.outbox-bar button { font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 999px; padding: 4px 14px; background: var(--grad-cta); color: #fff; }

/* ---- post editor ---- */
.drop [hidden] { display: none !important; }
.drop { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; border: 2px dashed color-mix(in srgb, var(--p1) 45%, var(--line)); border-radius: 18px; background: var(--field); }
.drop.over { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 10%, var(--field)); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm {
    position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0;
    background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1;
}
.thumb.uploading img { opacity: .35; }
.thumb .bar { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--grad-cta); width: 0; transition: width .15s; }
.thumb.failed { outline: 2px solid var(--danger); }

@media (prefers-reduced-motion: reduce) {
    .here { animation: none; }
    .btn, .mosaic img { transition: none; }
}

/* ---- print: the overview becomes a clean travel booklet ---- */
@media print {
    @page { margin: 12mm; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff !important; color: #14183a; }
    .topbar, .colorbar, .noprint, .outbox-bar, .lightbox, .leaflet-control-container, .flash { display: none !important; }
    .ov-hero { min-height: 0; padding: 40px 24px; border-radius: 18px; }
    .ov-stats { margin-top: 16px; }
    .ov { padding: 12px 0 0; gap: 18px; }
    .ov-map { height: 95mm; min-height: 0; }
    .card, .stat-tile, .ov-map-wrap, .mosaic a, .story, .day-head { box-shadow: none; break-inside: avoid; }
    .story { break-inside: avoid-page; }
    .mosaic { grid-auto-rows: 28mm; }
    .strip a { width: 28mm; height: 28mm; }
    .ov h2 { break-after: avoid; }
}
