:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --fill: #f2f2f7;
  --chip: #f2f2f7;
  --hairline: rgba(60, 60, 67, 0.14);
  --bar: rgba(255, 255, 255, 0.86);
  --danger: #ff3b30;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #f5f5f7;
    --muted: #98989d;
    --fill: #1c1c1e;
    --chip: #2c2c2e;
    --hairline: rgba(255, 255, 255, 0.12);
    --bar: rgba(28, 28, 30, 0.86);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --fill: #f2f2f7;
  --chip: #f2f2f7;
  --hairline: rgba(60, 60, 67, 0.14);
  --bar: rgba(255, 255, 255, 0.86);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --text: #f5f5f7;
  --muted: #98989d;
  --fill: #1c1c1e;
  --chip: #2c2c2e;
  --hairline: rgba(255, 255, 255, 0.12);
  --bar: rgba(28, 28, 30, 0.86);
}

* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
img { max-width: 100%; }

.shell { min-height: 100vh; }
.chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(52px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  transition: height 0.42s cubic-bezier(.2, .9, .2, 1);
}
.chrome.chrome-hide { height: 0; }
.avatar {
  position: fixed;
  z-index: 28;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}
.avatar.static { position: static; }
.phonebar, .deskbar { padding-right: 52px; }
.phonebar, .deskbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
}
.phonebar h1 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.phonebar > :first-child, .phone-actions { min-width: 72px; }
.phone-actions { margin-left: auto; display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.iconbtn, .navlink, #more, #back, #new-collection, #cancel-select {
  background: none;
  border: 0;
  color: var(--text);
  padding: 8px;
}
.navlink { color: var(--muted); font-size: 15px; }
.navlink.on { color: var(--text); font-weight: 600; }
#more { position: relative; font-size: 18px; letter-spacing: 0.12em; line-height: 1; }
#more.has-ask::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}
#cancel-select { color: var(--muted); font-size: 15px; }
.searchform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--fill);
  border-radius: var(--radius);
}
.searchform input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; outline: none; }
.searchicon { display: grid; color: var(--muted); }
.searchicon svg, .tabbar svg, .check svg, .float svg { width: 22px; height: 22px; display: block; }
.deskbar { display: none; }
.deskbar .searchform { max-width: 640px; margin: 0 auto; }

.main { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.shell.selecting .main { padding-bottom: calc(168px + env(safe-area-inset-bottom)); }
.grid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 4px 16px 0;
}
.grid-head button {
  border: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  padding: 6px 0;
}
.grid-head #select-count { font-size: 15px; font-weight: 600; }
.grid-head [hidden] { display: none; }
.count, .source-note, .reason, .fine {
  margin: 2px 16px 0;
  color: var(--muted);
  font-size: 13px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 12px; scrollbar-width: none; }
.chips:empty { display: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 0;
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.chip.on { background: var(--text); color: var(--bg); }

.folder-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 4px; }
.folder-list:empty { display: none; }
.folder-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  background: var(--fill);
  color: inherit;
  border-radius: 14px;
  padding: 8px;
  text-align: left;
}
.folder-row img, .folder-ph {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--chip);
  flex: 0 0 auto;
}
.folder-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.folder-ph svg { width: 22px; height: 22px; }
.folder-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.folder-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { color: var(--muted); font-size: 13px; }

.event-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 24px; }
.event-card {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--fill);
  border-radius: 14px;
  padding: 8px;
}
.event-open {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}
.event-open img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: #111; flex: 0 0 auto; }
.event-open span { min-width: 0; }
.event-open h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.event-open p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.event-card .textbtn { flex: 0 0 auto; }
.sheet .similar-grid { margin: 0 -4px; }
.sheet .similar-grid .tile { min-height: 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; }
.grid .empty { grid-column: 1 / -1; }
.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: var(--fill);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto 130px;
}
.tile img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.22s ease; }
.tile img.shown { opacity: 1; }
.tile .ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 11px; letter-spacing: 0.01em;
  background: linear-gradient(110deg, var(--ph, var(--fill)) 30%, color-mix(in srgb, var(--ph, var(--fill)) 82%, #fff) 50%, var(--ph, var(--fill)) 70%);
  background-size: 250% 100%; animation: ph-shimmer 1.4s ease-in-out infinite;
}
.tile .ph-icon svg { width: 22px; height: 22px; opacity: 0.55; }
.tile .ph-none { display: none; }
.tile.loaded .ph { animation: none; }
.tile.noprev .ph { animation: none; background: var(--fill); }
.tile.noprev .ph-none { display: block; font-weight: 500; }
.tile.noprev .ph-date { opacity: 0.7; }
.tile .dur, .tile .lock, .tile .why, .tile .check { z-index: 2; }
@keyframes ph-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .tile .ph { animation: none; } }
.grid .day-head { grid-column: 1 / -1; margin: 0; padding: 18px 4px 8px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.grid .day-head .day-count { color: var(--muted); font-weight: 400; font-size: 13px; }
.grid .day-head:first-child { padding-top: 6px; }
.dur, .lock {
  position: absolute;
  bottom: 4px;
  color: #fff;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.dur { right: 5px; }
.lock { left: 5px; }
.why {
  position: absolute;
  left: 4px;
  right: 28px;
  bottom: 16px;
  color: #fff;
  font-size: 10px;
  line-height: 1.15;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.review-why {
  margin: 12px 16px 0;
  font-size: 15px;
  font-weight: 600;
}
.check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: transparent;
  display: grid;
  place-items: center;
  opacity: 0;
}
.check svg { width: 14px; height: 14px; }
.shell.selecting .check { opacity: 1; }
.tile.on .check { background: #fff; color: #111; border-color: #fff; }

.tabbar {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--hairline);
}
.tabbar button { transition: transform 0.42s cubic-bezier(.2, .9, .2, 1), color 0.2s ease; }
.tabbar button.on { transform: translateY(-1px); }
.tabbar button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
}
.tabbar button.has-dot::after {
  content: '';
  position: absolute;
  top: 2px;
  right: calc(50% - 16px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}
.tabbar button.on { color: var(--text); }
.selectbar {
  position: fixed;
  z-index: 24;
  left: 0;
  right: 0;
  bottom: calc(52px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  padding: 8px 10px;
  background: var(--bar);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--hairline);
}
.selectbar button, .textbtn {
  border: 0;
  background: none;
  color: var(--text);
  padding: 8px 8px;
  font-size: 14px;
  white-space: nowrap;
}
.selectbar[hidden] { display: none; }

.album {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 18px 16px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: none;
  text-align: left;
  font-size: 17px;
}
.album span:last-child { color: var(--muted); font-size: 15px; }
.page-title { display: none; margin: 18px 16px 6px; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.empty { margin: 0; padding: 64px 24px; text-align: center; color: var(--muted); }
.empty .textbtn { display: inline-block; margin-top: 8px; color: var(--text); }

.question { margin: 28px 16px 8px; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px 0; }
.shot { position: relative; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; background: var(--fill); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
}
.pair figcaption { margin-top: 8px; font-size: 13px; }
.pair figure { margin: 0; }
.choices { display: grid; gap: 4px; padding: 16px 16px 8px; }
.primary {
  border: 0;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-weight: 600;
}
.quiet { border: 0; background: none; color: var(--text); padding: 12px; }
.choices .fine { text-align: center; margin-top: 8px; }
.person { padding: 8px 16px 24px; }
.person .group { padding: 12px 0; border-top: 1px solid var(--hairline); }

.viewer { position: fixed; inset: 0; z-index: 30; background: #000; color: #fff; touch-action: none; }
.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  touch-action: none;
}
.frame {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  will-change: transform;
}
.tile, .viewer, .tabbar, .chrome { -webkit-user-select: none; user-select: none; }
::view-transition-group(*) {
  animation-duration: 0.38s;
  animation-timing-function: cubic-bezier(.2, .9, .2, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.2s;
}
.viewer-media, .viewer-full {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  grid-area: 1 / 1;
}
.viewer-full { opacity: 0; z-index: 1; }
.viewer-full.ready { opacity: 1; }
.viewer-media { z-index: 2; }
.viewer-full.ready + .viewer-media,
.stage.full-ready .viewer-media,
.frame.full-ready .viewer-media { opacity: 0; }
.float { position: fixed; z-index: 2; left: 0; right: 0; display: flex; align-items: center; color: #fff; transition: opacity 0.45s ease; }
.viewer.idle .float { opacity: 0; pointer-events: none; }
.float.top {
  top: 0;
  justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 52px 24px 8px;
  background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
}
.viewer .avatar { z-index: 6; background: #fff; color: #111; }
.float.bottom {
  bottom: 0;
  gap: 8px;
  padding: 28px 12px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
}
.float button { border: 0; background: none; color: #fff; padding: 8px 10px; }
.float svg { width: 26px; height: 26px; }
#scrub { flex: 1; accent-color: #fff; }
.timecode { font-size: 12px; min-width: 42px; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}
.backdrop[hidden] { display: none; }
.sheet {
  width: min(560px, 100%);
  max-height: 82vh;
  overflow: auto;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: var(--text);
  border-radius: 16px 16px 0 0;
  animation: sheet-in 0.42s cubic-bezier(.2, .9, .2, 1);
}
@keyframes sheet-in {
  from { transform: translateY(28px); }
  to { transform: none; }
}
.backdrop.dark .sheet { background: #1c1c1e; color: #f5f5f7; }
.menu-item, .sheet .pick {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: inherit;
  padding: 14px 4px;
  font-size: 17px;
  border-radius: 10px;
}
.menu-item.on { font-weight: 600; }
.sheet h2 { margin: 12px 0 8px; font-size: 20px; font-weight: 600; }
.meta-row { display: grid; grid-template-columns: 88px 1fr; gap: 8px; padding: 7px 0; font-size: 14px; }
.meta-row dt { color: var(--muted); }
.meta-row dd { margin: 0; overflow-wrap: anywhere; }
.source-label {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 11px;
}
.tag {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 6px 0;
  padding: 0;
  border-radius: 999px;
  background: var(--chip);
  font-size: 15px;
}
.tag-label {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 999px;
  text-align: left;
}
.tag.suggested {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--hairline);
}
.face.suggested {
  border: 1px dashed var(--hairline);
  border-radius: 12px;
  padding: 4px;
  color: var(--muted);
}
.face.suggested .face-name {
  max-width: 76px;
  text-align: center;
  white-space: normal;
}
.tag-row { display: flex; flex-wrap: wrap; align-items: center; }
.tag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 999px;
}
.tag-x[hidden] { display: none !important; }
.tag-add {
  position: relative;
  display: flex;
  gap: 8px;
  margin: 4px 0 10px;
}
.tag-add input {
  flex: 1;
  border: 0;
  background: var(--fill);
  color: inherit;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
}
.tag-add button[type="submit"] {
  border: 0;
  background: var(--chip);
  color: inherit;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
}
.tag-suggest {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.tag-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.backdrop.dark .tag-add input,
.backdrop.dark .tag-add button[type="submit"],
.backdrop.dark .row-add input,
.backdrop.dark .tag { background: #2c2c2e; color: #f5f5f7; }
.backdrop.dark .tag.suggested { background: transparent; color: #98989d; border-color: rgba(255, 255, 255, 0.28); }
.backdrop.dark .face.suggested { color: #98989d; border-color: rgba(255, 255, 255, 0.28); }
.backdrop.dark .tag-suggest { background: #3a3a3c; color: #f5f5f7; }
.backdrop.dark .row-label { color: #98989d; }
.moment {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: inherit;
  padding: 8px 0;
}
.moment small { display: block; color: var(--muted); }
#bulk-ideas { display: grid; gap: 6px; }
#bulk-ideas[hidden] { display: none; }
#bulk-ideas button {
  text-align: left;
  border: 0;
  background: var(--fill);
  color: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
}
.stack { display: grid; gap: 10px; padding: 8px 0 16px; }
.stack input, .stack select, .login input {
  width: 100%;
  border: 0;
  background: var(--fill);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 16px;
}
.login { max-width: 380px; margin: 16vh auto; padding: 24px; }
.login h1 { margin: 0 0 8px; font-size: 40px; font-weight: 600; letter-spacing: -0.04em; }
.hint { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; font-size: 14px; }
.userrow { padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: calc(10px + env(safe-area-inset-top));
  bottom: auto;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  line-height: 1.2;
  width: max-content;
  max-width: calc(100vw - 104px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  pointer-events: none;
}
.toast[hidden] { display: none; }
.toast > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast-action {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  padding: 0;
  flex: 0 0 auto;
  pointer-events: auto;
}
#more-sentinel { height: 1px; }

@media (min-width: 900px) {
  .phonebar, .tabbar { display: none; }
  .deskbar { display: flex; }
  .main { padding-bottom: 28px; }
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; padding: 0 3px; }
  .page-title { display: block; }
  .selectbar { bottom: 0; border-radius: 0; }
  .backdrop { align-items: center; }
  .sheet { border-radius: 16px; margin: 24px; }
  .backdrop.account {
    align-items: flex-start;
    justify-content: flex-end;
    background: transparent;
    padding: 56px 12px 16px 0;
  }
  .backdrop.account .sheet {
    width: min(340px, calc(100vw - 24px));
    max-height: min(72vh, 640px);
    margin: 0;
    border-radius: 14px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
  }
  .backdrop.account .grab { display: none; }
  .pair { max-width: 880px; margin: 0 auto; }
  .choices { max-width: 420px; margin: 0 auto; }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

.recent { display: grid; gap: 2px; padding: 8px 8px 24px; }
.recent-q {
  border: 0;
  background: none;
  text-align: left;
  padding: 12px 8px;
  font-size: 17px;
  border-bottom: 1px solid var(--hairline);
}

@media (prefers-reduced-motion: reduce) {
  .chrome, .float, .viewer-media, .tile img, .tabbar button, .sheet { transition: none; animation: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none; }
}

.ask { display: flex; flex-direction: column; }
.ask-shot {
  position: relative;
  height: 46vh;
  min-height: 220px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ask-shot img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.ask-shot .ask-q {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 36px 16px 14px;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}
.ask .chips { flex-wrap: wrap; overflow: visible; }
.ask-form { display: flex; gap: 8px; align-items: center; padding: 4px 16px 0; }
.ask-form input {
  flex: 1;
  border: 0;
  border-bottom: 0.5px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  font-size: 16px;
  outline: none;
}
.ask-skip { margin: 4px 16px 8px; border: 0; background: none; color: var(--muted); padding: 8px 0; text-align: left; }
.faces {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 16px 2px;
  scrollbar-width: none;
}
.faces::-webkit-scrollbar { display: none; }
.face, .face-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 64px;
  max-width: 84px;
  border: 0;
  background: none;
  color: var(--text);
  padding: 0;
  font: inherit;
}
.face-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--chip);
}
.face-avatar.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--chip);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}
.add-person .initials { border: 1px dashed var(--hairline); background: transparent; }
.face-name, .face-count {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
.face-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 64px;
  max-width: 84px;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  font: inherit;
}
.face-x {
  position: absolute;
  top: -4px;
  right: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.face-x[hidden] { display: none !important; }
.edit-row { padding: 6px 0 0; }
.ask.review .edit-row { padding: 6px 16px 0; }
.row-label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.edit-row .faces { padding: 0 0 4px; }
.edit-row .tag-row { padding: 0; }
.row-add { position: relative; margin: 0 0 4px; }
.row-add input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: var(--fill);
  color: inherit;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 16px;
  min-height: 40px;
}
.ask.review .ask-shot { height: 200px; min-height: 160px; }
.ask.review .review-note {
  margin: 8px 16px 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-actions { padding: 8px 16px 28px; }
.review-actions .primary { width: 100%; }
.people-strip { padding: 8px 0 4px; }
.people-strip[hidden] { display: none; }
.people-label { margin: 0; padding: 0 16px 8px; font-size: 13px; color: var(--muted); }
.people-row, .people-board { display: flex; gap: 14px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; }
.people-row::-webkit-scrollbar, .people-board::-webkit-scrollbar { display: none; }
.people-strip.board { padding: 8px 0 24px; }
.people-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 8px; }
.people-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.people-board { flex-wrap: wrap; overflow: visible; }
.person-ideas { display: grid; gap: 4px; }
.person-ideas button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: var(--fill);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
  text-align: left;
}
.person-ideas img, .person-ideas .initials { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.select-preview { flex: 1 0 100%; text-align: left; padding: 2px 4px 6px; }
.select-preview[hidden] { display: none; }
.select-preview .fine { margin: 0; }
.select-preview .faces { padding: 8px 0 0; }
.review-count, .review-note, .review-label { padding: 0 16px; }
.review-label { margin: 14px 0 0; }
.review-unsure { margin: 14px 16px 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.review-form { display: grid; gap: 12px; padding: 8px 16px 24px; }
.review-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 0.5px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  padding: 8px 0;
  outline: none;
}
.review-form .primary { width: 100%; }
.ask-follow { margin: 8px 16px 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.style-list { padding: 0 16px 32px; }
.style-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--hairline);
}
.style-row .main { flex: 1; min-width: 0; }
.style-row .main div:first-child { font-size: 16px; }
.style-row button { border: 0; background: none; color: var(--muted); padding: 8px; }
.grab {
  width: 36px;
  height: 5px;
  margin: 6px auto 10px;
  border-radius: 99px;
  background: var(--hairline);
}
.account-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.account-head strong { font-size: 17px; }
.account-status { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.account-block { padding: 4px 0 8px; }
.account-block h2 { margin: 8px 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.account-links, .account-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: inherit;
  padding: 11px 0;
  font-size: 17px;
  border-bottom: 0.5px solid var(--hairline);
}
.person-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 0.5px solid var(--hairline); }
.person-line span:first-child { font-size: 16px; }
.dl-row { padding: 8px 0; }
.dl-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-bar { height: 3px; margin-top: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.dl-bar span { display: block; height: 100%; background: var(--text); }
.segment { display: flex; gap: 6px; padding-bottom: 8px; }
.segment button {
  flex: 1;
  border: 0;
  background: var(--fill);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
}
.segment button.on { background: var(--text); color: var(--bg); }
.signout {
  width: 100%;
  margin: 8px 0 4px;
  border: 0;
  background: none;
  color: var(--danger);
  font-size: 17px;
  font-weight: 600;
  padding: 14px 0;
  text-align: left;
}
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 56px 8px 12px;
  background: #1d1d1f;
  color: #fff;
  font-size: 13px;
}
.preview-banner button {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #1d1d1f;
  padding: 4px 10px;
  font-size: 13px;
}
.admin-tabs {
  position: sticky;
  top: 52px;
  z-index: 6;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--bg);
}
.admin-tabs button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  padding: 6px 12px;
  font-size: 13px;
}
.admin-tabs button.on { background: var(--text); color: var(--bg); }
.preview-wait { position: absolute; left: 16px; right: 16px; bottom: 96px; margin: 0; text-align: center; color: #fff; font-size: 15px; }
.spend-banner {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
}
.spend-banner.warn { background: #fff4d6; color: #1d1d1f; }
.spend-banner.limit { background: var(--danger); color: #fff; font-weight: 600; }
.admin-pad { padding: 0 12px calc(112px + env(safe-area-inset-bottom)); }
.import-line { margin: 0 0 6px; font-size: 14px; line-height: 1.35; }
.job-group { border-bottom: 0.5px solid var(--hairline); }
.job-group summary { cursor: pointer; list-style: none; }
.job-group summary::-webkit-details-marker { display: none; }
.job-group summary h2 { display: inline; }
.person-hide { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.person-hide a, .person-hide h1 { font-size: 17px; color: inherit; text-decoration: none; }
.admin-pad h2 { margin: 16px 0 8px; font-size: 15px; }
.admin-card { padding: 12px 0; border-bottom: 0.5px solid var(--hairline); }
.admin-card h2, .admin-card-head strong { font-size: 16px; }
.admin-card-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.money { margin: 4px 0; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.row-actions, .job-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions { margin: 8px 0; }
.row-actions button, .job-line button, .admin-pad button, #view-generic {
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  padding: 6px 10px;
  font-size: 13px;
}
.admin-pad .primary { background: var(--text); color: var(--bg); }
.job-line { justify-content: space-between; padding: 8px 0; border-bottom: 0.5px solid var(--hairline); font-size: 14px; }
.privacy-box { margin: 8px 0 12px; }
.privacy-label { font-size: 15px; margin-bottom: 8px; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 15px; padding: 4px 0; }
.access-form { padding-top: 8px; }

.viewer-section { margin: 12px 0; border-top: 1px solid rgba(255,255,255,.12); padding-top: 8px; }
.viewer-section > summary { cursor: pointer; font-weight: 600; padding: 8px 0; min-height: 44px; display: flex; align-items: center; gap: 6px; list-style: none; }
.viewer-section > summary::-webkit-details-marker { display: none; }
.viewer-section > summary::before { content: '▸'; transition: transform .15s; }
.viewer-section[open] > summary::before { transform: rotate(90deg); }
.viewer-section .moment { white-space: normal; line-height: 1.35; }

/* Watch page: poster layer, buffering shimmer, inline details on phone. */
.viewer-poster {
  width: 100%; height: 100%; object-fit: contain; grid-area: 1 / 1; z-index: 3;
  pointer-events: none; transition: opacity .25s ease;
}
.stage.video-live .viewer-poster { opacity: 0; }
.viewer-shimmer {
  grid-area: 1 / 1; align-self: stretch; justify-self: stretch; z-index: 4; pointer-events: none;
  opacity: 0; transition: opacity .2s ease;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%) 0 0 / 250% 100%;
  animation: viewer-shimmer 1.3s linear infinite;
}
.stage.buffering .viewer-shimmer, .frame:not(:has(video)) .viewer-shimmer { opacity: 1; }
@keyframes viewer-shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }
.preview-wait { grid-area: 1 / 1; align-self: end; z-index: 5; margin: 0 0 96px; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.6); font-size: 14px; }
.viewer-details { display: none; }
@media (max-width: 760px) and (orientation: portrait) {
  .viewer.is-video { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
  .viewer.is-video .stage { position: relative; height: 64svh; }
  .viewer.is-video .float.bottom { position: absolute; top: calc(64svh - 64px); bottom: auto; }
  .viewer.is-video.idle .float.bottom { opacity: 1; pointer-events: auto; }
  .viewer.is-video .viewer-details {
    display: block; position: relative; z-index: 3; background: #000; min-height: 36svh;
    padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); touch-action: pan-y; user-select: text; -webkit-user-select: text;
  }
  .viewer-details h2 { font-size: 17px; margin: 4px 0; word-break: break-word; }
  .viewer-details p { margin: 6px 0; line-height: 1.4; }
  .viewer-details .moment { display: block; width: 100%; text-align: left; color: #fff; background: none; border: 0; padding: 8px 0; }
  .viewer-details .moment small { opacity: .6; margin-right: 8px; }
}
.details-loading i { display: block; height: 12px; margin: 10px 0; border-radius: 6px; background: rgba(255,255,255,.12); }
.details-loading i:first-child { width: 60%; height: 16px; } .details-loading i:last-child { width: 40%; }
@media (prefers-reduced-motion: reduce) { .viewer-shimmer { animation: none; } }

.viewer-people {
  position: fixed;
  z-index: 4;
  top: calc(52px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 12px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.viewer-people::-webkit-scrollbar { display: none; }
.viewer-people[hidden] { display: none; }
.viewer-person {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
span.viewer-person { display: inline-flex; align-items: center; }
#delete.danger { color: #ffb4b4; }
.deleted-hint { margin: 8px 16px 0; }
