/**
 * Fijate Tools - Planificador visual del feed de Instagram (Grid & Feed Planner)
 * Estilos canónicos, simulación de interfaz móvil de Instagram y controles responsivos.
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema claro por defecto */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --accent-teal: #0d9488;
  --accent-teal-bg: #f0fdfa;
  --accent-gold: #d97706;
  --accent-gold-border: #fde68a;
  --accent-blue: #0095f6;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-card: #111827;
  --bg-card-subtle: #1e293b;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-focus: #60a5fa;

  --accent-teal: #14b8a6;
  --accent-teal-bg: #134e4a26;
  --accent-gold: #f59e0b;
  --accent-gold-border: #78350f;
  --accent-blue: #38bdf8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.6);
}

/* 1. Reset y contención de layout canónica */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.tool-layout {
  max-width: 1280px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Tipografías de ayuda */
.font-heading { font-family: var(--font-heading); }
.font-mono { font-family: var(--font-mono); }

/* 2. Sección de introducción y hero */
.tool-intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.12), rgba(253, 29, 29, 0.12));
  color: #e1306c;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
}

.intro-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.intro-description {
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 860px;
}

/* 3. Panel de control superior: zona de carga y filtros */
.planner-control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: var(--bg-card-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1.25rem;
}

.drop-zone:hover, .drop-zone.drop-zone-active {
  border-color: var(--accent-blue);
  background: rgba(0, 149, 246, 0.05);
}

.drop-zone-icon {
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}

.drop-zone-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.drop-zone-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.upload-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.75rem;
}

/* Barra de configuración y filtros */
.controls-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select, .form-input, .form-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 0.85rem;
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-textarea {
  height: auto;
  min-height: 85px;
  padding: 0.65rem 0.85rem;
  resize: vertical;
}

.form-select {
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
  border-color: var(--border-focus);
}

/* Barra de filtros rápidos */
.filters-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.filters-strip-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.btn-filter-tag {
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-filter-tag:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-filter-tag.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* 4. Maqueta visual de Instagram (Mockup de perfil y feed) */
.mockup-outer-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .mockup-outer-container {
    grid-template-columns: minmax(360px, 480px) 1fr;
    align-items: start;
  }
}

.instagram-phone-frame {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid #1a1a1a;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Temas del mockup de Instagram */
.instagram-phone-frame.ig-theme-light {
  background-color: #ffffff;
  color: #000000;
  border-color: #e2e8f0;
}

.instagram-phone-frame.ig-theme-dark {
  background-color: #000000;
  color: #f5f5f5;
  border-color: #262626;
}

/* Barra superior del teléfono */
.ig-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.ig-username-lock {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
}

.ig-verified-badge {
  color: #0095f6;
  display: inline-flex;
  align-items: center;
}

.ig-top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
}

/* Perfil superior: Avatar + Contadores */
.ig-profile-header {
  padding: 1rem 1rem 0.5rem;
}

.ig-avatar-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.85rem;
}

.ig-avatar-wrap {
  position: relative;
  width: 82px;
  height: 82px;
  flex-shrink: 0;
  cursor: pointer;
}

.ig-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(128, 128, 128, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(128, 128, 128, 0.1);
}

.ig-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-avatar-placeholder {
  font-size: 1.85rem;
  font-weight: 700;
  color: #888888;
}

.ig-avatar-badge-add {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0095f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  border: 2px solid #ffffff;
}

.ig-theme-dark .ig-avatar-badge-add {
  border-color: #000000;
}

.ig-stats-group {
  display: flex;
  flex: 1;
  justify-content: space-around;
  text-align: center;
}

.ig-stat-col {
  display: flex;
  flex-direction: column;
}

.ig-stat-number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.2;
}

.ig-stat-label {
  font-size: 0.76rem;
  opacity: 0.8;
}

/* Biografía y enlaces */
.ig-bio-area {
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.ig-name-text {
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.ig-bio-text {
  white-space: pre-line;
  word-break: break-word;
}

.ig-link-text {
  color: #00376b;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.25rem;
}

.ig-theme-dark .ig-link-text {
  color: #e0f1ff;
}

/* Botones de acción del perfil */
.ig-profile-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.ig-btn-action {
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #efefef;
  color: #000000;
  transition: opacity 0.2s;
}

.ig-theme-dark .ig-btn-action {
  background-color: #363636;
  color: #ffffff;
}

.ig-btn-action:hover {
  opacity: 0.9;
}

/* Historias destacadas (Highlights) */
.ig-highlights-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  margin-bottom: 0.5rem;
  scrollbar-width: none;
}

.ig-highlights-row::-webkit-scrollbar {
  display: none;
}

.ig-highlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ig-highlight-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(128, 128, 128, 0.08);
}

.ig-highlight-label {
  font-size: 0.72rem;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pestañas de cuadrícula */
.ig-tabs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(128, 128, 128, 0.15);
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.ig-tab-btn {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.ig-tab-btn.active {
  opacity: 1;
  border-bottom-color: currentColor;
}

/* Cuadrícula de fotos interactiva */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background-color: rgba(128, 128, 128, 0.15);
  user-select: none;
}

.feed-slot {
  position: relative;
  background-color: rgba(128, 128, 128, 0.06);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Modos de relación de aspecto */
.feed-grid.aspect-1-1 .feed-slot {
  aspect-ratio: 1 / 1;
}

.feed-grid.aspect-4-5 .feed-slot {
  aspect-ratio: 4 / 5;
}

/* Estados de arrastre */
.feed-slot.is-dragging {
  opacity: 0.35;
  transform: scale(0.94);
}

.feed-slot.drag-over {
  outline: 3px dashed var(--accent-blue);
  outline-offset: -3px;
  transform: scale(1.02);
  z-index: 10;
}

.slot-inner-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.slot-cell-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}

/* Badges de formato y estado */
.slot-badge {
  position: absolute;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.slot-badge-type {
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  padding: 0;
}

.slot-badge-draft {
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
}

.slot-color-dot {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  z-index: 2;
  pointer-events: none;
}

/* Botones sobre la imagen al pasar el cursor */
.slot-actions-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.feed-slot:hover .slot-actions-overlay {
  opacity: 1;
}

.btn-slot-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.btn-slot-action:hover {
  transform: scale(1.15);
}

.btn-slot-action.btn-slot-remove {
  background: #ef4444;
  color: #ffffff;
}

/* Casilla vacía */
.slot-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.feed-slot:hover .slot-empty-content {
  opacity: 1;
  color: var(--accent-blue);
}

.slot-empty-number {
  font-size: 1rem;
  font-weight: 700;
}

.slot-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-empty-hint {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Fantasma táctil flotante */
.touch-drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.85;
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
  overflow: hidden;
}

/* 5. Columna lateral de edición de perfil y analíticas */
.mockup-controls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Panel de armonía visual y paleta */
.harmony-gauge-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.harmony-score-text {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.harmony-bar-wrap {
  width: 100%;
  height: 8px;
  background-color: var(--bg-card-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.harmony-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #d97706, #0d9488);
  transition: width 0.35s ease;
}

.harmony-palette-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.harmony-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.harmony-swatch:hover {
  transform: scale(1.2);
}

.harmony-tips-list {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 1.25rem;
}

.harmony-tips-list li {
  margin-bottom: 0.4rem;
}

/* Botones de acción principales */
.actions-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-action-primary, .btn-action-secondary {
  height: 44px;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  border: none;
}

.btn-action-primary {
  background: linear-gradient(135deg, #0095f6, #0077c5);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 149, 246, 0.35);
}

.btn-action-primary:hover {
  background: linear-gradient(135deg, #0084dc, #0066aa);
  transform: translateY(-1px);
}

.btn-action-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}

.btn-action-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* 6. Sección de planificación cronológica */
.schedule-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.schedule-plan-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.schedule-item-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.schedule-item-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.schedule-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.schedule-item-num {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,0.7);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-top-right-radius: 4px;
}

.schedule-item-info {
  flex: 1;
  min-width: 0;
}

.schedule-item-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.schedule-type-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 149, 246, 0.1);
  color: var(--accent-blue);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.schedule-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.schedule-status-badge.published {
  background: #dcfce7;
  color: #166534;
}

.schedule-status-badge.draft {
  background: #fef3c7;
  color: #92400e;
}

.schedule-item-caption {
  font-size: 0.86rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* 7. Guía técnica y de composición para Instagram */
.seo-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.seo-guide-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.seo-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.seo-guide-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.seo-guide-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.seo-guide-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 8. Modales accesibles */
.modal-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-container.is-active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content-card {
  position: relative;
  z-index: 10;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
}

.modal-preview-box {
  width: 160px;
  height: 160px;
  margin: 0 auto 0.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border-color);
}

.modal-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sliders de zoom y recorte */
.range-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.range-slider-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
}

/* 9. Adaptabilidad móvil completa */
@media (max-width: 640px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin-top: 1rem;
  }

  .intro-title {
    font-size: 1.45rem;
  }

  .controls-toolbar {
    grid-template-columns: 1fr;
  }

  .actions-cluster {
    flex-direction: column;
  }

  .btn-action-primary, .btn-action-secondary {
    width: 100%;
  }

  .instagram-phone-frame {
    border-radius: 16px;
    border-width: 3px;
  }

  .ig-avatar-wrap {
    width: 70px;
    height: 70px;
  }

  .ig-stat-number {
    font-size: 0.95rem;
  }

  .ig-stat-label {
    font-size: 0.68rem;
  }
}
