/* Photos — the library, the viewer, the editor and the silly-faces camera
   (pages/photos.js, photo-viewer.js, photo-camera.js). The phone's are in
   components/photos/; the same shapes, the same order. */

/* ---- the library ---- */
.ph-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ph-scroll { flex: 1; min-height: 0; }
.screen-scroll > .inner.ph-page { padding: calc(52px + env(safe-area-inset-top)) 0 calc(var(--bar-clear, 96px) + 16px); max-width: 1280px; margin: 0 auto; }
.ph-head { gap: 8px; padding: 6px 14px 10px; position: sticky; top: 0; z-index: 3; background: var(--bg); }
.ph-tabs { max-width: 360px; }
.ph-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.3px; white-space: normal; overflow-wrap: break-word; }
.ph-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.ph-icon-btn {
  width: 38px; height: 38px; border-radius: 19px; border: 0; background: none; flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer;
}
.ph-icon-btn:hover { background: var(--accent-soft); }
.ph-icon-btn svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 34; }
.ph-icon-btn.danger { color: var(--danger); }
.ph-cam-btn {
  display: flex; align-items: center; gap: 6px; flex: none; height: 38px; padding: 0 14px 0 11px;
  border: 0; border-radius: 19px; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 14px; cursor: pointer;
}
.ph-cam-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 34; }
@media (max-width: 420px) { .ph-cam-btn span { display: none; } .ph-cam-btn { padding: 0 9px; } }
.ph-selecting { background: var(--surface-solid, var(--bg)); }

.ph-count { padding: 0 16px 4px; font-size: 12.5px; color: var(--ink-muted); }
.ph-month { margin: 18px 16px 2px; font-size: 21px; font-weight: 800; letter-spacing: -0.4px; color: var(--ink); }
.ph-day { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px 16px; font-size: 13.5px; font-weight: 700; color: var(--ink-muted); }
.ph-day-pick { width: 28px; height: 28px; border-radius: 14px; border: 1.5px solid var(--border); background: none; color: var(--ink-faint); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ph-day:hover .ph-day-pick, .ph-timeline:has(.ph-tile.selecting) .ph-day-pick { opacity: 1; }
.ph-day-pick svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 48; }
.ph-timeline > .ph-grid { content-visibility: auto; contain-intrinsic-size: auto 300px; }

.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px; padding: 0 3px; }
@media (max-width: 700px) { .ph-grid { grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 0 2px; } }
@media (max-width: 360px) { .ph-grid { grid-template-columns: repeat(3, 1fr); } }
.ph-tile {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; margin: 0; overflow: hidden; cursor: pointer;
  background: var(--surface); border-radius: 2px; -webkit-touch-callout: none; user-select: none;
}
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .16s ease; }
.ph-tile.on img { transform: scale(0.86); border-radius: 8px; }
.ph-tile.on { background: var(--accent-soft); }
.ph-badge { position: absolute; right: 6px; top: 5px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.ph-fav { position: absolute; left: 6px; bottom: 5px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.ph-fav svg { width: 15px; height: 15px; fill: #fff; stroke: #fff; stroke-width: 20; }
.ph-days { position: absolute; right: 6px; bottom: 5px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.ph-check {
  position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; border-radius: 12px;
  border: 2px solid rgba(255,255,255,.95); background: rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s;
}
.ph-check svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 56; }
.ph-tile:hover .ph-check, .ph-tile.selecting .ph-check { opacity: 1; }
.ph-tile.on .ph-check { background: var(--accent); border-color: var(--accent); opacity: 1; }
@media (hover: none) { .ph-tile:not(.selecting) .ph-check { display: none; } }

.ph-loading, .ph-note { padding: 18px 16px; color: var(--ink-muted); font-size: 14px; }
.ph-note { padding: 4px 16px 10px; font-size: 13px; }
.ph-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; gap: 8px; }
.ph-empty-ico { width: 64px; height: 64px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.ph-empty-ico svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 30; }
.ph-empty-title { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.ph-empty-text { max-width: 380px; color: var(--ink-muted); font-size: 14.5px; line-height: 1.45; }
.ph-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

.ph-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; padding: 4px 16px; }
@media (max-width: 520px) { .ph-albums { grid-template-columns: repeat(2, 1fr); } }
.ph-album-card { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--ink); min-width: 0; }
.ph-album-cover { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--ink-muted); }
.ph-album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-album-cover svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 30; }
.ph-album-card.new .ph-album-cover { border-style: dashed; color: var(--accent); }
.ph-album-name { margin-top: 7px; font-weight: 700; font-size: 14.5px; white-space: normal; overflow-wrap: break-word; }
.ph-album-count { font-size: 12.5px; color: var(--ink-muted); }

.ph-sheet-back { z-index: 1200; align-items: flex-end; }
.ph-sheet { width: min(440px, 100%); max-height: 80vh; overflow-y: auto; background: var(--surface-solid, var(--bg)); border-radius: 20px 20px 0 0; padding: 16px 14px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 700px) { .ph-sheet-back { align-items: center; } .ph-sheet { border-radius: 18px; } }
.ph-sheet-title { font-weight: 800; font-size: 16px; padding: 2px 4px 8px; }
.ph-album-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border: 0; background: none; border-radius: 12px; color: var(--ink); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.ph-album-row:hover { background: var(--accent-soft); }
.ph-album-row > span:nth-child(2) { flex: 1; min-width: 0; white-space: normal; overflow-wrap: break-word; }
.ph-album-ico { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.ph-album-ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 34; }
.ph-muted { color: var(--ink-muted); font-weight: 500; }
.ph-new-album { display: flex; gap: 8px; padding: 2px 4px 8px; }
.ph-new-album .input { flex: 1; min-width: 0; }

.ph-busy { position: absolute; left: 50%; transform: translateX(-50%); top: calc(60px + env(safe-area-inset-top)); z-index: 5; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.ph-drop { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ph-drop-card { background: var(--surface-solid, var(--bg)); border: 2px dashed var(--accent); color: var(--ink); border-radius: 22px; padding: 28px 34px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 700; }
.ph-drop-card svg { width: 38px; height: 38px; stroke: var(--accent); fill: none; stroke-width: 30; }

/* The scrubber: a thumb down the right edge, a bubble with the month. */
/* Invisible, it is not there: it must not swallow taps on the right-hand column. */
.ph-scrub { position: absolute; right: 0; top: calc(64px + env(safe-area-inset-top)); bottom: calc(var(--bar-clear, 96px) + 8px); width: 44px; z-index: 4; touch-action: none; opacity: 0; transition: opacity .25s; cursor: ns-resize; pointer-events: none; }
.ph-scrub.awake { opacity: 1; pointer-events: auto; }
.ph-scrub-thumb { position: absolute; right: 6px; top: 0; width: 30px; height: 44px; border-radius: 15px 4px 4px 15px; background: var(--surface-solid, var(--bg)); border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.ph-scrub-thumb::before, .ph-scrub-thumb::after { content: ''; position: absolute; left: 9px; right: 9px; height: 2px; border-radius: 1px; background: var(--ink-muted); }
.ph-scrub-thumb::before { top: 17px; } .ph-scrub-thumb::after { top: 24px; }
.ph-scrub-bubble { position: absolute; right: 46px; top: 8px; white-space: nowrap; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 800; padding: 6px 11px; border-radius: 999px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.ph-scrub.dragging .ph-scrub-bubble { opacity: 1; }

/* Overlays sit over the rail and the composer. */
body.pv-open .float-nav, body.pv-open .shell-bar { visibility: hidden; }

/* ---- the viewer ---- */
.pv { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; display: flex; touch-action: none; }
.pv-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pv.with-info .pv-stage { right: min(360px, 100%); }
.pv-media { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: transform .08s linear; will-change: transform; }
video.pv-media { width: 100%; height: 100%; }
.pv-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 2px; padding: calc(8px + env(safe-area-inset-top)) 10px 18px; background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0)); z-index: 2; }
.pv.with-info .pv-bar { right: min(360px, 100%); }
.pv-spacer { flex: 1; }
.pv-counter { font-size: 13px; font-weight: 700; opacity: .8; padding-left: 4px; }
.pv-btn { width: 42px; height: 42px; border-radius: 21px; border: 0; background: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.pv-btn:hover { background: rgba(255,255,255,.12); }
.pv-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 34; }
.pv-btn.on svg { fill: #ffd60a; stroke: #ffd60a; }
.pv-btn.danger:hover { color: #ff6b6b; }
.pv .btn.soft { background: rgba(255,255,255,.16); color: #fff; }
.pv .btn.ghost.danger { color: #ff8080; border-color: rgba(255,128,128,.5); }
/* The actions: beside the bar on a wide screen, along the bottom on a phone. */
.pv-actions { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 56px; display: flex; align-items: center; gap: 2px; z-index: 2; }
.pv.with-info .pv-actions { right: calc(min(360px, 100%) + 56px); }
.pv-info-btn { order: 9; }
@media (max-width: 600px) {
  .pv-actions { top: auto; bottom: 0; left: 0; right: 0; justify-content: space-around; padding: 12px 6px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.6)); }
  .pv-actions .pv-btn { width: 44px; height: 44px; }
  .pv.with-info .pv-actions { display: none; }
}
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 23px; border: 0; background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.pv-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 40; }
.pv-nav.prev { left: 14px; } .pv-nav.next { right: 14px; }
.pv.with-info .pv-nav.next { right: calc(min(360px, 100%) + 14px); }
@media (hover: none) { .pv-nav { display: none; } }
.pv-info { position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 100%); background: #151515; color: #eee; overflow-y: auto; padding: calc(12px + env(safe-area-inset-top)) 16px 24px; z-index: 3; }
.pv-info-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pv-info-title { font-size: 18px; font-weight: 800; }
.pv-info-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.pv-info-ico svg { width: 21px; height: 21px; stroke: #aaa; fill: none; stroke-width: 32; }
.pv-info-main { font-size: 14.5px; font-weight: 600; word-break: break-word; }
.pv-info-sub { font-size: 13px; color: #aaa; margin-top: 2px; }
.pv-info-sub a { color: #8ab4ff; }
.pv-info-loading { color: #aaa; padding: 20px 0; }

/* ---- the editor ---- */
.pe { position: fixed; inset: 0; z-index: 1050; background: #0c0c0c; color: #fff; display: flex; flex-direction: column; }
.pe-bar { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.pe .btn.ghost { color: #ddd; border-color: rgba(255,255,255,.22); }
.pe .btn:disabled { opacity: .4; }
.pe-bar .btn.sm { min-height: 40px; padding: 0 14px; }
.pe-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pe-frame { position: relative; overflow: hidden; touch-action: none; }
.pe.cropping .pe-frame { overflow: visible; }
.pe-inner { position: absolute; overflow: hidden; }
.pe-img { position: absolute; left: 50%; top: 50%; transform-origin: center; user-select: none; -webkit-user-drag: none; max-width: none; }
.pe-truth { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .18s; pointer-events: none; }
.pe-truth.shown { opacity: 1; }
.pe-crop { position: absolute; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); outline: 2px solid #fff; cursor: move; touch-action: none; }
.pe-grid { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent 33.1%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.9%),
  linear-gradient(transparent 33.1%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.9%); }
.pe-handle { position: absolute; width: 26px; height: 26px; border: 4px solid #fff; }
.pe-handle.nw { left: -5px; top: -5px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.pe-handle.ne { right: -5px; top: -5px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.pe-handle.sw { left: -5px; bottom: -5px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.pe-handle.se { right: -5px; bottom: -5px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.pe-tools { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 12px; min-height: 120px; }
.pe-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pe-chips::-webkit-scrollbar { display: none; }
.pe-chip { flex: none; border: 1px solid rgba(255,255,255,.2); background: none; color: #ddd; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer; }
.pe-chip.on { background: #fff; color: #000; border-color: #fff; }
.pe-chip.set:not(.on) { border-color: #ffd60a; color: #ffd60a; }
.pe-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pe-tool { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: #ddd; font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 4px 8px; }
.pe-tool svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 34; }
.pe-slider { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; }
.pe-label { font-size: 12.5px; font-weight: 700; color: #bbb; min-width: 74px; }
.pe-range { flex: 1; accent-color: #ffd60a; }
.pe-val { width: 46px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: #ddd; }
.pe-looks { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.pe-looks::-webkit-scrollbar { display: none; }
.pe-look { flex: none; border: 0; background: none; color: #ccc; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pe-look img { width: 66px; height: 66px; object-fit: cover; border-radius: 12px; border: 2.5px solid transparent; background: #222; }
.pe-look.on img { border-color: #ffd60a; }
.pe-look.on { color: #fff; }
.pe-tabs { display: flex; justify-content: center; gap: 6px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
.pe-tab { border: 0; background: none; color: #999; font-size: 14px; font-weight: 800; padding: 9px 18px; border-radius: 999px; cursor: pointer; }
.pe-tab.on { color: #000; background: #fff; }

/* ---- the camera ---- */
.fc { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; overflow: hidden; touch-action: manipulation; user-select: none; }
.fc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fc-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fc-flash.go { animation: fc-flash .45s ease-out; }
@keyframes fc-flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.fc-top { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 14px 24px; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0)); }
.fc-top-btn { min-width: 48px; height: 48px; border-radius: 24px; border: 0; background: rgba(0,0,0,.32); color: #fff; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px; cursor: pointer; font-weight: 800; font-size: 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.fc-top-btn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 36; }
.fc-top-btn.on { background: #ffd60a; color: #000; }
.fc-top-btn span:empty { display: none; }
.fc-status { position: absolute; left: 50%; top: calc(84px + env(safe-area-inset-top)); transform: translateX(-50%); background: rgba(0,0,0,.5); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: normal; max-width: calc(100% - 32px); overflow-wrap: break-word; }
.fc-status[data-state="error"] { white-space: normal; text-align: center; top: 40%; border-radius: 16px; padding: 14px 18px; }
.fc-count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 120px; font-weight: 900; text-shadow: 0 4px 30px rgba(0,0,0,.5); }
.fc-count.pop { animation: fc-pop 1s ease-out; }
@keyframes fc-pop { 0% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.9); opacity: .2; } }
.fc-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.35)); }
.fc-name { text-align: center; font-weight: 800; font-size: 15px; letter-spacing: .2px; text-shadow: 0 1px 6px rgba(0,0,0,.6); margin-bottom: 10px; }
.fc-rail-wrap { position: relative; height: 92px; }
.fc-rail { display: flex; align-items: center; gap: 12px; height: 92px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fc-rail::-webkit-scrollbar { display: none; }
.fc-pad { flex: none; width: calc(50% - 34px); height: 1px; }
.fc-face { flex: none; width: 56px; height: 56px; border-radius: 28px; border: 0; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 30px; cursor: pointer; scroll-snap-align: center; transition: transform .15s, background .15s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.fc-face.on { transform: scale(1.12); background: rgba(255,255,255,.35); }
.fc-shutter { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; transform: translate(-50%, -50%); border-radius: 42px; border: 6px solid #fff; background: transparent; cursor: pointer; box-shadow: 0 2px 14px rgba(0,0,0,.35); pointer-events: none; }
.fc-face.on { pointer-events: auto; }
.fc-thumb { position: absolute; left: 18px; bottom: calc(150px + env(safe-area-inset-bottom)); width: 52px; height: 52px; border-radius: 14px; border: 3px solid #fff; padding: 0; overflow: hidden; background: #222; cursor: pointer; }
.fc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-thumb.pop { animation: fc-thumb .35s ease-out; }
@keyframes fc-thumb { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
@media (max-width: 600px) {
  .pv-info { width: 100%; }
  .pv.with-info .pv-stage, .pv.with-info .pv-bar { right: 0; }
}

/* ---- the Camera page (14 Oct 2026; pages/camera.js, the phone's components/photos/CameraPage.tsx) ----
   The page is the viewfinder: black, the picture covering it, the controls
   over it — the timer top right, under the shell's top row; the thumbnail,
   the faces under the ring and the flip in a row above the bar. */
.screen.cam-screen { overflow: hidden; }
/* A picture to the edge, like the map: no fade where the page meets the rail or the bar. */
body[data-page='camera'] .app-shell > .screen { -webkit-mask-image: none; mask-image: none; }
.cam-page { position: absolute; inset: 0; background: #000; color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cam-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cam-top { position: absolute; right: 14px; top: calc(60px + env(safe-area-inset-top)); display: flex; gap: 10px; }
.cam-btn { min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.42); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 10px; cursor: pointer; font: inherit; font-weight: 800; font-size: 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cam-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 36; }
.cam-btn.on { background: #ffd60a; border-color: #ffd60a; color: #000; }
.cam-btn span:empty { display: none; }
.cam-btn:disabled { opacity: .45; cursor: default; }
.cam-btn:focus-visible, .cam-thumb:focus-visible, .cam-face:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cam-status { position: absolute; left: 50%; top: calc(116px + env(safe-area-inset-top)); transform: translateX(-50%); background: rgba(0,0,0,.55); padding: 8px 14px; border-radius: 16px; font-size: 14px; font-weight: 700; text-align: center; max-width: calc(100% - 32px); }
.cam-blank { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 28px 150px; text-align: center; }
.cam-blank[hidden] { display: none; }
.cam-blank-icon svg { width: 40px; height: 40px; stroke: #fff; fill: none; stroke-width: 30; }
.cam-blank-big { font-size: 19px; font-weight: 800; }
.cam-blank-small { font-size: 15px; line-height: 1.4; color: #d0d0d0; max-width: 360px; }
.cam-blank-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.cam-blank-row .btn { min-height: 44px; }
.cam-page .btn { background: #fff; color: #000; border: 1px solid #fff; }
.cam-page .btn.cam-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
/* No camera: the shutter and the faces stand back. */
.cam-page.cam-off .cam-rail-wrap, .cam-page.cam-off .cam-name, .cam-page.cam-off .cam-top { opacity: .35; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 0 12px; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.45)); }
.cam-name { text-align: center; font-weight: 800; font-size: 14px; text-shadow: 0 1px 6px rgba(0,0,0,.6); margin-bottom: 4px; min-height: 18px; }
.cam-controls { display: flex; align-items: center; gap: 10px; padding: 0 16px; max-width: 560px; margin: 0 auto; }
.cam-thumb, .cam-side { flex: none; width: 52px; height: 52px; border-radius: 26px; padding: 0; }
.cam-thumb { border: 2px solid #fff; overflow: hidden; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.cam-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-thumb svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 36; }
.cam-thumb.pop { animation: fc-thumb .35s ease-out; }
.cam-thumb.busy::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.cam-rail-wrap { position: relative; flex: 1; min-width: 0; height: 82px; }
.cam-rail { display: flex; align-items: center; gap: 12px; height: 82px; overflow-x: auto; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cam-rail::-webkit-scrollbar { display: none; }
.cam-pad { flex: none; width: calc(50% - 33px); height: 1px; }
.cam-face { flex: none; width: 54px; height: 54px; border-radius: 27px; border: 0; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; scroll-snap-align: center; transition: transform .15s, background .15s; color: #fff; padding: 0; }
.cam-face.plain { background: rgba(255,255,255,.55); }
.cam-face.on { transform: scale(1.06); background: rgba(255,255,255,.34); }
.cam-face.plain.on { background: #fff; }
/* A colour filter's disc: a sky over sand, painted through the filter (sillyfaces cameraMenu swatch). */
.cam-face.filter { box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
/* The viewfinder is the camera's whole picture (camera.js fit()); when the controls fit under it they stand on the black. */
.cam-page.cam-roomy .cam-bottom { background: none; }
.cam-face:disabled { cursor: default; }
.cam-ring { position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; transform: translate(-50%, -50%); border-radius: 37px; border: 5px solid #fff; box-sizing: border-box; pointer-events: none; box-shadow: 0 2px 14px rgba(0,0,0,.35); }
@media (prefers-reduced-motion: reduce) { .cam-face { transition: none; } .cam-thumb.pop { animation: none; } }
