/* Momentos — visual v0.4: claro, neutro, azul, abas inferiores */
:root {
  --bg: #F3F5F9;
  --card: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #475569;
  --muted: #94A3B8;
  --line: #E5E9F0;
  --fill: #EEF1F6;
  --accent: #2563EB;
  --accent-2: #1D4ED8;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8EFFE;
  --ok: #16A34A;
  --warn: #D97706;
  --danger: #DC2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .18);
  --radius: 20px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: calc(64px + var(--safe-bottom));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0F17;
    --card: #151B26;
    --ink: #F1F5F9;
    --ink-2: #B4C0D0;
    --muted: #6B7A90;
    --line: #232C3A;
    --fill: #1C2431;
    --accent: #4F8BFF;
    --accent-2: #3B76F0;
    --accent-soft: #17264A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh; overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
svg { flex: none; }
.hidden { display: none !important; }

#app { max-width: 640px; margin: 0 auto; padding-bottom: calc(var(--tabbar) + 24px); }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.topbar h1 { font: 700 20px/1.2 var(--sans); margin: 0; flex: 1; text-align: center; letter-spacing: -.01em; }
.topbar .sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.topbar.big { padding-top: calc(14px + var(--safe-top)); }
.topbar.big h1 { font-size: 30px; text-align: left; padding-left: 8px; letter-spacing: -.02em; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none;
}
.icon-btn:active { background: var(--fill); }
.icon-btn svg { width: 22px; height: 22px; }
.spacer40 { width: 40px; flex: none; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px;
  transition: transform .1s ease, opacity .2s, background .2s;
}
.btn:active { transform: scale(.98); background: var(--accent-2); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, .textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.code-input { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }

/* ---------- entrada ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(40px + var(--safe-top)) 24px calc(28px + var(--safe-bottom)); }
.welcome .mark { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 24px; box-shadow: var(--shadow); }
.welcome h1 { font: 800 34px/1.1 var(--sans); letter-spacing: -.03em; margin: 0 0 12px; }
.welcome h1 em { font-style: normal; color: var(--accent); }
.welcome p.lead { color: var(--ink-2); font-size: 17px; margin: 0 0 28px; max-width: 34ch; }
.welcome .perks { display: grid; gap: 10px; margin: 0 0 28px; padding: 0; list-style: none; }
.welcome .perks li { display: flex; gap: 12px; align-items: center; font-size: 15px; color: var(--ink-2); }
.welcome .perks .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.welcome .perks .ic svg { width: 20px; height: 20px; }
.welcome form { margin-top: auto; }
.switch-link { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 14px 0; width: 100%; font-size: 15px; }

/* ---------- lista de álbuns ---------- */
.trips { padding: 4px 16px 0; display: grid; gap: 16px; }
.trip-card {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card);
  box-shadow: var(--shadow); color: inherit; display: block; aspect-ratio: 16 / 11;
}
.trip-card img { width: 100%; height: 100%; object-fit: cover; }
.trip-card .placeholder { width: 100%; height: 100%; }
.trip-card .info {
  position: absolute; inset: auto 0 0 0; padding: 56px 18px 16px; color: #fff;
  background: linear-gradient(to top, rgba(2, 6, 23, .78), rgba(2, 6, 23, 0));
}
.trip-card h2 { font: 700 22px/1.2 var(--sans); margin: 0 0 4px; letter-spacing: -.01em; }
.trip-card .meta { font-size: 14px; opacity: .9; }
.kind-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  background: rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.kind-chip svg { width: 14px; height: 14px; }
.kind-chip.on-card { position: absolute; top: 12px; left: 12px; background: rgba(2, 6, 23, .45); }
.kind-chip.light { background: var(--accent-soft); color: var(--accent); backdrop-filter: none; }

/* capa sem foto: degradê por tipo */
.ph-viagem { background: linear-gradient(160deg, #FDBA74 0%, #F472B6 45%, #6366F1 100%); }
.ph-festa { background: linear-gradient(160deg, #F0ABFC 0%, #A78BFA 45%, #3B82F6 100%); }
.ph-encontro { background: linear-gradient(160deg, #6EE7B7 0%, #38BDF8 50%, #6366F1 100%); }

.empty { text-align: center; padding: 48px 28px; color: var(--ink-2); }
.empty h2 { font: 700 22px/1.25 var(--sans); color: var(--ink); margin: 0 0 8px; }
.empty p { margin: 0 0 22px; }
.empty .actions { display: grid; gap: 10px; max-width: 340px; margin: 0 auto; }
.empty .art { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .art svg { width: 36px; height: 36px; }

/* ---------- INÍCIO do álbum ---------- */
.cover {
  position: relative; height: min(58dvh, 520px); min-height: 400px; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.cover > img, .cover > .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 6, 23, .35) 0%, rgba(2, 6, 23, 0) 28%, rgba(2, 6, 23, 0) 45%, rgba(2, 6, 23, .7) 100%); }
.cover .top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: calc(8px + var(--safe-top)) 10px 0; z-index: 2; }
.cover .top .icon-btn { color: #fff; background: rgba(2, 6, 23, .25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cover .text { position: relative; z-index: 1; padding: 0 22px 22px; }
.cover h1 { font: 500 44px/1.02 var(--serif); letter-spacing: -.02em; margin: 10px 0 8px; text-shadow: 0 2px 20px rgba(0, 0, 0, .25); }
.cover .sub { font-size: 17px; opacity: .95; margin: 0 0 6px; }
.cover .dates { font-size: 14px; opacity: .85; }
.count-card {
  position: relative; z-index: 1; margin: 0 16px 16px; padding: 14px 18px; border-radius: 18px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.count-card .l { flex: 1; }
.count-card .k { font-size: 13px; opacity: .85; }
.count-card .v { font: 700 26px/1.1 var(--sans); letter-spacing: -.02em; }
.count-card svg { width: 28px; height: 28px; opacity: .9; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 16px 4px; }
.quick button {
  display: grid; justify-items: center; gap: 6px; padding: 14px 4px 12px; border-radius: 16px; border: 0; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-size: 13px; font-weight: 600;
}
.quick button svg { width: 24px; height: 24px; color: var(--accent); }
.quick button:active { transform: scale(.97); }

.section { padding: 22px 16px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 12px; }
.section-head h2 { font: 700 19px/1.2 var(--sans); margin: 0; letter-spacing: -.01em; }
.section-head a, .section-head button { font-size: 14px; font-weight: 600; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 30%; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.strip::-webkit-scrollbar { display: none; }
.strip .tile { border-radius: 14px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; }
.stat .v { font: 700 24px/1.1 var(--sans); }
.stat .k { font-size: 13px; color: var(--muted); }

/* ---------- avisos ---------- */
.banner { margin: 8px 16px 14px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); color: var(--ink); display: flex; gap: 12px; align-items: center; font-size: 14px; }
.banner > div { flex: 1; }
.banner.soft { background: var(--card); box-shadow: var(--shadow); margin-top: 20px; }
.notice { margin: 14px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--ink-2); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.notice svg { width: 18px; height: 18px; color: var(--accent); }
.sheet-lead { color: var(--ink-2); margin: -8px 0 18px; font-size: 15px; }
.fine { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.note { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); background: var(--fill); padding: 10px 12px; border-radius: 12px; }
.note svg { width: 16px; height: 16px; }

/* ---------- fila ---------- */
.queue-bar { margin: 14px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; font-size: 14px; }
.queue-bar .txt { flex: 1; color: var(--ink-2); }
.queue-bar strong { color: var(--ink); }
.queue-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex: none; }
.queue-bar.busy .dot { background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- DIÁRIO ---------- */
.timeline { padding: 4px 16px 0; }
.day { margin-top: 18px; }
.day-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.day-head .n { font: 700 13px/1 var(--sans); color: #fff; background: var(--accent); padding: 6px 10px; border-radius: 8px; }
.day-head .d { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.moment { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.moment .body { padding: 14px 16px 12px; }
.moment .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--fill); color: var(--ink-2); }
.pill svg { width: 15px; height: 15px; color: var(--accent); }
.moment .caption { font-size: 16px; line-height: 1.55; margin: 0 0 10px; white-space: pre-wrap; word-wrap: break-word; }
.moment .foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.moment .foot .spacer { flex: 1; }
.moment .foot .icon-btn { width: 32px; height: 32px; color: var(--muted); }
.mini-av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--accent); color: #fff; }

.grid { display: grid; gap: 3px; padding: 3px; }
.grid.n1 { grid-template-columns: 1fr; }
.grid.n2 { grid-template-columns: 1fr 1fr; }
.grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.grid.n3 .tile:first-child { grid-row: span 2; aspect-ratio: auto; }
.grid.n4 { grid-template-columns: 1fr 1fr; }
.grid .tile { border-radius: 12px; }
.grid.n1 .tile { aspect-ratio: auto; max-height: 520px; }
.grid.n1 .tile img, .grid.n1 .tile video { height: auto; max-height: 520px; }

.tile { position: relative; background: var(--fill); overflow: hidden; cursor: pointer; border: 0; padding: 0; aspect-ratio: 1; display: block; width: 100%; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2, 6, 23, .5); color: #fff; font: 700 26px var(--sans); }
.tile .badge { position: absolute; left: 8px; bottom: 8px; background: rgba(2, 6, 23, .6); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.tile .nopreview { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; font-size: 12px; color: var(--muted); }

/* ---------- FOTOS ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--card); box-shadow: var(--shadow); color: var(--ink-2); border-radius: 99px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip.on { background: var(--accent); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, .8); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; }
.gallery .tile { border-radius: 6px; }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(4, 1fr); } }

/* ---------- progresso de envio sobre a foto ---------- */
.tile .up { position: absolute; inset: 0; pointer-events: none; transition: background .3s; }
.tile .up.queued, .tile .up.preparing, .tile .up.uploading { background: rgba(2, 6, 23, .25); }
.tile .up .bar { position: absolute; left: 12%; right: 12%; bottom: 10px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.tile .up .bar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: #fff; border-radius: 3px; transition: width .25s; }
.tile .up.preparing .bar::after, .tile .up.queued .bar::after { width: 30%; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.tile .up.done { background: transparent; }
.tile .up.done .bar { display: none; }
.tile .up.error { background: rgba(153, 27, 27, .55); display: grid; place-items: center; pointer-events: auto; }
.tile .up .err { color: #fff; }
.tile .up .err svg { width: 28px; height: 28px; }

/* ---------- MAIS / ajustes ---------- */
.list { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); margin: 0 16px 16px; overflow: hidden; }
.list .item { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item .t { font-weight: 600; }
.list .item .s { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.list .link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; color: var(--ink); font-size: 16px; }
.list .link:last-child { border-bottom: 0; }
.list .link .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.list .link .ic svg { width: 18px; height: 18px; }
.list .link .lbl { flex: 1; }
.list .link .val { color: var(--muted); font-size: 14px; }
.list .link .chev { color: var(--muted); width: 18px; height: 18px; }
.ic.blue { background: #3B82F6; } .ic.violet { background: #8B5CF6; } .ic.green { background: #10B981; }
.ic.orange { background: #F59E0B; } .ic.pink { background: #EC4899; } .ic.slate { background: #64748B; } .ic.red { background: #EF4444; }
.section-title { font: 700 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 20px 10px; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.radio:last-child { border-bottom: 0; }
.radio input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; }
.radio .t { font-weight: 600; } .radio .s { font-size: 14px; color: var(--ink-2); }
.code { font: 700 28px/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .14em; color: var(--accent); margin: 6px 0 4px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .nm { flex: 1; font-weight: 600; }
.person .nm small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--accent); color: #fff; flex: none; }

.switch-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; }
.switch-row > div { flex: 1; }
.switch-row .t { font-weight: 600; }
.switch-row .s { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- ABAS INFERIORES ---------- */
.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: var(--tabbar); padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  max-width: 640px; margin: 0 auto;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  border-top: 1px solid var(--line);
}
.tab { display: grid; justify-items: center; gap: 3px; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 600; padding: 6px 0; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
.tab-plus { justify-self: center; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; margin-top: -22px;
  background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(37, 99, 235, .45); }
.tab-plus svg { width: 26px; height: 26px; }
.tab-plus:active { transform: scale(.95); }
.tab-plus[disabled] { background: var(--muted); box-shadow: none; }

/* ---------- novo álbum: tipo ---------- */
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.kind { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; cursor: pointer; border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.kind svg { width: 24px; height: 24px; }
.kind.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.kind-desc { font-size: 14px; color: var(--ink-2); margin: 0 0 16px; min-height: 40px; }

/* ---------- convite ---------- */
.invite { min-height: 100dvh; display: flex; flex-direction: column; }
.invite-cover { height: 40dvh; min-height: 240px; position: relative; overflow: hidden; }
.invite-cover img, .invite-cover .ph { width: 100%; height: 100%; object-fit: cover; }
.invite-body { flex: 1; margin-top: -28px; position: relative; background: var(--bg); border-radius: 26px 26px 0 0; padding: 22px 20px calc(28px + var(--safe-bottom)); }
.invite-body h1 { font: 800 30px/1.1 var(--sans); letter-spacing: -.02em; margin: 10px 0 8px; }
.invite-body .meta { color: var(--ink-2); margin: 0 0 4px; font-size: 15px; }
.join-form { margin-top: 22px; }

/* ---------- folha (bottom sheet) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 23, .45); animation: fade .2s; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  max-height: 92dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(24px + var(--safe-bottom)); animation: up .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font: 700 22px/1.25 var(--sans); margin: 0 0 18px; padding-right: 40px; letter-spacing: -.01em; }
.sheet-close { position: absolute; top: 10px; right: 10px; color: var(--muted); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.picker .thumb, .picker .add { aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; background: var(--fill); }
.picker .thumb img, .picker .thumb video { width: 100%; height: 100%; object-fit: cover; }
.picker .thumb .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(2, 6, 23, .65); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.picker .add { border: 2px dashed var(--line); display: grid; place-items: center; cursor: pointer; color: var(--accent); background: var(--card); }
.picker .add svg { width: 26px; height: 26px; }
.picker.big { grid-template-columns: 1fr; }
.picker.big .add { aspect-ratio: 16 / 7; gap: 4px; align-content: center; font-size: 15px; font-weight: 600; }
.place-row { display: flex; gap: 8px; }
.place-row .input { flex: 1; }
.loc-btn { flex: none; width: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.loc-btn.on { color: var(--accent); border-color: var(--accent); }
.loc-btn svg { width: 22px; height: 22px; }

/* QR */
.qr-box { background: #fff; border-radius: 22px; padding: 22px; margin: 0 auto 16px; max-width: 300px; box-shadow: var(--shadow); text-align: center; }
.qr svg { width: 100%; height: auto; display: block; }
.qr-code { margin-top: 14px; font: 700 22px/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .16em; color: #0F172A; }
.qr-actions { display: grid; gap: 10px; }

/* ---------- visualizador ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; animation: fade .15s; touch-action: pan-y; }
.viewer .vtop, .viewer .vbottom { display: flex; align-items: center; gap: 6px; padding: 8px; color: #fff; }
.viewer .vtop { padding-top: calc(8px + var(--safe-top)); }
.viewer .vbottom { padding-bottom: calc(10px + var(--safe-bottom)); justify-content: center; flex-wrap: wrap; }
.viewer .icon-btn { color: #fff; }
.viewer .count { flex: 1; text-align: center; font-size: 14px; opacity: .8; }
.viewer .stage { flex: 1; display: grid; place-items: center; overflow: hidden; min-height: 0; }
.viewer .stage img, .viewer .stage video { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.viewer .vbtn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 99px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.viewer .vbtn svg { width: 18px; height: 18px; }
.viewer .vbtn.danger { color: #FCA5A5; }
.viewer .status { width: 100%; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .6); margin-bottom: 4px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; z-index: 100; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  bottom: calc(var(--tabbar) + 16px); max-width: calc(100% - 32px);
  background: #0F172A; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 500;
  box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

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