/* =====================================================================
   mypinlog — styles. Mobile first; laptop layout from 900px.
   ===================================================================== */

:root {
  --teal-900: #0B3F48;
  --teal-800: #0F5560;
  --teal-700: #16707A;
  --teal-100: #DCEDEE;
  --orange-600: #E04E24;
  --orange-500: #F0592E;
  --orange-100: #FDE6DD;

  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #F0EEE8;
  --text: #1C2A2E;
  --muted: #62707A;
  --border: #E2DED5;

  --ok: #1F8A4C;
  --ok-bg: #E3F4EA;
  --err: #C23B22;
  --err-bg: #FBE6E1;
  --info: #1F6FB2;
  --info-bg: #E2EEF8;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 42, 46, .06), 0 4px 16px rgba(16, 42, 46, .06);
  --tabbar-h: 64px;
  --sidebar-w: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1719;
    --surface: #172225;
    --surface-2: #1E2B2F;
    --text: #E7EEEF;
    --muted: #9AABB0;
    --border: #2A3A3E;
    --teal-100: #173A40;
    --orange-100: #3A2219;
    --ok-bg: #16301F; --err-bg: #3A1D17; --info-bg: #172C3D;
    --ok: #5CC98A; --err: #F08A74; --info: #7DB7E8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--teal-700); }
@media (prefers-color-scheme: dark) { a { color: #6CC3CC; } }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 2px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.logo-mark { width: 32px; height: 32px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.25rem;
  border: 0; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange-500); color: #fff; }
.btn-primary:hover { background: var(--orange-600); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  font-size: 1.1rem; cursor: pointer; text-decoration: none;
}
.icon-btn:hover, .icon-btn.is-active { background: var(--surface-2); color: var(--text); }
.is-soon { opacity: .45; cursor: not-allowed; }

/* ---------- Cards, alerts ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-narrow { max-width: 440px; margin-inline: auto; }
.card-wide { max-width: 680px; margin-inline: auto; }
.card-title { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; }
.card.center .card-title { justify-content: center; }
.section-title { font-size: 1rem; margin-top: 1.5rem; }

.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .95rem; }
.alert i { margin-top: .2rem; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert span { color: var(--text); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; margin-top: 1rem; }
.field { display: grid; gap: .35rem; }
.label { font-weight: 600; font-size: .92rem; }
.hint { font-size: .85rem; color: var(--muted); }
.field-error { font-size: .85rem; color: var(--err); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem;
  font: inherit; font-size: 16px; /* 16px stops iPhone zooming into inputs */
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-700); box-shadow: 0 0 0 3px var(--teal-100); }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-addon {
  flex: none; width: 48px; border: 1px solid var(--border); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 1rem;
}
.input-prefixed input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-prefix {
  display: flex; align-items: center; padding: 0 .7rem; font-size: .85rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis;
}
.check { display: flex; gap: .6rem; align-items: center; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--orange-500); }

/* ---------- Minimal layout (sign in, landing, errors, install) ---------- */
.page-min { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.min-header { padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem; }
.min-main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.min-footer { padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom)); text-align: center; font-size: .8rem; color: var(--muted); }

.hero { text-align: center; padding: 2.5rem 0 2rem; }
.hero .logo-mark { width: 88px; height: 88px; margin-bottom: 1rem; }
.hero h1 { font-size: 2.2rem; letter-spacing: -.02em; }
.hero-tagline { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.5rem; }
.feature-grid { display: grid; gap: 1rem; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.feature h2 { font-size: 1.05rem; margin-top: .6rem; }
.feature p { color: var(--muted); margin: 0; }
.feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--orange-100); color: var(--orange-500); font-size: 1.15rem; }
@media (min-width: 720px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.steps { padding-left: 1.2rem; display: grid; gap: .6rem; }
.code { background: var(--surface-2); border-radius: var(--radius-sm); padding: .8rem 1rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; }
.checklist li i { margin-top: .25rem; }
.checklist li.ok i { color: var(--ok); }
.checklist li.fail i { color: var(--err); }
.checklist small { display: block; color: var(--muted); }

/* ---------- App layout (logged in) ---------- */
.page-app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(.5rem + env(safe-area-inset-top)) .75rem .5rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-actions { display: flex; align-items: center; gap: .15rem; }
.topbar-actions form { margin: 0; }
.main { padding: 1rem 1rem calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); font-size: .7rem; color: var(--muted); text-decoration: none;
}
.tab i { font-size: 1.2rem; }
.tab.is-active { color: var(--orange-500); font-weight: 600; }
.tab-log { justify-content: flex-end; padding-bottom: 8px; }
.tab-log-btn {
  display: grid; place-items: center; width: 56px; height: 56px; margin-top: -22px; margin-bottom: 2px;
  border-radius: 50%; background: var(--orange-500); color: #fff; font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(240, 89, 46, .45); border: 4px solid var(--surface);
}
.tab-log.is-soon { opacity: 1; }
.tab-log.is-soon .tab-log-btn { background: #C9A69A; box-shadow: none; }

@media (min-width: 900px) {
  .topbar, .tabbar { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    display: flex; flex-direction: column; gap: 1.25rem;
    padding: 1.25rem 1rem; background: var(--surface); border-right: 1px solid var(--border);
  }
  .sidebar .brand { padding: 0 .5rem; }
  .main { margin-left: var(--sidebar-w); max-width: none; padding: 2rem 2.5rem 3rem; }
  .main > * { max-width: 1100px; }
}
.side-nav { display: grid; gap: .2rem; }
.side-link {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .75rem;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 500;
}
.side-link i { width: 20px; text-align: center; color: var(--muted); }
.side-link:hover { background: var(--surface-2); }
.side-link.is-active { background: var(--orange-100); color: var(--orange-600); }
.side-link.is-active i { color: var(--orange-500); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.side-user form { margin: 0 0 0 auto; }
.side-user-text { display: grid; min-width: 0; font-size: .9rem; }
.side-user-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text a { font-size: .8rem; }

/* ---------- Page content ---------- */
.page-head { margin-bottom: 1rem; }
.page-head h1 { display: flex; align-items: center; gap: .55rem; }
.page-head p { margin: 0; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--teal-800); color: #fff; font-weight: 700; font-size: .9rem;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat-row-wide { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stat-row-wide { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .stat-row-wide { grid-template-columns: repeat(6, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; display: grid; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--muted); }

.map-placeholder {
  display: grid; place-items: center; min-height: 260px; margin-bottom: 1rem;
  border-radius: var(--radius); border: 1px dashed var(--border);
  background:
    radial-gradient(circle at 20% 30%, var(--teal-100) 0 2px, transparent 3px) 0 0 / 28px 28px,
    var(--surface);
}
@media (min-width: 900px) { .map-placeholder { min-height: 380px; } }
.empty { text-align: center; padding: 1.5rem; max-width: 360px; }
.empty p { color: var(--muted); margin: 0; }
.empty-icon {
  display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: .75rem;
  border-radius: 50%; background: var(--orange-100); color: var(--orange-500); font-size: 1.5rem;
}

.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 0; }
.share-card { display: grid; gap: .75rem; }
@media (min-width: 720px) { .share-card { grid-template-columns: 1fr 1fr; align-items: center; } .share-card p { margin: 0; } }

/* Tables: rows turn into stacked cards on phones */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.table td { padding: .65rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .table td { border: 0; padding: .15rem 0; display: flex; gap: .75rem; }
  .table td::before { content: attr(data-label); flex: 0 0 5.5rem; color: var(--muted); font-size: .8rem; }
}

/* Copy button feedback */
.is-copied { color: var(--ok) !important; }

/* =====================================================================
   v0.2 — maps, check-in form, visit page
   ===================================================================== */
.small { font-size: .85rem; }
.hide-phone { display: none; }
@media (min-width: 900px) { .hide-phone { display: inline-flex; } }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.btn-small { min-height: 40px; padding: 0 1rem; font-size: .9rem; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1EBE5A; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--err); border: 1px solid var(--border); }
.btn-danger-ghost:hover { background: var(--err-bg); }
.btn:disabled { opacity: .6; cursor: progress; }

/* ---------- Maps ---------- */
.map { position: relative; z-index: 0; width: 100%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.map-dashboard { height: 340px; margin-bottom: 1rem; }
.map-visit { height: 240px; margin: 1rem 0 .5rem; }
.map-checkin { height: 240px; margin-bottom: .6rem; }
@media (min-width: 900px) { .map-dashboard { height: 460px; } .map-visit { height: 320px; } .map-checkin { height: 300px; } }
.map-status { font-size: .9rem; color: var(--muted); margin: 0 0 .6rem; }
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: .7rem .9rem; }
.map-popup a { font-weight: 700; text-decoration: none; }
.map-popup-meta { color: #62707A; font-size: .8rem; margin-top: 2px; }

.pin-wrap { background: none; border: 0; }
.pin {
  --c: #F0592E;
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.pin i { transform: rotate(45deg); color: #fff; font-size: 14px; }
.you-wrap { background: none; border: 0; }
.you-dot {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  background: #1F6FB2; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(31,111,178,.5);
  animation: you-pulse 2s infinite; cursor: grab;
}
@keyframes you-pulse { 0% { box-shadow: 0 0 0 0 rgba(31,111,178,.45); } 70% { box-shadow: 0 0 0 14px rgba(31,111,178,0); } 100% { box-shadow: 0 0 0 0 rgba(31,111,178,0); } }
@media (prefers-reduced-motion: reduce) { .you-dot { animation: none; } }
.accuracy-circle { fill: #1F6FB2; fill-opacity: .12; stroke: #1F6FB2; stroke-opacity: .4; stroke-width: 1; }

/* ---------- Check-in form ---------- */
.visit-form { display: grid; gap: 0; max-width: 760px; }
.form-section { margin-bottom: .9rem; }
.section-head { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; margin-bottom: .8rem; }
.section-head i { color: var(--orange-500); }
.section-head small { font-weight: 500; margin-left: auto; }

.place-list { display: grid; gap: .5rem; }
.place-results { display: grid; gap: .5rem; }
.place-loading { margin: .25rem 0; }
.place-option {
  display: flex; align-items: center; gap: .8rem; padding: .65rem .8rem; min-height: 56px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface);
}
.place-option input { position: absolute; opacity: 0; pointer-events: none; }
.place-option:has(input:checked) { border-color: var(--orange-500); box-shadow: 0 0 0 2px var(--orange-500) inset; background: var(--orange-100); }
.place-option:has(input:focus-visible) { outline: 3px solid var(--orange-500); outline-offset: 2px; }
.place-text { display: grid; min-width: 0; }
.place-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-text small { color: var(--muted); font-size: .82rem; }
.place-icon {
  --c: #F0592E;
  display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--c); color: #fff; font-size: 15px;
}
.place-icon-plain { background: var(--surface-2); color: var(--muted); }
.place-icon-sm { width: 30px; height: 30px; font-size: 12px; }
.place-icon-lg { width: 56px; height: 56px; font-size: 22px; }
.new-place { display: grid; gap: .9rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
@media (min-width: 560px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }
.photo-tile, .photo-add {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile.is-loading { color: var(--muted); }
.photo-remove {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; cursor: pointer;
}
.photo-existing input { position: absolute; opacity: 0; pointer-events: none; }
.photo-existing { cursor: pointer; }
.photo-existing.is-removed img { opacity: .25; filter: grayscale(1); }
.photo-existing.is-removed .photo-remove { background: var(--err); }
.photo-add {
  border: 2px dashed var(--border); color: var(--muted); cursor: pointer; gap: .2rem; font-size: .8rem; text-align: center; align-content: center;
}
.photo-add i { font-size: 1.3rem; color: var(--orange-500); }
.photo-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-add[hidden] { display: none; }

.rating-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
@media (min-width: 560px) { .rating-scale { grid-template-columns: repeat(10, 1fr); } }
.rating-pill input { position: absolute; opacity: 0; pointer-events: none; }
.rating-pill span {
  display: grid; place-items: center; height: 46px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); font-weight: 700; cursor: pointer;
}
.rating-pill input:checked + span { background: var(--orange-500); border-color: var(--orange-500); color: #fff; }
.rating-pill input:focus-visible + span { outline: 3px solid var(--orange-500); outline-offset: 2px; }

.choice-cards { display: grid; gap: .5rem; }
@media (min-width: 640px) { .choice-cards { grid-template-columns: repeat(3, 1fr); } }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center; height: 100%;
  padding: .75rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface);
}
.choice-body i { grid-row: span 2; color: var(--muted); font-size: 1.05rem; }
.choice-body small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.choice-card input:checked + .choice-body { border-color: var(--teal-700); box-shadow: 0 0 0 2px var(--teal-700) inset; background: var(--teal-100); }
.choice-card input:checked + .choice-body i { color: var(--teal-700); }
.choice-card input:focus-visible + .choice-body { outline: 3px solid var(--orange-500); outline-offset: 2px; }
textarea { resize: vertical; min-height: 96px; }

.form-actions {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 10;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: .6rem; padding: .6rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
@media (min-width: 900px) { .form-actions { bottom: 1rem; max-width: 460px; margin-left: auto; } }
.form-errors { position: sticky; top: 70px; z-index: 11; }
.form-errors[hidden] { display: none; }

/* ---------- Visit page ---------- */
.visit { max-width: 820px; }
.visit-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .6rem; }
.visit-head-text { min-width: 0; flex: 1; }
.visit-head h1 { margin: 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.visit-head p { margin: 0; }
.rating-badge {
  display: flex; align-items: baseline; flex: none; padding: .45rem .75rem; border-radius: 14px;
  background: var(--orange-500); color: #fff;
}
.rating-badge strong { font-size: 1.5rem; line-height: 1; }
.rating-badge span { font-size: .85rem; opacity: .9; }
.visit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .9rem; font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.visit-owner { display: inline-flex; align-items: center; gap: .45rem; color: var(--text); text-decoration: none; font-weight: 600; }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.visit-title { font-size: 1.2rem; margin: 0 0 .8rem; }
.visit-note { font-size: 1.02rem; line-height: 1.6; margin: 1rem 0; white-space: normal; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0 1rem; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips-scroll { flex-wrap: wrap; } }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; flex: none; padding: .3rem .7rem; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .85rem; white-space: nowrap;
}
.chip i { color: var(--muted); font-size: .8em; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-ok i { color: var(--ok); }
.chip-cat { background: var(--surface); border: 1px solid var(--border); padding-left: .3rem; }
.chip-dot { --c: #F0592E; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); }
.chip-dot i { color: #fff; font-size: 11px; }

.gallery { display: grid; gap: .4rem; grid-template-columns: repeat(2, 1fr); margin: .5rem 0 1rem; }
.gallery-item { display: block; overflow: hidden; border-radius: var(--radius-sm); aspect-ratio: 1; background: var(--surface-2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.gallery-1 .gallery-item:first-child { aspect-ratio: 4 / 3; }
@media (min-width: 720px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery-item:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: 1; }
  .gallery-1 { grid-template-columns: 1fr; }
  .gallery-1 .gallery-item:first-child { grid-column: 1; grid-row: 1; aspect-ratio: 16 / 9; }
}

.action-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.action-row .btn { min-height: 44px; }
.owner-actions { display: flex; gap: .5rem; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border); }
.owner-actions form { margin: 0; }

/* ---------- Dashboard ---------- */
.card-drafts { border-color: var(--orange-100); }
.draft-list { list-style: none; margin: 0; padding: 0; }
.draft-list li + li { border-top: 1px solid var(--border); }
.draft-list a { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; text-decoration: none; color: var(--text); }
.draft-list a .muted { font-size: .85rem; margin-left: auto; }
.draft-list a i { color: var(--muted); }
.empty-card { display: grid; place-items: center; min-height: 280px; }
.empty-card .btn { margin-top: 1rem; }
.cell-place a { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; text-decoration: none; color: var(--text); }
@media (max-width: 719px) {
  .table-places td.cell-place { padding-bottom: .35rem; }
  .table-places td.cell-place::before { display: none; }
}
.leaflet-control-attribution { font-size: 10px !important; line-height: 1.4; }
.form-actions .btn { white-space: nowrap; padding: 0 .9rem; }
@media (max-width: 380px) { .form-actions .btn i { display: none; } }

/* =====================================================================
   v0.3 — invites, join, admin members
   ===================================================================== */
.subnav { display: flex; gap: .35rem; margin: -.25rem 0 1rem; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex; align-items: center; gap: .45rem; flex: none; padding: .5rem .9rem; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; background: var(--surface); border: 1px solid var(--border);
}
.subnav a.is-active { background: var(--teal-800); border-color: var(--teal-800); color: #fff; }
.card-warn { border-color: #E9C46A; background: color-mix(in srgb, #E9C46A 12%, var(--surface)); }
.card-warn form { margin-top: .5rem; }
.chip-warn { background: #FBF0D6; color: #8A5A00; }
.chip-warn i { color: #8A5A00; }
.chip-bad { background: var(--err-bg); color: var(--err); }
.chip-bad i { color: var(--err); }
@media (prefers-color-scheme: dark) { .chip-warn { background: #3A2E12; color: #F2C66D; } .chip-warn i { color: #F2C66D; } }
.row-muted td { opacity: .65; }
.cell-member { display: flex; align-items: center; gap: .6rem; }
.cell-member small a { color: inherit; }
.cell-actions { white-space: nowrap; text-align: right; }
.cell-actions form { display: inline; margin: 0; }
@media (max-width: 719px) {
  .table td.cell-actions { justify-content: flex-start; padding-top: .35rem; }
  .table td.cell-actions::before { display: none; }
  .table td.cell-member::before { display: none; }
}

.form-grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid-full { grid-column: 1 / -1; } }
.hint-ok { color: var(--ok); }
.hint-bad { color: var(--err); }

.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 230px;
  display: grid; padding: .35rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
@media (max-width: 719px) { .menu-list { left: 0; right: auto; } }
.menu-list button {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: .92rem; text-align: left; cursor: pointer;
}
.menu-list button i { width: 18px; color: var(--muted); }
.menu-list button:hover { background: var(--surface-2); }
.menu-list button.danger { color: var(--err); }
.menu-list button.danger i { color: var(--err); }

.join-hero { text-align: center; margin-bottom: .5rem; }
.join-hero .logo-mark { width: 64px; height: 64px; margin-bottom: .75rem; }
.join-hero .card-title { justify-content: center; }
.invite-new { border-color: var(--orange-500); }
.invite-new .action-row { margin-bottom: 0; }
.table-wrap-visible { overflow: visible; }

/* =====================================================================
   v0.4 — friends, account, owner tools, passkeys
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.side-link, .tab { position: relative; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto;
  border-radius: 999px; background: var(--orange-500); color: #fff; font-size: .72rem; font-weight: 700;
}
.tab .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: .68rem; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--orange-500); color: #fff; font-size: .78rem; }

@media (min-width: 640px) { .choice-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .visit-form .choice-cards, .choice-cards-4 { grid-template-columns: repeat(4, 1fr); } }

/* Friends */
.search-row { margin-bottom: .5rem; }
.search-row input { border-top-left-radius: 999px; border-bottom-left-radius: 999px; padding-left: 1.1rem; }
.search-row .input-addon { border-radius: 0 999px 999px 0; }
.people { list-style: none; margin: .5rem 0 0; padding: 0; }
.person { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; flex-wrap: wrap; }
.person + .person { border-top: 1px solid var(--border); }
.person-link { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1 1 200px; text-decoration: none; color: var(--text); }
.person-text { display: grid; min-width: 0; }
.person-text strong, .person-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: 0; }
.card-highlight { border-color: var(--orange-500); }
.profile-head { flex-wrap: wrap; }
.profile-head-text { flex: 1 1 220px; min-width: 0; }
.profile-bio { margin-top: .35rem !important; }
.profile-actions { flex: 1 1 100%; }
@media (min-width: 720px) { .profile-actions { flex: 0 0 auto; } }

/* Owner tools on the visit page */
.owner-bar {
  display: grid; gap: .75rem; margin: 0 0 1rem; padding: .85rem; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--teal-700);
}
@media (min-width: 900px) { .owner-bar { grid-template-columns: 1fr auto; align-items: center; } }
.owner-visibility { margin: 0; display: grid; gap: .45rem; }
.owner-bar-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.owner-bar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.owner-bar-actions form { margin: 0; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
@media (min-width: 560px) { .segmented { grid-template-columns: repeat(4, auto); justify-content: start; } }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .8rem; border-radius: 9px;
  font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented input:checked + span i { color: var(--teal-700); }
.segmented input:focus-visible + span { outline: 3px solid var(--orange-500); }

/* Menus: links and labels */
.menu-list a { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .92rem; }
.menu-list a i { width: 18px; color: var(--muted); }
.menu-list a:hover { background: var(--surface-2); }
.menu-list form { display: grid; margin: 0; }
.menu-label { display: block; padding: .5rem .7rem .2rem; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--border); margin-top: .25rem; }
.menu-list button.is-current { font-weight: 700; }
.menu-check { margin-left: auto; color: var(--ok) !important; }
.menu-list form:last-child { border-top: 1px solid var(--border); margin-top: .25rem; padding-top: .25rem; }

.danger-zone { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); max-width: 760px; }
.danger-zone .section-head i { color: var(--err); }

/* Passkeys */
.passkey-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.passkey-list li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.passkey-list li > i { color: var(--teal-700); }
.passkey-list li span { display: grid; flex: 1; }
.passkey-list form { margin: 0; }
.passkey-login { margin-top: 1rem; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.passkey-prompt { display: flex; gap: 1rem; align-items: flex-start; border-color: var(--teal-700); }
.passkey-prompt .empty-icon { flex: none; margin: 0; background: var(--teal-100); color: var(--teal-700); }
.passkey-prompt h2 { font-size: 1.05rem; margin: .2rem 0 .3rem; }
.passkey-prompt .action-row { margin: .6rem 0 0; }
[data-passkey-prompt][hidden], [data-passkey-only][hidden] { display: none; }
.menu-list { text-align: left; white-space: normal; }

/* =====================================================================
   v0.5 — languages
   ===================================================================== */
.lang-switch { display: inline-flex; gap: .6rem; margin-left: .6rem; }
.lang-switch a { color: var(--muted); }
.lang-switch strong { color: var(--text); }
@media (max-width: 560px) { .lang-switch { display: flex; justify-content: center; margin: .5rem 0 0; } }
.segmented-2 { grid-template-columns: repeat(2, 1fr) !important; max-width: 320px; }

.tr-filters { display: grid; gap: .75rem; align-items: center; }
@media (min-width: 900px) { .tr-filters { grid-template-columns: auto 1fr auto; } }
.tr-search input { border-top-left-radius: 999px; border-bottom-left-radius: 999px; padding-left: 1.1rem; }
.tr-search .input-addon { border-radius: 0 999px 999px 0; }
.tr-form { margin-bottom: 1rem; }
.tr-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.tr-row { display: grid; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.tr-row:last-child { border-bottom: 0; }
@media (min-width: 900px) { .tr-row { grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; } }
.tr-row.is-changed { background: color-mix(in srgb, var(--orange-100) 55%, var(--surface)); }
.tr-source { display: grid; gap: .3rem; font-size: .92rem; }
.tr-en { color: var(--text); }
.tr-builtin { font-size: .8rem; color: var(--muted); }
.tr-edit { display: grid; gap: .35rem; }
.tr-edit input, .tr-edit textarea { min-height: 42px; padding: .5rem .75rem; }
.tr-edit textarea { min-height: 64px; }
.tr-reset { font-size: .82rem; }
.tr-reset input { width: 16px; height: 16px; }
.tr-actions { grid-template-columns: 1fr auto; align-items: center; padding-left: 1.1rem; }
@media (min-width: 900px) { .tr-actions { max-width: 520px; } }
.pager { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1.5rem; }
.pager a, .pager strong { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; }
.pager strong { background: var(--teal-800); color: #fff; border-color: var(--teal-800); }
@media (max-width: 719px) { .table td::before { flex-basis: 7.5rem !important; } }

/* v0.6 — camera + gallery tiles, lightbox */
.only-desktop { display: none; }
@media (hover: hover) and (pointer: fine) {
  .photo-add-camera { display: none; }     /* laptops: no camera shortcut, one "Add photos" tile */
  .only-touch { display: none; }
  .only-desktop { display: inline; }
}
.photo-add-camera { border-color: var(--orange-500); border-style: solid; background: var(--orange-100); color: var(--orange-600); }
.photo-add-camera i { color: var(--orange-500); }
.lightbox {
  --lb-fade: 1;
  position: fixed; inset: 0; z-index: 1000;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 1fr; align-items: center;
  background: rgba(8, 14, 16, calc(.94 * var(--lb-fade))); color: #fff;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  touch-action: pan-y pinch-zoom;
}
.lightbox[hidden] { display: none; }
html.lb-open, html.lb-open body { overflow: hidden; }
.lb-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: .5rem .75rem .25rem 1.1rem; }
.lb-count { font-size: .9rem; opacity: .85; }
.lb-stage { grid-column: 2; grid-row: 2; position: relative; display: grid; place-items: center; height: 100%; min-height: 0; overflow: hidden; }
.lb-img {
  max-width: 100%; max-height: calc(100dvh - 90px); object-fit: contain; border-radius: 6px;
  transition: transform .2s ease, opacity .2s ease; user-select: none; -webkit-user-drag: none;
}
.lightbox.is-loading .lb-img { opacity: .25; }
.lb-spinner { position: absolute; font-size: 1.6rem; opacity: 0; transition: opacity .2s; pointer-events: none; }
.lightbox.is-loading .lb-spinner { opacity: .9; }
.lb-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.15rem; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-btn:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 2px; }
.lb-btn[hidden] { display: none; }
.lb-prev, .lb-next { grid-row: 2; margin: 0 .6rem; }
.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
@media (max-width: 719px) {
  /* phones: swipe is the main way; small arrows float over the photo */
  .lightbox { grid-template-columns: 1fr; }
  .lb-stage { grid-column: 1; }
  .lb-prev, .lb-next { position: absolute; top: 50%; width: 40px; height: 40px; margin: 0; background: rgba(0, 0, 0, .35); }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-img { max-height: calc(100dvh - 80px); border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .lb-img { transition: none; } }
.gallery-item { cursor: zoom-in; }
.lb-btn { position: relative; z-index: 2; }
@media (max-width: 719px) { .lb-prev, .lb-next { position: absolute; } }
.lightbox { background: rgba(8, 14, 16, calc(.97 * var(--lb-fade))); }
.lightbox { background: #0a1113; }

/* ---------- v0.7: Discover ---------- */
.discover.is-loading .dc-list { opacity: .55; transition: opacity .2s; }
.dc-controls { display: grid; gap: .9rem; }
.dc-controls .search-row { margin: 0; }
.dc-controls .chips { margin: 0; }
.dc-controls .label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.dc-controls .label i { color: var(--muted); }
.dc-popular { align-items: center; }
.dc-popular-label { flex: none; margin-right: .1rem; }
.dc-radius { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .35rem .75rem; }
.dc-radius output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--teal-700); }
.dc-radius input[type=range] { grid-column: 1 / -1; width: 100%; height: 32px; margin: 0; accent-color: var(--orange-500); cursor: pointer; }
.dc-scale { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: -.3rem; }
.dc-types-wrap { display: grid; gap: .45rem; }
.chip-filter { border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; font-size: .85rem; min-height: 36px; }
.chip-filter:hover { border-color: var(--teal-700); }
.chip-filter.is-on { background: var(--teal-800); border-color: var(--teal-800); color: #fff; }
.chip-filter.is-on i { color: #fff; }
.chip-filter .chip-dot { width: 22px; height: 22px; margin-left: -.35rem; }
.chip-count { font-size: .75rem; font-weight: 700; opacity: .7; }
.chip-xs { padding: .1rem .5rem; font-size: .72rem; }

.dc-body { display: grid; gap: 1rem; }
.dc-map-col { position: relative; }
.map-discover { height: 320px; }
.dc-here { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; box-shadow: var(--shadow); }
.dc-here[hidden] { display: none; }
.dc-locate { position: absolute; right: 10px; bottom: 26px; z-index: 500; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.dc-circle { stroke: var(--orange-500); stroke-width: 2; stroke-dasharray: 6 6; fill: var(--orange-500); fill-opacity: .06; }
.you-dot-still { animation: none; cursor: default; }
.dc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; margin-bottom: .75rem; }
.dc-status { margin: 0; font-size: .9rem; flex: 1 1 200px; }
.dc-sort { flex: none; }
.dc-list { display: grid; gap: .75rem; }
.dc-place { margin: 0; scroll-margin-top: 80px; transition: box-shadow .3s, border-color .3s; }
.dc-place.is-flash { border-color: var(--orange-500); box-shadow: 0 0 0 3px var(--orange-100); }
.dc-head { display: flex; align-items: center; gap: .75rem; }
.dc-head-text { flex: 1; min-width: 0; display: grid; }
.dc-name { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.dc-name:hover { text-decoration: underline; }
.dc-score { display: inline-flex; align-items: baseline; flex: none; padding: .3rem .55rem; border-radius: 10px; background: var(--orange-500); color: #fff; }
.dc-score strong { font-size: 1.1rem; line-height: 1; }
.dc-score small { font-size: .72rem; opacity: .9; }
.dc-recs { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .6rem; }
.dc-rec { display: flex; gap: .75rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.dc-rec-body { flex: 1; min-width: 0; }
.dc-rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; }
.dc-who { display: inline-flex; align-items: center; gap: .4rem; color: var(--text); text-decoration: none; font-size: .92rem; }
.dc-who .avatar-sm { width: 24px; height: 24px; font-size: .62rem; }
.dc-rating { font-weight: 700; font-size: .85rem; color: var(--orange-600); }
.dc-title { font-weight: 600; margin: .35rem 0 0; }
.dc-note { margin: .3rem 0 0; font-size: .92rem; color: var(--text); overflow-wrap: anywhere; }
.dc-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.dc-tag { border: 0; padding: .15rem .5rem; border-radius: 999px; background: var(--teal-100); color: var(--teal-800); font: inherit; font-size: .78rem; cursor: pointer; }
.dc-tag:hover { background: var(--teal-800); color: #fff; }
.dc-more { display: inline-flex; align-items: center; gap: .3rem; margin-top: .4rem; font-size: .82rem; font-weight: 600; }
.dc-more i { font-size: .7em; }
.dc-thumb { flex: none; width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.dc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-actions { margin-top: .8rem; }
@media (prefers-color-scheme: dark) { .dc-tag { color: #CFE7EA; } }
@media (min-width: 1100px) {
  .dc-body { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .dc-map-col { position: sticky; top: 1rem; }
  .map-discover { height: calc(100vh - 2rem); height: calc(100dvh - 2rem); max-height: 720px; }
  .dc-controls { grid-template-columns: 1fr 1fr; align-items: start; }
  .dc-controls .search-row, .dc-popular { grid-column: 1; }
  .dc-radius { grid-column: 2; grid-row: 1 / span 2; }
  .dc-types-wrap { grid-column: 1 / -1; }
}

/* ---------- v0.7: Activity ---------- */
.act-callout { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--text); }
.act-callout > span:nth-child(2) { flex: 1; display: grid; }
.act-callout > i { color: var(--muted); }
.act-notes { list-style: none; margin: 0; padding: 0; display: grid; }
.act-notes li + li { border-top: 1px solid var(--border); }
.act-notes a { display: flex; align-items: center; gap: .75rem; padding: .65rem .25rem; color: var(--text); text-decoration: none; }
.act-notes a:hover { background: var(--surface-2); border-radius: 8px; }
.act-note-icon { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--teal-100); color: var(--teal-800); }
.act-notes .is-unread .act-note-icon { background: var(--orange-500); color: #fff; }
.act-note-text { flex: 1; min-width: 0; display: grid; }
.act-note-text small { color: var(--muted); font-size: .88rem; }
.act-notes time { flex: none; align-self: flex-start; margin-top: .15rem; }
.act-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.act-pin { margin: 0; display: grid; gap: .6rem; }
.act-pin-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.act-pin-body { display: flex; align-items: flex-start; gap: .75rem; color: var(--text); text-decoration: none; }
.act-pin-text { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.act-pin-text strong { font-size: 1.05rem; }
.act-pin-text small i { font-size: .8em; }
.act-pin-title { font-weight: 600; margin-top: .2rem; }
.act-pin-note { color: var(--text); font-size: .93rem; overflow-wrap: anywhere; }
.act-pin-photo { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); }
.act-pin-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.act-more-photos { position: absolute; right: 8px; bottom: 8px; padding: .2rem .5rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .78rem; }
@media (min-width: 900px) { .act-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* ---------- v0.7: notification settings ---------- */
.push-device { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem;
  padding: .75rem .9rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.push-state { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .92rem; }
[data-push-box][data-state="on"] .push-state i { color: var(--ok); }
[data-push-box][data-state="denied"] .push-state i { color: var(--err); }
.push-device .action-row { margin: 0; }
.notify-form { margin-top: 1.1rem; gap: .2rem; }
.notify-form .label { margin-top: .6rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch-row > span { display: inline-flex; align-items: center; gap: .6rem; font-size: .95rem; }
.switch-row > span i { width: 18px; color: var(--muted); text-align: center; }
.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0;
  border-radius: 999px; background: var(--border); cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 2px; }
.dc-controls .input-group input { border-radius: 0; flex: 1; }
.dc-controls .input-prefix { max-width: none; }
[data-push-box] [hidden], .dc-here[hidden] { display: none !important; }

/* ---------- v0.8: Trips ---------- */
.chip-trip { background: var(--teal-100); color: var(--teal-800); text-decoration: none; font-weight: 600; }
.chip-trip i { color: var(--teal-800); }
@media (prefers-color-scheme: dark) { .chip-trip, .chip-trip i { color: #CFE7EA; } }

.trip-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.trip-card { display: flex; flex-direction: column; height: 100%; padding: 0; overflow: hidden; margin: 0; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.trip-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 42, 46, .12); }
.trip-card-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2); }
.trip-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trip-card-noimg { display: grid; place-items: center; height: 100%; font-size: 2rem; color: var(--teal-700); background: var(--teal-100); }
.trip-card-vis { position: absolute; left: 8px; top: 8px; padding: .2rem .55rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; font-weight: 600; }
.trip-card-text { display: grid; gap: .15rem; padding: .75rem .9rem .9rem; }
.trip-card-text strong { font-size: 1.02rem; }

.trip-suggest-head, .trip-nudge { display: flex; align-items: center; gap: .75rem; }
.trip-suggest-head h2 { font-size: 1.05rem; margin: 0; }
.trip-suggest-head p { margin: .15rem 0 0; font-size: .9rem; }
.trip-suggest-places { margin: .75rem 0; font-size: .92rem; overflow-wrap: anywhere; }
.trip-suggest .action-row form { margin: 0; }
.trip-nudge { flex-wrap: wrap; }
.trip-nudge-text { flex: 1 1 200px; display: grid; }
.trip-nudge .action-row { margin: 0; align-items: center; }
.trip-nudge .action-row form { margin: 0; }

/* form */
.trip-picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .75rem; }
.trip-picker-tools .input-group { flex: 1 1 220px; }
.trip-picker { max-height: 480px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .25rem .75rem .5rem; overscroll-behavior: contain; }
.trip-day { border: 0; margin: 0; padding: .5rem 0 0; }
.trip-day + .trip-day { border-top: 1px solid var(--border); margin-top: .35rem; }
.trip-day legend { padding: 0; margin-bottom: .25rem; }
.trip-day[hidden], .trip-pin[hidden] { display: none; }
.trip-pin { display: flex; align-items: center; gap: .65rem; padding: .45rem .35rem; border-radius: 8px; cursor: pointer; }
.trip-pin:hover { background: var(--surface-2); }
.trip-pin input { width: 20px; height: 20px; flex: none; accent-color: var(--orange-500); }
.trip-pin-text { display: grid; min-width: 0; }
.trip-pin-text strong { font-size: .95rem; overflow-wrap: anywhere; }
.trip-pin-other { color: #8A5A00; font-size: .78rem; }
@media (prefers-color-scheme: dark) { .trip-pin-other { color: #F2C66D; } }
.choice-cards-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .choice-cards-3 { grid-template-columns: repeat(3, 1fr); } }
.cover-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.cover-option { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; border: 3px solid transparent; background: var(--surface-2); }
.cover-option input { position: absolute; opacity: 0; pointer-events: none; }
.cover-option img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-option:has(input:checked) { border-color: var(--orange-500); }
.cover-option:has(input:focus-visible) { outline: 3px solid var(--teal-700); }
.cover-auto span { display: grid; place-items: center; align-content: center; gap: .25rem; height: 100%; color: var(--teal-700); text-align: center; padding: .25rem; }
.cover-auto small { font-size: .72rem; color: var(--muted); }

/* page */
.trip-hero { margin: 0 0 1rem; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; max-height: 420px; background: var(--surface-2); }
.trip-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 639px) { .trip-hero { margin: -1rem -1rem 1rem; border-radius: 0; } }
.trip-kicker { margin: 0; color: var(--orange-600); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.trip-head h1 { margin: .15rem 0 .5rem; overflow-wrap: anywhere; }
.trip-stats { margin-bottom: 1rem; }
.trip-intro { margin-bottom: 1.25rem; }
.trip-section { margin-bottom: 1.25rem; }
.map-trip { height: 320px; }
@media (min-width: 900px) { .map-trip { height: 440px; } }
.route-line { stroke: var(--orange-500); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; fill: none; }
.stop-pin {
  --c: #F0592E; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 800; font-size: .85rem; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.trip-day-title { font-size: .95rem; margin: 1rem 0 .5rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 12px; bottom: 12px; width: 2px; background: var(--border); }
.tl-item { position: relative; display: flex; gap: .85rem; padding-bottom: 1rem; scroll-margin-top: 80px; }
.tl-dot {
  --c: #F0592E; position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 800; font-size: .9rem; border: 3px solid var(--bg);
}
.tl-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .9rem; box-shadow: var(--shadow); }
.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.tl-head > div { display: grid; min-width: 0; }
.tl-name { font-weight: 700; font-size: 1.02rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.tl-name:hover { text-decoration: underline; }
.tl-title { font-weight: 600; margin: .45rem 0 0; }
.tl-note { margin: .35rem 0 0; font-size: .94rem; overflow-wrap: anywhere; }
.tl-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: .6rem; }
.tl-photo { position: relative; display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.tl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-photo-extra { display: none; }
.tl-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-weight: 700; font-size: 1.1rem; }
.trip-stops { margin: 0; padding-left: 1.4rem; display: grid; gap: .35rem; }
.trip-share { margin-top: .5rem; }
.trip-hero { aspect-ratio: auto; height: clamp(200px, 38vw, 420px); max-height: none; }
.tl-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 520px; }
.trip { max-width: 900px; }
.page-head-row .btn { white-space: nowrap; flex: none; }

/* ---------- v0.8.1: trip departure & arrival ---------- */
.trip-end { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem .9rem; margin: .75rem 0; }
.trip-end legend { padding: 0 .35rem; font-weight: 700; display: inline-flex; gap: .45rem; align-items: center; }
.trip-end legend i { color: var(--teal-700); }
.trip-end .form-grid { margin-bottom: .6rem; }
.trip-ends.is-round .end-only { display: none; }
.trip-ends .switch-row { margin: .25rem 0; }
.end-spot-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.end-spot-status i { color: var(--muted); }
.end-spot-status.is-set i { color: var(--ok); }
.end-spot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.end-spot-actions .icon-btn[hidden] { display: none; }
.map-endpick { height: 260px; margin-top: .6rem; }
.map-endpick[hidden], .end-reuse[hidden] { display: none; }
.end-reuse { margin-top: .6rem; }
.stop-end { --c: #0F5560; background: #0F5560; font-size: .8rem; }
.tl-dot-end { background: var(--teal-800); }
.tl-body-end { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .6rem .9rem; background: var(--teal-100); border-color: transparent; box-shadow: none; }
.tl-body-end strong { overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .tl-body-end { color: #E7EEEF; } }
.trip-ends-nudge { margin-bottom: 1rem; }
