:root {
  --bg: #0e1013;
  --surface: #171a1f;
  --surface-2: #1f242b;
  --border: #2a3038;
  --text: #e8eaed;
  --text-dim: #9aa3ad;
  --accent: #c8f542;        /* verde-limão: campeão */
  --up: #4ade80;
  --down: #f87171;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--text); text-decoration: none; }
main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 80px; }

/* topbar */
.topbar { display: flex; align-items: center; gap: 28px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; letter-spacing: 2px; font-size: 18px; color: var(--accent); }
.brand span { color: var(--text-dim); font-weight: 400; letter-spacing: 0; font-size: 12px; margin-left: 6px; }
.brand.big { font-size: 34px; display: block; text-align: center; margin-bottom: 24px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 14px; border-radius: 6px; color: var(--text-dim); transition: background .15s, color .15s; }
.topbar nav a:hover, .topbar nav a:focus-visible { background: var(--surface-2); color: var(--text); }
.topbar nav a.active { background: var(--surface-2); color: var(--accent); }
.userbox { color: var(--text-dim); font-size: 13px; }
.userbox a { color: var(--text-dim); text-decoration: underline; }

/* forms */
input, select, button { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { cursor: pointer; background: var(--accent); color: #0e1013; font-weight: 700; border: none; transition: filter .15s; }
button:hover { filter: brightness(1.1); }
button.ghost, a.ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); font-weight: 400; padding: 9px 12px; border-radius: 6px; }
button.ghost:hover, a.ghost:hover { color: var(--text); border-color: var(--text-dim); }

.coletando { background: var(--surface-2); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; color: var(--text); font-size: 14px; }
.searchnow { display: flex; gap: 10px; margin-bottom: 8px; }
.searchnow input { flex: 1; min-width: 220px; border-color: var(--accent); background: var(--surface); font-size: 16px; padding: 13px 16px; }
.searchnow button { padding: 13px 22px; font-size: 16px; white-space: nowrap; }
.searchnow-hint { color: var(--text-dim); font-size: 13px; margin-bottom: 22px; }
.searchbar { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.searchbar input[type=search] { flex: 1; min-width: 220px; }

/* cards / grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.ad-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.ad-card:hover { transform: translateY(-2px); border-color: var(--text-dim); }
.ad-card.champion { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(200,245,66,.07); }
.media { position: relative; display: block; aspect-ratio: 1.91/1; background: var(--surface-2); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-dim); font-size: 12px; letter-spacing: 2px; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #0e1013; font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 3px 8px; border-radius: 4px; }
.badge.video { left: auto; right: 10px; background: rgba(0,0,0,.65); color: var(--text); }
.badge.inline { position: static; margin-right: 8px; }
.ad-card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.advertiser { font-size: 14px; }
.trend { font-size: 12px; }
.trend.subindo { color: var(--up); }
.trend.caindo { color: var(--down); }
.trend.estavel { color: var(--text-dim); }
.copy { color: var(--text-dim); font-size: 13px; flex: 1; }
.stats { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 10px; }
.fav-form { margin-left: auto; }
.fav { background: transparent; border: none; color: var(--text-dim); font-size: 18px; padding: 2px 6px; }
.fav.on { color: var(--accent); }
.fav.big { border: 1px solid var(--border); border-radius: 6px; font-size: 14px; padding: 8px 14px; }

/* detail */
.detail-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 20px; }
.detail-head h1 { font-size: 24px; }
.sub { color: var(--text-dim); }
.inactive { color: var(--down); }
.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; align-items: start; }
.detail-media { max-width: 100%; border-radius: 8px; margin-bottom: 14px; }
.fullcopy { white-space: pre-wrap; margin: 8px 0 14px; }
.detail h2 { font-size: 15px; margin: 18px 0 8px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.mini { color: var(--text-dim); font-size: 12px; margin-top: 10px; }
.spark { width: 100%; height: 60px; color: var(--accent); margin-bottom: 8px; }
.analysis-body h3 { color: var(--accent); font-size: 14px; margin: 14px 0 6px; }
.analysis-body p, .analysis-body li { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.analysis-body li { margin-left: 18px; }

/* tables */
.listing, .snaps { width: 100%; border-collapse: collapse; margin-top: 14px; }
.listing th, .snaps th { text-align: left; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.listing td, .snaps td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.errline td { color: var(--down); }
.muted td { color: var(--text-dim); }
.addtarget { display: flex; gap: 10px; flex-wrap: wrap; }
.addtarget input { flex: 1; min-width: 220px; }

.pagetitle { font-size: 20px; margin-bottom: 16px; }
.empty { color: var(--text-dim); padding: 30px 0; }
.error { color: var(--down); margin-bottom: 12px; }

/* login */
.login-wrap { max-width: 380px; margin: 10vh auto 0; }
.login-card { display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }

@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
}
