/* Sami & Dalel — guest albums (/albums/ and /albums/admin/). Spec: docs/ALBUMS-UX.md §2.
   Self-contained: re-declares the tokens of style.css (same names, same values) plus the album aliases. */
:root {
  --ivory: #F6F0E4;
  --paper: #FBF8F1;
  --gold: #C9A961;
  --gold-deep: #8A6A2B;
  --gold-text: #7A5C24;
  --gold-light: #F3E3AE;
  --sage: #A8B5A0;
  --sage-deep: #5E6E58;
  --blush: #E8CFC8;
  --ink: #2B2A26;
  --dusk: #1C2620;
  --dusk-2: #243129;

  --f-text: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --f-script: "Pinyon Script", "Snell Roundhand", cursive;
  --f-caps: "Cinzel", "Trajan Pro", Georgia, serif;

  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  /* album aliases */
  --a-bg: var(--paper);
  --a-surface: #FFFDF9;
  --a-tile: var(--ivory);
  --a-line: rgba(201,169,97,.35);
  --a-error: #9A3B2E;
  --a-night: #0E1310;
  --a-max: 935px;
  --a-gap: 2px;
  --a-bar-h: 52px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--a-bg); }
html.is-locked, html.is-locked body { overflow: hidden; }
body.a-app {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--a-bg); color: var(--ink);
  font: 500 18px/1.35 var(--f-text);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
p, h1, h2 { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button, a, label[for], .tile, .fab { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ic .ic-dot, .ic .ic-fill { fill: currentColor; stroke: none; }
.ic--solid { fill: currentColor; stroke: none; }

/* ---------- Type + buttons (same recipes as style.css) ---------- */
.label {
  font: 400 12px/1.7 var(--f-caps); letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-text); margin: 0;
}
.small { font: italic 400 16px/1.4 var(--f-text); color: var(--sage-deep); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; min-width: 140px; padding: 12px 22px;
  font: 400 12px/1.2 var(--f-caps); letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-text); text-decoration: none;
  background: rgba(251,248,241,.6);
  border: 1px solid rgba(138,106,43,.55); border-radius: 999px;
  cursor: pointer; transition: background-color .3s ease, color .3s ease, border-color .3s ease, opacity .2s ease;
  -webkit-user-select: none; user-select: none;
}
.btn:hover { background: var(--paper); border-color: var(--gold-deep); }
.btn--solid { background: var(--dusk); color: var(--gold-light); border-color: var(--dusk); min-width: 220px; }
.btn--solid:hover { background: var(--dusk-2); border-color: var(--dusk-2); }
.btn--icon { gap: 11px; min-height: 52px; padding: 13px 28px 13px 24px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(201,169,97,.38), 0 6px 16px -10px rgba(28,38,32,.55); }
.btn__icon { flex: none; width: 19px; height: 19px; margin-top: -1px; fill: none; stroke: var(--gold); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.btn__icon .btn__icon-dot { fill: var(--gold); stroke: none; }
.btn--block { display: flex; width: 100%; max-width: 360px; min-width: 0; }
.btn:disabled { opacity: .45; cursor: default; }
.btn--ghost-light { color: var(--gold-light); background: transparent; border-color: rgba(243,227,174,.45); }
.btn--ghost-light:hover { background: rgba(243,227,174,.08); border-color: var(--gold-light); }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.is-busy > .spinner { display: inline-block; }
.is-busy > .btn__icon { display: none; }
.btn.is-busy:disabled { opacity: 1; }
.a-textlink {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 0 8px;
  font: 400 11px/1 var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); text-decoration: none;
}
.a-textlink .ic { width: 15px; height: 15px; }
.a-textlink:hover { color: var(--gold-deep); }

/* ---------- Ornaments ---------- */
.a-mono { width: 72px; height: 72px; color: var(--gold); display: flex; align-items: center; justify-content: center; }
.a-mono svg { width: 100%; height: 100%; }
.a-mono__fb {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  border: 1px solid currentColor; border-radius: 50%; font: 400 20px var(--f-caps); letter-spacing: .06em;
}
.a-mono__fb em { font: italic 400 15px var(--f-text); margin: 0 .2em; }
.a-jasmine { width: 200px; max-width: 70%; margin: 14px auto 0; color: var(--gold); min-height: 20px; }
.a-jasmine svg { width: 100%; height: auto; }
.a-jasmine:not(.is-svg) { height: 1px; min-height: 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin-top: 24px; }
.a-jasmine--sm { width: 104px; opacity: .8; margin: 24px auto 18px; }

/* ---------- Views ---------- */
.view.is-in { animation: viewIn .32s var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { margin-top: 22px; }
.field__label { display: block; margin-bottom: 8px; font: 400 11.5px/1.4 var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); }
.field__opt { font: italic 400 15px var(--f-text); letter-spacing: 0; text-transform: none; color: var(--sage-deep); margin-left: 4px; }
.field__input {
  display: block; width: 100%; height: 56px; padding: 0 16px;
  font: 500 18px/1.2 var(--f-text); color: var(--ink);
  background: var(--a-surface); border: 1px solid rgba(138,106,43,.35); border-radius: 14px;
  -webkit-appearance: none; appearance: none; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field__input::placeholder { color: rgba(94,110,88,.62); font-style: italic; font-weight: 400; }
.field__input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,97,.22); }
.field__input[aria-invalid="true"] { border-color: var(--a-error); }
.field__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(154,59,46,.14); }
.field__help { margin-top: 8px; font: italic 400 16px/1.4 var(--f-text); color: var(--sage-deep); }
.field__error { margin-top: 8px; font: 500 16px/1.4 var(--f-text); color: var(--a-error); }
.field__typo { margin-top: 8px; font: 400 16px/1.4 var(--f-text); color: var(--sage-deep); }
.field__sugg { padding: 0; border: 0; background: none; font: 600 16px var(--f-text); color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Onboarding ---------- */
.onb__inner { max-width: 440px; margin: 0 auto; padding: calc(32px + var(--safe-t)) 24px calc(32px + var(--safe-b)); }
.onb__brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 30px; }
.onb__brand .a-mono { margin-bottom: 6px; }
.onb__names { font: 400 40px/1.15 var(--f-script); color: var(--ink); }
.onb__brand .label { font-size: 11.5px; }
.onb__title { font: italic 500 28px/1.2 var(--f-text); color: var(--ink); }
.onb__lede { margin-top: 8px; font: 400 18px/1.45 var(--f-text); color: var(--sage-deep); }
.onb__form { margin-top: 6px; }
.onb__form .btn--block { margin-top: 28px; max-width: none; min-height: 56px; }
.onb__privacy { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font: 400 16px/1.4 var(--f-text); color: var(--sage-deep); }
.onb__privacy .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--gold-text); }
.onb__back { display: flex; margin: 26px auto 0; width: max-content; }

/* ---------- Top bar ---------- */
.a-bar {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--safe-t);
  background: rgba(251,248,241,.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--a-line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .a-bar { background: var(--a-bg); } }
.a-bar__in {
  height: var(--a-bar-h); max-width: var(--a-max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 max(6px, var(--safe-r)) 0 max(6px, var(--safe-l));
}
.a-bar__back, .a-bar__btn {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; min-width: 44px; padding: 0 8px;
  font: 400 11px/1 var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); text-decoration: none;
  background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.a-bar__back .ic { width: 16px; height: 16px; }
.a-bar__btn { justify-content: center; }
.a-bar__btn .ic { width: 20px; height: 20px; }
.a-bar__email {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; min-width: 0; padding: 0 10px;
  background: none; border: 0; cursor: pointer; font: 500 17px/1 var(--f-text); color: var(--ink);
}
.a-bar__email-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-bar__email .ic { width: 16px; height: 16px; color: var(--gold-text); }
.a-bar__title { font: 400 12px/1 var(--f-caps); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); padding: 0 10px; }
.a-bar__end { display: flex; align-items: center; }
.a-batch { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; opacity: 0; transition: opacity .3s ease; }
.a-batch.is-on { opacity: 1; }
.a-batch i { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; transition: transform .2s linear; }

/* ---------- Upload strip ---------- */
.a-strip {
  position: sticky; top: calc(var(--a-bar-h) + var(--safe-t)); z-index: 19;
  background: var(--a-bg); border-bottom: 1px solid var(--a-line);
  transition: opacity .3s ease, transform .3s var(--ease-out);
}
.a-strip.is-out { opacity: 0; transform: translateY(-8px); }
.a-strip__in {
  display: block; width: 100%; max-width: var(--a-max); margin: 0 auto; min-height: 44px; padding: 10px 16px;
  background: none; border: 0; text-align: left; cursor: pointer;
}
.a-strip__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.a-strip__status { font: 500 17px/1.3 var(--f-text); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.a-strip__eta { font: italic 400 16px/1.3 var(--f-text); color: var(--sage-deep); white-space: nowrap; }
.a-strip.is-done .a-strip__status { color: var(--sage-deep); }
.a-strip__keep { display: flex; align-items: center; gap: 7px; margin-top: 3px; font: italic 400 16px/1.3 var(--f-text); color: var(--gold-text); }
.a-strip__keep .ic { width: 15px; height: 15px; }

/* ---------- Profile header ---------- */
.a-main { max-width: var(--a-max); margin: 0 auto; }
.a-profile { padding: 22px max(16px, var(--safe-r)) 0 max(16px, var(--safe-l)); }
.a-profile__top { display: flex; align-items: center; gap: 30px; }
.a-avatar { position: relative; flex: none; width: 86px; height: 86px; border-radius: 50%; }
.a-avatar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--a-line); }
.a-avatar__ring {
  position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .4s ease;
  background: conic-gradient(var(--gold), var(--gold-light), var(--sage), var(--gold));
}
.a-avatar.has-ring::before { display: none; }
.a-avatar.has-ring .a-avatar__ring { opacity: 1; }
.a-avatar.is-busy .a-avatar__ring { animation: spin 2.4s linear infinite; }
.a-avatar__in {
  position: absolute; inset: 6px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--ivory); box-shadow: 0 0 0 3px var(--a-bg);
  font: italic 500 40px/1 var(--f-text); color: var(--gold-text);
}
.a-avatar__in img { width: 100%; height: 100%; object-fit: cover; }
.a-stats { display: flex; gap: 30px; margin: 0; }
.a-stat { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 52px; }
.a-stat__n { font: 600 22px/1.1 var(--f-text); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.a-stat__n.is-bump { animation: bump .24s var(--ease-out); }
@keyframes bump { 50% { transform: scale(1.12); } }
.a-stat__l { font: 400 10.5px/1 var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); }
.a-profile__name {
  margin-top: 14px; font: italic 500 24px/1.15 var(--f-text); color: var(--ink);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.a-profile__name.is-email { font-size: 21px; }
.a-profile__addname {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0; margin-top: 2px;
  background: none; border: 0; cursor: pointer;
  font: italic 500 17px/1.2 var(--f-text); color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.a-profile__bio { margin-top: 4px; font: 400 16px/1.4 var(--f-text); color: var(--sage-deep); }
.a-profile__meta { margin-top: 2px; font: italic 400 16px/1.4 var(--f-text); color: var(--sage-deep); }
.a-profile__email {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0; background: none; border: 0; cursor: copy;
  font: 500 17px/1.3 var(--f-text); color: var(--gold-text); -webkit-user-select: text; user-select: text; overflow-wrap: anywhere; text-align: left;
}
.a-profile__add { margin-top: 18px; }

/* ---------- Grid + tiles ---------- */
.a-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--a-gap); }
.tile {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  padding: 0; margin: 0; border: 0; border-radius: 0; background: var(--a-tile); cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
@supports not (aspect-ratio: 1 / 1) { .tile { height: 0; padding-bottom: 100%; } }
.tile:focus-visible { outline-offset: -3px; border-radius: 0; z-index: 1; }
.tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .24s ease, filter .3s ease; -webkit-user-drag: none; }
.tile__img.is-fading { opacity: 0; }
.tile__ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--gold); }
.tile__ph .ic { width: 30px; height: 30px; stroke-width: 1.15; }
.tile__ph span { font: 400 10px/1 var(--f-caps); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); }
.tile.has-img .tile__ph { display: none; }
.tile__play { position: absolute; top: 8px; right: 8px; z-index: 2; width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.tile__play .ic { width: 20px; height: 20px; }
.tile:not(.has-img) .tile__play { color: var(--gold); filter: none; }
.tile--skel { cursor: default; animation: shimmer 1.4s ease-in-out infinite; }
.tile--skel:nth-child(3n+2) { animation-delay: .15s; } .tile--skel:nth-child(3n) { animation-delay: .3s; }
@keyframes shimmer { 50% { opacity: .6; } }
.tile.is-new { animation: tileIn .22s var(--ease-out) var(--st, 0ms) both; }
@keyframes tileIn { from { opacity: 0; transform: scale(.94); } }
@media (hover: hover) { .tile:not(.is-up):hover .tile__img { filter: brightness(.92); } }

/* upload states */
.tile__up { position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px; transition: opacity .4s ease; }
.tile.is-up .tile__up { display: flex; }
.tile.is-up.has-img .tile__img { filter: brightness(.82); }
.tile.is-up.is-settled .tile__img { filter: none; }
.tile.is-up .tile__play { display: none; }
.ring { position: relative; width: 40px; height: 40px; flex: none; }
.ring > svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: rgba(255,253,249,.55); stroke-width: 3; }
.ring__arc { fill: none; stroke: var(--gold-light); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .2s linear, opacity .4s ease; }
.tile:not(.has-img) .ring__track { stroke: var(--a-line); }
.tile:not(.has-img) .ring__arc { stroke: var(--gold); }
.ring__check, .ring__retry { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; opacity: 0; transition: opacity .4s ease; }
.ring__check { background: var(--sage-deep); color: #fff; }
.ring__check .ic { width: 22px; height: 22px; stroke-width: 2; }
.ring__retry { display: none; }
.tile__cap, .tile__eta {
  max-width: 100%; text-align: center; font: 400 11px/1.2 var(--f-caps); letter-spacing: .06em; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.55); font-variant-numeric: lining-nums tabular-nums;
}
.tile__eta { font: italic 500 13px/1.2 var(--f-text); letter-spacing: 0; }
.tile__cap:empty, .tile__eta:empty { display: none; }
.tile:not(.has-img) .tile__cap, .tile:not(.has-img) .tile__eta { color: var(--gold-text); text-shadow: none; }
.tile.is-up:not(.has-img) .tile__ph { opacity: .35; }
.tile.is-done .ring__arc, .tile.is-done .ring__track { opacity: 0; }
.tile.is-done .ring__check { opacity: 1; }
.tile.is-done .tile__cap, .tile.is-done .tile__eta { display: none; }
.tile.is-settled .tile__up { opacity: 0; pointer-events: none; }
.tile.is-settled .tile__play { display: block; }
.tile.is-paused .ring__arc { stroke: var(--sage); }
.tile.is-paused .tile__cap { font: italic 500 14px/1.2 var(--f-text); letter-spacing: 0; }
.tile.is-failed::after, .tile.is-rejected::after { content: ""; position: absolute; inset: 0; z-index: 2; background: rgba(232,207,200,.62); }
.tile.is-failed .tile__img, .tile.is-rejected .tile__img { opacity: .5; filter: none; }
.tile.is-failed svg, .tile.is-rejected .ring { display: none; }
.tile.is-failed .ring { width: 44px; height: 44px; }
.tile.is-failed .ring__retry { display: flex; opacity: 1; background: rgba(255,253,249,.94); color: var(--a-error); box-shadow: 0 2px 8px rgba(154,59,46,.18); }
.tile.is-failed .ring__retry svg { display: block; width: 22px; height: 22px; stroke-width: 1.6; }
.tile.is-failed .tile__cap, .tile.is-rejected .tile__cap { color: var(--a-error); text-shadow: none; font: 600 14px/1.2 var(--f-text); letter-spacing: 0; }
.tile.is-rejected { cursor: default; }
.tile.is-rejected .tile__ph { opacity: .5; }

/* ---------- Empty state + footer ---------- */
.a-empty { padding: 40px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.a-empty__icon { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center; color: var(--gold); margin-bottom: 18px; }
.a-empty__icon .ic { width: 30px; height: 30px; stroke-width: 1.15; }
.a-empty__title { font: italic 500 24px/1.2 var(--f-text); color: var(--ink); }
.a-empty__text { margin: 6px 0 22px; max-width: 20em; font: 400 17px/1.45 var(--f-text); color: var(--sage-deep); }
.a-foot { padding: 48px 16px calc(96px + var(--safe-b)); text-align: center; }

/* ---------- Camera FAB ---------- */
.fab {
  position: fixed; z-index: 30;
  right: max(16px, var(--safe-r)); bottom: max(20px, calc(var(--safe-b) + 12px));
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--dusk); color: var(--gold-light); cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(28,38,32,.45), inset 0 0 0 1px rgba(201,169,97,.4);
  opacity: 0; transform: translateY(12px); pointer-events: none; visibility: hidden;
  transition: opacity .25s ease, transform .3s var(--ease-out), visibility 0s linear .3s;
}
.fab.is-shown { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .25s ease, transform .3s var(--ease-out); }
.fab .ic { width: 26px; height: 26px; stroke-width: 1.3; }
.fab:hover { background: var(--dusk-2); }

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(28,38,32,.45); opacity: 0; transition: opacity .22s ease; }
.sheet.is-open .sheet__scrim { opacity: 1; transition-duration: .28s; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px;
  max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--a-surface); border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(28,38,32,.18);
  padding: 0 20px calc(24px + var(--safe-b));
  transform: translateY(100%); transition: transform .22s var(--ease-io);
}
.sheet.is-open .sheet__panel { transform: none; transition: transform .28s var(--ease-out); }
.sheet__grab { height: 26px; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; margin: 0 -20px 4px; }
.sheet__grab::before { content: ""; width: 38px; height: 4px; border-radius: 4px; background: rgba(138,106,43,.3); }
.sheet__rows { margin: 0 -4px; }
.sheet__row {
  display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 0 6px;
  font: 500 19px/1.2 var(--f-text); color: var(--ink); cursor: pointer;
  border-bottom: 1px solid var(--a-line); border-radius: 0;
}
.sheet__row .ic { width: 22px; height: 22px; color: var(--gold-deep); stroke-width: 1.3; }
.sheet__row:hover { color: var(--gold-deep); }
.sheet__note { padding: 14px 2px 4px; font: 400 15px/1.45 var(--f-text); color: var(--sage-deep); }
.sheet__title { font: italic 500 26px/1.2 var(--f-text); color: var(--ink); }
.sheet__text { margin-top: 8px; font: 400 17px/1.45 var(--f-text); color: var(--sage-deep); }
.sheet__actions { display: grid; gap: 10px; margin-top: 24px; justify-items: center; }
.sheet__actions .btn--block { max-width: none; }
.sheet__body .field__help { margin-top: 14px; }

/* ---------- Viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 50; color: var(--gold-light); }
.viewer__bg { position: absolute; inset: 0; background: var(--a-night); opacity: 0; transition: opacity .26s ease; }
.viewer.is-open .viewer__bg { opacity: 1; }
.viewer__top, .viewer__bottom {
  position: absolute; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-left: max(6px, var(--safe-l)); padding-right: max(10px, var(--safe-r));
  opacity: 0; transition: opacity .26s ease; pointer-events: none;
}
.viewer__top > *, .viewer__bottom > * { pointer-events: auto; }
.viewer.is-open .viewer__top, .viewer.is-open .viewer__bottom { opacity: 1; }
.viewer__top { top: 0; padding-top: var(--safe-t); height: calc(56px + var(--safe-t)); }
.viewer__bottom { bottom: 0; padding-bottom: var(--safe-b); padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); min-height: calc(60px + var(--safe-b)); }
.viewer__btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: var(--gold-light); cursor: pointer; border-radius: 50%; }
.viewer__btn .ic { width: 24px; height: 24px; }
.viewer__count { padding-right: 6px; font: 400 12px/1 var(--f-caps); letter-spacing: .18em; font-variant-numeric: lining-nums tabular-nums; }
.viewer__when { font: 400 11px/1.2 var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--sage); }
.viewer__tip { flex: 1; text-align: right; font: italic 400 15px/1.2 var(--f-text); color: var(--sage); }
.viewer__dl {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; flex: none;
  font: 400 11px/1 var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); text-decoration: none;
  border: 1px solid rgba(243,227,174,.4); border-radius: 999px;
}
.viewer__dl .ic { width: 18px; height: 18px; }
.viewer__dl:hover { background: rgba(243,227,174,.08); border-color: var(--gold-light); }
.viewer__track {
  position: absolute; inset: 0; z-index: 1; display: flex;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x;
}
.viewer__track::-webkit-scrollbar { display: none; }
.vslide {
  position: relative; flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
  padding: calc(56px + var(--safe-t)) 0 calc(60px + var(--safe-b));
}
video.vslide__media { width: auto; height: auto; max-width: 100%; max-height: 100%; min-width: 50%; background: #000; }
.vslide__media { width: 100%; height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; will-change: transform; transform-origin: 50% 50%; }
.viewer:not(.is-open) .vslide__media { opacity: 0; transition: opacity .2s ease; }
.vslide__note { position: absolute; left: 16px; right: 16px; bottom: calc(66px + var(--safe-b)); text-align: center; font: italic 400 16px/1.4 var(--f-text); color: var(--gold-light); }
.vslide__err { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font: italic 400 19px/1.4 var(--f-text); }
.vslide__err .ic { width: 30px; height: 30px; color: var(--gold); }
.viewer__nav {
  position: absolute; top: 50%; z-index: 3; width: 44px; height: 44px; margin-top: -22px; display: none;
  align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%;
  background: rgba(243,227,174,.1); color: var(--gold-light); cursor: pointer; transition: background-color .2s ease, opacity .2s ease;
}
.viewer__nav .ic { width: 22px; height: 22px; }
.viewer__nav:hover { background: rgba(243,227,174,.2); }
.viewer__nav:disabled { opacity: 0; pointer-events: none; }
.viewer__nav--prev { left: max(16px, var(--safe-l)); }
.viewer__nav--next { right: max(16px, var(--safe-r)); }
@media (hover: hover) and (pointer: fine) { .viewer.is-open .viewer__nav { display: flex; } }
.viewer :focus-visible { outline-color: var(--gold-light); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 70; left: 50%; bottom: calc(var(--safe-b) + 92px);
  width: max-content; max-width: min(340px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: var(--dusk); color: var(--gold-light); border-radius: 999px;
  box-shadow: 0 10px 28px -10px rgba(28,38,32,.55), inset 0 0 0 1px rgba(201,169,97,.3);
  font: 500 17px/1.3 var(--f-text);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; transition-duration: .2s; transition-timing-function: var(--ease-out); }
.toast__msg { flex: 1; }
.toast__act {
  flex: none; min-height: 32px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 11px/1 var(--f-caps); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-light);
  text-decoration: underline; text-underline-offset: 4px;
}

/* ---------- In-app browser banner ---------- */
.a-iab {
  display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 8px 8px 16px;
  background: var(--ivory); border-bottom: 1px solid var(--a-line);
  font: 400 15px/1.35 var(--f-text); color: var(--ink);
}
.a-iab__text { flex: 1; }
.a-iab__act { min-height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer; font: 400 11px/1 var(--f-caps); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.a-iab__x { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--gold-text); cursor: pointer; }
.a-iab__x .ic { width: 18px; height: 18px; }
.a-iab__url { width: 100%; height: 36px; padding: 0 10px; font: 400 15px var(--f-text); border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-surface); }

/* ---------- Fatal ---------- */
.fatal { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px 24px; text-align: center; }
.fatal .a-mono { margin-bottom: 10px; }
.fatal__title { font: italic 500 28px/1.2 var(--f-text); max-width: 14em; }
.fatal__text { font: 400 18px/1.4 var(--f-text); color: var(--sage-deep); margin-bottom: 14px; }

/* =====================================================================
   Admin (/albums/admin/)
   ===================================================================== */
.adm-login .onb__brand { margin-bottom: 34px; }
.adm-check { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.adm-check .a-mono { opacity: .4; }
.pw { position: relative; }
.pw .field__input { padding-right: 56px; }
.pw__toggle { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--gold-text); cursor: pointer; border-radius: 10px; }
.pw__toggle .ic { width: 20px; height: 20px; }
.is-shake { animation: shake .3s linear; }
@keyframes shake { 0%, 100% { transform: none; } 17%, 50%, 83% { transform: translateX(-6px); } 33%, 67% { transform: translateX(6px); } }
.adm-login__stay { margin-top: 14px; text-align: center; font: 400 15px/1.4 var(--f-text); color: var(--sage-deep); }

.adm-index { padding: 20px max(16px, var(--safe-r)) calc(48px + var(--safe-b)) max(16px, var(--safe-l)); }
.adm-summary { font: italic 500 20px/1.3 var(--f-text); color: var(--ink); font-variant-numeric: lining-nums; }
.adm-search { position: relative; margin-top: 14px; }
.adm-search .ic { position: absolute; left: 16px; top: 50%; margin-top: -10px; width: 20px; height: 20px; color: var(--gold-text); pointer-events: none; }
.adm-search input {
  width: 100%; height: 48px; padding: 0 18px 0 46px; border-radius: 999px;
  font: 500 18px var(--f-text); color: var(--ink); background: var(--a-surface);
  border: 1px solid rgba(138,106,43,.3); outline: none; -webkit-appearance: none; appearance: none;
}
.adm-search input::placeholder { color: rgba(94,110,88,.7); font-style: italic; font-weight: 400; }
.adm-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,97,.22); }
.adm-sort { display: flex; gap: 4px; margin: 14px 0 8px; }
.adm-sort button {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 400 11px/1 var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--sage-deep);
}
.adm-sort button[aria-pressed="true"] { color: var(--gold-light); background: var(--dusk); }
.a-list { list-style: none; margin: 0 -16px; padding: 0; border-top: 1px solid var(--a-line); }
.a-row {
  display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--a-line); color: var(--ink); text-decoration: none;
  transition: background-color .2s ease;
}
.a-row:hover { background: rgba(246,240,228,.7); }
.a-row:focus-visible { outline-offset: -3px; border-radius: 0; }
.a-row__av { position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; }
.a-row__av::before { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--gold); }
.a-row__av.is-new::before { box-shadow: none; background: conic-gradient(var(--gold), var(--gold-light), var(--sage), var(--gold)); }
.a-row__av span { position: absolute; inset: 4px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--ivory); box-shadow: 0 0 0 2px var(--a-bg); font: italic 500 25px/1 var(--f-text); color: var(--gold-text); }
.a-row__av img { width: 100%; height: 100%; object-fit: cover; }
.a-row__main { flex: 1; min-width: 0; }
.a-row__title, .a-row__sub { display: block; }
.a-row__title { font: italic 500 20px/1.2 var(--f-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-row__sub { margin-top: 2px; font: 400 15px/1.3 var(--f-text); color: var(--sage-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-row__count { flex: none; display: flex; align-items: center; gap: 2px; font: 600 18px/1 var(--f-text); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.a-row__count .ic { width: 18px; height: 18px; color: var(--gold-text); }
.adm-msg { padding: 40px 12px; text-align: center; font: italic 400 19px/1.45 var(--f-text); color: var(--sage-deep); }
.adm-skel { height: 72px; border-bottom: 1px solid var(--a-line); background: linear-gradient(90deg, transparent, rgba(246,240,228,.9), transparent); animation: shimmer 1.4s ease-in-out infinite; }

/* ---------- Larger screens ---------- */
@media (min-width: 736px) {
  :root { --a-gap: 4px; }
  /* IG desktop profile: big avatar on the left, everything else in a column beside it */
  .a-profile { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 64px; align-items: start; max-width: 760px; margin: 0 auto; padding: 44px 32px 0; }
  .a-profile__top { display: contents; }
  .a-avatar { grid-column: 1; grid-row: 1 / span 6; align-self: center; width: 150px; height: 150px; }
  .a-avatar__in { inset: 7px; font-size: 64px; }
  .a-profile__name { order: -1; margin-top: 0; font-size: 28px; }
  .a-stats, .a-profile__name, .a-profile__addname, .a-profile__email, .a-profile__bio, .a-profile__meta, .a-profile__add { grid-column: 2; justify-self: start; }
  .a-stats { gap: 40px; margin: 14px 0 10px; }
  .a-stat { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
  .a-stat__n { font-size: 22px; }
  .a-profile__add { margin-top: 20px; width: 360px; }
  .a-jasmine--sm { grid-column: 1 / -1; margin-top: 36px; }
  .adm-index { padding-top: 32px; }
  .a-list { margin: 0; }
  .toast { bottom: calc(var(--safe-b) + 32px); }
}

/* ---------- Reduced motion / transparency ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .view.is-in { animation: none; }
  .tile.is-new { animation: none; }
  .a-avatar.is-busy .a-avatar__ring { animation: none; }
  .tile--skel { animation: none; }
  .sheet__panel, .sheet.is-open .sheet__panel { transform: none; opacity: 0; transition: opacity .15s ease; }
  .sheet.is-open .sheet__panel { opacity: 1; }
  .fab, .fab.is-shown, .toast, .toast.is-in, .a-strip.is-out { transform: none; transition: opacity .15s ease; }
  .toast, .toast.is-in { transform: translateX(-50%); }
  .spinner { animation: spin .8s linear infinite !important; animation-iteration-count: infinite !important; animation-duration: .8s !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .a-bar { background: var(--a-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
