/* EvoSnaps: black like the logo, silver type, and the aperture's cyan → blue → violet → pink glow as the accent. */

:root {
  --cyan: #3dd2fd;              /* aperture colours, sampled from the logo */
  --blue: #1f5bff;
  --indigo: #2a2bf0;
  --violet: #8a2bfe;
  --pink: #e04cf5;
  --grad: linear-gradient(100deg, var(--cyan) 0%, var(--blue) 38%, var(--violet) 72%, var(--pink) 100%);
  --accent: #4f8dff;            /* single-colour accent: focus rings, bars, ticks */
  --accent-ink: #ffffff;        /* text on the gradient */
  --accent-text: #6fdcff;       /* accent as text: links, "ask for access" */
  --accent-soft: rgba(79, 141, 255, .13);
  --glow: 0 0 0 1px rgba(111, 140, 255, .35), 0 6px 24px rgba(90, 70, 255, .35);

  --bg: #050608;                /* near the logo's pure black */
  --surface: #0e1015;
  --surface-2: #171a22;
  --ink: #eef0f5;               /* silver-white, like the wordmark */
  --ink-2: #c6cad4;
  --muted: #9097a6;
  --faint: #5c6270;
  --line: #1d212b;
  --line-strong: #2d3240;
  --field: #0a0c10;
  --tile: #0b0d14;
  --tile-ink: #dfe3ec;

  --open: #46d39a; --open-soft: rgba(70, 211, 154, .13);
  --locked: #c48bff; --locked-soft: rgba(160, 100, 255, .15);
  --hidden: #a3a9b6; --hidden-soft: rgba(163, 169, 182, .13);
  --danger: #ff6b7d; --danger-soft: rgba(255, 107, 125, .14);

  --shadow: 0 1px 2px rgba(0, 0, 0, .6);
  --shadow-lift: 0 18px 50px rgba(0, 0, 0, .7);
  --display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
  --r-s: 8px;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
#app { flex: 1; display: flex; flex-direction: column; }
a { color: inherit; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; margin: 0; }
h1 { font-size: clamp(30px, 4.4vw, 52px); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-2); }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0; }
small { font-size: .84em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; max-width: 70ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.loading.full { margin: 30vh auto; color: var(--muted); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px) 14px; border-bottom: 1px solid var(--line); background: #000; position: sticky; top: 0; z-index: 20; }
.wordmark { display: block; line-height: 0; }
.wordmark img { height: clamp(34px, 4.2vw, 48px); width: auto; display: block; }
.top-nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.top-nav > a { text-decoration: none; font-weight: 650; font-size: 15px; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.top-nav > a:hover { color: var(--ink); }
.top-nav > a.on { color: var(--ink); border-color: transparent; background: var(--grad) bottom / 100% 2px no-repeat; }
.icon-link { display: inline-flex; align-items: center; gap: 6px; }
.icon-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-link:hover { color: var(--accent-text) !important; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; }

.admin-tabs { display: flex; align-items: center; gap: 4px; padding: 10px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); overflow-x: auto; background: var(--surface); }
.admin-tabs a { text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--muted); white-space: nowrap; }
.admin-tabs a:hover { color: var(--ink); background: var(--surface-2); }
.admin-tabs a.on { background: var(--grad); color: #fff; }
.admin-tabs .linkish { margin-left: auto; white-space: nowrap; }

main { flex: 1; padding: 30px clamp(16px, 4vw, 48px) 70px; outline: none; min-width: 0; }
.page { display: grid; gap: 22px; max-width: 1280px; margin: 0 auto; width: 100%; }
.page.wide { max-width: 1600px; }
.page.narrow { max-width: 640px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.page-head .muted { margin-top: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.spread { justify-content: space-between; }
.stack { display: grid; gap: 14px; align-content: start; }
.cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.two { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.back:hover { color: var(--accent-text); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 22px clamp(16px, 4vw, 48px) max(22px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot a { color: var(--ink-2); }
.foot-note { flex: 1 1 260px; }
.foot-admin { color: var(--muted) !important; }
.version { color: var(--faint); font-size: 12px; }

/* ---------- home ---------- */
.hero { max-width: 1280px; margin: 8px auto 38px; display: grid; gap: 16px; position: relative; }
.hero::before { content: ""; position: absolute; z-index: -1; left: -10%; top: -40%; width: 70%; height: 180%; background: radial-gradient(closest-side, rgba(42, 91, 255, .22), rgba(138, 43, 254, .10) 55%, transparent); pointer-events: none; }
.hero h1 { font-size: clamp(34px, 6vw, 80px); font-weight: 800; max-width: 16ch; text-transform: uppercase; letter-spacing: -.005em; line-height: 1.02; }
.hero h1 .glow { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-kicker { font-size: 13px; font-weight: 600; letter-spacing: .4em; text-transform: uppercase; color: var(--muted); }
.hero-note { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; }
.hero-note svg, .private-note svg, .request-icon svg, .lock-tile svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-note svg { width: 18px; height: 18px; flex: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.toolbar input { max-width: 280px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 650; font-size: 14px; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; }

.albums { display: grid; gap: clamp(16px, 2.4vw, 30px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.album-card { display: grid; gap: 12px; text-decoration: none; }
.album-cover { display: block; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.album-card:hover .album-cover img { transform: scale(1.035); }
.album-card:hover .album-cover { box-shadow: var(--glow); }
.lock-tile { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; background:
  repeating-linear-gradient(-45deg, rgba(255,255,255,.035) 0 14px, transparent 14px 28px), var(--tile); color: var(--tile-ink); }
.lock-tile svg { width: 44px; height: 44px; color: var(--accent-text); filter: drop-shadow(0 0 10px rgba(79, 141, 255, .6)); }
.lock-tile small { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: 12px; opacity: .8; }
.empty-tile { background: var(--surface-2); color: var(--muted); }
.album-meta { display: grid; gap: 2px; }
.album-meta strong { font: 700 19px/1.2 var(--display); }
.album-card:hover strong { color: var(--accent-text); }
.album-meta small { color: var(--muted); }
.album-meta .ask { color: var(--accent-text); font-weight: 650; }

/* ---------- album page ---------- */
.album-head { display: grid; gap: 10px; margin-bottom: 6px; }
.album-desc { max-width: 70ch; color: var(--ink-2); }
.private-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: var(--locked-soft); color: var(--ink); border-radius: var(--r-s); max-width: 80ch; font-size: 15px; }
.private-note svg { width: 20px; height: 20px; color: var(--locked); flex: none; margin-top: 1px; }
.request-card { display: grid; gap: 14px; }
.request-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--tile); color: var(--accent); }
.request-icon svg { width: 26px; height: 26px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done-note { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-s); background: var(--open-soft); }

/* Rows of equal height; each photo keeps its shape. */
.jgrid { display: flex; flex-wrap: wrap; gap: 6px; --row: 240px; }
.jgrid::after { content: ""; flex-grow: 999999; }
.jitem { position: relative; flex: calc(var(--r) * 1000) 1 calc(var(--r) * var(--row)); aspect-ratio: var(--r); max-height: calc(var(--row) * 1.9); padding: 0; border: 0; background: var(--surface-2); border-radius: 4px; overflow: hidden; cursor: zoom-in; }
.jitem img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.jitem:hover img { filter: brightness(1.06); }
.jmissing { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); }
.selecting .jitem { cursor: pointer; }
.jitem .tick { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.jitem.picked { outline: 4px solid var(--accent); outline-offset: -4px; }
.jitem.picked .tick { background: var(--accent); }
.jitem.picked .tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.cover-badge { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 640px) { .jgrid { --row: 130px; gap: 4px; } }

/* ---------- viewer ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 9, .96); display: grid; touch-action: pan-y; animation: fade .18s ease; }
.lb-stage { display: grid; place-items: center; padding: 56px clamp(8px, 6vw, 80px) 24px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-spin { position: absolute; top: 18px; left: 50%; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; opacity: 0; transition: opacity .2s; animation: spin .8s linear infinite; }
.lb.loading .lb-spin { opacity: 1; transition-delay: .3s; }
.lb-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(10px, env(safe-area-inset-top)) 14px 10px 20px; color: #ddd; font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-btn { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@media (max-width: 640px) { .lb-prev, .lb-next { display: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms & buttons ---------- */
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label.inline, label.check { display: inline-flex; align-items: center; gap: 8px; }
label.inline select { width: auto; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--field); font-weight: 400; font-size: 16px; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; }
output { color: var(--muted); font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.12); border-color: transparent; box-shadow: var(--glow); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn-small { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.file-btn { cursor: pointer; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 14px; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: var(--r-s); font-size: 14px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 2.5vw, 26px); box-shadow: var(--shadow); }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r); }
.empty.big { padding: 60px 24px; display: grid; gap: 14px; justify-items: center; }
.notice { display: block; padding: 12px 16px; background: var(--accent-soft); color: var(--ink); border-radius: var(--r-s); text-decoration: none; }
.notice:hover { text-decoration: underline; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.pill-open { background: var(--open-soft); color: var(--open); }
.pill-locked { background: var(--locked-soft); color: var(--locked); }
.pill-hidden { background: var(--hidden-soft); color: var(--hidden); }
.gate-wrap { margin-top: 6vh; }
.gate-links { display: flex; justify-content: center; gap: 16px; font-size: 14px; }
.gate { display: grid; place-items: center; min-height: 70vh; padding: 20px; }
.gate-card { max-width: 440px; width: 100%; display: grid; gap: 14px; }
.gate-logo { width: 140px; height: auto; justify-self: center; border-radius: 22px; }

/* ---------- admin ---------- */
.dropzone { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 24px; border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); transition: border-color .15s, background .15s; }
.dropzone > svg { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { font-size: 17px; }
.dropzone p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.slim { grid-template-columns: 1fr auto; padding: 14px 16px; }
@media (max-width: 720px) { .dropzone, .dropzone.slim { grid-template-columns: 1fr; } .dropzone > svg { display: none; } }

.admin-albums { display: grid; gap: 8px; }
.admin-album { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.aa-thumb { width: 64px; height: 64px; border-radius: 9px; overflow: hidden; background: var(--surface-2); display: block; }
.aa-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aa-main { display: grid; gap: 1px; min-width: 0; }
.aa-main a { text-decoration: none; }
.aa-main strong { font-size: 17px; }
.aa-main small { color: var(--muted); }
.good-link { color: var(--accent-text) !important; font-weight: 700; }
.vis-pick { width: auto !important; min-height: 36px !important; padding: 5px 30px 5px 12px !important; border-radius: 999px !important; font-weight: 700 !important; font-size: 14px !important; }
.vis-open { background: var(--open-soft); color: var(--open); border-color: transparent !important; }
.vis-locked { background: var(--locked-soft); color: var(--locked); border-color: transparent !important; }
.vis-hidden { background: var(--hidden-soft); color: var(--hidden); border-color: transparent !important; }
@media (max-width: 640px) {
  .admin-album { grid-template-columns: 52px minmax(0, 1fr); }
  .aa-thumb { width: 52px; height: 52px; }
  .admin-album .vis-pick, .admin-album .btn { grid-column: 2; justify-self: start; }
}
.usage { display: grid; gap: 6px; font-size: 13px; color: var(--muted); max-width: 420px; }
.usage-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--open); }
.usage-bar span.warn { background: var(--danger); }

.new-albums { display: grid; gap: 10px; max-height: 40vh; overflow: auto; }
.new-album { display: grid; grid-template-columns: 1fr 160px; gap: 6px 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-s); }
.new-album small { grid-column: 1 / -1; color: var(--muted); }
@media (max-width: 520px) { .new-album { grid-template-columns: 1fr; } }
.vis-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.vis-choice legend { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.vis-choice.need legend { color: var(--danger); }
.vis-choice.need legend::after { content: " Choose one."; }
.radio-card { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-s); cursor: pointer; font-weight: 400; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 2px; }
.radio-card span { display: grid; gap: 2px; }
.radio-card small { color: var(--muted); }
.radio-card.compact { padding: 9px 12px; }

.seg { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.seg-opt { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; font-weight: 400; }
.seg-opt span { display: grid; gap: 3px; }
.seg-opt small { color: var(--muted); }
.seg-open:has(input:checked) { border-color: var(--open); background: var(--open-soft); }
.seg-locked:has(input:checked) { border-color: var(--locked); background: var(--locked-soft); }
.seg-hidden:has(input:checked) { border-color: var(--hidden); background: var(--hidden-soft); }
.slug-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--field); padding-left: 10px; }
.slug-field span { color: var(--muted); font-weight: 400; font-size: 14px; }
.slug-field input { border: 0 !important; padding-left: 2px !important; min-width: 0; }
.save-bar { grid-column: 1 / -1; display: flex; justify-content: flex-end; position: sticky; bottom: 12px; }
.save-bar .btn { box-shadow: var(--shadow-lift); }
#preview { width: 100%; height: auto; border-radius: var(--r-s); background: var(--surface-2); display: block; }

.requests { display: grid; gap: 12px; }
.request { display: grid; gap: 12px; }
.req-who { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.req-who strong { font-size: 18px; }
.req-who small { flex-basis: 100%; }
blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--violet); background: var(--surface-2); border-radius: 0 var(--r-s) var(--r-s) 0; white-space: pre-wrap; }
.access-list, .plain-list { list-style: none; margin: 0; padding: 0; display: grid; }
.access-list li { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.access-list li:first-child { border-top: 0; }
.access-list .who { display: grid; gap: 1px; min-width: 0; }
.access-list li.inactive { opacity: .6; }
.plain-list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary h2::after { content: " +"; color: var(--muted); }
details[open] summary h2::after { content: " –"; }
details[open] summary { margin-bottom: 12px; }

/* ---------- upload progress ---------- */
.upload-panel { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow-lift); padding: 14px 16px; display: grid; gap: 8px; }
.up-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.up-x { border: 0; background: none; font-size: 24px; line-height: 1; padding: 0 4px; color: var(--muted); }
.up-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.up-bar span { display: block; height: 100%; background: var(--grad); transition: width .3s; }
.up-now { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tip { font-size: 12px; color: var(--faint); }
.up-fails { display: none; margin: 0; padding-left: 18px; font-size: 13px; max-height: 180px; overflow: auto; }
.upload-panel.open .up-fails { display: block; }

/* ---------- toasts & dialogs ---------- */
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--r-s); background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; box-shadow: var(--shadow-lift); transition: opacity .3s, transform .3s; animation: fade .2s; }
.toast-error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
.dialog { border: 0; padding: 0; border-radius: var(--r); background: var(--surface); color: var(--ink); width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lift); }
.dialog-wide { width: min(680px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(10, 10, 12, .6); }
.dialog-inner { display: grid; gap: 16px; padding: 22px; }
.dialog-inner h2 { font-size: 24px; }
.dialog-body { display: grid; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .top { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .icon-link span { display: none; }
  .hero { margin-bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
