  :root {
    --primary-color: #004081;
    --primary-hover: #002d5c;
    --bg-light: #f8fafc;
    --border-color: #cbd5e1;
    --text-dark: #0f172a;
    --text-muted: #64748b;
  }
  
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { background-color: #f1f5f9; }
  
  .wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  
  /* Encabezado */
  .header { text-align: center; margin-bottom: 2.5rem; }
  .header .tag { font-size: 12px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--primary-color); }
  .header h1 { font-size: 32px; font-weight: 800; color: var(--text-dark); margin-top: 6px; }
  .header p { font-size: 15px; color: var(--text-muted); margin-top: 6px; }
  
/* Grid de Contenido */
.grid { 
  display: grid; 
  grid-template-columns: 1.2fr 1fr; 
  gap: 2rem; 
}

/* Esta es la parte que asegura que en móviles se apilen verticalmente */
@media (max-width: 768px) { 
  .grid { 
    grid-template-columns: 1fr; /* Una sola columna */
    display: flex;
    flex-direction: column; /* Apilado vertical: Formulario arriba, Vista previa abajo */
  }
  
  .panel {
    order: 1; /* Formulario primero */
  }
  
  /* El div de la vista previa */
  .grid > div:last-child {
    order: 2; /* Vista previa segundo */
  }
}
  
  /* Panel de Configuración */
  .panel { background: #ffffff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); height: fit-content; }
  .panel-title { font-size: 14px; font-weight: 700; color: var(--text-dark); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 8px; }
  
  label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
  input[type=text], input[type=date] { width: 100%; font-size: 14px; padding: 10px 12px; background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-dark); outline: none; transition: all 0.2s; }
  input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 64, 129, 0.1); }
  
  .field { margin-bottom: 16px; }
  
  /* Filas de Actividades */
  .item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
  .item-row input { flex: 1; min-width: 0; font-size: 13px; padding: 8px 10px; }
  .remove-btn { background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 4px; transition: all 0.2s; }
  .remove-btn:hover { color: #ef4444; background: #fee2e2; }
  
  .add-btn { width: 100%; padding: 10px; border: 2px dashed var(--border-color); border-radius: 8px; background: none; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 8px; transition: all 0.2s; }
  .add-btn:hover { border-color: var(--primary-color); color: var(--primary-color); background: #f0f7ff; }
  
  .gen-btn { width: 100%; margin-top: 16px; padding: 12px; background: var(--primary-color); color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
  .gen-btn:hover { background: var(--primary-hover); }
  
  /* Área de Vista Previa */
  .preview-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); text-align: center; margin-bottom: 1rem; }
  .preview-placeholder { background: #e2e8f0; border: 2px dashed var(--border-color); border-radius: 12px; min-height: 350px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #64748b; font-style: italic; }
  
  /* Botones de Descarga */
  .actions { display: flex; gap: 10px; margin-top: 16px; justify-content: center; }
  .dl-btn { padding: 10px 20px; border-radius: 50px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; display: flex; align-items: center; gap: 6px; transition: transform 0.1s, background 0.2s; }
  .dl-btn:active { transform: scale(0.96); }
  .dl-btn.green { background: #10b981; color: white; }
  .dl-btn.green:hover { background: #059669; }
  .dl-btn.slate { background: #475569; color: white; }
  .dl-btn.slate:hover { background: #334155; }
  
  /* DISEÑO DE LA TARJETA FINAL */
  .card-inner { background: white; border-top: 8px solid var(--primary-color); padding: 2.5rem 2rem; font-family: "Georgia", serif; color: #1e293b; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border-radius: 4px; }
  .card-logo-wrap { text-align: center; margin-bottom: 12px; }
  .card-logo-wrap img { max-height: 60px; max-width: 160px; object-fit: contain; }
  .card-title { font-size: 26px; font-weight: 700; text-align: center; color: var(--primary-color); line-height: 1.25; margin-top: 4px; }
  .card-divider { width: 50px; height: 3px; background: var(--primary-color); margin: 12px auto; border-radius: 2px; }
  .card-date { font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); text-align: center; font-family: sans-serif; }
  
  .card-items { margin-top: 1.5rem; border-top: 1px solid #e2e8f0; padding-top: 1rem; }
  .card-item { padding: 10px 0; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: baseline; }
  .card-item .activity { font-size: 14px; font-weight: 700; color: #0f172a; font-family: "Georgia", serif; }
  .card-item .responsible { font-size: 13px; color: #475569; font-family: sans-serif; font-weight: 500; font-style: italic; }
  
  .card-footer { margin-top: 1.5rem; border-top: 1px solid #e2e8f0; padding-top: 1rem; text-align: center; }
  .card-footer p { font-size: 11px; color: #64748b; font-style: italic; font-family: sans-serif; line-height: 1.6; }