/* ------------------------------------------------------------------ */
/*  MEDIA KIT — Roberto Jorge                                          */
/* ------------------------------------------------------------------ */

:root {
  --bg:           #07090F;
  --bg-2:         #0B0E18;
  --surface:      #121624;
  --surface-2:    #181D2E;
  --surface-3:    #1F2539;
  --border:       rgba(255, 255, 255, 0.07);
  --border-2:     rgba(255, 255, 255, 0.12);
  --text:         #EAECF5;
  --text-mid:     #B5BAD0;
  --text-mute:    #6C7491;
  --text-dim:     #4A516B;
  --green:        #22D39A;
  --red:          #FF5577;

  /* Platform colors */
  --yt-1:  #FF1E3C;
  --yt-2:  #FF7548;
  --yt-3:  #2A0610;
  --yt-glow: 255 40 80;

  --ig-1: #FFC93D;
  --ig-2: #FF4F8A;
  --ig-3: #B721E3;
  --ig-4: #4F5BD5;
  --ig-glow: 245 60 138;

  --tt-1: #25F4EE;
  --tt-2: #FE2C55;
  --tt-3: #0B1118;
  --tt-glow: 37 244 238;

  --fb-1: #1877F2;
  --fb-2: #00D4FF;
  --fb-3: #0A1F3E;
  --fb-glow: 24 119 242;

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(80, 60, 200, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 30%, rgba(200, 40, 100, 0.10), transparent 60%),
    var(--bg);
}

.display, .num {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-feature-settings: "tnum" 1, "ss01" 1;
  letter-spacing: -0.01em;
}

.num { font-variant-numeric: tabular-nums; }

button, input { font-family: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------------ */
/*  LAYOUT                                                             */
/* ------------------------------------------------------------------ */

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 28px 80px;
}

/* ------------------------------------------------------------------ */
/*  TOP BAR                                                            */
/* ------------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 0 22px;
}

.topbar .toggle-lang {
  margin-left: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
}
.brand-mark svg { width: 18px; height: 18px; color: white; }

.brand .pipe { opacity: 0.3; }
.brand .sub { font-weight: 400; color: var(--text-mid); }

.search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  max-width: 420px;
  color: var(--text-mute);
  transition: border-color 0.15s;
}
.search:focus-within { border-color: var(--border-2); }
.search input {
  flex: 1; background: none; border: 0; outline: 0;
  font-size: 13px;
}
.search input::placeholder { color: var(--text-mute); }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  position: relative;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-chip:hover { background: var(--surface-2); }
.user-chip img {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover;
}
.user-chip .name { font-size: 13px; font-weight: 500; }

/* ------------------------------------------------------------------ */
/*  HERO PROFILE CARD                                                  */
/* ------------------------------------------------------------------ */

.hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(500px 200px at 0% 0%, rgba(110, 84, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-avatar {
  position: relative;
  width: 132px; height: 132px;
}
.hero-avatar img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover;
  border: 3px solid #0B0E18;
}
.hero-avatar::before {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #6E54FF, #FF4F8A, #25F4EE, #6E54FF);
  z-index: -1;
}
.hero-avatar::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #6E54FF, #FF4F8A, #25F4EE, #6E54FF);
  filter: blur(14px); opacity: 0.5;
  z-index: -2;
}

.hero-info { z-index: 1; }
.hero-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 6px;
}
.hero-name .pipe { color: var(--text-dim); font-weight: 300; }
.hero-name .role { color: var(--text-mid); font-weight: 400; font-size: 14px; }
.hero-bio {
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.5;
  text-align: justify;
  margin: 12px 0 6px;
}
.hero-links {
  display: flex; gap: 18px;
  font-size: 13px;
  color: var(--text-mid);
}
.hero-links a { display: inline-flex; align-items: center; gap: 6px; transition: color 0.15s; }
.hero-links a:hover { color: var(--text); }
.hero-links svg { width: 14px; height: 14px; opacity: 0.8; }

.hero-divider {
  height: 1px; background: var(--border);
  margin: 18px 0 14px;
}

.hero-metrics-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-mute);
  margin-bottom: 12px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.metric .v {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 6px;
}
.metric .label {
  font-size: 11px;
  color: var(--text-mid);
  margin-top: 2px;
}
.metric .trend {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}
.metric.has-donut {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
}

.donut {
  width: 44px; height: 44px; flex-shrink: 0;
}

.hero-period {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--text-mid);
  cursor: pointer;
  align-self: flex-start;
  z-index: 1;
}
.hero-period:hover { background: #232a40; }
.hero-period svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ */
/*  PLATFORM CARDS                                                     */
/* ------------------------------------------------------------------ */

.platforms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

/* Instagram, TikTok, Facebook na primeira linha (2 colunas cada) */
.platform:nth-child(1) {
  grid-column: 1 / 3;
}

.platform:nth-child(2) {
  grid-column: 3 / 5;
}

.platform:nth-child(3) {
  grid-column: 5 / 7;
}

/* YouTube cartões na segunda linha (3 colunas cada) */
.platform:nth-child(4) {
  grid-column: 1 / 4;
}

.platform:nth-child(5) {
  grid-column: 4 / 7;
}

.platform {
  position: relative;
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
  isolation: isolate;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 320px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.platform:hover {
  transform: translateY(-3px);
}

.platform::before {
  content: ''; position: absolute; inset: 0;
  z-index: -2;
  border-radius: inherit;
}
.platform::after {
  content: ''; position: absolute; inset: 1px;
  z-index: -1;
  border-radius: calc(var(--radius) - 1px);
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(20px);
}

.platform.yt::before {
  background: linear-gradient(155deg, #FF1E3C 0%, #C61029 35%, #5B0817 75%, #1A0309 100%);
  box-shadow: 0 16px 50px -16px rgba(var(--yt-glow), 0.4);
}
.platform.ig::before {
  background: linear-gradient(155deg, #FFC93D 0%, #FF4F8A 35%, #B721E3 70%, #4F5BD5 100%);
  box-shadow: 0 16px 50px -16px rgba(var(--ig-glow), 0.4);
}
.platform.tt::before {
  background: linear-gradient(155deg, #25F4EE 0%, #5BC4E6 25%, #5C4E8E 55%, #FE2C55 100%);
  box-shadow: 0 16px 50px -16px rgba(var(--tt-glow), 0.4);
}
.platform.fb::before {
  background: linear-gradient(155deg, #00D4FF 0%, #1877F2 50%, #0A1F3E 100%);
  box-shadow: 0 16px 50px -16px rgba(var(--fb-glow), 0.4);
}

.platform-head {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
}
.platform-head .ico {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
}
.platform.yt .ico { background: linear-gradient(135deg, #FF1E3C, #C61029); }
.platform.ig .ico { background: linear-gradient(135deg, #FFC93D, #B721E3); }
.platform.tt .ico { background: #0B1118; border: 1px solid rgba(255,255,255,0.1); }
.platform.fb .ico { background: linear-gradient(135deg, #1877F2, #00D4FF); }
.platform-head .ico svg { width: 16px; height: 16px; color: white; }

.platform-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.p-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
}
.p-stat .v {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.p-stat .label {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
  display: flex; align-items: center; gap: 6px;
}
.p-stat .trend {
  color: var(--green);
  font-weight: 700;
  font-size: 10px;
  font-family: 'Space Grotesk', sans-serif;
}
.p-stat .trend.down { color: var(--red); }

.p-stat.special {
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}

.p-footer {
  margin-top: auto;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}
.p-footer .label {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}
.p-footer .body {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  line-height: 1.4;
}

/* mini bars sparkline */
.sparkline {
  display: flex; align-items: flex-end; gap: 3px;
  height: 30px;
}
.sparkline span {
  flex: 1;
  background: linear-gradient(180deg, rgba(37,244,238,0.9), rgba(37,244,238,0.3));
  border-radius: 2px;
  min-height: 3px;
}
.platform.ig .sparkline span { background: linear-gradient(180deg, rgba(255,79,138,0.9), rgba(255,79,138,0.3)); }
.platform.yt .sparkline span { background: linear-gradient(180deg, rgba(255,30,60,0.9), rgba(255,30,60,0.3)); }
.platform.fb .sparkline span { background: linear-gradient(180deg, rgba(0,212,255,0.9), rgba(0,212,255,0.3)); }

/* sparkline line */
.spark-svg { width: 100%; height: 30px; }

/* ------------------------------------------------------------------ */
/*  TABS                                                               */
/* ------------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: 4px;
  margin-top: 32px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  justify-content: space-evenly;
}

.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mute);
  transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text-mid); }
.tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.tab.active {
  background: linear-gradient(135deg, #6E54FF 0%, #4F5BD5 100%);
  color: white;
  box-shadow: 0 6px 16px -6px rgba(110, 84, 255, 0.6);
}

/* ------------------------------------------------------------------ */
/*  TAB CONTENT                                                        */
/* ------------------------------------------------------------------ */

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 600;
  margin: 28px 0 18px;
  letter-spacing: -0.01em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(18,22,36,0.8) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: -10px;
  margin-bottom: 14px;
}

/* engagement growth chart */
.growth-legend {
  display: flex; gap: 16px;
  justify-content: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-mid);
}
.growth-legend span {
  display: inline-flex; align-items: center; gap: 6px;
}
.growth-legend i {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}

/* bars demographics */
.demos {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
.demos-title {
  font-size: 12px; color: var(--text-mute);
  text-align: center;
  margin-bottom: 8px;
}

/* top content */
.tc-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.tc-row:hover { background: rgba(255,255,255,0.03); }
.tc-rank {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--text-dim);
}
.tc-thumb {
  width: 56px; height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-dim);
  font-size: 10px;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}
.tc-thumb.yt { background: linear-gradient(135deg, #FF1E3C, #5B0817); color: white; }
.tc-thumb.ig { background: linear-gradient(135deg, #FFC93D, #B721E3); color: white; }
.tc-thumb.tt { background: linear-gradient(135deg, #25F4EE, #FE2C55); color: white; }
.tc-thumb.fb { background: linear-gradient(135deg, #00D4FF, #1877F2); color: white; }
.tc-title { font-size: 13px; line-height: 1.35; }
.tc-meta { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.tc-views {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
}
.tc-views .lbl { font-size: 10px; color: var(--text-mute); font-weight: 400; display: block; }

/* world / region list */
.region-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.region-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.region-flag { font-size: 18px; }
.region-bar {
  height: 6px; background: var(--surface-3); border-radius: 3px;
  overflow: hidden; position: relative;
}
.region-bar i {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #6E54FF, #FF4F8A);
  border-radius: 3px;
}
.region-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  min-width: 44px; text-align: right;
}

/* settings modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 6, 14, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
}
.modal {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}
.modal h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 600;
  margin: 0 0 6px;
}
.modal .subtitle { font-size: 13px; color: var(--text-mid); margin-bottom: 22px; }
.modal label {
  display: block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.modal input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.modal input:focus { border-color: #6E54FF; }
.modal .field { margin-bottom: 14px; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px;
}
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn.primary {
  background: linear-gradient(135deg, #6E54FF 0%, #4F5BD5 100%);
  color: white;
  box-shadow: 0 6px 16px -6px rgba(110, 84, 255, 0.6);
}
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost {
  background: var(--surface-3);
  color: var(--text-mid);
}
.btn.ghost:hover { background: #2a3149; color: var(--text); }

.banner {
  background: linear-gradient(90deg, rgba(110,84,255,0.12), rgba(255,79,138,0.08));
  border: 1px solid rgba(110,84,255,0.3);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-mid);
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
}
.banner svg { width: 16px; height: 16px; color: #6E54FF; flex-shrink: 0; }
.banner button {
  background: rgba(110,84,255,0.2);
  border: 1px solid rgba(110,84,255,0.4);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}
.banner button:hover { background: rgba(110,84,255,0.35); }

.toggle-lang {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.toggle-lang button {
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-lang button.active {
  background: var(--surface-3);
  color: var(--text);
}

/* Debug Panel */
.debug-modal {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 12px;
}
.debug-modal h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
}
.debug-modal .empty {
  color: var(--text-mute);
  padding: 30px;
  text-align: center;
  font-size: 13px;
}
.log-entry {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.5;
}
.log-entry .head {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 6px;
}
.log-entry .pill {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
}
.log-entry .pill.ig { background: linear-gradient(90deg, #FFC93D, #B721E3); color: white; }
.log-entry .pill.yt { background: linear-gradient(90deg, #FF1E3C, #FF7548); color: white; }
.log-entry .pill.tt { background: linear-gradient(90deg, #25F4EE, #FE2C55); color: white; }
.log-entry .pill.fb { background: linear-gradient(90deg, #00D4FF, #1877F2); color: white; }
.log-entry .pill.unknown { background: var(--surface-3); color: var(--text-mid); }
.log-entry .status {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
}
.log-entry .status.ok    { background: rgba(34,211,154,0.18); color: #5BE6B6; }
.log-entry .status.warn  { background: rgba(255,200,60,0.15); color: #FFC93D; }
.log-entry .status.err   { background: rgba(255,85,119,0.18); color: var(--red); }
.log-entry .ts { color: var(--text-mute); font-size: 10px; margin-left: auto; }
.log-entry .url {
  color: var(--text-mid);
  word-break: break-all;
  background: rgba(0,0,0,0.3);
  padding: 6px 8px;
  border-radius: 6px;
  margin-top: 4px;
}
.log-entry .err-msg {
  color: var(--red);
  margin-top: 6px;
  background: rgba(255,85,119,0.08);
  padding: 6px 8px;
  border-radius: 6px;
}
.log-entry details {
  margin-top: 6px;
}
.log-entry summary {
  cursor: pointer;
  color: var(--text-mute);
  font-size: 10px;
  user-select: none;
}
.log-entry pre {
  max-height: 240px;
  overflow: auto;
  background: rgba(0,0,0,0.4);
  padding: 10px;
  border-radius: 6px;
  color: #aabad6;
  font-size: 10px;
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* loading state */
.loading {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.data-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
}
.data-tag.live { background: rgba(34,211,154,0.15); color: #5BE6B6; }
.data-tag.demo { background: rgba(255,255,255,0.08); color: var(--text-mute); }
.data-tag.err  { background: rgba(255,85,119,0.15); color: var(--red); }
.data-tag .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* engagement & rates */
.rate-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.rate-row:last-child { border-bottom: 0; }
.rate-row .label { font-size: 13px; color: var(--text-mid); display: flex; align-items: center; gap: 10px; }
.rate-row .value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
}
.platform-dot {
  width: 10px; height: 10px; border-radius: 3px;
}
.platform-dot.yt { background: linear-gradient(135deg, #FF1E3C, #C61029); }
.platform-dot.ig { background: linear-gradient(135deg, #FFC93D, #B721E3); }
.platform-dot.tt { background: linear-gradient(135deg, #25F4EE, #FE2C55); }
.platform-dot.fb { background: linear-gradient(135deg, #00D4FF, #1877F2); }

/* Demographics & Analysis Section */
.demo-chart {
  margin-bottom: 28px;
}
.demo-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.demo-platform-section {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.demo-platform-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* responsive demographics */
@media (max-width: 1100px) {
  .demo-grid { grid-template-columns: 1fr; }
}

/* responsive-ish */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: auto 1fr; }
  .hero-period { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .shell { padding: 14px; }
  .platforms {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  /* reset grid-column spans so cards don't create implicit columns */
  .platform:nth-child(1),
  .platform:nth-child(2),
  .platform:nth-child(3),
  .platform:nth-child(4),
  .platform:nth-child(5) {
    grid-column: auto;
  }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-avatar { margin: 0 auto; }
  .hero-metrics { grid-template-columns: 1fr 1fr; }
  .topbar { grid-template-columns: 1fr auto; gap: 10px; }
  .search { grid-column: 1 / -1; order: 5; }
  .brand .sub { display: none; }

  /* tabs: icons only on mobile */
  .tabs {
    gap: 2px;
    padding: 5px;
    justify-content: space-between;
  }
  .tab {
    flex: 1;
    justify-content: center;
    padding: 10px 6px;
    gap: 0;
  }
  .tab svg { width: 18px; height: 18px; }
  .tab-label { display: none; }
}
