/* Shell additions: Location menu, notification bell, first-run country map,
   phone home (full map + pull-up list), push settings, member search, and the
   phone pass (touch targets, keyboard). Same soft language as app.css. */

:root { --top-h: 57px; --tab-h: calc(66px + env(safe-area-inset-bottom)); }

/* avatars: the Nearily photo sits over the initial */
.avatar { position: relative; flex: none; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--surface-alt); }
.topav { padding: 0; }

/* ---------- Location ---------- */
.loc { position: relative; }
.loc-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
}
.loc-btn:hover { background: var(--surface-alt); }
.loc-btn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.loc-globe, .loc-chev { display: grid; place-items: center; color: var(--ink-2); }
.loc-globe svg { width: 18px; height: 18px; }
.loc-chev svg { width: 14px; height: 14px; }
.loc-flag { display: grid; place-items: center; }
.flag { width: 22px; height: 15px; display: block; flex: none; }
.loc-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 260px; padding: 6px; box-shadow: var(--shadow-lg);
  animation: pop .14s ease;
}
.loc-h { padding: 8px 10px 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.loc-opt {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border: 0; border-radius: 12px;
  background: none; cursor: pointer; text-align: left; font-weight: 600;
}
.loc-opt .flag { width: 27px; height: 18px; }
.loc-opt .nm { flex: 1; }
.loc-opt .ck { width: 18px; color: var(--brand-text); display: grid; place-items: center; }
.loc-opt .ck svg { width: 18px; height: 18px; }
.loc-opt:hover, .loc-opt:focus-visible { background: var(--surface-alt); outline: none; }
.loc-opt[aria-selected="true"] { background: var(--brand-soft); }
.loc-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.loc-world .loc-globe { width: 27px; color: var(--ink-2); }
.loc-world .loc-globe svg { width: 20px; height: 20px; }
/* Leaving for the world map without a MapLibre map to fly: the shell shrinks away under the picker. */
.shell.world-out { transform: scale(.96); opacity: 0; transition: transform .4s ease, opacity .4s ease; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .shell.world-out { transition: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- bell ---------- */
.bellbtn { position: relative; background: transparent; color: var(--ink-2); }
.bellbtn:hover { background: var(--line); color: var(--ink); }
.bellbtn svg { width: 22px; height: 22px; }
.bbadge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1;
  border: 2px solid var(--canvas);
}
.bell-scrim { position: fixed; inset: 0; z-index: 54; }
.bell-panel {
  position: fixed; z-index: 55; top: calc(var(--top-h) + 6px); right: 16px; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 640px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .14s ease;
}
.bell-h { display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.bell-h h2 { flex: 1; font-size: 17px; }
.bell-grab { display: none; }
.bell-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.bell-item {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 10px; min-height: 56px; border: 0; background: none;
  border-radius: 12px; cursor: pointer; text-align: left; color: var(--ink);
}
.bell-item:hover { background: var(--surface-alt); }
.bell-item .bi-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.bell-item.k-cafe .bi-ic { background: color-mix(in srgb, var(--s-won) 16%, transparent); color: color-mix(in srgb, var(--s-won) 80%, var(--ink)); }
.bell-item.k-mail .bi-ic { background: color-mix(in srgb, var(--s-replied) 14%, transparent); color: var(--s-replied); }
.bell-item.k-news .bi-ic { background: color-mix(in srgb, var(--warning) 16%, transparent); color: color-mix(in srgb, var(--warning) 80%, var(--ink)); }
.bell-item .bi-ic svg { width: 18px; height: 18px; }
.bell-item .bi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bell-item .bi-head { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.bell-item.unread .bi-head { color: var(--ink); font-weight: 600; }
.bell-item .bi-sub { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bell-item .bi-at { font-size: 12px; color: var(--ink-3); }
.bell-item .bi-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; margin-top: 6px; }

/* ---------- first run ---------- */
.onb { position: fixed; inset: 0; z-index: 80; background: var(--canvas); opacity: 0; transition: opacity .5s ease; }
.onb.in { opacity: 1; }
.onb.out { opacity: 0; transition-duration: .3s; }
.onb .onb-map { position: absolute; inset: 0; }
.onb-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; gap: 14px; align-items: flex-start;
  padding: calc(18px + env(safe-area-inset-top)) 20px 36px;
  background: linear-gradient(var(--canvas) 55%, color-mix(in srgb, var(--canvas) 0%, transparent));
  pointer-events: none;
}
.onb-top img { width: 44px; height: 44px; border-radius: 13px; flex: none; }
.onb-top h1 { font-size: 26px; }
.onb-top p { margin: 6px 0 0; color: var(--ink-2); max-width: 520px; }
.onb-cards {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 2;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(640px, calc(100vw - 32px));
}
.onb-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; min-height: 96px; cursor: pointer;
  font: inherit; color: inherit; text-align: left; box-shadow: var(--shadow-lg); transition: transform .15s ease, outline-color .15s;
}
.onb-card .flag { width: 33px; height: 22px; }
.onb-card .nm { font-weight: 700; font-size: 16px; }
.onb-card:hover { transform: translateY(-2px); }
.onb-card.sel { outline: 2px solid var(--brand); outline-offset: -1px; }
@media (prefers-reduced-motion: reduce) { .onb { transition: none; } }
.onb .maplibregl-ctrl-bottom-right { bottom: 130px; }
/* Five countries: the cards take two rows on narrow screens. */
@media (max-width: 900px) { .onb .maplibregl-ctrl-bottom-right { bottom: 250px; } }
@media (max-width: 600px) {
  .onb-card { padding: 10px 12px; min-height: 0; gap: 4px; }
  .onb-card .nm { font-size: 15px; line-height: 1.2; }
  .onb .maplibregl-ctrl-bottom-right { bottom: 270px; }
}

/* ---------- iPhone: add to Home Screen ---------- */
.a2hs { display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px 12px 14px; border-radius: var(--r-lg); }
.a2hs-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.a2hs-ic svg { width: 20px; height: 20px; }
.a2hs-t { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.a2hs-t span { color: var(--ink-2); }
.mappane .a2hs { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 3; box-shadow: var(--shadow-lg); }
.pushrow .a2hs, #pushstate .a2hs { box-shadow: none; background: var(--surface-alt); border: 0; }

/* ---------- home ---------- */
.cview .listpane { order: -1; }
.lp-drag { display: none; }

/* ---------- settings ---------- */
.prof { display: flex; gap: 14px; align-items: center; }
.prof-av { width: 64px; height: 64px; font-size: 24px; cursor: default; }
.prof-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.prof-t h3 { font-size: 18px; overflow-wrap: anywhere; }
.prof-note { font-size: 13px; color: var(--ink-2); background: var(--surface-alt); border-radius: 12px; padding: 10px 12px; }
.prof-note b { color: var(--ink); font-weight: 600; }
.pushrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-alt); }
.pushrow .ptxt { flex: 1; min-width: 160px; font-weight: 600; font-size: 14px; }
.pushrow .pdot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; }
.pushrow.on .pdot { background: var(--success); }
.pushrow.denied .pdot { background: var(--danger); }
.pushrow .btn svg { width: 16px; height: 16px; }
.toggles { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tgl { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px; cursor: pointer; border-top: 1px solid var(--line); font-weight: 500; color: var(--ink); font-size: 15px; }
.tgl:first-child { border-top: 0; }
.tgl > span { flex: 1; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl i { width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.tgl i::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,.2); transition: transform .15s; }
.tgl input:checked + i { background: var(--success); }
.tgl input:checked + i::after { transform: translateX(18px); }
.tgl input:focus-visible + i { box-shadow: 0 0 0 4px var(--brand-soft); }
.tgl input:disabled + i { opacity: .5; }

/* member search */
.addm { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-alt); margin-top: 6px; }
.ac-box { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; padding: 6px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.ac-row {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px; border: 0; border-radius: 12px;
  background: none; text-align: left; cursor: pointer; color: var(--ink);
}
.ac-row:hover:not(:disabled), .ac-row.on { background: var(--brand-soft); }
.ac-row:disabled { cursor: default; opacity: .6; }
.ac-av { width: 36px; height: 36px; font-size: 14px; cursor: default; }
.ac-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-empty { padding: 12px; }
.ac-picked .ac-row { background: var(--surface); border: 1px solid var(--line); cursor: default; }

/* ---------- push nudge (banner) + bell row ---------- */
.pnudge {
  position: fixed; z-index: 38; top: calc(var(--top-h) + 12px); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px;
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: nudgein .28s cubic-bezier(.2, .8, .2, 1);
}
.pn-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.pn-ic svg { width: 20px; height: 20px; }
.pnudge.denied .pn-ic { background: var(--surface-alt); color: var(--ink-2); }
.pn-t { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.pnudge.denied .pn-t { font-weight: 500; color: var(--ink-2); }
.pn-on { flex: none; }
.pn-x { width: 36px; height: 36px; background: transparent; color: var(--ink-3); }
.pn-x:hover { background: var(--line); color: var(--ink); }
.pn-x svg { width: 16px; height: 16px; }
@keyframes nudgein { from { opacity: 0; transform: translate(-50%, -8px); } }
.bell-push { display: flex; align-items: center; gap: 12px; margin: 6px 6px 0; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--brand-soft); }
.bell-push .bi-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--brand-text); }
.bell-push .bi-ic svg { width: 18px; height: 18px; }
.bell-push .bp-t { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .pnudge { animation: none; } }

/* team list: Team ⇄ Ambassador switch */
.role-seg { flex: none; }
.role-seg button { white-space: nowrap; }
.role-seg button:disabled { opacity: .6; cursor: default; }
@media (max-width: 420px) { .member { flex-wrap: wrap; } .role-seg { margin-left: 52px; } }

/* ---------- phones ---------- */
@media (pointer: coarse) {
  .btn.sm { min-height: 44px; }
  .filters .input { min-height: 44px; }
  .iconbtn.sm-ic { width: 44px; height: 44px; }
  .cc-switch button { min-height: 40px; padding: 0 14px; }
  .brand { min-height: 44px; }
}
@media (max-width: 760px) {
  :root { --top-h: 61px; }
  .topbar { gap: 8px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .brand span { display: none; }
  .brand img { width: 34px; height: 34px; }
  .topav { width: 44px; height: 44px; }
  .loc-btn { padding: 0 10px; gap: 6px; }
  .loc-menu { position: fixed; top: calc(var(--top-h) + env(safe-area-inset-top) + 4px); right: 12px; left: auto; width: min(300px, calc(100vw - 24px)); }
  .bell-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 82dvh; border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation: slideup .22s cubic-bezier(.2, .8, .2, 1);
  }
  .bell-scrim { background: rgba(0, 0, 0, .32); }
  .bell-h { position: relative; padding-top: 22px; }
  .bell-grab { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--line-2); }

  /* six tabs fit a 375 px screen */
  .tabbar { padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { min-width: 0; font-size: 10.5px; padding: 7px 0 6px; }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .fab { width: 56px; height: 56px; padding: 0; justify-content: center; }
  .fab span { display: none; }
  .fab svg { width: 24px; height: 24px; }

  /* cafes, map pane: full-screen map + pull-up list */
  body[data-view="cafes"][data-pane="map"] main { padding: 0; }
  body[data-view="cafes"][data-pane="map"] .fab { display: none; }
  .cview[data-pane="map"] { position: fixed; top: calc(var(--top-h) + env(safe-area-inset-top)); left: 0; right: 0; bottom: var(--tab-h); display: block; height: auto; gap: 0; overflow: hidden; }
  .cview[data-pane="map"] .panes { position: absolute; inset: 0; display: block; }
  .cview[data-pane="map"] .pane-bar { position: absolute; top: 10px; left: 10px; right: auto; z-index: 2; margin: 0; }
  .cview[data-pane="map"] .pane-title { display: none; }
  .cview[data-pane="map"] .mappane { position: absolute; inset: 0; height: auto !important; border-radius: 0; border: 0; box-shadow: none; display: block !important; }
  .cview[data-pane="map"] .listpane {
    position: absolute; left: 0; right: 0; bottom: 0; top: 6px; z-index: 4; display: flex !important; flex-direction: column; overflow: hidden;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; border-bottom: 0; box-shadow: 0 -6px 28px rgba(31, 38, 135, .14);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1); will-change: transform;
  }
  .cview[data-pane="map"] .listpane[data-snap="peek"] { transform: translateY(calc(100% - 82px)); }
  .cview[data-pane="map"] .listpane[data-snap="half"] { transform: translateY(48%); }
  .cview[data-pane="map"] .listpane.dragging { transition: none; }
  .cview[data-pane="map"] .listpane[data-snap="half"] .scroll { padding-bottom: 46dvh; }
  .cview[data-pane="map"] .listpane .head { padding: 4px 14px 10px; }
  .cview[data-pane="map"] .scroll { overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .cview[data-pane="map"] .lp-drag { display: block; height: 76px; padding: 8px 14px 0; touch-action: none; cursor: grab; flex: none; }
  /* list / board panes: the left column folds to cards + filters; the pane stacks below */
  .cview:not([data-pane="map"]) .lp-toggle { display: inline-flex; }
  .cview:not([data-pane="map"]):not(.lp-open) .scroll { display: none; }
  .cview:not([data-pane="map"]) .listpane .head { border-bottom: 0; }
  .cview:not([data-pane="map"]) .pane-bar { margin: 14px 0 10px; }
  .cview:not([data-pane="map"]) .panes .tbl { overflow: visible; }
  .lp-drag:focus-visible { outline: none; background: var(--surface-alt); }
  .lp-drag .grab { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 0 auto 10px; }
  .lp-sum { display: flex; align-items: center; gap: 12px; }
  .lp-flag .flag { width: 30px; height: 20px; }
  .lp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .lp-t b { font-size: 17px; }
  .lp-add { flex: none; }
  .lp-add svg { width: 16px; height: 16px; }
  .cview[data-pane="map"] .listpane #cnt { display: none; }
  .filters .search { flex-basis: 100%; min-width: 0; }
  .filters select.input { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .mappane .a2hs { top: 10px; }

  /* push nudge sits just above the tab bar; the + button and toasts make room */
  .pnudge { top: auto; bottom: calc(var(--tab-h) + 10px); left: 12px; right: 12px; width: auto; transform: none; animation-name: nudgeup; }
  html.has-nudge .fab { bottom: calc(var(--tab-h) + 20px + var(--nudge-h, 60px)); }
  html.has-nudge .toast { bottom: calc(var(--tab-h) + 20px + var(--nudge-h, 60px)); }

  /* list + board */
  .listhead h1 { font-size: 24px; }
  .board { grid-auto-columns: 84vw; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px; }

  /* chat / mail follow the visible viewport (keyboard) */
  .chat { height: calc(var(--vvh, 100dvh) - var(--top-h) - env(safe-area-inset-top) - 8px - var(--tab-h)); }
  .mbx { height: calc(var(--vvh, 100dvh) - var(--top-h) - env(safe-area-inset-top) - 8px - var(--tab-h)); }
  .chan { min-height: 44px; }
  .msg .acts .btn { min-height: 40px; padding: 0 12px; }
  .settings h1 { font-size: 24px; }
}
/* keyboard open (phones): no tab bar, the screen ends at the keyboard */
html.kb-open .tabbar, html.kb-open .fab, html.kb-open .pnudge { display: none; }
@keyframes nudgeup { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 760px) {
  html.kb-open .chat, html.kb-open .mbx { height: calc(var(--vvh, 100dvh) - var(--top-h) - env(safe-area-inset-top) - 8px); }
  html.kb-open .cview[data-pane="map"] { bottom: 0; }
}

/* ---------- foreground push toast ---------- */
.ptoast {
  position: fixed; z-index: 101; top: calc(var(--top-h, 60px) + 10px); right: 16px; width: min(380px, calc(100vw - 32px));
  display: flex; align-items: flex-start; gap: 4px; padding: 6px; border-radius: 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .16s ease;
}
.ptoast .pt-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.ptoast .pt-main:hover { background: var(--surface-alt); }
.ptoast .pt-main:focus-visible, .ptoast .pt-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ptoast .pt-ic { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.ptoast .pt-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ptoast .pt-h { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptoast .pt-b { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ptoast .pt-x {
  flex: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.ptoast .pt-x:hover { background: var(--line); color: var(--ink); }
@media (max-width: 760px) { .ptoast { left: 16px; right: 16px; width: auto; top: calc(var(--top-h, 60px) + 8px + env(safe-area-inset-top)); } }
@media (prefers-reduced-motion: reduce) { .ptoast { animation: none; } }

/* ---------- Cafes tab: left column + Map | List | Board panes ---------- */
.panes { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex: none; }
.pane-bar .vswitch { margin: 0; }
.pane-title { font-weight: 700; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panes .pane { flex: 1; min-height: 0; }
.panes .tbl { overflow-y: auto; }
.pane-board { overflow: auto; }
.pane-board .board { min-height: 100%; padding-bottom: 4px; }
.lp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.lp-toggle { display: none; }
.lp-toggle svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .cview[data-pane="map"] .vswitch-pane { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); }
  .cview[data-pane="map"] .vswitch-pane a { padding: 5px 10px; font-size: 12px; }
}
@media (max-width: 480px) { .cview[data-pane="map"] .vswitch-pane a span { display: none; } .cview[data-pane="map"] .vswitch-pane a { padding: 6px 9px; } }

/* ---------- Home: what should I do today ---------- */
.home { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; margin: 0 auto; }
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hcounters { display: flex; gap: 8px; }
.hcount { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.hcount:hover { background: var(--surface-alt); }
.hcount b { font-size: 22px; line-height: 1.1; }
.hcount span { font-size: 11px; color: var(--ink-3); font-weight: 600; text-align: center; }
.hcc-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hcc { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hcc button.ccard { box-shadow: var(--shadow); }
.fstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.fs { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: var(--surface-alt); font-size: 10px; color: var(--ink-3); min-width: 0; }
.fs small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fs b { font-size: 15px; color: color-mix(in srgb, var(--st) 80%, var(--ink)); }
.fs.hi { background: color-mix(in srgb, var(--s-won) 14%, transparent); }
.fs.hi b { color: color-mix(in srgb, var(--s-won) 75%, var(--ink)); }
.hmotiv { gap: 16px; }
.goal { display: flex; flex-direction: column; gap: 8px; }
.goal-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.goal-h h3 { flex: 1; }
.goal-n { font-weight: 700; }
.goal-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.goal-bar span { display: block; height: 100%; background: var(--s-won); border-radius: 999px; transition: width .4s ease; }
.goal-f { display: flex; gap: 8px; align-items: center; }
.goal-f .input { width: 90px; min-height: 36px; padding: 6px 10px; font-size: 15px; }
.hm-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.hm-grid h3 small { font-weight: 500; font-size: 13px; }
.sb { display: flex; flex-direction: column; margin-top: 8px; }
.sb-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) repeat(3, 58px) 64px; gap: 8px; align-items: center; padding: 8px 6px; border-top: 1px solid var(--line); }
.sb-row:first-child { border-top: 0; }
.sb-row.me { background: var(--brand-soft); border-radius: 10px; border-top-color: transparent; }
.sb-row.me + .sb-row { border-top-color: transparent; }
.sb-row .who-av { width: 28px; height: 28px; font-size: 11px; cursor: default; }
.sb-n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-c { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.sb-c b { font-size: 16px; }
.sb-c small { font-size: 10px; color: var(--ink-3); }
.sb-c.win b { color: color-mix(in srgb, var(--s-won) 75%, var(--ink)); }
.sb-streak { display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sb-streak svg { width: 14px; height: 14px; }
.sb-streak.hot { color: var(--warning); }
.quiet { padding: 12px 0; }
.wins { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wl { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 8px 6px; border-radius: 10px; text-align: left; cursor: pointer; color: var(--ink); font: inherit; font-size: 14px; min-width: 0; }
.wl:hover { background: var(--surface-alt); }
.wl svg { width: 16px; height: 16px; color: color-mix(in srgb, var(--s-won) 80%, var(--ink)); flex: none; }
.wl-n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl .faint { white-space: nowrap; }
.home-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.attn-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 10px 6px 2px; }
.attn-h small { font-weight: 500; }
.attn-more { align-self: flex-start; }
#hattn .row { padding: 8px 6px; }
#hattn .row .ava svg { width: 18px; height: 18px; }
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 6px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); font: inherit; font-size: 14px; border-radius: 0; }
button.feed-row { cursor: pointer; }
button.feed-row:hover { background: var(--surface-alt); border-radius: 10px; }
.feed-row:first-child { border-top: 0; }
.feed-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feed-l { overflow-wrap: anywhere; color: var(--ink-2); line-height: 1.35; }
.feed-l b { color: var(--ink); font-weight: 600; }
.feed-row .who-av { width: 26px; height: 26px; font-size: 11px; cursor: default; margin-top: 1px; }
@media (max-width: 860px) { .home-grid, .hm-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .hcc-row { grid-template-columns: 1fr; }
  .hcounters { width: 100%; }
  .hcount { flex: 1; min-width: 0; }
  .sb-row { grid-template-columns: 28px minmax(0, 1fr) repeat(3, 40px) 50px; gap: 6px; }
  .sb-c small { display: none; }
  .home h1 { font-size: 24px; }
}
