/**
 * Estilos principales - Analizador y auditor de currículum ATS
 * Fijate Tools
 */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-app: #070b14;
  --bg-card: #111827;
  --bg-surface: #111827;
  --bg-surface-elevated: #182235;
  --bg-surface-hover: #223049;
  --bg-input: #0b1220;

  --border-color: rgba(148, 163, 184, 0.18);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.32);

  --text-main: #f8fafc;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-light: rgba(14, 165, 233, 0.14);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.14);

  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.14);

  --danger: #f43f5e;
  --danger-light: rgba(244, 63, 94, 0.14);

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-card: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  color-scheme: light;
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-hover: #e2e8f0;
  --bg-input: #f8fafc;

  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --border-strong: #94a3b8;

  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: rgba(2, 132, 199, 0.11);

  --success: #059669;
  --success-light: rgba(5, 150, 105, 0.12);

  --warning: #d97706;
  --warning-light: rgba(217, 119, 6, 0.12);

  --danger: #e11d48;
  --danger-light: rgba(225, 29, 72, 0.11);

  --shadow-card: 0 6px 22px -4px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.hero-title,
.faq-section-title {
  font-family: var(--font-heading);
}

.mono,
code,
pre {
  font-family: var(--font-mono);
}

/* Layout principal canónico */
.tool-layout {
  width: 100%;
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
}

.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%;
}

/* Píldoras en barra rápida */
.privacy-pill,
.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  white-space: nowrap;
}

.privacy-pill {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.engine-pill {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

/* Botones táctiles (>= 40 px) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.88rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, color 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  min-height: 40px;
  padding: 0.45rem 0.88rem;
  font-size: 0.84rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

/* Controles de formulario y selects estilizados */
.form-control,
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  height: 40px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus,
.form-select:focus,
.studio-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  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='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

[data-theme="light"] select.form-select {
  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='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

select.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

[data-theme="light"] select.form-select option {
  background-color: #ffffff;
  color: #0f172a;
}

/* Tarjeta principal del estudio */
.studio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: clamp(1rem, 2.2vw, 1.5rem);
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
}

/* Zona drag & drop de PDF */
.cv-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-strong);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cv-dropzone:hover,
.cv-dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1 1 240px;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropzone-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dropzone-meta strong {
  font-size: 0.95rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-meta span {
  font-size: 0.81rem;
  color: var(--text-muted);
}

.dropzone-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.demo-notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.34);
  color: var(--text-main);
  font-size: 0.83rem;
}

/* Rejilla de entrada doble (CV + Oferta) */
.inputs-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  min-width: 0;
}

.input-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.input-panel-head label {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.input-counter {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.studio-textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  padding: 0.78rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.86rem;
  line-height: 1.55;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.input-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.analyze-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.analyze-action-btns {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Cabecera de resultados con anillo de nota global y 4 pilares */
.score-hero-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.score-ring-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.score-ring-wrap {
  position: relative;
  width: 138px;
  height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-ring-svg {
  width: 138px;
  height: 138px;
  transform: rotate(-90deg);
}

.score-ring-track {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 10;
}

.score-ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.55s ease, stroke 0.25s ease;
}

.score-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring-num {
  font-family: var(--font-mono);
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.score-ring-max {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.verdict-badge.is-excellent { background: var(--success-light); color: var(--success); }
.verdict-badge.is-good { background: var(--primary-light); color: var(--primary); }
.verdict-badge.is-warn { background: var(--warning-light); color: var(--warning); }
.verdict-badge.is-critical { background: var(--danger-light); color: var(--danger); }

.verdict-summary {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pillars-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.pillars-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.pillar-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pillar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.pillar-name {
  font-weight: 600;
  color: var(--text-main);
}

.pillar-weight {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pillar-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.pillar-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.pillar-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.45s ease, background-color 0.25s ease;
}

/* KPI Strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.kpi-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  min-width: 0;
}

.kpi-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.28rem;
}

.kpi-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Pestañas de resultados */
.mode-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.mode-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.mode-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.mode-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.tab-panel {
  display: none;
  margin-top: 1.15rem;
}

.tab-panel.is-active {
  display: block;
}

.panel-block {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.05rem;
  margin-bottom: 1rem;
}

.panel-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.panel-block-head h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-block-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Checklist priorizada */
.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.checklist-item.sev-alta { border-left-color: var(--danger); }
.checklist-item.sev-media { border-left-color: var(--warning); }
.checklist-item.sev-baja { border-left-color: var(--success); }

.checklist-item-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.sev-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
}

.sev-pill.sev-alta { background: var(--danger-light); color: var(--danger); }
.sev-pill.sev-media { background: var(--warning-light); color: var(--warning); }
.sev-pill.sev-baja { background: var(--success-light); color: var(--success); }

.checklist-cat {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.checklist-title {
  margin: 0.15rem 0 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.checklist-detail {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Secciones y señales detectadas */
.signals-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.check-list-compact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.check-list-compact li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.84rem;
}

.status-chip {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-chip.ok { background: var(--success-light); color: var(--success); }
.status-chip.warn { background: var(--warning-light); color: var(--warning); }
.status-chip.bad { background: var(--danger-light); color: var(--danger); }

/* Chips de palabras clave */
.kw-groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.kw-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.68rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.kw-chip.matched {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.28);
}

.kw-chip.partial {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.28);
}

.kw-chip.missing {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.28);
}

.kw-chip.neutral {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(14, 165, 233, 0.25);
}

.kw-chip-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Visor de texto crudo ATS */
.raw-ats-pre {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
  max-height: 440px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Estudio de tarjeta PNG */
.card-studio-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 380px);
  gap: 1.25rem;
  align-items: start;
}

.card-controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.card-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.card-theme-btn.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.card-actions-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ats-canvas-preview {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: block;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

/* Modales accesibles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 12, 20, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

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

.modal-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.modal-body {
  padding: 1.15rem 1.25rem;
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-body h4 {
  margin: 0.75rem 0 0.35rem 0;
  color: var(--text-main);
}

.modal-body ol,
.modal-body ul {
  margin: 0 0 0.75rem 1.2rem;
  padding: 0;
}

.modal-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
}

.toast-item {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.toast-item.is-warn { border-left-color: var(--warning); }
.toast-item.is-error { border-left-color: var(--danger); }
.toast-item.is-success { border-left-color: var(--success); }

/* Responsive Tablet y Mobile */
@media (max-width: 960px) {
  .score-hero-grid,
  .inputs-dual-grid,
  .signals-two-col,
  .kw-groups-grid,
  .card-studio-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-tabs-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .mode-tabs-bar {
    grid-template-columns: 1fr;
  }

  .theme-swatches {
    grid-template-columns: 1fr;
  }

  .analyze-action-btns,
  .dropzone-actions,
  .card-actions-stack {
    width: 100%;
  }

  .analyze-action-btns .btn,
  .dropzone-actions .btn,
  .card-actions-stack .btn,
  .input-panel-foot .btn {
    width: 100%;
  }
}

/* Estilos de impresión */
@media print {
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .tool-quick-bar,
  .cv-dropzone,
  .inputs-dual-grid,
  .analyze-action-bar,
  .mode-tabs-bar,
  .seo-guide-section,
  .related-tools-section,
  .tool-breadcrumbs,
  .toast-container {
    display: none !important;
  }

  body,
  .studio-card,
  .panel-block,
  .score-ring-card,
  .pillars-card,
  .kpi-card,
  .checklist-item {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    border-color: #cbd5e1 !important;
  }

  .tab-panel {
    display: block !important;
  }
}
