/* ═══════════ ROAM · iOS-style design system ═══════════ */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --blue: #E84393; /* primary accent = visited pink */ --green: #34C759; --amber: #FF9F0A; --red: #FF3B30;
  --purple: #E84393; --pink: #FF2D55; --teal: #5AC8FA; --indigo: #5856D6;
  --bg: #F2F2F7; --card: #FFFFFF; --card2: #F7F7FA; --text: #111111;
  --text2: #6B6B70; --text3: #AEAEB2; --sep: rgba(60,60,67,.14);
  --nav-blur: rgba(242,242,247,.82); --tab-blur: rgba(250,250,252,.86);
  --shadow: 0 6px 24px rgba(0,0,0,.08);
  --radius: 18px; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --map-water: #B7D7EE; --map-land: #ECEAE2; --map-stroke: #FFFFFF;
  --map-visited: #2ECC71; --map-wish: #F59E0B; --map-home: #9333EA;
}
html[data-theme="dark"] {
  --bg: #000000; --card: #1C1C1E; --card2: #2C2C2E; --text: #F5F5F7;
  --text2: #9A9AA0; --text3: #5A5A60; --sep: rgba(255,255,255,.14);
  --nav-blur: rgba(0,0,0,.78); --tab-blur: rgba(24,24,26,.88);
  --shadow: 0 6px 24px rgba(0,0,0,.5);
  --map-water: #0B2239; --map-land: #2E2E33; --map-stroke: #000000;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #000000; --card: #1C1C1E; --card2: #2C2C2E; --text: #F5F5F7;
    --text2: #9A9AA0; --text3: #5A5A60; --sep: rgba(255,255,255,.14);
    --nav-blur: rgba(0,0,0,.78); --tab-blur: rgba(24,24,26,.88);
    --shadow: 0 6px 24px rgba(0,0,0,.5);
    --map-water: #0B2239; --map-land: #2E2E33; --map-stroke: #000000;
  }
}
html, body { height: 100%; }
body {
  margin: 0; background: #0d1520; color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
#app {
  position: relative; max-width: 480px; margin: 0 auto; height: 100dvh;
  background: var(--bg); overflow: hidden; display: flex; flex-direction: column;
}
@media (min-width: 520px) {
  body { background: radial-gradient(1200px 800px at 20% -10%, #12395e 0%, #0d1520 55%) fixed; }
  #app { height: calc(100dvh - 32px); margin-top: 16px; border-radius: 36px;
    box-shadow: 0 30px 80px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.08); }
}

/* ── Views ── */
#views { flex: 1; position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 110px; display: none; scrollbar-width: none; }
.view.active { display: block; animation: fadeUp .25s ease; }
.view::-webkit-scrollbar { display: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

/* ── Nav ── */
.nav { position: sticky; top: 0; z-index: 20; padding: calc(10px + var(--sat)) 20px 8px;
  background: var(--nav-blur); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6); }
.nav-small { display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .08em; }
.nav-actions { display: flex; gap: 8px; }
.nav-large { margin: 2px 0 8px; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.stat-pill { display: inline-block; font-size: 13px; font-weight: 600; color: var(--blue);
  background: rgba(232,67,147,.13); padding: 6px 12px; border-radius: 999px; margin-bottom: 6px; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--card2); color: var(--text); display: grid; place-items: center;
  box-shadow: inset 0 0 0 .5px var(--sep); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.accent { background: var(--blue); color: #fff; }
.icon-btn:active { transform: scale(.93); }

/* ── Chips ── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  background: var(--card); color: var(--text); box-shadow: inset 0 0 0 .5px var(--sep); cursor: pointer; }
.chip.active { background: var(--text); color: var(--bg); }

/* ── Map ── */
.map-wrap { position: relative; margin: 0 12px; border-radius: 22px; overflow: hidden;
  background: var(--map-water); box-shadow: var(--shadow); touch-action: none; }
#world { display: block; width: 100%; height: auto; aspect-ratio: 2/1; cursor: grab; }
#world:active { cursor: grabbing; }
#world path.land { fill: var(--map-land); stroke: var(--map-stroke); stroke-width: 1px; vector-effect: non-scaling-stroke; transition: fill .2s; }
#world path.land.visited { fill: var(--map-visited); }
#world path.land.wishlist { fill: var(--map-wish); }
#world path.land.home { fill: var(--map-home); }
#world path.land.dim { opacity: .25; }
#world path.land.tapped { stroke: var(--blue); stroke-width: 2px; }
#world circle.dot { stroke: var(--map-stroke); stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: pointer; }
#world circle.dot.hot { stroke-width: 3px; }
.map-controls { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-btn { width: 34px; height: 34px; border: 0; border-radius: 11px; font-size: 20px; font-weight: 600;
  background: var(--card); color: var(--text); box-shadow: var(--shadow); cursor: pointer;
  display: grid; place-items: center; line-height: 1; }
.map-btn svg { width: 17px; height: 17px; }
.map-btn:active { transform: scale(.92); }
.map-legend { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.92); color: #111; padding: 5px 9px; border-radius: 999px; }
html[data-theme="dark"] .legend-item { background: rgba(28,28,30,.92); color: #f5f5f7; }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .legend-item { background: rgba(28,28,30,.92); color: #f5f5f7; } }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.map-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.45);
  padding: 6px 12px; border-radius: 999px; pointer-events: none; transition: opacity .4s;
  backdrop-filter: blur(6px); white-space: nowrap; }
.map-hint.hide { opacity: 0; }

/* ── Sections / strips ── */
.section-head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 8px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.link-btn { border: 0; background: none; color: var(--blue); font-size: 15px; font-weight: 600; cursor: pointer; }
.flag-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 20px 6px; scrollbar-width: none; }
.flag-strip::-webkit-scrollbar { display: none; }
.flag-card { flex: none; width: 86px; background: var(--card); border-radius: 16px; padding: 10px 6px 8px;
  text-align: center; box-shadow: inset 0 0 0 .5px var(--sep); cursor: pointer; }
.flag-card:active { transform: scale(.95); }
.flag-card .f { font-size: 34px; line-height: 1.2; }
.flag-card .n { font-size: 11px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag-card .s { font-size: 10px; color: var(--text2); }
.empty-note { margin: 4px 20px; padding: 16px; text-align: center; color: var(--text2); font-size: 14px;
  background: var(--card); border-radius: var(--radius); box-shadow: inset 0 0 0 .5px var(--sep); }

/* ── Cards / lists ── */
.card { background: var(--card); border-radius: var(--radius); margin: 10px 16px; padding: 16px;
  box-shadow: inset 0 0 0 .5px var(--sep); }
.card h3 { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.row-list { background: var(--card); border-radius: var(--radius); margin: 10px 16px; overflow: hidden;
  box-shadow: inset 0 0 0 .5px var(--sep); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.row + .row { border-top: 1px solid var(--sep); }
.row:active { background: var(--card2); }
.row .flag { font-size: 30px; flex: none; width: 44px; text-align: center; line-height: 1.3; }
.row .grow { flex: 1; min-width: 0; }
.row .t1 { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--text3); font-size: 18px; font-weight: 600; }
.pill { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; flex: none; }
.pill.v { background: rgba(52,199,89,.15); color: #1d9e45; }
.pill.w { background: rgba(255,159,10,.16); color: #d97e00; }
.pill.h { background: rgba(232,67,147,.15); color: var(--purple); }
html[data-theme="dark"] .pill.v { color: #4cd964; } html[data-theme="dark"] .pill.w { color: #ffb340; }

/* ── Trip cards ── */
.trip-card { margin: 10px 16px; border-radius: 22px; overflow: hidden; background: var(--card);
  box-shadow: var(--shadow); cursor: pointer; }
.trip-card:active { transform: scale(.985); }
.trip-cover { height: 118px; position: relative; display: flex; align-items: flex-end; padding: 12px 14px;
  color: #fff; background-size: cover; background-position: center; }
.trip-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.55)); }
.trip-cover > div { position: relative; z-index: 1; }
.trip-cover .tt { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.trip-cover .td { font-size: 12.5px; font-weight: 600; opacity: .92; }
.trip-body { padding: 12px 14px 14px; }
.trip-flags { font-size: 21px; letter-spacing: 1px; }
.trip-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.meta-chip { font-size: 12px; font-weight: 600; background: var(--card2); color: var(--text2);
  padding: 5px 10px; border-radius: 999px; }
.year-label { padding: 16px 22px 2px; font-size: 13px; font-weight: 800; color: var(--text2);
  text-transform: uppercase; letter-spacing: .08em; }

/* ── Tab bar ── */
#tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 8px 8px calc(14px + var(--sab));
  background: var(--tab-blur); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-top: .5px solid var(--sep); }
.tab { border: 0; background: none; color: var(--text3); display: flex; flex-direction: column;
  align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; cursor: pointer; min-width: 62px; }
.tab svg { width: 25px; height: 25px; }
.tab.active { color: var(--blue); }
#fab { width: 56px; height: 56px; border: 0; border-radius: 50%; margin-top: -26px; cursor: pointer;
  background: linear-gradient(135deg, #FF2D55, #E84393); box-shadow: 0 10px 24px rgba(255,45,85,.42);
  display: grid; place-items: center; }
#fab svg { width: 26px; height: 26px; }
#fab:active { transform: scale(.92); }

/* ── Sheet ── */
#sheet-backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s; }
#sheet-backdrop.open { opacity: 1; pointer-events: auto; }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92%;
  background: var(--bg); border-radius: 24px 24px 0 0; transform: translateY(105%);
  transition: transform .32s cubic-bezier(.32,.9,.35,1); display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
#sheet.open { transform: none; }
#sheet-grip { padding: 10px; display: grid; place-items: center; cursor: grab; flex: none; }
#sheet-grip span { width: 40px; height: 5px; border-radius: 999px; background: var(--text3); opacity: .6; }
#sheet-content { overflow-y: auto; padding: 0 0 calc(30px + var(--sab)); scrollbar-width: none; }
#sheet-content::-webkit-scrollbar { display: none; }
.sheet-head { padding: 2px 22px 12px; display: flex; align-items: flex-start; gap: 12px; }
.sheet-head .grow { flex: 1; }
.sheet-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.sheet-head p { margin: 4px 0 0; font-size: 14px; color: var(--text2); }
.sheet-x { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--card2); color: var(--text2); font-size: 16px; line-height: 1; }

/* ── Forms ── */
.field { margin: 10px 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: .05em; margin: 0 6px 6px; }
.input, .textarea, .select { width: 100%; border: 0; border-radius: 14px; padding: 13px 14px;
  font-size: 16px; font-family: inherit; background: var(--card); color: var(--text);
  box-shadow: inset 0 0 0 .5px var(--sep); outline: none; }
.input:focus, .textarea:focus, .select:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.textarea { min-height: 84px; resize: vertical; }
select.input { appearance: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 16px; }
.grid2 .field { margin: 0; }

/* Segmented */
.seg { display: flex; background: var(--card2); border-radius: 13px; padding: 3px; margin: 6px 16px;
  box-shadow: inset 0 0 0 .5px var(--sep); }
.seg button { flex: 1; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--text2);
  padding: 9px 4px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* Buttons */
.btn { display: block; width: calc(100% - 32px); margin: 10px 16px; border: 0; border-radius: 16px;
  padding: 15px; font-size: 17px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(232,67,147,.35); }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: var(--card); color: var(--blue); box-shadow: inset 0 0 0 .5px var(--sep); }
.btn.danger-ghost { background: var(--card); color: var(--red); box-shadow: inset 0 0 0 .5px var(--sep); }
.btn:active { transform: scale(.98); }
.btn-row { display: flex; gap: 10px; margin: 10px 16px; }
.btn-row .btn { margin: 0; flex: 1; }

/* Stars */
.stars { display: flex; gap: 4px; padding: 4px 6px; }
.stars button { border: 0; background: none; font-size: 30px; cursor: pointer; color: var(--text3); line-height: 1; }
.stars button.on { color: var(--amber); }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 14px;
  padding: 10px 14px; box-shadow: inset 0 0 0 .5px var(--sep); }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; font-size: 20px; font-weight: 700;
  background: var(--card2); color: var(--blue); cursor: pointer; }
.stepper b { font-size: 18px; min-width: 30px; text-align: center; }

/* Date chips / city rows */
.date-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 6px; }
.date-chip { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px;
  padding: 7px 8px 7px 12px; font-size: 13.5px; font-weight: 600; box-shadow: inset 0 0 0 .5px var(--sep); }
.date-chip button { border: 0; background: var(--card2); color: var(--text2); width: 22px; height: 22px;
  border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; }
.inline-add { display: flex; gap: 8px; margin-top: 8px; }
.inline-add .input { flex: 1; }
.inline-add .btn { width: auto; margin: 0; padding: 12px 18px; font-size: 15px; }
.city-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px;
  padding: 10px 12px; margin-top: 8px; box-shadow: inset 0 0 0 .5px var(--sep); font-size: 15px; font-weight: 600; }
.city-row small { display: block; font-weight: 400; color: var(--text2); font-size: 12.5px; }
.city-suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 216px; overflow-y: auto; }
.city-suggest:empty { display: none; }
#cv-date { max-width: 126px; flex: none; }
#cv-q { min-width: 0; }
.cityshape { cursor: pointer; }
.city-row .del { margin-left: auto; border: 0; background: rgba(255,59,48,.12); color: var(--red);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; }

/* Country hero */
.country-hero { text-align: center; padding: 6px 20px 4px; }
.country-hero .big-flag { font-size: 76px; line-height: 1.1; filter: drop-shadow(0 8px 16px rgba(0,0,0,.18)); }
.country-hero h2 { margin: 8px 0 2px; font-size: 26px; font-weight: 800; }
.country-hero p { margin: 0; color: var(--text2); font-size: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 16px; }
.stat-tile { background: var(--card); border-radius: 14px; padding: 10px 6px; text-align: center;
  box-shadow: inset 0 0 0 .5px var(--sep); }
.stat-tile b { display: block; font-size: 15px; }
.stat-tile span { font-size: 11px; color: var(--text2); font-weight: 600; }

/* Passport */
.pass-head { margin: 10px 16px; border-radius: 24px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #FF2D55, #E84393 55%, #7D2AE8); box-shadow: var(--shadow); }
.pass-head::before { content: "✈"; position: absolute; right: -10px; top: -30px; font-size: 150px; opacity: .18; transform: rotate(15deg); }
.avatar { width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.25); backdrop-filter: blur(4px);
  display: grid; place-items: center; font-size: 24px; font-weight: 800; border: 2px solid rgba(255,255,255,.5); }
.pass-name { font-size: 23px; font-weight: 800; margin: 10px 0 2px; }
.pass-sub { font-size: 13.5px; opacity: .92; font-weight: 600; }
.level-bar { margin-top: 12px; background: rgba(255,255,255,.25); border-radius: 999px; height: 8px; overflow: hidden; }
.level-bar i { display: block; height: 100%; background: #fff; border-radius: 999px; transition: width .5s; }
.level-row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 6px; opacity: .95; }
.pass-actions { display: flex; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.pass-actions button { flex: 1; border: 0; border-radius: 13px; padding: 11px 6px; font-size: 14px; font-weight: 700;
  background: rgba(255,255,255,.22); color: #fff; cursor: pointer; }
.pass-actions button.solid { background: #fff; color: #7D2AE8; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 16px; }
.stat-box { background: var(--card); border-radius: 16px; padding: 12px 4px; text-align: center;
  box-shadow: inset 0 0 0 .5px var(--sep); }
.stat-box b { display: block; font-size: 17px; }
.stat-box span { font-size: 10.5px; color: var(--text2); font-weight: 600; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; font-size: 13px; font-weight: 600; }
.bar-row .bl { width: 88px; flex: none; }
.bar-row .bv { width: 44px; flex: none; text-align: right; color: var(--text2); }
.bar-track { flex: 1; height: 9px; background: var(--card2); border-radius: 999px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pink), var(--purple)); }
.rg-row { margin-top: 8px; }
.rg-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.seg button:disabled { opacity: .8; cursor: default; }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { text-align: center; cursor: pointer; }
.badge .bi { font-size: 34px; line-height: 1.25; filter: drop-shadow(0 3px 6px rgba(0,0,0,.15)); }
.badge.locked { opacity: .32; filter: grayscale(1); }
.badge .bn { font-size: 10px; font-weight: 700; margin-top: 2px; }
.persona { display: flex; gap: 12px; align-items: center; }
.persona .pe { font-size: 44px; }
.persona b { font-size: 17px; }
.persona p { margin: 3px 0 0; font-size: 13px; color: var(--text2); }
.timeline-bar { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding-top: 8px; }
.timeline-bar .tb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.timeline-bar .tb i { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--pink), var(--purple)); min-height: 4px; }
.timeline-bar .tb span { font-size: 9.5px; font-weight: 700; color: var(--text2); }

/* Settings rows */
.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.set-row + .set-row { border-top: 1px solid var(--sep); }
.set-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: none; }
.set-row .grow { flex: 1; } .set-row .t1 { font-size: 16px; font-weight: 600; } .set-row .t2 { font-size: 13px; color: var(--text2); }
.toggle { width: 51px; height: 31px; border-radius: 999px; border: 0; background: var(--card2); position: relative; cursor: pointer;
  box-shadow: inset 0 0 0 .5px var(--sep); flex: none; }
.toggle::after { content: ""; position: absolute; top: 2.5px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: left .2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 22px; }

/* Search */
.search-box { margin: 4px 16px 8px; position: relative; }
.search-box .input { border-radius: 14px; }
/* magnifier removed — plain search field */
.search-results { max-height: 46vh; overflow-y: auto; }

/* Quick-add grid */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 16px; }
.qa { border: 0; border-radius: 18px; padding: 18px 12px; cursor: pointer; color: #fff; text-align: center; }
.qa .qe { font-size: 32px; } .qa b { display: block; margin-top: 6px; font-size: 15px; }
.qa small { font-size: 12px; opacity: .9; }

/* Toast */
#toast { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,22,.92); color: #fff; font-size: 14px; font-weight: 600; padding: 11px 18px;
  border-radius: 999px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60;
  max-width: 86%; text-align: center; backdrop-filter: blur(8px); }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* Onboarding */
#onboarding { position: absolute; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(20px + var(--sat)) 24px calc(24px + var(--sab)); overflow-y: auto; }
#onboarding[hidden] { display: none; }
.ob-hero { text-align: center; padding: 26px 0 10px; }
.ob-hero .oe { font-size: 84px; }
.ob-hero h1 { font-size: 32px; font-weight: 800; margin: 12px 0 6px; letter-spacing: -.02em; }
.ob-hero p { color: var(--text2); font-size: 16px; margin: 0 auto; max-width: 320px; line-height: 1.45; }
.ob-dots { display: flex; gap: 7px; justify-content: center; margin: 18px 0; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); opacity: .4; }
.ob-dots i.on { opacity: 1; background: var(--blue); width: 22px; border-radius: 999px; transition: all .25s; }
.ob-card { background: var(--card); border-radius: 20px; padding: 18px; margin-top: 14px;
  box-shadow: inset 0 0 0 .5px var(--sep); }
.ob-feat { display: flex; gap: 12px; align-items: center; padding: 9px 0; font-size: 15px; font-weight: 600; }
.ob-feat span { font-size: 26px; }
.ob-feat small { display: block; font-weight: 400; color: var(--text2); font-size: 13px; }

/* Compare */
.vs-row { display: flex; align-items: center; gap: 10px; text-align: center; margin: 6px 16px; }
.vs-card { flex: 1; background: var(--card); border-radius: 16px; padding: 14px 8px; box-shadow: inset 0 0 0 .5px var(--sep); }
.vs-card b { font-size: 26px; display: block; } .vs-card span { font-size: 12px; color: var(--text2); font-weight: 600; }
.vs-badge { font-size: 15px; font-weight: 800; color: #fff; background: var(--purple); border-radius: 50%;
  width: 40px; height: 40px; display: grid; place-items: center; flex: none; }

/* Share preview */
.share-preview { margin: 6px 16px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.share-preview canvas { width: 100%; display: block; }

/* Color dots */
.color-dots { display: flex; gap: 10px; padding: 4px 6px; }
.color-dots button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-dots button.on { border-color: var(--text); }

/* multi country picker */
.pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; }
.pick-row + .pick-row { border-top: 1px solid var(--sep); }
.pick-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--text3); flex: none;
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; }
.pick-row.sel .pick-check { background: var(--blue); border-color: var(--blue); }

/* photo */
.photo-pick { height: 130px; border-radius: 16px; margin: 6px 16px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px dashed var(--text3); display: grid; place-items: center; cursor: pointer;
  color: var(--text2); font-weight: 600; font-size: 15px; overflow: hidden; background-size: cover; background-position: center; }
.photo-pick.has { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); box-shadow: none; }

.hidden { display: none !important; }
.muted { color: var(--text2); } .small { font-size: 13px; }
.center { text-align: center; } .mt { margin-top: 14px; }

/* ── Map-first fullscreen ── */
#view-map { padding-bottom: 0; overflow: hidden; }
#view-map .map-wrap { position: absolute; inset: 0; margin: 0; border-radius: 0; box-shadow: none; }
#view-map #world { position: absolute; left: 0; top: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.map-top { position: absolute; top: calc(10px + var(--sat)); left: 12px; right: 12px; display: flex; gap: 8px; z-index: 6; }
.search-pill { flex: 1; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 999px; padding: 0 17px; height: 48px; font-size: 15.5px; font-family: inherit; color: var(--text2); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); cursor: pointer; }
.search-pill svg { width: 19px; height: 19px; flex: none; }
.search-pill:active { transform: scale(.98); }
.icon-btn.frost { background: rgba(255,255,255,.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); width: 48px; height: 48px; flex: none; }
.chips.floating { position: absolute; top: calc(68px + var(--sat)); left: 0; right: 0; z-index: 6; padding: 4px 12px 10px; }
.chips.floating .chip { background: rgba(255,255,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.chips.floating .chip.active { background: var(--text); color: var(--bg); }
#view-map .map-hint { top: calc(122px + var(--sat)); }
.map-bottom-left { position: absolute; left: 12px; bottom: calc(96px + var(--sab)); z-index: 6; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.map-bottom-left .stat-pill { margin: 0; background: rgba(255,255,255,.94); color: var(--text); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.map-bottom-left .map-legend { position: static; }
#view-map .map-controls { top: auto; right: 12px; bottom: calc(96px + var(--sab)); }
#view-map .map-controls .map-btn { width: 42px; height: 42px; border-radius: 13px; }
html[data-theme="dark"] .search-pill { background: rgba(28,28,30,.92); color: #9A9AA0; }
html[data-theme="dark"] .icon-btn.frost { background: rgba(28,28,30,.92); color: #f5f5f7; }
html[data-theme="dark"] .chips.floating .chip:not(.active) { background: rgba(28,28,30,.92); color: #f5f5f7; }
html[data-theme="dark"] .map-bottom-left .stat-pill { background: rgba(28,28,30,.94); color: #f5f5f7; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .search-pill { background: rgba(28,28,30,.92); color: #9A9AA0; }
  html[data-theme="system"] .icon-btn.frost { background: rgba(28,28,30,.92); color: #f5f5f7; }
  html[data-theme="system"] .chips.floating .chip:not(.active) { background: rgba(28,28,30,.92); color: #f5f5f7; }
  html[data-theme="system"] .map-bottom-left .stat-pill { background: rgba(28,28,30,.94); color: #f5f5f7; }
}

/* ── Bucket list ── */
.type-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:4px 0 6px}
.type-btn{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 6px 14px;border-radius:20px;border:1.5px solid var(--sep);background:var(--card2);color:var(--text);font-size:14px;cursor:pointer}
.type-btn span{font-size:32px}
.type-btn:active{transform:scale(.96)}
.kind-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:2px 0 12px}
.kind-btn{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px;border-radius:14px;border:1.5px solid var(--sep);background:transparent;color:var(--text);font-size:11px;cursor:pointer;opacity:.7}
.kind-btn span{font-size:24px}
.kind-btn.on{border-color:#E84393;background:rgba(232,67,147,.08);opacity:1}
.done-row{opacity:.62}

/* ── City dot labels ── */

.osm-credit{font-size:9px;opacity:.55}
