:root {
  --bg: #f5f6fa; --card: #fff; --text: #14171f; --muted: #6b7280; --border: #e7e9f0;
  --accent: #6366f1; --accent-2: #8b5cf6; --danger: #ef4444; --like: #ec4899;
  --radius: 16px; --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1016; --card: #171a23; --text: #eceef4; --muted: #9097a8; --border: #262a36;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); }
}
* { box-sizing: border-box; }
/* o atributo hidden precisa vencer qualquer display: flex/grid definido nas classes (senão "hidden" não esconde nada) */
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--border); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h3 { font-size: 1rem; }
small, .muted { color: var(--muted); }
.center { text-align: center; }

/* topo */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc(50% - 560px)); background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { height: 32px; width: auto; max-width: 160px; object-fit: contain; border-radius: 8px; }
.auth-logo { display: block; margin: 0 auto 8px; width: 56px; height: 56px; object-fit: contain; border-radius: 14px; }
.logo-preview { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg); }
.logo-preview img { max-width: 160px; max-height: 80px; object-fit: contain; }
.brand-mark { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text;
  background-clip: text; color: transparent; font-size: 1.4rem; }
.search { flex: 1; max-width: 320px; }
.search input { width: 100%; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: inherit; font: inherit; }
.tabs { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tabs a { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.tabs a:hover, .tabs a.on { background: var(--bg); color: var(--text); text-decoration: none; }
.tabs form { margin: 0; }
.admin-menu { position: relative; }
.admin-menu summary { list-style: none; cursor: pointer; padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary::after { content: " ▾"; font-size: .8em; }
.admin-menu[open] summary, .admin-menu.on summary, .admin-menu summary:hover { background: var(--bg); color: var(--text); }
.admin-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; padding: 6px; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.12); display: flex; flex-direction: column; }
.admin-panel a { border-radius: 10px; }

/* layout */
.shell { max-width: 1120px; margin: 24px auto; padding: 0 16px; display: block; }
.shell.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
aside { position: sticky; top: 76px; }
@media (max-width: 860px) { .shell.with-side { grid-template-columns: minmax(0, 1fr); } aside { display: none; }
  .search { display: none; } .tabs { margin-left: auto; } }
main { max-width: 640px; width: 100%; margin: 0 auto; }
.shell.with-side main { margin: 0; max-width: none; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; }
.section { margin: 4px 4px 12px; }
.empty { text-align: center; color: var(--muted); padding: 36px; }
.back { display: inline-block; margin-bottom: 10px; color: var(--muted); }

/* botões e formulários */
.btn { display: inline-block; padding: 9px 20px; border: 0; border-radius: 999px; cursor: pointer; font: inherit;
  font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.small { padding: 6px 14px; color: #fff !important; }
.btn.ghost, button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.ghost { padding: 7px 14px; border-radius: 999px; font: inherit; cursor: pointer; }
.btn.block { display: block; text-align: center; margin: 4px 0 16px; }
input, textarea { font: inherit; color: inherit; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--muted); }
label input, .inline input, .composer textarea { padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg); color: var(--text); font-weight: 400; }
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }
.alert { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger);
  padding: 10px 14px; border-radius: 12px; margin: 0 0 12px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 999px; box-shadow: var(--shadow); }

/* composer */
.composer textarea { width: 100%; resize: vertical; min-height: 80px; }
.row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* avatar */
.avatar { --h: 250; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .95rem; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 40) 70% 45%)); }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar.xl { width: 88px; height: 88px; font-size: 1.8rem; border: 4px solid var(--card); margin-top: -44px; }

/* posts */
.post { display: flex; gap: 12px; transition: border-color .15s; }
.post:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.post-main { min-width: 0; flex: 1; }
.post-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.post-head .muted { font-size: .88rem; }
.body { margin: 4px 0 8px; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 6px; align-items: center; margin-left: -8px; }
.post-actions form { margin: 0; }
.act { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; }
.act:hover { background: var(--bg); text-decoration: none; }
.act.liked { color: var(--like); }
.act.danger:hover { color: var(--danger); }
.heart { font-size: 1.1rem; }

/* comentários */
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.comment p { margin: 2px 0 0; overflow-wrap: anywhere; }
.inline { display: flex; gap: 8px; margin-top: 12px; }
.inline input { flex: 1; }

/* perfil */
.profile { padding: 0; overflow: hidden; }
.cover { height: 120px; background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, var(--like)); }
.profile-body { padding: 0 20px 20px; position: relative; }
.profile-actions { position: absolute; right: 20px; top: 12px; }
.profile-actions form { margin: 0; }
.profile h1 { margin-top: 10px; }
.stats { display: flex; gap: 20px; margin: 8px 0; color: var(--muted); }
.stats b { color: var(--text); }
.profile .stack { margin-top: 14px; }

/* pessoas */
.person { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.card.person { padding: 12px 18px; }
.person span { display: flex; flex-direction: column; line-height: 1.25; }

/* auth */
.auth { max-width: 420px; margin: 40px auto; padding: 28px; }
.auth h1 { font-size: 1.6rem; }

/* notificações, tags e menções */
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--like);
  color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 18px; }
.tag, .mention { color: var(--accent); font-weight: 500; }
.trend { display: flex; justify-content: space-between; padding: 6px 0; font-weight: 600; }
.notif { display: flex; gap: 12px; align-items: center; }
.notif:hover { text-decoration: none; }
.notif.unread { border-left: 4px solid var(--accent); }
.notif > span { display: flex; flex-direction: column; min-width: 0; }
.excerpt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* imagens */
img.avatar { object-fit: cover; background: var(--border); }
.post-img { display: block; max-width: 100%; max-height: 480px; margin: 8px 0; border-radius: 12px;
  border: 1px solid var(--border); object-fit: cover; }
.composer .preview { display: block; max-height: 220px; max-width: 100%; margin-top: 10px; border-radius: 12px; }
.composer .preview[hidden] { display: none; }
.tools { display: flex; align-items: center; gap: 12px; }
.pick { cursor: pointer; font-weight: 600; color: var(--accent); }

/* mensagens */
.conv { display: flex; gap: 12px; align-items: center; }
.conv:hover { text-decoration: none; }
.conv.unread { border-left: 4px solid var(--accent); }
.conv > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat { padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.thread { display: flex; flex-direction: column; gap: 6px; height: min(55vh, 520px); overflow-y: auto; padding: 16px 18px; }
.bubble { max-width: 78%; padding: 8px 14px; border-radius: 18px; overflow-wrap: anywhere; }
.bubble small { display: block; font-size: .7rem; opacity: .7; margin-top: 2px; }
.bubble.mine { align-self: flex-end; color: #fff; border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.bubble.theirs { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.chat .inline { margin: 0; padding: 12px 18px; border-top: 1px solid var(--border); }
.bubble.mine small { color: rgba(255,255,255,.85); opacity: 1; }

/* bloqueio, denúncia e moderação */
.more { position: relative; display: inline-block; }
.more summary { list-style: none; padding: 7px 14px; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: 110%; z-index: 5; min-width: 140px; padding: 6px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.menu a, .menu button { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg); text-decoration: none; }
.profile-actions { display: flex; gap: 8px; align-items: center; }
.person-row { display: flex; justify-content: space-between; align-items: center; }
.person-row form { margin: 0; }
.report .row { justify-content: flex-start; gap: 8px; }
.btn.danger { background: var(--danger); }
select { padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; }
.auth textarea { padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); width: 100%; }

.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.stack > p { margin: 0; }

/* edição */
em { font-style: normal; color: var(--muted); }
.comment .post-actions { margin-top: 2px; }
.auth textarea { resize: vertical; }

/* respostas */
.thread-item { border-top: 1px solid var(--border); }
.thread-item > .comment { border-top: 0; }
.replies { margin-left: 42px; padding-left: 12px; border-left: 2px solid var(--border); }
.replies .comment { border-top: 0; padding: 6px 0; }
.reply-form { margin: 0 0 10px 42px; }
button.act { font: inherit; }

/* paginação do chat, imagem na edição, listas de pessoas */
.older { align-self: center; padding: 4px 14px; border-radius: 999px; font-size: .85rem; color: var(--accent);
  border: 1px solid var(--border); background: var(--card); }
.current-img { display: flex; flex-direction: column; gap: 8px; }
.current-img img { max-height: 200px; max-width: 100%; border-radius: 12px; border: 1px solid var(--border); object-fit: cover; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.stats a { color: var(--muted); }
.stats a:hover { color: var(--text); text-decoration: none; }

/* instalador */
.installer .install-main { max-width: 640px; margin: 24px auto; padding: 0 16px; }
.auth.wide { max-width: 600px; margin: 16px auto; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; flex-wrap: wrap; justify-content: center; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; color: var(--muted); font-size: .85rem; background: var(--card); border: 1px solid var(--border); }
.steps li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); font-weight: 700; font-size: .75rem; }
.steps li.now { color: var(--text); border-color: var(--accent); }
.steps li.now span { background: var(--accent); color: #fff; }
.steps li.done span { background: #16a34a; color: #fff; }
.req { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.req li { display: flex; gap: 10px; align-items: flex-start; }
.req .ico { font-weight: 700; width: 20px; text-align: center; }
.req li.ok .ico { color: #16a34a; } .req li.bad .ico { color: var(--danger); } .req li.warn .ico { color: #d97706; }
.req small { display: block; color: var(--muted); }
.fields { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 6px 26px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.detail { color: var(--muted); font-size: .85rem; margin-bottom: 8px; } .detail code { display: block; margin-top: 6px; overflow-wrap: anywhere; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); }
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* carteira, presentes e financeiro */
.big { font-size: 1.8rem; font-weight: 800; margin: 4px 0; }
.small { font-size: .85rem; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.pack b { font-size: 1.15rem; }
.ledger-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.alert.ok { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gift { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 2px solid var(--border); border-radius: 14px; cursor: pointer; background: var(--bg); font-weight: 400; color: var(--text); }
.gift input { position: absolute; opacity: 0; width: 0; height: 0; }
.gift .emoji { font-size: 2rem; line-height: 1.2; }
.gift:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.gift:has(input:focus-visible) { outline: 2px solid var(--accent); }
.gift.off { opacity: .45; cursor: not-allowed; }
.gifts-received .gift-line { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.gift-line .emoji { font-size: 1.6rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpis div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; }
.kpis b { font-size: 1.15rem; }
.admin-row, .payout-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.admin-row input:not([type=checkbox]):not([type=hidden]), .payout-row input { width: auto; max-width: 100%; padding: 6px 10px; }
.payout-row > div { flex: 1 1 100%; }
.warn-text { color: var(--danger); }

/* pacotes de moedas como opções selecionáveis */
label.pack { position: relative; cursor: pointer; font-weight: 400; color: var(--text); border-width: 2px; }
label.pack input { position: absolute; opacity: 0; width: 0; height: 0; }
label.pack:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
label.pack:has(input:focus-visible) { outline: 2px solid var(--accent); }

/* documentos legais e rodapé */
.legal h1 { margin-bottom: 4px; } .legal h3 { margin-top: 1.4em; } .legal p { overflow-wrap: anywhere; }
.site-footer { max-width: 1120px; margin: 0 auto 28px; padding: 0 16px; display: flex; gap: 18px; justify-content: center; font-size: .85rem; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* página inicial (visitantes) */
.landing { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.hero { position: relative; margin: 20px 0 0; padding: 64px 24px 56px; text-align: center; border-radius: 28px; overflow: hidden;
  background: radial-gradient(1200px 400px at 50% -10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
              radial-gradient(800px 300px at 90% 110%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%), var(--card);
  border: 1px solid var(--border); }
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-logo { height: 72px; width: auto; max-width: 240px; object-fit: contain; border-radius: 18px; margin-bottom: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: var(--accent); margin: 8px 0; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; letter-spacing: -.03em; margin: 8px 0 16px; }
.grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: var(--muted); margin: 0 auto 24px; max-width: 620px; line-height: 1.5; }
.lead b { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 12px; }
.btn.big { padding: 14px 28px; font-size: 1.05rem; }
.stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.stats > div { flex: 1 1 140px; max-width: 220px; text-align: center; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; }
.stats b { display: block; font-size: 1.9rem; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: .9rem; }
.block { margin: 48px 0; }
.block > h2 { text-align: center; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -.02em; margin: 0 0 24px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { padding: 22px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.08); }
.feature.hot { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--card)), var(--card)); }
.feature .ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--bg); font-size: 1.5rem; }
.feature h3 { margin: 14px 0 6px; }
.feature p { margin: 0; color: var(--muted); line-height: 1.5; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.steps li { display: flex; gap: 14px; padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; }
.steps li > b { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.steps h3 { margin: 0 0 4px; } .steps p { margin: 0; color: var(--muted); }
.live { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.live-post { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
.live-post:hover { text-decoration: none; box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.live-post .who { display: flex; align-items: center; gap: 8px; }
.live-post .txt { color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.faq details { max-width: 720px; margin: 0 auto 10px; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); line-height: 1.55; margin: 10px 0 0; }
.cta-final { text-align: center; padding: 48px 24px; border-radius: 28px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.cta-final h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 4vw, 2.2rem); } .cta-final p { margin: 0 0 20px; opacity: .92; }
.cta-final .btn { background: #fff; color: #4c3fd0; }
@media (max-width: 600px) { .hero { padding: 40px 16px; border-radius: 20px; } }

/* mercado */
.market-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.market-head .section { margin: 0; }
.market-search { display: flex; gap: 8px; padding: 10px; margin: 12px 0; }
.market-search input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: inherit; font: inherit; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: thin; }
.chip { flex: none; display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: .9rem; text-decoration: none; }
a.chip:hover { text-decoration: none; color: var(--text); }
.chip.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.grid-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 6px 0 18px; }
.ad-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.ad-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.1); }
.ad-card.boosted { border-color: #f5b301; box-shadow: 0 0 0 1px #f5b301 inset; }
.ad-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg); }
.ad-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; opacity: .5; }
.tag-boost { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: #f5b301; color: #3b2a00; font-size: .75rem; font-weight: 700; }
.tag-boost.inline { position: static; display: inline-block; margin-bottom: 6px; }
.tag-sold { position: absolute; top: 8px; right: 8px; padding: 3px 9px; border-radius: 999px; background: #1f2937; color: #fff; font-size: .75rem; font-weight: 700; }
.ad-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.ad-price { font-size: 1.1rem; }
.ad-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 16px; }
.listing { display: flex; flex-direction: column; gap: 12px; }
.listing h1 { margin: 0; font-size: 1.5rem; }
.listing .price { font-size: 1.8rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.listing .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.listing .desc { line-height: 1.6; overflow-wrap: anywhere; }
.gallery .main img { width: 100%; max-height: 460px; object-fit: contain; background: var(--bg); border-radius: 14px; display: block; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; display: block; }
.thumbs.edit .th { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.seller { margin: 0; }
.owner-box { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.owner-box .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.owner-box form { margin: 0; }
.boost { padding: 14px; border-radius: 14px; background: color-mix(in srgb, #f5b301 12%, var(--card)); border: 1px solid color-mix(in srgb, #f5b301 50%, var(--border)); }
.boost h3 { margin: 0 0 6px; }
.plans { display: flex; flex-wrap: wrap; gap: 10px; }
.plan { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 16px; border: 2px solid var(--border); border-radius: 14px; background: var(--card); cursor: pointer; }
.plan:has(input:checked) { border-color: #f5b301; }
.plan input { margin-bottom: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } .grid-ads { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ===== responsivo: celular, tablet e desktop ===== */
img, video { max-width: 100%; }
.mobile-actions, .bottombar { display: none; }
.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.icon-btn { position: relative; display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 999px; font-size: 1.25rem;
  color: var(--text); background: transparent; border: 0; text-decoration: none; }
.icon-btn:hover { background: var(--bg); text-decoration: none; }
.icon-btn .badge { position: absolute; top: 2px; right: 0; }
.pop-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; max-width: calc(100vw - 24px); padding: 8px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.pop-panel a, .pop-panel button { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px; color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; text-decoration: none; }
.pop-panel a:hover, .pop-panel button:hover { background: var(--bg); }
.pop-panel hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; width: 100%; }
.pop-panel form { margin: 0; }

/* desktop apertado: tabs mais compactos antes de trocar para o menu de celular */
@media (max-width: 1320px) { .tabs a, .admin-menu summary { padding: 7px 9px; } .tabs { gap: 0; } }

/* celular e tablet: navegação na barra inferior + ações rápidas no topo */
@media (max-width: 1180px) {
  .tabs, .topbar .search { display: none; }
  .mobile-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
  .topbar { gap: 8px; padding: 6px max(12px, env(safe-area-inset-left)) 6px max(12px, env(safe-area-inset-right)); }
  .bottombar { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: stretch;
    padding: 4px max(4px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px;
    font-size: .72rem; color: var(--muted); text-decoration: none; border-radius: 12px; }
  .bottombar a.on { color: var(--accent); font-weight: 700; }
  .bottombar .bi { position: relative; font-size: 1.35rem; line-height: 1; }
  .bottombar .badge { position: absolute; top: -4px; left: 55%; font-size: .65rem; min-width: 16px; padding: 0 4px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .site-footer { padding-bottom: 8px; }
}

/* telas pequenas */
@media (max-width: 600px) {
  .shell { margin: 12px auto; padding: 0 12px; }
  .landing { padding: 0 12px 32px; }
  .card { padding: 14px; border-radius: 16px; }
  .brand-name { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  h1 { font-size: 1.4rem; }
  .market-head .btn { width: 100%; text-align: center; }
  .btn.big { width: 100%; text-align: center; }
  .hero-cta .btn { flex: 1 1 100%; }
  .admin-row, .payout-row, .ledger-row { flex-wrap: wrap; }
  .kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .plans { width: 100%; } .plan { flex: 1 1 28%; }
  .thumbs img { width: 70px; height: 70px; }
  .chat .thread { max-height: 60vh; }
}
@media (max-width: 360px) { .grid-ads { grid-template-columns: 1fr; } .brand-name { display: none; } .stats > div { flex-basis: 100%; max-width: none; } }

/* telas de toque: alvos de pelo menos ~44 px */
@media (pointer: coarse) {
  .btn, button:not(.ghost), button.ghost, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), select { min-height: 44px; }
  textarea { min-height: 88px; }
  a.back, .faq summary, .admin-menu summary, details > summary { display: block; padding-top: 10px; padding-bottom: 10px; }
  a.back { display: inline-block; }
  .chip { padding: 10px 16px; }
  .auth a.muted, .center a { display: inline-block; padding: 10px 6px; }
  .act { min-height: 40px; min-width: 40px; }
  .tabs a { min-height: 44px; display: inline-flex; align-items: center; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
}
@media (min-width: 1700px) { .shell, .landing { max-width: 1280px; } .topbar { padding-left: max(16px, calc(50% - 640px)); padding-right: max(16px, calc(50% - 640px)); } }

/* nada pode alargar a página: conteúdo longo quebra em vez de empurrar a tela */
main, .shell > * { min-width: 0; }
.card { min-width: 0; overflow-wrap: anywhere; }
.post-body, .post-main, .desc, .thread, .bubble { overflow-wrap: anywhere; }
.grid-ads { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
@media (max-width: 860px) {
  main > p:first-child a, .back { display: inline-block; padding: 10px 4px 10px 0; }
  .market-head { flex-direction: column; align-items: stretch; }
  .market-search { flex-wrap: wrap; } .market-search input { flex: 1 1 140px; }
}
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline input, form.inline textarea { flex: 1 1 160px; min-width: 0; }
.chat-head a { display: inline-block; padding: 10px 4px; }
.alert a, p.small a, p.muted a { display: inline-block; padding: 6px 0; }
