/* Camada visual compartilhada: dados primeiro, chrome reduzido. */
:root {
  --dash-ease: cubic-bezier(.22, 1, .36, 1);
  --dash-rule: color-mix(in srgb, currentColor 13%, transparent);
}

/* Painel de mídia */
.app .product-head {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.app .snapshot {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.app .hero {
  gap: 0;
  border-block: 1px solid var(--line);
}
.app .hero-main {
  min-height: 0;
  padding: 20px;
  border-radius: 0;
  background: var(--green-2);
}
.app .hero h2 {
  max-width: 760px;
  font-size: clamp(27px, 4.2vw, 43px);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.app .hero-copy {
  max-width: 680px;
  margin-top: 13px;
  font-size: 14px;
}
.app .period { margin-top: 15px; }
.app .context {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 20px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.app .context h3 { margin-bottom: 6px; font-size: 14px; }
.app .kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 16px 0 6px;
  border-block: 1px solid var(--line);
}
.app .kpi {
  min-height: 0;
  padding: 14px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.app .kpi:nth-child(2n) { border-right: 0; }
.app .kpi span { font-size: 10px; }
.app .kpi b { margin-top: 7px; font-size: clamp(22px, 3vw, 30px); }
.app .kpi small { margin-top: 2px; font-size: 11px; }
.app .section-title {
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.app .section-title h2 { font-size: clamp(22px, 3vw, 30px); }
.app #overview .panel {
  padding: 17px 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.app #overview .panel h3 { margin-bottom: 18px; font-size: 14px; }
.app .bar-row {
  width: 100%;
  padding-block: 5px;
  border: 0;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.app .bar-row:hover,
.app .bar-row[aria-pressed="true"] { background: color-mix(in srgb, var(--green) 7%, transparent); }
.app .bar-track {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}
.app .bar-fill {
  display: block;
  min-width: 3px;
  border-radius: 999px;
  transition: width .32s var(--dash-ease);
}
.app .brand-card {
  border-color: var(--line);
  border-radius: 9px;
  box-shadow: none;
  transition: border-color .18s ease, transform .18s var(--dash-ease);
}
.app .brand-card:hover { border-color: var(--green); transform: translateY(-2px); }
.app .metric-row {
  gap: 0;
  padding-block: 10px;
  border-block: 1px solid var(--line);
}
.app .metric {
  padding: 5px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.app .metric:nth-child(3n) { border-right: 0; }
.app .table-wrap { border-inline: 0; border-radius: 0; }
.app .funds-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
}
.app .funds-platform {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.app .funds-platform-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.app .funds-platform-head b { display: block; margin-top: 4px; font-size: 22px; }
.app .funds-platform-head small,
.app .funds-brand-row small,
.app .funds-cell small { color: var(--muted); font-size: 10px; }
.app .funds-brand-list { display: grid; gap: 0; margin-top: 4px; }
.app .funds-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.app .funds-brand-row:last-child { border-bottom: 0; }
.app .funds-brand-row > span { min-width: 0; }
.app .funds-brand-row strong { white-space: nowrap; }
.app .funds-cell { min-width: 145px; }
.app .funds-cell > strong { display: block; color: var(--green); white-space: nowrap; }
.app .funds-cell.pending > strong { color: var(--amber); }
.app .funds-cell small { display: block; max-width: 230px; margin-top: 3px; line-height: 1.25; }
.app .result-hero {
  border-inline: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--green) 6%, var(--page));
}
.app .leader-card { border-radius: 7px; box-shadow: none; }
.app .platform-chip.google::before,
.app .platform-inline.google::before { border-radius: 50%; }
.app .platform-chip.meta::before,
.app .platform-inline.meta::before { border-radius: 1px; }
.app .risk { border-radius: 0 8px 8px 0; }
.app .audit-hero {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 16% 16%, color-mix(in srgb, var(--green) 16%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--green) 9%, var(--surface)), var(--surface));
}
.app .audit-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.app .audit-kicker::before {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--green);
  content: "";
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 12%, transparent);
}
.app .audit-hero h3 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(20px, 3vw, 31px);
  line-height: 1.06;
  letter-spacing: -.035em;
}
.app .audit-hero p {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.app .audit-flow,
.app .audit-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.app .audit-step,
.app .audit-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}
.app .audit-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.app .audit-step-icon,
.app .signal-dot {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--green) 22%, transparent);
}
.app .audit-step strong,
.app .audit-card b {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}
.app .audit-step span,
.app .audit-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.app .audit-card b {
  margin-top: 6px;
  font-size: clamp(20px, 2.8vw, 29px);
}
.app .signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  white-space: nowrap;
}
.app .signal-dot {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border-radius: 6px;
  box-shadow: none;
}
.app .signal.win .signal-dot,
.app .audit-card.win { border-color: color-mix(in srgb, var(--green) 42%, var(--line)); }
.app .signal.win .signal-dot { background: var(--green); }
.app .signal.warn .signal-dot,
.app .audit-card.warn { border-color: color-mix(in srgb, var(--amber) 48%, var(--line)); }
.app .signal.warn .signal-dot { background: var(--amber); }
.app .signal.bad .signal-dot,
.app .audit-card.bad { border-color: color-mix(in srgb, var(--red) 46%, var(--line)); }
.app .signal.bad .signal-dot { background: var(--red); }
.app .signal.info .signal-dot,
.app .audit-card.info { border-color: color-mix(in srgb, var(--blue) 42%, var(--line)); }
.app .signal.info .signal-dot { background: var(--blue); }
.app .audit-table {
  min-width: 1420px;
}
.app .audit-group-table { min-width: 1500px; }
.app .audit-table td,
.app .audit-table th {
  vertical-align: top;
}
.app .metric-muted {
  color: var(--muted);
  font-size: 11px;
}
.app .audit-level-panel { margin-top: 18px; }
.app .audit-level {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.app .creative-audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.app .creative-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ink) 6%, transparent);
}
.app .creative-card.bad { border-top: 3px solid var(--red); }
.app .creative-card.warn { border-top: 3px solid var(--amber); }
.app .creative-card.win { border-top: 3px solid var(--green); }
.app .creative-card.info { border-top: 3px solid var(--blue); }
.app .creative-media {
  position: relative;
  align-self: start;
  width: 88px;
  aspect-ratio: 4 / 5;
  min-height: 0;
  margin: 14px 0 14px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background:
    radial-gradient(circle at 22% 18%, color-mix(in srgb, var(--green) 22%, transparent), transparent 36%),
    var(--surface-2);
}
.app .creative-preview-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
}
.app .creative-preview-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 72%, transparent);
  outline-offset: -3px;
}
.app .creative-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  transition: transform .18s var(--dash-ease);
}
.app .creative-preview-link:hover img { transform: scale(1.025); }
.app .creative-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  color: var(--muted);
}
.app .creative-placeholder span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--green) 45%, var(--line));
  border-radius: 12px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  font-size: 18px;
  font-weight: 900;
}
.app .creative-placeholder small {
  max-width: 74px;
  margin-top: 7px;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app .creative-type {
  position: absolute;
  right: 5px;
  bottom: 5px;
  max-width: calc(100% - 10px);
  padding: 3px 5px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(11,20,16,.76);
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.app .creative-body { min-width: 0; padding: 14px; }
.app .creative-top,
.app .creative-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.app .creative-top > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.app .creative-status {
  color: var(--muted);
  font-size: 10px;
  text-transform: capitalize;
}
.app .creative-card h4 {
  margin: 13px 0 4px;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.18;
}
.app .creative-path {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.app .creative-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0;
  border-block: 1px solid var(--line);
}
.app .creative-metrics span {
  min-width: 0;
  padding: 9px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.app .creative-metrics span:nth-child(2n) { border-right: 0; }
.app .creative-metrics span:nth-last-child(-n+2) { border-bottom: 0; }
.app .creative-metrics small,
.app .creative-metrics b { display: block; }
.app .creative-metrics small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.app .creative-metrics b { margin-top: 3px; font-size: 14px; }
.app .copy-stack {
  display: grid;
  gap: 7px;
}
.app .copy-stack details {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-2) 66%, transparent);
}
.app .copy-stack summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}
.app .copy-stack summary::-webkit-details-marker { display: none; }
.app .copy-stack summary span {
  color: var(--muted);
  font-size: 10px;
}
.app .copy-stack ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 12px 12px 28px;
}
.app .copy-stack li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
}
.app .copy-stack .metric-muted { display: block; padding: 0 12px 12px; }
.app .creative-footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}
.app .creative-footer a { color: var(--blue); font-weight: 800; }
.app .creative-action {
  margin: 11px 0 0;
  padding: 10px;
  border-left: 3px solid currentColor;
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, currentColor 5%, transparent);
  font-size: 12px;
}
.app .creative-empty { grid-column: 1 / -1; }

/* CRM: mesma linguagem, menos caixas e maior continuidade visual. */
.crm-main header.top {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}
.crm-shell .kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 18px;
  border-block: 1px solid var(--border);
}
.crm-shell .kpi {
  min-height: 116px;
  padding: 15px 14px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.crm-shell .kpi:nth-child(2n) { border-right: 0; }
.crm-shell .kpi .val { font-size: clamp(24px, 3vw, 32px); }
.crm-shell .card {
  padding: 20px 0 16px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.crm-shell .card h2 { font-size: 16px; }
.crm-shell .grid2 { gap: 28px; }
.crm-shell .media-card { overflow: visible; }
.crm-shell .media-summary {
  gap: 0;
  padding-block: 10px;
  border-block: 1px solid var(--border);
}
.crm-shell .media-stat {
  padding: 7px 11px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.crm-shell .media-stat:nth-child(2n) { border-right: 0; }
.crm-shell .media-row {
  border: 0;
  border-bottom: 1px solid var(--grid);
  border-radius: 0;
}
.crm-shell .media-row:last-child { border-bottom: 0; }
.crm-shell .media-value {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.crm-shell .media-track { height: 10px; border-radius: 3px; }
.crm-shell .media-bar { transition: width .32s var(--dash-ease); }
.crm-shell .media-key { border-radius: 1px; }
.crm-shell .media-key.google { border-radius: 50%; }
.crm-shell .spark { border-radius: 8px; box-shadow: none; }
.crm-shell .tblwrap { border-block: 1px solid var(--border); }

@media (min-width: 620px) {
  .app .funds-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app .kpis,
  .crm-shell .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app .kpi:nth-child(2n) { border-right: 1px solid var(--line); }
  .crm-shell .kpi:nth-child(2n) { border-right: 1px solid var(--border); }
  .app .kpi:nth-child(3n) { border-right: 0; }
  .crm-shell .kpi:nth-child(3n) { border-right: 0; }
  .crm-shell .media-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-shell .media-stat:nth-child(2n) { border-right: 1px solid var(--border); }
  .crm-shell .media-stat:nth-child(3n) { border-right: 0; }
  .app .creative-card { grid-template-columns: 104px minmax(0, 1fr); }
  .app .creative-media { width: 104px; }
}

@media (min-width: 900px) {
  .app .hero { grid-template-columns: minmax(0, 1.8fr) minmax(260px, .8fr); }
  .app .context { border-left: 1px solid var(--line); }
  .app .toolbar.filters-collapsed,
  .crm-main .toolbar.filters-collapsed { min-height: 54px; }
  .app .audit-hero { grid-template-columns: minmax(0, 1.4fr) minmax(330px, .8fr); }
  .app .audit-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .app .creative-audit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app .creative-card { grid-template-columns: 112px minmax(0, 1fr); }
  .app .creative-media { width: 112px; }
}

@media (min-width: 1320px) {
  .app .creative-audit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1120px) {
  .app .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .crm-shell .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .app .kpi:nth-child(3n) { border-right: 1px solid var(--line); }
  .crm-shell .kpi:nth-child(3n) { border-right: 1px solid var(--border); }
  .app .kpi:last-child,
  .crm-shell .kpi:last-child { border-right: 0; }
  .crm-shell .media-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .crm-shell .media-stat:nth-child(3n) { border-right: 1px solid var(--border); }
  .crm-shell .media-stat:last-child { border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .app .brand-card,
  .app .bar-fill,
  .app .creative-media img,
  .crm-shell .media-bar { transition: none !important; transform: none !important; }
}
