/* ==========================================================================
   SABIA - tema verde-amarelo (Brasil). Light + dark. Layout estilo Twitter.
   Variaveis de marca (--brand, --accent, --ink) sao sobrescritas em runtime
   pelo app.js a partir de /api/config, entao o admin muda a cara sem rebuild.
   ========================================================================== */
:root {
  --brand: #009739;
  --brand-dark: #007a2e;
  --accent: #FEDD00;
  --ink: #0a2540;

  --brand-soft: color-mix(in srgb, var(--brand) 12%, white);
  --brand-tint: color-mix(in srgb, var(--brand) 8%, white);

  --bg: #f7faf7;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --text: #12201a;
  --text-dim: #5c6b63;
  --text-mute: #8a978f;
  --border: #e4ebe4;
  --border-strong: #d3ddd3;
  --hover: #f0f5f0;
  --like: #e0245e;
  --repost: var(--brand);
  --shadow: 0 2px 10px rgba(10, 37, 24, .06);
  --shadow-lg: 0 14px 44px rgba(10, 37, 24, .18);
  --radius: 16px;
  --maxw: 1230px;
  font-synthesis: none;
}
[data-theme="dark"] {
  --brand-soft: color-mix(in srgb, var(--brand) 22%, #0d1a12);
  --brand-tint: color-mix(in srgb, var(--brand) 14%, #0d1a12);
  --bg: #0a1410;
  --bg-elev: #0e1c15;
  --card: #0e1c15;
  --text: #e8f1ea;
  --text-dim: #9fb0a5;
  --text-mute: #74857b;
  --border: #1c2c22;
  --border-strong: #26382c;
  --hover: #13221a;
  --shadow: 0 2px 12px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--brand-dark); text-decoration: none; }
[data-theme="dark"] a { color: color-mix(in srgb, var(--brand) 70%, white); }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ------- animacao do mascote (respeita reduce motion) ------- */
@keyframes louroBob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.louro-bob { animation: louroBob 3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .louro-bob { animation: none; } }

/* ------- boot ------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--text-dim); }

/* ==========================================================================
   SHELL 3 COLUNAS
   ========================================================================== */
.layout { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 275px minmax(0, 1fr) 350px; gap: 0; }
.rail-left { position: sticky; top: 0; height: 100vh; padding: 8px 10px; display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow-y: auto; }
.rail-left::-webkit-scrollbar { width: 0; }
.rail-right { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 10px 16px 40px; border-left: 1px solid var(--border); }
.rail-right::-webkit-scrollbar { width: 8px; } .rail-right::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.col-main { min-height: 100vh; border-right: 0; }

/* ------- topo verde-amarelo sutil ------- */
.brandstripe { height: 4px; background: linear-gradient(90deg, var(--brand) 0 55%, var(--accent) 55% 100%); }

/* ------- rail esquerda ------- */
.logo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 999px; }
.logo .wm { font-weight: 900; font-size: 24px; letter-spacing: .5px; color: var(--brand-dark); }
[data-theme="dark"] .logo .wm { color: color-mix(in srgb, var(--brand) 65%, white); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a, .nav button.navitem {
  display: flex; align-items: center; gap: 16px; padding: 12px 14px; border-radius: 999px;
  color: var(--text); font-size: 19px; background: none; border: 0; text-align: left; width: 100%;
}
.nav a:hover, .nav button.navitem:hover { background: var(--hover); text-decoration: none; }
.nav a.active { font-weight: 800; }
.nav .ico { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; }
.nav .badge { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; }
.cantar-btn {
  margin: 14px 6px 8px; padding: 14px; border-radius: 999px; border: 0; width: calc(100% - 12px);
  background: var(--brand); color: #fff; font-weight: 800; font-size: 17px; box-shadow: var(--shadow);
}
.cantar-btn:hover { background: var(--brand-dark); }
.rail-left .spacer { flex: 1; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 999px; margin-bottom: 6px; }
.me-chip:hover { background: var(--hover); }
.me-chip .who { min-width: 0; }
.me-chip .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip .who span { color: var(--text-mute); font-size: 13px; }
.me-chip .more { margin-left: auto; color: var(--text-mute); }

/* ------- coluna central ------- */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(8px); background: color-mix(in srgb, var(--bg-elev) 82%, transparent); border-bottom: 1px solid var(--border); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 800; padding: 14px 16px 6px; }
.topbar .sub { padding: 0 16px 8px; color: var(--text-mute); font-size: 13px; margin-top: -6px; }
.tabs { display: flex; }
.tabs button { flex: 1; background: none; border: 0; padding: 15px 8px; color: var(--text-dim); font-weight: 600; font-size: 15px; position: relative; }
.tabs button:hover { background: var(--hover); }
.tabs button.active { color: var(--text); font-weight: 800; }
.tabs button.active::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 56px; height: 4px; border-radius: 4px; background: var(--brand); }

/* ------- composer ------- */
.composer { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 10px solid var(--border); }
.composer.inline { border-bottom: 1px solid var(--border); }
.composer .grow { flex: 1; min-width: 0; }
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: none; color: var(--text);
  font: inherit; font-size: 20px; line-height: 1.4; padding: 10px 0; min-height: 54px;
}
.composer .tools { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.composer .tools .iconbtn { color: var(--brand); }
.composer .tools .count { margin-left: auto; font-size: 13px; color: var(--text-mute); }
.composer .tools .count.warn { color: #e0a800; } .composer .tools .count.over { color: var(--like); }
.composer .send { padding: 9px 20px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font-weight: 800; }
.composer .send:disabled { opacity: .5; }
.iconbtn { background: none; border: 0; border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--text-dim); }
.iconbtn:hover { background: var(--brand-tint); color: var(--brand); }

/* ==========================================================================
   CANTO (post card)
   ========================================================================== */
.feed { display: block; }
.post { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.post:hover { background: var(--hover); }
.post .avatar { flex: 0 0 46px; }
.post .main { flex: 1; min-width: 0; }
.repost-tag, .reply-tag { display: flex; align-items: center; gap: 8px; color: var(--text-mute); font-size: 13px; font-weight: 600; padding-left: 34px; margin-bottom: 2px; }
.repost-tag svg, .reply-tag svg { width: 15px; height: 15px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px; overflow: hidden; user-select: none; }
.avatar.sm { width: 38px; height: 38px; font-size: 16px; }
.avatar.lg { width: 76px; height: 76px; font-size: 30px; }
.phead { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.phead .name { font-weight: 700; color: var(--text); }
.phead .name:hover { text-decoration: underline; }
.phead .handle, .phead .dot, .phead .time { color: var(--text-mute); }
.phead .time:hover { text-decoration: underline; }
.phead .menu { margin-left: auto; }
.verified { color: var(--brand); display: inline-flex; }
.verified svg { width: 17px; height: 17px; }
.pbody { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0; }
.pbody a { color: var(--brand-dark); }
[data-theme="dark"] .pbody a { color: color-mix(in srgb, var(--brand) 72%, white); }
.pimg { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-height: 510px; }
.pimg img { display: block; width: 100%; object-fit: cover; }
.quoted { margin-top: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; }
.quoted:hover { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.quoted .phead { font-size: 14px; }
.quoted .pbody { font-size: 14px; color: var(--text-dim); }
.quoted.gone { color: var(--text-mute); font-style: italic; }

.actions { display: flex; justify-content: space-between; max-width: 440px; margin-top: 8px; color: var(--text-mute); }
.act { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: inherit; font-size: 13px; padding: 4px; border-radius: 999px; }
.act svg { width: 19px; height: 19px; }
.act .n { min-width: 14px; }
.act:hover { color: var(--brand); }
.act.reply:hover { color: #1d9bf0; }
.act.repost:hover, .act.repost.on { color: var(--brand); }
.act.like:hover, .act.like.on { color: var(--like); }
.act.like.on svg { fill: var(--like); }
.act.bookmark:hover, .act.bookmark.on { color: var(--brand); }
.act.bookmark.on svg { fill: var(--brand); }
.act.repost.on svg { fill: var(--brand); }

/* ------- detalhe do canto ------- */
.detail .post { cursor: default; }
.detail .lead { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.detail .lead .pbody { font-size: 23px; line-height: 1.35; }
.detail .lead .metaline { color: var(--text-mute); padding: 12px 0; border-bottom: 1px solid var(--border); margin-top: 12px; }
.detail .lead .stats { display: flex; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.detail .lead .stats b { color: var(--text); }
.thread-line { width: 2px; background: var(--border-strong); margin: 0 auto; flex: 1; }

/* ==========================================================================
   PERFIL
   ========================================================================== */
.profile .cover { height: 130px; background: linear-gradient(120deg, var(--brand), var(--brand-dark) 70%, #05421f); position: relative; }
.profile .cover .stripe { position: absolute; inset: auto 0 0 0; height: 6px; background: var(--accent); }
.profile .phead-wrap { padding: 0 16px 12px; position: relative; }
.profile .avatar.lg { margin-top: -42px; border: 4px solid var(--bg-elev); background: var(--brand); }
.profile .toprow { display: flex; justify-content: flex-end; padding-top: 12px; min-height: 54px; }
.profile h2 { margin: 8px 0 0; font-size: 21px; }
.profile .at { color: var(--text-mute); }
.profile .bio { margin: 10px 0; }
.profile .meta { color: var(--text-mute); display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.profile .counts { display: flex; gap: 18px; margin-top: 10px; }
.profile .counts b { color: var(--text); }
.follow-btn { padding: 8px 18px; border-radius: 999px; font-weight: 800; border: 1px solid var(--border-strong); background: var(--text); color: var(--bg-elev); }
.follow-btn.following { background: transparent; color: var(--text); }
.follow-btn.following:hover { border-color: var(--like); color: var(--like); }
.edit-btn { padding: 8px 18px; border-radius: 999px; font-weight: 700; border: 1px solid var(--border-strong); background: transparent; color: var(--text); }

/* ==========================================================================
   RAIL DIREITA (busca, trends, quem seguir)
   ========================================================================== */
.searchbox { position: sticky; top: 0; padding: 8px 0 12px; background: var(--bg); z-index: 5; }
.searchbox input { width: 100%; border: 1px solid var(--border); background: var(--brand-tint); border-radius: 999px; padding: 11px 16px; color: var(--text); font: inherit; outline: 0; }
.searchbox input:focus { background: var(--bg-elev); border-color: var(--brand); }
.widget { background: var(--brand-tint); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.widget h3 { margin: 0; padding: 12px 16px; font-size: 19px; font-weight: 800; }
.widget .row { padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.widget .row:hover { background: var(--hover); cursor: pointer; }
.trend .k { font-size: 12px; color: var(--text-mute); }
.trend .t { font-weight: 800; }
.trend .c { font-size: 12px; color: var(--text-mute); }
.wtf .who { min-width: 0; flex: 1; }
.wtf .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wtf .who span { color: var(--text-mute); font-size: 13px; }
.wtf .follow-btn { padding: 6px 14px; font-size: 14px; }
.rail-foot { color: var(--text-mute); font-size: 12px; padding: 8px 16px; line-height: 1.7; }
.rail-foot a { color: var(--text-mute); }

/* ==========================================================================
   OVERLAY / MODAIS / TOASTS
   ========================================================================== */
.overlay { position: fixed; inset: 0; background: rgba(10, 20, 14, .55); display: grid; place-items: start center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.overlay.hidden { display: none; }
.modal { background: var(--bg-elev); border-radius: 20px; width: 100%; max-width: 600px; box-shadow: var(--shadow-lg); }
.modal .mhead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.modal .mhead .x { font-size: 22px; line-height: 1; }
.modal .mhead .t { font-weight: 800; }
.modal .mbody { padding: 6px 14px 16px; }

/* auth */
.auth { max-width: 440px; text-align: center; padding: 26px 30px 32px; }
.auth h2 { margin: 8px 0 2px; font-size: 26px; }
.auth p.tag { color: var(--text-dim); margin: 0 0 18px; }
.auth .field { text-align: left; margin: 10px 0; }
.auth label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 4px; font-weight: 600; }
.auth input { width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; outline: 0; }
.auth input:focus { border-color: var(--brand); }
.auth .primary { width: 100%; margin-top: 16px; padding: 13px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font-weight: 800; font-size: 16px; }
.auth .primary:hover { background: var(--brand-dark); }
.auth .switch { margin-top: 14px; color: var(--text-dim); font-size: 14px; }
.auth .switch a { font-weight: 700; cursor: pointer; }
.auth .err { background: color-mix(in srgb, var(--like) 12%, transparent); color: var(--like); border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-top: 10px; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: toastin .2s ease; }
[data-theme="dark"] .toast { background: var(--brand); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* estados vazios */
.empty { text-align: center; padding: 46px 24px; color: var(--text-dim); display: grid; justify-items: center; gap: 8px; }
.empty h3 { margin: 6px 0 0; color: var(--text); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loadmore { text-align: center; padding: 16px; color: var(--brand); font-weight: 700; cursor: pointer; }
.loadmore:hover { background: var(--hover); }
.feed-sentinel { height: 1px; }

/* pilula "novos cantos" (feed vivo) */
#new-pill { text-align: center; }
.new-pill { margin: 8px auto; background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 9px 20px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); cursor: pointer; position: sticky; top: 56px; z-index: 18; }
.new-pill:hover { background: var(--brand-dark); }

/* lightbox de imagem (tocar na foto amplia) */
.pmedia img[data-lightbox] { cursor: zoom-in; }
.lightbox { min-height: 88vh; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 8px; cursor: zoom-out; }

/* ==========================================================================
   LANDING / HERO (visitante deslogado)
   ========================================================================== */
.landing { position: relative; text-align: center; padding: 32px 22px 26px; border-bottom: 10px solid var(--border); overflow: hidden; background: radial-gradient(120% 90% at 50% -10%, var(--brand-tint), transparent 70%); }
.landing-flag { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--brand) 0 55%, var(--accent) 55% 100%); }
.landing-mascot { display: flex; justify-content: center; }
.landing h2 { margin: 12px 0 6px; font-size: 28px; letter-spacing: -.5px; }
.landing .lead { max-width: 490px; margin: 0 auto; color: var(--text-dim); font-size: 16px; line-height: 1.5; }
.landing .lead b { color: var(--brand-dark); }
[data-theme="dark"] .landing .lead b { color: color-mix(in srgb, var(--brand) 72%, white); }
.landing-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px auto; max-width: 520px; }
.lchip { background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.landing-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.cta-primary { padding: 13px 26px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font-weight: 800; font-size: 16px; box-shadow: var(--shadow); }
.cta-primary:hover { background: var(--brand-dark); }
.cta-ghost { padding: 13px 24px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font-weight: 700; font-size: 16px; }
.cta-ghost:hover { background: var(--hover); }
.landing-sub { margin-top: 14px; color: var(--text-mute); font-size: 13px; }

/* chips / botoes genericos */
.ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); border-radius: 999px; padding: 7px 14px; font-weight: 700; }
.ghost:hover { background: var(--hover); }
.theme-toggle { position: fixed; bottom: 16px; right: 16px; z-index: 50; }

/* ==========================================================================
   MOBILE
   ========================================================================== */
.mobtop, .mobnav { display: none; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 88px minmax(0,1fr); }
  .rail-right { display: none; }
  .logo .wm, .nav a span.lbl, .nav button.navitem span.lbl, .me-chip .who, .me-chip .more { display: none; }
  .cantar-btn { font-size: 0; padding: 14px 0; }
  .cantar-btn::after { content: "+"; font-size: 26px; }
  .nav a, .nav button.navitem { justify-content: center; }
}
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }
  .rail-left { display: none; }
  .col-main { border: 0; padding-bottom: 60px; }
  .mobtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 8px 14px; background: color-mix(in srgb, var(--bg-elev) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
  .mobtop .wm { font-weight: 900; font-size: 20px; color: var(--brand-dark); }
  [data-theme="dark"] .mobtop .wm { color: color-mix(in srgb, var(--brand) 65%, white); }
  .mobtop .sp { flex: 1; }
  .mobnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--bg-elev); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .mobnav button { flex: 1; background: none; border: 0; padding: 12px 0; color: var(--text-dim); display: grid; place-items: center; position: relative; }
  .mobnav button.active { color: var(--brand); }
  .mobnav .badge { position: absolute; top: 6px; right: 50%; margin-right: -18px; background: var(--brand); color: #fff; border-radius: 999px; font-size: 10px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; }
  .fab { position: fixed; right: 16px; bottom: 74px; z-index: 45; width: 58px; height: 58px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; font-size: 30px; box-shadow: var(--shadow-lg); display: grid; place-items: center; }
  .theme-toggle { bottom: 80px; }
  .detail .lead .pbody { font-size: 20px; }
  .composer.inline { display: none; }
  .stories-bar { padding: 10px 12px; }
}

/* ==========================================================================
   SELO OURO (premium) + selo verificado
   ========================================================================== */
.verified.gold { color: var(--accent); }
.verified.gold svg path:first-child { fill: #F5B301; }
[data-theme="dark"] .verified.gold svg path:first-child { fill: #FFCE1F; }

/* ==========================================================================
   MIDIA (video) + link card
   ========================================================================== */
.pmedia { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-height: 540px; background: #000; }
.pmedia img, .pmedia video { display: block; width: 100%; max-height: 540px; object-fit: contain; background: #000; }
.pembed { margin-top: 10px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: #000; border: 1px solid var(--border); }
.pembed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* editar perfil: capa + foto */
.ep-cover { height: 140px; border-radius: 14px; background-color: var(--brand-tint); background-size: cover; background-position: center; position: relative; }
.ep-cover-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.ep-cover-actions .ghost { background: rgba(0,0,0,.5); color: #fff; border-color: transparent; font-size: 13px; padding: 5px 10px; }
.ep-avatar { position: absolute; left: 16px; bottom: -32px; width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--bg-elev); background-color: var(--brand); background-size: cover; background-position: center; display: grid; place-items: center; }
.ep-avatar-btn { background: rgba(0,0,0,.45); color: #fff; border: 0; border-radius: 50%; width: 100%; height: 100%; display: grid; place-items: center; cursor: pointer; }
.ep-avatar-btn svg { width: 24px; height: 24px; }
.linkcard { margin-top: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; display: block; }
.linkcard:hover { background: var(--hover); }
.linkcard .lc-img { width: 100%; max-height: 260px; object-fit: cover; border-bottom: 1px solid var(--border); background: var(--brand-tint); }
.linkcard .lc-body { padding: 10px 12px; }
.linkcard .lc-site { color: var(--text-mute); font-size: 12px; }
.linkcard .lc-title { font-weight: 700; margin: 2px 0; }
.linkcard .lc-desc { color: var(--text-dim); font-size: 13px; max-height: 40px; overflow: hidden; }
.edited { color: var(--text-mute); font-size: 12px; }

/* composer: previa de midia anexada */
.attach-preview { margin-top: 8px; position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-width: 320px; }
.attach-preview img, .attach-preview video { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.attach-preview .rm { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 50%; width: 30px; height: 30px; font-size: 18px; }
.attach-preview .upbar { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); color: #fff; }

/* ==========================================================================
   STORIES
   ========================================================================== */
.stories-bar { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 10px solid var(--border); overflow-x: auto; }
.stories-bar::-webkit-scrollbar { height: 0; }
.story-cell { flex: 0 0 auto; width: 66px; text-align: center; cursor: pointer; }
.story-ring { width: 62px; height: 62px; border-radius: 50%; padding: 3px; margin: 0 auto; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.story-ring.seen { background: var(--border-strong); }
.story-ring.add { background: var(--brand-tint); border: 2px dashed var(--brand); display: grid; place-items: center; }
.story-ring .inner { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--bg-elev); display: grid; place-items: center; color: #fff; font-weight: 800; overflow: hidden; background: var(--brand); }
.story-cell .lbl { font-size: 12px; color: var(--text-dim); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-add-plus { font-size: 30px; color: var(--brand); font-weight: 400; line-height: 1; }

/* viewer de story */
.story-viewer { position: fixed; inset: 0; background: #0a0a0a; z-index: 300; display: grid; place-items: center; }
.story-stage { position: relative; width: 100%; max-width: 460px; height: 100%; max-height: 92vh; background: #111; border-radius: 14px; overflow: hidden; display: grid; }
.story-stage img, .story-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; grid-area: 1/1; }
.story-text { grid-area: 1/1; display: grid; place-items: center; text-align: center; padding: 30px; color: #fff; font-size: 26px; font-weight: 700; line-height: 1.35; }
.story-progress { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 3; }
.story-progress .seg { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 3px; overflow: hidden; }
.story-progress .seg .fill { height: 100%; width: 0; background: #fff; }
.story-progress .seg.done .fill { width: 100%; }
.story-head { position: absolute; top: 20px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; z-index: 3; color: #fff; }
.story-head .avatar { width: 34px; height: 34px; font-size: 15px; }
.story-head b { color: #fff; } .story-head .t { color: rgba(255,255,255,.7); font-size: 13px; }
.story-head .x, .story-head .del { margin-left: auto; background: rgba(0,0,0,.4); border: 0; color: #fff; border-radius: 50%; width: 34px; height: 34px; font-size: 18px; }
.story-nav { position: absolute; inset: 0; display: flex; z-index: 2; }
.story-nav .prev, .story-nav .next { flex: 1; }
.story-nav .next { flex: 2; }

/* ==========================================================================
   PREMIUM (paywall / planos / pix)
   ========================================================================== */
.premium-hero { text-align: center; padding: 28px 20px 10px; }
.premium-hero .crown { font-size: 0; }
.premium-hero h2 { margin: 10px 0 4px; font-size: 26px; }
.premium-hero h2 .gold { color: #F5B301; }
.premium-hero p { color: var(--text-dim); margin: 0 auto; max-width: 460px; }
.plan-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; padding: 16px; }
@media (max-width: 620px) { .plan-grid { grid-template-columns: 1fr; } }
.plan { border: 2px solid var(--border-strong); border-radius: var(--radius); padding: 18px; background: var(--card); }
.plan.best { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.plan .pname { font-weight: 800; font-size: 17px; }
.plan .price { font-size: 30px; font-weight: 900; margin: 6px 0; }
.plan .price small { font-size: 14px; color: var(--text-mute); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 12px 0; }
.plan li { padding: 5px 0 5px 24px; position: relative; font-size: 14px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 900; }
.plan .choose { width: 100%; padding: 12px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font-weight: 800; }
.plan.best .choose { background: linear-gradient(135deg, #F5B301, #E09600); color: #3a2a00; }
.pix-box { text-align: center; padding: 6px 4px; }
.pix-code { word-break: break-all; background: var(--brand-tint); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; margin: 10px 0; max-height: 120px; overflow: auto; text-align: left; }
.badge-gold { display: inline-block; background: linear-gradient(135deg, #F5B301, #E09600); color: #3a2a00; font-weight: 800; font-size: 12px; padding: 2px 10px; border-radius: 999px; }

/* ==========================================================================
   MENSAGENS DIRETAS (DM)
   ========================================================================== */
.dm-thread.unread .pbody { color: var(--text) !important; font-weight: 600; }
.dm-row { display: flex; margin: 6px 0; }
.dm-row.mine { justify-content: flex-end; }
.dm-bubble { max-width: 78%; padding: 9px 13px; border-radius: 18px; background: var(--hover); position: relative; overflow-wrap: anywhere; }
.dm-row.mine .dm-bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.dm-row.theirs .dm-bubble { border-bottom-left-radius: 4px; }
.dm-row.mine .dm-bubble a { color: #eafff0; text-decoration: underline; }
.dm-bubble .pmedia { margin-top: 6px; max-height: 300px; }
.dm-time { display: block; font-size: 10px; opacity: .7; margin-top: 3px; text-align: right; }
.dm-composer { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--bg-elev); border-top: 1px solid var(--border); }
.dm-composer input { flex: 1; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); border-radius: 999px; padding: 11px 16px; font: inherit; outline: 0; }
.dm-composer input:focus { border-color: var(--brand); }
.dm-composer .send { width: 42px; height: 42px; border-radius: 50%; padding: 0; display: grid; place-items: center; }
.dm-composer .send svg { width: 20px; height: 20px; }
.ghost-round { border: 1px solid var(--border-strong); border-radius: 50%; width: 38px; height: 38px; }
@media (max-width: 700px) { .dm-composer { bottom: 58px; } #dm-body { padding-bottom: 20px !important; } }
