:root {
    --paper: #f5f1e8;
    --paper-deep: #eae3d5;
    --ink: #17251f;
    --muted: #6f776f;
    --line: rgba(23, 37, 31, .13);
    --forest: #173f35;
    --forest-soft: #2d5a4e;
    --accent: #ec6d4e;
    --accent-dark: #d6573b;
    --sun: #e6b85d;
    --white: #fff;
    --shadow: 0 18px 50px rgba(25, 41, 34, .14);
    --shadow-soft: 0 8px 28px rgba(25, 41, 34, .1);
    --radius: 22px;
    --serif: Georgia, 'Times New Roman', serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.map-page { overflow: hidden; }
.map-shell { position: relative; width: 100%; height: 100dvh; min-height: 620px; overflow: hidden; }
.world-map { position: absolute; inset: 0; z-index: 0; background: #dce6df; }

.world-map::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 400;
    pointer-events: none;
    box-shadow: inset 0 0 90px rgba(23, 63, 53, .13);
}

.leaflet-tile-pane { filter: saturate(.76) sepia(.08) brightness(1.03); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-soft) !important; }
.leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 36px !important; color: var(--forest) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { padding: 3px 7px !important; background: rgba(255,255,255,.74) !important; backdrop-filter: blur(7px); }

.glass-panel {
    border: 1px solid rgba(255, 255, 255, .68);
    background: rgba(252, 250, 245, .88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.map-toolbar {
    position: absolute;
    z-index: 800;
    top: 22px;
    left: 24px;
    right: 24px;
    height: 76px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 0 15px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 14px;
    color: #fff;
    background: var(--forest);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 6px 15px rgba(23,63,53,.2);
}
.brand-mark svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: var(--serif); font-size: 20px; letter-spacing: -.25px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .105em; }

.toolbar-actions { display: flex; align-items: center; gap: 20px; height: 100%; }
.trips-list-link { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; color: var(--forest); border-radius: 10px; background: rgba(23,63,53,.07); font-size: 11px; font-weight: 800; text-decoration: none; transition: background .2s, transform .2s; }
.trips-list-link:hover { background: rgba(23,63,53,.12); transform: translateY(-1px); }
.trips-list-link svg { width: 16px; }
.person-filter { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; transition: background .2s ease; }
.person-filter:hover { background: rgba(23,63,53,.055); }
.filter-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--forest); border-radius: 10px; background: rgba(23,63,53,.08); }
.filter-icon svg { width: 17px; }
.filter-copy { display: flex; flex-direction: column; line-height: 1.15; }
.filter-copy small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.filter-copy select { min-width: 174px; padding: 2px 24px 2px 0; color: var(--ink); font-size: 13px; font-weight: 700; border: 0; outline: 0; background: transparent; cursor: pointer; }
.year-filter .filter-copy select { min-width: 132px; }
.map-stats { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.map-stats strong { margin-right: 3px; color: var(--ink); font-family: var(--serif); font-size: 18px; }
.map-stats i { width: 1px; height: 24px; background: var(--line); }

.map-legend {
    position: absolute;
    z-index: 700;
    left: 24px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 11px;
}
.legend-photo { width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.legend-route { width: 22px; height: 0; margin-left: 8px; border-top: 2px dashed var(--accent); }

.add-trip-fab {
    position: absolute;
    z-index: 800;
    right: 30px;
    bottom: 28px;
    display: flex;
    align-items: center;
    gap: 11px;
    height: 58px;
    padding: 5px 22px 5px 6px;
    color: #fff;
    border: 0;
    border-radius: 30px;
    background: var(--accent);
    box-shadow: 0 12px 28px rgba(196, 72, 43, .32);
    cursor: pointer;
    transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.add-trip-fab:hover { transform: translateY(-3px); background: var(--accent-dark); box-shadow: 0 16px 34px rgba(196,72,43,.38); }
.add-trip-fab span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.16); }
.add-trip-fab svg { width: 22px; }
.add-trip-fab strong { font-size: 13px; }

.empty-map {
    position: absolute;
    z-index: 600;
    top: 50%;
    left: 50%;
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    width: min(680px, calc(100% - 40px));
    min-height: 320px;
    overflow: hidden;
    border-radius: 25px;
    transform: translate(-50%, -47%);
    animation: empty-enter .7s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes empty-enter { from { opacity: 0; transform: translate(-50%, -43%) scale(.97); } }
.empty-photo-wrap { position: relative; min-height: 320px; overflow: hidden; background: var(--forest); }
.empty-photo-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(23,63,53,.12), rgba(23,63,53,.55)); }
.empty-photo-wrap img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.78); }
.empty-pin { position: absolute; z-index: 2; top: 47%; left: 53%; width: 42px; height: 42px; border: 3px solid white; border-radius: 50% 50% 50% 8px; background: var(--accent); box-shadow: 0 8px 18px rgba(0,0,0,.28); transform: rotate(-45deg); animation: pin-bounce 2s ease-in-out infinite; }
.empty-pin span { position: absolute; inset: 10px; border-radius: 50%; background: white; }
@keyframes pin-bounce { 50% { transform: translateY(-7px) rotate(-45deg); } }
.empty-copy { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 36px 38px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; }
.empty-copy h1 { margin: 10px 0 13px; font-family: var(--serif); font-size: clamp(29px, 3vw, 40px); font-weight: 500; line-height: 1.07; letter-spacing: -.04em; }
.empty-copy p { margin: 0 0 23px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.photo-credit { position: absolute; right: 16px; bottom: 10px; color: #8b8e89; font-size: 8px; text-decoration: none; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; font-size: 13px; font-weight: 750; text-decoration: none; cursor: pointer; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 18px; }
.button-dark { color: #fff; background: var(--forest); box-shadow: 0 8px 20px rgba(23,63,53,.2); }
.button-dark:hover { background: #0f332a; }
.button-accent { color: white; background: var(--accent); box-shadow: 0 8px 18px rgba(217,84,54,.22); }
.button-accent:hover { background: var(--accent-dark); }
.button-ghost { border: 1px solid var(--line); background: transparent; }
.button-search { min-height: 48px; margin-top: 24px; color: white; background: var(--forest); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }

/* Map markers and popup */
.trip-marker { background: none; border: 0; }
.photo-marker { position: relative; width: 58px; height: 66px; filter: drop-shadow(0 7px 9px rgba(25,41,34,.28)); transform: scale(var(--marker-scale, 1)); transform-origin: 50% 100%; transition: transform .2s ease; }
.photo-marker:hover { transform: scale(var(--marker-scale, 1)) translateY(-4px); }
.photo-marker-frame { position: absolute; top: 0; left: 0; width: 56px; height: 56px; padding: 4px; overflow: hidden; border-radius: 50%; background: #fff; }
.photo-marker-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.photo-marker-frame.no-photo { display: grid; place-items: center; color: #fff; background: var(--accent); border: 4px solid #fff; font-family: var(--serif); font-size: 18px; font-weight: bold; }
.photo-marker::after { content: ''; position: absolute; left: 23px; bottom: 3px; width: 11px; height: 11px; background: white; transform: rotate(45deg); z-index: -1; }
.marker-number { position: absolute; z-index: 2; right: -3px; top: -3px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: white; border: 2px solid white; border-radius: 10px; background: var(--forest); font-size: 9px; font-weight: 800; }
.journey-line { stroke-dasharray: 8 8; filter: drop-shadow(0 1px 2px rgba(121,35,22,.48)); animation: route-flow 1.05s linear infinite; }
@keyframes route-flow { to { stroke-dashoffset: -16; } }
.leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 18px; box-shadow: 0 18px 45px rgba(23,37,31,.22); }
.leaflet-popup-content { width: 290px !important; margin: 0; }
.leaflet-popup-tip { box-shadow: 5px 5px 12px rgba(23,37,31,.1); }
.map-popup { background: #fff; }
.popup-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; height: 110px; background: #e7e8e2; }
.popup-photos img { width: 100%; height: 100%; object-fit: cover; }
.popup-photos img:first-child:last-child { grid-column: 1 / -1; }
.popup-photos.is-single { display: block; }
.popup-photos.is-single img { display: block; width: 100%; height: 110px; }
.popup-no-photo { display: grid; place-items: center; grid-column: 1 / -1; color: rgba(255,255,255,.75); background: linear-gradient(135deg, var(--forest), #567469); }
.popup-no-photo svg { width: 34px; }
.popup-body { padding: 17px 18px 16px; }
.popup-trip-name { display: block; margin-bottom: 3px; color: #a64133; font-size: 9px; font-weight: 850; letter-spacing: .12em; line-height: 1.35; text-transform: uppercase; }
.popup-body h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.2; }
.popup-meta { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.popup-meta span { display: flex; align-items: center; gap: 7px; }
.popup-meta svg { width: 14px; }
.popup-link { display: flex; align-items: center; justify-content: space-between; margin: 13px -18px -16px; padding: 12px 18px; color: var(--forest); border-top: 1px solid var(--line); font-size: 11px; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .07em; }
.popup-link svg { width: 16px; transition: transform .2s; }
.popup-link:hover svg { transform: translateX(4px); }

/* Add trip dialog */
.trip-dialog { width: min(1180px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; color: var(--ink); border: 0; border-radius: 25px; background: var(--paper); box-shadow: 0 28px 90px rgba(12,30,24,.35); }
.trip-dialog[open] { animation: dialog-in .34s cubic-bezier(.2,.75,.25,1) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(22px) scale(.975); } }
.trip-dialog::backdrop { background: rgba(15, 31, 26, .58); backdrop-filter: blur(5px); animation: fade-in .25s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.trip-form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.dialog-head { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; padding: 25px 29px 21px; color: #fff; background: var(--forest); }
.dialog-head h2 { margin: 3px 0 3px; font-family: var(--serif); font-size: 31px; font-weight: 500; letter-spacing: -.03em; }
.dialog-head p { margin: 0; color: rgba(255,255,255,.62); font-size: 12px; }
.dialog-head .eyebrow { color: #f0b080; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; color: inherit; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); cursor: pointer; transition: background .2s, transform .2s; }
.icon-button:hover { background: rgba(255,255,255,.18); transform: rotate(3deg); }
.icon-button svg { width: 19px; }
.dialog-body { flex: 1 1 auto; overflow: auto; padding: 8px 29px 30px; scrollbar-color: #bbc4bd transparent; scrollbar-width: thin; }
.form-alert { display: none; margin: 17px 0 6px; padding: 11px 14px; color: #822f25; border: 1px solid rgba(183,71,53,.24); border-radius: 10px; background: #f9ded6; font-size: 12px; }
.form-alert.is-visible { display: block; }
.form-section { padding: 25px 0 6px; }
.form-section + .form-section { margin-top: 21px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.section-heading > span { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; color: var(--accent); border: 1px solid rgba(236,109,78,.25); border-radius: 50%; font-family: var(--serif); font-size: 13px; font-weight: 700; }
.section-heading h3 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 500; }
.section-heading p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.section-heading-actions .text-button { margin-left: auto; }
.text-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; color: var(--forest); border: 0; border-radius: 9px; background: rgba(23,63,53,.08); font-size: 11px; font-weight: 800; cursor: pointer; }
.text-button svg { width: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span:first-child { color: #465149; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.field em { color: #a0a49f; font-size: 9px; font-style: normal; font-weight: 600; letter-spacing: .02em; text-transform: none; }
.field input, .field textarea {
    width: 100%;
    padding: 12px 13px;
    color: var(--ink);
    border: 1px solid #d9dbd5;
    border-radius: 10px;
    outline: 0;
    background: rgba(255,255,255,.76);
    font-size: 13px;
    transition: border .2s, box-shadow .2s, background .2s;
}
.field input { min-height: 46px; }
.field textarea { min-height: 94px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: rgba(23,63,53,.55); background: #fff; box-shadow: 0 0 0 3px rgba(23,63,53,.07); }
.field input::placeholder, .field textarea::placeholder { color: #a8aca7; }
.field-hint { margin-top: 6px; color: #929792; font-size: 10px; }
.tag-input { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 48px; padding: 6px 9px; border: 1px solid #d9dbd5; border-radius: 10px; background: rgba(255,255,255,.76); cursor: text; }
.tag-input:focus-within { border-color: rgba(23,63,53,.55); background: #fff; box-shadow: 0 0 0 3px rgba(23,63,53,.07); }
.tag-list { display: contents; }
.person-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px 5px 10px; color: var(--forest); border-radius: 8px; background: #e3ece7; font-size: 11px; font-weight: 700; }
.person-tag button { display: grid; place-items: center; width: 17px; height: 17px; padding: 0; color: var(--forest); border: 0; border-radius: 50%; background: rgba(23,63,53,.1); cursor: pointer; }
.person-tag svg { width: 10px; }
.tag-input > input { flex: 1 1 180px; min-width: 120px; padding: 6px 2px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.participant-suggestions { position: absolute; z-index: 1100; top: calc(100% + 6px); left: 0; right: 0; display: none; max-height: 220px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); cursor: default; }
.participant-suggestions.is-visible { display: block; }
.participant-suggestion { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; color: var(--ink); text-align: left; border: 0; border-radius: 8px; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.participant-suggestion:hover, .participant-suggestion:focus { outline: 0; background: #edf2ee; }
.participant-suggestion > span { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; color: white; border-radius: 50%; background: var(--forest); font-family: var(--serif); font-size: 10px; }

.places-list { display: flex; flex-direction: column; gap: 15px; }
.place-card { overflow: hidden; border: 1px solid #d9ddd7; border-radius: 16px; background: rgba(255,255,255,.62); box-shadow: 0 5px 18px rgba(23,37,31,.04); }
.place-card-head { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7); }
.place-card-head .place-number { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; color: #fff; border-radius: 10px; background: var(--forest); font-family: var(--serif); font-size: 12px; }
.place-card-head h4 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 500; }
.place-card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.place-card-head .remove-place { margin-left: auto; color: #8c4c41; background: #f5e8e4; }
.place-layout { display: grid; grid-template-columns: 1.12fr .88fr; min-height: 360px; }
.place-fields { padding: 18px; }
.place-map-wrap { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); background: #e0e8e1; }
.place-map { flex: 1 1 auto; min-height: 315px; background: #dce6df; }
.place-map-wrap > p { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; margin: 0; padding: 8px; color: #657168; background: #eef2ec; font-size: 9px; }
.place-map-wrap > p svg { width: 13px; }
.location-search { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.location-search .field { min-width: 0; }
.input-with-icon { position: relative; display: block; }
.input-with-icon svg { position: absolute; z-index: 1; top: 50%; left: 12px; width: 17px; color: #869087; transform: translateY(-50%); }
.input-with-icon input { padding-left: 38px; }
.geocode-results { position: absolute; z-index: 1001; top: calc(100% + 6px); left: 0; right: 0; display: none; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.geocode-results.is-visible { display: block; }
.geocode-result { display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 10px 12px; text-align: left; border: 0; border-bottom: 1px solid #eef0ed; background: #fff; cursor: pointer; }
.geocode-result:last-child { border-bottom: 0; }
.geocode-result:hover { background: #f4f6f2; }
.geocode-result svg { width: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--accent); }
.geocode-result span { display: flex; flex-direction: column; min-width: 0; }
.geocode-result strong { font-size: 11px; }
.geocode-result small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.geocode-message { padding: 12px; color: var(--muted); font-size: 11px; }
.geocode-notice { padding: 10px 12px; color: #684b19; border-bottom: 1px solid #ead8b3; background: #fff6df; font-size: 9px; font-weight: 650; line-height: 1.45; }
.selected-location { display: flex; align-items: center; gap: 10px; min-height: 55px; margin: 13px 0 16px; padding: 9px 11px; color: #69716b; border: 1px dashed #ced3cd; border-radius: 10px; background: rgba(244,246,242,.8); }
.selected-location.is-selected { color: var(--forest); border-style: solid; border-color: rgba(23,63,53,.18); background: #eaf1ed; }
.selected-location-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; color: var(--accent); border-radius: 10px; background: #fff; }
.selected-location-icon svg { width: 18px; }
.selected-location > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.selected-location small { color: var(--muted); font-size: 9px; }
.selected-location strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.compact-grid { gap: 13px; }
.compact-grid .field:first-child { grid-column: 1 / -1; max-width: 220px; }
.photo-drop { position: relative; display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 9px 12px; overflow: hidden; color: var(--forest); border: 1px dashed #bdc6be; border-radius: 10px; background: #f4f6f2; cursor: pointer; }
.photo-drop:hover { border-color: var(--forest); background: #edf2ee; }
.photo-drop > svg { width: 26px; }
.photo-drop > span { display: flex; flex-direction: column; }
.photo-drop strong { font-size: 11px; }
.photo-drop small { color: var(--muted); font-size: 9px; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-preview:empty { display: none; }
.preview-thumb { position: relative; width: 48px; height: 48px; margin-top: 2px; overflow: hidden; border-radius: 7px; background: #dfe4df; }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-more { display: grid; place-items: center; width: 48px; height: 48px; margin-top: 2px; color: var(--forest); border-radius: 7px; background: #dfe9e3; font-size: 10px; font-weight: 800; }
.dialog-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 29px; border-top: 1px solid var(--line); background: #fbfaf6; }
.dialog-footer > p { display: flex; align-items: center; gap: 7px; max-width: 430px; margin: 0; color: var(--muted); font-size: 9px; }
.dialog-footer > p svg { width: 14px; flex: 0 0 auto; }
.dialog-footer > div { display: flex; gap: 8px; }

/* Trip detail */
.detail-page { background: #f6f2e9; }
.detail-nav { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 78px; padding: 0 max(28px, calc((100% - 1260px) / 2)); background: rgba(250,248,242,.94); border-bottom: 1px solid var(--line); }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--forest); font-size: 12px; font-weight: 750; text-decoration: none; }
.back-link svg { width: 17px; transition: transform .2s; }
.back-link:hover svg { transform: translateX(-3px); }
.trip-detail { overflow: hidden; }
.trip-hero { position: relative; max-width: 1440px; height: min(64vw, 660px); min-height: 510px; margin: 0 auto; background: #d8dfd8; }
.hero-gallery { position: absolute; inset: 0; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; overflow: hidden; }
.hero-photo { position: relative; padding: 0; overflow: hidden; border: 0; background: #d5dbd5; cursor: zoom-in; }
.hero-photo:first-child { grid-row: 1 / -1; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.hero-photo:hover img { transform: scale(1.035); }
.hero-gallery-1 { display: block; }
.hero-gallery-1 .hero-photo { display: block; width: 100%; height: 100%; }
.hero-gallery-2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.hero-gallery-2 .hero-photo:first-child { grid-row: auto; }
.hero-gallery-3 { grid-template-columns: 2fr 1fr; }
.hero-gallery-4, .hero-gallery-5 { grid-template-columns: 2fr 1fr 1fr; }
.hero-gallery-4 .hero-photo:first-child, .hero-gallery-5 .hero-photo:first-child { grid-row: 1 / -1; }
.hero-gallery-4 .hero-photo:nth-child(4) { grid-column: 2 / -1; }
.hero-gallery::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 38%, rgba(8,25,20,.76) 100%); }
.all-photos-button { position: absolute; z-index: 3; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 0 12px; border: 0; border-radius: 10px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-soft); font-size: 10px; font-weight: 800; cursor: pointer; backdrop-filter: blur(8px); }
.all-photos-button svg { width: 15px; fill: currentColor; stroke: none; }
.all-photos-button span { display: grid; place-items: center; min-width: 20px; height: 20px; color: white; border-radius: 10px; background: var(--forest); }
.trip-heading { position: absolute; z-index: 5; left: max(32px, calc((100% - 1120px) / 2)); right: 32px; bottom: 46px; color: white; }
.heading-kicker { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .13em; }
.heading-kicker svg { width: 14px; }
.trip-heading h1 { max-width: 850px; margin: 0 0 16px; font-family: var(--serif); font-size: clamp(44px, 6vw, 76px); font-weight: 500; line-height: .98; letter-spacing: -.045em; text-shadow: 0 3px 20px rgba(0,0,0,.22); }
.trip-meta-row { display: flex; flex-wrap: wrap; gap: 9px; }
.trip-meta-row span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.19); border-radius: 9px; background: rgba(10,31,24,.34); backdrop-filter: blur(9px); font-size: 11px; }
.trip-meta-row svg { width: 14px; }
.edit-trip-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; padding: 8px 11px; color: white; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; background: rgba(255,255,255,.1); backdrop-filter: blur(9px); font-size: 10px; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .06em; transition: background .2s, transform .2s; }
.edit-trip-link:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.edit-trip-link svg { width: 14px; }
.trip-hero-empty { color: white; background: var(--forest); }
.hero-empty-art { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 75% 30%, rgba(230,184,93,.22), transparent 25%), linear-gradient(135deg, #31594d, #132e27); }
.hero-empty-art > svg { position: absolute; inset: auto 0 0; width: 100%; height: 72%; opacity: .19; }
.hero-empty-art > svg path:first-child { fill: #d9e3dc; stroke: none; }
.hero-empty-art > svg path:last-child { fill: none; stroke: #fff; stroke-width: 2px; opacity: .35; }
.hero-compass { position: absolute; top: 14%; right: 12%; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; }
.hero-compass::before, .hero-compass::after { content: ''; position: absolute; background: rgba(255,255,255,.15); }
.hero-compass::before { top: 50%; left: -30px; right: -30px; height: 1px; }
.hero-compass::after { left: 50%; top: -30px; bottom: -30px; width: 1px; }
.hero-compass i { position: absolute; inset: 38px; border: 1px solid rgba(255,255,255,.17); transform: rotate(45deg); }
.detail-content { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.trip-overview { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); gap: 80px; padding: 75px 0 65px; border-bottom: 1px solid var(--line); }
.lead-copy { margin: 14px 0 0; max-width: 710px; font-family: var(--serif); font-size: clamp(22px, 3vw, 32px); line-height: 1.45; letter-spacing: -.02em; }
.muted-copy { color: #758078; font-style: italic; }
.trip-facts { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding-left: 30px; border-left: 1px solid var(--line); }
.trip-facts > div { display: flex; align-items: flex-start; gap: 12px; }
.fact-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; color: var(--forest); border-radius: 12px; background: #e3e9e3; }
.fact-icon svg { width: 18px; }
.trip-facts div > span:last-child { display: flex; flex-direction: column; }
.trip-facts small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.trip-facts strong { margin-top: 2px; font-size: 12px; line-height: 1.5; }
.fact-person-chips { margin-top: 5px; }
.fact-person-chips a { padding: 4px 9px; }
.route-section { padding: 65px 0 45px; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.section-title-row h2 { margin: 5px 0 0; font-family: var(--serif); font-size: 36px; font-weight: 500; letter-spacing: -.035em; }
.place-count-badge { display: grid; place-items: center; width: 43px; height: 43px; color: white; border-radius: 50%; background: var(--accent); font-family: var(--serif); font-size: 17px; box-shadow: 0 7px 17px rgba(217,84,54,.22); }
.trip-route-map { height: 430px; overflow: hidden; border: 7px solid #fff; border-radius: 22px; background: #dce6df; box-shadow: var(--shadow-soft); }
.detail-map-marker { background: transparent; border: 0; }
.detail-marker { position: relative; display: grid; place-items: center; width: 40px; height: 40px; color: white; border: 4px solid white; border-radius: 50% 50% 50% 8px; background: var(--accent); box-shadow: 0 7px 14px rgba(23,37,31,.27); font-family: var(--serif); font-size: 13px; font-weight: bold; transform: rotate(-45deg); }
.detail-marker span { transform: rotate(45deg); }
.detail-marker.has-photo { overflow: hidden; background: white; }
.detail-marker.has-photo img { width: 100%; height: 100%; object-fit: cover; transform: rotate(45deg) scale(1.42); }
.places-timeline { padding: 28px 0 90px; }
.timeline-place { display: grid; grid-template-columns: 70px 1fr; }
.timeline-rail { position: relative; display: flex; justify-content: flex-start; }
.timeline-rail::after { content: ''; position: absolute; top: 44px; bottom: 0; left: 21px; width: 1px; background: repeating-linear-gradient(to bottom, #b4bdb5 0 5px, transparent 5px 10px); }
.timeline-place:last-child .timeline-rail::after { display: none; }
.timeline-rail span { position: relative; z-index: 1; display: grid; place-items: center; width: 43px; height: 43px; color: var(--forest); border: 1px solid #cbd2cb; border-radius: 50%; background: var(--paper); font-family: var(--serif); font-size: 12px; font-weight: bold; }
.place-story { padding: 2px 0 68px; }
.place-story-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.place-kicker { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.place-story h3 { margin: 4px 0 5px; font-family: var(--serif); font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.place-address { display: flex; align-items: flex-start; gap: 6px; max-width: 650px; margin: 0; color: var(--muted); font-size: 10px; }
.place-address svg { width: 13px; flex: 0 0 auto; margin-top: 1px; }
.locate-place { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-top: 11px; padding: 7px 10px; color: var(--forest); border: 1px solid #cbd4cd; border-radius: 9px; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.locate-place:hover { background: #e7ece7; }
.locate-place svg { width: 14px; }
.place-notes { max-width: 760px; margin: 21px 0 24px; color: #58645c; font-family: var(--serif); font-size: 18px; line-height: 1.65; }
.place-photo-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 7px; height: 300px; margin-top: 24px; }
.place-photo-grid button { padding: 0; overflow: hidden; border: 0; border-radius: 12px; background: #dde2dc; cursor: zoom-in; }
.place-photo-grid button:first-child { grid-row: 1 / 3; }
.place-photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.place-photo-grid button:hover img { transform: scale(1.04); }
.place-photo-grid-1 { display: block; max-width: 760px; }
.place-photo-grid-1 button { display: block; width: 100%; height: 100%; }
.place-photo-grid-2 { grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr; }
.place-photo-grid-2 button:first-child { grid-row: auto; }
.place-photo-grid-3 { grid-template-columns: 1.5fr 1fr; }
.no-place-photos { display: flex; align-items: center; gap: 9px; margin-top: 22px; padding: 16px; color: #8b938d; border: 1px dashed #cdd3ce; border-radius: 12px; font-size: 10px; }
.no-place-photos svg { width: 20px; }
.detail-footer { display: flex; align-items: center; justify-content: space-between; min-height: 110px; padding: 20px max(28px, calc((100% - 1120px) / 2)); color: white; background: var(--forest); }
.detail-footer .brand { color: white; }
.detail-footer .brand-mark { background: rgba(255,255,255,.1); }
.detail-footer p { color: rgba(255,255,255,.48); font-family: var(--serif); font-size: 14px; font-style: italic; }
.detail-footer > a:last-child { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.8); font-size: 10px; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .09em; }
.detail-footer > a:last-child svg { width: 15px; }

.lightbox { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; color: white; border: 0; background: rgba(8,17,14,.96); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: #08110e; }
.lightbox figure { display: flex; flex-direction: column; align-items: center; max-width: calc(100% - 150px); max-height: calc(100% - 100px); margin: 0; }
.lightbox figure img { display: block; max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; box-shadow: 0 20px 70px rgba(0,0,0,.4); }
.lightbox figcaption { margin-top: 11px; color: rgba(255,255,255,.62); font-size: 11px; }
.lightbox button { position: fixed; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; color: white; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: rgba(255,255,255,.08); cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.15); }
.lightbox button svg { width: 22px; }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { top: 50%; left: 24px; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 24px; transform: translateY(-50%); }
.lightbox-counter { position: fixed; left: 50%; bottom: 24px; color: rgba(255,255,255,.65); font-size: 11px; transform: translateX(-50%); }

.error-page { display: flex; min-height: 100dvh; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; background: radial-gradient(circle at 50% 25%, #fff, var(--paper) 65%); }
.error-page .brand { position: absolute; top: 28px; left: 30px; }
.error-code { color: var(--accent); font-family: var(--serif); font-size: 90px; line-height: 1; opacity: .28; }
.error-page h1 { max-width: 620px; margin: 10px 0 12px; font-family: var(--serif); font-size: 40px; font-weight: 500; line-height: 1.1; }
.error-page p { margin: 0 0 25px; color: var(--muted); }

/* Trips list */
.trips-list-page { min-height: 100dvh; background: #f4f0e7; }
.list-nav { position: sticky; top: 0; background: rgba(250,248,242,.9); backdrop-filter: blur(15px); }
.trips-list-shell { width: min(1020px, calc(100% - 48px)); min-height: calc(100dvh - 188px); margin: 0 auto; padding: 68px 0 90px; }
.list-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 45px; margin-bottom: 38px; }
.list-intro h1 { margin: 7px 0 5px; font-family: var(--serif); font-size: clamp(38px, 5vw, 57px); font-weight: 500; line-height: 1.05; letter-spacing: -.045em; }
.list-intro > div > p { margin: 0; color: var(--muted); font-size: 12px; }
.list-filters { display: flex; align-items: flex-end; gap: 8px; flex: 0 0 auto; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.55); box-shadow: 0 7px 22px rgba(23,37,31,.05); }
.list-filters label { display: flex; flex-direction: column; gap: 4px; }
.list-filters label > span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.list-filters select { min-height: 41px; padding: 0 30px 0 10px; color: var(--ink); border: 1px solid #d7dcd6; border-radius: 9px; outline: 0; background: #fff; font-size: 10px; font-weight: 700; }
.list-filters .button { min-height: 41px; }
.clear-list-filter { align-self: center; margin: 15px 3px 0; color: var(--muted); font-size: 9px; font-weight: 800; }
.trip-list { display: flex; flex-direction: column; gap: 14px; }
.trip-list-item { overflow: hidden; border: 1px solid rgba(23,37,31,.11); border-radius: 18px; background: rgba(255,255,255,.69); box-shadow: 0 7px 24px rgba(23,37,31,.055); transition: transform .23s ease, box-shadow .23s ease, border-color .23s ease; }
.trip-list-item:hover { border-color: rgba(23,63,53,.23); box-shadow: 0 14px 34px rgba(23,37,31,.095); transform: translateY(-2px); }
.trip-list-main { display: grid; grid-template-columns: 105px minmax(0, 1fr) 90px; align-items: center; min-height: 144px; color: inherit; text-decoration: none; }
.trip-list-main time { display: flex; min-height: 94px; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); line-height: 1; }
.trip-list-main time strong { font-family: var(--serif); font-size: 34px; font-weight: 500; }
.trip-list-main time span { margin-top: 5px; color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.trip-list-main time small { margin-top: 7px; color: #4d5a52; font-size: 12px; font-weight: 750; letter-spacing: .03em; }
.trip-list-copy { min-width: 0; padding: 22px 28px; }
.trip-list-title { color: var(--accent); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
.trip-list-copy h2 { margin: 4px 0 6px; overflow: hidden; font-family: var(--serif); font-size: 27px; font-weight: 500; line-height: 1.15; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.trip-list-copy p { margin: 0; color: var(--muted); font-size: 10px; }
.trip-list-cover { width: 68px; height: 68px; object-fit: cover; border: 4px solid white; border-radius: 50%; box-shadow: 0 5px 15px rgba(23,37,31,.16); }
.trip-list-arrow { display: grid; place-items: center; width: 43px; height: 43px; color: var(--forest); border-radius: 50%; background: #e4ebe6; transition: transform .2s, background .2s; }
.trip-list-arrow svg { width: 18px; }
.trip-list-main:hover .trip-list-arrow { color: white; background: var(--forest); transform: translateX(4px); }
.trip-list-footer { display: flex; align-items: center; justify-content: space-between; min-height: 51px; padding: 8px 16px 8px 121px; border-top: 1px solid rgba(23,37,31,.08); background: rgba(247,246,241,.72); }
.person-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; color: var(--forest); border: 1px solid #d4ddd6; border-radius: 15px; background: #edf2ee; font-size: 9px; font-weight: 800; text-decoration: none; transition: background .2s, border-color .2s; }
.person-chips a:hover { border-color: #aebeb2; background: #dfe9e2; }
.person-chips a > span { display: grid; place-items: center; width: 21px; height: 21px; color: white; border-radius: 50%; background: var(--forest); font-family: var(--serif); font-size: 9px; }
.list-edit-link { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; color: var(--muted); border-radius: 8px; font-size: 9px; font-weight: 800; text-decoration: none; }
.list-edit-link:hover { color: var(--forest); background: #e5ebe6; }
.list-edit-link svg { width: 13px; }
.list-empty { display: flex; min-height: 360px; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; border: 1px dashed #cbd3cc; border-radius: 20px; background: rgba(255,255,255,.45); }
.list-empty > span { display: grid; place-items: center; width: 56px; height: 56px; color: var(--accent); border-radius: 50%; background: #f9e4de; }
.list-empty > span svg { width: 25px; }
.list-empty h2 { margin: 16px 0 5px; font-family: var(--serif); font-size: 28px; font-weight: 500; }
.list-empty p { margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.list-footer { min-height: 110px; }

/* Trip editor */
.trip-edit-page { background: #e6ebe6; }
.editor-nav { position: sticky; top: 0; background: rgba(250,248,242,.94); backdrop-filter: blur(15px); }
.trip-editor-shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 75px; }
.trip-editor-form { border-radius: 24px; background: var(--paper); box-shadow: 0 22px 60px rgba(23,37,31,.13); }
.editor-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 35px 40px; color: white; border-radius: 24px 24px 0 0; background: var(--forest); }
.editor-heading h1 { margin: 5px 0 2px; font-family: var(--serif); font-size: 42px; font-weight: 500; line-height: 1; letter-spacing: -.04em; }
.editor-heading p { margin: 8px 0 0; color: rgba(255,255,255,.59); font-size: 11px; }
.editor-heading .eyebrow { color: #f0ae80; }
.editor-trip-name { max-width: 330px; padding: 7px 10px; overflow: hidden; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.15); border-radius: 9px; background: rgba(255,255,255,.07); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: .08em; }
.editor-paper { padding: 5px 40px 35px; }
.edit-places-list .place-card { background: rgba(255,255,255,.76); }
.existing-photos-field { gap: 9px; }
.existing-photos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.existing-photo { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border: 2px solid white; border-radius: 10px; background: #dce2dc; box-shadow: 0 3px 9px rgba(23,37,31,.1); cursor: pointer; }
.existing-photo img { width: 100%; height: 100%; object-fit: cover; transition: filter .2s, opacity .2s, transform .2s; }
.existing-photo input { position: absolute; opacity: 0; pointer-events: none; }
.existing-photo > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; color: white; background: rgba(101,29,19,.69); font-size: 8px; font-weight: 850; opacity: 0; transition: opacity .2s; }
.existing-photo > span svg { width: 12px; }
.existing-photo:hover > span, .existing-photo.is-removed > span { opacity: 1; }
.existing-photo.is-removed img { opacity: .4; filter: grayscale(1); transform: scale(.96); }
.editor-actions { position: sticky; z-index: 500; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 40px; border-top: 1px solid var(--line); border-radius: 0 0 24px 24px; background: rgba(252,250,245,.94); box-shadow: 0 -8px 25px rgba(23,37,31,.05); backdrop-filter: blur(13px); }

@media (max-width: 820px) {
    .map-toolbar { top: 10px; left: 10px; right: 10px; height: 66px; padding: 0 11px; }
    .map-toolbar .brand small, .map-stats { display: none; }
    .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
    .brand strong { font-size: 17px; }
    .person-filter { padding: 5px; }
    .trips-list-link span { display: none; }
    .trips-list-link { padding: 9px; }
    .filter-copy small, .filter-icon { display: none; }
    .filter-copy select { min-width: 142px; max-width: 43vw; padding: 9px 21px 9px 9px; border-radius: 9px; background: rgba(23,63,53,.07); font-size: 11px; }
    .year-filter .filter-copy select { min-width: 108px; max-width: 29vw; }
    .empty-map { grid-template-columns: 1fr; width: min(420px, calc(100% - 26px)); max-height: calc(100dvh - 190px); overflow: auto; transform: translate(-50%, -48%); }
    .empty-photo-wrap { min-height: 140px; max-height: 160px; }
    .empty-copy { padding: 25px; }
    .empty-copy h1 { font-size: 29px; }
    .empty-copy p { font-size: 12px; }
    .map-legend { display: none; }
    .add-trip-fab { right: 15px; bottom: max(15px, env(safe-area-inset-bottom)); height: 54px; padding-right: 18px; }
    .add-trip-fab span { width: 42px; height: 42px; }
    .trip-dialog { width: 100%; max-height: 100dvh; margin: auto 0 0; border-radius: 23px 23px 0 0; }
    .trip-form { max-height: 96dvh; }
    .dialog-head { padding: 20px; }
    .dialog-body { padding: 5px 18px 25px; }
    .dialog-footer { padding: 13px 18px max(13px, env(safe-area-inset-bottom)); }
    .dialog-footer > p { display: none; }
    .dialog-footer > div { width: 100%; }
    .dialog-footer .button { flex: 1; }
    .place-layout { grid-template-columns: 1fr; }
    .place-map-wrap { min-height: 260px; border-top: 1px solid var(--line); border-left: 0; }
    .place-map { min-height: 225px; }
    .detail-nav { height: 68px; padding: 0 18px; }
    .detail-nav .brand small { display: none; }
    .trip-hero { height: 72dvh; min-height: 480px; }
    .hero-gallery { grid-template-columns: 1fr; }
    .hero-gallery .hero-photo:not(:first-child) { display: none; }
    .trip-heading { left: 24px; right: 24px; bottom: 34px; }
    .trip-heading h1 { font-size: clamp(40px, 11vw, 61px); }
    .detail-content { width: min(100% - 36px, 720px); }
    .trip-overview { grid-template-columns: 1fr; gap: 35px; padding: 50px 0; }
    .trip-facts { padding: 25px 0 0; border-top: 1px solid var(--line); border-left: 0; }
    .trip-route-map { height: 350px; }
    .timeline-place { grid-template-columns: 52px 1fr; }
    .timeline-rail span { width: 37px; height: 37px; }
    .timeline-rail::after { top: 38px; left: 18px; }
    .place-story-head { flex-direction: column; gap: 5px; }
    .locate-place { margin-top: 4px; }
    .place-photo-grid { height: 230px; grid-template-columns: 1.4fr 1fr; }
    .place-photo-grid button:nth-child(n+4) { display: none; }
    .detail-footer p { display: none; }
    .list-intro { align-items: stretch; flex-direction: column; gap: 24px; }
    .list-filters { flex-wrap: wrap; }
    .trip-list-main { grid-template-columns: 86px minmax(0, 1fr) 70px; }
    .trip-list-footer { padding-left: 101px; }
    .trip-editor-shell { width: min(100% - 24px, 720px); padding: 25px 0 45px; }
    .editor-heading { align-items: flex-start; flex-direction: column; padding: 28px; }
    .editor-paper { padding: 5px 24px 30px; }
    .existing-photos { grid-template-columns: repeat(4, 1fr); }
    .editor-actions { padding: 14px 24px; }
}

@media (max-width: 520px) {
    .map-toolbar .brand > span:last-child { display: none; }
    .toolbar-actions { margin-left: auto; }
    .empty-photo-wrap { display: none; }
    .empty-map { width: calc(100% - 26px); min-height: 0; }
    .empty-copy { padding: 28px 24px 32px; }
    .empty-copy .button { width: 100%; }
    .add-trip-fab strong { display: none; }
    .add-trip-fab { width: 56px; padding: 5px; }
    .add-trip-fab span { width: 46px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .section-heading { align-items: flex-start; }
    .section-heading-actions { flex-wrap: wrap; }
    .section-heading-actions .text-button { margin-left: 49px; }
    .location-search { grid-template-columns: 1fr; }
    .button-search { margin-top: 0; }
    .geocode-results { top: 78px; }
    .place-fields { padding: 14px; }
    .compact-grid .field:first-child { grid-column: auto; max-width: none; }
    .detail-nav .brand > span:last-child { display: none; }
    .back-link { font-size: 10px; }
    .trip-meta-row { flex-direction: column; align-items: flex-start; }
    .route-section { padding-top: 48px; }
    .section-title-row h2 { font-size: 30px; }
    .trip-route-map { height: 300px; border-width: 5px; }
    .place-story h3 { font-size: 29px; }
    .place-photo-grid { height: 210px; grid-template-columns: 1fr 1fr; }
    .place-photo-grid button:first-child { grid-row: auto; }
    .place-photo-grid button:nth-child(n+3) { display: none; }
    .detail-footer { padding: 20px; }
    .detail-footer > a:last-child { font-size: 0; }
    .detail-footer > a:last-child svg { width: 22px; }
    .lightbox figure { max-width: calc(100% - 28px); }
    .lightbox-prev, .lightbox-next { top: auto !important; bottom: 20px; transform: none !important; }
    .toolbar-actions { gap: 5px; }
    .trips-list-link { background: transparent; }
    .trips-list-shell { width: calc(100% - 24px); padding: 42px 0 65px; }
    .list-intro h1 { font-size: 38px; }
    .list-filters label { width: 100%; }
    .list-filters select { width: 100%; }
    .list-filters .button { flex: 1; }
    .trip-list-main { grid-template-columns: 65px minmax(0, 1fr) 45px; min-height: 124px; }
    .trip-list-main time { min-height: 82px; }
    .trip-list-main time strong { font-size: 27px; }
    .trip-list-copy { padding: 18px 13px; }
    .trip-list-copy h2 { font-size: 21px; white-space: normal; }
    .trip-list-cover { width: 40px; height: 40px; border-width: 2px; }
    .trip-list-arrow { width: 34px; height: 34px; }
    .trip-list-footer { align-items: flex-end; padding: 9px 10px; }
    .list-edit-link { flex: 0 0 auto; }
    .editor-heading { padding: 25px 20px; }
    .editor-heading h1 { font-size: 35px; }
    .editor-paper { padding: 4px 14px 24px; }
    .existing-photos { grid-template-columns: repeat(3, 1fr); }
    .editor-actions { padding: 12px 14px; }
    .editor-actions .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
