/**
 * Estilos canónicos: Calculadora de masa para pizza y fermentación
 * Fijate Tools (fijate.com)
 */

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

  /* Tema oscuro por defecto */
  --bg-page: #090e1a;
  --bg-surface: #0f172a;
  --bg-card: #141f36;
  --bg-card-hover: #1c2b4a;
  --bg-card-subtle: #111a2e;
  --bg-input: #0b1222;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: #f59e0b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-pizza: #f59e0b;      /* Tono ámbar/dorado de masa horneada */
  --accent-pizza-hover: #d97706;
  --accent-crust: #ea580c;      /* Tono corteza tostada */
  --accent-tomato: #ef4444;     /* Rojo pomodoro */
  --accent-basil: #10b981;      /* Verde albahaca / fermentación */
  --accent-water: #38bdf8;      /* Azul hidratación */

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-subtle: #f8fafc;
  --bg-input: #ffffff;
  --border-color: rgba(0, 0, 0, 0.09);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-focus: #d97706;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-pizza: #d97706;
  --accent-pizza-hover: #b45309;
  --accent-crust: #c2410c;
  --accent-tomato: #dc2626;
  --accent-basil: #059669;
  --accent-water: #0284c7;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 15px rgba(217, 119, 6, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Enlaces base */
a {
  color: var(--accent-pizza);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--accent-pizza-hover);
  text-decoration: underline;
}

/* Layout institucional */
.main-wrapper {
  flex: 1 0 auto;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

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

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

/* Barra lateral publicitaria */
.tool-ad-sidebar {
  flex: 0 0 300px;
  width: 300px;
}

.ad-sticky-box {
  position: sticky;
  top: 80px;
}

/* Encabezado canónico e icono */
.brand-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-pizza);
}

/* Tarjeta principal */
.card-main {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

/* Títulos de sección */
.section-header {
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Bloque de Presets rápidos */
.presets-section {
  margin-bottom: 2rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  min-height: 80px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-preset-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-pizza);
  transform: translateY(-2px);
}

.btn-preset-card.active {
  background-color: var(--bg-card);
  border-color: var(--accent-pizza);
  box-shadow: var(--shadow-glow);
}

.btn-preset-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--accent-pizza);
}

.preset-icon {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

.preset-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.preset-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* Cuadrícula de configuración (Formulario + Resultados) */
.tool-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

/* Grupos y campos de formulario */
.form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form-value-pill {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-pizza);
  background-color: rgba(245, 158, 11, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Stepper de cantidad */
.stepper-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-input);
  overflow: hidden;
}

.btn-stepper {
  width: 46px;
  min-height: 42px;
  background-color: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  user-select: none;
}

.btn-stepper:hover {
  background-color: var(--bg-card-hover);
  color: var(--accent-pizza);
}

.input-stepper {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  border: none;
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem;
}
.input-stepper:focus {
  outline: none;
}

/* Sliders deslizantes */
.range-slider {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  margin-top: 0.4rem;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-pizza);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-pizza);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
}

/* Desplegables <select> canónicos */
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 40px 0.6rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  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='%23f59e0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s ease;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form-select option,
.form-select optgroup {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

/* Switch / Checkbox elegante */
.toggle-switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.toggle-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: var(--border-color);
  border-radius: 24px;
  transition: background-color 0.25s ease;
}

.toggle-switch-slider::before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.toggle-switch-input:checked + .toggle-switch-slider {
  background-color: var(--accent-basil);
}

.toggle-switch-input:checked + .toggle-switch-slider::before {
  transform: translateX(20px);
}

/* Subcaja de frío */
.cold-box {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background-color: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
}

/* Panel de Resultados */
.results-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.results-hero-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(234, 88, 12, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.results-hero-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
}

.results-hero-val {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-pizza);
  line-height: 1.1;
  margin-top: 0.2rem;
}

.results-hero-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Tabla de ingredientes */
.ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.ingredient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.ing-col-left {
  display: flex;
  flex-direction: column;
}

.ing-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

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

.ing-col-right {
  text-align: right;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.ing-grams {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ing-pct {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Aviso de masa madre */
.notice-box {
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  font-size: 0.85rem;
  color: var(--accent-basil);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

/* Diagnóstico de Harina W */
.flour-diagnostic-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.flour-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.flour-diag-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.flour-diag-message {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Badges de estado */
.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-primary {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--accent-pizza);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-secondary {
  background-color: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Temperatura del agua (Módulo de amasado) */
.water-temp-card {
  background-color: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.5rem;
}

.water-temp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.water-temp-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.water-temp-pill {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-water);
}

.water-temp-advice {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Botonera de acciones principales */
.actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: auto;
}

.btn-action {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  padding: 0.5rem 0.8rem;
  text-align: center;
}

.btn-action-primary {
  background: linear-gradient(135deg, var(--accent-pizza), var(--accent-pizza-hover));
  color: #090e1a;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.btn-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.btn-action-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-action-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-pizza);
}

/* Bloque Visual Canvas (Curva Cinética) */
.canvas-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.canvas-wrapper {
  width: 100%;
  height: 260px;
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 1rem;
}

.canvas-element {
  width: 100%;
  height: 100%;
  display: block;
}

/* Cronograma Invertido (Línea Temporal) */
.schedule-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.schedule-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background-color: var(--bg-surface);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.schedule-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.schedule-input {
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  background-color: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}
.schedule-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-left: 0.5rem;
  padding-left: 1.75rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-pizza), var(--accent-basil));
  opacity: 0.4;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}
.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -1.75rem;
  top: 4px;
}

.timeline-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 2px solid var(--accent-pizza);
}

.timeline-item:last-child .timeline-dot {
  border-color: var(--accent-basil);
  background-color: var(--accent-basil);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.timeline-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.timeline-time {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-pizza);
}

.timeline-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Gestor de Recetas Guardadas */
.saved-recipes-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.saved-recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.saved-recipe-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.saved-recipe-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.saved-recipe-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.saved-recipe-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-secondary-sm {
  min-height: 32px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}
.btn-secondary-sm:hover {
  border-color: var(--accent-pizza);
  color: var(--accent-pizza);
}

.btn-icon-sm {
  min-height: 32px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-icon-sm:hover {
  color: var(--accent-tomato);
  border-color: var(--accent-tomato);
}

.empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Modales nativos de confirmación y guardado */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  padding: 1rem;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-width: 460px;
  width: 100%;
  padding: 1.75rem;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-box {
  transform: scale(1);
}

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

.modal-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.modal-input {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.85rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}
.modal-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-secondary-link {
  min-height: 40px;
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary-link:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-primary-action {
  min-height: 40px;
  padding: 0.5rem 1.25rem;
  background: var(--accent-pizza);
  border: none;
  border-radius: var(--radius-md);
  color: #090e1a;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger {
  min-height: 40px;
  padding: 0.5rem 1.25rem;
  background-color: var(--accent-tomato);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

/* Notificación flotante Toast */
.toast-box {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--accent-pizza);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-box.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsividad móvil */
@media (max-width: 1024px) {
  .tool-with-sidebar {
    flex-direction: column;
  }
  .tool-ad-sidebar {
    display: none;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2rem;
  }
  .card-main {
    padding: 1.15rem;
  }
  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .actions-row {
    grid-template-columns: 1fr;
  }
  .schedule-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .schedule-input-group {
    justify-content: space-between;
  }
  .toast-box {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
  }
}

/* Estilos de impresión */
@media print {
  .app-header,
  .fijate-footer,
  .tool-ad-sidebar,
  .tools-ad-banner-section,
  .presets-section,
  .actions-row,
  .btn-icon,
  .modal-backdrop,
  .toast-box {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .card-main,
  .form-card,
  .results-card,
  .schedule-card {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
