@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Allura";
  src: url("../fonts/allura-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Follow the iPhone’s own text size (Settings → Display → Text Size). */
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; }
}

:root {
  --ink: #1a2628;
  --muted: #3d5156;
  --teal: #0f5560;
  --teal-dark: #0a3c44;
  --teal-deep: #072c32;
  --orange: #e8762b;
  --orange-ink: #7a320e;
  --cream: #f7f3ec;
  --sand: #efe8dc;
  --sand-deep: #e4d9c8;
  --sky: #eef3f2;
  --white: #fffcf8;
  --line: rgba(15, 85, 96, 0.16);
  --gold: #a68556;
  --bg: #f7f3ec;
  --heading: #072c32;
  --link: #0f5560;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --script: "Allura", "Segoe Script", cursive;
  --header: 3.5rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; font-size: max(17px, 1rem); }

#app { min-height: 100dvh; display: flex; flex-direction: column; }
#app.busy { cursor: wait; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--teal-deep);
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: 1.65rem; line-height: 1.2; }
h2 { font-size: 1.15rem; }

.script {
  font-family: var(--script);
  font-size: 1.85rem;
  color: var(--teal);
  line-height: 1;
  display: block;
}
.script.mini { font-size: 1.25rem; color: var(--teal); }

.lede { color: var(--muted); margin: 0.35rem 0 1rem; }
.fine-print { font-size: 1rem; color: var(--muted); line-height: 1.4; margin: 0.25rem 0 0.8rem; }

/* ---- top bar ---- */
.topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: calc(var(--safe-top) + 0.7rem) 1rem 0.7rem;
  background: var(--teal-deep);
  color: var(--cream);
  align-items: center;
}
.topbar .brand strong {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--cream);
}
.topbar .brand span { display: block; font-size: 1rem; color: #d7c4a8; }
.topbar .script { color: #f3e6d2; font-size: 1.7rem; margin-bottom: 0.1rem; }

.plan-bar {
  grid-template-columns: 2.2rem 1fr auto;
  column-gap: 0.6rem;
}
.plan-bar .brand.tight strong { font-size: 1rem; }
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-size: 1.25rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0;
  line-height: 1;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); }
.text-link {
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--orange);
}
.text-link:hover { color: #fff; }

/* ---- picker ---- */
.picker { padding: 1.4rem 1.15rem 2rem; }
.customer-list { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.customer-card {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  padding: 1rem 1.1rem;
  border-radius: 2px;
  color: inherit;
  font: inherit;
  display: grid;
  gap: 0.15rem;
}
.customer-card:active, .customer-card:hover { border-left-color: var(--orange); }
.cname { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; color: var(--teal-deep); }
.csite { font-weight: 700; color: var(--ink); }
.ccomm { font-size: 0.85rem; color: var(--muted); }

/* ---- progress + plan ---- */
.progress-wrap { padding: 0.55rem 1rem 0.35rem; background: var(--sand); }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-deep);
  margin-bottom: 0.3rem;
}
.next-hint { color: var(--orange-ink); font-weight: 700; }
.progress-bar {
  height: 4px;
  background: rgba(15, 85, 96, 0.15);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
}

.plan-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.5rem 0.2rem;
  min-height: 0;
}
.plan-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  line-height: 0;
  background: var(--cream);
}
.plan-frame img, .plan-frame svg {
  width: 100%;
  height: auto;
  display: block;
}
.plan-frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hotspot {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.15s ease;
}
.hotspot:hover, .hotspot:active { fill: rgba(15, 85, 96, 0.14); }
.hotspot.done { fill: rgba(15, 85, 96, 0.20); stroke: var(--teal); }
.hotspot.next {
  fill: rgba(232, 118, 43, 0.22);
  stroke: var(--orange);
  animation: pulse 1.6s ease-in-out infinite;
}
.hotspot.has { fill: rgba(15, 85, 96, 0.16); }
.hotspot.on { fill: rgba(232, 118, 43, 0.28); stroke: var(--orange); }

@keyframes pulse {
  0%, 100% { fill: rgba(232, 118, 43, 0.16); }
  50% { fill: rgba(232, 118, 43, 0.32); }
}

.room-label {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  fill: var(--teal-deep);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(247, 243, 236, 0.9);
  stroke-width: 3px;
}
.room-label.is-done { font-size: 13px; fill: var(--teal); }
.mark { pointer-events: none; }
.mark-disc { fill: var(--teal); }
.mark-ring { fill: none; stroke: var(--cream); stroke-width: 2; }
.mark-check { fill: none; stroke: var(--cream); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.exterior-row, .date-row, .room-toolbar {
  display: flex;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.exterior-row::-webkit-scrollbar, .date-row::-webkit-scrollbar { display: none; }

.chip {
  appearance: none;
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--teal-deep);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  white-space: nowrap;
}
.chip.done { background: var(--teal); color: var(--cream); border-color: var(--teal); }
.chip.next { border-color: var(--orange); color: var(--orange-ink); background: rgba(232, 118, 43, 0.12); }
.chip.on { background: var(--teal); color: var(--cream); border-color: var(--teal); }

.done-row { padding: 0.4rem 0.9rem calc(var(--safe-bot) + 0.8rem); }
.btn-primary {
  appearance: none;
  border: 0;
  background: var(--teal);
  color: var(--cream);
  font: inherit;
  font-weight: 700;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 2px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-done { font-size: 1.05rem; }
.btn-text {
  appearance: none;
  border: 0;
  background: none;
  color: var(--teal);
  font: inherit;
  font-weight: 700;
  padding: 0.6rem;
  width: 100%;
  cursor: pointer;
}
.btn-text.back-latest { width: auto; padding: 0.35rem 0.2rem; font-size: 0.85rem; }

/* ---- shot ---- */
.shot-stage { padding: 0.8rem 1rem calc(var(--safe-bot) + 1rem); display: flex; flex-direction: column; gap: 0.6rem; }
.viewfinder {
  position: relative;
  background: var(--teal-deep);
  color: var(--cream);
  min-height: 280px;
  aspect-ratio: 3 / 4;
  max-height: 52dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewfinder img, .viewfinder video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.viewfinder .ghost { opacity: 0.35; pointer-events: none; mix-blend-mode: normal; }
.viewfinder .preview.faint { opacity: 0.55; }
.vf-note {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--cream);
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}
.ghost-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--teal-deep);
  font-size: 0.95rem;
}

/* Photo name on the shot screen: "Room, detail". */
.shot-name { display: flex; flex-direction: column; gap: 0.3rem; width: 100%; }
.shot-name-label { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.shot-name-row { display: flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.75rem; border: 1px solid rgba(15, 85, 96, 0.25); border-radius: 12px; background: var(--card, #fff); }
.shot-name-row strong { font-size: 1.0625rem; color: var(--teal-deep); white-space: nowrap; }
.shot-name-row input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.0625rem; color: inherit; padding: 0.6rem 0; outline: none; }

/* ---- done / notify ---- */
.done-stage { padding: 1.2rem 1.15rem calc(var(--safe-bot) + 1.5rem); }
.message {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  padding: 0.9rem 1rem;
  margin: 0 0 0.8rem;
}
.message .via { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange-ink); margin: 0 0 0.4rem; }
.message p, .message pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
}

/* ---- gallery ---- */
.date-row { background: var(--sand); padding-top: 0.6rem; padding-bottom: 0.6rem; }
.gallery { padding: 1rem 1rem calc(var(--safe-bot) + 2rem); }
.gallery-plan { margin: 0.4rem auto 1.2rem; max-width: 360px; }
.gallery-plan .hotspot { cursor: pointer; }
.room-group { margin: 0 0 1.4rem; cursor: pointer; }
.room-group h2 { margin: 0 0 0.5rem; }
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.pair figure, .play-stage figure {
  margin: 0;
  background: var(--sand);
}
.pair img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--sand-deep);
}
.pair figcaption, .play-stage figcaption {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.3rem 0.35rem 0.4rem;
}
.pair figure.empty {
  min-height: 8rem;
  display: flex;
  align-items: flex-end;
  background: var(--sky);
}

.room-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-content: stretch;
  background: var(--sand);
  gap: 0.45rem 0.6rem;
}
.shot-toggle { display: flex; gap: 0.3rem; grid-column: 1 / -1; justify-content: center; }
.vf-caption { margin: 0.15rem 0 0; font-size: 0.92rem; color: var(--muted); text-align: center; }
.btn-play {
  appearance: none;
  border: 0;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  cursor: pointer;
}
.btn-play:disabled { opacity: 0.4; }
.play-date {
  text-align: center;
  font-family: var(--serif);
  color: var(--teal-deep);
  font-size: 1.05rem;
  margin: 0.2rem 0 0.7rem;
}
.play-stage {
  margin-bottom: 1rem;
}
.play-stage img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; display: block; }
.filmstrip {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0.2rem 0 0.6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.frame-btn {
  appearance: none;
  border: 2px solid transparent;
  background: var(--white);
  padding: 0;
  width: 5.4rem;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.frame-btn img { width: 100%; height: 3.6rem; object-fit: cover; display: block; }
.frame-btn span { display: block; font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.2rem; }
.frame-btn.on { border-color: var(--orange); color: var(--orange-ink); }

.gallery-empty { padding: 3rem 1.2rem; text-align: center; }

#camera {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---- Gallery typography & targets (easy for older eyes and hands) ---- */
.gallery-bar {
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.75rem;
}
.gallery-bar .brand.tight .script.mini { margin-bottom: 0.15rem; }
.select-launch {
  min-height: 48px;
  padding: 0.45rem 0.7rem;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  color: var(--teal-deep);
  background: var(--cream);
  border: 0;
  border-radius: 99px;
  text-decoration: none;
}
.select-launch:hover { color: var(--teal-deep); background: var(--white); }
.gallery-heading { margin-bottom: 0.5rem; }
.btn-share-day {
  margin: 0.75rem 0 0.25rem;
  min-height: 52px;
  font-size: 1.05rem;
}
.room-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.45rem;
}
.room-group-head h2 { margin: 0; }
.room-open {
  width: auto;
  padding: 0.45rem 0;
  min-height: 48px;
  font-size: 1rem;
  text-align: right;
}
.pair figcaption, .play-stage figcaption {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.45rem 0.15rem 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 48px;
}
.share-one {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  min-height: 48px;
  padding: 0 0.4rem;
  cursor: pointer;
}
.share-one:hover { color: var(--teal-dark); }

.chip {
  min-height: 48px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
}
.btn-play {
  min-height: 48px;
  padding: 0.5rem 1.1rem;
  font-size: 1rem;
}
.btn-text.back-latest {
  min-height: 48px;
  font-size: 1rem;
}
.frame-btn { min-width: 5.8rem; }
.frame-btn img { height: 4.2rem; }
.frame-btn span { font-size: 1rem; padding: 0.35rem 0.2rem; }

.btn-secondary {
  appearance: none;
  border: 2px solid var(--teal);
  background: transparent;
  color: var(--teal-deep);
  font: inherit;
  font-weight: 700;
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  margin-top: 0.45rem;
}

/* ---- Select mode ---- */
.sel-box {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(7, 44, 50, 0.45);
  color: var(--cream);
  font-weight: 700;
  font-size: 1.05rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  pointer-events: none;
}
.sel-box.on { background: var(--teal); border-color: var(--cream); }
.is-selecting .sel-box { display: flex; }
.photo-hit { position: relative; line-height: 0; }
.photo-card.is-selected img { outline: 3px solid var(--orange); outline-offset: -3px; }
.select-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--teal-deep);
  color: var(--cream);
  padding: 0.7rem 0.9rem calc(var(--safe-bot) + 0.8rem);
  box-shadow: 0 -8px 24px rgba(7, 44, 50, 0.18);
}
.select-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.select-bar-top p {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.select-bar .sel-cancel {
  width: auto;
  color: var(--cream);
  min-height: 48px;
  padding: 0.4rem 0.2rem;
}
.select-bar .btn-primary { background: var(--orange); color: #fff; }
.select-bar .btn-primary:disabled { opacity: 0.45; }
.select-bar .btn-secondary {
  border-color: var(--cream);
  color: var(--cream);
}

/* ---- Bottom sheet (share + Add to Home Screen) ---- */
body.sheet-open { overflow: hidden; }
#share-root, #a2hs-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 44, 50, 0.45);
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow: auto;
  background: var(--cream);
  border-radius: 16px 16px 0 0;
  padding: 0 1.1rem calc(var(--safe-bot) + 1.2rem);
  box-shadow: 0 -16px 40px rgba(7, 44, 50, 0.18);
  animation: sheet-up 0.28s ease;
}
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 99px;
  background: var(--sand-deep);
  margin: 0.55rem auto 0.2rem;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0 0.5rem;
}
.sheet-head h2 { font-size: 1.45rem; }
.sheet-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  min-height: 48px;
  padding: 0 0.2rem;
  cursor: pointer;
}
.sheet-body { padding-bottom: 0.4rem; }
.sheet-count { font-weight: 700; color: var(--teal-deep); margin: 0 0 0.5rem; }
.share-thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin: 0 0 0.9rem;
  padding-bottom: 0.2rem;
}
.share-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
  background: var(--sand-deep);
}
.thumb-more {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  color: var(--teal-deep);
  font-weight: 700;
}
.field-label {
  display: block;
  font-weight: 700;
  color: var(--teal-deep);
  margin: 0 0 0.35rem;
}
#shareCaption, .sheet textarea {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.75rem 0.8rem;
  resize: vertical;
  min-height: 6.5rem;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 1.05rem;
  margin: 0.85rem 0;
  color: var(--ink);
}
.check-row input {
  width: 22px;
  height: 22px;
  margin-top: 0.15rem;
  flex: 0 0 auto;
  accent-color: var(--teal);
}
.share-status {
  min-height: 1.4rem;
  color: var(--muted);
  margin: 0.4rem 0 0.6rem;
}
.share-fallback { margin-top: 1rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.6rem;
}
.share-app {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 52px;
  padding: 0.55rem 0.7rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--teal-deep);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.share-app-icon {
  width: 1.4rem;
  text-align: center;
  font-style: normal;
  color: var(--teal);
}
.s2f-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bot) + 1.2rem);
  transform: translate(-50%, 12px);
  background: var(--teal-deep);
  color: var(--cream);
  padding: 0.75rem 1.1rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  max-width: calc(100% - 2rem);
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.s2f-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- Add to Home Screen coach ---- */
.a2hs-sheet p { font-size: 1.05rem; }
.a2hs-steps {
  list-style: none;
  margin: 0.6rem 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}
.a2hs-steps li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 1.05rem;
}
.a2hs-num {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--cream);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

/* ---- Onboarding & forms ---- */
.onboard {
  padding: 1.2rem 1.15rem 1rem;
  flex: 1;
}
.onboard h1 { margin-bottom: 0.4rem; }
.onboard-actions {
  padding: 0.5rem 1rem calc(var(--safe-bot) + 1rem);
}
.choice-list { display: grid; gap: 0.65rem; margin: 1rem 0; }
.choice {
  appearance: none;
  width: 100%;
  text-align: left;
  min-height: 56px;
  padding: 0.9rem 1rem;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 2px;
  font: inherit;
  color: var(--teal-deep);
  cursor: pointer;
}
.choice strong { display: block; font-size: 1.1rem; }
.choice span { display: block; color: var(--muted); font-size: 1rem; }
.choice.on, .choice:hover { border-color: var(--teal); background: var(--sky); }
.plan-preview {
  margin: 1rem 0;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0.5rem;
}
.plan-preview img { width: 100%; height: auto; display: block; }
.check-list { margin: 0.8rem 0 1rem; }
.file-btn { display: flex; align-items: center; justify-content: center; margin: 0.8rem 0; }
.upload-list { padding-left: 1.2rem; }
.text-input, select.text-input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  min-height: 52px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 2px;
  margin: 0 0 0.9rem;
}
.opt-tag { font-weight: 400; color: var(--muted); font-size: 1rem; }
.pkg-list { display: grid; gap: 0.55rem; margin: 0.8rem 0; }
.pkg {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.8rem 0.9rem;
  background: var(--white);
  border: 2px solid var(--line);
  min-height: 56px;
}
.pkg.on { border-color: var(--teal); background: var(--sky); }
.pkg.vip { border-color: var(--orange); }
.pkg input { width: 22px; height: 22px; margin-top: 0.2rem; accent-color: var(--teal); flex: 0 0 auto; }
.pkg-price { display: block; font-weight: 700; color: var(--teal-deep); }
.pkg-blurb { display: block; color: var(--muted); font-size: 1rem; }
.quote-box, .pay-box {
  background: var(--sand);
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}
.tour-more { margin: 0.5rem 0 1rem; }
.tour-more summary { min-height: 48px; font-weight: 700; color: var(--teal); cursor: pointer; }
.review-lines { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.review-lines li, .review-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}
.review-total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

/* ---- Admin editor ---- */
.admin {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  min-height: calc(100dvh - 5rem);
}
.admin-side {
  padding: 1rem;
  background: var(--sand);
  overflow: auto;
  max-height: calc(100dvh - 5rem);
}
.admin-plan {
  padding: 0.8rem;
  overflow: auto;
  background: var(--cream);
}
.admin-frame { max-width: 720px; }
.handle { fill: var(--orange); stroke: #fff; stroke-width: 2; cursor: nwse-resize; }
.room-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.room-list-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  min-height: 44px;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--teal-deep);
  padding: 0.4rem 0.2rem;
  cursor: pointer;
}
.room-list-btn.on { font-weight: 700; color: var(--orange-ink); }
@media (max-width: 800px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { max-height: none; }
}

.picker-links { display:grid; gap:0.6rem; margin:1.4rem 0 0; }
.picker-links a { font-weight:700; color:var(--teal); min-height:48px; display:inline-flex; align-items:center; }


.onboard select.text-input {
  min-height: 52px;
  font-size: 18px;
  width: 100%;
  margin-bottom: 0.85rem;
}
.plan-preview.small {
  margin-top: 1rem;
  max-height: 280px;
  overflow: auto;
}


/* ---- Status, visit timer, retake sheet ---- */
.status-banner {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 17px;
  background: #e8f2f3;
  color: var(--teal-deep);
  border-bottom: 1px solid rgba(15, 85, 96, 0.12);
}
.status-banner.offline,
.status-banner.storage { background: #f8ead8; color: #6a3a0c; }
.status-banner.queue { background: #e8f2f3; }
.status-banner .btn-text { display: inline; min-height: auto; padding: 0 0.25rem; }
.plan-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.visit-timer { font-size: 17px; color: var(--cream, #f7f3ec); white-space: nowrap; }
.retake-sheet {
  position: fixed; inset: 0; background: rgba(7, 44, 50, 0.55);
  display: flex; align-items: flex-end; justify-content: center; z-index: 40;
}
.retake-card {
  background: var(--cream, #f7f3ec); color: var(--teal-deep, #072c32);
  width: 100%; max-width: 480px; border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  display: grid; gap: 0.65rem;
}
.retake-card h2 { margin: 0; font-size: 1.35rem; }
.retake-card .btn-primary,
.retake-card .btn-secondary,
.retake-card .btn-text { width: 100%; min-height: 48px; }

/* ---- Full-screen viewer ---- */
.viewer {
  position: fixed; inset: 0; background: #04191c; z-index: 50;
  display: flex; flex-direction: column; color: #f7f3ec;
}
.viewer-stage {
  flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.viewer-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  transform-origin: center center;
}
.viewer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.75rem calc(0.4rem + env(safe-area-inset-top));
  gap: 0.5rem;
}
.viewer-close, .viewer-heart {
  min-width: 48px; min-height: 48px; color: #f7f3ec; background: transparent; border: 0;
  font-size: 17px;
}
.viewer-heart.on { color: #e8762b; }
.viewer-count { margin: 0; font-size: 17px; }
.viewer-hint { margin: 0; padding: 0.5rem 1rem calc(0.8rem + env(safe-area-inset-bottom)); font-size: 17px; text-align: center; opacity: 0.8; }

/* ---- Gallery extras ---- */
.gallery-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; }
.heart-btn, .fig-actions { display: inline-flex; align-items: center; gap: 0.5rem; }
.heart-btn {
  min-height: 48px; border: 0; background: transparent; color: var(--teal-deep);
  font-size: 16px; padding: 0 0.2rem;
}
.heart-btn.on { color: #e8762b; font-weight: 700; }
.filter-row, .milestone-row { padding: 0 0.75rem 0.4rem; }
.scrub-label {
  display: grid; gap: 0.35rem; font-size: 17px; padding: 0.5rem 0.25rem 0.75rem;
}
.scrub-label input[type="range"] { width: 100%; min-height: 44px; }
.ba-slider { margin: 0.5rem 0 1rem; }
.ba-labels { display: flex; justify-content: space-between; font-size: 16px; margin: 0 0 0.35rem; }
.ba-frame { position: relative; overflow: hidden; border-radius: 12px; background: #111; aspect-ratio: 4/3; }
.ba-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ba-before-wrap { position: absolute; inset: 0 auto 0 0; overflow: hidden; }
.ba-before { position: absolute; inset: 0; width: 100%; max-width: none; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px;
  display: flex; align-items: center; justify-content: center; cursor: ew-resize;
}
.ba-handle span {
  width: 6px; height: 48px; background: #fff; border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(15, 85, 96, 0.45);
}

/* ---- Import tool ---- */
.importer { padding: 0.75rem 1rem 2rem; }
.import-layout { display: grid; gap: 0.75rem; }
.import-photo img { width: 100%; height: auto; border-radius: 12px; display: block; }
.room-btn-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0; }
.room-btn-row .chip, .import-actions .chip, .import-actions .btn-secondary, .import-actions .btn-text {
  min-height: 48px;
}
.import-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.5rem 0 1rem; }
.importer kbd {
  display: inline-block; min-width: 1.1em; padding: 0 0.2em;
  border: 1px solid rgba(15, 85, 96, 0.3); border-radius: 4px; font-size: 13px;
}

.checklist { margin: 0 0 1rem; }
.checklist .room-btn-row { margin: 0.6rem 0 0; }
.checklist .chip { min-height: 48px; font-size: 17px; }

/* ---- Checkout (schema 2026-11-21.1) ---- */
.pkg-price { margin-top: 0.2rem; }
.pkg-help { border-style: dashed; }
.fig-line { display: flex; justify-content: space-between; gap: 1rem; margin: 0.2rem 0; }
.review-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.9rem; margin: 0 0 0.8rem; }
.review-card p { margin: 0.15rem 0; }
.upload-list { list-style: none; padding: 0; }
.upload-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; background: var(--white); border-radius: 10px; padding: 0.2rem 0.2rem 0.2rem 0.8rem; margin: 0 0 0.4rem; }
.up-remove { width: auto; min-height: 48px; }
.field-hint { margin: -0.1rem 0 0.35rem; }
.onboard textarea.text-input { min-height: 7rem; resize: vertical; font: inherit; }
.tour-more summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }

/* ---- Checkout, grouped steps (schema 2026-11-21.2+) ---- */
.step-count { margin: 0 0 0.3rem; font-weight: 700; color: var(--muted); font-size: 1rem; }
.onboard .field { margin: 0; }
.onboard fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.onboard fieldset.field legend { padding: 0; margin-bottom: 0.4rem; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.7rem; }
@media (max-width: 359px) { .field-pair { grid-template-columns: 1fr; } }
.unlisted-row { margin: -0.3rem 0 0.9rem; }
.onboard select.text-input:disabled { opacity: 0.55; }
.did-you-mean { background: #fff6ec; border: 2px solid #e8833a; border-radius: 12px; padding: 0.8rem 0.9rem; margin: 0 0 1rem; }
.did-you-mean p { margin: 0 0 0.6rem; font-size: 1.1rem; }
.dym-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.dym-actions button { width: 100%; min-height: 52px; margin: 0; }
.dym-kept { margin: -0.4rem 0 1rem; }
.construction-set .choice-list { margin-top: 0.4rem; }
.choice[aria-pressed="true"], .choice.on { outline: 3px solid var(--teal-deep); }
.name-suggest { margin: -0.3rem 0 1rem; }
.name-suggest > button { width: 100%; min-height: 52px; }
.name-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.7rem; }
.name-chip { min-height: 56px; padding: 0.5rem 0.6rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); font: inherit; font-size: 1.02rem; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; }
.name-chip[aria-pressed="true"] { border-color: var(--teal-deep); background: #e7f1f1; }
.pay-block { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; margin: 0 0 1rem; }
.pay-block h2 { margin: 0 0 0.3rem; }
.pay-due { margin: 0 0 0.5rem; font-size: 1.1rem; }
.pay-later { margin: 0; }
.wallets { display: grid; gap: 0.6rem; margin: 0.6rem 0; }
.wallet-btn { min-height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.wallet-apple { background: #000; color: #fff; }
.wallet-google { background: #fff; color: #222; border: 1.5px solid #222; }
.wallet-btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.pay-or { text-align: center; color: var(--muted); margin: 0.6rem 0; }
.review-lines { list-style: none; padding: 0; margin: 0 0 0.8rem; }
.review-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.pending-panel { margin: 1rem 0; }
.pending-item { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem; margin: 0 0 0.7rem; }
.pending-item button { width: 100%; margin: 0.3rem 0; }
.pending-cmds { white-space: pre-wrap; font-size: 1rem; background: #f4efe6; padding: 0.6rem; border-radius: 8px; }

/* Capture app: build stage checklist */
.stage-row { padding: 0 16px 8px; }
.stage-open { width: 100%; min-height: 48px; }
.stage-card { max-height: 86vh; overflow-y: auto; }
.stage-head { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.stage-head h2 { margin: 0; font-size: 22px; white-space: nowrap; }
.stage-list { list-style: none; margin: 4px 0 8px; padding: 0; }
.stage-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px; border-bottom: 1px solid rgba(0,0,0,.08); cursor: pointer; font-size: 17px; }
.stage-item input { width: 24px; height: 24px; accent-color: #0f5560; flex: 0 0 auto; }
.stage-num { width: 22px; text-align: right; color: #8a9295; font-size: 15px; flex: 0 0 auto; }
.stage-name { display: grid; }
.stage-name small { font-size: 13px; color: #5f696d; }
.stage-item.on .stage-name { font-weight: 600; color: #0b3a42; }
.stage-head .btn-text { width: auto; padding: 0 4px; }
#stagePrompt h2 { font-size: 22px; line-height: 1.25; margin: 0 0 6px; }
#stagePrompt .stage-item { min-height: 56px; }
#stagePrompt .stage-item input { width: 28px; height: 28px; }
#stagePrompt .btn-primary, #stagePrompt .stage-none { width: 100%; min-height: 50px; margin-top: 10px; }
#stagePrompt .stage-foot { position: sticky; bottom: -1px; background: inherit; padding: 4px 0 2px; }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101c1f;
    --white: #1a2c30;
    --sand: #1e3338;
    --sand-deep: #244046;
    --sky: #1e3a3e;
    --ink: #f3efe8;
    --muted: #b7c2c4;
    --heading: #eef4f4;
    --link: #5eb8c2;
    --line: rgba(94, 184, 194, 0.28);
    --orange-ink: #e0b07a;
  }
  html, body, #app { background: var(--bg); color: var(--ink); }
  h1, h2, h3 { color: var(--heading); }
  .pkg-price { color: var(--heading); }
}
