@font-face {
  font-family: Inter;
  src: url("./inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ui-font: Inter, system-ui, sans-serif;
  --deep: #101b2b;
  --indigo: #172438;
  --sage: #a2b2a1;
  --sand: #c2cdbd;
  --cream: #dfd8c5;
  --linen: #f4efdf;
  color-scheme: dark;
  font: 16px/1.5 var(--ui-font);
  color: var(--linen);
  background: var(--deep);
  --paper: var(--indigo);
  --accent: var(--sand);
  --line: var(--sage);
  --pin-both: var(--sand);
  --pin-cedric: var(--sage);
  --pin-jana: var(--linen);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.album { height: 100dvh; overflow: hidden; background: var(--deep); }
.top { position: fixed; z-index: 900; top: calc(env(safe-area-inset-top) + 8px); left: calc(env(safe-area-inset-left) + 8px); right: calc(env(safe-area-inset-right) + 8px); display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.top h1, .top .actions { pointer-events: auto; }
.notification-wrap { position: relative; }
.notification-toggle { position: relative; display: grid; place-items: center; width: 46px; min-width: 46px; height: 46px; padding: 10px; }
.notification-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-count { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--deep); border-radius: 12px; background: var(--accent); color: var(--deep); font-size: .7rem; font-weight: 700; line-height: 1; }
.notifications-panel { position: fixed; z-index: 1200; top: calc(env(safe-area-inset-top) + 68px); right: max(env(safe-area-inset-right), 8px); width: min(370px, calc(100vw - 16px)); max-height: min(68dvh, 520px); overflow: auto; overscroll-behavior: contain; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 14px 42px #07111db3; }
.notifications-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.notifications-heading h2 { font: 650 1.15rem/1.3 var(--ui-font); }
.notifications-heading button { min-height: 38px; padding: 4px 10px; font-size: .78rem; }
#notifications-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.notification-item { display: grid; gap: 5px; width: 100%; min-height: 58px; text-align: left; border-radius: 11px; border-color: transparent; background: var(--deep); }
.notification-item.is-unread { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--deep)); }
.notification-message { display: block; font-size: .87rem; line-height: 1.4; }
.notification-place { color: var(--cream); }
.notification-item time { color: var(--cream); font-size: .75rem; }
#notifications-empty { margin: 12px 0 4px; }
.top h1 { padding: 8px 12px; border-radius: 13px; background: var(--paper); box-shadow: 0 2px 12px #22303029; white-space: nowrap; }
.top button { box-shadow: 0 2px 12px #22303029; }
h1, h2, h3 { margin: 0; font: 650 2rem/1.15 var(--ui-font); }
h1 { font-size: clamp(1.45rem, 5vw, 2.25rem); }
h3 { font-size: 1.4rem; }
p { margin: .55rem 0; }
.subtle { color: var(--cream); font-size: .875rem; }
.login { width: min(100% - 36px, 390px); margin: clamp(40px, 12vh, 150px) auto; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; }
.login form { display: grid; gap: 12px; margin-top: 20px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { min-height: 44px; padding: 6px 13px; border: 1px solid var(--sand); border-radius: 22px; background: var(--paper); cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--deep); }
label { display: grid; gap: 4px; }
input:not([type=file]), textarea, select { width: 100%; border: 1px solid var(--sand); border-radius: 8px; background: var(--deep); padding: 7px 10px; }
input[type=file] { display: block; width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
textarea { resize: vertical; }
a { color: var(--cream); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#map { position: fixed; inset: 0; height: 100dvh; background: var(--deep); }
#map .leaflet-control-zoom { margin-top: calc(env(safe-area-inset-top) + 73px); margin-left: calc(env(safe-area-inset-left) + 12px); }
#map .leaflet-control-zoom a { width: 42px; height: 42px; line-height: 42px; }
#map .leaflet-control-attribution { margin-right: env(safe-area-inset-right); margin-bottom: env(safe-area-inset-bottom); }
#map.picking { cursor: crosshair; }
.place-pin { display: grid; place-items: center; }
.place-pin span { width: 19px; height: 19px; border: 2px solid var(--linen); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pin-color, var(--pin-both)); box-shadow: 0 2px 6px #22303070; }
.pin-cedric, [data-travelers=cedric] { --pin-color: var(--pin-cedric); }
.pin-jana, [data-travelers=jana] { --pin-color: var(--pin-jana); }
.place-pin:focus-visible { outline: 2px solid var(--accent); }
.map-status { position: fixed; inset: auto 12px calc(env(safe-area-inset-bottom) + 28px); z-index: 1000; width: fit-content; margin: auto; padding: 8px 12px; background: var(--paper); border-radius: 12px; box-shadow: 0 3px 18px #22303035; }
.map-status button { margin-left: 6px; }
.pin-filters { position: fixed; z-index: 850; bottom: calc(env(safe-area-inset-bottom) + 25px); left: max(env(safe-area-inset-left), 8px); display: flex; gap: 5px; }
.pin-filters button { display: flex; align-items: center; gap: 5px; padding-inline: 9px; font-size: .82rem; box-shadow: 0 2px 12px #22303029; }
.pin-filters button::before { content: ""; flex: none; width: 8px; height: 8px; border: 1px solid var(--pin-color, var(--pin-both)); border-radius: 50%; }
.pin-filters [aria-pressed="true"] { border-color: var(--pin-color, var(--pin-both)); background: var(--paper); }
.pin-filters [aria-pressed="true"]::before { background: var(--pin-color, var(--pin-both)); }
.tile-status { position: fixed; z-index: 850; top: calc(env(safe-area-inset-top) + 73px); right: max(env(safe-area-inset-right), 8px); max-width: calc(100% - 76px); width: fit-content; margin: 0; padding: 6px 10px; font-size: .8rem; background: var(--paper); border-radius: 9px; pointer-events: none; }
.map-shortcuts, .clear-route { position: fixed; z-index: 850; left: max(env(safe-area-inset-left), 8px); }
.map-shortcuts { display: flex; gap: 6px; bottom: calc(env(safe-area-inset-bottom) + 77px); }
.map-shortcuts button, .clear-route { box-shadow: 0 2px 12px #22303029; }
.clear-route { bottom: calc(env(safe-area-inset-bottom) + 128px); max-width: calc(100% - 16px); text-align: left; }
.is-picking .top .actions, .is-picking .pin-filters, .is-picking .map-shortcuts, .is-picking .clear-route, .is-picking .tile-status { visibility: hidden; }
.is-picking .map-status { max-width: min(420px, calc(100% - 24px)); }
#pick-actions { margin-top: 8px; }
#pick-target { position: fixed; z-index: 640; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; width: 30px; height: 30px; border: 2px solid var(--accent); border-radius: 50%; background: #efefe944; }
#pick-target::before, #pick-target::after { content: ""; position: absolute; background: var(--accent); inset: 12px 5px; }
#pick-target::after { inset: 5px 12px; }
.pick-pin { pointer-events: none; border: 3px solid var(--deep); border-radius: 50%; background: var(--sand); box-shadow: 0 0 0 2px var(--accent), 0 2px 8px #22303066; }
.pick-pin::before { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--linen); margin: 9px; }
dialog { width: min(calc(100% - 26px), 430px); max-height: calc(100dvh - 32px); margin: auto 13px 16px auto; inset: auto 0 0 auto; border: 1px solid var(--line); border-radius: 17px; padding: 0; background: var(--paper); color: inherit; box-shadow: 0 12px 40px #22303040; }
dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
dialog::backdrop { background: #223030a6; }
.panel-top { flex: none; display: flex; align-items: center; justify-content: flex-end; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.panel-content { min-height: 0; overflow: hidden auto; overflow-wrap: anywhere; overscroll-behavior: contain; padding: 16px; }
.overview-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 11px; }
.overview-filters button { padding-inline: 10px; font-size: .9rem; }
.overview-filters [aria-pressed="true"] { color: var(--deep); background: var(--accent); border-color: var(--accent); }
.country-group { padding: 16px 0 9px; border-top: 1px solid var(--line); }
.country-group ul { margin: 7px 0 0; padding: 0; list-style: none; }
.country-group li + li { margin-top: 5px; }
.overview-place { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border-color: transparent; border-radius: 9px; background: var(--deep); }
.overview-place .traveler-pill { flex: none; }
.route-card { border-top: 1px solid var(--line); margin-top: 12px; padding: 12px 0; }
#route-form { display: grid; gap: 10px; margin-top: 16px; }
.route-add { display: flex; align-items: end; gap: 6px; }
.route-add label { flex: 1; min-width: 0; }
#route-stops { margin: 0; padding-left: 24px; }
#route-stops li { padding: 6px 0; }
.stop-controls { display: flex; gap: 4px; margin-top: 4px; }
.stop-controls button { font-size: .82rem; }
#route-form .danger { margin-top: 0; }
.entry-heading { padding: 18px 0 15px; }
.entry-heading h2 { font-size: clamp(2rem, 9vw, 3.25rem); margin-top: 7px; overflow-wrap: anywhere; }
.entry-heading .subtle { margin-bottom: 0; }
.traveler-pill { display: inline-block; margin: 0; padding: 4px 10px; border-radius: 15px; color: var(--deep); background: var(--pin-color, var(--pin-both)); font-size: .8rem; }
#entry-map { isolation: isolate; height: clamp(145px, 24dvh, 230px); border-radius: 13px; background: var(--deep); }
.diary-entry { display: grid; gap: 16px; margin: 0 0 20px; }
.diary-entry:empty { display: none; }
.story, #comments p { white-space: pre-wrap; overflow-wrap: anywhere; }
.story { margin: 0; font: 1.13rem/1.58 var(--ui-font); }
#place section { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#place section form, #place-form { display: grid; justify-items: start; gap: 9px; margin-top: 12px; }
#place section form label, #place-form label { width: 100%; }
.travel-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.travel-dates legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.travel-dates label { min-width: 0; }
.travel-dates input { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 44px; }
.travel-dates input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
@media (max-width: 480px) {
  .travel-dates { grid-template-columns: minmax(0, 1fr); }
}
#place-status, #editor-status { overflow-wrap: anywhere; color: var(--cream); }
.diary-photos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.diary-photos[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.diary-photos[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.diary-photos .image-button { width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 9px; background: var(--deep); }
.diary-photos .image-button:focus-visible { outline-offset: -3px; }
.diary-photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.diary-photos[data-count="1"] img { aspect-ratio: 4 / 3; }
#entry-cover .image-button { display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; }
#entry-cover img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.entry-layout { display: flex; flex-direction: column; gap: 12px; }
.entry-visual, .entry-reading { display: contents; }
.entry-map-panel { flex: none; }
#entry-map-legend { margin: 5px 0 0; }
#entry-map.leaflet-touch-zoom { touch-action: pan-y; }
#entry-map .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.entry-heading { order: 1; padding-block: 3px; }
#entry-cover { order: 2; }
.entry-body { order: 3; min-width: 0; }
.pin-preview-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 16px; }
.pin-preview-popup .leaflet-popup-content { margin: 0; }
.pin-preview {
  display: block;
  width: min(302px, calc(100vw - 36px));
  padding: 0;
  border: 1px solid var(--sand);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  font: 400 1rem/1.35 var(--ui-font);
}
.pin-preview img { display: block; width: 100%; height: clamp(84px, 17dvh, 142px); object-fit: cover; }
.pin-preview-info { display: grid; gap: 5px; padding: 12px 14px; overflow-wrap: anywhere; }
.pin-preview-title { padding-right: 39px; font: 650 clamp(1.25rem, 5vw, 1.55rem)/1.12 var(--ui-font); }
.pin-preview:has(img) .pin-preview-title { padding-right: 0; }
.pin-preview-meta { font-size: .875rem; color: var(--cream); }
.preview-action { display: grid; place-items: center; min-height: 44px; margin-top: 4px; border-radius: 9px; background: var(--sand); color: var(--deep); font-weight: 650; }
.leaflet-container .pin-preview-popup a.leaflet-popup-close-button {
  display: grid; place-items: center; top: 4px; right: 4px; width: 44px; height: 44px;
  border-radius: 50%; background: var(--deep); color: var(--linen); font-size: 22px;
}
.pin-preview:focus-visible, .leaflet-container .pin-preview-popup a:focus-visible { outline: 2px solid var(--linen); outline-offset: -3px; }
.pin-preview:active .preview-action { background: var(--cream); }
@media (max-height: 520px) {
  .pin-preview img { height: 72px; }
}
@media (min-width: 820px) and (min-height: 521px) {
  #place { inset: 0; margin: auto; width: min(calc(100vw - 48px), 1080px); }
  .entry-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; }
  .entry-visual { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .entry-reading { display: block; min-width: 0; }
  #entry-cover { order: -1; }
}
.diary-photo { min-width: 0; }
.photo-frame { position: relative; -webkit-touch-callout: none; user-select: none; touch-action: pan-y; }
#large-photo-frame { width: fit-content; max-width: 100%; margin: auto; }
.photo-frame img { -webkit-touch-callout: none; -webkit-user-drag: none; }
.photo-badges { position: absolute; left: 5px; bottom: 8px; display: flex; flex-wrap: wrap; max-width: calc(100% - 10px); gap: 2px; pointer-events: none; }
.photo-badges:empty { display: none; }
.photo-badges span { padding: 1px 4px; border: 1px solid var(--cream); border-radius: 12px; background: #523d35f2; box-shadow: 0 1px 5px #22303045; font-size: .73rem; white-space: nowrap; }
.photo-badges .mine { background: var(--deep); border-color: var(--sand); }
.photo-badges .photo-comment-badge { background: var(--deep); font-weight: 600; }
#photo-reaction-picker { inset: auto 0 max(14px, env(safe-area-inset-bottom)); width: min(calc(100% - 28px), 320px); margin: 0 auto; padding: 18px; align-items: center; gap: 12px; text-align: center; }
#reaction-picker-title { font-size: 1.3rem; }
.photo-reactions { display: flex; gap: 3px; }
.photo-reactions button { min-width: 48px; min-height: 48px; padding: 4px 10px; font-size: 1.15rem; white-space: nowrap; }
.photo-reactions button[aria-pressed="true"] { border-color: var(--accent); background: var(--sand); }
#photo-interactions h3 { margin-top: 14px; }
#photo-interactions form { display: grid; justify-items: start; gap: 8px; margin-top: 10px; }
#photo-interactions label { width: 100%; }
.photo-comments article { padding: 8px 10px; margin: 6px 0; background: var(--deep); border-radius: 8px; }
.photo-comments p { margin: 2px 0; white-space: pre-wrap; }
#comments article { margin-top: 10px; border-radius: 11px; background: var(--deep); padding: 10px 12px; }
#comments time { margin-left: 7px; color: var(--cream); font-size: .8rem; }
#comments p { margin-bottom: 0; }
.place-comments { margin-bottom: 24px; }
#comments article > button { margin-top: 7px; padding-inline: 11px; }
#comments .comment-response { margin-left: 8px; border-left: 2px solid var(--sand); background: var(--paper); }
#comment-reply { color: var(--cream); }
#comment-status { color: var(--cream); margin: 0; }
.leaflet-tile-pane { filter: grayscale(.62) sepia(.19) brightness(.84); }
.leaflet-container .leaflet-control-attribution, .leaflet-container .leaflet-bar a { background: var(--paper); color: inherit; }
.leaflet-container .leaflet-control-attribution a { color: var(--cream); }
.leaflet-container .leaflet-control-attribution { font-size: 11px; line-height: 1.4; border-radius: 5px 0 0 0; }
.leaflet-container .leaflet-control-attribution:empty { display: none; }
.leaflet-container .leaflet-popup-content-wrapper, .leaflet-container .leaflet-popup-tip { background: var(--paper); color: inherit; }
.photo-pin { display: grid; place-items: center; border: 2px solid white; border-radius: 50%; background: #537267; color: white; font: 700 .9rem/1 var(--ui-font); box-shadow: 0 2px 5px #0005; }
.photo-popup { display: grid; gap: 5px; }
.photo-popup button { padding: 4px 9px; white-space: nowrap; }
.danger { margin-top: 14px; color: var(--cream); border-color: var(--sand); }
.editor-tools { margin: 13px 0; }
.search-form { display: flex; align-items: end; gap: 6px; }
.search-form label { flex: 1; min-width: 0; }
.search-results { display: grid; gap: 4px; }
.search-results button { text-align: left; border-radius: 8px; }
#search-status { color: var(--cream); margin: 6px 0; }
#photo-view { inset: 0; margin: auto; width: min(92vw, 850px); max-height: 90dvh; }
#photo-view::backdrop { background: #223030bd; }
#photo-view img { display: block; min-height: 0; max-height: 70dvh; max-width: 100%; object-fit: contain; margin: auto; }
.photo-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 10px; }
#photo-status { padding: 0 12px; }
@media (max-width: 600px), (pointer: coarse) and (max-height: 520px) {
  .top h1 { font-size: clamp(1.15rem, 5vw, 1.65rem); padding: 9px 10px; }
  .top .actions { gap: 4px; flex-wrap: nowrap; }
  .top button { font-size: .82rem; padding-inline: 8px; white-space: nowrap; }
  #place, #editor, #overview, #routes { inset: 0; margin: 0; width: 100%; max-width: none; height: min(100dvh, var(--visible-height, 100dvh)); max-height: 100dvh; border: 0; border-radius: 0; }
  #place .panel-top, #editor .panel-top, #overview .panel-top, #routes .panel-top {
    justify-content: flex-start;
    padding: calc(env(safe-area-inset-top) + 6px) max(env(safe-area-inset-right), 16px) 6px max(env(safe-area-inset-left), 16px);
  }
  .panel-content {
    flex: 1;
    padding: 14px max(env(safe-area-inset-right), 16px) calc(env(safe-area-inset-bottom) + 22px) max(env(safe-area-inset-left), 16px);
  }
  #place, #photo-view {
    inset: var(--visible-top, 0px) 0 auto;
    width: 100%;
    margin: 0;
    height: var(--visible-height, 100dvh);
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  #place::backdrop, #photo-view::backdrop { background: var(--paper); }
  #photo-view .panel-top { padding-top: calc(env(safe-area-inset-top) + 6px); }
}
@media (max-width: 355px) {
  .top h1 { font-size: 1.05rem; padding-inline: 6px; }
  .top button { font-size: .76rem; padding-inline: 6px; }
}


/* Shared journal surfaces and the map controls. */
:root { --surface: color-mix(in srgb, var(--deep) 87%, var(--sage)); --surface-raised: color-mix(in srgb, var(--deep) 73%, var(--sage)); }
html, body { overscroll-behavior: none; }
.album { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { user-select: none; }
button:active:not(:disabled) { filter: brightness(1.18); }
input, textarea, select { font-size: 1rem; }
button:focus-visible, a:focus-visible { outline-color: var(--linen); }
.top {
  top: calc(env(safe-area-inset-top) + 10px);
  left: calc(env(safe-area-inset-left) + 12px);
  right: calc(env(safe-area-inset-right) + 12px);
}
.top h1 {
  font-size: clamp(1.65rem, 6.2vw, 2.3rem);
  line-height: 1;
  padding: 10px 13px;
  color: var(--linen);
  background: var(--deep);
  border: 1px solid var(--sage);
  border-radius: 15px;
}
.top button { padding-inline: 12px; background: var(--deep); }
.map-dock {
  position: fixed;
  z-index: 850;
  left: calc(env(safe-area-inset-left) + 10px);
  right: calc(env(safe-area-inset-right) + 10px);
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  width: min(440px, calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 20px));
  padding: 7px;
  border: 1px solid var(--sage);
  border-radius: 17px;
  background: var(--deep);
  box-shadow: 0 6px 18px #22303070;
}
.map-dock .pin-filters, .map-dock .map-shortcuts {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.map-dock .pin-filters { margin-bottom: 5px; }
.map-dock button {
  justify-content: center;
  line-height: 1.13;
  padding: 5px 3px;
  font-size: clamp(.69rem, 2.65vw, .88rem);
  border-radius: 10px;
  box-shadow: none;
}
.map-dock button:not(.primary) { background: var(--surface); border-color: transparent; }
.map-dock button[aria-pressed="true"]:not(.primary) { background: var(--surface-raised); border-color: var(--sand); }
.map-dock #add-place { padding-inline: 2px; }
.is-picking .map-dock { visibility: hidden; }
.clear-route { bottom: calc(env(safe-area-inset-bottom) + 139px); }
.map-status { bottom: calc(env(safe-area-inset-bottom) + 139px); }
.is-picking .map-status { bottom: calc(env(safe-area-inset-bottom) + 28px); }
.login {
  margin-top: max(calc(env(safe-area-inset-top) + 30px), 11svh);
  padding: clamp(20px, 6vw, 34px);
  background: var(--surface);
  border-radius: 21px;
}
.login h1 { font-size: clamp(2.25rem, 9vw, 3.1rem); }
.login > p { color: var(--cream); }
.login form .primary { width: 100%; border-radius: 10px; }
.panel-top { background: var(--deep); }
#place .entry-toolbar { justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.entry-toolbar button { padding-inline: clamp(5px, 2vw, 12px); font-size: clamp(.71rem, 2.85vw, .9rem); }
.entry-toolbar .actions { gap: 4px; }
.entry-toolbar #place-status { flex-basis: 100%; margin: 0; }
.entry-layout { gap: 16px; }
.entry-heading h2 { font-size: clamp(2.3rem, 10vw, 4.2rem); line-height: 1.01; letter-spacing: -.025em; }
.entry-heading #place-meta { margin-top: 9px; }
#place section.place-comments, #place section:last-child {
  padding: 14px;
  border: 1px solid var(--sage);
  border-radius: 15px;
  background: var(--surface);
}
#place section.place-comments { margin-top: 0; }
#comments article, .photo-comments article { background: var(--surface-raised); }
#comments .comment-response { background: var(--surface); }
.editor-tools > button, .overview-filters button { border-radius: 10px; }
#editor-title, #overview-title, #routes-title { font-size: clamp(2rem, 8vw, 3.1rem); }
#photo-view .panel-content { background: var(--surface); }
#photo-interactions, .photo-controls { max-width: 580px; margin-inline: auto; }
#photo-view img { max-height: min(63dvh, calc(var(--visible-height, 100dvh) - 70px)); }
@media (hover: hover) and (pointer: fine) {
  .pin-preview:hover .preview-action, .map-dock button:hover { filter: brightness(1.12); }
}
@media (min-width: 820px) and (min-height: 521px) {
  .map-dock { left: calc(env(safe-area-inset-left) + 18px); }
  .entry-layout { padding: 22px; gap: 24px; }
}

/* Night atlas navigation and album composition */
.top h1 { border-color: color-mix(in srgb, var(--sage) 44%, var(--deep)); }
.map-dock { border-color: color-mix(in srgb, var(--sage) 56%, var(--deep)); }
.place-pin span { width: 15px; height: 15px; border-width: 1.5px; }
.pin-preview, .pin-preview-popup .leaflet-popup-content-wrapper { background: var(--indigo); }
.pin-preview img { height: clamp(70px, 13dvh, 115px); }
.pin-preview-info { gap: 4px; }
.preview-action { background: var(--sage); }
.entry-heading { padding: 5px 0 14px; border-bottom: 1px solid var(--line); }
.entry-heading #place-meta { color: var(--cream); }
#entry-cover { order: 0; }
#entry-cover img { aspect-ratio: 5 / 4; }
.entry-map-panel { order: 2; }
.entry-story:has(.diary-entry:empty) { display: none; }
.entry-story > h3 { margin: 0 0 12px; }
.story { max-width: 62ch; color: var(--linen); }
.photo-badges span { background: #172438f2; }
@media (min-width: 820px) and (min-height: 521px) {
  .entry-visual #entry-cover { order: -1; }
  .entry-heading { margin-bottom: 16px; }
}

/* Atlas surfaces shared by the map, journal and account views. */
:root {
  color-scheme: light;
  --deep: #edf2ef;
  --indigo: #fff;
  --sage: #d0dcd5;
  --sand: #afc2b8;
  --cream: #46564f;
  --linen: #1d2622;
  --accent: #253a31;
  --surface: #f5f7f4;
  --surface-raised: #e6eee8;
  --water: #bfceca;
  --pin-both: #23332c;
  --pin-cedric: #4e756b;
  --pin-jana: #8c5244;
  -webkit-tap-highlight-color: transparent;
}
.atlas-summary { display: none; }
#map, #entry-map { background: var(--water); }
.leaflet-tile-pane { filter: saturate(.42) brightness(1.035); }
.primary, .overview-filters [aria-pressed=true], .traveler-pill, .photo-pin { color: white; }
button:focus-visible, a:focus-visible { outline-color: #344d42; }
.top h1, .top button, .map-dock, .panel-top { background: var(--paper); }
.top h1 { border-color: var(--sage); }
.map-dock { border-color: var(--sage); box-shadow: 0 8px 22px #253a3126; }
.place-pin span { border-color: white; }
.pin-preview, .pin-preview-popup .leaflet-popup-content-wrapper { background: var(--paper); }
.pin-preview-popup .preview-action { background: var(--accent); color: white; border-radius: 20px; }
.pin-preview:active .preview-action { background: #426254; }
.leaflet-container .pin-preview-popup a.leaflet-popup-close-button { background: var(--paper); color: var(--linen); }
.photo-badges span { background: #fffffff5; color: var(--linen); }
.photo-badges .mine { background: #e6eee8; border-color: #718c7f; }
.photo-reactions button[aria-pressed=true] { background: #dbe9df; }
.photo-badges .photo-comment-badge { background: #edf4ed; }
.panel-top, #place section.place-comments, #place section:last-child { border-color: var(--sage); }
.login { background: var(--paper); border-color: var(--sage); box-shadow: 0 16px 50px #253a3114; }
#photo-view::backdrop, dialog::backdrop { background: #24393066; }
@media (max-width: 600px), (pointer: coarse) and (max-height: 520px) {
  #place::backdrop, #photo-view::backdrop { background: var(--paper); }
}

@media (min-width: 900px) and (min-height: 650px) {
  .atlas-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    width: min(1320px, calc(100% - 48px));
    height: calc(100dvh - 36px);
    margin: 18px auto;
    padding: 14px;
    background: #dfe9e3;
    border: 1px solid #cbd8cf;
    border-radius: 27px;
    box-shadow: 0 14px 42px #23332c16;
  }
  .atlas-shell .top { position: static; pointer-events: auto; }
  .atlas-shell .top h1 { background: transparent; border: 0; box-shadow: none; }
  .map-board { position: relative; min-height: 0; border-radius: 18px; }
  #map { position: absolute; inset: 0; height: 100%; border-radius: inherit; }
  #map .leaflet-control-zoom { margin-top: 67px; }
  .map-dock { position: absolute; inset: 10px 10px auto; width: auto; display: flex; justify-content: space-between; gap: 10px; padding: 0; border: 0; background: none; box-shadow: none; pointer-events: none; }
  .map-dock .pin-filters, .map-dock .map-shortcuts { display: flex; gap: 7px; margin: 0; pointer-events: auto; }
  .map-dock button { padding: 6px 13px; border-radius: 22px; box-shadow: 0 2px 9px #23332c26; }
  .map-dock #add-place { padding-inline: 14px; }
  .map-dock button:not(.primary) { background: var(--paper); }
  .map-dock button[aria-pressed=true]:not(.primary) { background: var(--accent); color: white; }
  .map-dock button[aria-pressed=true]::before { background: white; border-color: white; }
  .atlas-summary { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); gap: 12px; }
  .atlas-summary section { padding: 13px 16px; border-radius: 17px; background: var(--paper); min-width: 0; }
  .atlas-summary h2 { font: 650 1rem/1.4 var(--ui-font); }
  .atlas-summary ul { margin: 5px 0 0; padding: 0; list-style: none; max-height: 102px; overflow: auto; }
  .atlas-summary li + li { border-top: 1px solid var(--sage); }
  .atlas-summary li button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-radius: 8px; }
  .atlas-summary li button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pin-color, var(--pin-both)); flex: none; }
  .atlas-summary li strong { overflow-wrap: anywhere; }
  .atlas-summary li span { color: var(--cream); margin-left: auto; font-size: .85rem; }
  .atlas-summary dl { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0 0; gap: 12px; }
  .atlas-summary dl div { background: var(--surface); padding: 7px 12px; border-radius: 10px; }
  .atlas-summary dt { font-size: .86rem; color: var(--cream); }
  .atlas-summary dd { margin: 0; font: 400 1.85rem/1.2 var(--ui-font); }
  #pick-target { position: absolute; }
  .is-picking .atlas-summary { visibility: hidden; }
}

#country-legend {
  position: fixed; z-index: 830;
  top: calc(env(safe-area-inset-top) + 76px);
  right: calc(env(safe-area-inset-right) + 10px);
  display: flex; align-items: center; gap: 7px; padding: 5px 7px;
  border-radius: 10px; border: 1px solid var(--sage); background: var(--paper);
  font-size: .72rem; line-height: 1.25;
}
#country-legend ol { display: flex; list-style: none; gap: 2px; margin: 0; padding: 0; }
#country-legend li { min-width: 17px; padding: 3px 2px; text-align: center; border-radius: 4px; color: #172f25; }
#country-legend li:nth-child(1) { background: #d1e1d9; }
#country-legend li:nth-child(2) { background: #aacaba; }
#country-legend li:nth-child(3) { background: #80ad98; }
#country-legend li:nth-child(4) { background: #558673; color: #101e18; }
#country-legend li:nth-child(5) { background: #32624f; color: white; }
#country-legend:not([hidden]) ~ .tile-status { margin-top: 38px; }
.is-picking #country-legend { visibility: hidden; }
@media (min-width: 900px) and (min-height: 650px) {
  #country-legend { position: absolute; inset: 65px 12px auto auto; }
}

.place-pin.home-pin span {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 10px; border: 2px solid white; background: #314e41; color: white;
  transform: none; font: 700 21px/1 var(--ui-font);
}

.comment-heading { display: flex; align-items: center; gap: 9px; }
.comment-heading h3, #photo-interactions .comment-heading h3 { margin: 0; }
#photo-interactions .comment-heading { margin-top: 16px; }
.comment-count { min-width: 25px; padding: 2px 6px; border-radius: 12px; text-align: center; background: var(--surface-raised); font-size: .8rem; font-variant-numeric: tabular-nums; }
#place .comment-composer, #photo-interactions .comment-composer { gap: 8px; padding: 11px; border: 1px solid var(--sage); border-radius: 13px; background: var(--paper); }
.comment-composer label { font-weight: 600; }
.comment-composer textarea { min-height: 70px; background: var(--surface); font-weight: 400; }
.comment-composer textarea:focus-visible { outline: 2px solid #456557; outline-offset: 1px; }
.comment-composer .primary { justify-self: end; }
#comment-reply { width: 100%; justify-content: space-between; gap: 8px; padding: 4px 7px 4px 10px; background: var(--surface-raised); border-radius: 8px; }
#comment-reply-target { min-width: 0; overflow-wrap: anywhere; }
#comments .comment-card, .photo-comments .comment-card { margin: 10px 0 0; padding: 12px; border: 1px solid var(--sage); border-radius: 12px; background: var(--paper); }
.comment-card header { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.comment-card strong { overflow-wrap: anywhere; min-width: 0; }
.comment-avatar { display: grid; place-items: center; width: 31px; height: 31px; flex: none; border-radius: 50%; background: var(--surface-raised); color: #324b40; font-size: .76rem; font-weight: 750; }
#comments .comment-card time, .photo-comments .comment-card time { color: var(--cream); font-size: .75rem; margin: 0 0 0 auto; }
.comment-card p { margin: 8px 0 0; overflow-wrap: anywhere; }
#comments .comment-card .comment-reply-button { min-height: 44px; padding: 4px 9px; border: 0; background: var(--surface); color: #324b40; font-size: .86rem; font-weight: 650; }
#comments .comment-response { margin-left: 10px; border-left: 3px solid #91aa9c; background: var(--surface); }

.leaflet-container { font-family: var(--ui-font); }

#editor-media { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--sage); }
#editor-media h3 { margin: 10px 0; }
.editor-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.editor-link input { min-width: 0; }
#editor-photos { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; }
#editor-photos li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
#editor-photos img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
@media (max-width: 600px), (pointer: coarse) and (max-height: 520px) {
  #editor { inset: var(--visible-top, 0px) 0 auto; height: var(--visible-height, 100dvh); max-height: none; }
  #editor::backdrop { background: var(--paper); }
}

#editor-comments { display: grid; gap: 10px; }
#editor-comments .comment-card { padding: 12px; border: 1px solid var(--sage); border-radius: 12px; }
#editor-comments summary { width: fit-content; min-height: 44px; padding-block: 10px; cursor: pointer; }
#editor-comments .actions { margin-top: 7px; }

#upload-progress { display: block; width: 100%; height: 12px; accent-color: var(--accent); }
#upload-status { margin: 0; color: var(--cream); }

.top h1:has(#globe-toggle) { padding: 0; }
.top #globe-toggle {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border: 0; border-radius: inherit;
  background: transparent; box-shadow: none; font: inherit; white-space: nowrap;
}
#globe-toggle span { width: 19px; height: 19px; display: grid; place-items: center; font-size: 19px; }
#globe-toggle span::before { content: "◎"; }
.globe-active #globe-toggle span::before { content: "↶"; }
.is-picking #globe-toggle { visibility: hidden; }
#globe-view {
  position: fixed; z-index: 840; inset: 0;
  overflow: hidden; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, #344451, #101b2b 78%);
  transition: opacity 620ms cubic-bezier(.77,0,.175,1);
}
#globe-view canvas {
  display: block; width: 100%; height: 100%;
  transform: scale(.77) rotate(-8deg);
  filter: drop-shadow(0 10px 17px #253a312d);
  transition: transform 560ms cubic-bezier(.23,1,.32,1);
  cursor: grab;
  touch-action: none;
}
#globe-view canvas.is-dragging { cursor: grabbing; }
#globe-view.is-visible { opacity: 1; pointer-events: auto; }
#globe-view.is-visible canvas { transform: scale(1) rotate(0); }
#globe-view.is-closing canvas { transform: scale(.82) rotate(0); }
.globe-hint {
  position: absolute;
  inset: auto 16px calc(env(safe-area-inset-bottom) + 20px);
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: auto;
  padding: 10px 15px;
  border: 1px solid #ffffffa8;
  border-radius: 999px;
  background: #f7f8f4e8;
  color: #223030;
  box-shadow: 0 5px 18px #2230301f;
  text-align: center;
  font-size: 14px;
  pointer-events: none;
}
.globe-credit {
  position: absolute;
  right: calc(env(safe-area-inset-right) + 12px);
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  padding: 5px 9px;
  border-radius: 8px;
  color: #e5e8df;
  background: #172438c9;
  font-size: 11px;
  text-decoration: none;
}
.globe-hint { bottom: calc(env(safe-area-inset-bottom) + 58px); }
.globe-active :is(.map-dock, #country-legend, #tile-status, #clear-route) { visibility: hidden; }
@media (min-width: 900px) and (min-height: 650px) {
  #globe-view { position: absolute; border-radius: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  #globe-view, #globe-view canvas { transition: none; }
}

#overview { width: min(calc(100% - 26px), 760px); }
.overview-section-title { margin-top: 18px; font-size: 1.2rem; }
.overview-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.overview-tabs button { min-height: 46px; border-color: transparent; border-radius: 12px; background: var(--surface); }
.overview-tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-raised); color: var(--linen); font-weight: 700; }
.retrospective-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 6px 0 18px; }
.retrospective-toolbar label { display: block; margin-top: 4px; color: var(--cream); font-size: .85rem; }
.retrospective-toolbar select { width: min(140px, 38vw); min-height: 46px; font-size: 16px; font-variant-numeric: tabular-nums; }
.retrospective-kicker { margin: 0 0 3px; color: var(--cream); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.retrospective-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 24px; }
.retrospective-stats > div { min-width: 0; padding: 12px; border: 1px solid var(--sage); border-radius: 13px; background: var(--surface); }
.retrospective-stats dt { color: var(--cream); font-size: .78rem; }
.retrospective-stats dd { margin: 3px 0 0; color: var(--linen); font-size: clamp(1.5rem, 7vw, 2rem); font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.anniversary-section { margin: 8px 0 22px; padding: 15px; border: 1px solid var(--sage); border-radius: 15px; background: var(--surface-raised); }
.anniversary-section h3, .retrospective-year-heading h3, #retrospective-routes-title { margin: 0; font-size: 1.2rem; }
.anniversary-list { display: grid; gap: 8px; margin-top: 10px; }
.retrospective-places { display: grid; gap: 14px; margin: 12px 0 22px; }
.retrospective-memory { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; overflow: hidden; padding: 0; border: 1px solid var(--sage); border-radius: 15px; background: var(--surface); color: var(--linen); text-align: left; }
.retrospective-memory img, .retrospective-no-photo { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: linear-gradient(135deg, var(--surface-raised), var(--water)); color: var(--cream); }
.retrospective-memory-copy { display: grid; gap: 6px; min-width: 0; padding: 13px; }
.retrospective-memory-meta { color: var(--cream); font-size: .82rem; line-height: 1.4; }
.retrospective-memory-copy > strong { overflow-wrap: anywhere; font-size: 1.2rem; line-height: 1.2; }
.retrospective-story { display: -webkit-box; overflow: hidden; color: var(--cream); font-size: .9rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.retrospective-memory-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.retrospective-open-label { color: var(--linen); font-size: .82rem; font-weight: 700; }
.anniversary-list .retrospective-memory { grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 10px; border-radius: 11px; background: var(--paper); }
.anniversary-list .retrospective-memory img, .anniversary-list .retrospective-no-photo { width: 68px; height: 68px; aspect-ratio: 1; border-radius: 10px; font-size: .66rem; text-align: center; }
.anniversary-list .retrospective-memory-copy { gap: 3px; padding: 7px 9px 7px 0; }
.anniversary-list .retrospective-memory-copy > strong { font-size: 1rem; }
.anniversary-list .retrospective-story, .anniversary-list .retrospective-memory-footer { display: none; }
.retrospective-empty { padding: 16px; border-radius: 12px; background: var(--surface); color: var(--cream); }
.retrospective-routes { display: grid; gap: 8px; margin: 10px 0 18px; }
.retrospective-route-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; padding: 12px; border: 1px solid var(--sage); border-radius: 12px; background: var(--surface); }
.retrospective-route-card h4 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 1rem; }
.retrospective-route-card p { grid-column: 1; margin: 0; color: var(--cream); font-size: .82rem; }
.retrospective-route-card button { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding-inline: 10px; }
.retrospective-memory:active, .overview-tabs button:active { filter: brightness(.95); }
@media (min-width: 640px) {
  .retrospective-places { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 380px) {
  .retrospective-stats { gap: 6px; }
  .retrospective-stats > div { padding: 10px 8px; }
  .retrospective-route-card { grid-template-columns: minmax(0, 1fr); }
  .retrospective-route-card p, .retrospective-route-card button { grid-column: 1; grid-row: auto; }
}
@media (max-width: 600px), (pointer: coarse) and (max-height: 520px) {
  #overview { inset: 0; width: 100%; max-width: none; height: min(100dvh, var(--visible-height, 100dvh)); max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
}
