/* HDR Fotos — esqueleto no estilo do app Fotos do iPhone */

:root {
  --bg: #ffffff;
  --sidebar: #f5f5f7;
  --sheet: #ffffff;
  --box: #f2f2f7;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.2);
  --fill: rgba(120, 120, 128, 0.12);
  --pressed: rgba(120, 120, 128, 0.16);
  --tint: #007aff;
  --green: #34c759;
  --tile: #e9e9ee;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  --scrim: rgba(0, 0, 0, 0.32);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-bottom: max(12px, calc(var(--safe-bottom) - 6px));
  --top-h: calc(var(--safe-top) + 68px);
  --side-w: 0px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --sidebar: #141416;
    --sheet: #1c1c1e;
    --box: #2c2c2e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.55);
    --fill: rgba(118, 118, 128, 0.24);
    --pressed: rgba(255, 255, 255, 0.14);
    --tint: #0a84ff;
    --green: #30d158;
    --tile: #1c1c1e;
    --glass: rgba(38, 38, 40, 0.7);
    --glass-edge: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --scrim: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --sidebar: #141416;
  --sheet: #1c1c1e;
  --box: #2c2c2e;
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.55);
  --fill: rgba(118, 118, 128, 0.24);
  --pressed: rgba(255, 255, 255, 0.14);
  --tint: #0a84ff;
  --green: #30d158;
  --tile: #1c1c1e;
  --glass: rgba(38, 38, 40, 0.7);
  --glass-edge: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  --scrim: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
/* A página não rola; só a área das fotos (.view). Ver .view abaixo. */
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 17px/1.3 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html, body, .view, .topbar { transition: background-color 0.25s; }
a { color: inherit; text-decoration: none; }
button { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: default; }
img { display: block; }
svg { display: block; flex: none; width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

.fade { opacity: 0; transition: opacity 0.3s; }
.fade.ok { opacity: 1; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-edge);
}

.round { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.round.lg { width: 50px; height: 50px; }
.pill { height: 40px; padding: 0 16px; border-radius: 20px; font-size: 15px; font-weight: 600; }
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a3a3c, #0b0b0c);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--glass-shadow), inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
}
/* ---------- Barra do topo ---------- */

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: var(--side-w);
  right: 0;
  height: var(--top-h);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: calc(var(--safe-top) + 10px) 16px 0;
  /* Cor sólida de propósito: o Safari do iPhone usa a cor do topo para pintar a área do relógio. */
  background: var(--bg);
  pointer-events: none;
}
/* Degradê logo abaixo da barra, para as fotos sumirem suavemente por baixo dela. */
.topbar::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(var(--bg), transparent);
}
.topbar.no-fade::before { display: none; }
.topbar > * { pointer-events: auto; }
.titles { flex: 1; min-width: 0; padding-top: 1px; }
.titles h1 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.12; letter-spacing: -0.025em; }
.titles p {
  margin: 1px 0 0;
  min-height: 1.3em;
  overflow: hidden;
  color: var(--label-2);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mini { flex: 1; min-width: 0; padding-top: 1px; opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s; }
.topbar.scrolled .mini { opacity: 1; transform: none; }
.mini b { display: block; overflow: hidden; font-size: 16px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.mini span { display: block; min-height: 1.3em; color: var(--label-2); font-size: 13px; }
.actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Conteúdo ---------- */

/* Área que rola, por baixo da barra do topo. Com a página parada, o Safari do iPhone
   não tem o que mostrar atrás do relógio além da cor de fundo. */
.view {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--side-w);
  right: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-top: var(--top-h);
  padding-bottom: calc(var(--safe-bottom) + 110px);
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--tile); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile.sel::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.25); }
.dur {
  position: absolute;
  right: 6px;
  bottom: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}
.fav { position: absolute; left: 5px; bottom: 5px; color: #fff; filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5)); }
.fav svg { width: 14px; height: 14px; }
.check {
  position: absolute;
  z-index: 1;
  right: 5px;
  bottom: 5px;
  display: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tint);
  color: #fff;
  box-shadow: 0 0 0 1.5px #fff;
}
.check svg { width: 15px; height: 15px; }
.tile.sel .check { display: grid; }
.selecting .dur { display: none; }
.tile.ghost { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.status { max-width: 360px; margin: 0 auto; padding: 72px 24px; text-align: center; }
.status h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.status p { margin: 0 0 18px; color: var(--label-2); font-size: 16px; line-height: 1.4; }

@media (hover: hover) {
  .tile:hover img { filter: brightness(0.92); }
}

/* Seções por dia */
.day { scroll-margin-top: var(--top-h); }
.chips ~ .day { scroll-margin-top: calc(var(--top-h) + 40px); } /* logo abaixo da fileira de datas */
.day-head { position: relative; padding: 20px 16px 10px; }
.pick { position: absolute; top: 22px; right: 16px; display: none; color: var(--tint); font-size: 15px; font-weight: 600; }
.selecting .pick { display: block; }
.selecting .day-head h2 { padding-right: 96px; }
.day-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.day-head p { margin: 2px 0 0; color: var(--label-2); font-size: 15px; }
.day-head a { color: var(--tint); }

/* Cabeçalho do álbum */
.album-head { padding: 6px 16px 12px; }
.album-head h1 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; }
.album-head p { margin: 4px 0 0; color: var(--label-2); font-size: 15px; }
.album-head p + p { margin-top: 0; }

/* Filtro Todos / DJs / Público: discreto, logo acima das fotos */
.who { display: flex; gap: 16px; padding: 2px 16px 0; }
.who button { height: 30px; color: var(--label-2); font-size: 14px; font-weight: 500; }
.who button.on { color: var(--label); font-weight: 600; }
.who + .day .day-head { padding-top: 6px; }
.view > .who:first-child { padding: 10px 16px 4px; } /* Biblioteca: logo abaixo do título */

/* Atalhos de data (fixos ao rolar) */
.chips {
  position: sticky;
  z-index: 10;
  top: -6px; /* conta a partir do padding-top da área que rola (que já é a altura do topo) */
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 16px 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--label); color: var(--bg); }

/* Álbuns */
.section-title { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 16px 12px; }
.section-title h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.section-title span { color: var(--label-2); font-size: 17px; }
.album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 14px; padding: 0 16px 14px; }
.album-card { display: block; min-width: 0; }
.cover { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--tile); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card .name {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.album-card .count { display: block; color: var(--label-2); font-size: 15px; }

/* Listas */
.rows { margin: 0 16px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 6px 0;
  border-bottom: 0.5px solid var(--sep);
  text-align: left;
}
.row > svg:first-child { width: 24px; height: 24px; color: var(--tint); }
.row > span { flex: 1; min-width: 0; color: var(--tint); }
.row small { display: block; overflow: hidden; color: var(--label-2); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.row em { color: var(--label-2); font-style: normal; }
.row > svg:last-child { width: 16px; height: 16px; color: var(--label-3); }
.row > img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--tile); }


.empty { padding: 48px 16px; color: var(--label-2); text-align: center; }

/* Procure seu rosto */
.face-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(100% - 32px);
  margin: 4px 16px 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--tint), color-mix(in srgb, var(--tint) 62%, #000));
  color: #fff;
  text-align: left;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--tint) 32%, transparent);
}
.face-cta-ico { display: grid; place-items: center; flex: none; width: 50px; height: 50px; border-radius: 15px; background: rgba(255, 255, 255, 0.18); }
.face-cta-ico svg { width: 32px; height: 32px; }
.face-cta > span:nth-child(2) { flex: 1; min-width: 0; }
.face-cta b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.face-cta small { display: block; margin-top: 1px; font-size: 14px; opacity: 0.9; }
.face-cta > svg:last-child { width: 18px; height: 18px; opacity: 0.8; }
.face-actions { padding: 0 16px 8px; }
.face-round { background: var(--tint); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--tint) 35%, transparent); }
.face-round svg { width: 24px; height: 24px; }
.face-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 22px;
  background: var(--tint);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.face-btn svg { width: 24px; height: 24px; }
.face-head { display: flex; align-items: center; gap: 14px; }
/* Em Álbuns o botão fica preso logo abaixo do título, por cima do degradê do topo;
   os álbuns passam por baixo e o degradê sai debaixo do botão. */
.face-cta-bar { position: sticky; z-index: 21; top: 0; padding-top: 4px; background: var(--bg); }
.face-cta-bar::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 24px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
.face-cta-bar .face-cta { margin-top: 0; }
.face-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; margin: 8px 0; }
.face-pick button { aspect-ratio: 1; overflow: hidden; border-radius: 50%; box-shadow: 0 0 0 3px var(--fill); }
.face-pick button:active, .face-pick button:hover { box-shadow: 0 0 0 3px var(--tint); }
.face-pick img { width: 100%; height: 100%; object-fit: cover; }
.selfie { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--tint); }

.face { position: fixed; z-index: 150; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.face-top { display: flex; justify-content: flex-end; padding: calc(var(--safe-top) + 10px) 16px 0; }
.face-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 24px calc(var(--safe-bottom) + 32px);
  overflow-y: auto;
  text-align: center;
}
.face-body h2 { margin: 6px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.face-body p { margin: 0; color: var(--label-2); font-size: 16px; line-height: 1.4; }
.face-body p b { color: var(--label); }
.face-body .btn { display: grid; place-items: center; margin-top: 4px; cursor: pointer; }
.face-body .fine { margin-top: 6px; font-size: 13px; }
.face-hero { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint); }
.face-hero svg { width: 54px; height: 54px; }
.face-hero .spin { position: static; width: 36px; height: 36px; margin: 0; border-width: 3px; border-color: color-mix(in srgb, var(--tint) 25%, transparent); border-top-color: var(--tint); }
.cam { position: relative; width: min(78vw, 340px); aspect-ratio: 3 / 4; overflow: hidden; border-radius: 28px; background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-ring { position: absolute; inset: 14% 15% 22%; border: 3px solid rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.shutter { width: 74px; height: 74px; margin-top: 6px; border-radius: 50%; background: var(--label); box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--label); }
/* Input de arquivo escondido dentro do botão (não usar display: none: o iPhone às vezes ignora o toque). */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn, .face-btn, .cam-alt { position: relative; }
.cam-alt { margin-top: 8px; color: var(--tint); font-size: 14px; font-weight: 500; cursor: pointer; }
/* Aviso de que a foto não fica guardada (telas da selfie). */
.privacy { display: flex; align-items: flex-start; gap: 10px; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 14px; background: var(--box); text-align: left; }
.privacy svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--tint); }
.face-body .privacy p { font-size: 13px; line-height: 1.4; }

/* ---------- Controles flutuantes ---------- */

.tabbar {
  position: fixed;
  z-index: 30;
  left: 16px;
  right: 16px;
  bottom: var(--bar-bottom);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tabbar > * { pointer-events: auto; }
.tabs { display: flex; padding: 4px; border-radius: 999px; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 96px;
  height: 54px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}
.tab svg { width: 25px; height: 25px; }
.tab.on { background: var(--pressed); color: var(--tint); }
.tab.theme { width: 62px; height: 62px; margin-left: 10px; border-radius: 50%; }

.selbar {
  position: fixed;
  z-index: 31;
  left: calc(var(--side-w) + 16px);
  right: 16px;
  bottom: var(--bar-bottom);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.selecting .selbar { display: flex; }
.selecting .tabbar { display: none; }
.selbar > i { width: 50px; }
.selbar > span { display: grid; place-items: center; height: 50px; padding: 0 20px; border-radius: 25px; font-size: 15px; font-weight: 600; }

/* ---------- Barra lateral (computador) ---------- */

.sidebar { display: none; }
.brand { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px 18px; font-size: 22px; }
.brand b { font-weight: 800; letter-spacing: 0.02em; }
.brand span { color: var(--label-2); }
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.nav span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav svg { width: 19px; height: 19px; color: var(--tint); }
.nav img { flex: none; width: 22px; height: 22px; border-radius: 5px; object-fit: cover; background: var(--tile); }
button.nav { width: 100%; text-align: left; }
.nav:hover { background: var(--fill); }
.nav.on { background: var(--pressed); }
.nav-h { display: block; margin: 18px 10px 4px; color: var(--label-2); font-size: 12px; font-weight: 700; }
.side-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px; border-radius: 10px; text-align: left; }
.side-foot:hover { background: var(--fill); }
.side-foot .avatar { width: 32px; height: 32px; font-size: 9px; box-shadow: none; }
.side-foot b { display: block; font-size: 13px; }
.side-foot small { display: block; color: var(--label-2); font-size: 12px; }

/* ---------- Visualizador ---------- */

.viewer { position: fixed; z-index: 100; inset: 0; background: var(--bg); transition: background-color 0.25s; }
.viewer.immersive { background: #000; }
.track {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.slide img { max-width: 100%; max-height: 100%; }
.spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2.5px solid var(--label-3);
  border-top-color: var(--label-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.slide img.ok ~ .spin { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  transform: translate(-50%, -50%);
}
.play svg { width: 30px; height: 30px; margin-left: 4px; }
.v-top {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 0;
  transition: opacity 0.2s;
}
.v-title { flex: 1; min-width: 0; text-align: center; }
.v-title b { display: block; font-size: 16px; font-weight: 600; }
.v-title span { display: block; color: var(--label-2); font-size: 13px; }
.v-bottom {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: var(--bar-bottom);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.2s;
}
.v-mid { display: flex; gap: 4px; padding: 4px; border-radius: 999px; }
.v-mid button { display: grid; place-items: center; width: 48px; height: 42px; border-radius: 999px; }
.v-arrow { display: none; }
.immersive .v-top, .immersive .v-bottom, .immersive .v-arrow { opacity: 0; pointer-events: none; }

/* ---------- Folhas (sheets) e avisos ---------- */

.sheet-bg {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.2s;
}
.sheet-bg.open { opacity: 1; }
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 8px 20px calc(var(--safe-bottom) + 20px);
  border-radius: 28px 28px 0 0;
  background: var(--sheet);
  transform: translateY(24px);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-bg.open .sheet { transform: none; }
.grab { width: 36px; height: 5px; margin: 0 auto 16px; border-radius: 3px; background: var(--label-3); }
.sheet h3 { margin: 0; font-size: 20px; font-weight: 700; }
.sheet > p { margin: 4px 0 0; font-size: 15px; }
.muted { color: var(--label-2); }
.facts { margin: 18px 0 16px; padding: 0 14px; border-radius: 14px; background: var(--box); }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 0.5px solid var(--sep); font-size: 15px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--label-2); }
.facts dd { margin: 0; text-align: right; }
.menu { margin: 16px 0 6px; overflow: hidden; border-radius: 14px; background: var(--box); }
.menu > * {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-bottom: 0.5px solid var(--sep);
  font-size: 17px;
  text-align: left;
}
.menu > :last-child { border-bottom: 0; }
.menu svg { color: var(--tint); }
.menu small { display: block; color: var(--label-2); font-size: 13px; }
.btn { display: block; width: 100%; height: 50px; margin-top: 10px; border-radius: 14px; background: var(--box); font-size: 17px; font-weight: 600; }
.btn.primary { background: var(--tint); color: #fff; }
.acct { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar.big { width: 56px; height: 56px; font-size: 15px; }
.acct b { display: block; font-size: 19px; }
.acct small { color: var(--label-2); font-size: 15px; }

.toast {
  position: fixed;
  z-index: 300;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  max-width: calc(100% - 32px);
  overflow: hidden;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -20px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Telas maiores ---------- */

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .album-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 700px) {
  .sheet-bg { align-items: center; }
  .sheet { padding-bottom: 20px; border-radius: 24px; }
}

@media (min-width: 700px) and (hover: hover) {
  .v-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    margin-top: -22px;
    width: 44px;
    height: 44px;
    transition: opacity 0.2s;
  }
  .v-arrow.prev { left: 16px; }
  .v-arrow.next { right: 16px; }
  .slide { padding: 70px 76px 90px; }
}

@media (min-width: 1000px) {
  :root { --side-w: 248px; }
  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--side-w);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    padding: 18px 10px 12px;
    border-right: 0.5px solid var(--sep);
    background: var(--sidebar);
  }
  .tabbar { display: none; }
  .selbar { bottom: 24px; }
  .view { padding-bottom: 110px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 0 2px; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Abertura (logo → saída em pixel sort) ---------- */

.splash {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  /* Segurança: se algo falhar no carregamento, a abertura some sozinha depois de 10 s. */
  animation: splash-failsafe 0s 10s forwards;
}
@keyframes splash-failsafe { to { visibility: hidden; } }
.splash-logo { width: clamp(150px, 44vw, 240px); color: #fff; }
.splash-logo svg { display: block; width: 100%; height: auto; }
/* O efeito é desenhado num canvas pequeno e ampliado sem suavizar: cada pixel vira um bloquinho. */
.splash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }

/* ---------- Onde procurar (busca por rosto) ---------- */

.scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 32px;
  margin-top: 8px;
  padding: 0 10px 0 12px;
  border-radius: 16px;
  background: var(--fill);
  color: var(--label-2);
  font-size: 14px;
  white-space: nowrap;
}
.scope-pill b { overflow: hidden; color: var(--label); font-weight: 600; text-overflow: ellipsis; }
.scope-pill svg { flex: none; width: 14px; height: 14px; transform: rotate(90deg); }
.face-body .scope-pill { margin-top: 0; }
.scope-list label { cursor: pointer; }
.scope-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-list em { color: var(--label-2); font-size: 15px; font-style: normal; }
.tick {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--label-3);
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.tick:checked {
  border-color: var(--tint);
  background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.btn:disabled { opacity: 0.4; }
.face-actions.center { display: flex; justify-content: center; }
.face-actions.center .btn { width: auto; padding: 0 22px; }

/* ---------- Selo "Novo" e baixar muitas (folha em lotes) ---------- */

.cover { position: relative; }
.new {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--tint);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.new-dot { flex: none; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--tint); }
.face-actions:has(.alt) { display: flex; flex-wrap: wrap; gap: 8px; }
.face-btn.alt { background: var(--fill); color: var(--tint); }
.batch-bar { height: 6px; margin: 16px 0 8px; overflow: hidden; border-radius: 3px; background: var(--fill); }
.batch-bar span { display: block; width: 0; height: 100%; background: var(--tint); transition: width 0.3s; }
.batch-status { min-height: 20px; font-size: 14px; }

/* Vídeo tocando no visualizador */
.slide video { max-width: 100%; max-height: 100%; background: #000; }
.slide.playing img, .slide.playing .play, .slide.playing .spin { display: none; }
