/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f2ff;
  --surface: #ffffff;
  --surface-2: #f8f9ff;
  --border: #e0e7ff;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --accent: #8b5cf6;
  --text: #1e1b4b;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --active-word-bg: #fbbf24;
  --active-word-color: #1e1b4b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(99,102,241,.08), 0 4px 16px rgba(99,102,241,.06);
  --shadow-md: 0 4px 24px rgba(99,102,241,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.logo-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.header-powered {
  font-size: 11px;
  color: var(--text-3);
  padding-left: 38px;
}
.header-powered strong {
  color: var(--primary);
  font-weight: 600;
}
.header-tagline {
  font-size: 13px;
  color: var(--text-3);
  flex: 1;
  min-width: 0;
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ── URL Card ────────────────────────────────────────────────────────────── */
.url-card {
  padding: 24px 20px;
}
@media (max-width: 640px) {
  .url-card { padding: 18px 14px; }
  .section-title { font-size: 18px; }
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.url-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .url-row { flex-direction: column; }
  .url-input, .model-select, .url-row .btn { width: 100%; }
}
.url-input {
  flex: 1;
  min-width: 240px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.url-input::placeholder { color: var(--text-3); }
.model-select {
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-2);
  cursor: pointer;
  outline: none;
}
.model-select:focus { border-color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(99,102,241,.35); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.btn-sm { padding: 7px 13px; font-size: 13px; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Error message ───────────────────────────────────────────────────────── */
.error-msg {
  margin-top: 14px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 13px;
}

.url-limit-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.url-limit-note strong { color: var(--text-2); }

/* ── Progress ────────────────────────────────────────────────────────────── */
.progress-section { display: flex; justify-content: center; }
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 280px;
  width: 100%;
  max-width: 480px;
}
@media (max-width: 600px) {
  .progress-card { padding: 32px 24px; }
  .progress-text { font-size: 15px; font-weight: 500; }
}
.progress-text { font-size: 14px; color: var(--text-2); font-weight: 500; margin-top: 4px; }

/* Anillo circular de progreso */
.progress-ring-wrap {
  position: relative;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.progress-ring-svg {
  position: absolute; top: 0; left: 0;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}
.ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  transition: stroke-dashoffset .5s ease;
}
.ring-pct {
  position: relative;
  font-size: 14px; font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
/* Estado indeterminado: gira el SVG */
.progress-ring-wrap.indeterminate .progress-ring-svg {
  animation: ring-spin 1.1s linear infinite;
  transform-origin: center;
}
.progress-ring-wrap.indeterminate .ring-fill {
  stroke-dashoffset: 100;
  transition: none;
}
@keyframes ring-spin {
  from { transform: rotate(-90deg); }
  to   { transform: rotate(270deg); }
}

/* ── Dual panel (transcripción + traducción) ─────────────────────────────── */
.dual-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .dual-panel { grid-template-columns: 1fr; } }

/* ── AI colapsable ───────────────────────────────────────────────────────── */
.ai-collapsible { display: flex; flex-direction: column; gap: 0; }

.ai-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  width: 100%;
  transition: background .15s, border-color .15s;
}
.ai-toggle-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.ai-toggle-btn .chevron { margin-left: auto; transition: transform .25s; }
.ai-toggle-btn.open .chevron { transform: rotate(180deg); }

.ai-collapsible-body {
  padding-top: 12px;
}
.ai-collapsible-body .ai-panel {
  border-radius: var(--radius);
  overflow: hidden;
}

/* Ajustar el panel-header de IA para que las tabs y el botón quepan */
.ai-panel .panel-header {
  flex-wrap: wrap;
  gap: 10px;
}
.ai-tabs-wrap { flex: 1; min-width: 0; }
.ai-tabs { flex-wrap: wrap; }

/* Panel de traducción */
.translation-display {
  background: var(--surface-2);
  color: var(--text-2);
}
.translation-display:empty::before { color: var(--text-3); font-style: italic; }
.translation-segment {
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.translation-segment:hover { background: var(--primary-light); color: var(--primary-dark); }
.translation-segment.active {
  background: var(--active-word-bg);
  color: var(--active-word-color);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(251,191,36,.5);
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface-2);
}
.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
}
.platform-badge.hidden { display: none; }

/* ── Language row ────────────────────────────────────────────────────────── */
.lang-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-label { font-size: 13px; color: var(--text-2); }
.lang-select {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  outline: none;
  cursor: pointer;
}
.lang-select:focus { border-color: var(--primary); }

/* ── Audio player ────────────────────────────────────────────────────────── */
.audio-wrap {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.audio-wrap-spacer {
  height: calc(36px + 28px + 1px);
  border-bottom: 1px solid transparent;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .audio-wrap-spacer { display: none; }
}
.audio-wrap audio {
  width: 100%;
  height: 36px;
  outline: none;
}

/* YouTube embed inside audio-wrap */
#youtubeWrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
#youtubeWrap iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* ── Transcript display ──────────────────────────────────────────────────── */
.transcript-display {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  max-height: 420px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  outline: none;
  word-break: normal;        /* nunca cortar palabras cortas en medio */
  overflow-wrap: break-word; /* solo romper strings SIN espacios (URLs largas, etc.) */
}
.transcript-display:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
  font-style: italic;
}
.transcript-display[contenteditable="false"] {
  cursor: default;
  user-select: text;
}
.transcript-display.editing {
  box-shadow: inset 0 0 0 2px rgba(99,102,241,.25);
  cursor: text;
}
.transcript-display[contenteditable="false"]:focus {
  box-shadow: none;
  outline: none;
}
/* Botón editar activo */
.btn.active {
  background: rgba(99,102,241,.15);
  color: var(--primary);
}

/* Mobile: YouTube player más compacto → transcript visible bajo el video */
@media (max-width: 768px) {
  #youtubeWrap {
    aspect-ratio: unset;
    height: 200px;
  }
  .transcript-display {
    max-height: 300px;
  }
}

/* Words */
.segment { margin-bottom: 1px; display: block; }
.word {
  display: inline;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
  transition: background .12s, color .12s;
  position: relative;
}
.word:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.word:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.word.active {
  background: var(--active-word-bg);
  color: var(--active-word-color);
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 2px;
  box-shadow: 0 0 0 1px rgba(251,191,36,.5);
}

/* ── Action bar ──────────────────────────────────────────────────────────── */
.action-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface-2);
}
@media (max-width: 600px) {
  .action-bar { gap: 6px; padding: 10px 12px; }
  .action-bar .btn { font-size: 12px; padding: 6px 10px; }
}

/* ── AI panel tabs ───────────────────────────────────────────────────────── */
.ai-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tab-btn {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--surface);
}

/* ── AI body ─────────────────────────────────────────────────────────────── */
.ai-body {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
}
.tab-pane {
  display: none;
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}
.tab-pane.active { display: block; }

.ai-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 14px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

/* Hashtags */
.hashtag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.hashtag-chip {
  padding: 5px 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.hashtag-chip:hover { background: #c7d2fe; }

/* AI footer */
.ai-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  animation: fadeInUp .25s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header nav ──────────────────────────────────────────────────────────── */
.header-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Etiquetas de botones: por defecto muestra la larga, oculta la corta */
.btn-label-short { display: none; }
.btn-label-long  { display: inline; }

/* Móvil: tagline oculto, nav debajo del logo a todo el ancho */
@media (max-width: 600px) {
  .btn-label-short { display: inline; }
  .btn-label-long  { display: none; }
  .header-tagline { display: none; }
  .header-nav {
    order: 10;       /* siempre al final */
    margin-left: 0;
    width: 100%;
  }
  .header-nav .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 8px 4px;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── Workspace ───────────────────────────────────────────────────────────── */
.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.workspace-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* ── Job list ────────────────────────────────────────────────────────────── */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.jobs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 64px 24px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}
.job-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.job-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

.job-card-top {
  display: contents; /* en desktop los hijos van directo al flex del card */
}
.job-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
}
.job-info { flex: 1; min-width: 0; }
.job-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.job-meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.job-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: #dcfce7;
  color: #166534;
  flex-shrink: 0;
}
.job-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.job-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

/* Móvil: tarjeta en columna */
@media (max-width: 600px) {
  .job-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .job-card-top { display: flex; align-items: center; gap: 12px; }
  .job-actions { flex-wrap: wrap; }
  .job-actions .btn { flex: 1; justify-content: center; min-width: 70px; }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.footer strong {
  color: var(--primary);
  font-weight: 600;
}

/* ── User menu ───────────────────────────────────────────────────────────── */
.user-menu-wrap { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 10px 4px 4px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text);
  transition: background .15s;
}
.user-menu-btn:hover { background: var(--primary-light); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-info-mini { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.user-info-mini span:first-child { font-size: 12px; font-weight: 600; }
.plan-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: .4px;
}
.plan-free    { background: #e0e7ff; color: #4338ca; }
.plan-monthly { background: #d1fae5; color: #065f46; }
.plan-annual  { background: #fef3c7; color: #92400e; }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 200px; z-index: 200; overflow: hidden;
}
.dropdown-usage {
  padding: 12px 14px;
  font-size: 12px; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.dropdown-usage .usage-mini-track {
  margin-top: 6px; height: 4px; background: var(--border);
  border-radius: 99px; overflow: hidden;
}
.dropdown-usage .usage-mini-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px; transition: width .4s;
}
.dropdown-divider { height: 1px; background: var(--border); }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  font-size: 13px; font-weight: 500; color: var(--text);
  background: none; border: none; cursor: pointer; text-align: left;
  transition: background .12s;
}
.dropdown-item:hover { background: var(--surface-2); }
.upgrade-item { color: var(--primary); }
.danger-item  { color: #ef4444; }

/* ── Auth Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  position: relative; width: 100%; max-width: 420px;
  padding: 32px 28px;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); border-radius: 8px; padding: 4px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 20px;
}
.auth-tabs {
  display: flex; border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 8px; font-size: 14px; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.form-input {
  width: 100%; padding: 10px 14px; font-size: 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  outline: none; font-family: inherit; transition: border-color .15s;
  background: var(--surface-2); color: var(--text);
}
.form-input:focus { border-color: var(--primary); background: var(--surface); }
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-3);
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; opacity: 1;
  font-family: inherit; color: var(--text); width: 100%;
  transition: background 150ms, box-shadow 150ms;
}
.btn-google:hover {
  background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.auth-error {
  padding: 10px 12px; background: #fef2f2; border: 1px solid #fca5a5;
  border-radius: var(--radius-sm); color: #b91c1c; font-size: 13px;
}
.w-full { width: 100%; }
.btn-outline {
  background: transparent; border: 1.5px solid var(--primary);
  color: var(--primary); border-radius: var(--radius-sm); padding: 9px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ── Plans Modal ─────────────────────────────────────────────────────────── */
.plans-modal { max-width: 760px; padding: 36px 32px; }
.plans-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.plans-sub { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }
.plans-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.plan-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 24px 18px; position: relative;
  display: flex; flex-direction: column; gap: 12px;
}
.plan-card.plan-featured {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.plan-badge-top {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 12px; border-radius: 99px;
}
.plan-saving-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: #f59e0b; color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 12px; border-radius: 99px;
}
.plan-name { font-size: 16px; font-weight: 700; color: var(--text); }
.plan-price { font-size: 32px; font-weight: 800; color: var(--text); }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--text-2); }
.plan-monthly-eq { font-size: 12px; color: var(--text-3); margin-top: -8px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan-features li {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
}
@media (max-width: 640px) {
  .plans-grid { grid-template-columns: 1fr; }
  .plans-modal { padding: 24px 18px; }
}

/* ── Usage bar ───────────────────────────────────────────────────────────── */
.usage-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px;
}
.usage-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-2); margin-bottom: 8px;
}
.usage-track {
  height: 6px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.usage-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px; transition: width .5s ease;
}

/* navLoginBtn */
#navLoginBtn { border: 1.5px solid var(--primary); }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Canje de cupones de regalo ─────────────────────────────────────────── */
.coupon-box {
  margin-top: 22px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px dashed #c7d2fe;
  border-radius: 12px;
}
.coupon-box label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.coupon-row { display: flex; gap: 8px; }
.coupon-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}
.coupon-row input:focus { outline: none; border-color: var(--primary); }
.coupon-msg { margin-top: 8px; font-size: 13px; }
.coupon-msg.ok { color: #16a34a; }
.coupon-msg.err { color: #dc2626; }

/* ── Filtros del historial (plataforma + carpeta) ───────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  padding: 5px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: #c7d2fe; }
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.filter-chip .chip-count { opacity: .7; font-size: 12px; margin-left: 3px; }
.folder-filter { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.folder-filter select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  max-width: 190px;
}
.job-folder-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
@media (max-width: 560px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .folder-filter select { max-width: none; flex: 1; }
}

/* ── Modal de carpetas ──────────────────────────────────────────────────── */
.folder-modal { max-width: 400px; }
.folder-modal-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: -6px 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.folder-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 11px;
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
}
.folder-option:hover { border-color: var(--primary); background: var(--primary-light, #eef2ff); }
.folder-option.current {
  border-color: var(--primary);
  background: var(--primary-light, #eef2ff);
  font-weight: 600;
}
.folder-option .fo-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-option .fo-count { font-size: 12px; color: var(--text-3, #94a3b8); }
.folder-option .fo-check { color: var(--primary); font-weight: 700; }
.folder-option.remove { color: #dc2626; }
.folder-option.remove:hover { border-color: #fca5a5; background: #fef2f2; }
.folder-empty {
  font-size: 13px;
  color: var(--text-3, #94a3b8);
  text-align: center;
  padding: 14px 0;
}
.folder-new { border-top: 1px solid var(--border, #e2e8f0); padding-top: 14px; }
.folder-new label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2, #475569);
  margin-bottom: 7px;
}
.folder-new-row { display: flex; gap: 8px; }
.folder-new-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 9px;
  font-size: 14px;
}
.folder-new-row input:focus { outline: none; border-color: var(--primary); }
.folder-row { display: flex; align-items: center; gap: 6px; }
.folder-row .folder-option { flex: 1; min-width: 0; }
.folder-rename {
  flex-shrink: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 9px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  opacity: .45;
  transition: opacity .15s, border-color .15s;
}
.folder-rename:hover { opacity: 1; border-color: var(--border, #e2e8f0); }
