/* Wedding photo sharing, in the invitation’s warm paper palette. */
.live-gallery { padding: 0; --gallery-surface: rgba(255,253,248,.96); color: var(--color-ink); }
.live-gallery button,.live-gallery input,.live-gallery select { font: inherit; }
.live-gallery button { cursor: pointer; }
.live-gallery [hidden] { display: none !important; }
.live-gallery :focus-visible { outline: 3px solid var(--color-fuchsia); outline-offset: 4px; }
.live-gallery button:disabled { opacity: .45; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.live-header { position: relative; z-index: 2; max-width: 840px; margin: auto; padding: 20px 28px 8px; display: flex; gap: 14px; align-items: center; }
.live-brand img { width: 50px; height: 48px; object-fit: contain; }
.camera-heading { flex: 1; }
.camera-heading h1 { margin: 0; font: 400 1.55rem/1.2 var(--font-display); letter-spacing: -.025em; }
.camera-heading p { margin: 4px 0 0; font: .64rem/1.4 system-ui,sans-serif; color: var(--color-ink-soft); }
.live-header select { border: 1px solid var(--color-line); border-radius: 20px; padding: 8px; background: var(--color-bg); font: .72rem system-ui,sans-serif; }
.live-main { position: relative; z-index: 1; max-width: 800px; margin: auto; padding: 0 28px 35px; }
.camera-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; margin-bottom: 8px; }
.connection-status { display: inline-flex; gap: 6px; align-items: center; font: .68rem/1.5 system-ui,sans-serif; color: var(--color-ink-soft); }
.connection-status:before { content: ''; border-radius: 50%; width: 6px; height: 6px; background: var(--color-orange); }
.connection-status[data-state='online']:before { background: #438448; }
.profile-chip { display: flex; align-items: center; gap: 6px; max-width: 55%; background: #f2e6e8; color: #7a314d; border: 0; border-radius: 20px; padding: 6px 12px; font: .7rem/1.4 system-ui,sans-serif !important; }
.profile-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-tabs { display: flex; gap: 5px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--color-line); border-radius: 28px; background: #f6efe5; }
.camera-tabs button { flex: 1; min-width: 0; padding: 10px 7px; border: 0; border-radius: 24px; background: transparent; color: var(--color-ink-soft); font: .8rem/1.5 system-ui,sans-serif; }
.camera-tabs button[aria-selected='true'] { background: var(--gallery-surface); color: var(--color-ink); box-shadow: 0 1px 5px #4d33221a; }
.share-panel { margin: auto; }
.share-heading { padding: 14px 0 22px; text-align: center; }
.share-heading .live-eyebrow { margin-bottom: 8px; }
.share-heading h2 { margin: 0; font: 400 clamp(1.8rem,5vw,2.5rem)/1.15 var(--font-display); letter-spacing: -.035em; }
.share-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.share-card { min-width: 0; padding: 24px; border: 1px solid var(--color-line); border-radius: 22px; background: var(--gallery-surface); box-shadow: 0 8px 30px #3f291c0a; text-align: center; }
.share-mark { display: block; font: 2.1rem/1.2 system-ui,sans-serif; margin-bottom: 12px; }
.share-card h3 { margin: 0 0 10px; font: 400 clamp(1.6rem,4vw,1.9rem)/1.15 var(--font-display); letter-spacing: -.025em; }
.share-intro { color: var(--color-ink-soft); font: .82rem/1.6 system-ui,sans-serif; margin: 0 0 18px; }
.share-actions { display: grid; gap: 10px; }
.share-actions .live-button { width: 100%; min-height: 54px; font-size: .96rem !important; touch-action: manipulation; }
.share-actions [aria-hidden] { font-size: 1.4rem; }
.share-note { color: var(--color-ink-soft); font: .72rem/1.6 system-ui,sans-serif; margin: 15px 0; }
.selected-challenge { max-width: 100%; margin-top: 14px; border: 1px solid var(--color-line); border-radius: 24px; padding: 7px 12px; background: #f6efe5; color: var(--color-ink-soft); font: .72rem/1.5 system-ui,sans-serif !important; }
.selected-challenge.has-challenge { background: #f3e3e9; color: #852d50; border-color: #d8bdca; }
.preparation-status { background: #f6efe5; border-radius: 14px; margin-top: 14px; padding: 12px 16px; font: .8rem/1.6 system-ui,sans-serif; }
.preparation-status p { margin: 0 0 6px; }
.preparation-status progress { width: 100%; height: 6px; accent-color: var(--color-fuchsia); }
.captured-photo { display: grid; grid-template-columns: 52px minmax(0,1fr); align-items: center; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--color-line); text-align: left; }
.captured-photo img { width: 52px; height: 64px; object-fit: cover; border-radius: 8px; }
.captured-photo .live-button { width: 100%; padding: 10px; font-size: .82rem !important; }
.captured-photo .capture-hint { grid-column: 1 / -1; margin: 0; }
.upload-overview { position: fixed; z-index: 20; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom,0px)); transform: translateX(-50%); width: min(600px,calc(100% - 28px)); max-height: min(50dvh,360px); overflow-y: auto; margin: 0; border: 1px solid #d8c6b4; border-radius: 18px; background: #fffdf8; padding: 14px 16px; box-shadow: 0 6px 30px #3f291c29; }
html:has(.has-upload-status) { scroll-padding-bottom: var(--upload-status-space,180px); }
.has-upload-status .live-main { padding-bottom: calc(var(--upload-status-space,180px) + 35px); }
.upload-status-heading { display: flex; align-items: center; gap: 10px; }
.upload-overview strong { flex: 1; min-width: 0; font: 600 .83rem/1.4 system-ui,sans-serif; }
.upload-overview .capture-hint { margin: 5px 0 0; font-size: .74rem; }
.upload-overview .live-text-button { flex-shrink: 0; padding: 7px 0; }
.upload-overview[data-state='error'] { border-color: #b92e64; }
.upload-overview[data-state='complete'] { border-color: #76997b; background: #f5faf3; }
.upload-overview[data-state='offline'] { border-color: #bb8b45; background: #fff9ee; }
.upload-status-icon { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: #f2e6e8; color: #852d50; font: 600 1rem/1 system-ui,sans-serif; }
.upload-overview[data-state='complete'] .upload-status-icon { background: #e0eddd; color: #356f3d; }
.upload-overview[data-state='preparing'] .upload-status-icon,.upload-overview[data-state='uploading'] .upload-status-icon,.upload-overview[data-state='backingUp'] .upload-status-icon { color: transparent; background: none; border: 3px solid #eedbe3; border-top-color: #b92e64; animation: upload-spin 1s linear infinite; }
#upload-status-progress { display: block; width: 100%; height: 6px; margin-top: 10px; accent-color: #b92e64; }
.upload-overview .undo-batches { margin: 10px 0 0; max-width: none; }
.upload-overview .undo-batches:empty { display: none; }
.upload-overview .undo-card { min-width: min(300px,100%); box-shadow: none; padding: 8px; }
.upload-overview .undo-card img { width: 30px; height: 38px; }
@keyframes upload-spin { to { transform: rotate(360deg); } }
@media(prefers-reduced-motion: reduce) { .upload-overview .upload-status-icon { animation: none !important; } }

.live-eyebrow { font: 500 .65rem/1.7 system-ui,sans-serif; letter-spacing: .13em; text-transform: uppercase; color: var(--color-fuchsia); margin: 0 0 14px; }
.live-button { min-height: 46px; padding: 12px 21px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 1px solid var(--color-line); border-radius: 28px; color: var(--color-ink); background: var(--gallery-surface); font-size: .86rem !important; text-decoration: none; }
.live-button--primary { background: var(--color-ink); color: white; border-color: var(--color-ink); }
.live-button--primary:hover { background: #493426; }
.live-text-button { border: 0; background: transparent; padding: 7px 0; text-decoration: underline; text-underline-offset: 3px; color: var(--color-ink-soft); font: .73rem/1.5 system-ui,sans-serif !important; }
.live-notice { border: 1px solid #dec7af; border-radius: 14px; padding: 14px 18px; background: var(--gallery-surface); color: var(--color-ink-soft); font: .83rem/1.6 system-ui,sans-serif; margin: 14px auto; }
.live-notice--error { border-color: var(--color-fuchsia); color: #8b214b; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.section-heading h2 { margin: 0; font: 400 clamp(1.7rem,4vw,2.25rem)/1.2 var(--font-display); letter-spacing: -.03em; }
.section-heading .live-eyebrow { margin-bottom: 7px; }
.section-description { font: .86rem/1.7 system-ui,sans-serif; color: var(--color-ink-soft); margin: 12px 0 18px; }
#challenges-panel,.shared-gallery { padding: 24px 0; }
.challenge-progress { font: .7rem/1.4 system-ui,sans-serif; background: #f2e6eb; border-radius: 24px; padding: 10px 13px; white-space: nowrap; }
.challenge-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 14px; }
.challenge-card { position: relative; min-width: 0; min-height: 120px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; border: 1px solid var(--color-line); border-radius: 14px; background: var(--gallery-surface); color: var(--color-ink); overflow: hidden; }
.challenge-card:nth-child(2n) { background: #f5edf0; }
.challenge-card:nth-child(3n) { background: #f6efdf; }
.challenge-card.is-selected { outline: 2px solid var(--color-fuchsia); outline-offset: -2px; }
.challenge-title { display: block; font: 400 1.06rem/1.35 var(--font-display); position: relative; z-index: 1; overflow-wrap: anywhere; }
.challenge-number { font: .65rem/1.5 system-ui,sans-serif; letter-spacing: .08em; color: var(--color-ink-soft); margin-top: 12px; }
.challenge-card.is-complete { background: #eaf0e3; border-color: #9eb78b; }
.challenge-card.is-complete img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; position: absolute; bottom: 13px; right: 14px; }
.challenge-celebration { padding: 16px 20px; border-radius: 12px; background: #eaf0e3; font: .86rem/1.7 system-ui,sans-serif; margin-top: 16px; }
.photo-count { font: .73rem/1.5 system-ui,sans-serif; color: var(--color-ink-soft); white-space: nowrap; }
.gallery-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(160px,.45fr); gap: 14px; margin: 22px 0 8px; }
.gallery-control { display: grid; gap: 6px; min-width: 0; color: var(--color-ink-soft); font: .72rem/1.5 system-ui,sans-serif; }
.gallery-control select { min-width: 0; width: 100%; min-height: 46px; padding-right: 28px; text-overflow: ellipsis; font: .8rem/1.5 system-ui,sans-serif; background-color: var(--gallery-surface); }
.gallery-order-hint { margin: 0 0 20px !important; max-width: 65ch; }
.gallery-empty { width: 100%; box-sizing: border-box; text-align: center; padding: 38px 22px; background: var(--gallery-surface); border: 1px solid var(--color-line); border-radius: 14px; font: 1rem/1.7 var(--font-display); color: var(--color-ink-soft); }
.gallery-empty p { margin: 0 auto 20px; max-width: 38ch; }
.live-photo-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; overflow-anchor: none; }
.live-photo { display: block; position: relative; aspect-ratio: 4/5; overflow: hidden; border: 0; padding: 0; border-radius: 10px; background: #eee4d7; }
.live-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.live-photo span { position: absolute; inset: auto 0 0; text-align: left; padding: 27px 12px 12px; background: linear-gradient(transparent,#140d08aa); color: white; font: .7rem/1.5 system-ui,sans-serif; }
.load-more { margin: 24px auto 0; display: flex; }
.undo-batches { position: sticky; z-index: 6; bottom: max(12px,env(safe-area-inset-bottom)); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; max-width: 540px; margin: 0 auto; }
.undo-batches::-webkit-scrollbar { display: none; }
.undo-card { flex: 0 0 calc(100% - 28px); min-width: 0; scroll-snap-align: start; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #fffdf8; border: 1px solid #d8bdca; box-shadow: 0 8px 30px #2b201825; }
.undo-card:only-child { flex-basis: 100%; }
.undo-card img { width: 42px; height: 48px; object-fit: cover; border-radius: 6px; }
.undo-card > span { flex: 1; }
.undo-card strong { display: block; font: 500 .8rem/1.4 system-ui,sans-serif; }
.undo-card small { color: var(--color-ink-soft); font: .7rem/1.6 system-ui,sans-serif; }
.undo-button { background: #f3e3e9; border: 0; border-radius: 22px; padding: 12px 15px; color: #852d50; font: 600 .76rem system-ui,sans-serif !important; }
.upload-drawer { max-width: 540px; margin: 16px auto 0; border: 1px solid var(--color-line); border-radius: 16px; background: var(--gallery-surface); padding: 0 16px; }
.upload-drawer summary { cursor: pointer; padding: 15px 0; font: .8rem/1.5 system-ui,sans-serif; }
#queue-summary { float: right; color: var(--color-ink-soft); font-size: .7rem; }
.capture-hint { color: var(--color-ink-soft); font: .73rem/1.6 system-ui,sans-serif; margin: 4px 0 12px; }
.upload-list { list-style: none; padding: 0; margin: 0; }
.upload-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--color-line); }
.upload-row img { width: 42px; height: 50px; object-fit: cover; border-radius: 5px; }
.upload-placeholder { display: grid; place-items: center; width: 42px; height: 50px; border-radius: 5px; background: #f3e3e9; color: #852d50; }
.upload-row strong { display: block; font: 500 .76rem/1.5 system-ui,sans-serif; }
.upload-row small { display: block; font: .66rem/1.6 system-ui,sans-serif; color: var(--color-ink-soft); }
.upload-row[data-error='true'] small { color: #9b2451; }
.upload-row progress { height: 4px; accent-color: var(--color-fuchsia); width: min(200px,100%); }
.upload-row-actions { display: flex; flex-direction: column; align-items: flex-end; }
.upload-row-actions button { font-size: .67rem !important; }
.field-label { display: block; font: .78rem/1.5 system-ui,sans-serif; margin-bottom: 7px; }
.live-input { display: block; width: 100%; border: 1px solid var(--color-line); border-radius: 10px; padding: 12px; background: white; font: 16px/1.5 system-ui,sans-serif !important; }
.profile-dialog { position: fixed; inset: 0; margin: auto; box-sizing: border-box; max-width: none; max-height: calc(100dvh - 28px); overflow-y: auto; border: 1px solid var(--color-line); background: var(--color-bg); color: var(--color-ink); border-radius: 20px; padding: 25px; width: min(430px,calc(100vw - 28px)); }
.profile-dialog::backdrop { background: #21180db0; }
.profile-dialog h2 { font: 400 2rem/1.2 var(--font-display); margin: 0 0 20px; }
.profile-dialog .capture-hint { margin: 12px 0 20px; }
.profile-dialog #close-profile { margin-left: 16px; }
.photo-dialog { inset: 0; max-width: none; max-height: none; width: 100%; height: 100dvh; padding: max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); background: #171410; color: white; border: 0; overflow: hidden; }
.photo-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.photo-dialog::backdrop { background: #171410; }
.photo-dialog-heading { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; min-height: 46px; gap: 16px; }
#photo-position { margin: 0 0 0 6px; font: .78rem/1.5 system-ui,sans-serif; color: #e8d8c8; }
.photo-dialog-close { z-index: 2; font: 2rem/1 system-ui,sans-serif !important; background: #0007; border: 1px solid #ffffff40; border-radius: 50%; width: 46px; height: 46px; flex-shrink: 0; color: white; }
.photo-dialog-media { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; user-select: none; }
.photo-dialog-media img { display: block; max-height: 100%; max-width: 100%; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
#photo-load-status { position: absolute; margin: 0; padding: 20px 58px; text-align: center; color: #e8d8c8; font: .8rem/1.7 system-ui,sans-serif; }
.photo-nav { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); width: 46px; height: 56px; display: flex; align-items: center; justify-content: center; border: 1px solid #ffffff55; border-radius: 28px; color: white; background: #171410a6; backdrop-filter: blur(8px); font: 2.4rem/1 system-ui,sans-serif !important; }
.photo-nav--previous { left: 7px; } .photo-nav--next { right: 7px; }
.photo-nav:hover:not(:disabled) { background: #594234cc; }
.photo-dialog .photo-nav:disabled { opacity: .3; }
.photo-dialog-footer { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 20px; font: .85rem/1.5 system-ui,sans-serif; }
#photo-dialog-caption { color: #f0e6dc; margin: 0; overflow-wrap: anywhere; max-height: 5.4em; overflow-y: auto; }
.photo-dialog-caption { min-width: 0; }
.photo-dialog-time { margin: 4px 0 0; color: #d7c7b8; font: .7rem/1.45 system-ui,sans-serif; }
.photo-dialog-footer .live-button { flex-shrink: 0; }
.photo-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 16px; }
.photo-dialog-actions .live-text-button { color: #e7bfc4; }
.photo-dialog #save-status { color: #e8d8c8; margin: 0; min-height: 1.4em; font: .75rem/1.4 system-ui,sans-serif; }
@media(min-width: 700px) { .camera-tabs { max-width: 540px; margin-inline: auto; } .camera-topline { max-width: 540px; margin-inline: auto; } }
@media(max-width: 480px) {
  .live-header { padding: 12px 16px 5px; gap: 10px; } .live-main { padding: 0 14px 25px; }
  .live-brand img { width: 37px; height: 42px; } .camera-heading h1 { font-size: 1.3rem; } .camera-heading p { font-size: .58rem; }
  .share-card { padding: 22px 20px; }
  .camera-topline { min-height: 34px; margin-bottom: 5px; } .camera-tabs { margin-bottom: 10px; }
  .challenge-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .challenge-card { min-height: 132px; padding: 16px 14px; }
  .gallery-toolbar { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .challenge-progress { font-size: .66rem; padding: 9px; } .live-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .photo-dialog-footer { gap: 10px; } .photo-dialog-footer .live-button { font-size: .75rem !important; padding-inline: 16px; }
}

/* Keep touch controls immediate while preserving pinch zoom. */

@media(prefers-reduced-motion: reduce) { .live-gallery * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Post-wedding album */
.gallery-toolbar { flex-wrap: wrap; }
.album-selection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0; }
.live-photo.is-selected { outline: 4px solid var(--color-accent, #8d452d); outline-offset: -4px; }
.live-photo.is-selected::after { content: '✓'; position: absolute; top: .5rem; right: .5rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #fff; color: #683d2c; display: grid; place-items: center; font-weight: bold; }
.album-review-files { max-height: 35vh; overflow: auto; padding-left: 0; list-style: none; text-align: left; }
.album-review-files li { padding: .5rem 0; overflow-wrap: anywhere; }
.album-review-files input { width: auto; margin-right: .5rem; }
#album-download-dialog .live-button { margin: .5rem 0; display: inline-flex; }
#selection-dialog .field-label { display: block; margin: .75rem 0; }
.share-options { grid-template-columns: minmax(0, 1fr); }
.camera-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.live-gallery .gallery-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .75rem; align-items: end; }
.live-gallery .gallery-control { min-width: 0; }
.live-gallery .gallery-control--sort { grid-column: auto; }
.live-gallery .gallery-toolbar select { min-width: 0; width: 100%; }
@media (min-width: 768px) { .live-gallery .gallery-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Phone album controls: selection stays reachable without covering the grid. */
.share-options { grid-template-columns: minmax(0,1fr); max-width: 560px; margin-inline: auto; }
.photo-share-card h3 { display: none; }
.share-actions #choose-photos { order: -1; }
.album-filter-group { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.album-filter-group legend { font: 600 .75rem/1.5 system-ui,sans-serif; margin-bottom: 7px; }
.album-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.album-chip { border: 1px solid var(--color-line); border-radius: 24px; padding: 9px 13px; min-height: 44px; background: var(--gallery-surface); color: var(--color-ink); font: .76rem/1.3 system-ui,sans-serif !important; }
.album-chip[aria-pressed='true'] { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
.album-grid-actions { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--gallery-surface); padding-block: 8px; border-bottom: 1px solid var(--color-line); }
.album-browse-controls { display: contents; }
.album-grid-actions .gallery-control { display: flex; align-items: center; gap: 8px; }
.album-grid-actions select { width: auto; margin: 0; }
.album-selection-actions { position: fixed; z-index: 25; left: 50%; bottom: 0; transform: translateX(-50%); width: min(760px,100%); margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom,0px)); border: 1px solid var(--color-line); border-radius: 18px 18px 0 0; background: var(--gallery-surface); box-shadow: 0 -4px 24px #3f291c16; display: block; }
.album-selection-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; font: .85rem/1.4 system-ui,sans-serif; }
.album-selection-heading .capture-hint { margin: 0; text-align: right; }
.album-selection-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.album-selection-buttons > .live-button { flex: 1 1 130px; }
#album-more { position: relative; }
#album-more summary { cursor: pointer; padding: 12px 5px; font: .8rem system-ui,sans-serif; }
#album-more .live-button { position: absolute; bottom: 100%; right: 0; white-space: nowrap; box-shadow: 0 0 20px #3f291c20; }
.has-album-selection .live-main { padding-bottom: calc(var(--album-selection-space,160px) + 28px); }
.has-album-selection.has-upload-status .live-main { padding-bottom: calc(var(--album-selection-space,160px) + var(--upload-status-space,180px) + 28px); }
.has-album-selection .upload-overview { bottom: calc(var(--album-selection-space,160px) + 8px); max-height: min(30dvh,220px); }
html:has(.has-album-selection) { scroll-padding-bottom: calc(var(--album-selection-space,160px) + var(--upload-status-space,0px)); }
.has-album-selection .live-photo::after { content: ''; position: absolute; top: .5rem; right: .5rem; width: 1.6rem; height: 1.6rem; border: 2px solid white; border-radius: 50%; background: #35291c55; }
.has-album-selection .live-photo.is-selected::after { content: '✓'; display: grid; place-items: center; background: var(--color-fuchsia); color: white; font: 700 1rem system-ui,sans-serif; }
.album-file-downloads { display: grid; gap: 8px; }
.album-file-downloads a { overflow-wrap: anywhere; max-width: 100%; }
#album-download-dialog { max-height: 85dvh; overflow: auto; }
@media(max-width: 460px) { .album-selection-buttons .live-text-button { font-size: .72rem !important; } .album-grid-actions .live-input { max-width: 160px; } }
.photobooth-dialog{width:min(960px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:24px;border:1px solid #eaded5;border-radius:24px;background:#fffaf4;color:#302218;overflow:auto}.photobooth-dialog::backdrop{background:#241a15bb}.photobooth-dialog header{display:flex;justify-content:space-between;align-items:center;gap:16px}.photobooth-dialog h2{margin:0;font-family:var(--font-serif,Georgia,serif)}.photobooth-shots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:20px 0}.photobooth-shots article{min-width:0}.photobooth-shots img{width:100%;height:auto;border-radius:12px;display:block}.photobooth-shots p{font-size:.85rem;margin:8px 0}.photobooth-session-actions{position:sticky;bottom:-24px;display:flex;flex-wrap:wrap;gap:12px;background:#fffaf4;padding:16px 0 calc(16px + env(safe-area-inset-bottom))}.photobooth-session-actions button{flex:1}.photobooth-shots .live-button{width:100%}@media(max-width:540px){.photobooth-dialog{padding:16px}.photobooth-shots{grid-template-columns:1fr}.photobooth-session-actions{bottom:-16px}}
.gallery-window-spacer{grid-column:1/-1;pointer-events:none}.gallery-more-sentinel{text-align:center;padding:12px 0}.gallery-more-sentinel[hidden],.gallery-window-spacer[hidden]{display:none}
/* Current-state album browsing and explicit selection targets. */
.album-collection-tabs { gap: 4px; border-bottom: 1px solid var(--color-line); padding-bottom: 8px; }
.album-collection-tabs .album-chip { border-radius: 8px; }
.gallery-loader { min-height: 200px; display: grid; place-items: center; }
.gallery-loader video { width: 150px; height: 160px; object-fit: contain; mix-blend-mode: multiply; }
.live-photo-open { width: 100%; height: 100%; display: block; padding: 0; border: 0; background: transparent; color: inherit; }
.live-photo-open img { object-fit: cover; }
.live-photo .photo-select-check { appearance: none; -webkit-appearance: none; position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; margin: 0; border: 2px solid white; border-radius: 10px; background: #30221899; box-shadow: 0 1px 5px #0005; cursor: pointer; }
.photo-select-check:checked { background: var(--color-fuchsia); }
.photo-select-check:checked::after,.photo-select-check:indeterminate::after { content: '✓'; display: grid; place-items: center; height: 100%; color: white; font: 700 25px system-ui,sans-serif; }
.photo-select-check:indeterminate::after { content: '−'; }
.has-album-selection .live-photo::after { content: none; }
.album-selection-actions { max-height: min(45dvh,280px); overflow: auto; }
.album-selection-buttons { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 12px; }
.album-selection-buttons > .live-button { grid-column: 1 / -1; width: 100%; }
.album-selection-buttons .live-text-button { white-space: normal; min-height: 44px; text-align: center; }
#album-save-choices { border: 0; display: grid; gap: 10px; margin: 16px 0; }
#album-save-choices label { display: flex; gap: 12px; align-items: center; min-height: 54px; padding: 12px; border: 1px solid var(--color-line); border-radius: 10px; text-align: left; }
#album-save-choices input { flex: 0 0 22px; width: 22px; height: 22px; accent-color: var(--color-fuchsia); }
#album-download-dialog .live-button { width: 100%; justify-content: center; white-space: normal; }
#album-download-dialog { overscroll-behavior: contain; }
.photobooth-dialog { position: fixed; inset: 0; margin: auto; max-width: none; padding: 0; width: min(960px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; background: var(--color-bg); color: var(--color-ink); }
.photobooth-dialog[open] { display: flex; flex-direction: column; }
.photobooth-dialog header { flex: 0 0 auto; padding: 16px 20px; border-bottom: 1px solid var(--color-line); }
.photobooth-dialog header h2 { flex: 1; font-size: 1.7rem; }
.photobooth-dialog header button { min-height: 44px; min-width: 44px; }
.photobooth-body { overflow: auto; overscroll-behavior: contain; padding: 16px 20px; min-height: 0; }
.photobooth-body > p { margin: 0 0 12px; font: .85rem/1.5 var(--font-body); }
.photobooth-shots { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 0; }
.photobooth-shots article { display: grid; gap: 8px; align-content: start; }
.photobooth-shots article > label { display: flex; gap: 8px; align-items: center; min-height: 44px; font: .8rem/1.4 var(--font-body); }
.photobooth-shots input { width: 24px; height: 24px; accent-color: var(--color-fuchsia); flex-shrink: 0; }
.photobooth-preview { display: block; width: 100%; padding: 0; border: 0; background: #eee4d7; border-radius: 12px; overflow: hidden; aspect-ratio: 3/2; }
.photobooth-preview img { height: 100%; width: 100%; object-fit: contain; }
.photobooth-session-actions { position: static; flex: 0 0 auto; border-top: 1px solid var(--color-line); background: var(--color-bg); padding: 12px 20px max(12px,env(safe-area-inset-bottom)); gap: 10px; }
.photobooth-session-actions button { min-width: 0; white-space: normal; }
.photobooth-shots--single { display: flex; min-height: 200px; justify-content: center; }
.photobooth-shots--single > img { max-height: 65dvh; width: 100%; object-fit: contain; }
@media(max-width:540px) {
  .photobooth-dialog { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .photobooth-dialog header { padding: max(12px,env(safe-area-inset-top)) 14px 12px; }
  .photobooth-body { padding: 14px; flex: 1; }
  .photobooth-shots { gap: 12px; }
  .photobooth-shots .live-button { padding: 10px 6px; font-size: .8rem !important; }
  .photobooth-session-actions { padding-inline: 14px; }
  .photobooth-session-actions button { flex: 1 1 100%; }
}
/* Save preparation has a scrolling body and separate, full-width actions. */
#album-download-dialog { width: min(480px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; }
#album-download-dialog[open] { display: flex; flex-direction: column; }
.album-download-heading { flex: 0 0 auto; padding: 20px 20px 12px; border-bottom: 1px solid var(--color-line); }
#album-download-dialog .album-download-heading h2 { margin: 0; font-size: clamp(1.4rem,5vw,1.8rem); line-height: 1.2; overflow-wrap: anywhere; }
.album-download-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; }
#album-download-status { margin: 0 0 12px; font: 1rem/1.5 var(--font-body); overflow-wrap: anywhere; }
.album-download-actions { display: grid; gap: 8px; flex: 0 0 auto; max-height: 50dvh; overflow-y: auto; padding: 12px 20px max(12px,env(safe-area-inset-bottom)); border-top: 1px solid var(--color-line); }
#album-download-dialog .album-download-actions > button,#album-download-dialog .album-download-actions > a { display: flex; align-items: center; justify-content: center; position: static; width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 12px; white-space: normal; overflow-wrap: anywhere; text-align: center; font: 1rem/1.4 var(--font-body); }
#album-preparation { margin: 0 0 12px; }
#album-preparation-dancers { display: block; width: 112px; height: 120px; margin: 0 auto 16px; object-fit: contain; mix-blend-mode: multiply; }
.album-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font: .85rem/1.4 var(--font-body); }
#album-preparation-percent { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
#album-preparation-progress { display: block; width: 100%; height: 12px; margin: 10px 0; accent-color: var(--color-fuchsia); }
#album-download-dialog #album-preparation .capture-hint { margin: 8px 0 0; }
#album-download-dialog:is([data-state='preparing'],[data-state='handoff']) .album-download-metadata { display: none; }
@media(max-width:380px) { .album-download-heading { padding: 16px 16px 12px; } .album-download-body { padding: 14px 16px; } .album-download-actions { padding-inline: 16px; } }

.album-save-feedback { position: fixed; z-index: 30; top: max(12px,env(safe-area-inset-top,0px)); left: 50%; transform: translateX(-50%); width: min(480px,calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--color-line); border-radius: 16px; background: var(--gallery-surface); box-shadow: 0 6px 30px #3f291c29; font: 1rem/1.5 var(--font-body); overflow-wrap: anywhere; }
.album-save-feedback span { flex: 1; min-width: 0; }
.album-save-feedback button { flex: 0 0 auto; min-height: 44px; }
