/* Painel Ballys v2: minimalista, tons neutros e um só destaque (personalizável em Ajustes), claro/escuro, pensado primeiro para o celular. */
:root {
  --bg: #f7f7f8; --surface: #ffffff; --surface-2: #f2f2f4; --text: #18181b; --muted: #71717a; --border: #e4e4e7;
  --accent: #128c7e; --on-accent: #ffffff; --danger: #dc2626; --warn: #b45309; --ok: #16a34a;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --radius: 14px; --row: 14px; --gap: 14px;
  --gutter: clamp(18px, 3vw, 40px); --maxw: 1600px; --pad-card: 20px;
  --momo-body: color-mix(in srgb, var(--accent) 10%, #fffaf3); --momo-line: color-mix(in srgb, var(--accent) 30%, #e9dccd);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --surface: #111113; --surface-2: #1c1c1f; --text: #fafafa; --muted: #a1a1aa; --border: #27272a;
    --danger: #f87171; --warn: #fbbf24; --ok: #4ade80; --shadow: none; color-scheme: dark;
    --momo-body: color-mix(in srgb, var(--accent) 16%, #f3ece4); --momo-line: color-mix(in srgb, var(--accent) 40%, #b9ab9c);
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --surface: #111113; --surface-2: #1c1c1f; --text: #fafafa; --muted: #a1a1aa; --border: #27272a;
  --danger: #f87171; --warn: #fbbf24; --ok: #4ade80; --shadow: none; color-scheme: dark;
    --momo-body: color-mix(in srgb, var(--accent) 16%, #f3ece4); --momo-line: color-mix(in srgb, var(--accent) 40%, #b9ab9c);
}
:root[data-density="compact"] { --row: 9px; --gap: 10px; --radius: 11px; --pad-card: 14px; }
:root[data-hints="off"] .hint, :root[data-hints="off"] .momo-say { display: none !important; }

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
/* sem barra de rolagem visível: a página e o menu continuam rolando com a roda, o touchpad ou o dedo */
html, .side { scrollbar-width: none; }
html::-webkit-scrollbar, .side::-webkit-scrollbar { display: none; }
/* nas listas internas (grupos, código), uma barra fina e discreta */
.groups, pre, dialog { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100dvh;
  font: 14.5px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.hint a, .momo-say a, .note a, .warn-box a, .muted a { color: var(--accent); }
code { font: .86em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 12px 14px; border-radius: 10px; overflow: auto; margin: 6px 0 0; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; } h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); } .error { color: var(--danger); font-size: 13.5px; } .ok-text { color: var(--ok); }
.pad { padding: 14px; }
.grow { flex: 1; min-width: 0; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.momo { fill: initial; stroke: none; }

/* --- topo --- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  padding: calc(10px + var(--safe-top)) max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter))) 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; flex: 1; min-width: 0; text-decoration: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { border-radius: 7px; }
.tabs { display: flex; gap: 2px; }
.tab { display: flex; align-items: center; gap: 7px; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; font-size: 13.5px; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-2); }
.tab svg { width: 16px; height: 16px; }
.top-actions { display: flex; gap: 8px; }
.offline { background: var(--warn); color: #1b1300; text-align: center; font-size: 13px; padding: 6px 12px; }

main { max-width: var(--maxw); margin: 0 auto; padding: 32px var(--gutter) 64px; }
.view { display: flex; flex-direction: column; gap: 20px; animation: fade .18s ease-out; }
.view.narrow, .guide, .settings { max-width: 1080px; width: 100%; margin-inline: auto; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.view-head p { font-size: 13.5px; margin-top: 3px; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

/* --- controles --- */
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; box-shadow: var(--shadow); }
textarea { resize: vertical; min-height: 42px; line-height: 1.45; }
select:disabled { opacity: .7; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); outline-offset: 0; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.opt { color: var(--muted); font-weight: 400; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--on-accent); border: 1px solid transparent; border-radius: 9px;
  padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: filter .12s, background .12s, border-color .12s; white-space: nowrap; text-decoration: none; }
button:hover, .btn:hover { filter: brightness(1.07); }
button:active, .btn:active { filter: brightness(.94); }
button:disabled { opacity: .5; cursor: default; }
button svg, .btn svg { width: 16px; height: 16px; }
button.ghost, .btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
button.ghost:hover { filter: none; background: var(--surface-2); }
button.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
button.danger:hover { filter: none; background: color-mix(in srgb, var(--danger) 8%, transparent); }
button.small, .btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--muted); padding: 6px; border-radius: 8px; border: 0; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); filter: none; }
form { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; flex-direction: row; }
.row > * { flex: 1 1 160px; }
.row > button { flex: 0 0 auto; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }
.stack { gap: var(--gap); }

/* dicas: o "para que serve" de cada coisa; dá para esconder em Ajustes */
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; font-weight: 400; }
.note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.warn-box { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); border-radius: 10px; padding: 10px 12px; }
.warn-box svg { width: 16px; height: 16px; margin-top: 1px; }
.result { font-size: 13px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.result.ok { color: var(--ok); } .result.bad { color: var(--danger); }

/* --- Momo, o mascote (um mochi com um brotinho) --- */
.momo { display: block; flex: none; overflow: visible; }
.momo-body { transform-box: fill-box; transform-origin: 50% 100%; animation: squish 4.2s ease-in-out infinite; }
.momo-sprout { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 3.4s ease-in-out infinite; }
.momo-eyes { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
.momo-shadow { transform-box: fill-box; transform-origin: center; animation: shadow 4.2s ease-in-out infinite; }
.momo-alerta .momo-body { animation: wobble 2.4s ease-in-out infinite; }
.momo-dormindo .momo-body { animation: breathe 3.6s ease-in-out infinite; }
.momo-feliz .momo-body { animation: hop 2.8s cubic-bezier(.3,.7,.4,1) infinite; }
@keyframes squish { 0%, 100% { transform: scale(1, 1); } 45% { transform: scale(1.035, .965); } 60% { transform: scale(.98, 1.025) translateY(-1.5px); } }
@keyframes hop { 0%, 60%, 100% { transform: none; } 70% { transform: scale(1.06, .92); } 80% { transform: translateY(-4px) scale(.96, 1.05); } 90% { transform: scale(1.03, .97); } }
@keyframes breathe { 50% { transform: scale(1.03, .975); } }
@keyframes wobble { 0%, 78%, 100% { transform: rotate(0); } 84% { transform: rotate(-6deg); } 92% { transform: rotate(5deg); } }
@keyframes sway { 50% { transform: rotate(-9deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes shadow { 45% { transform: scaleX(1.06); } 60% { transform: scaleX(.94); } }
.momo-say { display: flex; gap: 14px; align-items: center; background: linear-gradient(120deg, var(--accent-soft), var(--surface) 60%); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: var(--radius); padding: 12px 18px 12px 12px; box-shadow: var(--shadow); }
.momo-say p { font-size: 13.5px; line-height: 1.55; }
.momo-hero { margin-bottom: 6px; filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--accent) 22%, transparent)); }

/* --- status --- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; padding: 2px 9px 2px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-open { color: var(--ok); } .st-qr, .st-connecting { color: var(--warn); } .st-close { color: var(--muted); } .st-logged_out { color: var(--danger); }
.st-qr::before, .st-connecting::before, .dot.st-qr, .dot.st-connecting { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* --- avatar (foto do WhatsApp por cima das iniciais) --- */
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 600; font-size: 13px; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent); }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2.5px var(--surface); }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.lg { width: 48px; height: 48px; font-size: 15px; }
.avatar.xl { width: 64px; height: 64px; font-size: 19px; }
.avatar.xl .dot { width: 15px; height: 15px; }
.who { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small.warn { color: var(--warn); } .who small svg { width: 13px; height: 13px; }
.who .status { align-self: flex-start; margin-top: 4px; }

/* --- lista de instâncias (cards como os da Evolution) --- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar select { width: auto; flex: 0 0 auto; }
.search { position: relative; flex: 1 1 240px; display: block; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search input { padding-left: 34px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: calc(var(--gap) + 4px); }
.icard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, transform .15s; }
.icard:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); transform: translateY(-1px); }
.icard header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -4px 0 0; }
.icard-name { font-weight: 600; font-size: 15px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard-profile { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 2px 0; }
.icard footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; }
.pill svg { width: 13px; height: 13px; }
.token-row { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 9px; padding: 3px 3px 3px 10px; }
.tok { flex: 1; min-width: 0; background: none; padding: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.token-row .icon-btn { padding: 5px; }
.token-row .icon-btn svg { width: 15px; height: 15px; }
.empty { text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px 20px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty p { max-width: 420px; }
.empty button, .empty .btn { margin-top: 8px; }

/* --- página da instância: menu lateral (no celular vira faixa de abas) --- */
.ipage { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: clamp(24px, 2.6vw, 40px); align-items: start; animation: fade .18s ease-out; }
.side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 88px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); padding: 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); text-decoration: none; align-self: flex-start; padding: 2px 6px 0; }
.back:hover { color: var(--text); }
.back svg { width: 15px; height: 15px; }
.side-head .avatar.lg { width: 42px; height: 42px; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 3%, var(--surface)) 75%);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border)); }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.side-group { display: flex; flex-direction: column; gap: 1px; }
.side-group + .side-group { border-top: 1px solid var(--border); padding-top: 6px; }
.side-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: color-mix(in srgb, var(--muted) 85%, transparent); padding: 2px 10px 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 3px 8px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s; }
.side-nav a svg { width: 16px; height: 16px; }
.side-nav a::before { content: ""; width: 26px; height: 26px; margin: 0 -36px 0 0; border-radius: 8px; flex: none; transition: background .12s; }
.side-nav a svg { position: relative; left: 5px; margin-right: 5px; }
.side-nav a:hover { color: var(--text); background: var(--surface-2); }
.side-nav a:hover::before { background: var(--surface); }
.side-nav a.active { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.side-nav a.active::before { background: var(--accent); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.side-nav a.active svg { color: var(--on-accent); }
/* notebook com tela baixa: tudo do menu cabe sem rolar */
@media (min-width: 861px) and (max-height: 820px) {
  .side { top: 68px; max-height: calc(100dvh - 80px); padding: 8px; gap: 6px; }
  .side-head { padding: 8px 10px; }
  .side-head .status { margin-top: 2px; }
  .side-nav a { padding: 2px 8px; font-size: 13px; }
  .side-nav a::before { width: 22px; height: 22px; margin-right: -32px; border-radius: 7px; }
  .side-nav a svg { width: 15px; height: 15px; left: 3.5px; margin-right: 3.5px; }
  .side-nav { gap: 3px; }
  .side-group + .side-group { padding-top: 4px; }
  .side-label { font-size: 10px; padding-bottom: 1px; }
}
.pane { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; animation: fade .15s ease-out; scroll-margin-top: 140px; }
.pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 2px; }
.pane-head .hint { margin-top: 4px; font-size: 13px; max-width: 640px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--pad-card); display: flex; flex-direction: column; gap: 16px; }
.card-title { display: flex; align-items: center; gap: 8px; }
.card-title b { font-weight: 600; font-size: 14.5px; }
.card-title svg { color: var(--accent); }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary b::before { content: "▸ "; color: var(--muted); }
details.card[open] > summary b::before { content: "▾ "; }
details.card:not([open]) { gap: 0; }
details > summary.hint { cursor: pointer; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }

/* linhas com chave liga/desliga e explicação (como as da Evolution, com o "para que serve") */
.trow { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 0; cursor: pointer; font-weight: 400; }
.trow-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trow-text b { font-weight: 500; font-size: 14px; }
.trow.warn .trow-text b { color: var(--warn); }
.field > span:first-child { font-size: 13px; font-weight: 500; }
.field.sub { padding-left: 14px; border-left: 2px solid var(--border); }
.field.dim { opacity: .55; }
.copy-box { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 9px; padding: 6px 6px 6px 12px; }
.copy-box code { flex: 1; background: none; padding: 0; font-size: 12px; }
.ev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border); }
.ev-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ev-list .trow { padding: 10px 12px; }
.ev-list .trow + .trow { border-top: 1px solid var(--border); }
.ev-list .trow-text b code { background: none; padding: 0; font-size: 12.5px; font-weight: 600; }
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row > a.grow, .list-row > span.grow { display: flex; flex-direction: column; text-decoration: none; }
.list-row b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* dashboard */
.dash-top { display: flex; align-items: center; gap: 16px; }
.dash-top .who b { font-size: 17px; }
/* duas colunas em telas largas (notebook pra cima), uma no resto */
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
@media (min-width: 1200px) { .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cols-2.top { align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0; text-align: center; }
.qr-box img { width: 264px; max-width: 100%; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border); }
.steps { text-align: left; font-size: 13px; margin: 0; padding-left: 20px; color: var(--muted); }
.pairing { font: 600 28px ui-monospace, monospace; letter-spacing: 6px; }
.pair form { margin-top: 10px; }


/* --- guia e ajustes --- */
.guide, .settings { display: flex; flex-direction: column; gap: 10px; }
.guide details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 20px; box-shadow: var(--shadow); }
.guide summary { cursor: pointer; padding: 14px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: ""; width: 7px; height: 7px; border-right: 1.75px solid var(--muted); border-bottom: 1.75px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.guide details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.guide .body { padding: 0 0 18px; font-size: 13.5px; display: flex; flex-direction: column; gap: 10px; overflow-x: auto; }
.guide ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.guide table, .set table { border-collapse: collapse; width: 100%; font-size: 13px; }
.guide td, .set td { border-top: 1px solid var(--border); padding: 7px 10px 7px 0; vertical-align: top; }
.guide td:first-child { white-space: nowrap; }
.set { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.set-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-head b { font-size: 14px; font-weight: 500; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--muted); padding: 5px 11px; font-size: 12.5px; font-weight: 500; border-radius: 7px; }
.seg button:hover { filter: none; color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--surface); }
.swatch.on { border-color: var(--text); }
.switch { position: relative; width: 40px; height: 24px; flex: none; appearance: none; -webkit-appearance: none; background: var(--border); border-radius: 999px; padding: 0; border: 0; cursor: pointer; transition: background .15s; box-shadow: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* --- modal: no celular vira folha que sobe de baixo --- */
dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 18px 20px 20px; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.18); }
dialog[open] { animation: pop .16s ease-out; }
dialog::backdrop { background: rgba(9,9,11,.45); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(4px); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 10px;
  max-width: calc(100vw - 32px); z-index: 20; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

.login { max-width: 360px; margin: 9vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login p { font-size: 13.5px; }
.login form { width: 100%; margin-top: 12px; gap: 10px; }

/* --- tablet: o menu lateral vira faixa de abas rolável --- */
@media (max-width: 860px) {
  .ipage { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side { position: static; max-height: none; overflow: visible; gap: 10px; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
  .side-group + .side-group { border-top: 0; padding-top: 0; }
  .side-nav a::before { display: none; }
  .side-nav a svg { position: static; margin: 0; }
  .side-nav a.active svg { color: var(--accent); }
  .side-nav a.active { color: var(--accent); }
  .side-nav { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scroll-padding-inline: var(--gutter);
    scroll-snap-type: x proximity; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-group { flex-direction: row; gap: 6px; }
  .side-label { display: none; }
  .side-nav a { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; scroll-snap-align: center; }
  .side-nav a.active { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
  .side-nav svg { width: 15px; height: 15px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- celular --- */
@media (max-width: 720px) {
  /* sem blur no topo: backdrop-filter prenderia a barra de abas fixa dentro do cabeçalho */
  :root { --gutter: 18px; --pad-card: 16px; }
  .topbar { padding-left: var(--gutter); padding-right: var(--gutter); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  main { padding: 20px var(--gutter) calc(96px + var(--safe-bottom)); }
  .view, .pane { gap: 16px; }
  .momo-say { padding: 12px 14px 12px 10px; gap: 12px; }
  h1 { font-size: 20px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; justify-content: space-around; gap: 0;
    padding: 6px 8px calc(6px + var(--safe-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
  .tab { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 14px; border-radius: 10px; flex: 1; max-width: 120px; }
  .tab.active { background: transparent; color: var(--accent); }
  .tab svg { width: 22px; height: 22px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .toolbar select { flex: 1 1 100%; }
  .set { padding: 14px 16px; }
  .guide details { padding: 0 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pane-head { flex-wrap: wrap; }
  .row-end > button, .row-end > .btn { flex: 1 1 auto; }
  .sticky-actions { position: sticky; bottom: calc(68px + var(--safe-bottom)); background: var(--bg); padding: 10px 0; margin: 0; z-index: 2; }
  .toast { bottom: calc(80px + var(--safe-bottom)); }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; max-height: 92dvh; padding-bottom: calc(20px + var(--safe-bottom)); }
  dialog[open] { animation: sheet .22s cubic-bezier(.2,.8,.2,1); }
  dialog::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--border); margin: -6px auto 12px; }
  @keyframes sheet { from { transform: translateY(40%); opacity: .4; } }
}
@media (display-mode: standalone) { .topbar #btn-install { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* --- grupos (aba Conversas › Grupos) --- */
.groups { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 60dvh; }
.groups > p { padding: 12px; margin: 0; }
.group { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.group + .group { border-top: 1px solid var(--border); }
.group-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.group-name { font-weight: 500; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.group .tag { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.group-id { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%; background: transparent; color: var(--muted); border: 0; padding: 0; font-size: 12px; white-space: normal; text-align: left; box-shadow: none; }
.group-id:hover { color: var(--text); filter: none; background: transparent; }
.group-id svg { width: 13px; height: 13px; flex: none; }
.group-id code { overflow-wrap: anywhere; }
.group-watch { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; cursor: pointer; font-weight: 400; }
.group-watch small { font-size: 11px; color: var(--muted); }

/* --- ritmo humano (aba Comportamento) --- */
.pace-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pace { position: relative; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s; }
.pace:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.pace input { position: absolute; opacity: 0; width: 0; height: 0; }
.pace b { font-weight: 600; font-size: 14px; }
.pace small { color: var(--muted); font-weight: 400; font-size: 12.5px; line-height: 1.45; }
.pace.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.pace.on b { color: var(--accent); }
.pace:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); }
details.adv { border-top: 1px solid var(--border); padding-top: 12px; }
details.adv > summary { cursor: pointer; list-style: none; font-size: 13.5px; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary b { font-weight: 500; }
details.adv > summary b::before { content: "▸ "; color: var(--muted); }
details.adv[open] > summary b::before { content: "▾ "; }
details.adv[open] > summary { margin-bottom: 14px; }
.timing-grid .field { gap: 5px; }
.timing-grid .hint { font-size: 12px; }

/* --- status (stories) --- */
.status-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: clamp(20px, 3vw, 36px); align-items: start; }
#st-text, #st-media { display: flex; flex-direction: column; gap: 14px; }
.status-side { position: sticky; top: 84px; display: flex; justify-content: center; }
.phone { width: 220px; aspect-ratio: 9 / 16; border-radius: 28px; padding: 8px; background: #0b0b0d; box-shadow: 0 18px 40px rgba(0,0,0,.22), inset 0 0 0 1.5px #2a2a2e; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 21px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px; color: #fff; text-align: center; background: var(--accent); transition: background .2s; }
.phone-screen::before { content: ""; position: absolute; top: 9px; left: 12px; right: 12px; height: 2.5px; border-radius: 2px; background: rgba(255,255,255,.55); }
.phone-screen p { font-size: 16px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 100%; overflow: hidden; }
.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone-screen .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 12px 16px; font-size: 13px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.phone-ic svg { width: 46px; height: 46px; opacity: .75; stroke-width: 1.5; }
.font-1 p { font-family: Georgia, "Times New Roman", serif; }
.font-2 p { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 20px; }
.font-3 p { font-family: "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif; font-weight: 700; }
.font-4 p { font-family: Impact, "Arial Narrow", sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.font-5 p { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.seg-wide { display: flex; }
.seg-wide button { flex: 1 1 0; }
.seg-wide button svg { width: 15px; height: 15px; }
.center-card { align-items: center; text-align: center; padding: 32px 24px; }
.center-card .hint { max-width: 440px; }
.st-dot { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; }
.st-dot svg { width: 16px; height: 16px; }
@media (max-width: 720px) {
  .status-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .status-side { order: -1; position: static; }
  .phone { width: 150px; border-radius: 22px; padding: 6px; }
  .phone-screen { border-radius: 17px; padding: 14px 10px; }
  .phone-screen p { font-size: 13px; }
  #st-aud { display: flex; } #st-aud button { flex: 1 1 0; }
}

/* --- plataforma de afiliados: visão geral, ofertas, automação, métricas --- */
.af .view-head { flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.view.narrow { max-width: 920px; width: 100%; margin-inline: auto; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.section-title h2 { font-size: 16px; }
.small-link { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; text-decoration: none; }
.small-link:hover { color: var(--text); }
.small-link svg { width: 14px; height: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ok-t { color: var(--ok); } .bad-t { color: var(--danger); }

/* números grandes do topo */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; color: inherit; font-weight: 400; }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi b { font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi b em { font-style: normal; font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 1px; }
.kpi span { font-size: 12px; color: var(--muted); min-height: 18px; display: flex; align-items: center; }
.kpi span a { color: var(--accent); text-decoration: none; }
.kpi.warn b { color: var(--warn); }
.meter { flex: 1; height: 5px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s; }
.kpis.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi.tile { cursor: pointer; white-space: normal; align-items: stretch; justify-content: flex-start; padding: 12px 14px; }
.kpi.tile b { font-size: 22px; }
.kpi.tile:hover { filter: none; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.kpi.tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.kpi.tile .spark { margin-top: 6px; }

/* grade de cartões: 3 colunas no notebook, 1 no celular */
.af-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.af-grid .span-2 { grid-column: span 2; }

/* gráficos */
.chart-wrap { position: relative; padding-left: 34px; }
.plot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chart { width: 100%; height: var(--h, 168px); display: block; overflow: visible; }
.y-axis { position: absolute; left: 0; top: 0; width: 28px; height: var(--h, 168px); }
.y-axis span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.x-axis { display: grid; font-size: 11px; color: var(--muted); text-align: center; }
.x-axis span { white-space: nowrap; overflow: visible; }
#ov-body, #mt-body { display: flex; flex-direction: column; gap: var(--gap); }
.chart .grid-l { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart rect { stroke: none; }
.chart rect { transition: opacity .12s; }
.chart rect:hover { opacity: .75; }
.c-a { fill: var(--accent); stroke: var(--accent); }
.c-b { fill: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); stroke: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); }
.c-m { fill: var(--muted); stroke: color-mix(in srgb, var(--muted) 70%, transparent); }
.c-ok { fill: var(--ok); stroke: var(--ok); } .c-bad { fill: var(--danger); stroke: var(--danger); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: -6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: currentColor; }
.legend i.c-a { background: var(--accent); } .legend i.c-b { background: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); }
.legend i.c-ok { background: var(--ok); } .legend i.c-bad { background: var(--danger); }
.spark { width: 100%; height: 26px; display: block; }
.spark polyline { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.ritmo-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }

/* selos */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); background: var(--surface-2); }
.b-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, transparent); }
.b-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.b-bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.b-info { color: var(--accent); background: var(--accent-soft); }
.store { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--text); white-space: nowrap; }
.store::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.store.s-ml::before, .thumb.s-ml { --store: #f5c400; } .store.s-shp::before, .thumb.s-shp { --store: #ee4d2d; } .store.s-amz::before, .thumb.s-amz { --store: #ff9900; }
.store.s-ml::before { background: #f5c400; } .store.s-shp::before { background: #ee4d2d; } .store.s-amz::before { background: #ff9900; }
.role { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.role.r-postador { background: var(--accent-soft); color: var(--accent); }
.role.r-leitor { background: color-mix(in srgb, #6366f1 12%, transparent); color: #6366f1; }

/* saúde */
.health { display: flex; flex-direction: column; gap: 10px; }
.h-row { display: flex; gap: 10px; align-items: flex-start; }
.h-row > i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 15%, transparent); }
.h-aviso > i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 15%, transparent); }
.h-erro > i { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent); }
.h-row span { display: flex; flex-direction: column; min-width: 0; }
.h-row b { font-size: 13px; font-weight: 500; }
.h-row small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.h-row small a { color: var(--accent); }

/* cartões dos números */
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--gap); }
.ncard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; transition: border-color .15s, transform .15s; }
.ncard:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); transform: translateY(-1px); }
.ncard-top { display: flex; align-items: center; gap: 10px; }
.ncard-top .who { flex: 1; }
.roles { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ncard-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ncard-metrics div, .mini-kpis div { display: flex; flex-direction: column; min-width: 0; }
.ncard-metrics b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ncard-metrics small, .mini-kpis small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncard-foot { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.ncard-foot small { font-size: 11.5px; white-space: nowrap; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini-kpis b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.roles-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }

/* tabelas e rankings */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted); padding: 0 8px 6px 0; }
.tbl td { border-top: 1px solid var(--border); padding: 8px 8px 8px 0; font-variant-numeric: tabular-nums; }
.tbl th:not(:first-child), .tbl td:not(:first-child) { text-align: right; padding-right: 0; padding-left: 8px; }
.rank { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 36px; align-items: center; gap: 10px; }
.rank-row .grow { display: flex; flex-direction: column; min-width: 0; }
.rank-row b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row small { font-size: 11.5px; }
.rank-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* lista de ofertas */
.offers { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card .offers { border-radius: 12px; box-shadow: none; }
.offers > .empty { border: 0; border-radius: 0; }
.offer { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: transparent; color: inherit; border: 0; border-radius: 0; text-align: left; white-space: normal; font-weight: 400; width: 100%; }
.offer + .offer { border-top: 1px solid var(--border); }
.offer:hover { filter: none; background: var(--surface-2); }
.thumb { position: relative; width: 44px; height: 44px; border-radius: 10px; flex: none; overflow: hidden; display: grid; place-items: center;
  background: color-mix(in srgb, var(--store, var(--muted)) 14%, var(--surface-2)); color: var(--store, var(--muted)); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.offers.compact .thumb { width: 36px; height: 36px; border-radius: 8px; }
.offer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.offer-text { font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offers.compact .offer-text { -webkit-line-clamp: 1; }
.offer-main small { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }

/* detalhe da oferta: prévia como no WhatsApp */
.offer-detail { display: flex; flex-direction: column; gap: 14px; }
.offer-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.wa { background: color-mix(in srgb, #25d366 6%, var(--surface-2)); border-radius: 12px; padding: 14px; display: flex; }
.bubble { background: var(--surface); border-radius: 4px 12px 12px 12px; box-shadow: 0 1px 1px rgba(0,0,0,.08); padding: 4px; max-width: 340px; width: 100%; display: flex; flex-direction: column; }
.bubble-img img { width: 100%; max-height: 280px; object-fit: cover; border-radius: 8px; display: block; background: #fff; }
.bubble p { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 8px 0; }
.bubble p a { color: #0b7bd6; }
.bubble small { align-self: flex-end; font-size: 10.5px; color: var(--muted); padding: 0 8px 4px; min-height: 8px; }
.kvs { display: flex; flex-direction: column; gap: 8px; }
.kv { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.kv small { color: var(--muted); font-size: 11.5px; }
.kv a { color: var(--accent); overflow-wrap: anywhere; display: inline-flex; gap: 4px; align-items: center; }
.kv a svg { width: 13px; height: 13px; }
.kv code { align-self: flex-start; }
a.list-row { text-decoration: none; color: inherit; }
a.list-row:hover { background: var(--surface-2); }
a.list-row > svg { color: var(--muted); }

@media (max-width: 1100px) {
  .af-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .af-grid .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .kpis, .kpis.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .af-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi b { font-size: 22px; }
  .head-actions { width: 100%; }
  .head-actions .seg { flex: 1; }
  .head-actions .seg button { flex: 1; }
  .toolbar .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .num-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar #btn-guide { display: inline-flex; }
}
