/* Layout: a sunny postcard atlas — globe card is the hero, the trip postcards stack beside it (below it on phones). Single bright look by choice. */
:root {
  color-scheme: light;
  --bg: #F2F8FD;
  --bg-2: #FFF8EC;
  --surface: #FFFFFF;
  --ink: #15314E;
  --muted: #5D7590;
  --line: #DCE7F1;
  --sky-1: #DDF1FF;
  --sky-2: #FFF3DC;
  --sea: #A9DDF8;
  --land: #FFFCF4;
  --land-line: #94B4CC;
  --visited: #FFC83D;
  --prov: #FF7FA0;
  --pin: #FF5E4D;
  --route: #2F7BEA;
  --river: #86C6EC;
  --accent: #2F7BEA;
  --accent-ink: #FFFFFF;
  --mint: #2FC79A;
  --mint-soft: #DDF7EE;
  --sun-soft: #FFF1C7;
  --pink-soft: #FFE3EA;
  --danger: #D9364A;
  --font-display: "Mali", "IBM Plex Sans Thai Looped", "Comic Sans MS", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai Looped", "Noto Sans Thai", system-ui, sans-serif;
  --r-lg: 26px;
  --r-md: 18px;
  --shadow: 0 10px 30px -14px rgba(21, 49, 78, .28);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
img { max-width: 100%; }
html { background: var(--bg-2); min-height: 100%; }
body {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 70%, var(--bg-2) 100%);
  color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px 56px;
  min-height: 100%;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { max-width: 1200px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 44px; height: 44px; flex: none; display: block; }
.brand h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 4.5vw, 30px); line-height: 1.1; margin: 0; }
.brand p { margin: 0; color: var(--muted); font-size: 13px; }

.btn { border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 18px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 6px 16px -8px var(--accent); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn.danger.armed { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }

.layout { max-width: 1200px; margin: 0 auto; display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 940px) {
  .layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 24px; }
  .layout > .globe-card { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); }
}

/* Globe card */
.globe-card { min-width: 0; background: radial-gradient(120% 90% at 50% 45%, #FFFFFF 0%, var(--sky-1) 45%, var(--sky-2) 100%); border-radius: var(--r-lg); padding: 0; overflow: hidden; box-shadow: var(--shadow); position: relative; isolation: isolate; }
.seg { position: absolute; top: 12px; left: 12px; display: inline-flex; backdrop-filter: blur(6px); background: rgba(255,255,255,.75); border-radius: 999px; padding: 4px; gap: 2px; z-index: 3; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(21,49,78,.12); }
.seg.lang { left: auto; right: 12px; }
.seg.lang button { padding: 6px 11px; font-size: 13px; letter-spacing: .04em; }
.globe-box { position: relative; width: 100%; height: clamp(460px, 128vw, 620px); }
@media (orientation: landscape) and (max-height: 560px) and (max-width: 939px) { .globe-box { height: calc(100vh - 24px); height: calc(100dvh - 24px); min-height: 300px; } }
@media (min-width: 940px) { .globe-box { height: calc(100vh - 116px); height: calc(100dvh - 116px); min-height: 520px; max-height: 1000px; } }
#globe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#globe:active { cursor: grabbing; }
#globe.picking { cursor: crosshair; }
.globe-ctrl { position: absolute; right: 12px; bottom: 74px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.globe-ctrl button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); font-size: 18px; font-weight: 600; line-height: 1; display: grid; place-items: center; box-shadow: 0 4px 12px -4px rgba(21,49,78,.3); }
.globe-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px; background: linear-gradient(180deg, rgba(255,250,240,0) 0%, rgba(255,250,240,.88) 45%); pointer-events: none; z-index: 1; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 0; }
.hint .short { display: none; }
@media (max-width: 400px) { .legend .lg-long { display: none; } }
@media (max-width: 520px) {
  .hint .long { display: none; } .hint .short { display: inline; }
  .legend { font-size: 11.5px; gap: 2px 10px; }
  .globe-foot { padding: 18px 10px 8px; }
  .field input, .field textarea { font-size: 16px; }
}
.legend { display: flex; justify-content: center; gap: 4px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw.c { background: var(--visited); } .sw.p { background: var(--prov); }
.sw.pin { border-radius: 50%; background: var(--pin); box-shadow: 0 0 0 2px var(--surface); width: 9px; height: 9px; }
.sw.home { background: var(--ink); width: 8px; height: 8px; border-radius: 2px; }
.pick-banner { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 6px 6px 16px; display: flex; gap: 10px; align-items: center; font-size: 14px; white-space: nowrap; box-shadow: var(--shadow); z-index: 3; }
.pick-banner button { border: 0; border-radius: 999px; padding: 4px 12px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; }
.stop-chip { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); background: var(--surface); border-radius: 999px; padding: 6px 8px 6px 14px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: 86%; z-index: 2; }
.stop-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Right column */
.side { min-width: 0; display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) and (max-width: 939px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; min-width: 0; box-shadow: 0 1px 0 var(--line); }
.stat b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.c b { color: #B98300; } .stat.k b { color: var(--route); } .stat.d b { color: var(--mint); }

.th-card { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 8px; box-shadow: 0 1px 0 var(--line); text-align: left; border: 0; width: 100%; }
.th-card:hover { box-shadow: 0 0 0 2px var(--prov); }
.th-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.th-row strong { font-family: var(--font-display); font-size: 17px; }
.th-row span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.th-row span b { color: var(--ink); font-size: 20px; font-family: var(--font-display); }
.bar { height: 12px; border-radius: 999px; background: var(--pink-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--prov); border-radius: 999px; min-width: 12px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.th-card small { color: var(--muted); font-size: 12.5px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.section-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 21px; margin: 0; }
.section-head span { color: var(--muted); font-size: 13px; }
.list { display: grid; gap: 14px; }
.year { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.year::after { content: ""; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px); }

/* Postcard */
.card { text-align: left; width: 100%; background: var(--surface); border: 0; border-radius: var(--r-lg); padding: 0; overflow: hidden; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr; transition: transform .2s; }
.card:hover { transform: translateY(-2px); }
.card.on { box-shadow: 0 0 0 3px var(--visited), var(--shadow); }
.cover { position: relative; aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--sky-1), var(--sun-soft)); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 6vw, 36px); color: rgba(21,49,78,.18); letter-spacing: .02em; padding: 0 16px; text-align: center; }
.postmark { position: absolute; right: 12px; top: 12px; width: 62px; height: 62px; border-radius: 50%; border: 2px dashed rgba(21,49,78,.45); display: grid; place-items: center; text-align: center; line-height: 1.05; font-size: 11px; font-weight: 600; color: var(--ink); background: rgba(255,255,255,.72); transform: rotate(-10deg); }
.postmark b { display: block; font-family: var(--font-display); font-size: 18px; }
.tag-ex { position: absolute; left: 12px; top: 12px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.cover .placeholder::before { content: ""; position: absolute; inset: 14px; border: 2px dashed rgba(21,49,78,.12); border-radius: 14px; }
.card-body { padding: 12px 16px 14px; display: grid; gap: 4px; min-width: 0; }
.card h3 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.3; }
.route { font-size: 13.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.route b { color: var(--ink); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--sun-soft); color: var(--ink); font-weight: 500; }
.chip.p { background: var(--pink-soft); } .chip.m { background: var(--mint-soft); } .chip.who { background: transparent; border: 1.5px solid var(--line); color: var(--muted); }
.empty { background: var(--surface); border-radius: var(--r-lg); padding: 26px 20px; text-align: center; color: var(--muted); box-shadow: var(--shadow); }
.empty strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 19px; margin-bottom: 6px; }

/* Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(21, 49, 78, .38); z-index: 20; }
.sheet { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(21,49,78,.25);
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); padding-block: 10px calc(28px + env(safe-area-inset-bottom, 0px)); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 10px; }
@media (min-width: 940px) { .sheet { left: auto; top: 0; width: 480px; max-height: none; border-radius: 26px 0 0 26px; padding-block: calc(22px + env(safe-area-inset-top, 0px)) 32px; } .sheet::before { display: none; } }
.sheet-cover { margin: 0 -18px 14px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sky-1); }
@media (min-width: 940px) { .sheet-cover { margin-top: -22px; } }
.sheet-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet h2 { font-family: var(--font-display); font-size: 27px; line-height: 1.2; margin: 0 0 2px; text-wrap: balance; }
.meta { color: var(--muted); font-size: 13.5px; }
.x { border: 0; background: var(--bg); width: 38px; height: 38px; border-radius: 50%; flex: none; font-size: 16px; font-weight: 600; }
.trip-note { white-space: pre-wrap; margin: 14px 0 0; background: var(--bg-2); border-radius: var(--r-md); padding: 12px 14px; }

.timeline { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--pin); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--pink-soft); }
.tl-line { flex: 1; width: 0; border-left: 2.5px dashed var(--line); margin: 4px 0; min-height: 16px; }
.tl:last-child .tl-line { display: none; }
.tl-body { padding-bottom: 20px; min-width: 0; }
.tl-name { border: 0; background: none; padding: 0; text-align: left; font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.3; }
.tl-name:hover { color: var(--accent); }
.tl-sub { color: var(--muted); font-size: 13px; }
.tl-note { white-space: pre-wrap; margin: 6px 0 0; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.photos button { border: 0; padding: 0; background: var(--bg); border-radius: 12px; overflow: hidden; aspect-ratio: 1; }
.photos button.wide { grid-column: span 2; grid-row: span 2; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clips { display: grid; gap: 8px; margin-top: 8px; }
.clips video { width: 100%; border-radius: 14px; background: #000; display: block; }
.vlinks { display: grid; gap: 6px; margin-top: 8px; }
.vlink { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--bg); text-decoration: none; color: var(--ink); min-width: 0; }
.vlink:hover { background: var(--sky-1); }
.vlink .play { width: 30px; height: 30px; border-radius: 50%; background: var(--pin); color: #fff; display: grid; place-items: center; font-size: 11px; flex: none; }
.vlink span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.vlink small { color: var(--muted); margin-left: auto; flex: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 40; background: #0B1622; display: flex; flex-direction: column; color: #fff; touch-action: pan-x; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(16px + env(safe-area-inset-left, 0px)); min-height: 60px; }
.lb-count { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; background: rgba(255,255,255,.14); padding: 4px 12px; border-radius: 999px; flex: none; }
.lb-cap { flex: 1; min-width: 0; font-size: 14px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox .x { flex: none; position: static; background: #fff; color: #15314E; }
.lb-stage { position: relative; flex: 1; min-height: 0; }
.lb-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; position: relative; }
.lb-slide img { position: absolute; inset: 0 8px; width: calc(100% - 16px); height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #15314E; font-size: 22px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.lb-nav.prev { left: max(10px, env(safe-area-inset-left, 0px)); }
.lb-nav.next { right: max(10px, env(safe-area-inset-right, 0px)); }
.lb-nav:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .lb-nav { width: 38px; height: 38px; font-size: 18px; background: rgba(255,255,255,.55); } }
.lb-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 10px calc(12px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px)); scrollbar-width: none; justify-content: safe center; }
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumbs button { flex: none; width: 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.1); opacity: .55; transition: opacity .15s, border-color .15s; }
.lb-thumbs button.on { opacity: 1; border-color: #fff; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-count { display: inline-flex; align-items: center; gap: 4px; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Form */
.form { display: grid; gap: 14px; margin-top: 12px; min-width: 0; }
.form > *, .stop-edit > * { min-width: 0; }
body.sheet-open { overflow: hidden; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label, .lbl { font-size: 13px; font-weight: 600; }
.help { font-size: 12px; color: var(--muted); }
.field input, .field textarea { width: 100%; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 9px 12px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 76px; }
.field input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; min-height: 46px; background: var(--surface); text-align: left; }
.field input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.field input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; }
.row2 > .field { min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stop-edit { border-radius: var(--r-md); background: var(--bg); padding: 12px; display: grid; gap: 10px; }
.stop-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stop-edit-head b { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 16px; }
.stop-edit-head .tl-dot { width: 24px; height: 24px; font-size: 12px; box-shadow: none; }
.coord-row { display: flex; gap: 8px; }
.coord-row input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.coord-row .btn { flex: none; padding: 6px 12px; font-size: 13px; }
.found { font-size: 12.5px; color: var(--mint); font-weight: 600; min-height: 1em; }
.found.bad { color: var(--danger); font-weight: 500; }
.loc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-actions .btn { text-decoration: none; color: var(--ink); }
.media-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.media-edit .m { position: relative; width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--surface); display: grid; place-items: center; font-size: 11px; color: var(--muted); border: 1.5px solid var(--line); }
.media-edit .m img { width: 100%; height: 100%; object-fit: cover; }
.media-edit .m.new { border-color: var(--mint); }
.media-edit .m button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(21,49,78,.75); color: #fff; font-size: 11px; line-height: 1; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; border: 2px dashed var(--land-line); border-radius: 14px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: var(--accent); background: var(--surface); cursor: pointer; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.add-stop { border: 2px dashed var(--land-line); background: transparent; border-radius: var(--r-md); padding: 12px; font-weight: 600; color: var(--accent); }
.err { color: var(--danger); font-size: 13.5px; margin: 0; font-weight: 500; }
.status { color: var(--muted); font-size: 13px; margin: 0; }
.sticky-actions { position: sticky; bottom: calc(-28px - env(safe-area-inset-bottom, 0px)); background: var(--surface); padding: 12px 0 calc(16px + env(safe-area-inset-bottom, 0px)); margin-bottom: calc(-28px - env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: grid; gap: 8px; }

.house { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 16px; box-shadow: 0 1px 0 var(--line); margin-top: 6px; }
.house-h { font-family: var(--font-display); font-size: 17px; margin: 0; }
.meter { display: grid; gap: 6px; }
.meter .th-row strong, .backup strong { font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.meter small, .backup small { display: block; color: var(--muted); font-size: 12.5px; }
.bar.store { background: var(--mint-soft); }
.bar.store i { background: var(--mint); min-width: 6px; }
.bar.store.warn i { background: var(--visited); }
.bar.store.full i { background: var(--danger); }
.backup { display: grid; gap: 8px; }
.backup strong { font-size: 14px; }
.backup-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ord { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ord .btn { padding: 4px 11px; }

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: rise .32s cubic-bezier(.2,.9,.25,1.05); }
  @media (min-width: 940px) { .sheet { animation-name: slide; } }
  @keyframes rise { from { transform: translateY(40px); opacity: .5; } }
  @keyframes slide { from { transform: translateX(40px); opacity: .5; } }
}
@media (prefers-reduced-motion: reduce) { .card, .btn, .bar i { transition: none; } }

/* ---- Mapbox version additions ---- */
#map { position: absolute; inset: 0; }
#map.picking .mapboxgl-canvas-container { cursor: crosshair; }
.mapboxgl-ctrl-bottom-left, .mapboxgl-ctrl-bottom-right { bottom: 58px; }
.mapboxgl-ctrl-bottom-right { right: 64px; }
.num-pin { width: 24px; height: 24px; border-radius: 50%; background: var(--pin); color: #fff; font: 700 12px/24px var(--font-body); text-align: center; box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(21,49,78,.35); cursor: pointer; }
.home-pin { width: 12px; height: 12px; border-radius: 3px; background: var(--ink); box-shadow: 0 0 0 2.5px #fff; }
.center-pin { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -30px 0 0 -15px; pointer-events: none; z-index: 2; }
.center-pin::before { content: ""; position: absolute; inset: 0; border-radius: 50% 50% 50% 0; background: var(--pin); transform: rotate(-45deg); box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0,0,0,.25); }
.center-pin::after { content: ""; position: absolute; left: 50%; top: 100%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: rgba(21,49,78,.35); }
.pick-panel { position: absolute; z-index: 4; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); top: 60px; max-width: 460px; margin: 0 auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 10px; display: grid; gap: 8px; }
.pick-panel p { margin: 0; font-size: 13px; color: var(--muted); padding: 0 4px; }
.search { position: relative; }
.search input { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 16px; background: var(--bg); }
.search input:focus { outline: none; border-color: var(--accent); }
.results { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; max-height: 40vh; overflow: auto; }
.results button { width: 100%; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; display: grid; }
.results button:hover, .results button:focus-visible { background: var(--bg); }
.results b { font-weight: 600; }
.results small { color: var(--muted); font-size: 12px; }
.pick-actions { display: flex; gap: 8px; }
.pick-actions .btn { flex: 1; }
.yt { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; margin-top: 8px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.import-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.map-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); z-index: 3; }
.map-error strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 18px; margin-bottom: 6px; }

.tl-gm { display: inline-block; font-size: 12.5px; color: var(--muted); text-decoration: none; margin: 2px 0 4px; }
.tl-gm:hover { color: var(--ink); text-decoration: underline; }

/* original-photos album link */
.album-link { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; padding: 12px 16px; border-radius: 16px; background: var(--bg); border: 2px solid var(--line); color: var(--ink); text-decoration: none; }
.album-link:hover { border-color: var(--accent); }
.album-link > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.album-link small { color: var(--muted); font-size: 12.5px; }
.album-ic { font-size: 22px; }
.opt { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
/* trash */
.trash-btn { margin-top: 10px; }
.trash-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.trash-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.trash-list li > div:first-child { display: grid; min-width: 0; flex: 1 1 200px; }
.trash-list small { color: var(--muted); font-size: 12.5px; }
.trash-acts { display: flex; gap: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: max-content; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px; background: #15314E; color: #fff; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.toast[hidden] { display: none; }
.toast .btn { background: #fff; color: #15314E; border-color: #fff; flex: none; }
