/* Painel de Campanhas — tokens */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/space-grotesk-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/space-grotesk-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format("woff2"); }

:root {
  /* Identidade STEEG (steeg.com.br): preto quente, coral, Space Grotesk + Inter */
  --paper: #0E0707;
  --surface: #170F0E;
  --surface-2: #221816;
  --ink: #F8F4F2;
  --muted: #A4948F;
  --line: #302624;
  --accent: #FF714E;
  --accent-glow: #FF9867;
  --accent-ink: #0E0707;
  /* status: distintos do coral da marca */
  --crit: #FF4D6A;
  --crit-bg: #3A1218;
  --warn: #F5B43C;
  --warn-bg: #352710;
  --ok: #3ECF8E;
  --ok-bg: #10291F;
  --meta: #9AAEFF;
  --google: #5CCFBC;
  --chart-spend: #3A2A27;
  --chart-conv: #FF714E;
  --chart-conv2: #9AAEFF;
  --chart-conv3: #5CCFBC;
  --radius-s: 10px;
  --radius-m: 14px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink);
  background: var(--paper) radial-gradient(80% 420px at 50% -120px, rgba(255, 113, 78, .13), transparent 70%) no-repeat;
  font: 400 15px/1.55 Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--font-display); letter-spacing: -.02em; }
code { font-size: .9em; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 5px; border-radius: 4px; }

/* status colors */
.h-critico { --h: var(--crit); --hbg: var(--crit-bg); }
.h-atencao { --h: var(--warn); --hbg: var(--warn-bg); }
.h-ok { --h: var(--ok); --hbg: var(--ok-bg); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--h, var(--muted)); flex: none; }
.t-crit { color: var(--crit); }

/* top bar */
.topbar { background: rgba(14, 7, 7, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; min-height: 58px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 22px; letter-spacing: -.03em; display: inline-flex; align-items: baseline; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-dot { color: var(--accent); }
.brand-sub { font-family: Inter, system-ui, sans-serif; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: var(--radius-s); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.nav a:hover { text-decoration: none; color: var(--ink); }
.nav a[aria-current] { color: var(--ink); background: var(--surface-2); }
.count { font-size: 12px; font-weight: 600; background: var(--line); color: var(--ink); border-radius: 10px; padding: 0 7px; line-height: 18px; }
.count.crit { background: var(--crit); color: var(--accent-ink); }
.sync { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.sync form { margin: 0; }
.sync-state.running::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .sync-state.running::before { animation: none; } }
.logout { color: var(--muted); }
.demo-banner { background: var(--warn-bg); color: var(--ink); text-align: center; font-size: 13px; padding: 7px 16px; border-bottom: 1px solid var(--line); }

/* buttons & forms */
.btn { font: inherit; font-weight: 600; font-size: 14px; border: 0; border-radius: 999px; padding: 9px 20px; background: var(--accent); color: var(--accent-ink); cursor: pointer; box-shadow: 0 0 40px -12px rgba(255, 113, 78, .6); }
.btn:hover { background: var(--accent-glow); }
.btn-quiet { background: rgba(34, 24, 22, .6); color: var(--ink); border: 1px solid var(--line); font-weight: 500; box-shadow: none; }
.btn-quiet:hover { background: var(--surface-2); border-color: #4a3a36; }
.btn-small { padding: 5px 12px; font-size: 13px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 10px; }
textarea { resize: vertical; width: 100%; }

.page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; }
.page-title { font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.page-lead { color: var(--muted); max-width: 70ch; margin: 8px 0 28px; }
.empty { color: var(--muted); }
.empty.big { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-m); padding: 40px; text-align: center; }
.saved { color: var(--ok); font-weight: 500; margin-left: 12px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- home: the morning brief ---------- */
.brief { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; margin-bottom: 36px; }
.brief-date { color: var(--muted); margin: 0 0 10px; font-weight: 500; }
.brief-headline { font-size: clamp(26px, 3.2vw, 38px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; max-width: 24ch; text-wrap: balance; }
.brief-summary { color: var(--muted); max-width: 68ch; margin: 14px 0 0; font-size: 16px; }
.brief-sub { font-size: 15px; font-weight: 600; margin: 26px 0 8px; }
.priorities { margin: 0; padding-left: 22px; max-width: 72ch; }
.priorities li { padding: 4px 0 4px 4px; }
.priorities li::marker { font-weight: 700; color: var(--muted); }

.tally { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; }
.tally-total { margin: 0 0 12px; color: var(--muted); }
.tally-total b { color: var(--ink); font-size: 34px; font-weight: 700; margin-right: 4px; letter-spacing: -.02em; }
.tally-bar { display: flex; gap: 3px; height: 14px; margin-bottom: 16px; }
.tally-bar span { background: var(--h); border-radius: 3px; min-width: 6px; }
.tally-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tally-legend a { color: var(--ink); display: flex; align-items: center; gap: 10px; }
.tally-legend b { min-width: 1.4em; }

/* KPIs */
.totals { margin-bottom: 36px; }
.totals-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.totals-head h2, .campaigns h2, .resolved h2, .runs h2 { font-size: 15px; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 2px; }
.seg a { color: var(--muted); font-size: 13px; padding: 4px 12px; border-radius: 4px; font-weight: 500; }
.seg a[aria-current] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg a { border-radius: 999px !important; }
.seg { border-radius: 999px !important; }
.seg a:hover { text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.kpis > div { padding: 16px 20px; background: var(--surface); }
.kpi-delta { font-size: 13px; font-weight: 400; }
.kpis dt { color: var(--muted); font-size: 13px; }
.kpis dd { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.kpis dd.sub { font-size: 13px; font-weight: 400; color: var(--muted); }

.delta { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.delta.good { color: var(--ok); }
.delta.bad { color: var(--crit); }

/* ---------- triage board ---------- */
.board-cols, .row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 175px 160px 128px 16px; gap: 20px; align-items: center; }
.rline { display: block; white-space: nowrap; line-height: 1.45; }
.rline small { color: var(--muted); font-size: 12px; }
.metric .rline b { font-weight: 600; font-size: 15px; }
.board-cols { padding: 0 20px 6px 26px; font-size: 12.5px; color: var(--muted); }
.board-cols span:not(:first-child) { text-align: right; }
.group-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin: 26px 0 10px; }
.group-title span { color: var(--muted); font-weight: 400; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 6px solid var(--h);
  border-radius: var(--radius-s); padding: 14px 20px;
}
.row:hover { text-decoration: none; border-color: color-mix(in srgb, var(--h) 45%, var(--line)); border-left-color: var(--h); }
.row-name { margin: 0; font-weight: 600; font-size: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-headline { margin: 3px 0 0; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.h-critico .row-headline { color: var(--ink); }
.metric { text-align: right; display: flex; flex-direction: column; }
.metric b { font-weight: 600; font-size: 15px; }
.metric-label { display: none; }
.spark { width: 120px; height: 32px; }
.spark polyline { fill: none; stroke: var(--h, var(--accent)); stroke-width: 1.8; stroke-linejoin: round; }
.spark line { stroke: var(--line); stroke-width: 2; }

.ptag { font-size: 11.5px; font-weight: 600; border-radius: 4px; padding: 1px 6px; border: 1px solid; vertical-align: 1px; }
.p-meta { color: var(--meta); border-color: color-mix(in srgb, var(--meta) 35%, transparent); }
.p-google { color: var(--google); border-color: color-mix(in srgb, var(--google) 35%, transparent); }
.alert-chip { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 4px; padding: 1px 7px; }
.alert-chip.crit { color: var(--crit); background: var(--crit-bg); }

/* ---------- client page ---------- */
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.back::before { content: "‹ "; }
.client-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-left: 6px solid var(--h); padding-left: 18px; margin-bottom: 24px; }
.client-head h1 { font-size: 32px; font-weight: 600; letter-spacing: -.02em; }
.acc-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.acc-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acc-ok { color: var(--ok); font-size: 13px; }
.acc-bad { color: var(--crit); font-weight: 600; font-size: 13px; }
.acc-meta { color: var(--muted); font-size: 13px; }
.health-pill { background: var(--hbg); color: var(--h); font-weight: 700; padding: 6px 14px; border-radius: 20px; white-space: nowrap; }

.alert-stack { display: grid; gap: 10px; margin-bottom: 28px; }
.alert { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 18px; border-left: 6px solid var(--sev); }
.alert form { margin: 0; flex: none; }
.sev-critical { --sev: var(--crit); background: color-mix(in srgb, var(--crit-bg) 70%, var(--surface)); }
.sev-warning { --sev: var(--warn); }
.sev-info { --sev: var(--accent); }
.alert.acked { opacity: .65; background: var(--surface); }
.alert-client { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.alert-title { margin: 0; font-weight: 600; }
.alert-msg { margin: 4px 0 0; color: var(--muted); white-space: pre-line; max-width: 90ch; }
.alert-when { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

.analysis { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px 28px; margin-bottom: 36px; }
.analysis-meta { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.analysis-headline { font-size: 24px; font-weight: 600; letter-spacing: -.01em; max-width: 40ch; text-wrap: balance; }
.analysis-summary { font-size: 16px; max-width: 75ch; margin: 12px 0 0; }
.analysis-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; margin-top: 22px; }
.analysis-cols h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.analysis-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.analysis-cols li { padding-left: 16px; position: relative; }
.list-bad li::before, .list-good li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); }
.list-good li::before { background: var(--ok); }
.list-actions li { padding-left: 0 !important; display: flex; gap: 10px; align-items: baseline; }
.prio { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; flex: none; }
.prio-alta { background: var(--crit-bg); color: var(--crit); }
.prio-media { background: var(--warn-bg); color: var(--warn); }
.prio-baixa { background: var(--surface-2); color: var(--muted); }
.history { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.history summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.history ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 14px; }
.history li { display: flex; gap: 10px; align-items: baseline; }

.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 20px; margin-top: 12px; }
.chart-legend { display: flex; gap: 20px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.chart-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.lg-spend::before { background: var(--chart-spend); }
.lg-conv::before { background: var(--chart-conv); height: 3px !important; vertical-align: 3px !important; }
.lg-c2::before { background: var(--chart-conv2); }
.lg-c3::before { background: var(--chart-conv3); }
.chart-box { position: relative; height: 280px; }

table { border-collapse: collapse; width: 100%; }
.split, .data { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; font-size: 14px; }
.split-wrap { margin-top: 12px; }
.split { min-width: 520px; }
.split th, .split td, .data th, .data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.split th, .data th { font-weight: 500; color: var(--muted); font-size: 13px; background: var(--surface-2); }
.data tr:last-child td, .split tr:last-child td { border-bottom: 0; }
.data .n, .split td:not(:first-child), .split th:not(:first-child) { text-align: right; white-space: nowrap; }
.sortable th { cursor: pointer; user-select: none; }
.sortable th[data-dir="desc"]::after { content: " ▼"; font-size: 10px; }
.sortable th[data-dir="asc"]::after { content: " ▲"; font-size: 10px; }
.table-scroll { overflow-x: auto; }
.muted-tag { font-size: 12px; color: var(--muted); margin-left: 6px; }
.campaigns { margin-bottom: 36px; }
.campaigns h2 { margin-bottom: 12px; }
.issues-title { font-size: 15px; font-weight: 600; margin: 24px 0 8px; }
.issues { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.issues span { color: var(--muted); }

.settings details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 22px; }
.settings summary { cursor: pointer; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.form-grid label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .check { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; color: var(--ink); font-size: 14px; }

/* accounts page */
.accounts td { vertical-align: top; }
.accounts tr.unassigned { background: color-mix(in srgb, var(--warn-bg) 60%, var(--surface)); }
.accounts tr.ignored { opacity: .55; }
.inline-form { display: grid; gap: 6px; margin: 0; min-width: 200px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.runs { margin-top: 40px; }
.run-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 16px; }
.run { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 6px; }
.run summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.run pre { font-size: 12.5px; white-space: pre-wrap; color: var(--muted); margin: 10px 0 0; max-height: 360px; overflow: auto; }
.resolved { margin-top: 40px; }
.resolved h2 { margin-bottom: 12px; }

/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 36px; width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.login h1 span { color: var(--accent); }
.login-sub { color: var(--muted); margin: -10px 0 4px; }
.login label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }

.login-error { color: var(--crit); margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .brief { grid-template-columns: 1fr; gap: 24px; }
  .tally { order: -1; }
  .board-cols { display: none; }
  .row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
  .rline { white-space: normal; }
  .kpis > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .row-main { grid-column: 1 / -1; }
  .spark-cell { display: none; }
  .metric { text-align: left; }
  .metric-label { display: block; font-size: 12px; color: var(--muted); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 8px 16px; gap: 10px 16px; }
  .sync { margin-left: 0; width: 100%; justify-content: space-between; }
  .page { padding: 24px 16px 60px; }
  .row { padding: 12px 14px; }
  .kpis dd { font-size: 21px; }
  .kpis > div { padding: 12px 14px; }
  .alert { flex-direction: column; }
  .client-head { flex-direction: column; }
  .client-head h1 { font-size: 26px; }
  .analysis { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- identidade STEEG: números e títulos ---------- */
.kpis dd, .tally-total b, .metric b, .rline b, .brief-headline, .analysis-headline, .client-head h1, .page-title, .group-title, .row-name { font-family: var(--font-display); }
.brief-headline { font-weight: 700; letter-spacing: -.035em; }
.brief-date, .analysis-meta { color: var(--accent); font-weight: 500; }
.kpis dd { letter-spacing: -.02em; }
.row:hover { border-color: #4a3a36; border-left-color: var(--h); background: var(--surface-2); }
.row, .analysis, .tally, .kpis, .chart-wrap, .split, .data, .settings details, .run, .alert, .empty.big, .login { box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .6); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 113, 78, .18); }
input, select, textarea { background: #1b1210; }
.demo-banner { background: rgba(255, 113, 78, .1); color: var(--accent-glow); }
::selection { background: rgba(255, 113, 78, .35); }

/* variação (setinha) sempre embaixo do número */
.metric .delta, .rline .delta { display: block; margin-top: 1px; }
.metric .rline + .rline { margin-top: 6px; }
.kpi-delta { display: block; font-size: 13px; line-height: 1.3; margin-top: 2px; }

/* ---------- linha do cliente com detalhes (abre/fecha) ---------- */
.brief-headline { font-size: clamp(24px, 2.6vw, 32px); max-width: 30ch; }
.brief-more { margin-top: 14px; }
.brief-more > summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.brief-more > summary::-webkit-details-marker { display: none; }
.brief-more > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.brief-more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.row-wrap > summary { list-style: none; cursor: pointer; }
.row-wrap > summary::-webkit-details-marker { display: none; }
.chev { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); justify-self: end; margin-top: -4px; transition: transform .2s; }
.row-wrap[open] .chev { transform: rotate(-135deg); margin-top: 4px; border-color: var(--accent); }
.row-wrap[open] > .row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--surface-2); }
.row-detail { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-left: 6px solid var(--h); border-radius: 0 0 var(--radius-s) var(--radius-s); padding: 18px 20px 20px; }
.rd-headline { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.rd-summary { margin: 8px 0 0; color: var(--muted); max-width: 90ch; }
.row-detail .analysis-cols { margin-top: 16px; }
.rd-sub { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.rd-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rd-alerts li { display: flex; gap: 10px; align-items: center; }
.rd-open { display: inline-block; margin-top: 18px; }
.rd-open:hover { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .chev, .brief-more > summary::after { transition: none; } }
@media (max-width: 980px) {
  .row { position: relative; padding-right: 36px; }
  .chev { position: absolute; right: 16px; top: 20px; }
}

/* ---------- "Resolvido" ---------- */
.btn-done::before { content: ""; display: inline-block; width: 9px; height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg) translateY(-2px); margin-right: 8px; }
.btn-done:hover { border-color: var(--ok); }
.priorities li, .rd-alerts li, .done-list li, .snoozed-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.priorities li form, .rd-alerts li form, .done-list li form, .snoozed-list li form { margin: 0; flex: none; }
.rd-alerts li > span { flex: 1; }
.priorities { list-style: none; padding: 0; counter-reset: prio; max-width: 760px; }
.priorities li { counter-increment: prio; padding: 6px 0; border-bottom: 1px solid rgba(48, 38, 36, .6); }
.priorities li:last-child { border-bottom: 0; }
.priorities li::before { content: counter(prio) "."; color: var(--muted); font-weight: 700; min-width: 22px; align-self: flex-start; padding-top: 1px; }
.priorities li > span { flex: 1; }
.done-list { max-width: 760px; }
.done-list { margin-top: 10px; }
.done-list summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.done-list ul, .snoozed-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.done-list li span, .snoozed-list li span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(164,148,143,.5); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.snoozed { margin-top: 36px; }
.snoozed h2 { font-size: 15px; font-weight: 600; color: var(--muted); }
.snoozed .muted { margin: 4px 0 0; }

/* ---------- chat ---------- */
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px 24px; margin-bottom: 36px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-head h2 { font-size: 20px; font-weight: 700; }
.chat-head form { margin: 0; }
.chat-sub { margin: 4px 0 14px; }
.chat-log { display: grid; gap: 10px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.chat-log:empty { display: none; }
.msg { padding: 12px 16px; border-radius: 14px; max-width: 92%; line-height: 1.55; }
.msg-user { justify-self: end; background: rgba(255, 113, 78, .14); border: 1px solid rgba(255, 113, 78, .3); white-space: pre-wrap; }
.msg-assistant { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); }
.msg-assistant p { margin: 0 0 8px; } .msg-assistant p:last-child { margin-bottom: 0; }
.msg-assistant ul, .msg-assistant ol { margin: 4px 0 8px; padding-left: 20px; }
.msg-assistant table { border-collapse: collapse; margin: 8px 0; font-size: 14px; display: block; overflow-x: auto; }
.msg-assistant th, .msg-assistant td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.msg-assistant th { background: var(--surface); color: var(--muted); font-weight: 500; }
.msg-assistant h1, .msg-assistant h2, .msg-assistant h3 { font-size: 16px; margin: 10px 0 6px; }
.msg-wait { color: var(--muted); }
.msg-wait::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.msg-err { color: var(--crit); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.chat-chips button { font: inherit; font-size: 13px; color: var(--ink); background: rgba(34, 24, 22, .6); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.chat-chips button:hover { border-color: var(--accent); color: var(--accent-glow); }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; }
.chat-form .btn:disabled { opacity: .5; cursor: wait; }

/* ---------- anúncios e Instagram ---------- */
.ads-section, .ig-section, .pages-section { margin-bottom: 36px; }
.ads-section h2, .ig-section h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.section-title { font-size: 20px; font-weight: 700; margin-top: 40px; }
.ad-cell { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.thumb-empty { display: inline-block; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ig-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; color: var(--ink); }
.ig-card:hover { text-decoration: none; border-color: #4a3a36; }
.ig-card img, .ig-noimg { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface-2); display: block; }
.ig-cap { font-size: 13px; padding: 8px 10px 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ig-stats { font-size: 13px; padding: 6px 10px 10px; display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); }
.ig-stats b { color: var(--ink); }
.ig-flag { font-size: 12px; color: var(--warn); padding: 0 10px 10px; }
@media (max-width: 600px) { .chat { padding: 16px; } .msg { max-width: 100%; } .chat-form { flex-direction: column; align-items: stretch; } }
.page-err { display: block; max-width: 360px; font-size: 12px; line-height: 1.4; white-space: normal; }

/* ---------- propostas de mudança ---------- */
.action-card { margin-top: 12px; border: 1px solid rgba(255, 113, 78, .45); background: rgba(255, 113, 78, .07); border-radius: 12px; padding: 12px 14px; }
.action-card.act-done { border-color: rgba(62, 207, 142, .45); background: rgba(62, 207, 142, .06); }
.action-card.act-failed { border-color: rgba(255, 77, 106, .5); background: rgba(255, 77, 106, .07); }
.action-card.act-canceled, .action-card.act-expired { opacity: .6; border-color: var(--line); background: transparent; }
.act-title { font-weight: 600; margin: 0 0 6px; }
.act-tag { font-size: 12px; color: var(--accent-glow); margin-right: 4px; }
.act-steps { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.act-steps li { margin-bottom: 4px; }
.act-buttons { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.act-status { font-size: 14px; margin: 0; }
.act-done .act-status { color: var(--ok); } .act-failed .act-status { color: var(--crit); }
.act-result { white-space: pre-wrap; font-size: 12px; color: var(--muted); background: var(--surface); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; }
.changes { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 20px; margin: -20px 0 36px; }
.changes summary { cursor: pointer; font-weight: 600; }
.changes ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 8px; }
.dated { font-size: 12px; color: var(--warn); white-space: nowrap; }
.act-doc { margin: 0 0 10px; font-size: 14px; }
.act-doc summary { cursor: pointer; color: var(--accent-glow); }
.act-doc-body { max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-top: 8px; }
.act-doc-body table { border-collapse: collapse; font-size: 13px; } .act-doc-body th, .act-doc-body td { border: 1px solid var(--line); padding: 4px 8px; }
