/* ============================================================
   Herramienta 3 — Extractor de texto RSS
   Los números 1-2-3 no son decoración: el flujo es realmente
   secuencial (subir → elegir campos → ajustar salida).
   ============================================================ */

.rss-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
}
.rss-step:first-child { margin-top: 0; }

.rss-step__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .8125rem;
  font-weight: 800;
}

.rss-step__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-900);
}

.rss-step__note {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-3);
}

/* ---------- Zona de carga ---------- */
.rss-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 18px;
  border: 2px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.rss-drop:hover { border-color: var(--accent); }
.rss-drop.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.rss-drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

.rss-drop input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rss-drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rss-drop__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.rss-drop__icon svg { width: 22px; height: 22px; fill: currentColor; }

.rss-drop strong { font-size: .9375rem; color: var(--brand-900); }
.rss-drop span { font-size: .8125rem; color: var(--ink-3); }

.rss-drop__file {
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--accent-line);
  color: var(--accent-strong) !important;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.rss-drop__file[hidden] { display: none; }

/* ---------- Selección de campos ---------- */
.rss-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
}

.rss-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.rss-field input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.rss-field::before {
  content: "";
  width: 15px; height: 15px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line-2);
  border-radius: 5px;
}
.rss-field.is-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}
.rss-field.is-on::before {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M6.2 11.6 3 8.4l1.1-1.1 2.1 2.1 5-5L12.3 5z'/%3E%3C/svg%3E") center/contain no-repeat;
  border-color: var(--accent);
}
.rss-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Configuración ---------- */
.rss-config {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .rss-config { grid-template-columns: 1fr 1fr; gap: 18px; }
}

.rss-input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 16px;
}
.rss-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.rss-help {
  display: block;
  margin-top: 5px;
  font-size: .75rem;
  color: var(--ink-3);
}

.rss-options {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 16px;
}
@media (min-width: 640px) {
  .rss-options { grid-template-columns: 1fr 1fr; }
}

.rss-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
}
.rss-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.rss-check strong { display: block; font-size: .875rem; color: var(--brand-900); }
.rss-check small { display: block; font-size: .75rem; color: var(--ink-3); line-height: 1.45; }

.rss-saved {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-size: .75rem;
  color: var(--ink-3);
}

/* ---------- Resultados ---------- */
.rss-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.rss-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.rss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.rss-table th {
  padding: 10px 12px;
  text-align: left;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
.rss-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.rss-table td a { color: var(--accent); font-weight: 600; }
.rss-empty-cell { color: var(--ink-3); }

/* En móvil la tabla se convierte en tarjetas apiladas */
@media (max-width: 719px) {
  .rss-table thead { display: none; }
  .rss-table, .rss-table tbody, .rss-table tr, .rss-table td { display: block; width: 100%; }
  .rss-table tr {
    border-top: 1px solid var(--line);
    padding: 6px 0;
  }
  .rss-table tr:first-child { border-top: none; }
  .rss-table td {
    border: none;
    padding: 5px 14px;
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 10px;
  }
  .rss-table td::before {
    content: attr(data-label);
    font-size: .6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-3);
    padding-top: 2px;
  }
}

@media (min-width: 720px) {
  .rss-table-wrap { max-height: 460px; overflow-y: auto; }
  .rss-table thead th { position: sticky; top: 0; z-index: 1; }
}
