/* ══════════════════════════════════════════════════════════════
   TRUTH OBSERVATORY - Cockpit preview (free live map)
   DarkWave Studios LLC - Copyright 2026
   Used by the home-page teaser and /preview. Tokens come from ui.css.
   ══════════════════════════════════════════════════════════════ */

.pv { position: relative; width: 100%; }
.pv__frame {
  position: relative; overflow: hidden;
  border: 1px solid var(--ob-line-2, rgba(255,255,255,.14));
  border-radius: var(--ob-radius, 16px);
  background: #05070b;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.9), inset 0 0 0 1px rgba(255,255,255,.02);
}
.pv__map { width: 100%; height: 440px; background: #05070b; }
.pv--full .pv__map { height: min(68vh, 680px); }
.pv--failed {
  padding: 48px 20px; text-align: center; color: var(--ob-text-2, rgba(255,255,255,.64));
  border: 1px dashed var(--ob-line-2, rgba(255,255,255,.14)); border-radius: var(--ob-radius, 16px);
}
@media (max-width: 700px) {
  .pv__map { height: 340px; }
  .pv--full .pv__map { height: 58vh; }
}

/* Skeleton shimmer until Leaflet arrives */
.pv:not(:has(.pv__frame)):not(.pv--failed) {
  min-height: 440px; border-radius: var(--ob-radius, 16px);
  border: 1px solid var(--ob-line, rgba(255,255,255,.08));
  background: linear-gradient(110deg, #07090d 30%, #0e1218 50%, #07090d 70%) 0 0 / 300% 100%;
  animation: pv-shimmer 1.6s linear infinite;
}
@media (max-width: 700px) { .pv:not(:has(.pv__frame)):not(.pv--failed) { min-height: 340px; } }
@keyframes pv-shimmer { to { background-position: -300% 0; } }

/* HUD */
.pv-hud {
  position: absolute; top: 12px; left: 12px; z-index: 500;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--ob-glass, rgba(10,12,17,.72)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--ob-line-2, rgba(255,255,255,.14));
  font-family: var(--ob-mono, monospace); font-size: .68rem; letter-spacing: .08em; color: var(--ob-text-2, rgba(255,255,255,.64));
  pointer-events: none;
}
.pv-hud__live { color: var(--ob-live, #7dffb8); font-weight: 600; text-transform: uppercase; display: inline-flex; align-items: center; gap: 7px; }
.pv-hud__rot { color: var(--ob-gold-2, #f2d48a); font-weight: 600; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.16); }
.pv-hud__live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ob-live, #7dffb8);
  box-shadow: 0 0 0 0 rgba(125,255,184,.6); animation: pv-pulse 2s infinite;
}
@keyframes pv-pulse { 70% { box-shadow: 0 0 0 8px rgba(125,255,184,0); } 100% { box-shadow: 0 0 0 0 rgba(125,255,184,0); } }

/* Layer chips: two centered rows (Free, Cockpit), each with its label above */
.pv-chips { display: grid; gap: 14px; margin-top: 18px; padding: 2px; }
.pv-chips__group { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.pv-chips__label {
  flex: 0 0 100%; text-align: center; margin-bottom: 2px;
  font-family: var(--ob-mono, monospace); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ob-live, #7dffb8);
}
.pv-chips__label--lock { color: var(--ob-gold, #e3b95a); }
@media (max-width: 700px) {
  /* Phones: each row swipes on its own, no visible scrollbar */
  .pv-chips__group {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity;
    padding: 0 24px 4px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .pv-chips__group::-webkit-scrollbar { display: none; }
  .pv-chips__label { flex: none; text-align: left; margin: 0 4px 0 0; }
}
.pv-chip {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 999px; cursor: pointer;
  font: 500 .82rem/1 var(--ob-font, system-ui); color: var(--ob-text, #fff);
  background: rgba(255,255,255,.04); border: 1px solid var(--ob-line-2, rgba(255,255,255,.14));
  transition: background .2s var(--ob-ease, ease), border-color .2s var(--ob-ease, ease), opacity .2s, transform .2s var(--ob-ease, ease);
}
.pv-chip:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.pv-chip:focus-visible { outline: 2px solid var(--ob-live, #7dffb8); outline-offset: 2px; }
.pv-chip[aria-pressed="false"] { opacity: .45; }
.pv-chip[aria-pressed="false"] .pv-chip__dot { background: transparent !important; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }
.pv-chip__dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.pv-chip__count {
  font-family: var(--ob-mono, monospace); font-size: .7rem; color: var(--ob-text-2, rgba(255,255,255,.64));
  padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.06);
}
.pv-chip__count.is-busy { animation: pv-blink 1s ease-in-out infinite; }
@keyframes pv-blink { 50% { opacity: .35; } }
.pv-chip--locked {
  color: var(--ob-text-2, rgba(255,255,255,.64));
  border-style: dashed; border-color: rgba(227,185,90,.35); background: rgba(227,185,90,.04);
}
.pv-chip--locked:hover { color: var(--ob-gold-2, #f2d48a); border-color: var(--ob-gold, #e3b95a); background: rgba(227,185,90,.1); }
.pv-chip__lock { font-size: .72rem; filter: grayscale(.3); }

/* Popups (built with textContent in preview-client.lume) */
.pv-popup .leaflet-popup-content-wrapper {
  background: rgba(8,10,14,.96); color: var(--ob-text, #fff); border-radius: 12px;
  border: 1px solid var(--ob-line-2, rgba(255,255,255,.14)); box-shadow: 0 18px 40px -12px rgba(0,0,0,.8);
}
.pv-popup .leaflet-popup-tip { background: rgba(8,10,14,.96); }
.pv-popup .leaflet-popup-content { margin: 12px 14px; }
.pv-pop p { margin: 0; }
.pv-pop__title { font: 700 .95rem/1.25 var(--ob-font, system-ui); margin-bottom: 4px !important; }
.pv-pop__line { font: 400 .8rem/1.45 var(--ob-font, system-ui); color: rgba(255,255,255,.82); }
.pv-pop__src { margin-top: 6px !important; font: 500 .62rem/1.3 var(--ob-mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--ob-text-3, rgba(255,255,255,.4)); }
.pv .leaflet-control-attribution { background: rgba(0,0,0,.45) !important; color: rgba(255,255,255,.55) !important; font-size: 10px; }
.pv .leaflet-control-attribution a { color: rgba(255,255,255,.7) !important; }
.pv .leaflet-bar a { background: rgba(10,12,17,.86); color: #fff; border-color: rgba(255,255,255,.12); }
.pv .leaflet-bar a:hover { background: rgba(30,34,42,.95); }

/* Near me (full mode) */
.pv-near { margin-top: 18px; display: grid; gap: 12px; justify-items: start; }
.pv-near__out:empty { display: none; }
.pv-near__out {
  width: 100%; padding: 16px 18px; border-radius: var(--ob-radius-sm, 10px);
  background: rgba(125,255,184,.04); border: 1px solid rgba(125,255,184,.18);
  color: var(--ob-text-2, rgba(255,255,255,.64)); font-size: .9rem; line-height: 1.5;
}
.pv-near__head { margin: 0 0 10px; color: var(--ob-text, #fff); font-weight: 600; }
.pv-near__row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.pv-near__cell {
  flex: 1 0 110px; display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--ob-line, rgba(255,255,255,.08));
}
.pv-near__cell.is-hit { border-color: rgba(255,179,92,.5); background: rgba(255,179,92,.07); }
.pv-near__n { font: 700 1.35rem/1 var(--ob-font, system-ui); color: var(--ob-text, #fff); }
.pv-near__k { font: 500 .66rem/1.3 var(--ob-mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--ob-text-3, rgba(255,255,255,.4)); }
.pv-near__hook { margin: 12px 0 0; }
.pv-near__buy {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--ob-gold-2, #f2d48a); text-decoration: underline; text-underline-offset: 3px;
}
.pv-near__fine { margin: 8px 0 0; font-size: .74rem; color: var(--ob-text-3, rgba(255,255,255,.4)); }

/* Upsell sheet */
.pv-up { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; padding: 16px; }
.pv-up[hidden] { display: none; }
.pv-up__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: pv-fade .2s ease; }
.pv-up__panel {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 26px 24px 20px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(20,22,28,.98), rgba(10,12,16,.98));
  border: 1px solid rgba(227,185,90,.28); box-shadow: 0 40px 100px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(255,255,255,.03) inset;
  animation: pv-rise .28s var(--ob-ease, ease);
}
.pv-up__panel .ob-label { color: var(--ob-gold, #e3b95a); }
.pv-up__title { margin: 6px 0 6px; font: 800 1.45rem/1.2 var(--ob-font, system-ui); letter-spacing: -.01em; color: var(--ob-text, #fff); }
.pv-up__note { margin: 0 0 14px; color: var(--ob-text-2, rgba(255,255,255,.64)); line-height: 1.5; }
.pv-up__also { margin: 0 0 6px; font-size: .78rem; color: var(--ob-text-3, rgba(255,255,255,.4)); text-transform: uppercase; letter-spacing: .1em; font-family: var(--ob-mono, monospace); }
.pv-up__list { margin: 0 0 16px; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pv-up__list li { position: relative; padding-left: 18px; font-size: .86rem; color: rgba(255,255,255,.86); }
.pv-up__list li::before { content: "✓"; position: absolute; left: 0; color: var(--ob-live, #7dffb8); font-weight: 700; }
.pv-up__price { margin: 0 0 12px; font-family: var(--ob-mono, monospace); font-size: .82rem; color: var(--ob-gold-2, #f2d48a); }
.pv-up__buy { width: 100%; justify-content: center; padding: 14px 18px; font-size: .95rem; }
.pv-up__pass { width: 100%; justify-content: center; padding: 11px 16px; margin-top: 8px; font-size: .84rem; }
.pv-chip--today { border-color: rgba(125,255,184,.42); background: rgba(125,255,184,.08); }
.pv-up__row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px; }
.pv-up__link { background: none; border: 0; padding: 4px 0; cursor: pointer; font: 500 .82rem var(--ob-font, system-ui); color: var(--ob-text-2, rgba(255,255,255,.64)); text-decoration: none; }
.pv-up__link:hover { color: var(--ob-text, #fff); }
@media (max-width: 420px) { .pv-up__list { grid-template-columns: 1fr; } }
@keyframes pv-fade { from { opacity: 0; } }
@keyframes pv-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* Home section wrapper + CTAs */
.pv-section { padding: clamp(48px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); }
.pv-section .section-header__label { display: inline-flex; align-items: center; gap: 8px; }
.pv-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 22px; }
@media (max-width: 560px) { .pv-cta .ob-btn { width: 100%; justify-content: center; } }

@media (prefers-reduced-motion: reduce) {
  .pv-hud__live::before, .pv-chip__count.is-busy, .pv:not(:has(.pv__frame)) { animation: none !important; }
  .pv-up__panel, .pv-up__scrim { animation: none; }
}

/* Two-finger hint (phones, embed map only) */
.pv-gesture {
  position: absolute; inset: 0; z-index: 650; display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center; pointer-events: none;
  font-family: var(--ob-sans, system-ui, sans-serif); font-size: 1rem; font-weight: 600; color: #fff;
  background: rgba(6,8,12,.55); opacity: 0; transition: opacity .25s ease;
}
.pv-gesture.is-on { opacity: 1; }

/* "See the polar view" teaser + dialog (landing page) */
.pv-polar-link {
  display: flex; align-items: center; gap: 10px; margin: 18px auto 0; padding: 10px 16px;
  font: 600 .9rem/1.2 var(--ob-sans, system-ui, sans-serif); color: var(--ob-text, #e9edf2);
  background: rgba(120,190,255,.06); border: 1px solid rgba(120,190,255,.28); border-radius: 999px; cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.pv-polar-link:hover, .pv-polar-link:focus-visible { background: rgba(120,190,255,.12); border-color: rgba(120,190,255,.55); transform: translateY(-1px); }
.pv-polar-link__icon {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid #7cc4ff; box-shadow: inset 0 0 0 4px rgba(124,196,255,.18);
  background: radial-gradient(circle, #7cc4ff 0 2px, transparent 2.5px);
}
.pv-polar-dlg {
  width: min(1080px, calc(100vw - 24px)); max-height: calc(100vh - 24px); margin: auto; padding: 0; border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px; background: #0b0d12; color: var(--ob-text, #e9edf2); box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.pv-polar-dlg::backdrop { background: rgba(4,6,10,.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pv-polar-dlg[open] { animation: pvDlgIn .22s ease-out; }
@keyframes pvDlgIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.pv-polar-dlg__inner { padding: 16px 18px 18px; }
.pv-polar-dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pv-polar-dlg__head form { margin: 0; }
.pv-polar-dlg__title { margin: 0; font: 700 1.15rem/1.2 var(--ob-sans, system-ui, sans-serif); }
.pv-polar-dlg__close {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); background: transparent;
  color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.pv-polar-dlg__img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); }
.pv-polar-dlg__text { margin: 14px 2px 0; font-size: .95rem; line-height: 1.6; color: var(--ob-text-2, rgba(233,237,242,.75)); max-width: 75ch; }
.pv-polar-dlg__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pv-polar-dlg__cta form { margin: 0; }
@media (max-width: 700px) {
  .pv-polar-dlg__inner { padding: 12px; }
  .pv-polar-dlg__zoom::after { content: 'Tap to enlarge'; display: block; margin-top: 6px; font-size: .72rem; color: var(--ob-text-3, rgba(233,237,242,.5)); text-align: center; }
  .pv-polar-dlg__text { font-size: .88rem; }
  .pv-polar-dlg__cta > * { flex: 1 1 100%; }
  .pv-polar-dlg__cta .ob-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .pv-polar-dlg[open] { animation: none; } }
