:root {
  --bg: #f1f3f6;          /* cinza claro */
  --surface: #ffffff;
  --navy: #1b2a4a;        /* azul-marinho */
  --navy-2: #2a3d66;
  --navy-soft: #e6eaf2;
  --orange: #f07f2f;      /* laranja dos botões e detalhes */
  --orange-dark: #d96a1c;
  --orange-soft: #fdeee2;
  --ink: #1f2937;
  --muted: #6b7488;
  --line: #e2e6ee;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(27, 42, 74, .06), 0 8px 24px rgba(27, 42, 74, .07);
  --title: var(--navy);   /* títulos e textos de destaque */
  --link: var(--orange-dark);
  --field: #fafbfc;       /* fundo dos campos */
  --field-focus: #fff;
  --header: var(--navy);
  color-scheme: light;
}

/* Tema escuro: azul-marinho profundo no fundo, laranja continua sendo o destaque.
   Vale quando a pessoa escolhe "Escuro", ou "Automático" com o aparelho no modo escuro. */
:root[data-theme="dark"] {
  --bg: #0e1524;
  --surface: #172036;
  --navy: #22345a;
  --navy-2: #2d4473;
  --navy-soft: #222e48;
  --orange-soft: rgba(240, 127, 47, .16);
  --ink: #e4e8f1;
  --muted: #98a2b8;
  --line: #2b3854;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --title: #f2f4f9;
  --link: #f7a468;
  --field: #111a2c;
  --field-focus: #0f1728;
  --header: #0a101d;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1524;
    --surface: #172036;
    --navy: #22345a;
    --navy-2: #2d4473;
    --navy-soft: #222e48;
    --orange-soft: rgba(240, 127, 47, .16);
    --ink: #e4e8f1;
    --muted: #98a2b8;
    --line: #2b3854;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
    --title: #f2f4f9;
    --link: #f7a468;
    --field: #111a2c;
    --field-focus: #0f1728;
    --header: #0a101d;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 "Nunito", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--title); line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
a { color: var(--link); }

/* Cabeçalho */
header { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--header); color: #fff; }
header h1 { margin: 0; font-size: 1.25rem; color: #fff; }
header h1 a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; display: block; }
#who { display: flex; align-items: center; gap: 12px; font-size: .95rem; }
#who a { color: #fff; opacity: .8; text-decoration: none; } #who a:hover { opacity: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 800; text-transform: uppercase; }

main { max-width: 920px; margin: 0 auto; padding: 28px 16px 80px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }

/* Formulários e botões */
label { font-size: .9rem; font-weight: 700; color: var(--title); }
input, textarea, select { font: inherit; width: 100%; margin: 6px 0 14px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); background: var(--field-focus); }
input[type=file] { padding: 10px; background: var(--navy-soft); border-style: dashed; cursor: pointer; }
button { font: inherit; font-weight: 700; padding: 11px 20px; border-radius: 999px; border: none; cursor: pointer; background: var(--orange); color: #fff; transition: background .15s, transform .1s; }
button:hover { background: var(--orange-dark); } button:active { transform: scale(.98); }
button.ghost { background: transparent; color: var(--title); border: 1.5px solid var(--line); }
button.ghost:hover { border-color: var(--title); background: var(--navy-soft); }
button.small { padding: 6px 14px; font-size: .85rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: .92rem; }
.error { color: #c0392b; font-weight: 600; }

/* Login */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 860px; margin: 40px auto; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.auth-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 48px 40px; position: relative; overflow: hidden; }
.auth-hero h2 { color: #fff; font-size: 2rem; margin: 0 0 12px; }
.auth-hero p { opacity: .85; margin: 0; }
.auth-hero::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--orange); opacity: .9; }
.auth-hero .examples { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.auth-hero .examples span { background: rgba(255,255,255,.12); padding: 6px 12px; border-radius: 999px; font-size: .88rem; }
.auth-form { padding: 44px 36px; }
.auth-form h2 { margin-top: 0; }

/* Início */
.hello { margin: 0 0 4px; font-size: 1.7rem; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 32px 0 14px; }
.section-title h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.trail-card { display: block; color: inherit; text-decoration: none; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.trail-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(27,42,74,.08), 0 14px 32px rgba(27,42,74,.12); }
.cover { height: 140px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%) center/cover no-repeat; display: grid; place-items: center; color: #fff; font-size: 2.6rem; font-weight: 800; position: relative; }
.cover .badge { position: absolute; top: 12px; left: 12px; }
.trail-body { padding: 16px 18px 18px; }
.trail-body b { color: var(--title); font-size: 1.08rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--navy); }
.badge.shared { background: var(--orange); color: #fff; }
.new-trail { border: 2px dashed var(--line); box-shadow: none; background: transparent; }

/* Relembrar */
.rewind { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; }
.rewind h2 { color: #fff; margin-top: 0; display: flex; align-items: center; gap: 10px; }
.rewind h2::before { content: "✦"; color: var(--orange); }
.rewind a { color: #ffb782; }
.rewind-item { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.12); }
.rewind-item:first-of-type { border-top: none; padding-top: 0; }
.rewind-item small { display: block; color: #ffb782; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; }

/* Trilha */
.trail-head { position: relative; overflow: hidden; }
.trail-head::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--orange); }
.trail-head h2 { margin: 0 0 6px; font-size: 1.8rem; }
details summary { cursor: pointer; font-weight: 700; color: var(--title); margin-top: 8px; }
details ul { list-style: none; padding: 0; } details li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }

.tag { display: inline-block; background: var(--orange-soft); color: var(--link); border-radius: 999px; padding: 2px 12px; font-size: .85rem; font-weight: 700; margin: 2px 6px 2px 0; cursor: pointer; transition: background .15s; }
.tag:hover { background: #fbdcc4; }

.timeline { position: relative; margin-left: 10px; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px; background: var(--navy-soft); }
.year { position: relative; display: inline-block; margin: 26px 0 12px -48px; padding: 4px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 800; font-size: .9rem; }
.memory { position: relative; }
.memory::before { content: ""; position: absolute; left: -38px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--orange); }
.memory .date { font-size: .82rem; font-weight: 800; color: var(--link); text-transform: uppercase; letter-spacing: .04em; }
.memory h3 { margin: 2px 0 6px; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.media img, .media video { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; display: block; background: var(--navy-soft); }
.media .file { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--navy-soft); color: var(--title); text-decoration: none; font-weight: 600; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

@media (max-width: 680px) {
  .auth { grid-template-columns: 1fr; margin: 0 auto; }
  .auth-hero { padding: 32px 24px; } .auth-hero h2 { font-size: 1.6rem; }
  .auth-form { padding: 28px 24px; }
  header { padding: 12px 16px; }
  #who .name { display: none; }
}

/* Sino de notificações */
.bell-wrap { position: relative; }
.bell { position: relative; background: transparent; color: #fff; padding: 6px; border-radius: 50%; display: grid; place-items: center; }
.bell:hover { background: rgba(255,255,255,.12); }
.bell-badge { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--orange); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--navy); }
.bell-badge[hidden] { display: none; }
.bell-panel { position: absolute; right: -60px; top: 46px; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: 0 12px 40px rgba(27,42,74,.25); z-index: 20; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--title); position: sticky; top: 0; background: var(--surface); }
button.link { background: none; color: var(--link); padding: 0; font-size: .85rem; font-weight: 700; }
button.link:hover { background: none; text-decoration: underline; }
.notif { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); font-size: .93rem; line-height: 1.4; }
.notif:hover { background: var(--bg); }
.notif.unread { background: var(--orange-soft); }
.notif.unread b { color: var(--title); }
.notif-icon { font-size: 1.3rem; }
a.avatar { text-decoration: none; opacity: 1 !important; }

/* Lembretes e preferências */
.reminder-box { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin-top: 4px; }
.reminder-box select { max-width: 340px; }
label.check { display: flex; align-items: center; gap: 10px; margin-top: 8px; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--orange); }
@media (max-width: 680px) {
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
}

/* Pop-up de revelação da memória */
.reveal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(27, 42, 74, 0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); transition: background .4s, backdrop-filter .4s, -webkit-backdrop-filter .4s; }
.reveal-backdrop.open { background: rgba(27, 42, 74, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.reveal-backdrop.closing { opacity: 0; transition: opacity .25s; }
.reveal-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); opacity: 0; transform: translateY(24px) scale(.94); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .9, .3, 1.2); }
.reveal-backdrop.open .reveal-card { opacity: 1; transform: none; }
.reveal-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--navy); font-size: 1rem; }
.reveal-close:hover { background: #fff; }
.reveal-kicker { position: absolute; top: 16px; left: 16px; z-index: 3; background: var(--orange); color: #fff; font-weight: 800; font-size: .85rem; padding: 6px 14px; border-radius: 999px; box-shadow: 0 4px 14px rgba(240,127,47,.4); }
.reveal-stage { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--navy); cursor: pointer; }
.reveal-stage img, .reveal-stage video, .reveal-placeholder { width: 100%; height: 100%; object-fit: cover; display: block; filter: blur(28px) saturate(1.3); transform: scale(1.15); transition: filter 1.6s ease, transform 1.8s cubic-bezier(.2, .8, .2, 1); }
.reveal-placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2) 60%, var(--orange)); }
.reveal-placeholder span { color: #fff; font-size: 4.5rem; font-weight: 800; letter-spacing: .02em; }
.reveal-veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.05rem; text-shadow: 0 2px 12px rgba(0,0,0,.4); transition: opacity .6s; }
.reveal-veil span { font-size: 2.4rem; color: #ffb782; animation: pulse 1.2s ease-in-out infinite; }
.reveal-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.revealed .reveal-stage img, .revealed .reveal-stage video, .revealed .reveal-placeholder { filter: none; transform: none; }
.revealed .reveal-veil { opacity: 0; pointer-events: none; }
.revealed .reveal-stage::after { animation: shine 1.2s ease .2s; }
.reveal-body { padding: 22px 24px 24px; }
.reveal-body > * { opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.revealed .reveal-body > * { opacity: 1; transform: none; }
.revealed .reveal-body > :nth-child(2) { transition-delay: .5s; }
.revealed .reveal-body > :nth-child(1) { transition-delay: .4s; }
.revealed .reveal-body > :nth-child(n+3) { transition-delay: .65s; }
.reveal-body h2 { margin: 4px 0 8px; font-size: 1.6rem; }
.reveal-body .date { font-size: .82rem; font-weight: 800; color: var(--link); text-transform: uppercase; letter-spacing: .04em; }
a.btn { display: inline-block; font-weight: 700; padding: 11px 20px; border-radius: 999px; background: var(--orange); color: #fff; text-decoration: none; }
a.btn:hover { background: var(--orange-dark); }
@keyframes pulse { 50% { transform: scale(1.25); opacity: .7; } }
@keyframes shine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) {
  .reveal-card, .reveal-stage img, .reveal-stage video, .reveal-placeholder, .reveal-body > * { transition-duration: .01s !important; }
  .revealed .reveal-stage::after, .reveal-veil span { animation: none; }
}

/* Áudio: botão de som, notas de voz e gravador */
.sound-toggle { position: absolute; right: 14px; bottom: 14px; z-index: 3; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(27, 42, 74, .72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.sound-toggle:hover { background: var(--navy); }
.sound-toggle.on { background: var(--orange); }
.voice-note { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: var(--navy-soft); }
.voice-icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--orange); font-size: 1.1rem; }
.voice-note audio, .audio-card audio, .recorder audio { width: 100%; height: 40px; }
.audio-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--navy-soft); grid-column: 1 / -1; }
.audio-card > div { flex: 1; min-width: 0; } .audio-card small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recorder { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--line); }
.recorder .row { width: 100%; flex-wrap: nowrap; } .recorder audio { flex: 1; }
#rec-btn.recording { background: #c0392b; color: #fff; border-color: #c0392b; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c0392b; animation: pulse 1s ease-in-out infinite; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- Pop-up da memória sem revelação + edição ---------- */
.reveal-backdrop.no-reveal .reveal-stage img, .reveal-backdrop.no-reveal .reveal-stage video { filter: none; transform: none; }
.reveal-backdrop.no-reveal .reveal-stage::after { display: none; }
.reveal-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: rgba(27, 42, 74, .55); color: #fff; font-size: 16px; line-height: 36px; }
.reveal-close:hover { background: var(--navy); }
.reveal-card { position: relative; }
.edit-form label { display: block; margin-bottom: 12px; }
.edit-form input, .edit-form textarea { width: 100%; }
.card.memory[data-open] { cursor: pointer; transition: box-shadow .2s, transform .2s; }
.card.memory[data-open]:hover { box-shadow: 0 10px 28px rgba(27, 42, 74, .12); transform: translateY(-1px); }
.card.memory[data-open]:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.card-actions { gap: 6px; flex-wrap: nowrap; }
.switch-mode { margin-top: 14px; }
a.btn.ghost { background: transparent; color: var(--title); border: 1.5px solid var(--line); }
a.btn.ghost:hover { border-color: var(--title); background: var(--navy-soft); }
a.btn.small { padding: 6px 14px; font-size: 14px; }
.section-title .frame-link { margin-left: auto; }

/* ---------- Porta-retrato ---------- */
body.frame-mode { background: #000; overflow: hidden; }
body.frame-mode header { display: none; }
body.frame-mode main { padding: 0; max-width: none; margin: 0; }
.frame { position: fixed; inset: 0; background: #000; color: #fff; overflow: hidden; cursor: none; }
.frame.show-ui { cursor: default; }
.frame-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s ease; }
.frame-slide.active { opacity: 1; }
.frame-slide img, .frame-slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.frame-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.55); }
.frame-slide.kenburns.active img { animation: kenburns 20s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }
.frame-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 32px 26px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.frame-caption small { font-size: 15px; opacity: .85; }
.frame-caption b { font-size: clamp(20px, 3vw, 34px); font-weight: 800; }
.frame-clock { position: absolute; top: 20px; right: 28px; font-size: clamp(20px, 2.6vw, 32px); font-weight: 700; opacity: .8; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.frame-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 18px; }
.frame-controls { position: absolute; top: 16px; left: 16px; display: flex; gap: 8px; align-items: center; opacity: 0; transition: opacity .3s; pointer-events: none; }
.frame.show-ui .frame-controls { opacity: 1; pointer-events: auto; }
.frame-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; text-decoration: none; border: 0; backdrop-filter: blur(6px); }
.frame-btn:hover { background: rgba(255, 255, 255, .3); }
.frame-btn.on { background: var(--orange); }
.frame-controls select { width: auto; height: 44px; border-radius: 22px; background: rgba(255, 255, 255, .16); color: #fff; border: 0; padding: 0 12px; }
.frame-controls select option { color: #000; }

/* ---------- Aparência (preferências) ---------- */
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 4px; }
.theme-option { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.theme-option:hover { border-color: var(--muted); }
.theme-option:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-preview { height: 74px; border-radius: 10px; overflow: hidden; display: grid; grid-template-rows: 16px 1fr; }
.theme-preview i { display: block; }
.theme-preview .pv-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.theme-preview .pv-card { height: 14px; border-radius: 5px; }
.theme-preview .pv-btn { width: 42%; height: 10px; border-radius: 5px; background: #f07f2f; }
.pv-light { background: #f1f3f6; } .pv-light .pv-head { background: #1b2a4a; } .pv-light .pv-card { background: #fff; }
.pv-dark { background: #0e1524; } .pv-dark .pv-head { background: #0a101d; } .pv-dark .pv-card { background: #172036; }
.pv-system { background: linear-gradient(115deg, #f1f3f6 50%, #0e1524 50%); }
.pv-system .pv-head { background: linear-gradient(115deg, #1b2a4a 50%, #0a101d 50%); }
.pv-system .pv-card { background: linear-gradient(115deg, #fff 50%, #172036 50%); }
.theme-option span { font-weight: 700; color: var(--title); text-align: center; font-size: .92rem; }

/* ---------- Planos ---------- */
body.plans-mode main { max-width: 1240px; }
.plans-intro { text-align: center; margin: 4px 0 18px; }
.plans-intro h2 { font-size: 2rem; margin: 0 0 6px; }
.plan-quiz h3 { margin: 0 0 10px; font-size: 1.05rem; }
.plan-quiz h3 + .needs, .plan-quiz h3 + .space-options { margin-bottom: 18px; }
.needs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.need { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; color: var(--ink); transition: border-color .15s, background .15s; }
.need input { width: auto; margin: 4px 0 0; accent-color: var(--orange); }
.need:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.space-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.space-option { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; text-align: center; }
.space-option input { position: absolute; opacity: 0; pointer-events: none; }
.space-option small { color: var(--muted); font-weight: 600; }
.space-option:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.plan-rec { margin: 0; min-height: 1.5em; font-weight: 700; color: var(--title); }
.billing-toggle { display: flex; justify-content: center; gap: 4px; margin: 6px auto 8px; padding: 4px; width: fit-content; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); }
.billing-toggle label { position: relative; }
.billing-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.billing-toggle span { display: block; padding: 8px 18px; border-radius: 999px; cursor: pointer; color: var(--title); }
.billing-toggle em { font-style: normal; font-size: .8rem; color: var(--link); margin-left: 4px; }
.billing-toggle input:checked + span { background: var(--title); color: var(--surface); }
.billing-toggle input:checked + span em { color: var(--orange); }
.billing-toggle input:focus-visible + span { outline: 2px solid var(--orange); }
.plan-msg { text-align: center; min-height: 1.5em; margin: 6px 0; font-weight: 700; }
.plan-msg .ok { color: #1f9d55; }
.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 2px solid transparent; border-radius: var(--radius); padding: 22px 18px 18px; box-shadow: var(--shadow); }
.plan.current { border-color: var(--line); }
.plan.recommended { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft), var(--shadow); }
.plan h3 { margin: 0 0 8px; font-size: 1.25rem; }
.plan-badge { position: absolute; top: -11px; left: 18px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--navy); color: #fff; }
.plan-badge.rec { background: var(--orange); }
.plan-badge.cur { background: var(--muted); }
.plan-cost { display: flex; flex-direction: column; margin-bottom: 12px; min-height: 3.4em; }
.plan-price { font-size: 1.5rem; color: var(--title); }
.plan-price small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.plan-ideal-title { margin: 0 0 4px; font-size: .85rem; font-weight: 800; color: var(--link); text-transform: uppercase; letter-spacing: .03em; }
.plan ul { margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.plan li { position: relative; padding-left: 20px; margin-bottom: 5px; }
.plan-ideal li::before { content: "•"; position: absolute; left: 6px; color: var(--orange); font-weight: 800; }
.plan-ideal { padding-bottom: 12px !important; margin-bottom: 12px !important; border-bottom: 1px solid var(--line); }
.plan-features { flex: 1; margin-bottom: 16px !important; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: #1f9d55; font-weight: 800; }
.plan button { width: 100%; }
button:disabled, button:disabled:hover { background: var(--line); color: var(--muted); opacity: 1; cursor: default; transform: none; }
.plans-note { text-align: center; margin-top: 18px; }
.usage { display: flex; flex-direction: column; gap: 6px; }
.usage-row { display: flex; justify-content: space-between; font-size: .92rem; font-weight: 600; }
.meter { height: 10px; border-radius: 999px; background: var(--navy-soft); overflow: hidden; margin-bottom: 6px; }
.meter i { display: block; height: 100%; min-width: 4px; background: var(--orange); border-radius: inherit; }
.meter i.full { background: #d64545; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .plans { grid-template-columns: 1fr; }
  .space-options { grid-template-columns: repeat(2, 1fr); }
  .plans-intro h2 { font-size: 1.5rem; }
}
.invite-link { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.invite-link input { margin: 0; flex: 1; min-width: 0; }

/* ---------- Trilha de evento: link + QR Code ---------- */
.event-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.event-box h3 { margin: 0 0 6px; }
details.event-box summary { cursor: pointer; font-weight: 700; }
.event-share { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.event-share .qr { width: 148px; flex: none; background: #fff; padding: 6px; border-radius: 10px; }
.event-share .qr svg { display: block; width: 100%; height: auto; }
.event-actions { flex: 1; min-width: 220px; display: grid; gap: 10px; }
.event-actions input { font-size: .9rem; }
.event-box form { margin-top: 8px; }
.auth-hero h2, .auth-hero p { position: relative; z-index: 1; }
@media (max-width: 680px) { #who .name.guest { display: inline; } }
#nt label.check { margin-bottom: 12px; }

/* Excluir conta */
.danger-zone { border: 1.5px solid #e7b3ab; }
.danger-zone h2 { color: #c0392b; }
.danger-zone form { margin-top: 6px; }
button.danger { background: #c0392b; color: #fff; }
button.danger:hover { background: #a93226; }
button.ghost.danger { background: transparent; color: #c0392b; border-color: #e7b3ab; }
button.ghost.danger:hover { background: #fbecea; border-color: #c0392b; }
.delete-banner { box-sizing: border-box; width: calc(100% - 32px); max-width: 888px; margin: 16px auto 0; padding: 12px 16px; border-radius: 14px; background: #fdecea; color: #7b241c;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .95rem; }
.delete-banner + main { padding-top: 16px; }
.notice { background: #fdecea; color: #7b241c; border-radius: 12px; padding: 10px 14px; font-size: .92rem; }
:root[data-theme=dark] .delete-banner, :root[data-theme=dark] .notice { background: #3a1d1d; color: #f5c6c0; }
:root[data-theme=dark] .danger-zone { border-color: #6b2b2b; }
:root[data-theme=dark] button.ghost.danger:hover { background: #3a1d1d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .delete-banner, :root:not([data-theme=light]) .notice { background: #3a1d1d; color: #f5c6c0; }
  :root:not([data-theme=light]) .danger-zone { border-color: #6b2b2b; }
  :root:not([data-theme=light]) button.ghost.danger:hover { background: #3a1d1d; }
}

/* Busca global */
.search-btn { color: #fff; opacity: .85; padding: 6px; border-radius: 50%; display: grid; place-items: center; }
.search-btn:hover { opacity: 1; background: rgba(255,255,255,.12); }
.search-bar { display: flex; gap: 10px; align-items: center; margin: 4px 0 24px; flex-wrap: wrap; }
.search-bar input { flex: 1 1 260px; margin: 0; }
.search-bar a.btn { padding: 10px 16px; }
.search-head input[type=search] { font-size: 1.05rem; margin: 0; }
.tag-chips { margin-top: 12px; }
.search-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.calendar { position: sticky; top: 84px; padding: 18px; }
.cal-head { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.cal-head select { margin: 0; padding: 7px 8px; flex: 1; min-width: 0; }
.cal-head button { padding: 5px 11px; font-size: 1.1rem; line-height: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid > b { font-size: .75rem; color: var(--muted); padding-bottom: 2px; }
.cal-grid .day { position: relative; aspect-ratio: 1; padding: 0; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 600; font-size: .9rem; }
.cal-grid .day:hover { background: var(--navy-soft); }
.cal-grid .day.today { box-shadow: inset 0 0 0 1.5px var(--line); }
.cal-grid .day.has { background: var(--orange-soft); color: var(--link); font-weight: 800; }
.cal-grid .day.has i { position: absolute; right: 3px; top: 2px; font-style: normal; font-size: .62rem; line-height: 1; }
.cal-grid .day.sel { background: var(--orange); color: #fff; }
.cal-foot { font-size: .85rem; margin: 10px 0 0; }
.results-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 12px; }
.result { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 14px; margin-bottom: 12px; cursor: pointer; transition: transform .12s; }
.result:hover { transform: translateY(-1px); }
.result h3 { margin: 2px 0 4px; }
.result .thumb { width: 76px; height: 76px; border-radius: 12px; background: var(--navy-soft) center / cover; display: grid; place-items: center; font-size: 1.6rem; color: var(--muted); }
.search-hint { padding: 28px 20px; }
@media (max-width: 760px) {
  .search-layout { grid-template-columns: 1fr; }
  .calendar { position: static; }
  .search-bar a.btn { flex: 1; text-align: center; }
}

/* Compartilhar com quem tem conta */
.share-box summary { font-weight: 700; color: var(--title); cursor: pointer; margin: 14px 0 6px; }
.share-box .members { list-style: none; padding: 0; margin: 8px 0 14px; }
.share-box .members li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.avatar.mini { display: inline-grid; width: 24px; height: 24px; font-size: .75rem; margin-right: 8px; vertical-align: middle; }
.share-box label { font-weight: 700; color: var(--title); }
.lookup { font-size: .9rem; color: var(--muted); margin: -4px 0 10px; min-height: 1.4em; }
.lookup.found { color: #1f9d55; }
.lookup.missing { color: #c0392b; }
.notice-soft { background: var(--orange-soft); border-radius: 12px; padding: 10px 14px; font-size: .93rem; }

/* Excluídas recentemente */
.trash { border: 1.5px dashed var(--line); box-shadow: none; }
.trash h3 { margin: 0 0 4px; }
.trash ul { list-style: none; padding: 0; margin: 8px 0 0; }
.trash li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.purge-when { font-size: .88rem; color: var(--muted); }
.trash li.ending .purge-when { color: #c0392b; font-weight: 700; }
.trash .countdown { font-variant-numeric: tabular-nums; }

/* Aviso rápido (ex.: memória excluída + Desfazer) */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; gap: 16px; align-items: center; max-width: calc(100vw - 32px);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: translate(-50%, 20px); opacity: 0; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast button.link { color: #ffb782; font-size: .95rem; }

/* Seus dados: exportar e excluir conta */
.data-zone h3 { margin: 14px 0 6px; }
.data-zone .danger-block { margin-top: 22px; padding-top: 4px; border-top: 1.5px solid #e7b3ab; }
.data-zone .danger-block h3 { color: #c0392b; }
:root[data-theme=dark] .data-zone .danger-block { border-color: #6b2b2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .data-zone .danger-block { border-color: #6b2b2b; } }

/* Trilha travada (acima do limite do plano) */
.cover .badge.locked { left: auto; right: 12px; background: #c0392b; color: #fff; }

/* Gerenciar trilhas (pop-up) */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(27, 42, 74, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal { position: relative; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 22px; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal h2 { margin: 0 0 4px; padding-right: 40px; }
.modal .reveal-close { background: var(--navy-soft); color: var(--title); }
table.manage, table.admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.manage th, table.manage td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.manage th, table.admin-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
th.num, td.num { text-align: right !important; font-variant-numeric: tabular-nums; }
th.center, td.center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.pill { display: inline-block; margin-left: 6px; font-size: .74rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--navy-soft); color: var(--title); }
.pill.lock { background: #fdecea; color: #c0392b; }
.mini-meter { display: inline-block; width: 46px; height: 6px; border-radius: 99px; background: var(--line); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.mini-meter i { display: block; height: 100%; background: var(--orange); }
.mini-meter i.full { background: #c0392b; }
@media (max-width: 560px) { .mini-meter { display: none; } .modal { padding: 20px 14px; } }

/* Painel do administrador */
body.admin-mode main { max-width: 1320px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-head input { max-width: 340px; margin: 0; }
.table-wrap { padding: 6px 10px; overflow-x: auto; }
table.admin-table th { padding: 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.admin-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr.inactive td { color: var(--muted); }
button.sort { all: unset; cursor: pointer; display: block; padding: 12px 10px; font: inherit; font-weight: 800; color: inherit; width: 100%; box-sizing: border-box; }
th.num button.sort { text-align: right; } th.center button.sort { text-align: center; }
button.sort:hover, button.sort:focus-visible { color: var(--title); }
table.admin-table input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--orange); }
.status { display: inline-block; font-size: .8rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.status.on { background: #e3f6ea; color: #1f7a45; }
.status.off { background: #fdecea; color: #c0392b; }
:root[data-theme=dark] .status.on { background: #173a27; color: #8fe0b0; }
:root[data-theme=dark] .status.off, :root[data-theme=dark] .pill.lock { background: #3a1d1d; color: #f5c6c0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .status.on { background: #173a27; color: #8fe0b0; }
  :root:not([data-theme=light]) .status.off, :root:not([data-theme=light]) .pill.lock { background: #3a1d1d; color: #f5c6c0; }
}

/* Excluir trilha (dentro do Gerenciar) */
.del-trail { margin-top: 18px; padding: 16px; border: 1.5px solid #e7b3ab; border-radius: 16px; }
.del-trail h3 { margin: 0 0 6px; color: #c0392b; }
.del-trail p { font-size: .93rem; }
:root[data-theme=dark] .del-trail { border-color: #6b2b2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .del-trail { border-color: #6b2b2b; } }

/* ---------- Cápsula do tempo ---------- */
.capsule-hero { background: linear-gradient(135deg, var(--navy), var(--navy-2) 70%, #6b4a7a); color: #fff; }
.capsule-hero h2 { color: #fff; } .capsule-hero .muted { color: rgba(255,255,255,.82); }
#nc label { display: block; margin: 4px 0 12px; } #nc label input, #nc label textarea { margin-top: 6px; }
.capsule-warning { padding: 10px 14px; border-radius: 12px; font-size: .9rem; }
.capsule-list { display: grid; gap: 12px; margin-bottom: 24px; }
.capsule { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.capsule-info { flex: 1; min-width: 0; } .capsule-info b { color: var(--title); font-size: 1.05rem; }
.capsule-seal { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: var(--navy-soft); }
.capsule.sealed .capsule-seal { background: linear-gradient(135deg, var(--navy), var(--navy-2)); animation: sway 3s ease-in-out infinite; }
.capsule.opened .capsule-seal { background: var(--orange-soft); }
.capsule-countdown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.15rem; color: var(--link); margin: 2px 0; }
.capsule-letter { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.7; }
@keyframes sway { 50% { transform: rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .capsule.sealed .capsule-seal { animation: none; } }
@media (max-width: 560px) { .capsule { flex-wrap: wrap; } .capsule .card-actions, .capsule > button { margin-left: 68px; } }

/* ---------- Local da memória ---------- */
.place-field { position: relative; margin-bottom: 12px; }
.place-row { display: flex; gap: 8px; align-items: center; }
.place-row input { flex: 1; margin: 0; }
.place-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.18); max-height: 280px; overflow-y: auto; }
.place-results li.muted { padding: 8px 10px; }
.place-results button { display: block; width: 100%; text-align: left; background: none; color: var(--ink); font-weight: 600; padding: 9px 10px; border-radius: 10px; font-size: .92rem; }
.place-results button:hover, .place-results button:focus-visible { background: var(--navy-soft); }
.place { margin: 2px 0 6px; font-size: .9rem; font-weight: 700; }
.place a { text-decoration: none; } .place a:hover { text-decoration: underline; }

/* ---------- Retrospectiva ---------- */
.modal.retro { width: min(520px, 100%); }
.retro-progress { margin: 14px 0; }
.retro-result video { display: block; width: auto; max-width: 100%; max-height: 60vh; margin: 14px auto; border-radius: 16px; background: #000; aspect-ratio: 9 / 16; }
.card-actions a.btn.small { white-space: nowrap; }
.dl-menu { position: relative; display: inline-block; }
.dl-menu summary { list-style: none; cursor: pointer; display: inline-block; font-weight: 700; border-radius: 999px; color: var(--title); border: 1.5px solid var(--line); padding: 11px 20px; }
.dl-menu summary.small { padding: 6px 14px; font-size: 14px; }
.dl-menu summary::-webkit-details-marker { display: none; }
.dl-list { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); min-width: 220px; max-width: 320px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.dl-list a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-list a:hover { background: var(--navy-soft); }

/* ---------- Enviar arquivos: arrastar e soltar ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 14px; padding: 26px 16px; border: 2px dashed var(--line); border-radius: 16px; background: var(--navy-soft); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.dropzone:hover, .dropzone:focus-visible { outline: none; border-color: var(--orange); }
.dropzone.over { border-color: var(--orange); background: var(--orange-soft); transform: scale(1.01); }
.drop-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.dropzone.over .drop-icon { animation: pulse 1s ease-in-out infinite; }
.drop-title { font-weight: 800; color: var(--title); }
.drop-sub { font-size: .88rem; } .drop-sub u { color: var(--link); text-decoration-thickness: 2px; }
.drop-touch { display: none; }
/* No celular não tem arrastar: a área vira um botão simples de escolher (continua aceitando vários). */
@media (hover: none) {
  .drop-desktop { display: none; } .drop-touch { display: inline; }
  .dropzone { flex-direction: row; justify-content: center; gap: 10px; width: fit-content; padding: 10px 20px 10px 12px; white-space: nowrap; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; }
  .dropzone .drop-icon { width: 28px; height: 28px; font-size: 1rem; margin: 0; }
  .dropzone .drop-sub { display: none; }
  .dropzone .drop-title { font-size: .95rem; }
}
.drop-mode { margin: 0 0 12px; }
.drop-mode > .muted { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--navy-soft); }
.seg button { padding: 8px 16px; font-size: .9rem; background: transparent; color: var(--title); }
.seg button:hover { background: var(--surface); }
.seg button[aria-checked="true"] { background: var(--orange); color: #fff; box-shadow: 0 2px 8px rgba(240,127,47,.35); }
.drop-mode-hint { margin: 6px 0 0; font-size: .85rem; }
.drop-list.single:not(:empty) { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 0 0 14px; }
.drop-list .drop-item { position: relative; }
.drop-list.single .drop-item small { display: block; margin-top: 4px; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-thumb { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--navy-soft); display: grid; place-items: center; }
.drop-thumb img, .drop-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.drop-file-icon { font-size: 2rem; }
.drop-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border-radius: 50%; font-size: .8rem; line-height: 26px; background: rgba(27, 42, 74, .7); color: #fff; }
.drop-remove:hover { background: #c0392b; }
.drop-list.separate { display: flex; flex-direction: column; gap: 12px; margin: 0 0 14px; }
.drop-list.separate .drop-item { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px; border: 1.5px solid var(--line); border-radius: 16px; }
.drop-list.separate .drop-fields input, .drop-list.separate .drop-fields textarea { margin: 0 0 8px; }
.drop-list.separate .drop-fields small { font-size: .78rem; }
.drop-list.separate .drop-remove { top: 18px; left: 18px; right: auto; }
@media (max-width: 520px) { .drop-list.separate .drop-item { grid-template-columns: 84px 1fr; gap: 10px; } }

/* ---------- Carrossel: várias fotos/vídeos numa memória ---------- */
.carousel { position: relative; margin-top: 12px; border-radius: 14px; overflow: hidden; background: var(--navy); }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.carousel-slide > a { display: block; }
.carousel-slide img, .carousel-slide video { width: 100%; height: 360px; object-fit: cover; display: block; background: var(--navy); }
.carousel-slide video { object-fit: contain; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 1.6rem; line-height: 38px; background: rgba(255,255,255,.88); color: var(--navy); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.carousel-nav:hover { background: #fff; } .carousel-nav:active { transform: translateY(-50%) scale(.95); }
.carousel-nav.prev { left: 10px; } .carousel-nav.next { right: 10px; }
.carousel-count { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 10px; border-radius: 999px; background: rgba(27, 42, 74, .72); color: #fff; font-size: .78rem; font-weight: 800; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.carousel-dots button { pointer-events: auto; width: 8px; height: 8px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: width .2s, background .2s; }
.carousel-dots button.on { width: 22px; border-radius: 999px; background: #fff; }
.carousel + .media { margin-top: 10px; }
@media (max-width: 520px) { .carousel-slide img, .carousel-slide video { height: 260px; } .carousel-nav { display: none; } }
@media (hover: none) { .carousel-nav { display: none; } }
/* No pop-up, o carrossel ocupa o palco inteiro (e herda o efeito de revelar). */
.reveal-stage .carousel { position: absolute; inset: 0; margin: 0; border-radius: 0; }
.reveal-stage .carousel-track, .reveal-stage .carousel-slide { height: 100%; }
.reveal-stage .carousel-slide img, .reveal-stage .carousel-slide video { height: 100%; }
.reveal-stage .carousel-count { top: auto; bottom: 12px; right: auto; left: 14px; }
.reveal-stage .sound-toggle { z-index: 4; }

/* ---------- Mapa das memórias ---------- */
.map-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.map-filter { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--title); }
.map-filter select { width: auto; min-width: 200px; margin: 0; }
.map-canvas { height: min(68vh, 640px); padding: 0; overflow: hidden; position: relative; z-index: 0; }
.map-canvas .leaflet-container, .map-canvas.leaflet-container { font: inherit; background: var(--navy-soft); }
.map-pin-wrap { background: none; border: 0; }
.map-pin {
  width: 52px; height: 52px; border-radius: 50%; padding: 0; cursor: pointer; position: relative;
  border: 3px solid #fff; background: var(--navy-soft) center / cover; box-shadow: 0 2px 10px rgba(27, 42, 74, .35);
  transition: transform .12s;
}
.map-pin:hover, .map-pin:focus-visible { transform: scale(1.1); z-index: 1; }
.map-pin.no-photo { background: var(--orange); color: #fff; font-size: 1.3rem; display: grid; place-items: center; }
.map-pin i {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: var(--orange); color: #fff; font: 800 .75rem/22px Nunito, sans-serif; font-style: normal; border: 2px solid #fff;
}
#map-list { margin-top: 16px; }
.map-foot { margin-top: 12px; }
/* No tema escuro, escurece os mapas do OpenStreetMap. */
:root[data-theme="dark"] .map-canvas .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map-canvas .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
}
@media (max-width: 680px) {
  .map-filter { width: 100%; }
  .map-filter select { flex: 1; min-width: 0; }
  .map-canvas { height: 60vh; }
}
/* Cabeçalho no celular: com busca, mapa, cápsulas e sino, aperta o espaço para caber o "Sair". */
@media (max-width: 680px) {
  header { padding: 12px 14px; }
  #who { gap: 4px; }
  #who .search-btn { padding: 5px; }
  #who #out { margin-left: 4px; }
}
.map-locked { text-align: center; padding: 40px 24px; }
.map-locked h2 { margin: 8px 0; }
.map-locked p { max-width: 460px; margin: 8px auto; }
.map-locked .btn { margin-top: 8px; }
.map-locked-art { font-size: 3rem; }
.reminder-collapse .reminder-box { background: none; padding: 0; margin-top: 10px; }

/* Ordem da linha do tempo, ao lado do primeiro ano */
.year-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.year-row .year { margin-right: 0; }
.order-toggle { display: inline-flex; margin: 14px 0 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.order-toggle button { background: none; border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 5px 11px; font-size: 16px; line-height: 1; font-weight: 700; color: var(--title); cursor: pointer; }
.order-toggle button + button { border-left: 1px solid var(--line); }
.order-toggle button.on { color: var(--orange); background: var(--orange-soft); cursor: default; }
.trash-btn { position: relative; }
#who a.trash-btn { opacity: 1; } #who a.trash-btn svg { opacity: .8; } #who a.trash-btn:hover svg { opacity: 1; }
@media (max-width: 420px) { #who { gap: 6px; } header { padding-left: 12px; padding-right: 12px; } }

/* Marcos da vida */
.milestone-field { display: flex; gap: 8px; flex-wrap: wrap; }
.milestone-field select { flex: 1 1 220px; }
.milestone-field input { flex: 2 1 220px; }
.milestone-badge { display: inline-block; margin: 4px 0 2px; padding: 3px 12px; border-radius: 999px; font-size: .82rem; font-weight: 800;
  background: linear-gradient(135deg, #ffd27a, var(--orange)); color: #3b2306; box-shadow: 0 2px 8px rgba(240,127,47,.25); }
.marks { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.marks::before { content: ""; position: absolute; left: 132px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--orange), var(--navy-2)); }
.mark { display: grid; grid-template-columns: 112px 1fr; gap: 40px; align-items: center; margin-bottom: 18px; cursor: pointer; position: relative; }
.mark::before { content: "⭐"; position: absolute; left: 119px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 15px;
  background: var(--surface); border: 3px solid var(--orange); border-radius: 50%; }
.mark-when { text-align: right; } .mark-when b { display: block; color: var(--title); font-size: .92rem; } .mark-when small { color: var(--muted); font-size: .8rem; }
.mark-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: transform .15s; }
.mark:hover .mark-card, .mark:focus .mark-card { transform: translateY(-2px); }
.mark-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; flex: none; background: var(--navy-soft); }
.mark-label { font-weight: 800; color: var(--title); font-size: 1.05rem; }
.mark-title { color: var(--muted); }
@media (max-width: 560px) {
  .marks::before { left: 14px; }
  .mark { grid-template-columns: 1fr; gap: 6px; padding-left: 44px; }
  .mark::before { left: 1px; top: 0; }
  .mark-when { text-align: left; }
  .mark-thumb { width: 56px; height: 56px; }
}

/* Pergunta do dia */
.daily-q { border: 2px solid var(--orange-soft); }
.dq-kicker { color: var(--link); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; }
.dq-question { margin: 6px 0 12px; font-size: 1.35rem; }
.dq-done { margin: -4px 0 12px; color: var(--muted); font-size: .93rem; }
.dq-actions { align-items: center; gap: 10px; margin-top: 8px; }

/* App instalado (PWA) */
.install-banner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.install-banner img { border-radius: 12px; flex: none; }
.install-banner > div:nth-child(2) { flex: 1 1 200px; }
.install-banner p { margin: 2px 0 0; font-size: .9rem; }
.install-actions { display: flex; gap: 10px; align-items: center; }
.ios-share { display: inline-block; padding: 0 4px; border: 1.5px solid currentColor; border-radius: 5px; font-size: .8em; }
.queue-pill { position: fixed; right: 16px; top: calc(74px + env(safe-area-inset-top)); z-index: 55; padding: 10px 16px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: .88rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
/* Aberto pela tela inicial: o cabeçalho desce para baixo do relógio/notch e nada fica sob a barra de gestos. */
@media (display-mode: standalone) {
  header { padding-top: calc(12px + env(safe-area-inset-top)); padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
  main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
}
.dq-compact { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; color: var(--muted); }

.event-ends { margin: 0 0 12px; }
.dq-where { font-size: .88rem; margin-left: auto; }
@media (max-width: 560px) { .dq-where { flex: 1 1 100%; margin-left: 0; } }
/* Estrela "marco da vida" ao lado do título */
.title-row { display: flex; gap: 8px; align-items: center; }
.title-row input { flex: 1; }
.star-btn { flex: none; width: 46px; height: 46px; margin: 6px 0 14px; padding: 0; border-radius: 12px; font-size: 1.45rem; line-height: 1;
  background: var(--field); color: var(--muted); border: 1.5px solid var(--line); box-shadow: none; }
.star-btn:hover { color: var(--orange); border-color: var(--orange); background: var(--field); }
.star-btn.on { color: #fff; background: linear-gradient(135deg, #ffd27a, var(--orange)); border-color: transparent; }
.star-label { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--title); }
.star-label .star-btn { margin: 4px 0 10px; }
.mark-trail { color: var(--link); }

/* Baixar, editar e excluir na memória aberta: ícones redondos no estilo do botão de som do vídeo. */
.icon-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: rgba(27, 42, 74, .72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.25); text-decoration: none; }
.icon-btn:hover { background: var(--navy); color: #fff; }
.icon-btn[data-del]:hover { background: #c0392b; }
.icon-actions .dl-menu summary.icon-btn { display: grid; padding: 0; border: 0; border-radius: 50%; color: #fff; }
.icon-actions .dl-menu[open] summary.icon-btn { background: var(--orange); }
.icon-actions .dl-list { left: 0; right: auto; top: auto; bottom: calc(100% + 6px); }
.memory-actions { justify-content: space-between; }

/* Story de uma memória: pré-visualização da arte 9:16 por cima da memória aberta. */
.story-backdrop { z-index: 60; }
.modal.story { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.story-preview { display: grid; place-items: center; min-height: 200px; margin: 6px 0 14px; }
.story-preview img { display: block; width: auto; max-width: 100%; max-height: 52vh; aspect-ratio: 9 / 16; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.art-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 12px; }
.art-format { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px 12px; border-radius: 16px; background: none; border: 1.5px solid var(--line); color: var(--title); box-shadow: none; cursor: pointer; }
.art-format:hover { border-color: var(--muted); background: none; }
.art-format[aria-checked="true"] { border-color: var(--orange); background: var(--orange-soft); }
.art-format small { color: var(--muted); font-weight: 700; }
.art-shape { display: block; border: 2.5px solid currentColor; border-radius: 6px; }
.art-shape.feed { width: 36px; height: 48px; margin: 2.5px 0; }
.art-shape.story { width: 30px; height: 53px; }
.art-format[aria-checked="true"] .art-shape { color: var(--orange); }
.story-preview.feed img { aspect-ratio: 3 / 4; }

/* Marca Capsuli: o pingo do "i" é sempre laranja (texto usa ı sem pingo + este ponto). */
.idot { position: relative; }
.idot::after { content: ""; position: absolute; left: 50%; bottom: .924em; width: .17em; height: .17em; margin-left: -.085em; border-radius: 50%; background: #f07f2f; }
.modal.diary-created { width: min(440px, 100%); text-align: center; }
.modal.diary-created h2 { padding: 0; }
.dc-icon { font-size: 2.6rem; margin-bottom: 6px; }

/* Início: trilhas em mosaico de quadrados; o último é o "+" que cria uma trilha. */
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-bottom: 26px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; display: block; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%) center/cover no-repeat; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,16,30,.78) 0%, rgba(10,16,30,.15) 55%, transparent 75%); pointer-events: none; }
.tile-letter { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 22%; font-size: 2.2rem; font-weight: 800; }
.tile-tag { position: absolute; top: 7px; left: 7px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: rgba(255,255,255,.9); }
.tile-text { position: absolute; left: 9px; right: 9px; bottom: 8px; z-index: 1; line-height: 1.2; }
.tile-text b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; }
.tile-text small { display: block; opacity: .85; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.locked { filter: grayscale(.6); }
.tile.milestones-tile .tile-tag { background: var(--orange); }
.tile-new { padding: 0; border: 2px dashed var(--line); background: transparent; box-shadow: none; color: var(--orange); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; }
.tile-new::after { display: none; }
.tile-new span { font-size: 2.6rem; font-weight: 400; line-height: 1; }
.tile-new small { color: var(--muted); font-weight: 700; }
.tile-new:hover { background: var(--orange-soft); border-color: var(--orange); }
@media (max-width: 560px) { .mosaic { grid-template-columns: repeat(3, 1fr); gap: 8px; } .tile-text b { font-size: .82rem; } .tile-text small { font-size: .68rem; } }
.modal.new-trail-modal { width: min(480px, 100%); }
#daily-q .daily-q { margin-top: 0; }

/* Preferências: atalho para a lixeira e o "Sair" no fim da página. */
.trash-link { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.trash-link .trash-icon { position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--navy-soft); color: var(--title); }
.trash-link .bell-badge { position: absolute; top: -2px; right: -4px; border-color: var(--surface); }
.trash-link .chev { margin-left: auto; font-size: 1.6rem; color: var(--muted); }
.logout-row { margin: 8px 0 30px; }
.logout-row button { width: 100%; }
.section-title h2, .section-title > .muted { white-space: nowrap; }
@media (max-width: 560px) { .section-title { flex-wrap: wrap; margin-top: 24px; } .section-title .frame-link { margin-left: 0; } .section-title .btn.small { white-space: nowrap; } }
.tile-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--navy-soft); color: var(--title); box-shadow: none; }
.tile-more::after { display: none; }
.tile-more span { font-size: 2.6rem; font-weight: 800; line-height: .8; letter-spacing: 2px; }
.tile-more small { color: var(--muted); font-weight: 700; }
.tile-more:hover { background: var(--orange-soft); }

/* Trilha: cabeçalho curto, com Lembrete / Evento / Compartilhar em abas. */
.trail-desc { margin: 2px 0 0; }
.trail-tabs { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.trail-tabs::-webkit-scrollbar { display: none; }
.trail-tab { flex: none; padding: 8px 14px; font-size: .9rem; background: var(--field); color: var(--title); border: 1.5px solid var(--line); white-space: nowrap; }
.trail-tab:hover { background: var(--orange-soft); }
.trail-tab[aria-selected="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.trail-panel { margin-top: 10px; }
.trail-panel > details > summary { display: none; }
.trail-panel > .event-box, .trail-panel > details.event-box { margin-top: 0; }
.trail-panel > .share-box { padding: 14px 16px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
@media (max-width: 560px) { .trail-top h2 { font-size: 1.45rem; } .trail-tab { padding: 7px 12px; font-size: .85rem; } }
.trail-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, max-content); overflow: visible; }
.trail-tab { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .trail-tabs { grid-auto-columns: minmax(0, 1fr); gap: 6px; } .trail-tab { padding: 8px 6px; } }
@media (max-width: 560px) { .trail-tabs { grid-auto-columns: auto; } .trail-tab { padding: 8px 10px; font-size: .82rem; } }
@media (max-width: 400px) { .trail-tabs { gap: 5px; } .trail-tab { padding: 8px 8px; font-size: .78rem; } }
.rewind-item[data-open] { cursor: pointer; }

/* Busca da tela inicial: lupa e calendário só em ícone, numa linha só também no celular. */
#home-search { flex-wrap: nowrap; gap: 8px; }
#home-search input { flex: 1 1 auto; min-width: 0; }
#home-search .icon-search { flex: none; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 50%; }

/* Família (dependentes do plano Max) em Preferências */
.family-list { display: grid; gap: 8px; }
.family-invites { display: grid; gap: 8px; margin-bottom: 12px; }
.family-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1.5px solid var(--line); }
.family-row .row { margin: 0; gap: 8px; flex-wrap: nowrap; }
.family-row.pending { opacity: .85; }
.family-row.empty { background: transparent; border: 1.5px dashed var(--line); }
.family-invites .family-row { background: var(--orange-soft); }
.fam-tag { font-size: .78rem; font-weight: 700; color: var(--orange); margin-left: 4px; }

/* ---------- Fotos inteiras ("Original", ex.: vertical 9:16) ou ajustadas ao quadro ---------- */
/* data-fit="original": a foto aparece inteira; "auto" (memórias antigas): só as verticais (img.tall). */
.media[data-fit="original"] img, .media[data-fit="original"] video, .media[data-fit="auto"] img.tall {
  height: auto; max-height: 440px; object-fit: contain; }
.carousel[data-fit="original"] .carousel-slide img, .carousel[data-fit="auto"] .carousel-slide img.tall { object-fit: contain; }
.carousel[data-fit="original"] .carousel-slide img, .carousel[data-fit="original"] .carousel-slide video,
.carousel.has-tall[data-fit="auto"] .carousel-slide img, .carousel.has-tall[data-fit="auto"] .carousel-slide video { height: min(480px, 70vh); }
/* Pop-up: o palco deixa o 4:3 e acompanha a foto (uma só) ou fica alto para o carrossel. */
.reveal-stage.fit-original { aspect-ratio: auto; display: grid; align-items: center; min-height: 200px; }
.reveal-stage.fit-original > img, .reveal-stage.fit-original > video { height: auto; max-height: min(72vh, 720px); object-fit: contain; margin: 0 auto; }
.reveal-stage.fit-original:has(.carousel) { height: min(72vh, 640px); }
.reveal-stage.fit-original .carousel .carousel-slide img, .reveal-stage.fit-original .carousel .carousel-slide video { height: 100%; object-fit: contain; }
/* Recorte escolhido no "Ajustar ao quadro" (--fx/--fy, em %); no "Original" a foto fica centralizada. */
.media img, .carousel-slide img, .reveal-stage img { object-position: var(--fx, 50%) var(--fy, 50%); }
.media[data-fit="original"] img, .media[data-fit="auto"] img.tall, .carousel[data-fit="original"] .carousel-slide img,
.carousel[data-fit="auto"] .carousel-slide img.tall, .reveal-stage.fit-original img { object-position: 50% 50%; }
/* Editor direto na foto: Original / Ajustar ao quadro no canto e arrastar para escolher o recorte.
   Ícones azul-marinho no tema claro e laranja no escuro. */
:root { --fe-accent: #1b2a4a; --fe-accent-soft: rgba(27, 42, 74, .12); --fe-pill: rgba(255, 255, 255, .92); }
:root[data-theme="dark"] { --fe-accent: #f07f2f; --fe-accent-soft: rgba(240, 127, 47, .2); --fe-pill: rgba(14, 21, 36, .86); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --fe-accent: #f07f2f; --fe-accent-soft: rgba(240, 127, 47, .2); --fe-pill: rgba(14, 21, 36, .86); }
}
.nm-fit { margin: 4px 0 12px; }
.nm-fit[hidden] { display: none; }
.fit-editor { position: relative; overflow: hidden; border-radius: 14px; background: var(--navy); }
.fe-view { aspect-ratio: 4 / 3; touch-action: none; cursor: grab; overflow: hidden; }
.fit-editor.dragging .fe-view { cursor: grabbing; }
.fe-view img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-select: none; pointer-events: none; filter: none !important; transform: none !important; }
.fit-editor[data-fit="original"] .fe-view { aspect-ratio: auto; cursor: default; touch-action: auto; display: grid; place-items: center; min-height: 180px; }
.fit-editor[data-fit="original"] .fe-view img { height: auto; max-height: min(62vh, 560px); object-fit: contain; object-position: 50% 50% !important; }
.fe-hint { position: absolute; top: 12px; left: 12px; padding: 5px 12px; border-radius: 999px; background: var(--fe-pill); color: var(--fe-accent); font-size: .8rem; font-weight: 800; pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,.18); transition: opacity .3s; }
.fit-editor[data-fit="original"] .fe-hint, .fit-editor.dragging .fe-hint { opacity: 0; }
.fe-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fe-pill); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fe-tools button { width: 38px; height: 38px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--fe-accent); opacity: .5; box-shadow: none; transition: opacity .2s, background .2s; }
.fe-tools button:hover { background: var(--fe-accent-soft); opacity: .8; }
.fe-tools button[aria-checked="true"] { opacity: 1; background: var(--fe-accent-soft); }
/* Tema escuro: os ícones ficam brancos sobre fundo azul-marinho. */
:root[data-theme="dark"] .fe-tools { background: #1b2a4a; }
:root[data-theme="dark"] .fe-tools button { color: #fff; }
:root[data-theme="dark"] .fe-tools button[aria-checked="true"], :root[data-theme="dark"] .fe-tools button:hover { background: rgba(255, 255, 255, .18); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fe-tools { background: #1b2a4a; }
  :root:not([data-theme="light"]) .fe-tools button { color: #fff; }
  :root:not([data-theme="light"]) .fe-tools button[aria-checked="true"], :root:not([data-theme="light"]) .fe-tools button:hover { background: rgba(255, 255, 255, .18); }
}
.fe-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1.5rem; line-height: 34px; background: var(--fe-pill); color: var(--fe-accent); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fe-nav.prev { left: 10px; } .fe-nav.next { right: 10px; }
.fe-nav[hidden] { display: none; }
.fe-count { position: absolute; left: 12px; bottom: 14px; padding: 3px 10px; border-radius: 999px; background: rgba(27, 42, 74, .72); color: #fff; font-size: .78rem; font-weight: 800; }
.fe-count:empty { display: none; }
.reveal-stage.editing { aspect-ratio: auto; cursor: default; display: block; min-height: 0; }
.reveal-stage.editing > :not(.fit-editor) { display: none !important; }
.reveal-stage.editing .fit-editor { border-radius: 0; }

/* Título da trilha com o lápis para renomear (só o dono) */
.trail-title { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.title-edit { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--muted); }
.title-edit:hover { background: var(--navy-soft); color: var(--title); }
.title-edit svg { width: 18px; height: 18px; }
.title-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.title-form input { flex: 1 1 200px; margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--title); }
.title-form .error { flex-basis: 100%; margin: 0; }
.title-form .error:empty { display: none; }

/* Busca no menu suspenso da lupa do topo (saiu da tela inicial). */
.search-wrap { position: relative; }
#who .search-btn { background: transparent; border: 0; cursor: pointer; }
#who .search-btn.on { opacity: 1; background: rgba(255,255,255,.16); }
.search-panel { position: absolute; right: -8px; top: 46px; width: min(420px, calc(100vw - 24px)); display: flex; gap: 8px; align-items: center;
  padding: 12px; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 40px rgba(27,42,74,.25); z-index: 21; }
.search-panel[hidden] { display: none; }
.search-panel input { flex: 1 1 auto; min-width: 0; margin: 0; }
.search-panel .icon-search { flex: none; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
@media (max-width: 680px) { .search-panel { position: fixed; left: 12px; right: 12px; top: calc(64px + env(safe-area-inset-top)); width: auto; } }
@media (display-mode: standalone) and (max-width: 680px) { .search-panel, .bell-panel { top: calc(64px + env(safe-area-inset-top)); } }

/* Pergunta do dia compacta: resposta e Guardar na mesma linha. */
#daily-q .daily-q { padding: 16px 18px; }
.daily-q .dq-question { margin: 4px 0 10px; font-size: 1.08rem; line-height: 1.3; }
.dq-line { display: flex; gap: 8px; align-items: flex-end; }
.dq-line textarea { flex: 1; min-width: 0; margin: 0; min-height: 46px; resize: none; overflow: hidden; }
.dq-line button { flex: none; height: 46px; }
.daily-q .dq-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.daily-q .dq-where { margin-left: 0; flex: 1 1 auto; font-size: .84rem; }
.daily-q .dq-actions .link { flex: none; }
.daily-q #dq-err:empty { display: none; }
.search-panel { font-size: 16px; } /* 16px ou mais: o iPhone não dá zoom ao tocar na caixa */
.tile-tag { color: #1b2a4a; } .tile.milestones-tile .tile-tag { color: #fff; } .tile-tag svg { display: block; }
/* "Hoje não" no canto de cima do cartão da pergunta do dia, discreto. */
.dq-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.daily-q .dq-skip { color: var(--muted); font-weight: 700; font-size: .82rem; }
.daily-q .dq-skip:hover { color: var(--link); }

/* Lixeira da trilha: ícone com contagem ao lado do Mapa e menu suspenso com as excluídas (substitui o cartão). */
.trail-trash { position: relative; }
.trail-trash-btn { position: relative; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.trail-trash-btn.on { background: var(--navy-soft); }
.trail-trash-btn .bell-badge { position: absolute; top: -4px; right: -6px; border-color: var(--surface); }
.trail-trash-menu { position: fixed; z-index: 22; width: min(400px, calc(100vw - 24px)); max-height: 60vh; overflow-y: auto;
  padding: 14px 16px; background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: 0 12px 40px rgba(27,42,74,.25); border: 1px solid var(--line); }
.trail-trash-menu[hidden] { display: none; }
.trail-trash-menu > p { margin: 0 0 8px; font-size: .88rem; }
.trail-trash-menu ul.trash-list { list-style: none; margin: 0; padding: 0; }
.trail-trash-menu li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.trail-trash-menu li .purge-when { font-size: .84rem; color: var(--muted); }
.trail-trash-menu li.ending .purge-when { color: #c0392b; font-weight: 700; }
.trail-trash-menu .countdown { font-variant-numeric: tabular-nums; }
.trail-trash-menu li button { flex: none; }
@media (max-width: 680px) { .trail-trash-menu { position: fixed; left: 12px; right: 12px; width: auto; max-height: 55vh; } }
button.small.trail-trash-btn { padding: 0; line-height: 0; flex: none; } /* o padding do botão pequeno empurrava o ícone para a direita */
.trail-trash-btn svg { display: block; }

/* Carrossel na linha do tempo: do tamanho de uma foto sozinha (uma casa da grade .media), sem o fundo em volta. */
.media > .carousel { margin: 0; border-radius: 12px; background: transparent; align-self: start; }
.media > .carousel .carousel-slide { display: grid; align-items: center; }
.media > .carousel .carousel-slide img, .media > .carousel .carousel-slide video { border-radius: 12px; }
.media > .carousel .carousel-nav { width: 30px; height: 30px; font-size: 1.25rem; line-height: 28px; }
.media > .carousel .carousel-nav.prev { left: 6px; } .media > .carousel .carousel-nav.next { right: 6px; }
.media > .carousel .carousel-count { top: 6px; right: 6px; padding: 2px 8px; font-size: .72rem; }
.media > .carousel .carousel-dots { bottom: 8px; gap: 4px; flex-wrap: wrap; padding: 0 8px; }
.media > .carousel .carousel-dots button { width: 6px; height: 6px; }
.media > .carousel .carousel-dots button.on { width: 14px; }
.media > .carousel .carousel-slide img, .media > .carousel .carousel-slide video { height: 200px; object-fit: cover; }
.media > .carousel[data-fit="original"] .carousel-slide img, .media > .carousel[data-fit="original"] .carousel-slide video,
.media > .carousel[data-fit="auto"] .carousel-slide img.tall { height: auto; max-height: 440px; object-fit: contain; }
