:root {
  --bg: #0a0a0c;
  --surface: #16161a;
  --surface-2: #1f1f24;
  --accent: #b81f26;
  --accent-hover: #8f1820;
  --text: #ffffff;
  --text-secondary: #6e6e72;
  --border: #2a2a2e;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Oswald', system-ui;
  --voltagem: #e8ff2e;

  /* Theme-aware tokens */
  --accent-text: #e85058;
  --surface-hover: rgba(255,255,255,0.05);
  --surface-active: rgba(255,255,255,0.08);
  --shadow-card: 0 8px 28px rgba(0,0,0,0.4);
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.6);
  --skel-shine: #2a2a2e;
  --overlay-dark: rgba(0,0,0,0.75);
}

[data-theme="light"] {
  --bg: #f1e8d6;
  --surface: #e5d9bd;
  --surface-2: #d8ccb0;
  --text: #0a0a0c;
  --text-secondary: #6e6e72;
  --border: #c8bca4;
  --accent-text: #b81f26;
  --surface-hover: rgba(0,0,0,0.04);
  --surface-active: rgba(0,0,0,0.07);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.2);
  --skel-shine: #cfc3a8;
  --overlay-dark: rgba(0,0,0,0.5);
}

/* Force white text on accent-colored elements in light mode */
[data-theme="light"] .btn-cta,
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-confirm,
[data-theme="light"] .cta-button:not(.cta-button--secondary),
[data-theme="light"] .ftab--active,
[data-theme="light"] #search-btn { color: #fff; }

/* ── Theme toggle button ─────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  background: var(--surface-hover);
}

/* ── User menu ───────────────────────────────────────────────── */
.user-menu {
  position: relative;
  flex-shrink: 0;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.2s;
}
.user-avatar:hover { opacity: 0.85; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  min-width: 210px;
  box-shadow: var(--shadow-card);
  z-index: 9999;
  display: none;
}
.user-dropdown.open { display: block; }

.user-dropdown-info {
  padding: 10px 12px 8px;
}
.user-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-email {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.user-dropdown-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.user-dropdown-logout:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ── Onboarding overlay ──────────────────────────────────────── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-modal);
}
.onboarding-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.onboarding-card .onb-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
  line-height: 1.5;
}
.onb-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}
.onb-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.onb-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.onb-step-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.onb-step-text span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.onb-start-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.onb-start-btn:hover { background: var(--accent-hover); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============================================================
   LANDING
   ============================================================ */

.landing {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at top, rgba(184, 31, 38, 0.15) 0%, transparent 55%), var(--bg);
}

.landing-header { padding: 24px 40px; display: flex; align-items: center; justify-content: space-between; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover .brand-name { opacity: 0.75; }
.brand:hover { color: var(--text); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  background: transparent;
  border-radius: 0;
  flex-shrink: 0;
}

.brand-name { font-size: 17px; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; transition: opacity 0.15s; }

.brand-logo { height: 44px; width: auto; display: block; }
.brand-logo--light { display: none; }
[data-theme="light"] .brand-logo--dark { display: none; }
[data-theme="light"] .brand-logo--light { display: block; }

.landing-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.hero { max-width: 760px; text-align: center; }

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(184, 31, 38, 0.15);
  color: var(--accent-text);
  border: 1px solid rgba(184, 31, 38, 0.45);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.08;
  margin-bottom: 18px;
}

.subheadline {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.cta-button {
  display: inline-block;
  padding: 16px 36px;
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cta-button:hover { background: var(--accent-hover); transform: translateY(-1px); }

.cta-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.cta-button--secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-secondary);
}
.cta-button--secondary:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
}

.hero-bullets {
  margin-top: 60px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  text-align: left;
}

.hero-bullet {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-bullet strong { font-size: 15px; font-weight: 600; }
.hero-bullet span { color: var(--text-secondary); font-size: 14px; }

.landing-footer {
  padding: 24px 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================================
   WIZARD — LAYOUT
   ============================================================ */

.wizard-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* Header */
.wiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 20px;
}

.wiz-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: flex-end;
}

/* Progress bar */
.wiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 380px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.wiz-progress.visible { opacity: 1; pointer-events: auto; }

.wiz-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.wiz-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #d4526a);
  border-radius: 2px;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.wiz-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Restart button */
.btn-restart {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, border-color 0.2s, color 0.2s;
}
.btn-restart.visible { opacity: 1; pointer-events: auto; }
.btn-restart:hover { border-color: var(--text-secondary); color: var(--text); }

/* Main scrollable area */
.wiz-main {
  flex: 1;
  overflow-y: auto;
  padding: 48px 24px 60px;
  scroll-behavior: smooth;
}

.wiz-main::-webkit-scrollbar { width: 8px; }
.wiz-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================================
   STEP — WELCOME
   ============================================================ */

.s-welcome {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(184,31,38,0.14) 0%, transparent 60%);
}

.s-welcome-inner { max-width: 580px; }

.s-welcome-inner h1 {
  font-size: clamp(30px, 4.5vw, 50px);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.08;
  margin: 18px 0;
}

.s-welcome-inner p {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* From-video welcome banner */
.from-video-banner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  max-width: 480px;
  text-align: left;
}
.from-video-icon { font-size: 22px; flex-shrink: 0; }
.from-video-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.from-video-channel { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Video hint in area select */
.video-hint {
  display: inline-flex;
  padding: 8px 14px;
  background: rgba(184,31,38,0.08);
  border: 1px solid rgba(184,31,38,0.25);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-hint strong { color: var(--text); }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 17px 40px;
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  border: none;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.btn-cta:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-cta:active { transform: translateY(0); }

/* ============================================================
   STEP — SHARED QUESTION LAYOUT
   ============================================================ */

.s-step {
  max-width: 740px;
  margin: 0 auto;
  padding: 8px 0;
}

.step-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.s-step h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 28px;
}

/* Area grid */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.area-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.area-card:hover {
  border-color: var(--accent);
  background: rgba(184,31,38,0.08);
  transform: translateY(-2px);
}

.ac-icon  { font-size: 26px; margin-bottom: 4px; }
.ac-label { font-size: 14px; font-weight: 600; }
.ac-sub   { font-size: 12px; color: var(--text-secondary); }

/* Option list (refine steps) */
.opts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
}

.opt-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.opt-btn:hover {
  border-color: var(--accent);
  background: rgba(184,31,38,0.08);
  transform: translateX(4px);
}

.opt-icon { font-size: 22px; flex-shrink: 0; }

/* Other / freetext input */
.other-wrap {
  display: flex;
  gap: 12px;
  max-width: 560px;
  margin-bottom: 16px;
}

.other-inp {
  flex: 1;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.other-inp:focus { border-color: var(--accent); }
.other-inp::placeholder { color: var(--text-secondary); }

.btn-confirm {
  padding: 14px 22px;
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
  cursor: pointer;
}
.btn-confirm:hover { background: var(--accent-hover); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.btn-link:hover { color: var(--text); }

/* Back button row — shown above each wizard step */
.step-nav {
  margin-bottom: 8px;
}
.btn-back-step {
  font-size: 13px;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}
.btn-back-step:hover { opacity: 1; }

/* Format step nav row — Voltar + Recomeçar */
.fmt-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
}

/* Waiting for analysis — progress bar inside script card */
.analysis-wait {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 0;
}

/* Inline "outro" input expansion */
.opt-inline-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  animation: fadeInUp 0.15s ease;
}
.opt-inline-inp {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  min-width: 0;
}
.opt-inline-inp::placeholder { color: var(--text-secondary); }
.opt-inline-btn {
  padding: 9px 18px;
  font-size: 15px;
  flex-shrink: 0;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STEP — LOADING
   ============================================================ */

.s-loading {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
}

.ld-icon {
  font-size: 52px;
  animation: float 2.2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

.ld-phase {
  font-size: 16px;
  color: var(--text-secondary);
  transition: opacity 0.25s ease;
  min-height: 1.5em;
}

.ld-track {
  width: 280px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.ld-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #d4526a);
  border-radius: 3px;
  transition: width 0.55s ease;
}

/* ============================================================
   STEP — ANALYSIS RESULT
   ============================================================ */

.s-result { max-width: 900px; margin: 0 auto; }

.res-header { margin-bottom: 28px; }
.res-header h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 8px 0 6px;
}
.res-sub { font-size: 15px; color: var(--text-secondary); }

.an-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 30px;
}

.an-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.an-card--wide     { grid-column: 1 / -1; }
.an-card--briefing {
  grid-column: 1 / -1;
  background: rgba(184,31,38,0.07);
  border-color: rgba(184,31,38,0.35);
}

.an-emoji { font-size: 26px; margin-bottom: 10px; }
.an-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-text);
  margin-bottom: 12px;
  line-height: 1.4;
}
.an-body  { font-size: 13.5px; line-height: 1.65; }
.an-body ul { padding-left: 16px; margin: 6px 0; }
.an-body li { margin-bottom: 4px; }
.an-body h2, .an-body h3 { font-size: 13px; font-weight: 600; margin: 10px 0 4px; }

/* Action buttons shared */
.res-actions, .scr-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover   { background: var(--accent-hover); }
.btn-primary:active  { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); background: rgba(184,31,38,0.08); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-secondary); }

/* ============================================================
   STEP — FORMAT SELECTION
   ============================================================ */

.s-formats { max-width: 900px; margin: 0 auto; }

.fmt-header { margin-bottom: 28px; }
.fmt-header h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 8px 0 6px;
}

.fmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.fmt-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.fmt-card:hover {
  border-color: var(--accent);
  background: rgba(184,31,38,0.08);
  transform: translateY(-2px);
}
.fmt-card:active { transform: scale(0.98); }

.fmt-icon { font-size: 22px; margin-bottom: 3px; }
.fmt-name { font-size: 13px; font-weight: 700; letter-spacing: 0.2px; }
.fmt-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* ============================================================
   STEP — SCRIPT RESULT
   ============================================================ */

.s-script { max-width: 800px; margin: 0 auto; }

.scr-header { margin-bottom: 22px; }
.scr-header h2 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 8px;
}

.scr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.scr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(184,31,38,0.12);
  border: 1px solid rgba(184,31,38,0.4);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  letter-spacing: 0.3px;
  margin-bottom: 20px;
}

.scr-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  max-height: 520px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.scr-body::-webkit-scrollbar { width: 5px; }
.scr-body::-webkit-scrollbar-track { background: transparent; }
.scr-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.scr-body p {
  margin-bottom: 12px;
  line-height: 1.75;
}

/* ── Take cards ─────────────────────────────────────────────────────────── */
.scr-body .take-card,
.scr-body .take-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 10px 0;
  overflow: hidden;
}
.scr-body .take-card-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(184,31,38,0.12);
  border-bottom: 1px solid rgba(184,31,38,0.2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--accent-text);
}
.scr-body .take-card-hd::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.scr-body .take-card-bd {
  padding: 12px 16px;
}
.scr-body .take-card-bd p {
  margin: 0 0 8px;
  line-height: 1.75;
}
.scr-body .take-card-bd p:last-child { margin-bottom: 0; }
.scr-body .take-card:first-child { margin-top: 0; }

/* ── Labels de seção (FORMATO:, ROTEIRO COMPLETO:, etc.) ─────────────────── */
.scr-body .script-section-lbl {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.scr-body .script-section-lbl:first-child { margin-top: 0; }
.scr-body .ssl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}
.scr-body .ssv {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ── Legado: take-header (mantido para roteiros no cache antigo) ─────────── */
.scr-body .take-header {
  margin-top: 16px;
  margin-bottom: 4px;
  padding: 6px 12px;
  background: rgba(184,31,38,0.1);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent-text);
}

.scr-body ul { padding-left: 18px; margin: 8px 0 12px; }
.scr-body ol { padding-left: 18px; margin: 8px 0 12px; }
.scr-body li { margin-bottom: 6px; line-height: 1.65; }
.scr-body h1 { font-size: 17px; font-weight: 700; margin: 20px 0 8px; }
.scr-body h2 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; color: var(--text); }
.scr-body h3 { font-size: 13px; font-weight: 700; margin: 14px 0 5px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.scr-body strong { font-weight: 600; }
.scr-body code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.scr-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding: 9px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.scr-copy-btn:hover { border-color: var(--accent); color: var(--text); }

/* ============================================================
   TYPEWRITER THINKING DOT
   ============================================================ */

.thinking-dot {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  background: rgba(184,31,38,0.18);
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent-text);
  font-style: italic;
  animation: tdpulse 0.9s ease-in-out infinite;
}

@keyframes tdpulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ============================================================
   ERROR
   ============================================================ */

.s-error {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: var(--text-secondary);
}

/* ============================================================
   SHARED APP HEADER + NAV (wizard & research)
   ============================================================ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.app-nav-link {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.app-nav-link:hover    { color: var(--text); }
.app-nav-link--active  {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 1px var(--border);
}

/* ============================================================
   RESEARCH PAGE
   ============================================================ */

.research-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.research-wrap {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px 60px;
}

/* Search hero */
.search-hero {
  text-align: center;
  padding: 52px 0 36px;
}

.search-hero h1 {
  font-size: clamp(26px, 3.5vw, 38px);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.search-hero > p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.search-box {
  display: flex;
  align-items: center;
  max-width: 680px;
  margin: 0 auto 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
  gap: 8px;
  transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--accent); }

.search-icon { color: var(--text-secondary); flex-shrink: 0; }

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 8px 0;
}
.search-box input::placeholder { color: var(--text-secondary); }

#search-btn {
  padding: 10px 22px;
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
#search-btn:hover { background: var(--accent-hover); }

/* Suggestions */
.suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sug-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.sug-pill {
  padding: 5px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.sug-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(184,31,38,0.08);
}

/* Toolbar */
.results-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding-top: 8px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
}

.ftab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.ftab:hover          { color: var(--text); border-color: var(--text-secondary); }
.ftab--active        { background: var(--accent); color: var(--text); border-color: var(--accent); }

.saved-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Sort tabs */
.sort-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sort-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stab {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.stab:hover     { color: var(--text); border-color: var(--text-secondary); }
.stab--active   { color: var(--text); border-color: var(--text-secondary); background: var(--surface-2); }

/* Platform links */
.platform-links {
  display: flex;
  gap: 8px;
}

.plat-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s;
}
.plat-btn--ig {
  color: #e1306c;
  background: rgba(225,48,108,0.08);
  border-color: rgba(225,48,108,0.3);
}
.plat-btn--ig:hover { background: rgba(225,48,108,0.15); border-color: #e1306c; }

.plat-btn--tt {
  color: #69c9d0;
  background: rgba(105,201,208,0.08);
  border-color: rgba(105,201,208,0.3);
}
.plat-btn--tt:hover { background: rgba(105,201,208,0.15); border-color: #69c9d0; }

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* Video card */
.vid-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.vid-card:hover {
  border-color: rgba(184,31,38,0.5);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.vid-card--saved { border-color: rgba(184,31,38,0.35); }

.vid-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

/* Short cards are narrower / portrait */
.vid-card--short .vid-thumb-wrap { aspect-ratio: 9/16; }

.vid-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface-2);
}

.vid-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.vid-card:hover .vid-thumb { transform: scale(1.04); }

/* Bookmark save button */
.vid-save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  color: rgba(255,255,255,0.6);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  z-index: 2;
}
.vid-card:hover .vid-save-btn,
.vid-save-btn.saved { opacity: 1; }
.vid-save-btn.saved { color: var(--accent); }
.vid-save-btn:hover { background: rgba(0,0,0,0.85); color: #fff; }

/* Create script button */
.vid-create-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.vid-create-btn:hover,
.vid-card:hover .vid-create-btn {
  background: var(--accent);
  color: #fff;
  border-top-color: var(--accent);
}

.vid-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.vid-card:hover .vid-play-overlay { opacity: 1; }

.vid-dur {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 7px;
  background: rgba(0,0,0,0.82);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
}
.vid-dur--short {
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.4px;
}

.vid-platform-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.7);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.2px;
}

.vid-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.vid-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.vid-channel {
  font-size: 13px;
  color: var(--text-secondary);
}

.vid-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: auto;
}

/* Loading spinner */
.search-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 0;
  color: var(--text-secondary);
}

.search-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty / error state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}
.empty-state p    { font-size: 16px; margin-bottom: 8px; }
.empty-state span { font-size: 14px; }
.empty-state code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.empty-state--error p { color: #f87171; }

/* ============================================================
   NOTÍCIAS PAGE
   ============================================================ */

.noticias-page { display: flex; flex-direction: column; min-height: 100%; }

.noticias-wrap {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  width: 100%;
}

.noticias-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.noticias-hero h1 { font-size: clamp(24px, 3vw, 36px); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.noticias-hero p  { font-size: 15px; color: var(--text-secondary); }

.noticias-hero-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.atualizacao-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-refresh:hover:not(:disabled) { color: var(--text); border-color: var(--text-secondary); }
.btn-refresh:disabled { opacity: 0.5; cursor: default; }

/* Category filters */
.noticias-filtros {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 28px;
  scrollbar-width: none;
}
.noticias-filtros::-webkit-scrollbar { display: none; }

.nfilt {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.nfilt:hover    { color: var(--text); border-color: var(--text-secondary); }
.nfilt--active  { background: var(--accent); color: #fff; border-color: var(--accent); }

/* News grid */
.noticias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* News card */
.card-noticia {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card-noticia:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(184,31,38,0.18);
  border-color: rgba(184,31,38,0.4);
}

.card-imagem {
  width: 100%;
  height: 160px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card-noticia:hover .card-imagem img { transform: scale(1.04); }
/* Cartão sem imagem: colapsa a área para não deixar espaço vazio */
.card-imagem:empty,
.card-imagem--empty { height: 0; border: none; }

.card-corpo {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.badge-fonte {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.card-titulo {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.card-resumo {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.card-data {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: 8px;
}

/* Skeleton */
.card-skeleton { pointer-events: none; }
.skel-img {
  width: 100%; height: 160px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--skel-shine) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skel-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.skel-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--skel-shine) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skel-short  { width: 40%; }
.skel-medium { width: 65%; }
.skel-full   { width: 100%; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty / error */
.noticias-vazio {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
}
.noticias-vazio p    { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.noticias-vazio span { font-size: 14px; }
.noticias-vazio--erro p { color: #f87171; }

/* ============================================================
   ROTEIROS / LIBRARY PAGE
   ============================================================ */

.roteiros-page { display: flex; flex-direction: column; min-height: 100%; }

.roteiros-wrap {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  width: 100%;
}

.roteiros-hero { margin-bottom: 32px; }
.roteiros-hero h1 { font-size: clamp(26px, 3vw, 38px); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.roteiros-hero p  { font-size: 16px; color: var(--text-secondary); }

/* Filter bar */
.board-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.bfilt {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.bfilt:hover    { color: var(--text); border-color: var(--text-secondary); }
.bfilt--active  { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Board columns */
.board {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.board-col {
  flex: 1;
  min-width: 280px;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.board-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.board-col-header h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.board-col-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 999px;
}

.board-col-cards { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* Script card */
.rcard {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: default;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rcard:hover { border-color: rgba(184,31,38,0.4); box-shadow: var(--shadow-card); }

.rcard-top {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rcard-area {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(184,31,38,0.12);
  color: var(--accent-text);
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.rcard-fmt {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: 999px;
}

.rcard-excerpt {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.rcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rcard-date { font-size: 12px; color: var(--text-secondary); }

.rcard-actions { display: flex; gap: 6px; align-items: center; }

.rcard-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.rcard-view {
  background: var(--accent);
  color: #fff;
}
.rcard-view:hover { background: var(--accent-hover); }

.rcard-delete {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 5px 7px;
}
.rcard-delete:hover { color: #f87171; border-color: #f87171; background: rgba(248,113,113,0.08); }

.board-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
  width: 100%;
}
.board-empty p    { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.board-empty span { font-size: 14px; }

.board-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-secondary);
  width: 100%;
}

/* Script modal */
.script-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.script-modal.open {
  pointer-events: all;
  opacity: 1;
}

.script-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  backdrop-filter: blur(4px);
}

.script-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-badges { display: flex; gap: 8px; align-items: center; }
.modal-area-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(184,31,38,0.12);
  color: var(--accent-text);
  border-radius: 999px;
}
.modal-fmt-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: 999px;
}
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* reuse scr-body typography inside modal */
.modal-body p              { margin-bottom: 12px; line-height: 1.75; font-size: 15px; }
.modal-body .take-header { margin-top: 16px; margin-bottom: 4px; padding: 6px 12px; background: rgba(184,31,38,0.1); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent-text); }
/* Take cards no modal */
.modal-body .take-card { border: 1px solid var(--border); border-radius: var(--radius); margin: 10px 0; overflow: hidden; }
.modal-body .take-card-hd { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(184,31,38,0.12); border-bottom: 1px solid rgba(184,31,38,0.2); font-size: 11px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--accent-text); }
.modal-body .take-card-hd::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.modal-body .take-card-bd { padding: 12px 16px; }
.modal-body .take-card-bd p { margin: 0 0 8px; line-height: 1.75; }
.modal-body .take-card-bd p:last-child { margin-bottom: 0; }
/* Labels de seção no modal */
.modal-body .script-section-lbl { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.modal-body .ssl { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-secondary); }
.modal-body .ssv { font-size: 14px; font-weight: 600; color: var(--text); }
.modal-body ul             { padding-left: 18px; margin: 8px 0 12px; }
.modal-body li             { margin-bottom: 6px; line-height: 1.65; font-size: 15px; }
.modal-body h2             { font-size: 16px; font-weight: 700; margin: 16px 0 6px; }
.modal-body h3             { font-size: 13px; font-weight: 700; margin: 14px 0 5px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.modal-body strong         { font-weight: 600; }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Save to library button in chat */
.btn-save-lib {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-save-lib:hover { background: rgba(184,31,38,0.1); border-color: var(--accent); }

/* Existing script found */
.existing-excerpt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 20px 0 28px;
  max-width: 600px;
  white-space: pre-wrap;
}
.existing-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Infinite scroll sentinel ──────────────────────────────── */
.scroll-sentinel {
  grid-column: 1 / -1;
  padding: 24px 0 8px;
}
.load-more-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 8px 0;
}
.load-more-error {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 8px 0;
}
.load-more-error button {
  margin-left: 8px;
  color: var(--accent-text, var(--accent));
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: inherit;
  font-family: inherit;
}

/* ============================================================
   ANÁLISE DE PÚBLICO — Dashboard
   ============================================================ */

.analise-page { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); }

.analise-wrap {
  flex: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  width: 100%;
}

/* Hero / form */
.analise-hero { margin-bottom: 32px; }
.analise-hero h1 { font-size: clamp(22px, 3vw, 34px); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.analise-hero p  { color: var(--text-secondary); font-size: 15px; margin-bottom: 24px; }

.analise-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.af-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.af-select {
  flex: 1;
  min-width: 160px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.af-select:focus    { outline: none; border-color: var(--accent); }
.af-select:disabled { opacity: 0.45; cursor: not-allowed; }

.af-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, opacity 0.2s;
  flex-shrink: 0;
}
.af-btn:hover    { background: var(--accent-hover); }
.af-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Dashboard header ── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.dash-header-text h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.dash-header-text p  { color: var(--text-secondary); font-size: 13.5px; }
.dash-header-text em { font-style: normal; opacity: 0.7; }

.dash-retry-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.dash-retry-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Error card ── */
.dash-error-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #991b1b;
}
[data-theme="light"] .dash-error-card { background: #fef2f2; border-color: #fecaca; }
[data-theme]:not([data-theme="light"]) .dash-error-card,
:root:not([data-theme]) .dash-error-card {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.25);
  color: #fca5a5;
}
.dash-error-icon { flex-shrink: 0; margin-top: 1px; }
.dash-error-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.dash-error-msg   { font-size: 12px; opacity: 0.8; }

/* ── Metric cards ── */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mc, var(--accent));
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.metric-icon-wrap {
  width: 32px; height: 32px;
  background: color-mix(in srgb, var(--mc, var(--accent)) 12%, transparent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mc, var(--accent));
  margin-bottom: 12px;
  flex-shrink: 0;
}
.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 4px;
}
.metric-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.metric-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Main 2×2 grid ── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.dash-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.dash-card-icon-wrap {
  width: 30px; height: 30px;
  background: color-mix(in srgb, var(--ci, var(--accent)) 12%, transparent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ci, var(--accent));
  flex-shrink: 0;
}
.dash-card-head h3   { font-size: 14.5px; font-weight: 700; flex: 1; margin: 0; }
.dash-card-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}
.dash-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.dash-empty-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 8px 0;
}

/* Bullet lists */
.dash-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dash-bullet-list li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  padding-left: 18px;
  position: relative;
}
.dash-bullet-list li::before {
  content: '›';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}
.dash-bullet-list--accent li::before { color: #ec4899; }

/* ── Keyword list ── */
.kw-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 12px; }
.kw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.kw-row:last-child { border-bottom: none; }
.kw-row-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.kw-row-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.kw-term   { font-size: 13px; font-weight: 500; color: var(--text); word-break: break-word; }
.kw-intent {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.int-informacional { background: rgba(3,105,161,0.1);  color: #0369a1; }
.int-comercial     { background: rgba(184,31,38,0.08);  color: #9f1239; }
.int-transacional  { background: rgba(124,58,237,0.1); color: #7c3aed; }
[data-theme]:not([data-theme="light"]) .int-informacional,
:root:not([data-theme]) .int-informacional { background: rgba(56,189,248,0.12); color: #38bdf8; }
[data-theme]:not([data-theme="light"]) .int-comercial,
:root:not([data-theme]) .int-comercial    { background: rgba(251,113,133,0.12); color: #fb7185; }
[data-theme]:not([data-theme="light"]) .int-transacional,
:root:not([data-theme]) .int-transacional { background: rgba(167,139,250,0.12); color: #a78bfa; }

.kw-vol { display: flex; gap: 3px; align-items: center; }
.vol-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
}
.vol-dot.vol-on { background: var(--accent); }

.kw-growth { font-size: 12px; font-weight: 700; color: #22c55e; white-space: nowrap; }

.kw-season {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 4px;
}
.kw-season svg { flex-shrink: 0; margin-top: 1px; }

/* ── Opportunities ── */
.opp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; flex: 1; }
/* ── Tendências full width + scroll ──────────────────────────────────────── */
.dash-card--fullwidth { grid-column: 1 / -1; }
.kw-scroll-wrap {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  margin-bottom: 4px;
}
.kw-scroll-wrap::-webkit-scrollbar { width: 4px; }
.kw-scroll-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Oportunidades clicáveis ─────────────────────────────────────────────── */
.opp-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
}
.opp-item--btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.opp-item--btn:hover {
  background: rgba(184,31,38,0.08);
  border-color: rgba(184,31,38,0.35);
}
.opp-item--btn:active { transform: scale(0.99); }
.opp-arrow { display: flex; align-items: center; flex-shrink: 0; color: var(--text-secondary); margin-top: 2px; transition: color 0.15s; }
.opp-item--btn:hover .opp-arrow { color: var(--accent-text); }
.opp-num {
  width: 22px; height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.opp-body { flex: 1; min-width: 0; }
.opp-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.opp-tema   { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; line-height: 1.35; }
.opp-badges { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.opp-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--bc, #888) 30%, transparent);
  background: color-mix(in srgb, var(--bc, #888) 10%, transparent);
  color: var(--bc, #888);
  white-space: nowrap;
}
.opp-motivo { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin: 0; }

.dash-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: auto;
}
.dash-create-btn:hover { background: var(--accent-hover); }

/* ── Market size ── */
.merc-desc {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
}
.merc-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.merc-stat         { display: flex; flex-direction: column; gap: 3px; }
.merc-stat-val     { font-size: 1.1rem; font-weight: 700; }
.merc-stat-label   { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }

.merc-cnj {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.merc-cnj-title  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-secondary); margin-bottom: 2px; }
.merc-cnj-row    { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.merc-cnj-label  { font-size: 12px; color: var(--text-secondary); }
.merc-cnj-val    { font-size: 12.5px; font-weight: 600; color: var(--text); text-align: right; }
.merc-growth     { color: #22c55e !important; }
.merc-cnj-source { font-size: 10.5px; color: var(--text-secondary); margin-top: 2px; padding-top: 7px; border-top: 1px solid var(--border); }

/* ── Briefing block ── */
.dash-briefing {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #6366f1;
  border-radius: var(--radius);
  padding: 22px 24px;
}
.dash-briefing .dash-card-head { margin-bottom: 12px; }
.dash-briefing-sub { font-size: 12px; color: var(--text-secondary); margin: 0; }
.briefing-body {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.65;
}
.briefing-body ul { padding-left: 18px; margin: 6px 0; }
.briefing-body li { margin-bottom: 3px; }

/* ── Skeleton ── */
.dash-skeleton { display: flex; flex-direction: column; gap: 14px; }
.skel-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 8px 0;
}
.skel-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skel-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.skel-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.skel-card    { height: 110px; border-radius: var(--radius); }
.skel-block   { height: 260px; border-radius: var(--radius); }
.skel-full    { height: 160px; border-radius: var(--radius); }
.skel-pulse {
  background: var(--surface);
  border: 1px solid var(--border);
  animation: skel-anim 1.5s ease-in-out infinite;
}
@keyframes skel-anim {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 720px) {
  /* ── Prevent horizontal page overflow ── */
  html { overflow-x: clip; }
  body { overflow-x: clip; max-width: 100vw; }

  /* ── Wizard ── */
  .wiz-header { padding: 12px 16px; gap: 12px; overflow: hidden; }
  .wiz-main   { padding: 28px 16px 48px; }
  .wiz-progress { display: none; }

  .area-grid  { grid-template-columns: 1fr 1fr; }
  .opts-list  { max-width: 100%; }
  .other-wrap { flex-direction: column; }

  .an-grid    { grid-template-columns: 1fr; }
  .an-card--wide, .an-card--briefing { grid-column: 1; }
  .fmt-grid   { grid-template-columns: 1fr 1fr; }

  .res-actions, .scr-actions { flex-direction: column; }
  .btn-primary, .btn-secondary, .btn-ghost { width: 100%; justify-content: center; }

  /* ── Análise dashboard ── */
  .analise-wrap   { padding: 24px 16px 60px; overflow-x: hidden; }
  .dash-metrics   { grid-template-columns: 1fr 1fr; }
  .dash-main-grid { grid-template-columns: 1fr; }
  .skel-metrics   { grid-template-columns: 1fr 1fr; }
  .skel-grid      { grid-template-columns: 1fr; }
  .af-row         { flex-direction: column; }
  .af-select, .af-btn { width: 100%; flex: none; }
  .kw-term        { max-width: none; word-break: break-word; }
  .dash-header    { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* ── App header — nav scrollable sem overflow lateral na página ── */
  .app-header {
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 8px;
    overflow: hidden;
  }
  /* A marca fica à esquerda, controles à direita — ambos na mesma linha */
  .app-header > .brand { flex-shrink: 0; }

  /* Nav desce para segunda linha e rola horizontalmente */
  .app-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: var(--radius);  /* menos agressivo que 999px para clipar borda */
    padding: 4px 4px;
  }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav-link {
    font-size: 12px;
    padding: 6px 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── Research page ── */
  .research-page  { overflow-x: hidden; }
  .research-wrap  { padding: 16px 16px 60px; overflow-x: hidden; }
  .search-hero    { padding: 28px 0 20px; }
  .search-box {
    width: 100%;
    margin: 0 0 16px;
    box-sizing: border-box;
  }
  #search-btn { padding: 10px 14px; font-size: 13px; }

  /* Toolbar: filtros e ordem rodam horizontalmente sem quebrar página */
  .results-toolbar { overflow: hidden; }
  .toolbar-row     { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .toolbar-row::-webkit-scrollbar { display: none; }
  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .sort-tabs   { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sort-tabs::-webkit-scrollbar { display: none; }
  .platform-links { display: none; }  /* esconde links de plataforma; pouco espaço */
  .ftab { flex-shrink: 0; font-size: 12px; padding: 6px 12px; }
  .stab { flex-shrink: 0; }

  /* ── Notícias page ── */
  .noticias-page  { overflow-x: hidden; }
  .noticias-wrap  { padding: 24px 16px 60px; overflow-x: hidden; }
  .noticias-hero  { flex-direction: column; align-items: flex-start; gap: 12px; }
  .noticias-hero-right { width: 100%; justify-content: space-between; }

  /* ── Roteiros board ── */
  .roteiros-page  { overflow-x: hidden; }
  .roteiros-wrap  { padding: 24px 16px 60px; overflow-x: hidden; }
  .board { flex-direction: column; gap: 12px; }
  .board-col { min-width: 0; max-width: 100%; width: 100%; }

  /* ── Modals ── */
  .script-modal-panel { border-radius: 16px 16px 0 0; max-height: 88dvh; }
  .user-dropdown { right: 0; left: auto; min-width: 180px; }

  /* ── Landing ── */
  .landing-header { padding: 16px 20px; }
  .landing-footer { padding: 16px 20px; }
  .hero-bullets   { grid-template-columns: 1fr; margin-top: 40px; }

  /* ── Legal + planos ── */
  .legal-header { padding: 12px 16px; }
  .legal-wrap   { padding: 28px 16px 48px; }
  .legal-table  { display: block; overflow-x: auto; }
  .planos-wrap  { padding: 32px 16px 56px; overflow-x: hidden; }
  .plano-card   { padding: 32px 20px; }
  .plano-valor  { font-size: 44px; }

  /* ── App footer ── */
  .app-footer { padding: 14px 16px; gap: 4px; font-size: 12px; }
}

/* Telas muito pequenas (< 400px) */
@media (max-width: 400px) {
  .area-grid  { grid-template-columns: 1fr 1fr; }
  .fmt-grid   { grid-template-columns: 1fr; }
  .app-nav-link { font-size: 11.5px; padding: 6px 9px; }
  #search-btn { padding: 10px 10px; font-size: 12px; }
  .search-icon { display: none; }
}

/* ============================================================
   APP FOOTER — visible on all authenticated pages
   ============================================================ */

.app-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--surface);
  flex-shrink: 0;
}
.app-footer a {
  color: var(--text-secondary);
  transition: color 0.15s;
}
.app-footer a:hover { color: var(--text); }
.app-footer-sep { opacity: 0.4; }

/* ============================================================
   LEGAL PAGES — /termos  /privacidade
   ============================================================ */

.legal-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  flex-shrink: 0;
}

.legal-header-cta {
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.2s;
}
.legal-header-cta:hover { background: var(--accent-hover); }

.legal-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 48px 24px 64px;
}

.legal-card {
  width: 100%;
  max-width: 780px;
}

.legal-hero {
  margin-bottom: 40px;
}
.legal-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.legal-hero p {
  color: var(--text-secondary);
  font-size: 14px;
}

.legal-body h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal-body h2:first-child { margin-top: 0; }

.legal-body p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.legal-body strong { color: var(--text); }

.legal-body ul {
  padding-left: 20px;
  margin-bottom: 12px;
}
.legal-body li {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.legal-body a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-body a:hover { opacity: 0.8; }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 13.5px;
}
.legal-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}
.legal-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.legal-table tr:nth-child(even) td { background: var(--surface); }

.legal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--surface);
}
.legal-footer a {
  color: var(--text-secondary);
  transition: color 0.15s;
}
.legal-footer a:hover { color: var(--text); }
.legal-footer-sep { opacity: 0.4; }

/* ============================================================
   PLANOS PAGE — /planos
   ============================================================ */

.planos-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.planos-wrap {
  flex: 1;
  padding: 60px 24px 80px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.planos-hero {
  text-align: center;
  margin-bottom: 52px;
}
.planos-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.planos-hero p {
  font-size: 18px;
  color: var(--text-secondary);
}

.planos-grid {
  display: flex;
  justify-content: center;
  margin-bottom: 72px;
}

.plano-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 480px;
  position: relative;
}
.plano-card--featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-card);
}

.plano-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.plano-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.plano-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 16px;
}
.plano-currency { font-size: 20px; font-weight: 600; color: var(--text-secondary); }
.plano-valor   { font-size: 54px; font-weight: 700; line-height: 1; font-family: var(--font-display); }
.plano-period  { font-size: 15px; color: var(--text-secondary); }

.plano-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.plano-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plano-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}
.plano-features svg { color: var(--accent); flex-shrink: 0; }

.plano-cta {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  border-radius: var(--radius);
  font-size: 15.5px;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}
.plano-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }

.plano-guarantee {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* FAQ */
.planos-faq {
  max-width: 680px;
  margin: 0 auto;
}
.planos-faq h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
  text-align: center;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-q {
  width: 100%;
  text-align: left;
  padding: 18px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  transition: color 0.15s;
}
.faq-q:hover { color: var(--accent-text); }
.faq-q::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-q[aria-expanded="true"]::after {
  content: '−';
}

.faq-a {
  display: none;
  padding: 0 0 18px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.faq-q[aria-expanded="true"] + .faq-a { display: block; }

/* ============================================================
   RESPONSIVE — legal + planos + additional fixes
   ============================================================ */

@media (max-width: 720px) {
  .legal-header { padding: 12px 16px; }
  .legal-wrap   { padding: 32px 16px 48px; }
  .legal-table  { display: block; overflow-x: auto; }

  .planos-wrap  { padding: 40px 16px 60px; }
  .plano-card   { padding: 32px 24px; }
  .plano-valor  { font-size: 44px; }

  .app-footer   { padding: 14px 16px; gap: 4px; font-size: 12px; }
}
