/* Guest uploader (WED-121, public/media/uploader.js). Mobile first, one thumb: the big button sits where the
   thumb reaches, tiles are large enough to tap. Builds on .card/.btn/.input/.meter from media.css. Accent only
   through the tokens (design/DESIGN-RULES.md); no one-sided lines on rounded elements. */
.rq-up { max-width: 640px; margin: 0 auto var(--space-7); }
.rq-up.is-drag { border-color: var(--accent-text); box-shadow: var(--ring); }

.rq-name { margin-bottom: var(--space-4); }
.rq-name__why { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); transition: color var(--dur-2); }
.rq-up.is-name-needed .rq-name__why { color: var(--accent-text); }
.rq-up.is-name-needed .input { border-color: var(--accent-text); box-shadow: var(--ring); }

.rq-pick { position: relative; width: 100%; min-height: 56px; font-size: var(--step-0); }
.rq-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.rq-pick:focus-within { box-shadow: var(--ring); }
.rq-hint { margin-top: var(--space-3); font-size: 12.5px; color: var(--ink-3); text-align: center; }
.rq-drop { display: none; }
@media (pointer: fine) { .rq-drop { display: revert; } }
.rq-msg .up__msg { margin-top: var(--space-4); }

.rq-resume { margin-top: var(--space-4); padding: 14px 16px; border-radius: var(--radius-2); background: var(--accent-soft); color: var(--ink-2); font-size: var(--step--1); }
.rq-resume p { margin: 0 0 10px; }
.rq-resume b { color: var(--accent-text); font-weight: 500; }
.rq-resume__acts { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }

/* ---------- progress ---------- */
.rq-progress { margin-top: var(--space-5); }
.rq-progress__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: 10px; }
.rq-count { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); font-variant-numeric: tabular-nums; }
.rq-eta { font-size: 12.5px; color: var(--ink-3); text-align: right; }
.rq-meter { height: 8px; }
.rq-meter i { transition: width 600ms var(--ease-out); }
.rq-status { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); min-height: 1.4em; }
.rq-status.is-offline { color: var(--accent-text); }
.rq-fail { margin-top: var(--space-3); padding: 10px 14px; border-radius: var(--radius-2); background: color-mix(in oklab, var(--danger) 9%, var(--paper)); color: var(--danger); font-size: var(--step--1); display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- tiles ---------- */
.rq-tiles { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; max-height: min(52vh, 460px); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rq-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-2); overflow: hidden; background: var(--paper-2); content-visibility: auto; contain-intrinsic-size: 72px 72px; }
.rq-tile__img, .rq-tile__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rq-tile__img img { animation: rq-in var(--dur-2) var(--ease-out); }
.rq-tile[data-kind="video"] .rq-tile__img::after { content: ""; position: absolute; right: 6px; top: 6px; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--ivory); filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.rq-tile:not([data-state="done"]):not([data-state="already"]):not([data-state="review"]) .rq-tile__img { opacity: .62; transition: opacity var(--dur-2); }

.rq-ring { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; transform: rotate(-90deg); opacity: 0; transition: opacity var(--dur-2); }
.rq-ring circle { fill: none; stroke-width: 3.5; }
.rq-ring__bg { stroke: rgba(251, 248, 242, .55); }
.rq-ring__fg { stroke: var(--ivory); stroke-linecap: round; transition: stroke-dashoffset 300ms var(--ease-out); }
.rq-tile[data-state="uploading"] .rq-ring, .rq-tile[data-state="preparing"] .rq-ring { opacity: 1; }
.rq-tile[data-state="preparing"] .rq-ring { animation: rq-spin 1.2s linear infinite; }
.rq-tile[data-state="preparing"] .rq-ring__fg { stroke-dashoffset: 70; }
.rq-tile::before { content: ""; position: absolute; inset: 0; background: rgba(28, 26, 22, .18); opacity: 0; transition: opacity var(--dur-2); }
.rq-tile[data-state="uploading"]::before, .rq-tile[data-state="preparing"]::before { opacity: 1; }

.rq-tile__mark { position: absolute; right: 5px; bottom: 5px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; line-height: 1; opacity: 0; transform: scale(.6); transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-out); }
.rq-tile[data-state="done"] .rq-tile__mark, .rq-tile[data-state="already"] .rq-tile__mark, .rq-tile[data-state="review"] .rq-tile__mark { opacity: 1; transform: none; background: var(--accent); color: var(--accent-ink); }
.rq-tile[data-state="done"] .rq-tile__mark::after, .rq-tile[data-state="already"] .rq-tile__mark::after { content: "✓"; }
.rq-tile[data-state="review"] .rq-tile__mark::after { content: "…"; }
.rq-tile[data-state="failed"] .rq-tile__mark { opacity: 1; transform: none; background: var(--danger); color: var(--ivory); }
.rq-tile[data-state="failed"] .rq-tile__mark::after { content: "!"; font-weight: 600; }
.rq-tile__retry { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(28, 26, 22, .35); color: var(--ivory); font-size: 22px; cursor: pointer; }
.rq-tile__retry:focus-visible { outline: 2px solid var(--ivory); outline-offset: -4px; }

/* ---------- thank you ---------- */
.rq-done { margin-top: var(--space-5); padding: var(--space-6) var(--space-4); border-radius: var(--radius-3); background: var(--accent-soft); text-align: center; outline: none; animation: rq-in var(--dur-3) var(--ease-out); }
.rq-done__heart { display: block; font-family: var(--font-display); font-size: var(--step-4); color: var(--accent-text); line-height: 1; animation: rq-beat 1.6s var(--ease-soft) 2; }
.rq-done h2 { font-size: var(--step-4); font-style: italic; margin: var(--space-3) 0 var(--space-2); }
.rq-done p { color: var(--ink-2); margin: 0 auto var(--space-5); max-width: 36ch; }
.rq-done__acts { display: grid; gap: 10px; max-width: 320px; margin: 0 auto; }

@keyframes rq-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rq-spin { to { transform: rotate(270deg); } }
@keyframes rq-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.18); } 60% { transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) {
  .rq-tile__img img, .rq-done, .rq-done__heart, .rq-tile[data-state="preparing"] .rq-ring { animation: none; }
  .rq-meter i, .rq-ring__fg { transition: none; }
}
@media (min-width: 560px) { .rq-tiles { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } }

/* "Solo para los novios" (WED-134): files chosen with the switch on */
.rq-tile__priv { position: absolute; left: 4px; top: 4px; max-width: calc(100% - 8px); padding: 1px 6px; border-radius: var(--radius-pill); background: rgba(20, 16, 12, .62); color: #fff; font-size: 9.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }

/* WED-262: while uploading with the progress out of sight, a slim copy at the bottom edge (never over the new
   pictures: the page gets the same room at its end). Full border all around, accent only through the tokens. */
.rq-dock { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; width: min(420px, calc(100% - 24px)); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 10px 16px; border: 1px solid var(--rule); border-radius: var(--radius-pill); background: color-mix(in oklab, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--ink); font: inherit; font-size: var(--step--1); font-variant-numeric: tabular-nums; box-shadow: 0 6px 24px rgba(28, 26, 22, .14); cursor: pointer; text-align: left; }
.rq-dock[hidden] { display: none; }
.rq-dock__count { font-weight: 500; white-space: nowrap; }
.rq-dock__meter { height: 6px; }
.rq-dock:focus-visible { outline: none; box-shadow: var(--ring), 0 6px 24px rgba(28, 26, 22, .14); }
html.rq-docked body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
html.rq-docked .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: no-preference) { .rq-dock:not([hidden]) { animation: rq-dock-in var(--dur-2, .2s) var(--ease-out, ease-out); } }
@keyframes rq-dock-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }
/* Phones: the tiles keep to about three rows, so the album with the new pictures starts on the same screen. */
@media (max-width: 559px) { .rq-tiles { max-height: min(30vh, 240px); } }

/* WED-287: the picker opens from "Subir fotos" in the gallery header (hosts and team) or "Elegir fotos y videos" (guests,
   WED-384/388); the file input itself stays out of sight. */
.rq-up { position: relative; }
.rq-files { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
/* WED-384: "Solo para los novios" as one clear row right above the guests' picker button; off unless switched on. */
.rq-priv { margin: 0 0 var(--space-3); padding: 12px 14px; border-radius: var(--radius-2); background: var(--paper-2); border: 1px solid var(--rule); }
.rq-priv__row { display: flex; width: 100%; justify-content: space-between; gap: var(--space-3); min-height: 32px; font-size: var(--step--1); color: var(--ink); -webkit-tap-highlight-color: transparent; }
.rq-priv__text { flex: 1; font-weight: 600; }
.rq-priv .switch input:not(:checked) { background: var(--paper-3); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.rq-priv .switch input:focus-visible { outline: none; box-shadow: var(--ring); }
.rq-priv__hint { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.rq-priv:has(input:checked) { background: var(--accent-soft); border-color: var(--rule-strong); }
