/* ============================================================
   IG Manager — tema Instagram
   ============================================================ */
:root {
  --grad: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 55%, #6228d7 100%);
  --grad-soft: linear-gradient(45deg, #f9ce34, #ee2a7b);
  --blue: #0095f6;
  --blue-dim: rgba(0, 149, 246, .12);
  --green: #00c714;
  --red: #ed4956;
  --yellow: #f5a623;
  --story-ring: conic-gradient(from 180deg, #f9ce34, #ee2a7b, #6228d7, #f9ce34);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- tema escuro (padrão) ---------- */
body[data-theme="dark"] {
  --bg: #000000;
  --bg2: #0a0a0a;
  --surface: #121212;
  --surface2: #1a1a1a;
  --surface3: #242424;
  --border: #262626;
  --border2: #333333;
  --text: #f5f5f5;
  --text2: #a3a3a3;
  --text3: #6f6f6f;
  color-scheme: dark;
}

/* ---------- tema claro ---------- */
body[data-theme="light"] {
  --bg: #fafafa;
  --bg2: #f2f2f2;
  --surface: #ffffff;
  --surface2: #f5f5f5;
  --surface3: #ebebeb;
  --border: #dbdbdb;
  --border2: #cfcfcf;
  --text: #262626;
  --text2: #656565;
  --text3: #9a9a9a;
  --shadow: 0 8px 30px rgba(0, 0, 0, .10);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
::selection { background: rgba(238, 42, 123, .35); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

.icon { flex-shrink: 0; vertical-align: -3px; }
.icon.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ============================================================
   LAYOUT — desktop: sidebar + conteúdo
   ============================================================ */
#app { min-height: 100dvh; }
.layout { display: flex; min-height: 100dvh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 20px;
  font-weight: 800; font-size: 19px; letter-spacing: -.3px;
}
.logo .logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center; color: #fff;
}
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text2); font-weight: 600; font-size: 15px;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--surface3); color: var(--text); }
.nav-item .icon { width: 22px; height: 22px; }

.side-accounts { margin-top: 22px; flex: 1; overflow-y: auto; min-height: 0; }
.side-label {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text3); padding: 0 12px 8px;
}
.side-acct {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: none; background: none; width: 100%; text-align: left; color: var(--text2);
  font-size: 14px; font-weight: 600;
}
.side-acct:hover { background: var(--surface2); color: var(--text); }
.side-acct.active { background: var(--blue-dim); color: var(--text); }
.side-acct .dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.dot.on { background: var(--green); box-shadow: 0 0 6px rgba(0,199,20,.8); }
.dot.off { background: var(--text3); }
.dot.warn { background: var(--yellow); }

.side-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content {
  flex: 1; width: 100%; max-width: 1080px; margin: 0 auto;
  padding: 28px 28px 60px;
  animation: fadeIn .18s ease-out;
}

/* ============================================================
   MOBILE — header + bottom nav
   ============================================================ */
.mobile-top {
  display: none;
  position: sticky; top: 0; z-index: 40;
  align-items: center; gap: 10px;
  height: 56px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.mobile-top .mt-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.mobile-top .mt-logo .logo-mark { width: 28px; height: 28px; border-radius: 8px; }
.mobile-top .mt-title { font-weight: 700; font-size: 16px; }
.mobile-top .mt-actions { margin-left: auto; display: flex; gap: 4px; }

.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--text3); font-size: 10.5px; font-weight: 600;
  padding-top: 8px;
}
.bn-item.active { color: var(--text); }
.bn-item .icon { width: 24px; height: 24px; }
.bn-fab {
  flex: 1; display: flex; justify-content: center; align-items: flex-start; padding-top: 2px;
  background: none; border: none;
}
.bn-fab .fab {
  width: 48px; height: 48px; margin-top: -18px; border-radius: 16px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(238, 42, 123, .45);
  border: 3px solid var(--bg);
}

@media (max-width: 899px) {
  .sidebar { display: none; }
  .mobile-top { display: flex; }
  .bottom-nav { display: flex; }
  .content { padding: 18px 14px calc(104px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   COMPONENTES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h .icon { color: var(--blue); }
.card-h h3 { font-size: 15.5px; font-weight: 700; }
.card-h .sub { color: var(--text3); font-size: 12.5px; font-weight: 500; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 4px; }
.page-sub { color: var(--text2); font-size: 14px; margin-bottom: 20px; }
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface2); color: var(--text);
  font-size: 14px; font-weight: 700;
  transition: filter .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.grad { background: var(--grad); border: none; color: #fff; }
.btn.danger { background: rgba(237, 73, 86, .12); border-color: rgba(237, 73, 86, .4); color: var(--red); }
.btn.success { background: rgba(0, 199, 20, .12); border-color: rgba(0, 199, 20, .4); color: var(--green); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--surface2); color: var(--text); }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn.xs { padding: 4px 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.icon-btn { padding: 9px; }
.btn.block { width: 100%; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: var(--surface3); color: var(--text2);
  border: 1px solid var(--border);
}
.badge.on { background: rgba(0,199,20,.12); color: var(--green); border-color: rgba(0,199,20,.35); }
.badge.off { background: var(--surface3); color: var(--text3); }
.badge.warn { background: rgba(245,166,35,.12); color: var(--yellow); border-color: rgba(245,166,35,.35); }
.badge.err { background: rgba(237,73,86,.12); color: var(--red); border-color: rgba(237,73,86,.35); }
.badge.info { background: var(--blue-dim); color: var(--blue); border-color: rgba(0,149,246,.3); }

/* avatar */
.avatar {
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; overflow: hidden; flex-shrink: 0;
  background: var(--grad); position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.ring { padding: 2.5px; background: var(--story-ring); }
.avatar.ring > .avatar-inner {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--grad);
  border: 2.5px solid var(--bg);
}
.avatar.ring > .avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.avatar.s28 { width: 28px; height: 28px; font-size: 12px; }
.avatar.s36 { width: 36px; height: 36px; font-size: 15px; }
.avatar.s44 { width: 44px; height: 44px; font-size: 18px; }
.avatar.s64 { width: 64px; height: 64px; font-size: 26px; }
.avatar.s84 { width: 84px; height: 84px; font-size: 34px; }

/* inputs */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text3); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,149,246,.18);
}
.textarea { resize: vertical; min-height: 74px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-wrap { position: relative; }
.input-wrap .toggle-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text3); padding: 6px; display: flex;
}
.input-wrap .toggle-eye:hover { color: var(--text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2, .row3 { grid-template-columns: 1fr; } }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 44px; height: 26px; border-radius: 999px;
  background: var(--surface3); border: 1px solid var(--border2);
  transition: background .18s; position: relative; flex-shrink: 0;
}
.switch .track::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: left .18s;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.switch input:checked + .track { background: var(--blue); border-color: var(--blue); }
.switch input:checked + .track::after { left: 20px; }
.switch .sw-label { font-weight: 600; font-size: 14px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.stat .stat-ic {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--blue-dim); color: var(--blue);
}
.stat.grad .stat-ic { background: var(--grad); color: #fff; }
.stat .stat-v { font-size: 20px; font-weight: 800; line-height: 1.1; }
.stat .stat-l { font-size: 12px; color: var(--text3); font-weight: 600; }
@media (max-width: 899px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* stats 3 colunas (métricas) — compacto no mobile */
.stats3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 899px) {
  .stats3 { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
  .stats3 .stat { flex-direction: column; align-items: flex-start; gap: 7px; padding: 10px 10px; }
  .stats3 .stat .stat-ic { width: 30px; height: 30px; border-radius: 9px; }
  .stats3 .stat .stat-ic .icon { width: 15px; height: 15px; }
  .stats3 .stat-v { font-size: 16.5px; }
  .stats3 .stat-l { font-size: 10px; line-height: 1.25; }
}

/* grid de contas */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acct-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s;
}
.acct-card:hover { border-color: var(--border2); }
.acct-top { display: flex; align-items: center; gap: 12px; }
.acct-top .nm { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-top .un { color: var(--text3); font-size: 13px; }
.acct-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.acct-actions { display: flex; gap: 8px; margin-top: auto; }

/* lista */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  width: 100%; background: none; border-left: none; border-right: none; border-top: none;
  color: var(--text); text-align: left; border-radius: 0;
}
.list-item:hover { background: var(--surface2); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-t { font-weight: 700; font-size: 14.5px; }
.list-item .li-s { color: var(--text3); font-size: 13px; }
.row-del {
  width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center;
  border: none; border-radius: 9px; background: none; color: var(--text3); cursor: pointer;
}
.row-del:hover, .row-del:active { background: rgba(237, 73, 86, .12); color: var(--red); }

/* tabs (aba da conta) */
.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: none; border: none;
  color: var(--text2); font-weight: 700; font-size: 14px;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--blue); }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.media-cell {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; background: var(--surface2); cursor: pointer;
}
.media-cell img, .media-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-cell.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,149,246,.25); }
.media-cell .m-check {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: #fff; display: none;
  align-items: center; justify-content: center;
}
.media-cell.selected .m-check { display: flex; }
.media-cell .m-del {
  position: absolute; bottom: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 8px; border: none;
  background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity .15s;
}
.media-cell:hover .m-del { opacity: 1; }
.media-cell .m-badge {
  position: absolute; bottom: 6px; left: 6px;
  background: rgba(0,0,0,.65); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; display: flex; gap: 4px; align-items: center;
}

/* logs */
.logbox {
  background: #0b0e14; color: #c8d3f5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.3px; line-height: 1.75;
  padding: 14px; overflow: auto;
  max-height: 520px; white-space: pre-wrap; word-break: break-word;
}
body[data-theme="light"] .logbox { background: #f6f8fa; color: #24292f; }
.log-line.warn { color: var(--yellow); }
.log-line.err { color: var(--red); }
.log-line.ok { color: var(--green); }

/* job row */
.job-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.job-row:last-child { border-bottom: none; }
.job-row .j-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.job-row .j-main { flex: 1; min-width: 0; }
.job-row .j-t { font-weight: 700; font-size: 14px; }
.job-row .j-s { font-size: 12.5px; color: var(--text3); }

/* empty */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 44px 20px; text-align: center; color: var(--text3);
}
.empty .e-ic {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--surface2); display: grid; place-items: center; color: var(--text3);
  margin-bottom: 4px;
}
.empty h4 { color: var(--text2); font-size: 15.5px; }
.empty p { font-size: 13.5px; max-width: 340px; }

/* kv */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text3); font-weight: 600; }
.kv dd { word-break: break-all; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dt { margin-top: 8px; } }

/* ============================================================
   LOGIN (tela de senha)
   ============================================================ */
.login-wrap {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px; position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(238, 42, 123, .22), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(98, 40, 215, .25), transparent 60%),
    radial-gradient(500px 400px at 80% 15%, rgba(249, 206, 52, .12), transparent 60%);
  pointer-events: none;
}
.login-card {
  position: relative; width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 30px;
  box-shadow: var(--shadow);
  animation: popIn .25s ease-out;
}
.login-logo {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 18px;
  background: var(--grad); display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 30px rgba(238, 42, 123, .4);
}
.login-card h1 { text-align: center; font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.login-card .sub { text-align: center; color: var(--text3); font-size: 13.5px; margin: 6px 0 22px; }
.login-card .btn { margin-top: 14px; }
.login-err {
  display: none; align-items: center; gap: 8px;
  background: rgba(237, 73, 86, .1); border: 1px solid rgba(237, 73, 86, .35);
  color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 600;
  margin-top: 14px;
}
.login-err.show { display: flex; }

/* ============================================================
   MODAL / TOAST
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(4px);
  display: flex; overflow-y: auto; padding: 20px;
  animation: fadeIn .15s ease-out;
}
.modal {
  width: 100%; max-width: 480px;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  margin: auto; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow);
  animation: popIn .18s ease-out;
}
.modal h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.modal .m-sub { color: var(--text3); font-size: 13.5px; margin-bottom: 16px; }
.modal .m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

#toast-root {
  position: fixed; bottom: calc(78px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(92vw, 420px); pointer-events: none;
}
@media (min-width: 900px) { #toast-root { bottom: 26px; } }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); border-radius: 12px; padding: 11px 16px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  animation: popIn .2s ease-out;
  max-width: 100%;
}
.toast.ok { border-color: rgba(0,199,20,.5); }
.toast.ok .icon { color: var(--green); }
.toast.err { border-color: rgba(237,73,86,.5); }
.toast.err .icon { color: var(--red); }
.toast.info .icon { color: var(--blue); }
.toast.busy .icon { color: var(--yellow); }

/* progresso */
.progress { height: 8px; border-radius: 99px; background: var(--surface3); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); border-radius: 99px; transition: width .2s; }

/* breadcrumb do drive */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13.5px; }
.crumb {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; font-weight: 600; color: var(--text2);
}
.crumb.active { color: var(--text); border-color: var(--blue); background: var(--blue-dim); }

/* post composer */
.composer { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 999px) { .composer { grid-template-columns: 1fr; } }
.preview-box {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface2);
  aspect-ratio: 9/13; display: grid; place-items: center; position: relative;
}
.preview-box img { width: 100%; height: 100%; object-fit: contain; }
.preview-box video { width: 100%; height: 100%; object-fit: contain; }
.preview-box .pv-empty { color: var(--text3); display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13.5px; }

/* story link chip */
.link-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--blue-dim); border: 1px solid rgba(0,149,246,.35);
  color: var(--blue); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 700; max-width: 100%;
}
.link-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* install hint */
.install-hint {
  display: flex; align-items: center; gap: 12px;
  background: var(--blue-dim); border: 1px solid rgba(0,149,246,.3);
  border-radius: var(--radius); padding: 14px 16px;
}
.install-hint .ih-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--blue); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.install-hint .ih-t { font-weight: 700; font-size: 14.5px; }
.install-hint .ih-s { font-size: 12.5px; color: var(--text2); }

/* util */
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.muted { color: var(--text3); } .small { font-size: 13px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.wrap { flex-wrap: wrap; }
.flex.between { justify-content: space-between; }
.spacer { flex: 1; }
hr.div { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* animação de item de lista */
.view-enter { animation: fadeIn .18s ease-out; }

/* ---- chips (seleção múltipla: métricas / cruzado) ---- */
.ac-menu-wrap { position: relative; }
.ac-more { width: 100%; justify-content: center; margin-top: 14px; }
.menu-drop.right { left: auto; right: 0; }
.menu-drop { position:absolute; left:0; top:calc(100% + 8px); min-width:280px; max-width:100%; background:var(--surface2); border:1px solid var(--border2); border-radius:12px; box-shadow:0 14px 34px rgba(0,0,0,.45); padding:6px; z-index:80; animation:fadeIn .12s ease; }
.menu-item.disabled { opacity:.55; cursor:not-allowed; }
.menu-item { display:flex; align-items:flex-start; gap:10px; width:100%; padding:9px 10px; border-radius:9px; background:none; border:0; cursor:pointer; color:var(--text); text-align:left; }
.menu-item:hover { background:var(--surface3); }
.menu-item svg { margin-top:2px; color:#a78bfa; flex-shrink:0; }
.menu-item .mi-t { display:block; font-weight:700; font-size:13.5px; }
.menu-item .mi-s { display:block; font-size:11.5px; color:var(--text3); margin-top:1px; }

.chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
  background:var(--surface3); border:1px solid var(--border); color:var(--text2);
  font-size:12.5px; font-weight:600; cursor:pointer; transition:all .15s; font-family:inherit; }
.chip:hover { border-color:var(--text3); color:var(--text); }
.chip.on { background:rgba(139,92,246,.16); border-color:rgba(139,92,246,.6); color:#c4b5fd; }

/* ===== tela de posts cruzados ===== */
.modal.xc-screen { max-width: 680px; }
.xc-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border2);
  border-radius: 12px; padding: 10px; margin-bottom: 8px; background: var(--surface2); }
.xc-card-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; background: #000; }
.xc-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.xc-card-main .select, .xc-card-main .input { min-width: 0; }
.xc-card-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-card-x { flex: none; border: none; background: transparent; color: var(--text3); cursor: pointer; padding: 4px; border-radius: 8px; }
.xc-card-x:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.xc-sched-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border2);
  border-radius: 10px; margin-bottom: 6px; background: var(--surface2); font-size: 12.5px; }
@media (max-width: 640px) {
  .modal-overlay { padding: 0; }
  .modal { max-width: none; }
  .modal.xc-screen { max-height: none; height: 100%; border-radius: 0; padding: 14px 12px calc(16px + env(safe-area-inset-bottom)); }
  .xc-card-main .select, .xc-card-main .input { font-size: 14px; }
}

/* opções de modo (caixinha única de configuração de post) */
.xc-mode { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--border2); background: var(--surface2); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer; }
.xc-mode.on { border-color: #ee2a7b; box-shadow: 0 0 0 1px #ee2a7b inset; }
.xc-mode-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid var(--border3, #4a4a5a);
  display: flex; align-items: center; justify-content: center; color: #fff; }
.xc-mode.on .xc-mode-dot { background: var(--grad-soft); border-color: transparent; }
.xc-mode-t { font-size: 13.5px; font-weight: 700; }
.xc-mode-d { font-size: 12px; color: var(--text3); }
.xc-fixrow { margin-bottom: 8px; }

/* caixinha de configuração de post (destacada) */
.xc-cfg { border: 1px solid var(--border2); border-left: 3px solid #ee2a7b; background: var(--surface2);
  border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.xc-cfg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.xc-cfg .xc-mode { background: var(--surface); }
@media (max-width: 640px) { .xc-cfg { padding: 10px; } }

/* barra fixa no topo da tela de cruzados */
.xc-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: 12px; padding: 8px 10px;
  margin-bottom: 12px; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow); }
.xc-topbar-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* mobile: o dropdown vira fixed full-width (JS: positionMenuDrop) */
@media (max-width: 560px) {
  .menu-drop { min-width: 0; width: auto; max-width: none; }
}

/* destaque do botão de ativar agendamento (pulso) */
@keyframes raPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 48, 112, 0); }
  50% { box-shadow: 0 0 0 12px rgba(214, 48, 112, 0.28); }
}
.ra-pulse { animation: raPulse 1.2s ease-in-out 5; }

/* ============================================================
   MOBILE COMPACTO — visual de app (<=560px)
   ============================================================ */
@media (max-width: 560px) {
  .mobile-top { height: 50px; padding: 0 12px; }
  .mobile-top .mt-logo { font-size: 16px; }
  .content { padding: 12px 10px calc(100px + env(safe-area-inset-bottom)); }

  /* o título ja esta na barra superior — so o subtitulo fica */
  .page-title { display: none; }
  .page-sub { font-size: 12.5px; margin-bottom: 8px; }
  .page-head .actions { margin-left: 0; width: 100%; gap: 8px; }
  .page-head .actions .ac-menu-wrap { flex: 1; }
  .page-head .actions .btn { flex: 1; width: 100%; padding: 9px 8px; font-size: 13px; white-space: normal; }

  /* stats 2x2: compactas */
  .stats { gap: 7px; margin-bottom: 10px; }
  .stats.mt20 { margin-top: 8px; }
  .stat { padding: 9px 10px; gap: 8px; border-radius: 12px; }
  .stat .stat-ic { width: 30px; height: 30px; border-radius: 9px; }
  .stat .stat-ic .icon { width: 15px; height: 15px; }
  .stat-v { font-size: 16.5px; }
  .stat-l { font-size: 10.5px; }

  /* cards e secoes: menos respiro */
  .card { padding: 13px 12px; border-radius: 14px; }
  .card + .card { margin-top: 10px; }
  .mt16 { margin-top: 10px; }
  .mt20 { margin-top: 10px; }
  .card-h { margin-bottom: 10px; gap: 8px; }
  .card-h h3 { font-size: 14.5px; }

  /* contas do dashboard */
  .acct-card { padding: 11px 12px; }
  .acct-card .nm { font-size: 14px; }
  .acct-card .un { font-size: 12px; }
  .acct-meta { margin: 7px 0 5px; gap: 4px; flex-wrap: wrap; }
  .acct-actions { padding-top: 7px; gap: 6px; }
  .acct-actions .btn { flex: 1; font-size: 12.5px; padding: 8px 6px; }

  /* instalar como app */
  .install-hint { padding: 10px 12px; }
  .install-hint .ih-ic { width: 34px; height: 34px; border-radius: 10px; }

  /* chips de metrica e listas */
  #mt-filters .chip { font-size: 12px; padding: 5px 10px; }
  .list-item { padding-top: 9px; padding-bottom: 9px; }
}

/* ============================================================
   ANTI-OVERFLOW GLOBAL — token longo (nome de arquivo, hash,
   link) nunca mais empurra conteudo para fora da tela
   ============================================================ */
html, body { overflow-x: hidden; }
.content { overflow-wrap: anywhere; }
img, video, canvas { max-width: 100%; }

/* ============================================================
   FORMULÁRIO DE CONTA — elegante + animado
   ============================================================ */
@keyframes accUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes accGlow {
  0%, 100% { box-shadow: 0 8px 22px rgba(238, 42, 123, .30); transform: translateY(0); }
  50% { box-shadow: 0 10px 32px rgba(238, 42, 123, .55); transform: translateY(-2px); }
}
.acc-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; animation: accUp .5s ease both; }
.acc-hero-badge {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  animation: accGlow 2.8s ease-in-out infinite;
}
.acc-hero-t { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.acc-hero-s { font-size: 13px; color: var(--text3); margin-top: 1px; }
.acc-hero .acc-back { margin-left: auto; flex-shrink: 0; }
.acc-card { animation: accUp .5s ease both; }
.acc-card.acc-d1 { animation-delay: .06s; }
.acc-card.acc-d2 { animation-delay: .15s; }
.acc-sec { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.acc-sec h3 { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.acc-sec-ic {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(238, 42, 123, .35);
}
.acc-secure {
  display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; padding: 10px 12px;
  border-radius: 12px; background: rgba(0, 199, 20, .07);
  border: 1px solid rgba(0, 199, 20, .22);
  color: var(--text2); font-size: 12.5px; line-height: 1.45;
}
.acc-secure .icon { color: var(--green); flex-shrink: 0; margin-top: 1px; }
.acc-form .input, .acc-form .select, .acc-form .textarea {
  transition: border-color .18s ease, box-shadow .18s ease;
}
.acc-form .input:focus, .acc-form .select:focus, .acc-form .textarea:focus {
  border-color: #ee2a7b;
  box-shadow: 0 0 0 3px rgba(238, 42, 123, .16);
  outline: none;
}
.acc-submit { display: flex; gap: 10px; margin-top: 18px; animation: accUp .5s ease both; animation-delay: .24s; }
.acc-submit .btn.grad {
  flex: 1; font-size: 15px; padding: 13px 18px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(238, 42, 123, .35);
}
.acc-submit .btn.grad::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg); transition: left .55s ease;
}
.acc-submit .btn.grad:hover::after { left: 125%; }
@media (max-width: 560px) {
  .acc-hero { gap: 10px; }
  .acc-hero-badge { width: 40px; height: 40px; border-radius: 12px; }
  .acc-hero-t { font-size: 18px; }
  .acc-hero-s { font-size: 12.5px; }
  .acc-submit { flex-direction: column; }
  .acc-submit .btn { width: 100%; }
}

/* ============================================================
   RADAR DA CONTA (saúde + stories + melhores reels)
   ============================================================ */
.radar-health { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.radar-row:last-child { border-bottom: none; }
.radar-thumb {
  width: 46px; height: 62px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--surface3); display: grid; place-items: center;
}
.radar-thumb img, .radar-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.radar-main { flex: 1; min-width: 0; }
.radar-t { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.radar-s { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.radar-v { display: flex; align-items: center; gap: 5px; color: var(--text2); flex-shrink: 0; }
.radar-v .icon { width: 14px; height: 14px; }
.radar-v b { color: var(--text); font-size: 14.5px; }
@media (max-width: 560px) {
  .radar-grid { grid-template-columns: 1fr !important; }
  .radar-row { padding: 7px 0; }
}
.radar-ph { color: var(--text3); display: grid; place-items: center; }
.radar-ph .icon { width: 18px; height: 18px; }
