
* { box-sizing: border-box; }
:root {
  --bg-page: #f8f8f8;
  --bg-card: #fff;
  --bg-input: #fff;
  --border-soft: #e5e7eb;
  --text-main: #222;
  --text-soft: #555;
  --text-muted: #94a3b8;
  --accent: #2563eb;
}
body.dark {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --border-soft: #334155;
  --text-main: #e2e8f0;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
}
body.dark .card { background: var(--bg-card) !important; border-color: var(--border-soft) !important; color: var(--text-main); }
body.dark input, body.dark textarea, body.dark select { background: var(--bg-input) !important; color: var(--text-main) !important; border-color: var(--border-soft) !important; }
body.dark h1, body.dark h2, body.dark h3 { color: var(--text-main) !important; }
body.dark .art-card { background: var(--bg-card) !important; }
body.dark .art-card-title { color: var(--text-main) !important; }
body.dark table { color: var(--text-main); }
body.dark .empty-msg { color: var(--text-muted) !important; }
* { box-sizing: border-box; }
body { font-family: Arial, sans-serif; margin: 0; padding: 20px 24px; color: var(--text-main); background: var(--bg-page);
       padding-left: max(24px, env(safe-area-inset-left));
       padding-right: max(24px, env(safe-area-inset-right));
       transition: background 0.2s, color 0.2s; }
h2 { color: #444; font-size: 15px; border-bottom: 1px solid #ddd; padding-bottom: 6px; margin-top: 0; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px 20px; margin: 16px 0; }
label { display: block; font-size: 13px; font-weight: bold; margin: 10px 0 3px; color: #555; }
input[type=text], input[type=email], input[type=password], input[type=number] {
  padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; max-width: 100%;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 7px 9px; border: 1px solid #e5e7eb; font-size: 13px; }
th { background: #f3f4f6; font-size: 12px; text-align: left; }
.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 5px;
       cursor: pointer; font-size: 14px; font-weight: bold; color: #fff; }
.btn-save { background: #2563eb; }
.btn-run  { background: #059669; margin-left: 10px; }
.btn-add  { background: #2563eb; font-size: 12px; padding: 5px 11px; border: none;
            border-radius: 4px; color: #fff; cursor: pointer; margin-top: 8px; }
.wp-tabs  { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; padding-bottom: 0; }
.wp-tab   { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
            padding: 7px 16px; font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; border-radius: 6px 6px 0 0; transition: color .15s; }
.wp-tab:hover { color: #2563eb; background: #f8fafc; }
.wp-tab.active { color: #2563eb; border-bottom-color: #2563eb; background: #eff6ff; }
.pag-bar  { display: flex; align-items: center; gap: 8px; padding: 10px 4px 4px; border-top: 1px solid #f1f5f9; margin-top: 8px; }
.pag-info { font-size: 12px; color: #6b7280; flex: 1; }
.pag-btn  { background: none; border: 1px solid #e2e8f0; border-radius: 5px; padding: 4px 11px;
            cursor: pointer; font-size: 15px; color: #374151; line-height: 1; }
.pag-btn:disabled { opacity: .35; cursor: default; }
.pag-size { font-size: 12px; border: 1px solid #e2e8f0; border-radius: 5px; padding: 4px 6px; color: #374151; background: #fff; }
.notice { padding: 10px 14px; border-radius: 5px; margin: 10px 0; font-size: 14px; }
.notice.ok  { background: #d1fae5; color: #065f46; }
.notice.err { background: #fee2e2; color: #991b1b; }
pre { background: #1a1a2e; color: #a6e3a1; font-size: 11px; padding: 14px; border-radius: 6px;
      max-height: 280px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
.stats-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stat-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px;
            padding: 10px 16px; flex: 1 1 120px; text-align: center; }
.stat-box.green  { background: #f0fdf4; border-color: #bbf7d0; }
.stat-box.orange { background: #fff7ed; border-color: #fed7aa; }
.stat-box.gray   { background: #f9fafb; border-color: #e5e7eb; }
.stat-box.red    { background: #fef2f2; border-color: #fecaca; }
.stat-num { font-size: 24px; font-weight: bold; color: #2563eb; }
.stat-box.green  .stat-num { color: #059669; }
.stat-box.orange .stat-num { color: #d97706; }
.stat-box.gray   .stat-num { color: #9ca3af; }
.stat-box.red    .stat-num { color: #dc2626; }
.stat-label { font-size: 12px; color: #666; margin-top: 2px; }
/* ── Pipeline stats ───────────────────────────────────────────────────────── */
.pipe-section { margin-bottom: 14px; }
.pipe-toggle { background: none; border: none; font-size: 12px; color: #94a3b8;
               cursor: pointer; padding: 0 0 6px 0; display: flex; align-items: center; gap: 4px; }
.pipe-toggle:hover { color: #64748b; }
.pipe-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }
.pipe-step { border-radius: 6px; padding: 6px 10px; text-align: center; min-width: 68px; flex: 0 0 auto; }
.pipe-step .pipe-n { font-size: 18px; font-weight: 700; line-height: 1.2; }
.pipe-step .pipe-l { font-size: 10px; color: #64748b; margin-top: 1px; white-space: nowrap; }
.pipe-step.fetch  { background: #eff6ff; border: 1px solid #bfdbfe; }
.pipe-step.fetch  .pipe-n { color: #2563eb; }
.pipe-step.minus  { background: #fff1f2; border: 1px solid #fecdd3; }
.pipe-step.minus  .pipe-n { color: #e11d48; font-size: 15px; }
.pipe-step.net    { background: #f0fdf4; border: 1px solid #bbf7d0; }
.pipe-step.net    .pipe-n { color: #059669; }
.pipe-step.preflt { background: #fefce8; border: 1px solid #fde68a; }
.pipe-step.preflt .pipe-n { color: #d97706; }
.pipe-step.claude { background: #faf5ff; border: 1px solid #e9d5ff; }
.pipe-step.claude .pipe-n { color: #7c3aed; }
.pipe-step.cost   { background: #f9fafb; border: 1px solid #e5e7eb; }
.pipe-step.cost   .pipe-n { color: #374151; font-size: 15px; }
.pipe-step.res-p  { background: #eff6ff; border: 1px solid #bfdbfe; }
.pipe-step.res-p  .pipe-n { color: #2563eb; }
.pipe-step.res-c  { background: #f0fdf4; border: 1px solid #bbf7d0; }
.pipe-step.res-c  .pipe-n { color: #059669; }
.pipe-step.res-e  { background: #fff7ed; border: 1px solid #fed7aa; }
.pipe-step.res-e  .pipe-n { color: #d97706; }
.pipe-step.res-i  { background: #f9fafb; border: 1px solid #e5e7eb; }
.pipe-step.res-i  .pipe-n { color: #9ca3af; }
.pipe-arrow { color: #cbd5e1; font-size: 14px; font-weight: 700; flex-shrink: 0; padding: 0 1px; }
.pipe-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase;
              letter-spacing: .5px; margin-bottom: 3px; }
@media (max-width: 640px) {
  .pipe-step { min-width: 58px; padding: 5px 6px; }
  .pipe-step .pipe-n { font-size: 16px; }
  .pipe-step.minus .pipe-n { font-size: 13px; }
}
.tabs { display: flex; gap: 4px; margin-bottom: -1px; overflow-x: auto;
        -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
.tab-btn { padding: 8px 14px; border: 1px solid #ddd; border-bottom: none;
           background: #f3f4f6; cursor: pointer; border-radius: 6px 6px 0 0;
           font-size: 13px; font-weight: bold; color: #555; white-space: nowrap; flex-shrink: 0; }
.tab-btn.active { background: #fff; color: #2563eb; border-color: #e5e7eb; }
.tab-pane { display: none; border: 1px solid #e5e7eb; border-radius: 0 6px 6px 6px;
            background: #fff; overflow: hidden; }
.tab-pane.active { display: block; }
.badge { display: inline-block; background: #2563eb; color: #fff; border-radius: 10px;
         padding: 1px 7px; font-size: 11px; margin-left: 4px; }
.badge.green  { background: #059669; }
.badge.orange { background: #d97706; }
.badge.gray   { background: #9ca3af; }
.empty-msg { color: #888; padding: 20px; font-size: 14px; }

/* ── Tarjetas de artículos ───────────────────────────────────────────────── */
.art-cards { display: flex; flex-direction: column; }
.art-card { border-bottom: 1px solid #f1f5f9; padding: 14px 16px 14px 18px;
            transition: background .12s, opacity .3s; background: #fff;
            display: grid; grid-template-columns: 22px 1fr 112px; gap: 0 12px; align-items: start; }
.art-card:last-child { border-bottom: none; }
.art-card:hover { background: #f8fafc; }
.art-card { touch-action: pan-y; }
.swipe-hint { position: absolute; top: 0; bottom: 0; width: 80px; display: flex;
              align-items: center; justify-content: center; font-size: 22px;
              opacity: 0; pointer-events: none; transition: opacity .1s; border-radius: 4px; }
.swipe-hint-write  { left: 0;  background: linear-gradient(90deg, #059669 0%, transparent 100%); color: #fff; }
.swipe-hint-discard{ right: 0; background: linear-gradient(270deg, #dc2626 0%, transparent 100%); color: #fff; }
.art-card { position: relative; overflow: hidden; }
.art-card-check { padding-top: 3px; }
.art-card-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: #2563eb; }
.art-card-body { min-width: 0; }
.art-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.art-card-serie { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase;
                  letter-spacing: .6px; }
.art-card-tipo { font-size: 10px; color: #2563eb; background: #dbeafe; padding: 2px 7px;
                 border-radius: 8px; font-weight: 700; white-space: nowrap; letter-spacing: .3px;
                 cursor: pointer; user-select: none; }
.art-card-tipo:hover { background: #bfdbfe; }
/* ── Tipo modal ── */
.tipo-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 600;
                      display: flex; align-items: center; justify-content: center; }
.tipo-modal { background: #fff; border-radius: 14px; padding: 20px 16px 12px;
              box-shadow: 0 8px 32px rgba(0,0,0,.22); min-width: 240px; max-width: 320px; width: 90%; }
.tipo-modal h3 { font-size: 14px; font-weight: 700; color: #1e293b; margin: 0 0 14px; }
.tipo-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tipo-modal-item { padding: 9px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
                   color: #334155; cursor: pointer; text-align: center; border: 1.5px solid #e2e8f0;
                   background: #f8fafc; transition: background .1s, border-color .1s; }
.tipo-modal-item:hover { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.tipo-modal-item.current { background: #dbeafe; border-color: #2563eb; color: #2563eb; }
.tipo-modal-cancel { display: block; width: 100%; margin-top: 10px; padding: 8px;
                     text-align: center; font-size: 13px; color: #94a3b8; cursor: pointer;
                     border: none; background: none; }
.art-card-title { font-size: 15px; font-weight: 600; color: #1e293b; text-decoration: none;
                  line-height: 1.45; display: block; margin-bottom: 3px;
                  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.art-card-title:hover { color: #2563eb; }
.art-card-source { font-size: 11px; color: #cbd5e1; }
.art-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
/* ── Columna de acciones (derecha, siempre alineada) */
.art-card-actions { display: flex; flex-direction: column; gap: 5px; }
.ac-btn-write { display: block; background: #2563eb; color: #fff; border: none; border-radius: 6px;
                padding: 7px 8px; font-size: 12px; font-weight: 600; text-align: center;
                text-decoration: none; cursor: pointer; width: 100%; line-height: 1.2; }
.ac-btn-write:hover { background: #1d4ed8; color: #fff; }
.ac-sel { width: 100%; font-size: 11px; padding: 6px 4px; border: 1px solid #e2e8f0;
          border-radius: 6px; background: #fff; color: #64748b; cursor: pointer; }
.ac-btn-discard { background: #fff; color: #94a3b8; border: 1px solid #e2e8f0; border-radius: 6px;
                  padding: 6px 8px; font-size: 12px; cursor: pointer; width: 100%; text-align: center;
                  font-weight: 500; transition: background .1s, color .1s, border-color .1s; }
.ac-btn-discard:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }
@media (max-width: 640px) {
  .art-card { grid-template-columns: 22px 1fr; padding: 12px; gap: 0 8px; }
  .art-card-actions { display: none; }
}
/* ── Grupos de artículos similares */
.art-group { border-bottom: 1px solid #f1f5f9; }
.art-group:last-child { border-bottom: none; }
.art-group-head { border-bottom: none !important; background: #f8fafc !important; }
.art-group-head:hover { background: #f0f9ff !important; }
.art-group-badge { font-size: 10px; color: #2563eb; background: #dbeafe; padding: 2px 7px;
                   border-radius: 8px; font-weight: 700; white-space: nowrap; }
.art-group-toggle { background: none; border: none; color: #94a3b8; font-size: 11px; cursor: pointer;
                    padding: 3px 0 0; text-align: left; display: block; max-width: 100%;
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-group-toggle:hover { color: #2563eb; }
.art-group-body { display: none; border-top: 1px solid #f1f5f9; background: #f8fafc; }
.art-group-body.open { display: block; }
.art-src-row { display: flex; align-items: center; gap: 8px; padding: 8px 18px 8px 54px;
               border-bottom: 1px solid #f1f5f9; }
.art-src-row:last-child { border-bottom: none; }
.art-src-link { flex: 1; text-decoration: none; min-width: 0; overflow: hidden; }
.art-src-name { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase;
                letter-spacing: .4px; display: block; margin-bottom: 1px; }
.art-src-title { font-size: 13px; color: #475569; display: block;
                 overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.art-src-link:hover .art-src-title { color: #2563eb; }
.ac-btn-discard-sm { background: none; border: none; color: #cbd5e1; cursor: pointer;
                     padding: 4px 6px; border-radius: 4px; font-size: 14px; flex-shrink: 0; }
.ac-btn-discard-sm:hover { background: #fef2f2; color: #ef4444; }
/* ── Modal de motivo de descarte */
.discard-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 500px) { .discard-modal-overlay { align-items: center; } }
.discard-modal { background: #fff; border-radius: 16px 16px 0 0; padding: 20px 16px 32px;
  width: 100%; max-width: 480px; box-shadow: 0 -4px 32px rgba(0,0,0,.18); }
@media (min-width: 500px) { .discard-modal { border-radius: 16px; padding: 24px 20px; } }
.discard-modal-title { font-size: 13px; color: #94a3b8; text-align: center; margin: 0 0 4px; }
.discard-modal-sub { font-size: 15px; font-weight: 700; color: #1e293b; text-align: center;
  margin: 0 0 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.discard-modal-reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.discard-modal-reason-btn { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 16px; font-size: 14px; color: #334155; cursor: pointer; text-align: left;
  transition: background .1s, border-color .1s; }
.discard-modal-reason-btn:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.discard-modal-cancel { width: 100%; background: none; border: none; padding: 12px;
  font-size: 15px; color: #94a3b8; cursor: pointer; border-radius: 10px; }
.discard-modal-cancel:hover { background: #f1f5f9; color: #475569; }
.art-preview { font-family: Georgia, serif; font-size: 16px; line-height: 1.8; color: #222;
               border: 1px solid #e5e7eb; border-radius: 8px; padding: 32px 36px; background: #fff;
               max-width: 760px; }
.art-preview h1 { font-family: Arial, sans-serif; font-size: 26px; line-height: 1.3; color: #111;
                  margin: 0 0 24px; font-weight: 800; border: none; padding: 0; }
.art-preview h2 { font-family: Arial, sans-serif; font-size: 18px; color: #333; margin: 28px 0 10px;
                  font-weight: 700; border: none; padding: 0; }
.art-preview h3 { font-family: Arial, sans-serif; font-size: 15px; color: #555; margin: 20px 0 8px;
                  font-weight: 700; border: none; padding: 0; }
.art-preview p  { margin: 0 0 16px; text-align: left; }
.art-preview strong { color: #111; }
@media (max-width: 640px) {
  .art-preview { padding: 18px 16px; font-size: 15px; }
  .art-preview h1 { font-size: 20px; }
  .art-preview h2 { font-size: 16px; }
}
.spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid #e5e7eb;
           border-top-color: #2563eb; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }

/* ── Navegación ───────────────────────────────────────────────────────────── */
.topnav { background: #1e3a5f; border-bottom: 2px solid #152d4a;
          padding: env(safe-area-inset-top,0px) 20px 0;
          display: flex; align-items: center; flex-wrap: wrap;
          margin: -20px -24px 20px -24px;
          position: sticky; top: 0; z-index: 200; }
.nav-brand { color: #fff; font-weight: bold; font-size: 15px;
             padding: 12px 16px 12px 3px; border-right: 1px solid rgba(255,255,255,.15);
             margin-right: 8px; white-space: nowrap; flex-shrink: 0;
             text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-brand:hover { color: #93c5fd; }
.nav-burger { display: none; background: none; border: none; font-size: 22px;
              cursor: pointer; color: rgba(255,255,255,.8); padding: 10px 8px; margin-left: auto; }
.nav-links { display: flex; align-items: center; flex: 1; }
.nav-link { text-decoration: none; padding: 12px 14px; font-size: 14px;
            color: rgba(255,255,255,.65); border-bottom: 3px solid transparent;
            display: inline-block; white-space: nowrap; }
.nav-link:hover { color: #fff; }
.nav-link-active { color: #fff; border-bottom: 3px solid rgba(255,255,255,.8); font-weight: bold; }

/* Tarea #40: Bottom tab bar movil */
.bottom-tabs { display: none; }
@media (max-width: 640px) {
  .bottom-tabs {
    display: flex !important;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 250;
    background: var(--bg-card, #fff);
    border-top: 1px solid var(--border-soft, #e5e7eb);
    padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px) 4px;
    justify-content: space-around;
  }
  .bottom-tabs a {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; padding: 6px 4px; text-decoration: none;
    color: #94a3b8; font-size: 10px; font-weight: 600;
  }
  .bottom-tabs a.active { color: #2563eb; }
  body.dark .bottom-tabs a { color: #cbd5e1; }
  body.dark .bottom-tabs a.active { color: #60a5fa; }
  .bottom-tabs svg { width: 22px; height: 22px; }
  body { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 70px); }
}

/* ── Móvil ────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { padding: 12px; }

  .topnav { margin: -20px -24px 14px -24px !important;
            padding: env(safe-area-inset-top,0px) 12px 0 !important;
            flex-wrap: nowrap; position: relative; }
  .nav-burger { display: block; }
  .nav-links { display: none; flex-direction: column;
               position: absolute; top: 100%; left: 0; right: 0;
               background: #1e3a5f; border-top: 1px solid rgba(255,255,255,.12);
               box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 300; }
  .nav-links.open { display: flex; }
  body { padding: 16px 18px; font-size: 17px;
         padding-left: max(18px, env(safe-area-inset-left));
         padding-right: max(18px, env(safe-area-inset-right)); }

  .nav-link { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08) !important;
              width: 100%; font-size: 17px; box-sizing: border-box; }
  .nav-link-active { background: rgba(255,255,255,.1); color: #fff; border-left: 3px solid #60a5fa !important; padding-left: 15px; }

  .card { padding: 16px 0; margin: 10px -14px; border-radius: 0; border-left: none; border-right: none; }
  .card > h2, .card > p, .card > label, .card > div:not(.art-cards):not(.tabs):not(.tab-pane):not(.stats-grid):not(.table-wrap) { padding-left: 14px; padding-right: 14px; }
  .art-card { padding-left: 14px; padding-right: 14px; }
  .art-src-row { padding-left: 46px; }
  h2 { font-size: 17px; }
  label { font-size: 15px; }
  p { font-size: 16px; line-height: 1.65; }

  /* Estadísticas / Pipeline */
  .stats-grid { gap: 5px; flex-wrap: nowrap; padding: 0 14px; }
  .stat-box { flex: 1 1 0; min-width: 0; padding: 10px 6px; text-align: center; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 12px; }
  .pipe-section { padding: 0 14px; }
  .pipe-row { gap: 3px; }
  .pipe-arrow { font-size: 12px; }

  /* Header de la última ejecución */
  .run-header { align-items: center !important; }

  /* Tabs */
  .tabs { gap: 3px; }
  .tab-btn { padding: 8px 12px; font-size: 14px; }

  /* Tablas */
  .tab-pane { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  th, td { padding: 9px 10px; font-size: 14px; }
  th { font-size: 13px; }

  /* Barra de descarte masivo */
  #bulk-bar { flex-wrap: wrap; gap: 8px !important; }
  #bulk-bar select { max-width: 100% !important; flex: 1 1 100% !important; }
  #bulk-bar button { flex: 1 1 100% !important; text-align: center; }

  /* Formularios de config */
  input[type=text], input[type=email], input[type=password], input[type=number] {
    width: 100% !important; font-size: 16px; padding: 11px 13px;
  }
  select { width: 100%; padding: 11px; font-size: 16px; }
  .btn-save, .btn-add { width: 100%; text-align: center; padding: 14px; font-size: 17px; }

  /* Página /escribir */
  .art-text { font-size: 16px; line-height: 1.8; padding: 18px; }
  #result-area > div[style*="display:flex"] { flex-direction: column !important; }
  #result-area button, #result-area a { width: 100%; text-align: center; }

  /* Artículo preview en wizard */
  .art-preview p { font-size: 16px; line-height: 1.8; margin-bottom: 16px; }

  /* Log */
  pre { font-size: 12px; max-height: 200px; }
}

@media (max-width: 380px) {
  .stat-box { flex: 1 1 100%; }
}

/* === Wizard responsive === */
.wiz-progress { display: flex; margin-bottom: 22px; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.wiz-progress > div { flex: 1; padding: 8px 4px; text-align: center; font-size: 11px; border-right: 1px solid #e2e8f0; }
.wiz-progress > div:last-child { border-right: none; }
.wiz-progress > div.act { background: #2563eb; color: #fff; font-weight: bold; }
.wiz-progress > div.done { background: #dcfce7; color: #166534; }
.wiz-progress > div.todo { background: #f8fafc; color: #94a3b8; }
.wiz-progress-mobile { display: none; }
@media (max-width: 640px) {
  .wiz-progress { display: none; }
  .wiz-progress-mobile {
    display: block;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
  }
  .wpm-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
  .wpm-step { font-weight: 700; color: #2563eb; font-size: 14px; }
  .wpm-counter { font-size: 12px; color: #94a3b8; }
  .wpm-bar { display: flex; gap: 4px; }
  .wpm-dot { flex: 1; height: 4px; border-radius: 2px; background: #e2e8f0; }
  .wpm-dot.act { background: #2563eb; }
  .wpm-dot.done { background: #86efac; }
}
.wiz-nav { margin-top: 20px; display: flex; justify-content: space-between; gap: 10px; }
@media (max-width: 640px) {
  .wiz-nav {
    position: sticky;
    bottom: 0;
    background: var(--bg-card, #fff);
    padding: 12px 10px;
    margin: 16px -10px 0;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 10;
  }
  .wiz-nav button { flex: 1; padding: 12px 16px !important; font-size: 15px !important; }
  #wp-img-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  #wp-img-grid img { width: 100% !important; height: auto !important; aspect-ratio: 1; object-fit: cover; }
}
.wiz-dropzone {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed #cbd5e1; border-radius: 8px;
  padding: 16px; text-align: center; font-size: 13px;
  color: #64748b; cursor: pointer; background: #f8fafc;
  margin-bottom: 8px;
}
.wiz-dropzone:hover { border-color: #2563eb; color: #2563eb; }
.wiz-dropzone-input { display: none; }
