/* ============================================================================
   map.css — the main site (/): Map, Photos and About views plus the bottom
   menu. Night Prowl (frankie.css v2 tokens). Phone-first; on wide screens the
   menu and pages stay centred and the map fills the window.
   ============================================================================ */

html, body { height: 100%; }
body.map-body { overflow: hidden; }

:root { --tabbar-h: calc(76px + env(safe-area-inset-bottom, 0px)); }

.app { position: relative; height: 100dvh; }
.view { position: absolute; inset: 0; }
.view--page { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--tabbar-h) + var(--space-6)); }

/* ---------------------------------------------------------------- Map -- */
.map-canvas { position: absolute; inset: 0; }

.map-header {
  position: absolute; z-index: 900; left: 0; right: 0; top: 0;
  display: flex; gap: var(--space-2); align-items: stretch; pointer-events: none;
  padding: max(var(--space-3), env(safe-area-inset-top)) max(var(--space-3), env(safe-area-inset-right)) 0 max(var(--space-3), env(safe-area-inset-left));
}
.map-header > * { pointer-events: auto; }
.map-header__card {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
  border-radius: 18px; background: var(--glass-strong); box-shadow: var(--shadow-raised);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.map-header__titles { min-width: 0; }
.map-header__title { font-size: var(--fs-md); margin: 0; line-height: 1.2; }
.map-header__sub { margin: 0; font-size: var(--fs-xs); color: var(--ink-soft); display: flex; align-items: center; gap: var(--space-2); }
.map-header__sub .fh-live-dot { width: 6px; height: 6px; box-shadow: 0 0 0 2px rgba(74,222,128,0.25); }
.map-round {
  width: 52px; flex: none; border: 0; cursor: pointer; border-radius: 18px;
  background: var(--glass-strong); color: var(--ink); box-shadow: var(--shadow-raised);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); display: grid; place-items: center;
}
.map-round:hover { background: var(--raised); }
.map-round .fh-icon { width: 20px; height: 20px; }

.leaflet-top { top: calc(max(var(--space-3), env(safe-area-inset-top)) + 64px); }
.leaflet-right .leaflet-control { margin-right: max(var(--space-3), env(safe-area-inset-right)); }
.leaflet-bottom { bottom: calc(var(--tabbar-h) + 76px); }

/* ------------------------------------------------------- Sightings sheet -- */
.map-sheet {
  position: absolute; z-index: 1000;
  left: max(var(--space-2), env(safe-area-inset-left)); right: max(var(--space-2), env(safe-area-inset-right));
  bottom: calc(var(--tabbar-h) + var(--space-2));
  max-height: 60px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--glass-strong); border-radius: var(--radius-sheet); box-shadow: var(--shadow-raised);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: max-height 280ms var(--ease-out);
}
.map-sheet.is-open { max-height: calc(100dvh - var(--tabbar-h) - 150px); }
.map-sheet__handle {
  flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  width: 100%; min-height: 60px; padding: var(--space-2) var(--space-5) var(--space-3);
  background: transparent; border: 0; cursor: pointer; color: var(--ink);
}
.map-sheet__grip { align-self: center; width: 36px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.25); }
.map-sheet__label { display: flex; align-items: baseline; justify-content: space-between; font-weight: 800; font-size: var(--fs-md); letter-spacing: -0.02em; }
.map-sheet__count { font-weight: 600; font-size: var(--fs-xs); color: var(--ink-soft); letter-spacing: 0; }
.map-sheet__body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 var(--space-3) var(--space-3); min-height: 0; }

.stats { margin: 0 var(--space-1) var(--space-2); }
.stats__row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.stats__item { padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; min-width: 0; }
.stats__item + .stats__item { box-shadow: inset 1px 0 0 var(--line); }
.stats__num { font-weight: 800; font-size: var(--fs-md); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats__cap { font-size: var(--fs-xs); color: var(--ink-soft); }

.feed-status { margin: 0 var(--space-1) var(--space-2); font-size: var(--fs-xs); }
.feed-status:empty { display: none; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed > li + li .feed-row { box-shadow: inset 0 1px 0 var(--line); }
.feed-row {
  display: grid; grid-template-columns: 56px 1fr; gap: var(--space-3); align-items: center; width: 100%; min-height: 76px;
  padding: var(--space-2) var(--space-2); border: 0; border-radius: var(--radius); background: none; color: inherit; text-align: left; cursor: pointer;
}
.feed-row:hover { background: rgba(255,255,255,0.04); }
.thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; position: relative; background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No photo: a tiny drawn map with the pin, so the row still says "a place". */
.thumb--map { background: #151A22; box-shadow: inset 0 0 0 1px var(--line); }
.thumb--map::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 24px, #262D38 24px 27px, transparent 27px) 0 0/44px 44px,
              linear-gradient(0deg, transparent 18px, #262D38 18px 21px, transparent 21px) 0 0/44px 32px; }
.thumb--map::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2.5px var(--bg); }
.feed-row__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.feed-row__title { font-weight: 700; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.feed-row__where { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--primary); }
.feed-row__where .fh-icon { width: 13px; height: 13px; }
.feed-row__meta { font-size: var(--fs-xs); color: var(--ink-soft); overflow-wrap: anywhere; }

.feed-empty { text-align: center; padding: var(--space-4) var(--space-3) var(--space-2); }
.feed-empty__badge { width: 52px; height: 52px; margin: 0 auto var(--space-3); border-radius: 16px; display: grid; place-items: center; background: var(--primary-wash); color: var(--primary); }
.feed-empty__badge .fh-icon { width: 24px; height: 24px; }
.feed-empty h3 { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.feed-empty p { color: var(--ink-soft); margin: 0 auto; max-width: 34ch; font-size: var(--fs-sm); }

/* ------------------------------------------------------- Sighting detail -- */
.detail {
  position: absolute; z-index: 1100;
  left: max(var(--space-2), env(safe-area-inset-left)); right: max(var(--space-2), env(safe-area-inset-right));
  bottom: calc(var(--tabbar-h) + var(--space-2));
  padding: var(--space-3) var(--space-3) var(--space-4); border-radius: var(--radius-sheet);
  background: rgba(20,24,31,0.97); box-shadow: var(--shadow-raised);
  animation: detail-up 240ms var(--ease-out);
}
@keyframes detail-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail__photo { border-radius: var(--radius); overflow: hidden; margin-bottom: var(--space-3); background: var(--surface); aspect-ratio: 4 / 3; max-height: 44dvh; width: 100%; }
.detail__photo:empty { display: none; }
.detail__photo { position: relative; }
.detail__strip { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.detail__strip::-webkit-scrollbar { display: none; }
.detail__open { flex: 0 0 100%; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; scroll-snap-align: center; }
.detail__open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail__enlarge { position: absolute; right: var(--space-3); bottom: var(--space-3); padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,0.65); color: #fff; font-size: var(--fs-xs); font-weight: 700; pointer-events: none; }

/* Full-screen photo viewer: whole photo, uncropped, swipe between them */
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 3000; background: #000; }
.viewer__strip { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.viewer__strip::-webkit-scrollbar { display: none; }
.viewer__slide { flex: 0 0 100%; width: 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 0 calc(env(safe-area-inset-bottom, 0px) + 56px); }
.viewer__slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.viewer__close { position: absolute; z-index: 2; top: max(var(--space-3), env(safe-area-inset-top)); right: max(var(--space-3), env(safe-area-inset-right));
  min-height: 44px; padding: 0 var(--space-4); border: 0; border-radius: 99px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.14); color: #fff; font-weight: 700; font-size: var(--fs-sm); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.viewer__close .fh-icon { width: 18px; height: 18px; }
.viewer__nav { position: absolute; z-index: 2; top: 50%; width: 48px; height: 48px; margin-top: -24px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: rgba(255,255,255,0.14); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.viewer__nav[disabled] { opacity: 0.3; cursor: default; }
.viewer__nav--prev { left: max(var(--space-3), env(safe-area-inset-left)); }
.viewer__nav--next { right: max(var(--space-3), env(safe-area-inset-right)); }
.viewer__nav--next .fh-icon { transform: scaleX(-1); }
.viewer__nav .fh-icon { width: 22px; height: 22px; }
.viewer__count { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-4));
  padding: 4px 12px; border-radius: 99px; background: rgba(255,255,255,0.14); color: #fff; font-weight: 800; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
@media (hover: none) { .viewer__nav { display: none; } }
.detail__count { position: absolute; left: var(--space-3); bottom: var(--space-3); pointer-events: none; padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,0.65); color: #fff; font-size: var(--fs-xs); font-weight: 800; font-variant-numeric: tabular-nums; }
.thumb__more { position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 99px; background: rgba(0,0,0,0.7); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 16px; }
.detail__close {
  position: absolute; top: 0; right: 0; width: 56px; height: 56px; border: 0; background: none; cursor: pointer; color: #fff;
  display: grid; place-items: center; z-index: 2;
}
.detail__close::before { content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.6); }
.detail__close .fh-icon { position: relative; width: 18px; height: 18px; }
.detail__title { font-size: var(--fs-md); margin: 0 48px var(--space-1) var(--space-1); overflow-wrap: anywhere; }
.detail__photo:not(:empty) ~ .detail__title { margin-right: var(--space-1); }
.detail__where { display: flex; gap: 6px; align-items: center; margin: 0 var(--space-1) 2px; font-size: var(--fs-sm); font-weight: 700; color: var(--primary); }
.detail__where .fh-icon { width: 15px; height: 15px; }
.detail__meta { margin: 0 var(--space-1); font-size: var(--fs-xs); color: var(--ink-soft); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Pins -- */
.pin-wrap, .tglow-wrap, .tface-wrap, .home-pin-wrap { background: none; border: 0; }
.pin-hit { width: 44px; height: 44px; display: grid; place-items: center; }
.pin { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--bg), 0 6px 14px rgba(0,0,0,0.5); transition: transform var(--press-time) var(--ease-out); }
.pin-hit:hover .pin { transform: scale(1.2); }
.pin--photo { width: 38px; height: 38px; border-radius: 12px; overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 2.5px var(--primary), 0 0 0 4.5px var(--bg), 0 10px 18px rgba(0,0,0,0.55); }
.pin--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.is-selected .pin { box-shadow: 0 0 0 3px var(--primary), 0 0 0 9px rgba(255,181,71,0.3); }
.is-selected .pin--photo { box-shadow: 0 0 0 3px var(--primary), 0 0 0 10px rgba(255,181,71,0.3); }
.home-pin-hit { height: 44px; display: flex; align-items: center; justify-content: center; }
.home-pin { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; white-space: nowrap;
  border-radius: var(--radius-pill); background: var(--ink); color: var(--bg); font-weight: 800; font-size: 12px; box-shadow: 0 12px 24px -8px rgba(0,0,0,0.7); }
.home-pin__dot { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.home-pin__dot .fh-icon { width: 15px; height: 15px; }

/* Grouped pins: newest photo + how many */
.cluster-wrap { background: none; border: 0; }
.cluster-hit { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.cluster { width: 46px; height: 46px; border-radius: 15px; overflow: hidden; background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary), 0 0 0 5px var(--bg), 0 0 0 9px rgba(255,181,71,0.25), 0 12px 22px rgba(0,0,0,0.55); }
.cluster--photo { background: var(--surface); }
.cluster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cluster__count { position: absolute; top: -4px; right: -6px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 13px;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2.5px var(--bg); }
.cluster-hit:hover .cluster { transform: scale(1.06); }
.group-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 var(--space-1) var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); border-radius: var(--radius); background: var(--primary-wash); box-shadow: inset 0 0 0 1px var(--primary-line); }
.group-bar__label { font-weight: 700; font-size: var(--fs-sm); }
.stats.is-hidden-by-group { display: none; }
.map-admin { display: flex; align-items: center; gap: 6px; padding: 0 var(--space-3); border-radius: 18px; text-decoration: none; flex: none;
  background: var(--primary-wash); color: var(--primary); font-weight: 800; font-size: var(--fs-sm);
  box-shadow: inset 0 0 0 1px var(--primary-line), var(--shadow-raised); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.map-admin .fh-icon { width: 18px; height: 18px; }

/* ----------------------------------------------------------- Pages -- */
.page { max-width: 560px; margin: 0 auto;
  padding: calc(max(var(--space-5), env(safe-area-inset-top)) + var(--space-2)) max(var(--space-4), env(safe-area-inset-right)) 0 max(var(--space-4), env(safe-area-inset-left)); }
.page__title { font-size: 1.75rem; margin: 0 0 var(--space-1); }
.page__sub { color: var(--ink-soft); margin: 0 0 var(--space-4); }
.page__empty { color: var(--ink-soft); text-align: center; padding: var(--space-6) var(--space-4); border-radius: var(--radius-card); box-shadow: inset 0 0 0 1px var(--line); margin-top: var(--space-4); }

.photo-grid { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid button { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

.about__hero { position: relative; height: clamp(220px, 34dvh, 340px); overflow: hidden; background: #2A221C; }
.about__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about__placeholder { position: absolute; inset: 0;
  background: radial-gradient(55% 45% at 62% 40%, rgba(255,214,170,0.22), transparent 70%), linear-gradient(150deg, #8C7A68 0%, #5B4B3E 45%, #2A221C 100%); }
.about__hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,14,19,0.3), transparent 40%, var(--bg)); pointer-events: none; }
.page--about { padding-top: 0; margin-top: calc(-1 * var(--space-5)); position: relative; z-index: 1; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 var(--space-5); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.facts__item { padding: var(--space-3); min-width: 0; }
.facts__item + .facts__item { box-shadow: inset 1px 0 0 var(--line); }
.facts dt { font-size: var(--fs-xs); color: var(--ink-soft); }
.facts dd { margin: 0; display: flex; flex-direction: column; }
.facts dd > span { font-weight: 800; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.facts dd small { font-size: 0.75rem; color: var(--ink-faint); }
.about__label { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 var(--space-2); }
.rules { list-style: none; margin: 0 0 var(--space-5); padding: 0; }
.rule { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) 0; color: var(--ink-soft); }
.rule p { margin: 0; }
.rule strong { color: var(--ink); }
.rule__icon { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--glass); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.rule__icon .fh-icon { width: 17px; height: 17px; }
.rule--no .rule__icon { background: var(--danger-wash); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-line); }

/* ----------------------------------------------------------- Menu -- */
.tabbar {
  position: fixed; z-index: 1500; left: 0; right: 0; bottom: 0; height: var(--tabbar-h);
  display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr; align-items: end;
  padding: var(--space-2) max(var(--space-2), env(safe-area-inset-right)) calc(var(--space-2) + env(safe-area-inset-bottom, 0px)) max(var(--space-2), env(safe-area-inset-left));
  background: rgba(11,14,19,0.97); box-shadow: inset 0 1px 0 var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-height: 56px; min-width: 44px;
  text-decoration: none; color: var(--ink-soft); font-size: 0.75rem; font-weight: 700; border-radius: 12px; }
.tab .fh-icon { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--primary); }
.tab--spot { color: var(--ink); }
.tab__spot { width: 60px; height: 60px; margin-top: -34px; border-radius: 20px; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 5px var(--bg), 0 14px 30px -8px rgba(255,181,71,0.7);
  transition: transform var(--press-time) var(--ease-out); }
.tab__spot .fh-icon { width: 28px; height: 28px; }
.tab--spot:active .tab__spot { transform: scale(0.95); }

/* --------------------------------------------------- Wide screens -- */
@media (min-width: 900px) {
  .map-header { right: auto; width: min(460px, calc(100% - 24px)); }
  .map-sheet, .detail { left: auto; right: max(var(--space-3), env(safe-area-inset-right)); width: 400px; }
  .map-sheet.is-open { max-height: calc(100dvh - var(--tabbar-h) - 120px); }
  .tabbar { left: 50%; right: auto; width: 480px; transform: translateX(-50%); bottom: var(--space-3); height: 76px;
    border-radius: 24px; padding-bottom: var(--space-2); box-shadow: 0 0 0 1px var(--line), var(--shadow-raised); }
  :root { --tabbar-h: 92px; }
  .leaflet-bottom { bottom: 0; }
}

/* ============================================== Frankie's AirTag ("now") == */
/* Sky blue = "where his AirTag thinks he is now". Amber = "where a neighbour saw him".
   Soft, edge-less glow on purpose: an AirTag fix is approximate, so we never draw a hard circle. */

/* His face: photo from admin, paw until then */
.now-face { flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%;
  background: var(--surface); color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.now-face img, .leaflet-container .leaflet-marker-pane .now-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-face .fh-icon { width: 55%; height: 55%; }
.now-face--sm { width: 32px; height: 32px; }
.now-face--home { width: 28px; height: 28px; box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px rgba(125,211,252,0.25); }
.now-face--map { width: 40px; height: 40px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--bg), 0 10px 22px rgba(0,0,0,0.6); }

/* The glow on the map (sized in real metres by map.js through --d) */
.tglow { position: absolute; left: 0; top: 0; width: var(--d, 120px); height: var(--d, 120px);
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(125,211,252,0.50), rgba(125,211,252,0.30) 45%, rgba(125,211,252,0.10) 78%, rgba(125,211,252,0) 100%);
  transition: width 200ms var(--ease-out), height 200ms var(--ease-out), opacity 300ms; }
.tglow__ring { position: absolute; inset: 30%; border-radius: 50%; border: 2px solid rgba(125,211,252,0.55); opacity: 0; }
.tglow.is-fresh .tglow__ring { animation: fh-ripple 3.2s var(--ease-out) infinite; }
.tglow.is-stale { opacity: 0.45; }
@keyframes fh-ripple { 0% { transform: scale(0.4); opacity: 0.8; } 100% { transform: scale(1.5); opacity: 0; } }

.tface-hit { width: 52px; height: 52px; display: grid; place-items: center; cursor: pointer; position: relative; }
.tface-hit::after { content: ""; position: absolute; right: 7px; top: 7px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 2px var(--bg); }
.tface-hit.is-stale { opacity: 0.6; }
.tface-hit.is-stale::after { display: none; }
.tface-hit:hover .now-face--map { transform: scale(1.06); }
.now-face--map { transition: transform var(--press-time) var(--ease-out); }

/* His trail over the last day: soft glow under a thin line */
.ttrail { filter: drop-shadow(0 0 4px rgba(125,211,252,0.55)); }

/* Home pin when the AirTag says he's in */
.home-pin--in { background: var(--ink); box-shadow: 0 0 0 3px rgba(125,211,252,0.55), 0 0 26px 6px rgba(125,211,252,0.35), 0 12px 24px -8px rgba(0,0,0,0.7); }

/* Chip under the header */
.map-now { position: absolute; z-index: 800; display: flex; gap: var(--space-2); align-items: stretch;
  left: max(var(--space-3), env(safe-area-inset-left)); right: calc(max(var(--space-3), env(safe-area-inset-right)) + 64px);
  top: calc(max(var(--space-3), env(safe-area-inset-top)) + 70px); pointer-events: none; }
.map-now > * { pointer-events: auto; }
.now-chip { min-height: 52px; min-width: 0; display: inline-flex; align-items: center; gap: var(--space-3);
  padding: 8px 16px 8px 8px; border: 0; border-radius: 999px; cursor: pointer; text-align: left;
  font: inherit; color: var(--ink); background: var(--glass-strong); box-shadow: var(--shadow-raised), inset 0 0 0 1px rgba(125,211,252,0.35);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.now-chip:hover { background: var(--raised); }
.now-chip:disabled { cursor: default; }
.now-chip__text { display: flex; flex-direction: column; min-width: 0; }
.now-chip__title { font-weight: 800; font-size: var(--fs-sm); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-chip__sub { font-size: var(--fs-xs); color: var(--ink-soft); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-chip--seen { box-shadow: var(--shadow-raised), inset 0 0 0 1.5px var(--ok); }
.now-chip--seen .now-chip__sub { color: var(--ok); }
.now-chip--stale .now-face, .now-chip--gone .now-face { box-shadow: 0 0 0 2px var(--line-strong); color: var(--ink-faint); }
.now-chip--gone { box-shadow: var(--shadow-raised), inset 0 0 0 1px var(--line); }
/* "Right now" card at the top of the sightings sheet */
.now-card { margin: 0 0 var(--space-3); padding: var(--space-2); border-radius: 18px; background: var(--glass); display: grid; gap: 2px; }
.now-card__label { margin: 4px var(--space-2) 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.now-row { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; width: 100%; padding: 6px var(--space-2);
  border: 0; border-radius: 14px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.now-row:hover:not(:disabled) { background: var(--raised); }
.now-row:disabled { cursor: default; }
.now-row__text { display: flex; flex-direction: column; min-width: 0; }
.now-row__title { font-weight: 700; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-row__sub { font-size: var(--fs-xs); color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-row__pin { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-wash); color: var(--primary); box-shadow: 0 0 0 2px var(--primary-line); }
.now-row__pin .fh-icon { width: 16px; height: 16px; }
.now-row__pin--photo { border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 2px var(--primary); }
.now-row__pin--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* About page: the AirTag rule's icon is a little glow */
.rule__glow { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgba(125,211,252,0.95), rgba(125,211,252,0.35) 60%, rgba(125,211,252,0)); }

@media (prefers-reduced-motion: reduce) {
  .tglow.is-fresh .tglow__ring { animation: none; opacity: 0.5; transform: scale(1); }
  .tglow { transition: none; }
}

/* "Show his trail" switch inside the Right-now card */
.now-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 48px; width: 100%;
  padding: 6px var(--space-2); border: 0; border-radius: 14px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.now-switch:hover { background: var(--raised); }
.now-switch__text { display: flex; flex-direction: column; min-width: 0; }
.now-switch__title { font-weight: 700; font-size: var(--fs-sm); }
.now-switch__sub { font-size: var(--fs-xs); color: var(--ink-soft); }
.now-switch__track { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 160ms; }
.now-switch__track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform 160ms var(--ease-out); }
.now-switch[aria-pressed="true"] .now-switch__track { background: var(--accent); }
.now-switch[aria-pressed="true"] .now-switch__track::after { transform: translateX(18px); background: var(--on-accent); }

/* ---- Video sightings ---- */
.play-badge { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff; display: grid; place-items: center; pointer-events: none; }
.play-badge .fh-icon { width: 11px; height: 11px; margin-left: 1px; }
.play-badge--grid { width: 34px; height: 34px; margin: -17px; }
.play-badge--grid .fh-icon { width: 15px; height: 15px; margin-left: 2px; }
.play-badge--pin { left: auto; top: auto; right: -2px; bottom: -2px; margin: 0; width: 18px; height: 18px; z-index: 2;
  background: var(--primary); color: var(--bg); box-shadow: 0 0 0 2px var(--bg); }
.play-badge--pin .fh-icon { width: 9px; height: 9px; }
.pin-hit { position: relative; }
.thumb--video { background: #151A22; box-shadow: inset 0 0 0 1px var(--line); }
.photo-grid button { position: relative; }
.photo-grid__video { background: #151A22 !important; box-shadow: inset 0 0 0 1px var(--line); }
.detail__video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.detail__novideo { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-4); text-align: center; color: var(--ink-soft); font-size: var(--fs-sm); }
.detail__muted { top: var(--space-3); bottom: auto; right: auto; left: var(--space-3); }
