/* Family gallery v2: tab bar, home, visits, rooms, players, panel maker,
   share sheet preview, settings. Base layer; css/theme.css sets the v2 look (standard iPhone sizes). */

:root { --tabbar-h: 4.6rem; --fb: #1f4f8f; }

html.hi-contrast {
  --muted: #142024;
  --ink: #000;
  --line: rgba(7, 44, 50, 0.6);
  --cream: #ffffff;
  --sand: #f1ece4;
  --teal: #0a4650;
}
html.hi-contrast .chip, html.hi-contrast .btn-secondary, html.hi-contrast .seg { border-width: 2px; border-color: var(--teal-deep); }
html.hi-contrast .fine-print, html.hi-contrast .lede { color: #142024; }
html.hi-contrast .photo-card img { outline: 1px solid rgba(0,0,0,0.35); }

body.viewer-open { overflow: hidden; }

/* ---------- header ---------- */
.g-head { grid-template-columns: 1fr auto; position: sticky; top: 0; z-index: 30; }
.g-head .brand strong { font-size: 1.2rem; }
.g-head .script.mini { font-size: 1.35rem; }
.head-btn {
  appearance: none; border: 0; border-radius: 99px; background: var(--cream); color: var(--teal-deep);
  font: inherit; font-weight: 700; font-size: 1rem; min-height: 48px; padding: 0 1rem; white-space: nowrap; cursor: pointer;
}
.head-btn span { font-family: var(--serif); margin-right: 0.15rem; }

/* ---------- main + tab bar ---------- */
.g-main { padding: 1rem 1rem calc(var(--tabbar-h) + var(--safe-bot) + 1.5rem); flex: 1; width: 100%; max-width: 760px; margin: 0 auto; }
.g-main.is-selecting { padding-bottom: calc(12rem + var(--safe-bot)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: flex; background: var(--white); border-top: 1px solid var(--line);
  padding: 0.2rem 0.25rem calc(var(--safe-bot) + 0.2rem);
  box-shadow: 0 -6px 20px rgba(7, 44, 50, 0.08);
}
.tab {
  flex: 1; appearance: none; border: 0; background: none; font: inherit; color: var(--muted);
  min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  font-size: 1rem; font-weight: 700; cursor: pointer; border-radius: 12px;
}
.tab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--teal-deep); background: rgba(15, 85, 96, 0.09); }
.tab.on svg { stroke-width: 2.2; }
.select-bar { position: fixed; left: 0; right: 0; bottom: 0; }

/* ---------- buttons ---------- */
.btn-big { min-height: 56px; font-size: 1.1rem; border-radius: 12px; }
.btn-primary.btn-big { border-radius: 12px; }
.btn-orange {
  appearance: none; border: 0; background: var(--orange); color: #fff; font: inherit; font-weight: 700;
  width: 100%; padding: 0.9rem 1rem; border-radius: 12px; cursor: pointer;
}
.btn-orange:hover { background: #d4661f; }
.btn-orange:disabled { opacity: 0.6; }
html.hi-contrast .btn-orange { background: #b4520f; }
.btn-facebook {
  appearance: none; border: 0; background: var(--fb); color: #fff; font: inherit; font-weight: 700; width: 100%;
  padding: 0.9rem 1rem; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; cursor: pointer;
}
.fb-mark { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; color: var(--fb); font-weight: 700; font-family: Helvetica, Arial, sans-serif; }
.btn-inline { width: auto; margin: 0; padding: 0.6rem 1rem; }
.btn-secondary { border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.btn-primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-height: 52px; border-radius: 12px; }
.back-btn {
  appearance: none; border: 0; background: none; font: inherit; font-weight: 700; color: var(--teal); font-size: 1.1rem;
  min-height: 48px; padding: 0 0.25rem; cursor: pointer;
}
.select-launch-inline { min-height: 48px; font-size: 1.05rem; }

/* ---------- segmented toggle ---------- */
.seg { display: flex; background: var(--sand); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin: 0 0 1rem; }
.seg-btn {
  flex: 1; appearance: none; border: 0; background: transparent; color: var(--teal-deep); font: inherit; font-weight: 700;
  min-height: 48px; border-radius: 10px; font-size: 1.05rem; cursor: pointer;
}
.seg-btn.on { background: var(--teal); color: var(--cream); box-shadow: 0 2px 6px rgba(7,44,50,0.18); }

/* ---------- home ---------- */
.whatsnew { background: var(--white); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(7, 44, 50, 0.10); margin: 0 0 1.25rem; }
.whatsnew-photo { display: block; position: relative; width: 100%; padding: 0; border: 0; background: var(--sand); cursor: pointer; }
.whatsnew-photo img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.new-badge { position: absolute; top: 12px; left: 12px; background: var(--orange); color: #fff; font-weight: 700; font-size: 1rem; padding: 0.3rem 0.8rem; border-radius: 99px; }
.whatsnew-body { padding: 1rem 1.1rem 1.2rem; }
.whatsnew-date { margin: 0; color: var(--muted); font-weight: 700; font-size: 1rem; }
.whatsnew-body h1 { margin: 0.2rem 0 0.25rem; font-size: 1.85rem; line-height: 1.15; color: var(--teal-deep); }
.whatsnew-meta { margin: 0 0 1rem; color: var(--muted); }
.celebrate {
  background: linear-gradient(160deg, #fff7ef, #fdeedd); border: 1px solid rgba(232,118,43,0.35); border-radius: 18px;
  padding: 1.1rem 1.1rem 1.2rem; margin: 0 0 1.25rem;
}
.celebrate h2, .celebrate-card h2 { margin: 0.5rem 0 0.35rem; font-size: 1.6rem; color: var(--teal-deep); }
.celebrate p { margin: 0 0 1rem; }
.celebrate-rule { display: block; width: 3rem; height: 4px; border-radius: 4px; background: var(--orange); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin: 0 0 1.4rem; }
.quick-tile {
  appearance: none; border: 1px solid var(--line); background: var(--white); border-radius: 16px; text-align: left; font: inherit; color: var(--ink);
  padding: 0.9rem 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; min-height: 132px; cursor: pointer;
}
.quick-tile strong { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; color: var(--teal-deep); line-height: 1.2; }
.quick-tile span:not(.q-icon) { color: var(--muted); font-size: 1rem; line-height: 1.3; }
.q-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(15,85,96,0.1); color: var(--teal); font-size: 1.25rem; margin-bottom: 0.35rem; }
.progress { margin: 0 0 1.4rem; }
.progress h2, .potw h2, .keepsake-teaser h2, .compare-box h2 { font-size: 1.4rem; margin: 0 0 0.7rem; color: var(--teal-deep); }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.step-btn {
  width: 100%; appearance: none; font: inherit; display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 0.6rem;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; min-height: 56px; padding: 0 0.9rem; text-align: left; color: var(--ink); cursor: pointer;
}
.step-btn.is-todo { cursor: default; background: transparent; color: var(--muted); border-style: dashed; }
.step-dot { width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: #fff; }
.done .step-dot { background: var(--teal); border-color: var(--teal); }
.step-name { font-weight: 700; }
.step-date { color: var(--muted); font-size: 1rem; }
.done .step-date::after { content: " ›"; }
.potw { margin: 0 0 1.4rem; }
.keepsake-teaser { background: var(--sand); border-radius: 16px; padding: 1rem 1.1rem 1.1rem; margin: 0 0 1rem; }
.keepsake-teaser p { margin: 0 0 0.6rem; }
.welcome-card { background: var(--white); border-radius: 18px; padding: 1.3rem 1.2rem; margin-bottom: 1.2rem; box-shadow: 0 10px 30px rgba(7,44,50,0.08); }
.welcome-card h1 { font-size: 1.7rem; margin: 0 0 0.4rem; color: var(--teal-deep); }

/* ---------- photos ---------- */
.gallery-heading h1 { font-size: 1.7rem; line-height: 1.15; margin: 0 0 0.25rem; color: var(--teal-deep); }
.visit-line { margin: 0 0 0.9rem; color: var(--muted); font-weight: 700; }
.date-strip { display: flex; gap: 0.55rem; overflow-x: auto; padding: 0.1rem 0.1rem 0.8rem; margin: 0 -1rem 0.4rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.date-strip::-webkit-scrollbar { display: none; }
.date-card {
  appearance: none; font: inherit; flex: 0 0 auto; min-width: 6.6rem; min-height: 64px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--white); color: var(--teal-deep); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.4rem 0.8rem; cursor: pointer; scroll-snap-align: center;
}
.date-card .dc-day { font-weight: 700; font-size: 1.1rem; }
.date-card .dc-sub { font-size: 1rem; color: var(--muted); }
.date-card.on { background: var(--teal); border-color: var(--teal); color: var(--cream); }
.date-card.on .dc-sub { color: #d7e6e4; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0 0 0.4rem; }
.act {
  appearance: none; font: inherit; font-weight: 700; color: var(--teal-deep); background: var(--white); border: 1.5px solid var(--line);
  border-radius: 14px; min-height: 64px; padding: 0.5rem 0.7rem; text-align: left; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; line-height: 1.2;
}
.act span { font-size: 1.2rem; color: var(--orange); width: 1.4rem; text-align: center; flex: 0 0 auto; }
.g-main .pair { grid-template-columns: 1fr; gap: 0.8rem; }
@media (min-width: 640px) { .g-main .pair { grid-template-columns: 1fr 1fr; } }
.g-main .pair img, .g-main .play-stage img { aspect-ratio: 16 / 10; border-radius: 12px 12px 0 0; }
.g-main .photo-card { background: var(--white); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.g-main .photo-hit { cursor: zoom-in; }
.g-main figcaption { padding: 0.25rem 0.5rem 0.25rem 0.85rem !important; font-size: 1rem !important; }
.fig-label { color: var(--muted); font-weight: 700; }
.fig-actions { gap: 0.25rem !important; }
.heart-btn, .share-one { font-size: 1rem !important; min-width: 48px; padding: 0 0.6rem !important; border-radius: 10px; }
.share-one { background: rgba(15, 85, 96, 0.08) !important; }
.room-group { cursor: default; margin-bottom: 1.6rem; }
.room-group-head h2 { font-size: 1.875rem; line-height: 1.1; cursor: pointer; }
.room-open { font-size: 1rem !important; }
.empty-note { padding: 1.5rem 0; }
.room-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.room-row {
  width: 100%; appearance: none; font: inherit; display: grid; grid-template-columns: 4.6rem 1fr auto; gap: 0.75rem; align-items: center; text-align: left;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0.4rem 0.8rem 0.4rem 0.4rem; min-height: 64px; color: var(--ink); cursor: pointer;
}
.room-row img, .room-row-ph { width: 4.6rem; height: 3.3rem; object-fit: cover; border-radius: 8px; background: var(--sand); display: block; }
.room-row-name { font-weight: 700; font-size: 1.05rem; }
.room-row-count { color: var(--muted); font-size: 1rem; }
.room-row:disabled { opacity: 0.6; cursor: default; }
.g-main .gallery-plan { max-width: 420px; }
.room-top { margin: -0.4rem 0 0.2rem; }
.btn-play { width: 100%; margin: 0 0 0.8rem; background: var(--orange) !important; color: #fff; }
.btn-play:disabled { background: var(--sand-deep) !important; color: var(--muted); }
.seg-3 .seg-btn { font-size: 1rem; }
.scrub-label span { font-weight: 700; }
.scrub-label input[type="range"] { accent-color: var(--orange); height: 44px; }
.g-main .frame-btn { border-radius: 10px; overflow: hidden; min-height: 48px; }
.g-main .frame-btn.on { border-color: var(--orange); }
.compare-box { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin: 1rem 0 1.2rem; }
.cmp-pickers { display: grid; gap: 0.25rem; margin-bottom: 0.8rem; }
.big-select {
  font: inherit; font-size: 1.05rem; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--cream); padding: 0 0.8rem; color: var(--ink); width: 100%;
}
.ba-frame { aspect-ratio: 16 / 10 !important; }
.ba-labels { font-weight: 700; font-size: 1rem !important; }

/* ---------- drone ---------- */
.video-card { background: var(--white); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); margin: 0 0 1.2rem; }
.video-card video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #04191c; }
.video-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; }
.video-meta h2 { margin: 0; font-size: 1.25rem; }
.video-meta p { margin: 0; color: var(--muted); }
.drone-grid, .fav-grid { display: grid; gap: 0.8rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .drone-grid, .fav-grid { grid-template-columns: 1fr 1fr; } }
.drone-grid img, .fav-grid img, .potw img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.drone-grid .photo-card, .fav-grid .photo-card, .potw .photo-card { margin: 0; background: var(--white); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.drone-grid figcaption, .fav-grid figcaption, .potw figcaption { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }

/* ---------- keepsakes ---------- */
.keepsakes { margin-top: 0; }
.ks-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin: 0 0 1rem; }
.ks-card h3 { margin: 0 0 0.3rem; font-size: 1.3rem; color: var(--teal-deep); }
.ks-card p { margin: 0 0 0.7rem; }
.ks-card img { width: 100%; border-radius: 10px; display: block; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 0.7rem; }
.ks-price { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; color: var(--teal-deep); }
.ks-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.ks-actions .btn-secondary { margin: 0; }

/* ---------- viewer ---------- */
.viewer { z-index: 60; }
.viewer-top { padding: calc(env(safe-area-inset-top) + 0.4rem) 0.6rem 0.4rem !important; }
.viewer-btn {
  appearance: none; border: 0; background: rgba(255,255,255,0.12); color: #f7f3ec; font: inherit; font-weight: 700; font-size: 1rem;
  min-height: 48px; min-width: 48px; padding: 0 0.9rem; border-radius: 99px; cursor: pointer; white-space: nowrap;
}
.viewer-heart.on { color: #ffb37e; }
.viewer-stage { position: relative; }
.viewer-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 72px; border: 0; border-radius: 14px;
  background: rgba(4, 25, 28, 0.45); color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.viewer-arrow.prev { left: 6px; }
.viewer-arrow.next { right: 6px; }
.viewer-bottom { padding: 0.5rem 1rem calc(env(safe-area-inset-bottom) + 0.6rem); display: grid; gap: 0.45rem; }
.viewer-caption { margin: 0; text-align: center; font-weight: 700; font-size: 1.05rem; }
.viewer-share { background: var(--orange) !important; color: #fff !important; }
.viewer-hint { padding: 0 !important; font-size: 1rem !important; }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; z-index: 2000; background: #000; color: #f7f3ec; display: flex; flex-direction: column; }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: calc(env(safe-area-inset-top) + 0.4rem) 0.6rem 0.4rem; }
.player-heading { margin: 0; font-family: var(--serif); font-size: 1.1rem; text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-stage { flex: 1; position: relative; overflow: hidden; min-height: 200px; cursor: pointer; }
.player-layer { position: absolute; inset: 0; opacity: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.player-layer.on { opacity: 1; }
.player-pic {
  position: relative; overflow: hidden; flex: 0 1 auto;
  max-width: 100%; max-height: 100%; width: auto; height: auto; line-height: 0;
}
.player-pic img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center;
  transform-origin: var(--kb-ox, 50%) var(--kb-oy, 50%);
  will-change: transform;
}
.player-layer img { width: 100%; height: 100%; object-fit: contain; }
.player-layer.kenburns.on .player-pic img {
  animation: kb-pan var(--kb-ms, 3600ms) ease-in-out forwards;
}
@keyframes kb-pan {
  from { transform: scale(1); }
  to { transform: scale(var(--kb-scale, 1.1)); }
}
@media (prefers-reduced-motion: reduce) {
  .player-layer.kenburns.on .player-pic img { animation: none; }
  .player-layer { transition: none !important; }
}
.player-card { text-align: center; padding: 1.5rem; }
.player-card h2 { color: #fffcf8; font-size: 2rem; margin: 0.3rem 0 0; }
.player-card-sub { color: #f2a36b; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0; font-size: 1rem; }
.player-caption {
  position: absolute; left: 0.8rem; bottom: 0.8rem; margin: 0; max-width: calc(100% - 1.6rem);
  background: rgba(7, 44, 50, 0.78); color: #fffcf8; font-weight: 700; padding: 0.45rem 0.85rem; border-radius: 99px; font-size: 1rem;
}
.player-controls { padding: 0.6rem 1rem calc(env(safe-area-inset-bottom) + 0.8rem); display: grid; gap: 0.6rem; }
.player-progress { width: 100%; height: 44px; accent-color: var(--orange); }
.player-row { display: flex; align-items: center; justify-content: center; gap: 1.4rem; }
.player-play {
  width: 76px; height: 76px; border-radius: 50%; border: 0; background: #fffcf8; color: var(--teal-deep); font-size: 1.8rem; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.player-step { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.4); background: transparent; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }
.speed-row { display: flex; gap: 0.5rem; justify-content: center; }
.speed-chip { flex: 1; max-width: 8rem; min-height: 48px; border-radius: 99px; border: 1.5px solid rgba(255,255,255,0.45); background: transparent; color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.speed-chip.on { background: #fffcf8; color: var(--teal-deep); border-color: #fffcf8; }
.player-tip { margin: 0; text-align: center; font-size: 1rem; color: #cfdcda; }
@media (orientation: landscape) and (max-height: 500px) {
  .player-controls { grid-template-columns: 1fr auto auto; align-items: center; }
  .player-progress { grid-column: 1 / -1; }
  .player-tip { display: none; }
}
.render-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(4,25,28,0.72); display: grid; place-items: center; padding: 1rem; }
.render-card { background: var(--cream); color: var(--ink); border-radius: 18px; padding: 1.3rem; width: min(420px, 100%); text-align: center; }
.render-card h2 { margin: 0 0 0.4rem; color: var(--teal-deep); }
.render-bar { height: 12px; background: var(--sand-deep); border-radius: 99px; overflow: hidden; margin: 0.8rem 0 0.3rem; }
.render-bar span { display: block; height: 100%; width: 0; background: var(--orange); transition: width 0.2s linear; }
.render-pct { margin: 0; font-weight: 700; }

/* ---------- share sheet ---------- */
#share-root { z-index: 95; }
.share-preview { background: var(--sand); border-radius: 12px; overflow: hidden; margin: 0 0 0.6rem; min-height: 140px; display: grid; place-items: center; }
.share-preview img, .share-preview video { display: block; width: 100%; height: auto; max-height: 46dvh; object-fit: contain; background: #fff; }
.share-preview-wait { color: var(--muted); font-weight: 700; padding: 2rem 1rem; }
.share-thumbs { gap: 0.45rem !important; }
.share-thumb { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; flex: 0 0 auto; width: 64px; height: 64px; cursor: pointer; }
.share-thumb.on { border-color: var(--orange); }
.share-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share-logo-note { margin-top: 0; }
.share-main { display: grid; gap: 0.6rem; margin: 0.6rem 0 0.8rem; }
.share-main.fb-first .btn-facebook { order: -1; }
.family-row { border-top: 1px solid var(--line); padding-top: 0.6rem; }
.share-app { min-height: 52px; font-size: 1rem !important; }
.sheet-close { font-size: 1.05rem !important; }

/* ---------- panel maker ---------- */
.panel-maker { position: fixed; inset: 0; z-index: 75; background: var(--cream); display: flex; flex-direction: column; }
.pm-loading { margin: auto; font-weight: 700; color: var(--teal-deep); font-size: 1.15rem; padding: 2rem; text-align: center; }
.pm-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; background: var(--teal-deep); color: var(--cream); padding: calc(env(safe-area-inset-top) + 0.4rem) 0.6rem 0.4rem; }
.pm-top h2 { margin: 0; font-size: 1.2rem; color: var(--cream); }
.pm-undo:disabled { opacity: 0.4; }
.pm-scroll { flex: 1; overflow-y: auto; padding: 0.9rem 1rem calc(env(safe-area-inset-bottom) + 2rem); -webkit-overflow-scrolling: touch; }
.pm-intro { margin: 0 0 0.6rem; color: var(--muted); }
.pm-carousel { display: flex; gap: 0.8rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1rem; padding: 0.2rem 1rem 0.4rem; scrollbar-width: none; }
.pm-carousel::-webkit-scrollbar { display: none; }
.pm-card { flex: 0 0 84%; max-width: 420px; margin: 0; scroll-snap-align: center; }
.pm-canvas-wrap { background: #fff; border-radius: 14px; box-shadow: 0 8px 26px rgba(7,44,50,0.14); overflow: hidden; border: 2px solid transparent; }
.pm-card.on .pm-canvas-wrap { border-color: var(--orange); }
.pm-card canvas { display: block; width: 100%; height: auto; cursor: pointer; }
.pm-card figcaption { text-align: center; font-weight: 700; color: var(--teal-deep); margin-top: 0.4rem; }
.pm-dots { display: flex; justify-content: center; gap: 0.2rem; margin: 0.2rem 0 0.7rem; }
.pm-dot { width: 44px; height: 44px; border: 0; background: none; position: relative; cursor: pointer; }
.pm-dot::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--sand-deep); }
.pm-dot.on::after { background: var(--orange); }
.pm-post { margin: 0 0 1.2rem; }
.pm-h { font-size: 1.35rem; margin: 0.4rem 0 0.4rem; color: var(--teal-deep); }
.pm-label { font-weight: 700; margin: 1rem 0 0.45rem; color: var(--teal-deep); }
.pm-hint { font-weight: 400; color: var(--muted); }
.pm-tiles { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.3rem; }
.pm-tile {
  flex: 0 0 auto; width: 6.4rem; appearance: none; font: inherit; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); padding: 0.3rem; cursor: pointer;
  display: flex; flex-direction: column; gap: 0.25rem; align-items: stretch; font-size: 1rem; font-weight: 700; color: var(--teal-deep);
}
.pm-tile.is-hero { border-color: var(--orange); }
.pm-tile img, .pm-tile-plan, .pm-tile-empty { width: 100%; height: 3.8rem; object-fit: cover; border-radius: 8px; display: grid; place-items: center; background: var(--sand); font-size: 1rem; }
.pm-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pm-seg-btn {
  appearance: none; font: inherit; font-weight: 700; font-size: 1rem; min-height: 76px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--white); color: var(--teal-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; cursor: pointer; line-height: 1.15; padding: 0.3rem;
}
.pm-seg-btn.on, .pm-layout.on { border-color: var(--teal); background: rgba(15,85,96,0.1); box-shadow: inset 0 0 0 1px var(--teal); }
.pm-shape { display: block; border: 2px solid currentColor; border-radius: 3px; }
.pm-shape-square { width: 24px; height: 24px; }
.pm-shape-post { width: 22px; height: 27px; }
.pm-shape-story { width: 17px; height: 30px; }
.pm-layouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
.pm-layout {
  appearance: none; font: inherit; font-weight: 700; font-size: 1rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--white); color: var(--teal-deep);
  padding: 0.45rem 0.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; cursor: pointer; line-height: 1.1; min-height: 96px; text-align: center;
}
.pm-diagram { width: 44px; height: 54px; display: grid; gap: 2px; }
.pm-diagram i { background: var(--teal); border-radius: 2px; opacity: 0.75; display: none; }
.pm-d-big4 { grid-template: 3fr 1fr / repeat(4, 1fr); }
.pm-d-big4 i:nth-child(1) { grid-column: 1 / -1; }
.pm-d-big4 i:nth-child(-n+5) { display: block; }
.pm-d-big5 { grid-template: 3fr 1fr 1fr / repeat(3, 1fr); }
.pm-d-big5 i:nth-child(1) { grid-column: 1 / -1; }
.pm-d-big5 i:nth-child(-n+6) { display: block; }
.pm-d-big5 i:nth-child(5) { grid-column: span 1; }
.pm-d-big6 { grid-template: 2.4fr 1fr 1fr / repeat(3, 1fr); }
.pm-d-big6 i:nth-child(1) { grid-column: 1 / -1; }
.pm-d-big6 i:nth-child(-n+7) { display: block; }
.pm-d-thenNow { grid-template: 1fr 1fr / 1fr; }
.pm-d-thenNow i:nth-child(-n+2) { display: block; }
.pm-switch { margin-top: 1rem; }
.pm-scroll .text-input, .pm-scroll textarea { width: 100%; font: inherit; font-size: 1.05rem; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0.6rem 0.8rem; background: #fff; }
.pm-scroll .btn-secondary { margin: 1rem 0 0.8rem; }
.pm-sheet { position: absolute; inset: 0; background: rgba(7,44,50,0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 5; }
.pm-sheet-card { background: var(--cream); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 1.1rem 1.1rem calc(env(safe-area-inset-bottom) + 1rem); display: grid; gap: 0.6rem; }
.pm-sheet-card h3 { margin: 0; font-size: 1.3rem; color: var(--teal-deep); }
.pm-sheet-card.tall { max-height: 88dvh; overflow-y: auto; }
.pm-picker-head { display: flex; justify-content: space-between; align-items: center; }
.pm-picker-close { width: auto; min-height: 48px; }
.pm-date-row { display: flex; gap: 0.45rem; overflow-x: auto; padding-bottom: 0.2rem; }
.pm-date-row .chip { min-height: 48px; font-size: 1rem; flex: 0 0 auto; }
.pm-pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.pm-pick { appearance: none; font: inherit; padding: 0; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); overflow: hidden; text-align: left; cursor: pointer; }
.pm-pick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.pm-pick span { display: block; padding: 0.35rem 0.5rem; font-weight: 700; font-size: 1rem; color: var(--teal-deep); }

/* ---------- settings / sheets ---------- */
.retake-sheet { z-index: 85 !important; }
.settings-card { max-height: 90dvh; overflow-y: auto; }
.settings-card h3 { margin: 0.6rem 0 0; font-size: 1.2rem; }
.sheet-row { display: flex; justify-content: space-between; align-items: center; }
.sheet-row .btn-text { width: auto !important; }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 56px; font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
.switch-row input { width: 52px; height: 32px; accent-color: var(--teal); }
.fam-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.fam-list li { display: flex; justify-content: space-between; align-items: center; background: var(--white); border-radius: 10px; padding: 0.3rem 0.3rem 0.3rem 0.8rem; }
.fam-remove { width: auto !important; }
.check-row { min-height: 48px; font-size: 1rem; }
.check-row input { width: 24px; height: 24px; }

/* ---------- tour ---------- */
.tour { position: fixed; inset: 0; z-index: 88; background: rgba(4, 25, 28, 0.66); display: flex; align-items: flex-end; justify-content: center; }
.tour-card { position: relative; background: var(--cream); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 1.4rem 1.3rem calc(env(safe-area-inset-bottom) + 1.1rem); text-align: center; animation: sheet-up 0.28s ease; }
.tour-card h2 { font-size: 1.6rem; margin: 0.3rem 0 0.4rem; color: var(--teal-deep); }
.tour-card p { margin: 0 0 1rem; font-size: 1.1rem; }
.tour-step { color: var(--muted); font-weight: 700; margin: 0 !important; font-size: 1rem !important; }
.tour-skip { position: absolute; top: 0.5rem; right: 0.6rem; width: auto !important; min-height: 48px; }
.tour-icon svg { width: 160px; height: 106px; }
.t-photo { fill: #d5e3e1; stroke: var(--teal); stroke-width: 2; }
.t-photo.dim { opacity: 0.5; }
.t-arrow { fill: none; stroke: var(--orange); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.t-dot { fill: var(--orange); }

/* ---------- visit link page ---------- */
.visit-hero { width: 100%; border-radius: 16px; aspect-ratio: 16 / 10; object-fit: cover; display: block; margin-bottom: 0.8rem; }
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.visit-tile { appearance: none; padding: 0; border: 0; background: var(--white); border-radius: 10px; overflow: hidden; text-align: left; font: inherit; cursor: zoom-in; }
.visit-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.visit-tile span { display: block; padding: 0.35rem 0.5rem; font-weight: 700; font-size: 1rem; color: var(--teal-deep); }
.visit-foot { text-align: center; margin-top: 1.2rem; }
.visit-logo { display: block; width: 140px; margin: 0.4rem auto 1rem; }
picture:has(.visit-logo) { display: contents; }
.visit-page { padding-bottom: 2rem; }
.heart-btn, .share-one { white-space: nowrap; }

/* Drone tab built from visit aerials (Sample Home) */
.act-wide { width: 100%; justify-content: center; margin: 0 0 1rem; }
.drone-visit { margin: 0 0 1.4rem; }
.drone-visit h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.step-btn.is-past { cursor: default; }
.is-past .step-date::after { content: none; }

/* ---------- install card (Home tab) ---------- */
.install-card { display: flex; align-items: center; gap: 0.3rem; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 0.45rem 0.3rem 0.45rem 0.45rem; margin: 0 0 1rem; }
.install-go { flex: 1; display: flex; align-items: center; gap: 0.7rem; min-height: 54px; padding: 0.3rem 0.8rem 0.3rem 0.35rem; border: 0; border-radius: 12px; background: var(--teal); color: var(--cream); font: inherit; font-size: 1.05rem; font-weight: 700; text-align: left; cursor: pointer; }
.install-go img { width: 40px; height: 40px; border-radius: 9px; background: var(--cream); }
.install-x { width: 40px; height: 48px; border: 0; background: none; color: var(--muted); font-size: 1.05rem; cursor: pointer; }
.ui-chip { display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 700; white-space: nowrap; }
#headLogo { cursor: default; -webkit-user-select: none; user-select: none; }

/* ---------- builder demo ---------- */
.demo { position: fixed; inset: 0; z-index: 75; background: var(--cream); color: var(--ink); display: flex; flex-direction: column; overflow: hidden; }
.demo-top { display: grid; grid-template-columns: 92px 1fr 92px; align-items: center; padding: calc(var(--safe-top) + 0.5rem) 0.6rem 0.5rem; background: var(--teal-deep); color: var(--cream); }
.demo-top h1 { margin: 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--cream); }
.demo-brand { font-family: var(--script); font-size: 1.3rem; color: #f3d9b1; padding-left: 0.3rem; white-space: nowrap; }
.demo-back, .demo-close { min-height: 44px; border: 0; background: none; color: var(--cream); font: inherit; font-weight: 700; cursor: pointer; }
.demo-back svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.demo-close { justify-self: end; }
.demo-main { flex: 1; overflow-y: auto; padding: 1rem 1rem calc(var(--safe-bot) + 1.5rem); -webkit-overflow-scrolling: touch; }
.demo-start { display: flex; flex-direction: column; gap: 0.7rem; padding-top: 1.2rem; }
.demo-tile { display: grid; grid-template-columns: 52px 1fr 20px; align-items: center; gap: 0.8rem; width: 100%; min-height: 76px; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 18px; background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 2px 10px rgba(7, 44, 50, 0.05); }
.demo-tile strong { display: block; font-family: var(--serif); font-size: 1.22rem; color: var(--teal-deep); font-weight: 600; }
.demo-tile small { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 0.1rem; }
.demo-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--sky); display: flex; align-items: center; justify-content: center; color: var(--teal); }
.demo-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.demo-chev { font-size: 1.8rem; color: var(--muted); }
.demo-lede { margin: 0 0 0.8rem; font-size: 1.05rem; color: var(--muted); }
.demo-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.demo-pick { padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--white); font: inherit; cursor: pointer; text-align: left; }
.demo-pick img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.demo-pick span { display: block; padding: 0.5rem 0.65rem; font-weight: 700; color: var(--teal-deep); }
.demo-points { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 0.45rem; }
.demo-points li { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; }
.demo-points svg, .pv-done svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--teal); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.demo-note { color: var(--muted); font-size: 0.98rem; margin: 0.6rem 0 1rem; }

.pv-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0b2a2f; }
.pv-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-after { opacity: 0; transition: opacity 0.9s ease; }
.pv-stage.cleaned .pv-after { opacity: 1; }
.pv-patches, .pv-boxes { position: absolute; inset: 0; }
.pv-patch { position: absolute; opacity: 0; transition: opacity 1s ease; background-repeat: no-repeat; }
.pv-patch.on { opacity: 1; }
.pv-box { position: absolute; border: 2px solid var(--orange); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); opacity: 0; transform: scale(1.15); transition: opacity 0.25s ease, transform 0.25s ease; }
.pv-box.on { opacity: 1; transform: none; }
.pv-box.fade { opacity: 0 !important; transition: opacity 0.9s ease 0.2s; }
.pv-box span { position: absolute; left: -2px; bottom: 100%; margin-bottom: 2px; background: var(--orange); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.pv-box.inner span { bottom: auto; top: 100%; margin: 2px 0 0; background: #b4541a; }
.pv-scan { position: absolute; top: 0; bottom: 0; width: 22%; left: -25%; background: linear-gradient(90deg, transparent, rgba(232, 118, 43, 0.28), transparent); opacity: 0; pointer-events: none; }
.pv-stage.scanning .pv-scan { opacity: 1; animation: pvScan 1.3s linear infinite; }
@keyframes pvScan { from { left: -25%; } to { left: 105%; } }
.pv-ba { position: absolute; inset: 0; }
.pv-ba-before { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-ba-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.4); pointer-events: none; }
.pv-ba-line span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--teal-deep); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.pv-tag { position: absolute; top: 8px; background: rgba(4, 25, 28, 0.7); color: #fff; font-size: 0.78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; pointer-events: none; }
.pv-tag.l { left: 8px; } .pv-tag.r { right: 8px; }
.pv-ba input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.pv-status { margin-top: 1rem; }
.pv-bar { height: 6px; border-radius: 3px; background: var(--sand-deep); overflow: hidden; }
.pv-bar i { display: block; height: 100%; width: 0; background: var(--teal); }
.pv-status p { margin: 0.6rem 0 0; font-weight: 700; color: var(--teal-deep); font-size: 1.05rem; }
.pv-result { margin-top: 0.9rem; }
.pv-done { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.5rem; font-family: var(--serif); font-size: 1.3rem; color: var(--teal-deep); }
.pv-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pv-chips span { padding: 0.25rem 0.65rem; border-radius: 999px; background: #fbe6d6; color: var(--orange-ink); font-weight: 700; font-size: 0.9rem; }

.demo-name .demo-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.demo-field { display: block; margin: 0 0 0.6rem; }
.demo-field span { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 0.2rem; color: var(--muted); }
.demo-field .text-input { width: 100%; }
.demo-name .btn-big { margin-top: 0.4rem; }
.demo-sign { margin: 1.2rem auto 0; padding: 1.1rem 1rem; text-align: center; border-radius: 16px; background: var(--teal-deep); color: var(--cream); }
.demo-sign small { display: block; font-family: var(--script); font-size: 1.5rem; color: #f3d9b1; }
.demo-sign strong { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.15; }
.demo-sign.pop { animation: signPop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes signPop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pv-stage.scanning .pv-scan, .demo-sign.pop { animation: none; } }


/* Share detail / Make your own editor */
.share-detail { background: var(--cream, #f7f4ef); }
.share-detail .sd-top { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; background: var(--teal-deep); color: #fff; }
.share-detail .sd-top h1 { color: #fff; font-size: 20px; margin: 0; font-family: Fraunces, Georgia, serif; font-weight: 600; text-align: center; flex: 1; }
.share-detail .sd-close,
.share-detail .sd-undo { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; height: 40px; padding: 0 16px; font: 600 17px inherit; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.share-detail .sd-undo:disabled { opacity: 0.4; }
.share-detail .sd-scroll { flex: 1; overflow-y: auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 40px); }
.share-detail .sd-hero-wrap { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(11,58,66,.06), 0 6px 18px rgba(11,58,66,.05); overflow: hidden; }
.share-detail .sd-hero { display: block; width: 100%; height: auto; cursor: pointer; }
.share-detail .sd-meta { font-size: 16px; color: var(--muted); margin: 10px 0 14px; text-align: center; }
.share-detail .sd-share { width: 100%; min-height: 54px; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.share-detail .sd-share svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-detail .sd-h { font-size: 22px; margin: 28px 0 10px; color: var(--teal-deep); }
.share-detail .sd-label { display: block; font-size: 16px; font-weight: 600; color: var(--ink, #1b2326); margin: 16px 0 8px; }
.share-detail .sd-hint { font-weight: 400; color: var(--muted); }
.share-detail .sd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.share-detail .sd-chip { border: 1.5px solid var(--line, #e6e0d6); background: #fff; border-radius: 999px; padding: 10px 16px; font-size: 16px; color: var(--teal-deep); cursor: pointer; }
.share-detail .sd-chip.on { border-color: var(--teal-deep); background: var(--teal-deep); color: #fff; font-weight: 600; }
.share-detail .sd-field { width: 100%; border: 1.5px solid var(--line, #e6e0d6); background: #fff; border-radius: 12px; padding: 14px; font: 17px inherit; color: inherit; }
.share-detail .sd-photos { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.share-detail .pm-tile { flex: 0 0 104px; background: #fff; border-radius: 12px; border: 1.5px solid var(--line, #e6e0d6); overflow: hidden; text-align: center; font-size: 13px; font-weight: 600; color: var(--teal-deep); padding: 0; }
.share-detail .pm-tile.is-hero { border-color: var(--gold, #c8a36a); }
.share-detail .pm-tile img, .share-detail .pm-tile-plan, .share-detail .pm-tile-empty { width: 100%; height: 78px; object-fit: cover; display: block; border-radius: 0; }
.share-detail .pm-tile.is-plan img, .share-detail .pm-tile-plan { object-fit: contain; background: #f3ece2; }
.share-detail .pm-tile span { display: block; padding: 6px 4px; }

/* ---------- player full screen (see player.js enterMax) ----------
   Never rotated. Upright: the picture spans the screen width, centred, black above/below.
   Sideways: it fills the landscape screen (black side bars only if the shape needs them).
   The picture box is inset by the safe areas so the notch / home bar never cover it. */
.pl-exit { display: none; }
html.player-max-lock, body.player-max-lock { overflow: hidden; overscroll-behavior: none; background: #000; }
body.player-max-lock { touch-action: none; }
body.player-max-lock .tabbar,
body.player-max-lock .hx-top { visibility: hidden !important; pointer-events: none; }
.player.is-max, .player.is-max-css {
  background: #000; inset: 0; width: 100%; width: 100vw; height: 100%; height: 100vh; height: 100dvh;
  z-index: 2000;
}
.player.is-max .player-top, .player.is-max .player-controls { display: none !important; }
.player.is-max .player-stage {
  position: fixed; inset: 0; z-index: 1; min-height: 0; width: auto; height: auto;
  background: #000; transform: none; overflow: hidden; touch-action: none;
}
.player.is-max .player-layer {
  top: env(safe-area-inset-top); right: env(safe-area-inset-right);
  bottom: env(safe-area-inset-bottom); left: env(safe-area-inset-left);
}
.player.is-max .player-pic { max-width: 100%; max-height: 100%; }
.player.is-max .player-layer img,
.player.is-max.is-story .player-layer img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.player.is-story .player-caption { display: none !important; }
.player.is-max .player-caption {
  left: calc(env(safe-area-inset-left) + 0.8rem);
  bottom: calc(env(safe-area-inset-bottom) + 0.8rem);
  max-width: calc(100% - 1.6rem - env(safe-area-inset-left) - env(safe-area-inset-right));
}
.player.is-max .pl-exit {
  display: flex; align-items: center; justify-content: center; position: absolute; z-index: 3;
  top: calc(env(safe-area-inset-top) + 10px); right: calc(env(safe-area-inset-right) + 10px);
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.55); color: #fff; font-size: 20px; cursor: pointer;
}

/* Clip videos in the same letterbox full-screen shell (see openClipPlayer). */
.player.is-max video.player-clip {
  width: 100%; height: 100%;
  object-fit: contain; object-position: center; background: #000;
}
/* Compact speed control in the letterbox gutter so the windowed chrome is not needed. */
.player:not(.is-max) .pl-fs-speed { display: none; }
.player.is-max .pl-fs-speed {
  display: flex; align-items: center; justify-content: center;
  position: absolute; z-index: 3;
  right: calc(env(safe-area-inset-right) + 0.8rem);
  bottom: calc(env(safe-area-inset-bottom) + 0.8rem);
  height: 36px; padding: 0 12px; border-radius: 99px;
  border: 1.5px solid rgba(255,255,255,0.45); background: rgba(0,0,0,0.55);
  color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
}
.pl-share { display: none; }
.player.is-max .pl-share {
  display: flex; align-items: center; justify-content: center; position: absolute; z-index: 3;
  top: calc(env(safe-area-inset-top) + 10px); right: calc(env(safe-area-inset-right) + 64px);
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; padding: 0;
}
.pl-share svg, .pl-end svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* End screen: Share this, Watch again. Sits over the last picture; ✕ stays on top. */
.pl-end {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6); padding: 24px; cursor: default;
}
.pl-end[hidden] { display: none; }
.pl-end-card { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(320px, 100%); text-align: center; }
.pl-end-title { margin: 0 0 6px; color: #f7f4ef; font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.2; }
.pl-end-share, .pl-end-again {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; border-radius: 999px; font: inherit; font-size: 18px; font-weight: 600; cursor: pointer;
}
.pl-end-share { border: 0; background: #c8a36a; color: #1f1a12; }
.pl-end-again { border: 1.5px solid rgba(255, 255, 255, 0.55); background: rgba(0, 0, 0, 0.25); color: #fff; min-height: 50px; font-size: 17px; }
.player.is-ended .player-caption,
.player.is-ended .pl-fs-speed { display: none !important; }
/* Sharing from the player: the sheet and toasts sit above it. */
body.viewer-open #share-root { z-index: 2100; }
body.viewer-open .s2f-toast { z-index: 2200; }
.player.is-max .pl-exit,
.player.is-max .pl-share,
.player.is-max .pl-fs-speed {
  opacity: 1;
  transition: opacity 0.35s ease;
}
.player.is-max.hud-off .pl-exit,
.player.is-max.hud-off .pl-share,
.player.is-max.hud-off .pl-fs-speed {
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .player.is-max .pl-exit,
  .player.is-max .pl-share,
  .player.is-max .pl-fs-speed { transition: none; }
}
/* Aerial / drone clip cards open the full-screen player instead of playing inline. */
.video-card-open {
  display: block; width: 100%; padding: 0; border: 0; background: #04191c;
  cursor: pointer; position: relative;
}
.video-card-open::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px;
  margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(0,0,0,0.45) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M8 5v14l11-7z'/></svg>") 54% 50% / 28px no-repeat;
  pointer-events: none;
}
