/* Tokens do brandbook LunoChat: branco primeiro, azul com propósito.
   Regra de equilíbrio: 70% superfícies claras / 20% texto e bordas / 10% azul e ciano. */
:root {
  --bg: #f8fafc;            /* Branco suave: fundo principal */
  --surface: #ffffff;
  --fill: #f1f5f9;
  --fill-hover: #e7edf5;
  --text: #101827;          /* Texto: títulos e conteúdo */
  --text-2: #526077;
  --text-3: #7c889c;
  --line: #e5eaf2;          /* Bordas de 1 px */
  --accent: #2563ff;        /* Azul principal: ações e marca */
  --accent-hover: #3882f6;  /* Azul vivo: hover e gráficos */
  --accent-soft: #e7f0ff;   /* Azul pálido: superfícies suaves e navegação ativa */
  --accent-ring: rgba(37, 99, 255, 0.18);
  --cyan: #5ac8fa;          /* Ciano: detalhes e brilho */
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.12);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.1);
  --orange-soft: #fff4e5;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 39, 0.04), 0 4px 16px rgba(16, 24, 39, 0.04);
  --shadow-lg: 0 24px 80px rgba(16, 24, 39, 0.18);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---- Botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 980px; padding: 9px 18px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 255, 0.25); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--fill); }
.btn:focus-visible, .card:focus-visible, .post:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.btn-text { background: none; color: var(--accent); padding: 8px 4px; }
.btn-text:hover { text-decoration: underline; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-lg { padding: 13px 24px; font-size: 17px; }

/* ---- Navegação ---- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; letter-spacing: -0.02em; }
.brand b, .login-card h1 b { font-weight: 700; color: var(--text); }
.brand b + span, .login-card h1 b + span { font-weight: 700; color: var(--accent); }
.brand-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.status {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 980px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; background: var(--green-soft); color: #15803d; white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.off { background: var(--red-soft); color: var(--red); }
.account { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; min-width: 0; }
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--fill); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--text-2);
}

/* ---- Página ---- */
.page { max-width: 1080px; margin: 0 auto; padding: 48px 22px 96px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.hero h1 {
  font-family: var(--font-display); font-size: 40px; line-height: 1.1; font-weight: 700;
  letter-spacing: -0.025em; margin: 0 0 8px;
}
.hero p { margin: 0; font-size: 16px; color: var(--text-2); max-width: 560px; }

.connect {
  display: flex; align-items: center; gap: 24px; margin-bottom: 32px; padding: 24px 32px;
  background: var(--accent-soft); border: 1px solid #d6e4ff; border-radius: var(--radius);
}
.connect .mascot { margin: 0; flex: none; }
.connect-text { flex: 1; min-width: 0; }
.connect h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; }
.connect p { margin: 0; color: var(--text-2); max-width: 520px; }
.btn-quiet { color: var(--text-2); font-size: 14px; }
a.btn { text-decoration: none; }

.banner {
  background: var(--orange-soft); border-radius: var(--radius-sm); padding: 14px 18px;
  margin-bottom: 24px; font-size: 14px; color: #8a5300;
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.stat:first-child .stat-value { color: var(--accent); }
.stat-label { color: var(--text-2); font-size: 13px; }

.section-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 16px;
}

/* ---- Cards de automação ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; margin-bottom: 56px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px; cursor: pointer; text-align: left;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-2px); border-color: #d3ddf0; box-shadow: 0 2px 4px rgba(16, 24, 39, 0.04), 0 12px 32px rgba(16, 24, 39, 0.08); }
.card.off { opacity: 0.6; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.card-meta { color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.card-meta div { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.card-meta svg { flex: none; color: var(--text-3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); color: var(--accent); border-radius: 980px;
  padding: 4px 11px; font-size: 13px; font-weight: 500;
}
.chip button { border: 0; background: none; color: inherit; padding: 0 0 0 2px; font-size: 15px; line-height: 1; opacity: 0.7; }
.chip button:hover { opacity: 1; }

.empty {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 48px 24px; text-align: center; margin-bottom: 56px;
}
.empty h3 { font-size: 21px; margin: 16px 0 6px; letter-spacing: -0.015em; }
.empty p { color: var(--text-2); margin: 0 0 22px; }
.mascot { display: block; margin: 0 auto; filter: drop-shadow(0 12px 24px rgba(37, 99, 255, 0.18)); }

/* ---- Lista de atividade (estilo Ajustes do iOS) ---- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.row + .row { border-top: 1px solid var(--line); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; }
.row-sub { color: var(--text-2); font-size: 13px; }
.row-time { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.list-empty { padding: 28px 20px; color: var(--text-2); text-align: center; }
.badge { border-radius: 980px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--green-soft); color: #1e8e3e; }
.badge-err { background: var(--red-soft); color: var(--red); }

/* ---- Toggle (estilo iOS) ---- */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 31px; background: #e9e9eb; transition: background 0.25s; }
.switch span::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.25s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

/* ---- Login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 40px 32px 28px; box-shadow: var(--shadow); text-align: center;
}
.login-card .mascot { margin-bottom: 12px; }
.login-card h1 { font-family: var(--font-display); font-size: 32px; letter-spacing: -0.025em; margin: 0 0 6px; }
.login-card p { color: var(--text-2); margin: 0 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.error-text { color: var(--red); font-size: 14px; min-height: 20px; margin: 0; }

/* ---- Campos ---- */
.input, .textarea {
  width: 100%; border: 1px solid transparent; background: var(--fill); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 15px; outline: none; transition: border 0.15s, background 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.textarea { resize: vertical; min-height: 72px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); display: flex; justify-content: space-between; }
.hint { font-size: 12px; color: var(--text-3); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 10px; padding: 2px; }
.segmented button {
  border: 0; background: none; border-radius: 8px; padding: 7px 10px; font-size: 14px; font-weight: 500; color: var(--text);
  transition: background 0.2s, box-shadow 0.2s;
}
.segmented button.active { background: var(--surface); color: var(--accent); box-shadow: 0 2px 6px rgba(16, 24, 39, 0.1), 0 0 0 1px rgba(37, 99, 255, 0.3); }

/* ---- Editor (folha estilo iOS) ---- */
.overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 24px; animation: fade 0.2s ease;
}
.sheet {
  width: 100%; max-width: 1000px; height: min(860px, calc(100vh - 48px));
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.sheet-bar h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-bar .left { justify-self: start; }
.sheet-bar .right { justify-self: end; }
.sheet-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.form { overflow-y: auto; padding: 24px 28px 40px; }
.preview { background: var(--bg); border-left: 1px solid var(--line); display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.preview-stack { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.group { margin-bottom: 30px; }
.group-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.015em; }
.group-desc { color: var(--text-2); font-size: 14px; margin: 0 0 14px; }
.inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--fill); border-radius: var(--radius-sm); padding: 12px 14px; }

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.post {
  position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; border: 0; padding: 0;
  background: var(--fill); outline: 3px solid transparent; outline-offset: -3px; transition: outline-color 0.15s;
}
.post img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post .check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0, 0, 0, 0.25); display: grid; place-items: center; color: #fff;
}
.post.selected { outline-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.post.selected .check { background: var(--accent); }
.post-caption { position: absolute; inset: auto 0 0 0; padding: 4px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); text-align: left; }

.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--fill); border-radius: var(--radius-sm); padding: 8px 10px; border: 1px solid transparent; }
.chip-input:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.chip-input input { flex: 1; min-width: 140px; border: 0; background: none; outline: none; padding: 4px; }

.variant { display: flex; gap: 8px; align-items: center; }
.variant + .variant { margin-top: 8px; }
.icon-btn {
  width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--fill);
  color: var(--text-2); display: grid; place-items: center; font-size: 18px;
}
.icon-btn:hover { background: var(--red-soft); color: var(--red); }

.form-error { background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }

/* ---- Prévia do iPhone ---- */
.phone {
  width: 300px; height: 620px; background: #fff; border-radius: 48px; padding: 12px;
  box-shadow: 0 0 0 10px #1d1d1f, 0 0 0 11px #3a3a3c, 0 30px 60px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.phone::before {
  content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 28px; background: #1d1d1f; border-radius: 20px; z-index: 2;
}
.phone-head { display: flex; align-items: center; gap: 10px; padding: 44px 8px 12px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.phone-head .avatar { width: 30px; height: 30px; }
.phone-head small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.chat { flex: 1; padding: 14px 6px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; font-size: 13.5px; }
.chat-note { text-align: center; color: var(--text-3); font-size: 11px; margin: 4px 0 8px; }
.reply-ref { align-self: flex-start; font-size: 11px; color: var(--text-3); margin-left: 10px; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.them { align-self: flex-start; background: #efefef; border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, #6f3ff5, #3a7bfd); color: #fff; border-bottom-right-radius: 6px; }
.bubble-card { align-self: flex-start; max-width: 80%; background: #efefef; border-radius: 18px; overflow: hidden; border-bottom-left-radius: 6px; }
.bubble-card .bubble { max-width: none; border-radius: 0; background: none; }
.bubble-card .bubble-btn { display: block; border-top: 1px solid rgba(0, 0, 0, 0.08); padding: 9px 12px; text-align: center; color: var(--accent); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 30;
  background: rgba(29, 29, 31, 0.92); color: #fff; padding: 11px 20px; border-radius: 22px; font-size: 14px;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  box-shadow: var(--shadow-lg); animation: rise 0.25s ease;
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.toast { animation-name: toast-in; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---- Abas ---- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 980px; box-shadow: var(--shadow);
  max-width: 100%; overflow-x: auto;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 980px;
  color: var(--text-2); font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); background: var(--fill); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.tab:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.tab-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 980px; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
}

.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-gray { background: var(--fill); color: var(--text-2); }
.badge-orange { background: var(--orange-soft); color: #a35b00; }

/* ---- Aprovações ---- */
.approvals { display: flex; flex-direction: column; gap: 16px; }
.approval {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 14px;
}
.approval-head { display: flex; align-items: center; gap: 12px; }
.comment {
  margin: 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--fill);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 16px; white-space: pre-wrap; word-wrap: break-word;
}
.approval-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.approval .form-error { margin: 0; }

/* ---- Perfil da IA ---- */
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.profile-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel-title { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 4px; }
.panel > .group-desc { margin-bottom: 18px; }
.panel > .field + .field, .panel > .field + .segmented { margin-top: 16px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting .hint { margin: 2px 0 0; }
.setting-stack { flex-direction: column; align-items: stretch; gap: 10px; }
.setting-title { font-weight: 500; }
.examples { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.example { display: flex; gap: 8px; align-items: flex-start; padding: 12px; background: var(--fill); border-radius: var(--radius-sm); }
.example-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.example .input, .example .textarea { background: var(--surface); }
.example .textarea { min-height: 56px; }
.save-bar { display: flex; justify-content: flex-end; }
.test-panel { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.test-panel .group-desc { margin: 0; }
.test-panel .field + .field { margin-top: 0; }
.test-panel > .btn { align-self: flex-start; }
.posts-small { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.test-result:empty { display: none; }
.test-result { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.test-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.test-bubble { max-width: 100%; font-size: 15px; }

/* ---- Posts (capas verticais, como no Reels) ---- */
.btn-sm { padding: 6px 14px; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 18px; margin-bottom: 32px; }
.reel {
  display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; background: none; text-align: left; min-width: 0;
  border-radius: var(--radius-sm);
}
.reel:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 3px; }
.reel-cover {
  position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--fill); box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.reel:hover .reel-cover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 39, 0.05), 0 14px 32px rgba(16, 24, 39, 0.12); }
.reel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-blank { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); }
.reel-top, .reel-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px; }
.reel-top { top: 0; background: linear-gradient(rgba(0, 0, 0, 0.38), transparent); }
.reel-bottom { bottom: 0; padding-top: 28px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.62)); flex-wrap: wrap; }
.reel-type {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 980px;
  background: rgba(16, 24, 39, 0.55); color: #fff; font-size: 12px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.reel-type svg { fill: currentColor; stroke: none; }
.reel-type-inline { background: var(--accent-soft); color: var(--accent); backdrop-filter: none; }
.reel-counts { display: inline-flex; gap: 10px; color: #fff; font-size: 12px; font-weight: 600; }
.reel-counts span { display: inline-flex; align-items: center; gap: 3px; }
.badge-cover.badge-ok { background: #34c759; color: #fff; }
.badge-cover.badge-gray { background: rgba(255, 255, 255, 0.9); color: var(--text); }
.badge-cover.badge-blue { background: var(--accent); color: #fff; }
.badge-new { background: var(--cyan); color: #04283a; }
.reel-info { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.reel-date { font-size: 12px; color: var(--text-3); font-weight: 500; }
.reel-caption {
  font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reel.skeleton .reel-cover { animation: pulse 1.4s ease-in-out infinite; box-shadow: none; }
@keyframes pulse { 50% { opacity: 0.55; } }
.load-more { display: flex; margin: 0 auto 56px; }

.banner-new {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #d6e4ff; color: var(--text);
}
.banner-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.banner-text { flex: 1; min-width: 200px; }

/* Folha do post */
.sheet-post { max-width: 760px; height: auto; max-height: calc(100vh - 48px); }
.sheet-scroll { overflow-y: auto; }
.post-sheet { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; padding: 24px 28px 28px; }
.post-sheet-cover { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--fill); box-shadow: var(--shadow); }
.post-sheet-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-sheet-cover .reel-type { position: absolute; top: 12px; left: 12px; }
.post-sheet-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; align-items: flex-start; }
.post-sheet-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-sheet-caption { margin: 0; white-space: pre-wrap; word-wrap: break-word; max-height: 220px; overflow-y: auto; color: var(--text); }
.post-sheet-counts { color: var(--text-2); }
.post-campaign {
  align-self: stretch; margin-top: 4px; padding: 18px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.post-campaign .card-head { align-self: stretch; }
.post-campaign .campaign-stats { align-self: stretch; }
.post-campaign-empty p { margin: 0; color: var(--text-2); }

/* Cards de campanha */
.campaign { gap: 18px; }
.campaign-top { display: flex; gap: 16px; min-width: 0; }
.campaign-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.campaign-main .card-head { align-self: stretch; }
.cover-mini {
  position: relative; width: 76px; aspect-ratio: 9 / 16; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--fill); display: grid; place-items: center; color: var(--text-3);
}
.cover-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px;
  background: linear-gradient(160deg, var(--accent-soft), var(--fill)); text-align: center;
}
.cover-placeholder span { font-size: 11px; font-weight: 600; color: var(--accent); line-height: 1.2; }
.cover-placeholder small { font-size: 10px; color: var(--text-3); max-width: 100%; }
.cover-more, .cover-tag {
  position: absolute; bottom: 5px; left: 5px; right: 5px; text-align: center; border-radius: 980px;
  background: rgba(16, 24, 39, 0.62); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 4px;
}
.cover-more { left: auto; }
.campaign-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cstat { background: var(--bg); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.cstat b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.cstat span { font-size: 11px; color: var(--text-2); line-height: 1.2; }
.cstat-err b { color: var(--red); }
.card.draft { border-style: dashed; border-color: #c7d7f7; background: linear-gradient(180deg, #fbfcff, var(--surface)); }
.draft-note { margin: 0; font-size: 13px; color: var(--text-2); }
.section-badge { margin-left: 10px; vertical-align: middle; font-size: 12px; }
.section-desc { margin: -8px 0 16px; color: var(--text-2); font-size: 14px; }
.avatar-accent { background: var(--accent-soft); color: var(--accent); }

/* Editor: post de origem, aviso da IA e prévia do comentário */
.editor-note {
  display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; margin-bottom: 18px; border-radius: var(--radius-sm);
  background: var(--orange-soft); color: #8a5300; font-size: 14px;
}
.editor-note svg { flex: none; margin-top: 2px; }
.editor-note-ai { background: var(--accent-soft); color: #1d4ed8; }
.editor-post { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 26px; }
.cover-editor { width: 96px; box-shadow: var(--shadow); }
.editor-post-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.editor-post-text p {
  margin: 0; font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.subgroup { margin-top: 18px; }
.subgroup-title { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.hint-warn { color: #a35b00; margin: 0 0 12px; display: block; }
.comment-preview {
  width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px;
}
.cp-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.cp-title .badge { text-transform: none; letter-spacing: 0; }
.cp-row { display: flex; gap: 8px; align-items: flex-start; word-wrap: break-word; min-width: 0; }
.cp-row .avatar { width: 24px; height: 24px; font-size: 11px; }
.cp-reply { margin-left: 22px; }
.comment-preview .hint { margin: 0; }
.segmented { grid-auto-columns: minmax(0, 1fr); }
.segmented button { min-width: 0; }

@media (max-width: 860px) {
  .post-sheet { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; padding: 20px; }
  .profile-layout { grid-template-columns: 1fr; }
  .test-panel { position: static; }
  .sheet-body { grid-template-columns: 1fr; overflow-y: auto; }
  .form { overflow: visible; padding: 20px 18px 24px; }
  .preview { border-left: 0; border-top: 1px solid var(--line); padding: 32px 16px; overflow: visible; }
}
@media (max-width: 640px) {
  .page { padding: 28px 16px 72px; }
  .nav-inner { padding: 0 16px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }
  .status { display: none; }
  .connect { flex-direction: column; text-align: center; padding: 24px 20px; gap: 16px; }
  .connect .btn { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 12px; }
  .grid { grid-template-columns: 1fr; }
  .overlay { padding: 0; place-items: end stretch; }
  .sheet { height: calc(100vh - 24px); border-radius: 22px 22px 0 0; }
  .phone { width: 270px; height: 560px; }
  .account span { display: none; }
  .tabs { display: flex; width: 100%; margin-bottom: 24px; }
  .tab { flex: 1; justify-content: center; padding: 8px 6px; font-size: 13px; gap: 4px; }
  .tab-count { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
  .approval { padding: 16px; }
  .approval-actions .btn { flex: 1; }
  .panel { padding: 18px; }
  .reels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .reel-top, .reel-bottom { padding: 8px; }
  .reel-bottom { gap: 4px; }
  .reel-counts { gap: 6px; font-size: 11px; }
  .badge-cover { font-size: 11px; padding: 2px 8px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; padding: 11px 14px; font-size: 15px; }
  .sheet-post { max-height: calc(100vh - 24px); }
  .post-sheet { grid-template-columns: 1fr; padding: 16px; }
  .post-sheet-cover { width: min(240px, 70%); margin: 0 auto; }
  .post-campaign .btn { width: 100%; }
  .segmented button { font-size: 13px; padding: 7px 6px; line-height: 1.25; }
  .comment-preview { width: 270px; }
}
