/* Staging additions on top of style.css: photographer create flow, album
   gates (password / indexing / unavailable) and shared form components.
   Uses only the design tokens defined in style.css. */

.badge { display: inline-block; margin-left: 10px; padding: 4px 10px; border-radius: 999px; background: var(--color-marigold-soft); color: #7a4d00;
  font: normal 700 10px/1.4 var(--font-body); letter-spacing: .12em; text-transform: uppercase; vertical-align: middle; }

/* ---- Create page ------------------------------------------------------ */
.create { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 6vw, 96px);
  align-items: start; padding: clamp(48px, 7vw, 104px) var(--space-page) clamp(64px, 8vw, 110px); }
.create-intro h1 { font-size: clamp(48px, 4.8vw, 84px); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 36px 0 0; display: grid; gap: 18px; max-width: 480px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: center;
  color: var(--color-muted); font-size: 14px; line-height: 1.6; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-marigold-soft); color: var(--color-ink); font: 700 14px/1 var(--font-body); }
.steps li:nth-child(2)::before { background: var(--color-blush); }
.steps li:nth-child(3)::before { background: var(--color-sage-soft); }
.steps strong { color: var(--color-ink); font-weight: 600; }
.my-albums { grid-column: 1 / -1; border-top: 1px solid var(--color-rule); padding-top: 28px; }
.my-albums h3 { font-size: 30px; margin-bottom: 16px; }
.albums-empty { color: var(--color-muted); font-size: 14px; }
.album-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.album-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 18px 22px;
  border: 1px solid var(--color-rule); border-radius: 16px; background: var(--color-ivory); }
.album-info { display: grid; gap: 4px; min-width: 0; flex: 1 1 280px; font-size: 13px; color: var(--color-muted); }
.album-info p { margin: 0; }
.album-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--color-ink); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.album-name .album-status { margin: 0; padding: 3px 10px; border-radius: 999px; background: var(--color-marigold-soft); color: #7a4d00;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.album-name .album-status[data-state="ready"] { background: var(--color-sage-soft); color: var(--color-sage); }
.album-name .album-status[data-state="failed"] { background: var(--color-blush); color: var(--color-rose-dark); }
.album-error { color: var(--color-rose-dark); }
.album-actions { display: flex; flex-wrap: wrap; gap: 13px 20px; }
.album-actions .text-button:disabled { opacity: .45; cursor: default; }
.album-actions .text-button:disabled:hover { color: var(--color-muted); }
.album-actions .is-danger:hover { color: var(--color-rose-dark); }
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: clamp(24px, 3.4vw, 36px); border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  background: var(--color-ivory); color: var(--color-ink); box-shadow: 0 24px 60px var(--color-shadow); }
.confirm-dialog::backdrop { background: #2a1a3366; }
.confirm-dialog .card-title { font-size: 30px; margin-bottom: 14px; }
.confirm-dialog .card-actions { margin-top: 22px; }

/* ---- Card & form ------------------------------------------------------ */
.card { position: relative; overflow: hidden; background: var(--color-ivory); border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  box-shadow: 0 30px 70px -20px var(--color-shadow); padding: clamp(24px, 3.4vw, 44px); }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--color-rose), var(--color-marigold)); }
.card-title { font-size: clamp(34px, 3.2vw, 46px); line-height: 1; letter-spacing: -.02em; margin: 6px 0 26px; overflow-wrap: anywhere; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field > span { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.field em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--color-muted); }
.field input { width: 100%; min-height: 52px; padding: 13px 16px; border: 1.5px solid var(--color-rule); background: var(--color-paper);
  color: var(--color-ink); border-radius: var(--radius-field); transition: border-color .2s var(--ease-gentle), background .2s var(--ease-gentle), box-shadow .2s var(--ease-gentle); }
.field:focus-within { outline: none; } /* inputs carry their own focus ring */
.field input:focus { outline: none; border-color: var(--color-rose); background: var(--color-white); box-shadow: 0 0 0 4px var(--color-blush); }
.field input::placeholder { color: #ab9fb0; }
.field small { color: var(--color-muted); font-size: 12px; }
.form-error { color: var(--color-rose-dark); background: var(--color-blush); border-radius: var(--radius-field); padding: 12px 14px; font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.signin-note { color: var(--color-muted); font-size: 14px; line-height: 1.6; margin: -10px 0 22px; }
.google-button { min-height: 44px; }
.usage { margin: -8px 0 22px; font-size: 13px; color: var(--color-muted); }
.form-error a { color: inherit; font-weight: 600; }
.account { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; margin: 0 0 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--color-rule); font-size: 13px; color: var(--color-muted); }
.account strong { color: var(--color-ink); overflow-wrap: anywhere; }
.button-block { width: 100%; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; font-size: 13px; }
.link-box .button { min-height: 52px; padding-inline: 16px; }
.lock-note { color: var(--color-sage); letter-spacing: .04em; text-transform: none; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.lock-note .icon { width: 14px; height: 14px; }

/* ---- Progress --------------------------------------------------------- */
.progress { height: 8px; border-radius: 999px; background: var(--color-blush); overflow: hidden; margin: 6px 0 12px; }
.progress-bar { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--color-rose), var(--color-marigold)); transition: width .6s var(--ease-gentle); position: relative; }
.progress:not(.is-done):not(.is-failed) .progress-bar::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, #ffffff80, transparent); animation: shimmer 1.6s infinite; }
.progress.is-done .progress-bar { background: var(--color-sage); }
.progress.is-failed .progress-bar { background: var(--color-rose-dark); }
.progress-text { font-size: 13px; color: var(--color-muted); margin-bottom: 26px; min-height: 1.5em; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---- Album gates ------------------------------------------------------ */
.gate { min-height: calc(100dvh - 86px - 120px); display: grid; place-items: center; padding: 48px var(--space-page); text-align: center; }
.gate > p { color: var(--color-muted); }
.gate .processing-mark { animation: gentle-pulse 1.6s var(--ease-gentle) infinite alternate; }
.gate-card { width: min(460px, 100%); text-align: left; }
.gate-icon { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--color-blush); color: var(--color-rose); margin-bottom: 16px; }
.gate-copy { color: var(--color-muted); font-size: 14px; line-height: 1.65; }

@media (max-width: 860px) {
  .create { grid-template-columns: 1fr; }
  .masthead-note .badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-bar::after, .gate .processing-mark { animation: none !important; }
}

/* Privacy and terms pages. */
.legal { max-width: 720px; margin: 0 auto; padding: 48px var(--space-page) 72px; line-height: 1.65; }
.legal h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 6vw, 58px); margin: 0 0 6px; }
.legal h2 { font-family: var(--font-display); font-weight: 400; font-size: 28px; margin: 36px 0 8px; }
.legal-updated { color: var(--color-muted); margin-top: 0; }
.legal li { margin-bottom: 10px; }
.footer a { color: inherit; }

/* ---- Photographer branding + WhatsApp share (P41) ---------------------- */
/* Branded masthead (P46): the studio replaces the brand in the masthead row, so the hero keeps its place.
   The same markup is reused in the My albums phone preview. */
.masthead:has(#studio:not([hidden])) { background: linear-gradient(90deg, var(--color-blush), var(--color-paper) 55%, var(--color-marigold-soft)); }
.masthead:has(#studio:not([hidden])) .brand { display: none; }
.studio-bar { display: flex; align-items: center; gap: 12px 20px; min-width: 0; }
.studio-masthead { flex: 1 1 auto; justify-content: space-between; }
.studio-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.studio-logo { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; background: var(--color-ivory); box-shadow: 0 0 0 2px var(--color-ivory), 0 4px 12px var(--color-shadow); }
.studio-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio-logo img:not([hidden]) + .studio-monogram { display: none; }
.studio-monogram { font: italic 600 21px/1 var(--font-display); color: var(--color-rose); text-transform: uppercase; }
.studio-text { margin: 0; display: grid; gap: 1px; min-width: 0; }
.studio-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }
.studio-text strong { font: 500 20px/1.2 var(--font-display); color: var(--color-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-contact { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 9px 16px; border-radius: 999px; background: var(--color-ivory);
  color: var(--color-ink); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 260px;
  box-shadow: 0 2px 8px var(--color-shadow); transition: transform .2s var(--ease-gentle); }
.studio-contact span { overflow: hidden; text-overflow: ellipsis; }
.studio-contact:hover { transform: translateY(-1px); }
.studio-contact .icon { width: 17px; height: 17px; display: none; }
.studio-contact[data-kind="whatsapp"] .icon-whatsapp { display: block; color: #1a9e5b; }
.studio-contact[data-kind="instagram"] .icon-instagram { display: block; color: var(--color-rose); }
.studio-contact[data-kind="website"] .icon-website { display: block; color: var(--color-sage); }

/* Album-level WhatsApp share for guests: a quiet chip, secondary to the selfie actions. */
.share-whatsapp { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 8px 14px 8px 12px; border-radius: 999px;
  border: 1px solid var(--color-rule); background: var(--color-ivory); color: var(--color-ink); text-decoration: none; font-size: 13px; font-weight: 600; }
.share-whatsapp .icon { width: 17px; height: 17px; color: #1a9e5b; }
.share-whatsapp:hover { border-color: #1a9e5b; }
.results-top .share-whatsapp { margin: 0 0 0 auto; }
.results-top .results-eyebrow { margin-left: auto; }
.results-top .results-eyebrow + .share-whatsapp { margin-left: 0; }
.button-whatsapp .icon { color: #1a9e5b; }
.button-whatsapp:hover .icon { color: inherit; }
.button-small { min-height: 40px; padding: 9px 18px; font-size: 13px; }

/* Album-ready card: nudge towards Your studio when no branding is set (P46). */
.branding-nudge { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 12px 16px; border-radius: 14px;
  background: var(--color-marigold-soft); color: var(--color-ink); text-decoration: none; font-size: 13px; font-weight: 600; line-height: 1.4; }
.branding-nudge .brand-mark { transform: scale(.8); }
.branding-nudge .icon { width: 16px; height: 16px; margin-left: auto; flex: none; transition: transform .2s var(--ease-gentle); }
.branding-nudge:hover .icon { transform: translateX(3px); }
html { scroll-behavior: smooth; }
#branding { scroll-margin-top: 24px; }

/* My albums → Your studio */
.branding { grid-column: 1 / -1; border-top: 1px solid var(--color-rule); padding-top: 28px; }
.branding-head { margin-bottom: 18px; }
.branding-head h3 { font-size: 30px; margin-bottom: 6px; }
.branding-head p { margin: 0; color: var(--color-muted); font-size: 14px; }
.branding-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.logo-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.studio-logo-large { width: 64px; height: 64px; }
.studio-logo-large .studio-monogram { font-size: 30px; }
.contact-field { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.contact-field legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.contact-field legend em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--color-muted); margin-left: 8px; }
.segmented { justify-self: start; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 4px; border-radius: 999px; background: var(--color-paper); border: 1.5px solid var(--color-rule); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--color-muted); cursor: pointer; }
.segmented .icon { width: 15px; height: 15px; }
.segmented input:checked + span { background: var(--color-ivory); color: var(--color-ink); box-shadow: 0 2px 8px var(--color-shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--color-rose); outline-offset: 2px; }
.branding-status { font-size: 13px; color: var(--color-sage); font-weight: 600; }

/* Live preview: a small phone frame with the real studio-bar and skeleton hero lines. */
.branding-preview { position: sticky; top: 24px; }
.preview-phone { width: min(340px, 100%); margin-top: 12px; border-radius: 30px; overflow: hidden; background: var(--color-paper);
  border: 8px solid var(--color-ink); box-shadow: 0 30px 60px -20px var(--color-shadow); }
.preview-masthead { display: flex; align-items: center; height: 62px; padding: 0 12px; border-bottom: 1px solid var(--color-rule);
  background: linear-gradient(90deg, var(--color-blush), var(--color-paper) 55%, var(--color-marigold-soft)); }
.preview-phone .studio-logo { width: 36px; height: 36px; }
.preview-phone .studio-text strong { font-size: 15px; }
.preview-phone .studio-label { font-size: 9px; }
.preview-phone .studio-contact { width: 36px; height: 36px; padding: 0; justify-content: center; }
.preview-phone .studio-contact span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.preview-phone .studio-contact::after { content: none; }
.preview-hero { display: grid; gap: 10px; padding: 22px 16px 28px; }
.preview-chip { width: 96px; height: 16px; border-radius: 999px; background: var(--color-blush); }
.preview-line { height: 20px; width: 82%; border-radius: 6px; background: var(--color-ink); opacity: .85; }
.preview-line-accent { width: 60%; background: var(--color-rose); }
.preview-line-thin { height: 8px; width: 90%; background: var(--color-muted); opacity: .3; }
.preview-line-thin.short { width: 64%; }
.preview-button { width: 120px; height: 34px; margin-top: 6px; border-radius: 999px; background: var(--color-rose); }

@media (max-width: 860px) {
  .branding-grid { grid-template-columns: 1fr; }
  .branding-preview { position: static; }
}
@media (max-width: 700px) {
  .masthead:has(#studio:not([hidden])) { height: 72px; }
  .studio-logo { width: 40px; height: 40px; }
  .studio-text strong { font-size: 17px; }
  .studio-label { font-size: 10px; }
  /* Icon-only contact on phones; the label stays as the accessible name. */
  .studio-contact { height: 40px; padding: 0 14px 0 12px; gap: 6px; }
  /* Short visible word so the contact button can't be mistaken for "Share album" (P46 polish).
     The "/ ''" alt text keeps it out of the accessible name, which stays the full hidden label. */
  .studio-contact::after { font-size: 13px; font-weight: 700; content: "Message" / ""; }
  .studio-contact[data-kind="instagram"]::after { content: "Instagram" / ""; }
  .studio-contact[data-kind="website"]::after { content: "Website" / ""; }
  .studio-contact span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .studio-contact .icon { width: 19px; height: 19px; }
  .segmented { justify-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 16px; }
  .segmented span { justify-content: center; padding: 8px 6px; border-radius: 12px; font-size: 12px; }
}
/* My albums row link built by create.mjs: <a class="text-button share-whatsapp-row">. */
.album-actions .share-whatsapp-row { color: #157f4a; text-decoration: none; }
.album-actions .share-whatsapp-row:hover { color: var(--color-ink); }
/* ---- Favourites (P43) ---------------------------------------------------- */
/* Legacy albums: no hearts or entry points at all. */
body[data-favourites="off"] :is(.heart-toggle, .favourites-chip, #favourites-manage, #browse) { display: none !important; }

/* Heart toggle: outline when off, filled rani pink when on. Tiles wrap as <div class="photo-cell"> [button.photo + button.tile-heart]. */
.photo-cell { position: relative; min-width: 0; }
/* A failed preview shows a plain blush tile instead of the broken-image icon and filename.
   ::before only renders on broken images (Chrome, Firefox); transparent text hides Safari's alt text. */
.gallery .photo img { position: relative; color: transparent; }
.gallery .photo img::before { content: ""; position: absolute; inset: 0; background: var(--color-blush); }
.heart-toggle .icon { fill: transparent; transition: fill .18s var(--ease-gentle), transform .18s var(--ease-gentle); }
.heart-toggle[aria-pressed="true"] .icon { fill: currentColor; }
.heart-toggle:active .icon { transform: scale(.85); }
.tile-heart { position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: #ffffffe0; color: var(--color-ink); box-shadow: 0 4px 14px #1c102233;
  opacity: 0; transition: opacity .2s var(--ease-gentle), transform .2s var(--ease-gentle); }
.tile-heart .icon { width: 20px; height: 20px; }
.photo-cell:hover .tile-heart, .tile-heart:focus-visible, .tile-heart[aria-pressed="true"] { opacity: 1; }
.tile-heart[aria-pressed="true"] { color: var(--color-rose); }
@media (hover: none) { .tile-heart { opacity: 1; width: 36px; height: 36px; top: 8px; right: 8px; } }
/* Invisible ring so the tap target is 44 px (phones) / 48 px (desktop) while the visible disc stays small on narrow tiles. */
.tile-heart::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }

/* Viewer header heart: 44 px targets with room between heart and close. */
.viewer-header-actions { display: inline-flex; align-items: center; gap: 8px; }
.viewer-header-actions .viewer-icon { width: 44px; height: 44px; }
#viewer-heart { border-radius: 50%; }
#viewer-heart[aria-pressed="true"] { color: #ff6fa5; }
#viewer-heart .icon { width: 22px; height: 22px; }

/* "My favourites (N)" chip: welcome entry point and results filter */
.favourites-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px 8px 14px; border-radius: 999px; border: 1px solid var(--color-rule);
  background: var(--color-ivory); color: var(--color-ink); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.favourites-chip .icon { width: 16px; height: 16px; color: var(--color-rose); fill: var(--color-rose); }
.favourites-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--color-blush); color: var(--color-rose-dark); font-size: 12px; text-align: center; }
.favourites-chip[aria-pressed="true"] { background: var(--color-rose); border-color: var(--color-rose); color: var(--color-white); }
.favourites-chip[aria-pressed="true"] .icon { color: var(--color-white); fill: var(--color-white); }
.favourites-chip[aria-pressed="true"] .favourites-count { background: #ffffff33; color: var(--color-white); }
.hero-copy .favourites-chip { margin: 18px 10px 0 0; }
.hero-copy .share-whatsapp { margin-right: 10px; min-height: 44px; }

/* Sign-in sheet + My favourites dialogs (reuse .confirm-dialog) */
.dialog-heart { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; background: var(--color-blush); color: var(--color-rose); }
.dialog-heart .icon { width: 24px; height: 24px; fill: currentColor; }
.danger-zone { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--color-rule); }
.clear-confirm { margin-top: 10px; padding: 14px 16px; border-radius: var(--radius-field); background: var(--color-blush); font-size: 13px; line-height: 1.55; }
.clear-confirm p { margin: 0 0 8px; }
.button-danger { background: var(--color-rose-dark); color: var(--color-white); min-height: 44px; padding: 10px 20px; }
.button-danger:hover { background: #6d1a40; }

/* Photographer: favourites export panel */
.favourites-panel { width: min(720px, calc(100% - 24px)); }
.fav-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.fav-head .card-title { margin-bottom: 18px; }
.fav-close { color: var(--color-ink); flex: none; border-radius: 50%; }
.fav-close:hover { background: var(--color-blush); }
.fav-empty { display: flex; gap: 10px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--color-paper); color: var(--color-muted); font-size: 14px; line-height: 1.55; }
.fav-empty .icon { color: var(--color-rose); flex: none; }
.fav-table-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--color-rule); border-radius: 14px; }
.fav-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fav-table th { position: sticky; top: 0; background: var(--color-paper); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }
.fav-table th, .fav-table td { padding: 12px 14px; border-bottom: 1px solid var(--color-rule); }
.fav-table tr:last-child td { border-bottom: 0; }
.fav-table th:first-child, .fav-table td:first-child { width: 44px; padding-right: 0; }
.fav-table input { width: 18px; height: 18px; accent-color: var(--color-rose); }
.fav-table tbody tr:has(.fav-pick:checked) { background: #fbe3ec80; }
.fav-name { font-weight: 600; overflow-wrap: anywhere; }
.fav-count { font-weight: 600; white-space: nowrap; }
.fav-count::before { content: "♥ "; color: var(--color-rose); }
.fav-updated { color: var(--color-muted); white-space: nowrap; }
.fav-footer { margin-top: 18px; }
.fav-summary { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.fav-hint { margin: 12px 0 0; font-size: 12px; color: var(--color-muted); }
.album-actions .favourites-row { color: var(--color-rose); text-decoration: none; }
@media (max-width: 700px) {
  /* Phones: each viewer is a two-line row (name + count, then "last updated" under the name) instead of losing the date column. */
  .fav-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; border-bottom: 1px solid var(--color-rule); }
  .fav-table tbody tr:last-child { border-bottom: 0; }
  .fav-table th, .fav-table td { border-bottom: 0; padding: 12px 14px 12px 0; }
  .fav-table th:first-child, .fav-table td:first-child { width: auto; padding: 12px 0 12px 14px; }
  .fav-table thead tr { position: sticky; top: 0; z-index: 1; background: var(--color-paper); }
  .fav-table thead th:last-child { display: none; }
  .fav-table th:nth-child(3), .fav-table .fav-count { text-align: right; }
  .fav-table td.fav-updated { grid-column: 2 / -1; padding: 0 14px 12px 0; margin-top: -8px; font-size: 12px; }
  .fav-table tbody td:first-child { grid-row: span 2; }
  .fav-footer .card-actions .button { flex: 1 1 100%; }
}
@media (max-width: 390px) {
  .favourites-panel .card-title { font-size: 26px; }
}

/* Overlap in the export summary: "· 17 picked by both" (P50 polish). */
.fav-overlap { color: var(--color-sage); }

/* Browse all photos (P50) */
.browse-chip .icon { color: var(--color-ink); fill: none; }
.browse-toolbar { padding-left: 22px; }
.browse-hint { margin: 0; font-size: 13px; color: var(--color-muted); }
.browse-paging { display: grid; justify-items: center; gap: 12px; margin-top: 32px; }
.browse-progress { margin: 0; font-size: 13px; color: var(--color-muted); }
@media (max-width: 700px) {
  .browse-toolbar { padding: 12px 16px; }
  /* Phones: tighter heading so the first row of photos shows on the first screen. */
  .browse-stage .results-top { margin-bottom: 20px; }
  .browse-stage .results-heading { gap: 16px; margin-bottom: 20px; }
  .browse-stage .results-heading h2 { margin: 6px 0 4px; }
  .browse-stage .browse-toolbar { gap: 10px; margin-bottom: 18px; }
}

/* Bulk download (P51/P52). One #bulk-dialog; data-mode="zip" (desktop, Android: parts of 100) or "photos" (iPhone: Save to Photos, 20 per tap). */
body[data-bulk="off"] .bulk-download { display: none !important; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; flex: none; margin-bottom: 8px; }
.heading-actions .add-people { margin-bottom: 0; }
.bulk-count { font-variant-numeric: tabular-nums; }
#favourites-dialog .bulk-download { width: 100%; margin: 0 0 18px; }
.bulk-dialog { width: min(520px, calc(100% - 24px)); }
.bulk-dialog .card-title { margin-bottom: 10px; }
.bulk-intro { margin: 0 0 18px; color: var(--color-muted); font-size: 14px; line-height: 1.55; }
.bulk-dialog[data-mode="zip"] .bulk-photos-only, .bulk-dialog[data-mode="photos"] .bulk-zip-only { display: none; }
.bulk-dialog progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--color-rule); overflow: hidden; }
.bulk-dialog progress::-webkit-progress-bar { background: var(--color-rule); border-radius: 999px; }
.bulk-dialog progress::-webkit-progress-value { background: linear-gradient(90deg, var(--color-rose), var(--color-marigold)); border-radius: 999px; transition: width .3s var(--ease-gentle); }
.bulk-dialog progress::-moz-progress-bar { background: linear-gradient(90deg, var(--color-rose), var(--color-marigold)); border-radius: 999px; }
.bulk-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 52vh; overflow: auto; }
.bulk-part { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; padding: 14px 14px 14px 18px; border: 1px solid var(--color-rule); border-radius: 16px; background: var(--color-ivory); }
.bulk-part-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bulk-part-name { font-size: 15px; }
.bulk-part-range, .bulk-part-status { font-size: 12px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.bulk-part-action { min-height: 42px; padding: 9px 18px; font-size: 13px; }
.bulk-part-action .icon { width: 16px; height: 16px; }
.bulk-part .bulk-part-progress, .bulk-part-status { display: none; }
.bulk-part:is([data-state="working"], [data-state="failed"], [data-state="stopped"]) .bulk-part-progress { display: block; grid-column: 1 / -1; }
.bulk-part:is([data-state="working"], [data-state="failed"], [data-state="stopped"]) .bulk-part-status { display: block; grid-column: 1 / -1; margin-top: -4px; }
.bulk-part[data-state="working"] { border-color: #f0a83080; box-shadow: 0 10px 24px -18px var(--color-rose); }
.bulk-part[data-state="working"] .bulk-part-action { border-color: var(--color-rule); color: var(--color-muted); }
.bulk-part[data-state="working"] .bulk-part-action .icon { display: none; }
.bulk-part[data-state="done"] { background: var(--color-sage-soft); border-color: transparent; }
.bulk-part[data-state="done"] .bulk-part-action { background: transparent; border-color: transparent; color: var(--color-sage); pointer-events: none; }
.bulk-part[data-state="done"] .bulk-part-action .icon { display: none; }
.bulk-part[data-state="done"] .bulk-part-action::before { content: "✓"; font-weight: 700; }
.bulk-part:is([data-state="failed"], [data-state="stopped"]) { background: var(--color-blush); border-color: transparent; }
.bulk-part:is([data-state="failed"], [data-state="stopped"]) .bulk-part-status { color: var(--color-rose-dark); }
.bulk-part:is([data-state="failed"], [data-state="stopped"]) .bulk-part-action { background: var(--color-rose); border-color: var(--color-rose); color: var(--color-white); }
.bulk-photos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px; border-radius: 16px; background: var(--color-paper); border: 1px solid var(--color-rule); }
.bulk-photos progress { height: 10px; }
.bulk-batch-status { margin: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bulk-photos #bulk-batch-save { width: 100%; white-space: normal; text-align: center; text-wrap: balance; }
.bulk-photos[data-state="preparing"] #bulk-batch-save { opacity: .7; pointer-events: none; }
.bulk-photos[data-state="preparing"] #bulk-batch-save .icon { display: none; }
.bulk-photos[data-state="preparing"] #bulk-batch-save::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--color-white); border-right-color: transparent; animation: spin .8s linear infinite; }
.bulk-done { display: none; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: var(--radius-field); background: var(--color-sage-soft); color: var(--color-sage); font-weight: 600; font-size: 14px; }
.bulk-done .icon { fill: currentColor; width: 16px; height: 16px; }
.bulk-photos[data-state="done"] .bulk-done { display: flex; }
.bulk-photos[data-state="done"] #bulk-batch-save { display: none; }
#bulk-error { margin: 14px 0 0; }
#bulk-zip-instead { justify-self: center; padding: 4px 0; }
.bulk-failed { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-field); background: var(--color-marigold-soft); color: #5c3a00; font-size: 13px; line-height: 1.5; }
.bulk-failed p { margin: 0 0 6px; }
.bulk-failed ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; max-height: 120px; overflow: auto; }
.bulk-failed a { color: inherit; font-weight: 600; font-size: 12px; }
@media (max-width: 700px) {
  .heading-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 390px) {
  .heading-actions .button { flex: 1 1 100%; }
  .bulk-part { padding: 12px 12px 12px 14px; gap: 8px 10px; }
  .bulk-part-action { padding: 8px 12px; }
  .bulk-part-action .icon { display: none; }
  .bulk-part-name { font-size: 14px; white-space: nowrap; }
}

/* Photographer landing (signed-out pitch). body[data-auth="out"] shows #landing and hides the signed-in create view. */
.landing { display: none; grid-column: 1 / -1; }
body[data-auth="out"] .landing { display: block; }
body[data-auth="out"] .create > :not(.landing) { display: none !important; }
body[data-auth="out"] .create { display: block; padding-top: clamp(36px, 6vw, 84px); }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 6vw, 96px); align-items: center; }
.landing-copy h1 { font-size: clamp(44px, 4.6vw, 78px); max-width: 640px; }
.landing-copy .hero-intro { max-width: 500px; }
/* #landing-google-button(-bottom) hold the GIS-rendered button (pill, "Continue with Google", filled_black, large); no custom Google styling (Google branding rules). */
.landing-cta { display: grid; justify-items: start; gap: 12px; }
.landing-google-button { min-height: 44px; min-width: 240px; }
.landing-note { margin: 0; font-size: 13px; color: var(--color-muted); line-height: 1.5; }
.landing-note strong { color: var(--color-rose); font-weight: 700; }
/* Returning creators (localStorage hint): blank until the auth check resolves, so the pitch never flashes. */
body[data-auth="pending"] .create { visibility: hidden; }
.landing-phone { position: relative; justify-self: center; padding: 28px 0 28px 28px; }
.landing-phone::before { content: ""; position: absolute; inset: 0 -24px 6% 0; border-radius: 50% 50% 28px 28px / 32% 32% 28px 28px;
  background: linear-gradient(180deg, var(--color-arch), var(--color-blush)); z-index: -1; }
.landing-device { width: 300px; margin: 0; transform: rotate(2deg); }
.landing-device-body { padding: 18px 14px 16px; }
.landing-device-kicker { margin: 0 0 6px; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--color-rose); }
.landing-device-title { margin: 0; font: 400 30px/1 var(--font-display); letter-spacing: -.02em; }
.landing-device-title em { color: var(--color-rose); }
.landing-device-meta { margin: 6px 0 14px; font-size: 11px; color: var(--color-muted); }
.landing-device-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile { position: relative; aspect-ratio: 4 / 5; border-radius: 8px; }
.tile-a { background: linear-gradient(160deg, #e9a8c2, #8e2253); }
.tile-b { background: linear-gradient(160deg, #fbd38a, #d9822b); }
.tile-c { background: linear-gradient(160deg, #a9d8cd, #237566); }
.tile-d { background: linear-gradient(160deg, #f6c9a8, #b8326e); }
.tile-e { background: linear-gradient(160deg, #3e2a4a, #2a1a33); }
.tile-f { background: linear-gradient(160deg, #fde3c2, #f0a830); }
.tile i { position: absolute; top: 5px; right: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-white); }
.tile i::after { content: "♥"; position: absolute; inset: 0; display: grid; place-items: center; font: normal 8px/1 var(--font-body); color: var(--color-rose); }
.landing-selfie { position: absolute; left: 0; bottom: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px;
  background: var(--color-ivory); box-shadow: 0 14px 30px -12px var(--color-shadow); font-size: 12px; font-weight: 700; transform: rotate(-3deg); }
.landing-selfie-ring { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--color-rose); background: radial-gradient(circle at 50% 38%, #f6c9a8 0 32%, #8e2253 34%); position: relative; }
.landing-selfie-ring::after { content: "✓"; position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--color-marigold); color: var(--color-ink); font-size: 9px; font-weight: 700; border: 2px solid var(--color-ivory); }
.landing-reasons { list-style: none; margin: clamp(56px, 8vw, 104px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.reason { padding: 26px 24px 24px; border-radius: var(--radius-card); background: var(--color-ivory); border: 1px solid var(--color-rule); }
.reason h2 { font-size: 26px; line-height: 1.1; letter-spacing: -.01em; margin: 18px 0 10px; }
.reason p { margin: 0; color: var(--color-muted); font-size: 14px; line-height: 1.6; }
.reason-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; }
.reason-rose .reason-icon { background: var(--color-blush); color: var(--color-rose); }
.reason-marigold .reason-icon { background: var(--color-marigold-soft); color: #9a5b00; }
.reason-teal .reason-icon { background: var(--color-sage-soft); color: var(--color-sage); }
.landing-how { margin-top: clamp(56px, 8vw, 104px); text-align: center; }
.landing-how h2, .landing-faq h2 { font-size: clamp(38px, 4vw, 58px); line-height: 1; letter-spacing: -.02em; margin: 10px 0 34px; }
.landing-how h2 span { color: var(--color-rose); font-style: italic; }
.landing-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; text-align: left; position: relative; }
.landing-steps::before { content: ""; position: absolute; top: 20px; left: 16.7%; right: 16.7%; height: 2px; background: linear-gradient(90deg, var(--color-marigold), var(--color-rose), var(--color-sage)); opacity: .45; }
.landing-steps li { counter-increment: step; position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; }
.landing-steps li::before { content: counter(step); display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; border-radius: 50%;
  background: var(--color-marigold-soft); border: 4px solid var(--color-paper); font: 700 15px/1 var(--font-body); }
.landing-steps li:nth-child(2)::before { background: var(--color-blush); }
.landing-steps li:nth-child(3)::before { background: var(--color-sage-soft); }
.landing-steps strong { font-size: 16px; }
.landing-steps span { color: var(--color-muted); font-size: 14px; line-height: 1.55; max-width: 260px; }
.landing-trust { display: flex; align-items: center; justify-content: center; gap: 12px; margin: clamp(48px, 7vw, 88px) auto 0; padding: 16px 22px; max-width: 760px;
  border-radius: 999px; background: var(--color-sage-soft); color: var(--color-sage); font-size: 14px; font-weight: 600; line-height: 1.5; }
.landing-trust a { color: inherit; }
.landing-faq { max-width: 760px; margin: clamp(56px, 8vw, 104px) auto 0; }
.landing-faq h2 { text-align: center; }
.landing-faq details { border-bottom: 1px solid var(--color-rule); }
.landing-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 4px; cursor: pointer; font-size: 17px; font-weight: 600; }
.landing-faq summary::-webkit-details-marker { display: none; }
.landing-faq summary .icon { color: var(--color-rose); transition: transform .2s var(--ease-gentle); }
.landing-faq details[open] summary .icon { transform: rotate(45deg); }
.landing-faq details p { margin: 0 4px 20px; color: var(--color-muted); font-size: 15px; line-height: 1.65; }
.landing-faq a { color: var(--color-rose); font-weight: 600; }
.landing-close { display: grid; justify-items: center; gap: 14px; margin-top: clamp(56px, 8vw, 96px); text-align: center; }
.landing-close p { margin: 0; font: italic 400 clamp(28px, 3vw, 40px)/1.1 var(--font-display); }
.landing-close .landing-note { font: 400 13px/1.5 var(--font-body); }
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: minmax(0, 1fr); }
  .landing-reasons, .landing-steps { grid-template-columns: minmax(0, 1fr); }
  .landing-steps::before { top: 0; bottom: 0; left: 20px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--color-marigold), var(--color-rose), var(--color-sage)); }
  .landing-steps li { grid-template-columns: 42px 1fr; justify-items: start; text-align: left; column-gap: 14px; row-gap: 2px; }
  .landing-steps li::before { grid-row: span 2; margin: 0; }
  .landing-trust { border-radius: 18px; justify-content: flex-start; align-items: flex-start; }
}
.landing-device .studio-text strong { font-size: 14px; }
@media (max-width: 480px) {
  .landing-copy h1 { font-size: 42px; margin-bottom: 20px; }
  .landing-copy .hero-intro { margin-bottom: 22px; }
  .landing-device { width: 250px; }
  .landing-phone { padding: 18px 0 18px 18px; }
  .landing-phone::before { right: -12px; }
  .landing-selfie { bottom: 30px; }
  .reason { padding: 22px 20px; }
  .reason h2 { font-size: 24px; }
}
@media (max-width: 360px) {
  .landing-copy h1 { font-size: 34px; }
  body[data-auth="out"] .create { padding-top: 28px; }
  .landing .section-kicker { margin-bottom: 16px; }
}
/* Home hero for everyone (guest paths first, photographer pitch lower). */
.masthead-signin { display: none; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--color-rose); text-decoration: none; white-space: nowrap; }
.masthead-signin:hover { text-decoration: underline; }
body[data-auth="out"] .masthead-signin { display: inline; }
body[data-auth="out"] .masthead-for { display: none; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.open-album { display: grid; gap: 8px; max-width: 520px; padding: 16px; border-radius: var(--radius-card); background: var(--color-ivory); border: 1px solid var(--color-rule); }
.open-album label { font-size: 13px; font-weight: 700; }
.open-album-row { display: flex; gap: 10px; }
.open-album-row input { flex: 1; min-width: 0; min-height: 52px; padding: 13px 16px; border: 1.5px solid var(--color-rule); background: var(--color-paper); border-radius: 14px; color: var(--color-ink); }
.open-album-row input:focus { outline: none; border-color: var(--color-rose); background: var(--color-white); box-shadow: 0 0 0 4px var(--color-blush); }
.open-album-row input::placeholder { color: #ab9fb0; }
.open-album .form-error { margin: 0; }
.home-trust { margin-top: 16px; }
.home-trust span { white-space: nowrap; }
.photographer-pitch { margin-top: clamp(64px, 9vw, 120px); text-align: center; display: grid; justify-items: center; }
.pitch-title { font-size: clamp(34px, 4vw, 58px); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 28px; max-width: 760px; }
.pitch-title span { color: var(--color-rose); font-style: italic; }
.photographer-pitch .landing-cta { justify-items: center; }
.photographer-pitch .section-kicker { margin-bottom: 18px; }
.landing-reasons-four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(36px, 5vw, 56px); }
@media (max-width: 1100px) { .landing-reasons-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .landing-reasons-four { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .home-actions .button { flex: 1 1 100%; }
  .open-album-row { flex-direction: column; }
  .open-album-row .button { width: 100%; }
}
/* Drive limiting / offline (QA F1). "stopped" is a pause, not an error: marigold, with Resume as the primary action; "failed" stays pink. */
.bulk-parts-label { font-weight: 500; opacity: .85; }
.bulk-part[data-state="stopped"] { background: var(--color-marigold-soft); }
.bulk-part[data-state="stopped"] .bulk-part-status { color: #7a4d00; }
.bulk-part[data-state="stopped"] .bulk-part-progress::-webkit-progress-value { background: var(--color-marigold); }
.bulk-part[data-state="stopped"] .bulk-part-progress::-moz-progress-bar { background: var(--color-marigold); }
.bulk-photos[data-state="stopped"] { background: var(--color-marigold-soft); border-color: transparent; }
.bulk-photos[data-state="stopped"] progress::-webkit-progress-value { background: var(--color-marigold); }
.bulk-photos[data-state="stopped"] progress::-moz-progress-bar { background: var(--color-marigold); }
.bulk-stopped { position: relative; padding-left: 46px; }
.bulk-stopped::before { content: "❚❚" / ""; position: absolute; left: 14px; top: 13px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-white); color: #9a5b00; font-size: 7px; letter-spacing: 1px; }
#bulk-stopped-text { margin: 0 0 8px; font-weight: 600; color: #5c3a00; }
.bulk-stopped details { margin: 0; }
.bulk-stopped summary { list-style: none; display: block; cursor: pointer; font-weight: 700; color: #5c3a00; }
.bulk-stopped summary::-webkit-details-marker { display: none; }
.bulk-summary-end { white-space: nowrap; }
.bulk-summary-end::after { content: "›" / ""; display: inline-block; margin-left: 6px; font-size: 16px; line-height: 1; transition: transform .2s var(--ease-gentle); }
.bulk-stopped details[open] .bulk-summary-end::after { transform: rotate(90deg); }
.bulk-stopped ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 10px; max-height: 168px; overflow: auto;
  padding: 10px 12px; border-radius: 10px; background: #ffffff99; }
.bulk-stopped li { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 390px) { .bulk-stopped ul { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 360px) {
  .bulk-part-name { font-size: 13px; }
  .bulk-part-action { padding: 7px 10px; font-size: 12px; }
}

/* ---- Tap targets (Tester sweep): every control gets at least a 44 × 44 px hit area on phones. ----
   Invisible ::after boxes, centred on the control, so nothing moves or changes colour. :where() keeps
   specificity at zero, so controls that are already positioned (absolute, sticky) keep their position. */
:where(.text-button, .viewer-action, .share-whatsapp, .refine summary, .switch-label, .segmented label, .button-small,
  .brand, .footer p a, .landing-trust a, .landing-faq p a) { position: relative; }
:where(.text-button, .viewer-action, .share-whatsapp, .refine summary, .switch-label, .segmented label, .button-small,
  .brand, .footer p a, .landing-trust a, .landing-faq p a)::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
/* Viewer arrows are 30 px wide on phones; widen the hit area inwards (over the photo edge) rather than off-screen. */
.viewer-arrow::after { content: ""; position: absolute; top: 0; bottom: 0; width: 44px; }
.viewer-arrow.previous::after { left: 0; }
.viewer-arrow.next::after { right: 0; }
/* Dialog close buttons (favourites panel, bulk download) were 42 px. */
.fav-close { width: 44px; height: 44px; }
/* Match-sensitivity slider: a 44 px tall input with the same track; negative margins keep the layout. */
.refine input[type="range"] { height: 44px; margin: -14px 0; }
/* Wrapped rows: enough row gap that neighbouring 44 px hit areas don't overlap. */
@media (max-width: 700px) {
  .filter-controls { row-gap: 0; }
  /* Real 44 px rows (not just hit areas) so the stacked toggle, refine and Manage never share a tap zone. */
  .filter-controls :is(.switch-label, #favourites-manage) { min-height: 44px; }
  .filter-controls .refine summary { line-height: 44px; }
}
/* Guest favourites checkboxes: a 44 px input that still draws an 18 px box (native look: rose fill, white tick). */
.fav-table input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 44px; height: 44px; margin: -13px; border: 0; border-radius: 8px; cursor: pointer; vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect x='.75' y='.75' width='16.5' height='16.5' rx='3' fill='%23fff' stroke='%238a7f8c' stroke-width='1.5'/%3E%3C/svg%3E") center / 18px 18px no-repeat; }
.fav-table input[type="checkbox"]:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect width='18' height='18' rx='3' fill='%23b8326e'/%3E%3Cpath d='M4.5 9.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.fav-table input[type="checkbox"]:focus-visible { outline: 2px solid var(--color-rose); outline-offset: -11px; }
/* Viewer actions overflowed by ~50 px at 320 (WhatsApp clipped): below 360 px the plain actions drop their icons; Full quality keeps its pill. */
@media (max-width: 360px) {
  .viewer-actions { gap: 8px; }
  .viewer-action:not(.viewer-action-strong) .icon { display: none; }
  .viewer-action-strong { padding: 8px 12px; }
}

/* "Not me" (P64): hide look-alikes from selfie results. Device only; never in Browse all. */
.not-me { position: absolute; z-index: 2; top: 10px; left: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: #2a1a3399; color: var(--color-ivory); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s var(--ease-gentle), background .2s var(--ease-gentle); }
.not-me .icon { width: 18px; height: 18px; stroke-width: 1.8; }
.not-me:hover { background: #2a1a33d9; }
.photo-cell:hover .not-me, .not-me:focus-visible { opacity: 1; }
@media (hover: none) { .not-me { opacity: 1; width: 32px; height: 32px; top: 8px; left: 8px; } .not-me .icon { width: 17px; height: 17px; } }
.not-me::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; }
#gallery .photo-cell { transition: opacity .2s var(--ease-gentle), transform .2s var(--ease-gentle); }
#gallery .photo-cell.is-leaving { opacity: 0; transform: scale(.94); pointer-events: none; }

.hidden-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px 8px 14px; border-radius: 999px; border: 1px solid var(--color-rule);
  background: var(--color-ivory); color: var(--color-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.hidden-chip .icon { width: 16px; height: 16px; stroke-width: 1.8; }
.hidden-chip .favourites-count { background: var(--color-paper); color: var(--color-muted); }
.hidden-chip[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-ivory); }
.hidden-chip[aria-pressed="true"] .favourites-count { background: #ffffff26; color: var(--color-ivory); }

.hidden-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 0 0 18px; padding: 10px 16px;
  border-radius: 18px; background: var(--color-paper); border: 1px dashed var(--color-rule); font-size: 13px; color: var(--color-muted); }
.hidden-banner[hidden] { display: none; }
.hidden-banner strong { color: var(--color-ink); font-weight: 600; }
.hidden-banner .text-button { position: relative; color: var(--color-rose); font-size: 13px; }
.hidden-banner .text-button::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
#results.is-hidden-view .photo img { filter: grayscale(.6) brightness(.85); }
#results.is-hidden-view .not-me { display: none; }
.show-again { position: absolute; z-index: 2; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  border: 0; border-radius: 999px; background: var(--color-ivory); color: var(--color-ink); font: 600 12px var(--font-body); box-shadow: 0 4px 14px #1c102233; }
.show-again .icon { width: 15px; height: 15px; stroke-width: 1.8; }
.show-again::after { content: ""; position: absolute; inset: -4px; }

/* Toast with an action: one line at 320 px, Undo in marigold with a 44 px hit area. */
.toast:has(.toast-undo) { display: inline-flex; align-items: center; gap: 16px; white-space: nowrap; }
.toast:has(.toast-undo)[hidden] { display: none; }
.toast-undo { position: relative; padding: 0; border: 0; background: transparent; color: var(--color-marigold); font: 700 13px var(--font-body); }
.toast-undo::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }

/* Viewer: "Not me" pill on the caption row (selfie results only). */
.viewer-caption-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-width: 0; }
.viewer-caption-row > div { min-width: 0; }
.viewer-not-me { position: relative; display: inline-flex; flex: none; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid #ffffff4d; background: transparent; color: var(--color-ivory); font: 600 12px var(--font-body); white-space: nowrap; }
.viewer-not-me:hover { border-color: #ffffffa6; background: #ffffff14; }
.viewer-not-me .icon { width: 15px; height: 15px; stroke-width: 1.8; }
.viewer-not-me::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
.viewer-not-me[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { #gallery .photo-cell { transition: none; } #gallery .photo-cell.is-leaving { transform: none; } }
/* Toast inside the open viewer: sit under the header so it never covers the caption or actions; lifted off the black. */
#viewer .toast { top: 68px; bottom: auto; background: #3a2745; box-shadow: 0 0 0 1px #ffffff26, 0 8px 24px #0000004d; }
/* Every result hidden: smaller heading than the no-results state, rose "Show all". */
.all-hidden { padding: 48px 20px; }
.all-hidden h3 { font-size: clamp(26px, 7vw, 34px); margin: 12px 0 6px; }
.all-hidden .text-button { position: relative; color: var(--color-rose); font-size: 14px; }
.all-hidden .text-button::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
/* Full stop after a closing curly quote: Plus Jakarta's ” has a wide right bearing, so ”. read as "” ." at 13 px. Tuck the stop in. */
.quote-stop { margin-left: -.14em; }

/* P66: without the hint, the Browse toolbar holds only the favourites chip; drop the card so it reads as a filter row, not an empty bar. */
.browse-stage .browse-toolbar:not(:has(.browse-hint:not([hidden]))) { background: transparent; border: 0; border-radius: 0; padding: 0; margin-bottom: 22px; }
@media (max-width: 700px) { .browse-stage .browse-toolbar:not(:has(.browse-hint:not([hidden]))) { padding: 0; margin-bottom: 16px; } }

/* ---- P68: guest Google sign-in for favourites ---------------------------------------------- */
/* Sign-in sheet at the first heart: centred card on desktop, bottom sheet on phones (thumb reach).
   #viewer-signin-button holds the GIS-rendered pill ("Continue with Google", filled_black, large); no custom Google styling. */
.signin-dialog { text-align: center; }
.signin-dialog .dialog-heart { margin: 0 auto 14px; }
.signin-dialog .card-title { margin-bottom: 10px; }
.signin-copy { max-width: 300px; margin: 0 auto 24px; color: var(--color-muted); font-size: 15px; line-height: 1.55; text-wrap: balance; }
.signin-google { display: flex; justify-content: center; min-height: 44px; }
.signin-dialog .form-error { margin: 16px 0 0; text-align: left; }
.signin-dialog .card-actions { justify-content: center; margin-top: 14px; }
@media (max-width: 700px) {
  .signin-dialog[open] { width: 100%; max-width: none; margin: auto 0 0; border: 0; border-radius: 28px 28px 0 0;
    padding: 14px 24px max(20px, env(safe-area-inset-bottom)); animation: signin-rise .28s var(--ease-gentle); }
  .signin-dialog::before { content: ""; display: block; width: 40px; height: 4px; margin: 0 auto 18px; border-radius: 4px; background: var(--color-rule); }
}
@keyframes signin-rise { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .signin-dialog[open] { animation: none; } }

/* My favourites: close icon in the head, account row, inline name editor, Clear + Sign out at the foot. */
/* Close sits beside the overline, so the title keeps the full card width at 320 px. */
.fav-dialog-head { position: relative; }
.fav-dialog-head .overline { padding-right: 48px; }
.fav-dialog-head .fav-close { position: absolute; top: -12px; right: -12px; }
.fav-account { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; padding: 12px 8px 12px 12px; border-radius: var(--radius-field); background: var(--color-paper); border: 1px solid var(--color-rule); }
.fav-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-rose), var(--color-marigold)); color: var(--color-white); font: 600 17px var(--font-body); text-transform: uppercase; }
.fav-account-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.fav-account-label { font-size: 12px; color: var(--color-muted); }
.fav-account-name { font-size: 15px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fav-account .text-button { flex: none; padding: 8px 10px; color: var(--color-rose); }
.fav-name-editor { margin: 4px 0 0; padding: 14px; border-radius: var(--radius-field); background: var(--color-paper); border: 1px solid var(--color-rule); }
.fav-name-editor[hidden], .fav-account[hidden] { display: none; }
.fav-name-editor .field { margin-bottom: 0; }
.fav-name-editor .field input { background: var(--color-white); }
.fav-name-editor .card-actions { margin-top: 12px; }
#favourites-dialog .bulk-download + .fav-account, #favourites-dialog .bulk-download + .fav-name-editor { margin-top: 0; }
.fav-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; }
.fav-foot .clear-confirm { flex: 1 1 100%; }
.fav-foot .text-button:not(.is-danger) { color: var(--color-muted); }

/* Photographer panel: Export CSV + Export to Google Sheet (P67/P68); Lightroom copy and its hint are gone. */
@media (max-width: 390px) { .fav-footer .card-actions .button { padding-inline: 16px; gap: 8px; } }
.fav-footer .card-actions .button[aria-busy="true"] { cursor: progress; opacity: .7; }
.fav-footer .fav-hint { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
/* P68 QA: Clear is destructive, Sign out is not; colour tells them apart in the foot row. */
.fav-foot .is-danger { color: var(--color-rose-dark); }
.fav-foot .is-danger:hover { color: #6d1a40; }

/* P71 photographer uploads: proposed styles (design mock). Only existing tokens; drops into staging.css when the build starts. */

/* Source choice: two radio cards. */
.source-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 20px; padding: 0; border: 0; }
.source-choice legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.source-option { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 14px; border: 1.5px solid var(--color-rule);
  border-radius: 16px; background: var(--color-paper); cursor: pointer; transition: border-color .2s var(--ease-gentle), box-shadow .2s var(--ease-gentle), background .2s var(--ease-gentle); }
.source-option input { position: absolute; opacity: 0; pointer-events: none; }
.source-option .source-icon { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-blush); color: var(--color-rose); }
.source-option[data-source="drive"] .source-icon { background: var(--color-marigold-soft); color: #7a4d00; }
.source-option .source-icon .icon { width: 19px; height: 19px; }
.source-title { font-size: 14px; font-weight: 600; color: var(--color-ink); line-height: 1.25; }
.source-sub { font-size: 12px; color: var(--color-muted); line-height: 1.4; }
.source-option:has(input:checked) { border-color: var(--color-rose); background: var(--color-white); box-shadow: 0 0 0 4px var(--color-blush); }
.source-option:has(input:focus-visible) { outline: 2px solid var(--color-rose); outline-offset: 3px; }
@media (max-width: 480px) { .source-choice { grid-template-columns: 1fr; } }

/* Drop zone / picker. */
.dropzone { display: grid; justify-items: center; gap: 6px; margin: 0 0 20px; padding: 30px 20px 24px; border: 2px dashed #e6cdd8; border-radius: 20px; background: var(--color-paper); text-align: center;
  transition: border-color .2s var(--ease-gentle), background .2s var(--ease-gentle); }
.dropzone.is-over { border-color: var(--color-rose); background: var(--color-blush); }
.dropzone-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; background: linear-gradient(135deg, var(--color-rose), var(--color-marigold)); color: var(--color-white); box-shadow: 0 10px 24px -10px var(--color-rose); }
.dropzone-icon .icon { width: 24px; height: 24px; stroke-width: 1.8; }
.dropzone-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--color-ink); }
.dropzone-sub { margin: 0 0 10px; font-size: 13px; color: var(--color-muted); }
.dropzone-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; }
.dropzone small { margin-top: 10px; font-size: 12px; color: var(--color-muted); }
@media (hover: none) { .dropzone .only-desktop { display: none; } }
@media (hover: hover) { .dropzone .only-touch { display: none; } }

/* Selected files + quality picker. */
.upload-summary { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 14px; border-radius: 16px; background: var(--color-paper); border: 1px solid var(--color-rule); }
.upload-thumbs { display: flex; flex: none; }
.upload-thumbs img { width: 34px; height: 34px; object-fit: cover; border-radius: 9px; border: 2px solid var(--color-ivory); box-shadow: 0 2px 6px var(--color-shadow); }
.upload-thumbs img + img { margin-left: -14px; }
.upload-summary-text { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.upload-summary-text strong { font-size: 15px; font-weight: 600; }
.upload-summary-text span { font-size: 12px; color: var(--color-muted); }
.upload-summary .text-button { flex: none; color: var(--color-rose); }

.quality-picker { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.quality-picker legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.quality-option { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--color-rule); border-radius: 16px;
  background: var(--color-white); cursor: pointer; transition: border-color .2s var(--ease-gentle), box-shadow .2s var(--ease-gentle); }
.quality-option input { appearance: none; -webkit-appearance: none; grid-row: span 2; width: 20px; height: 20px; margin: 0; border: 1.5px solid #c9bccc; border-radius: 50%; background: var(--color-white); }
.quality-option input:checked { border: 6px solid var(--color-rose); }
.quality-option:has(input:checked) { border-color: var(--color-rose); box-shadow: 0 0 0 4px var(--color-blush); }
.quality-option:has(input:focus-visible) { outline: 2px solid var(--color-rose); outline-offset: 3px; }
.quality-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.quality-tag { padding: 2px 8px; border-radius: 999px; background: var(--color-sage-soft); color: var(--color-sage); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.quality-desc { grid-column: 2; font-size: 12px; color: var(--color-muted); }
.quality-size { grid-row: 1 / span 2; grid-column: 3; display: grid; justify-items: end; gap: 1px; font-variant-numeric: tabular-nums; }
.quality-size strong { font-size: 14px; font-weight: 600; }
.quality-size span { font-size: 12px; color: var(--color-muted); }
.quality-option[data-fit="no"] .quality-size strong { color: var(--color-rose-dark); }
.quality-option[data-fit="no"]:not(:has(input:checked)) { background: var(--color-paper); }

/* Will it fit: meter with used / this upload / free. */
.quota-fit { display: grid; gap: 8px; margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--color-sage-soft); color: #164d43; font-size: 13px; line-height: 1.45; }
.quota-fit-line { display: flex; gap: 8px; align-items: flex-start; }
.quota-fit-line .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.quota-fit strong { font-weight: 600; }
.quota-fit a { color: inherit; font-weight: 600; }
.quota-fit[data-fit="no"] { background: var(--color-blush); color: var(--color-rose-dark); }
.quota-meter { display: flex; height: 8px; border-radius: 999px; background: #ffffffb3; overflow: hidden; }
.quota-meter span { display: block; height: 100%; }
.quota-meter .is-used { background: var(--color-ink); opacity: .55; }
.quota-meter .is-new { background: repeating-linear-gradient(135deg, var(--color-sage) 0 6px, #2f8f7e 6px 12px); }
.quota-fit[data-fit="no"] .quota-meter .is-new { background: repeating-linear-gradient(135deg, var(--color-rose) 0 6px, var(--color-rose-dark) 6px 12px); }
.quota-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; opacity: .85; }
.quota-legend span { display: inline-flex; align-items: center; gap: 6px; }
.quota-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.quota-legend .is-used::before { background: var(--color-ink); opacity: .55; }
.quota-legend .is-new::before { background: var(--color-sage); }
.quota-fit[data-fit="no"] .quota-legend .is-new::before { background: var(--color-rose); }
.quota-legend .is-free::before { background: var(--color-white); box-shadow: inset 0 0 0 1px currentColor; }
/* P78: estimating (neutral, the meter shimmers) and "may not fit" (marigold, softer than "no"). */
.quota-fit[data-fit="unknown"] { background: var(--color-paper); color: var(--color-muted); box-shadow: inset 0 0 0 1px var(--color-rule); }
.quota-fit[data-fit="unknown"] strong { color: var(--color-ink); }
.quota-fit[data-fit="unknown"] .quota-meter { background: linear-gradient(90deg, var(--color-blush) 0 30%, var(--color-marigold-soft) 50%, var(--color-blush) 70% 100%) 0 0 / 250% 100%; animation: quota-estimating 1.4s linear infinite; }
@keyframes quota-estimating { to { background-position: -250% 0; } }
.quota-fit[data-fit="maybe"] { background: var(--color-marigold-soft); color: #5c3a00; }
.quota-fit[data-fit="maybe"] .quota-meter .is-new { background: repeating-linear-gradient(135deg, var(--color-marigold) 0 6px, #d68a12 6px 12px); }
.quota-fit[data-fit="maybe"] .quota-legend .is-new::before { background: var(--color-marigold); }
.quality-option[data-fit="unknown"] .quality-size strong { color: var(--color-muted); font-weight: 500; }
.quality-option[data-fit="maybe"] .quality-size strong { color: #8a5a00; }
@media (prefers-reduced-motion: reduce) { .quota-fit[data-fit="unknown"] .quota-meter { animation: none; } }
.upload-after { margin: 12px 0 0; font-size: 12px; color: var(--color-muted); text-align: center; }

/* Upload progress. */
.upload-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 0 0 4px; font-size: 13px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.upload-stats strong { color: var(--color-ink); font-weight: 600; }
.progress.is-paused .progress-bar { background: var(--color-marigold); }
.progress.is-paused .progress-bar::after { display: none; }
.upload-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 18px; }
.upload-controls .button { min-height: 44px; padding: 10px 20px; font-size: 13px; }
.upload-controls .usage { margin: 0; }
.upload-files { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.upload-file { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--color-paper); }
.upload-file img { grid-row: span 2; width: 36px; height: 36px; object-fit: cover; border-radius: 9px; }
.upload-file img:not([src]) { box-sizing: border-box; padding: 9px; background: var(--color-blush); content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e2253' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='m4 17 5-5 4 4 2.5-2.5L20 18'/%3E%3C/svg%3E"); }
.upload-file[data-state="failed"] img:not([src]) { background: var(--color-white); }
.upload-file-name { font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.upload-file-pct { font-size: 12px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.upload-file .progress { grid-column: 2 / -1; height: 4px; margin: 0; }
.upload-file[data-state="failed"] { background: var(--color-blush); }
.upload-file[data-state="failed"] .upload-file-pct { color: var(--color-rose-dark); }
.upload-file-error { grid-column: 2 / -1; font-size: 12px; color: var(--color-rose-dark); }
.upload-file .text-button { color: var(--color-rose-dark); padding: 6px 0; }
@media (max-width: 360px) {
  .upload-summary { gap: 10px; padding: 10px 12px; }
  .upload-thumbs img { width: 28px; height: 28px; }
  .upload-thumbs img + img { margin-left: -18px; }
  .upload-summary-text strong { font-size: 14px; }
  .quality-option { grid-template-columns: 20px minmax(0, 1fr); }
  .quality-option input { grid-row: span 3; }
  .quality-size { grid-row: auto; grid-column: 2; display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
  .quality-size { flex-wrap: wrap; }
  .quality-size strong, .quality-size span { white-space: nowrap; }
  .quality-size span:not(:empty)::before { content: "· "; }
}
.upload-failed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--color-rose-dark); }
.upload-failed-head .text-button { color: var(--color-rose-dark); }
.upload-note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--color-marigold-soft); color: #5c3a00; font-size: 13px; line-height: 1.5; }
.upload-note .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.upload-done { display: flex; gap: 10px; align-items: center; margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--color-sage-soft); color: #164d43; font-size: 14px; }
.upload-done .icon { width: 18px; height: 18px; flex: none; }

/* My albums: storage card, expiry line, 30-day banner. */
.storage-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 20px; margin: 0 0 16px; padding: 16px 20px; border: 1px solid var(--color-rule); border-radius: 16px; background: var(--color-ivory); }
.storage-label { margin: 0; font-size: 14px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.storage-label strong { color: var(--color-ink); font-size: 18px; font-weight: 600; margin-right: 4px; white-space: nowrap; }
@media (max-width: 390px) { .storage-card { padding: 14px 16px; gap: 8px 12px; } .storage-label strong { font-size: 16px; } .storage-card .text-button { font-size: 12px; } }
.storage-card .progress { grid-column: 1 / -1; height: 10px; margin: 2px 0 0; }
.storage-card .progress-bar::after { display: none; }
.storage-card .text-button { color: var(--color-rose); }
.storage-card[data-level="high"] .progress-bar { background: linear-gradient(90deg, var(--color-marigold), var(--color-rose-dark)); }
.album-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.album-source { display: inline-flex; align-items: center; gap: 5px; }
.album-source .icon, .album-expiry .icon { width: 14px; height: 14px; }
.album-expiry { display: inline-flex; align-items: center; gap: 5px; }
.album-expiry[data-soon] { color: #7a4d00; font-weight: 600; }
.expiry-banner { flex: 1 1 100%; display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--color-marigold-soft); color: #5c3a00; font-size: 13px; line-height: 1.5; }
.expiry-banner .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.expiry-banner a { color: inherit; font-weight: 600; }
.album-row:has(.expiry-banner) { border-color: #f0a83080; }

/* Guest: expired album. */
.expired-card { text-align: center; }
.expired-card .gate-icon { margin: 0 auto 16px; background: var(--color-marigold-soft); color: #7a4d00; }
.expired-card .card-title { margin-bottom: 12px; }
.expired-card .gate-copy { max-width: 360px; margin: 0 auto; text-wrap: balance; }
.expired-card .card-actions { justify-content: center; margin-top: 22px; }
@media (max-width: 480px) { .album-meta-line > [aria-hidden="true"] { display: none; } .album-meta-line { column-gap: 14px; } }
/* P73: quiet hint under the picker (iPhone/iPad: "High is available when uploading from a computer or Android"). */
.quality-hint { display: flex; gap: 6px; align-items: flex-start; margin: 2px 2px 0; font-size: 12px; line-height: 1.45; color: var(--color-muted); }
.quality-hint .icon { width: 14px; height: 14px; flex: none; margin-top: 1px; }
/* P74: High stays the default; when it doesn't fit, the blocked panel offers a one-tap switch. */
.quota-fit-action { justify-self: start; min-height: 40px; padding: 8px 16px; border-color: currentColor; background: var(--color-white); color: var(--color-rose-dark); font-size: 13px; }
.quota-fit-action:hover { background: var(--color-rose-dark); border-color: var(--color-rose-dark); color: var(--color-white); }

/* P82: "Only photos of…" in the upload panel. #face-filter[data-state] = off | pick | scanning | review. */
.face-filter { margin: 0 0 18px; border: 1.5px solid var(--color-rule); border-radius: 18px; background: var(--color-ivory); padding: 14px 16px; }
.face-filter > [data-show] { display: none; }
.face-filter[data-state="off"] > [data-show~="off"], .face-filter[data-state="pick"] > [data-show~="pick"],
.face-filter[data-state="scanning"] > [data-show~="scanning"], .face-filter[data-state="review"] > [data-show~="review"] { display: grid; gap: 12px; }
.face-filter-pick, .face-filter-scan, .face-filter-review { grid-template-columns: minmax(0, 1fr); }
.face-filter:not([data-state="off"]) { border-color: #e9c6d6; box-shadow: 0 0 0 4px var(--color-blush); }
.face-filter-off { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
.face-filter-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--color-blush), var(--color-marigold-soft)); color: var(--color-rose); }
.face-filter-icon .icon { width: 19px; height: 19px; }
.face-filter-text { display: grid; line-height: 1.35; min-width: 0; }
.face-filter-text strong { font-size: 14px; font-weight: 600; }
.face-filter-text span { font-size: 12px; color: var(--color-muted); }
.face-filter-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.face-filter-title { margin: 0; font-size: 15px; font-weight: 600; }
.face-filter-title strong { color: var(--color-rose); font-variant-numeric: tabular-nums; }
.face-filter-head .text-button { color: var(--color-rose); font-size: 13px; white-space: nowrap; }
.face-filter-help { margin: -4px 0 0; font-size: 12px; color: var(--color-muted); }

/* Reference faces: round crops, a remove ×, and a dashed "Add photo" tile. */
.face-refs { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.ff-ref { position: relative; display: grid; justify-items: center; gap: 4px; width: 64px; font-size: 11px; color: var(--color-muted); text-align: center; }
.ff-ref img, .ff-ref-empty { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-white); box-shadow: 0 0 0 1.5px var(--color-rose), 0 4px 10px var(--color-shadow); background: var(--color-blush); }
.ff-ref.is-loading .ff-ref-empty { box-shadow: 0 0 0 1.5px var(--color-rule); background: linear-gradient(90deg, var(--color-blush) 0 30%, var(--color-marigold-soft) 50%, var(--color-blush) 70% 100%) 0 0 / 250% 100%; animation: quota-estimating 1.4s linear infinite; }
.ff-ref.ff-noface img { box-shadow: 0 0 0 1.5px var(--color-rose-dark); filter: grayscale(.7); opacity: .7; }
.ff-ref.ff-noface .ff-ref-note { color: var(--color-rose-dark); font-weight: 600; }
.ff-ref-remove { position: absolute; top: -4px; right: 0; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--color-ink); color: var(--color-ivory); }
.ff-ref-remove::after { content: ""; position: absolute; inset: -11px; }
.ff-ref-remove .icon { width: 12px; height: 12px; }
.ff-ref-add { display: grid; place-items: center; align-content: center; gap: 2px; width: 56px; height: 56px; border: 1.5px dashed #d8a3bb; border-radius: 50%; background: var(--color-paper); color: var(--color-rose); font-size: 10px; font-weight: 700; cursor: pointer; }
.ff-ref-add .icon { width: 16px; height: 16px; }
.ff-ref-add:hover { background: var(--color-blush); }
.ff-ref-add:has(input:focus-visible) { outline: 2px solid var(--color-rose); outline-offset: 3px; }
.face-refs-small .ff-ref { width: auto; }
.face-refs-small .ff-ref img { width: 34px; height: 34px; box-shadow: 0 0 0 1.5px var(--color-rose); }
.face-refs-small .ff-ref + .ff-ref { margin-left: -16px; }

/* Several faces in one reference photo: tap the right one. */
.face-choose { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--color-marigold-soft); color: #5c3a00; font-size: 13px; }
.face-choose p { margin: 0; }
.face-choose-options { display: flex; flex-wrap: wrap; gap: 10px; }
.ff-face { padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.ff-face img { display: block; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-white); box-shadow: 0 2px 8px #5c3a0033; }
.ff-face:hover img, .ff-face:focus-visible img { box-shadow: 0 0 0 3px var(--color-rose); }

/* Any / All together. */
.match-rule { display: inline-flex; justify-self: start; gap: 4px; margin: 0; padding: 4px; border: 1.5px solid var(--color-rule); border-radius: 999px; background: var(--color-paper); }
.match-rule legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.match-rule input { position: absolute; opacity: 0; pointer-events: none; }
.match-rule span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--color-muted); cursor: pointer; white-space: nowrap; }
.match-rule input:checked + span { background: var(--color-ivory); color: var(--color-ink); box-shadow: 0 2px 8px var(--color-shadow); }
.match-rule input:focus-visible + span { outline: 2px solid var(--color-rose); outline-offset: 2px; }
.face-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.face-filter-actions .button { min-height: 44px; padding: 10px 20px; font-size: 13px; }
.face-filter-privacy { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-muted); }
.face-filter-privacy .icon { width: 14px; height: 14px; color: var(--color-sage); }

/* Scanning. */
.face-filter-scan .progress { margin: 0; }
.face-scan-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: -4px 0 0; font-size: 13px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.face-scan-stats strong { color: var(--color-ink); font-weight: 600; }
.face-scan-stats .is-matches strong { color: var(--color-rose); }

/* Review: slider, tabs, a scrolling grid of ticks. */
.face-strict { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; color: var(--color-muted); }
.face-strict input[type="range"] { width: 100%; height: 44px; margin: -10px 0; }
.face-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; margin: 0; padding: 2px; border-radius: 12px; overscroll-behavior: contain; }
.ff-photo label { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--color-paper); }
.ff-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s, filter .15s; }
.ff-photo .ff-tick { position: absolute; opacity: 0; pointer-events: none; }
.ff-tick-mark { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--color-white); background: #2a1a3366; color: transparent; box-shadow: 0 2px 6px #0003; }
.ff-tick-mark::after { content: ""; width: 10px; height: 5px; margin-top: -2px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.ff-photo .ff-tick:checked ~ .ff-tick-mark { background: var(--color-rose); color: var(--color-white); }
.ff-photo .ff-tick:not(:checked) ~ img { opacity: .45; filter: grayscale(.6); }
.ff-photo .ff-tick:focus-visible ~ .ff-tick-mark { outline: 2px solid var(--color-rose); outline-offset: 2px; }
.face-grid-more { justify-self: center; }
#ff-show-misses { justify-self: start; color: var(--color-rose); font-size: 13px; }
.face-misses-head { margin: 4px 0 -4px; font-size: 12px; font-weight: 600; color: var(--color-muted); }
.face-grid-empty { margin: 0; padding: 18px; text-align: center; font-size: 13px; color: var(--color-muted); border: 1px dashed var(--color-rule); border-radius: 12px; }
.upload-summary-text .face-filter-on { color: var(--color-rose); font-weight: 600; }

@media (max-width: 480px) {
  .face-filter { padding: 12px 14px; }
  .face-filter-off { grid-template-columns: auto minmax(0, 1fr); row-gap: 10px; }
  .face-filter-off .button { grid-column: 1 / -1; justify-self: stretch; }
  .match-rule { justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; border-radius: 16px; }
  .match-rule span { justify-content: center; padding: 6px 8px; border-radius: 12px; font-size: 12px; white-space: normal; text-align: center; line-height: 1.25; }
  .face-refs { gap: 8px; }
  .ff-ref { width: 54px; }
  .ff-ref img, .ff-ref-empty, .ff-ref-add { width: 50px; height: 50px; }
  .face-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 360px; }
}
@media (prefers-reduced-motion: reduce) { .ff-ref.is-loading .ff-ref-empty { animation: none; } }
/* P82: references grouped per person (.ff-person), so a wrong merge stands out; #ff-people count next to Any/All. */
#ff-refs { counter-reset: ff-person; align-items: flex-start; }
.ff-person { counter-increment: ff-person; position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 22px 10px 8px; list-style: none; border: 1.5px dashed #e3b7ca; border-radius: 18px; background: var(--color-paper); }
.ff-person:nth-of-type(even) { border-color: #eccb8a; background: #fff8ea; }
.ff-person::before { content: "Person " counter(ff-person); position: absolute; top: 3px; left: 12px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-rose); }
.ff-person:nth-of-type(even)::before { color: #8a5a00; }
.ff-person > ul { display: contents; }
.face-refs-small .ff-person { padding: 3px; border-style: solid; border-width: 1px; }
.face-refs-small .ff-person::before { content: none; }
.ff-rule-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
#ff-people { display: inline-flex; align-items: center; min-height: 28px; margin: 0; padding: 2px 12px; border-radius: 999px; background: var(--color-sage-soft); color: var(--color-sage); font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .ff-rule-row .match-rule { flex: 1 1 100%; } .ff-person { padding: 22px 8px 6px; gap: 6px; } }
/* P82 (Coder): the chosen face of a multi-face reference. */
.ff-face[aria-pressed="true"] img { box-shadow: 0 0 0 3px var(--color-rose); }
/* P82 QA: misses stay readable (they're candidates to add), the misses toggle wraps, and the slider gets the full width on phones. */
#ff-misses .ff-photo .ff-tick:not(:checked) ~ img { opacity: .8; filter: grayscale(.25); }
#ff-show-misses { white-space: normal; text-align: left; }
@media (max-width: 480px) {
  .face-strict { grid-template-columns: 1fr auto; row-gap: 0; }
  .face-strict input[type="range"] { grid-column: 1 / -1; grid-row: 1; margin: -10px 0 -12px; }
}
/* P84 QA: the header sign-in link is a real 44 px target and shortens to "Photographers" on small phones (wrap ": sign in" in .masthead-signin-who). */
body[data-auth="out"] .masthead-signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
@media (max-width: 420px) {
  .masthead-signin-who { display: none; }
  .masthead { gap: 12px; }
}
/* P84: on the narrowest phones the header keeps the wordmark and "Photographers" on one line. */
@media (max-width: 360px) {
  .masthead { gap: 10px; }
  .brand { gap: 8px; font-size: 11px; letter-spacing: .1em; }
  .masthead-signin { font-size: 12px; }
}
