/* ==========================================================================
   My Easy Science - Rename Article (paper-tools/rename-article/)
   Tool-specific layout only. Shared look comes from /assets/ui.css and
   the Paper Tools UI kit in /ui/paper-tools-ui.css.
   Uses only ui.css variables; no hardcoded colours.
   ========================================================================== */

/* ---------- How it works guide (top of page) ---------- */
/* Numbers come only from the CSS counter below. There is no number
   element in the markup, so a step number can never show twice. */
.rn-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s3);
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
  counter-reset: rn-step;
}
.rn-guide li {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.rn-guide li::before {
  counter-increment: rn-step;
  content: counter(rn-step);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.rn-guide strong { display: block; margin-bottom: var(--s1); font-size: var(--fs-base); }
.rn-guide span { color: var(--muted); font-size: var(--fs-sm); line-height: var(--lh); }

/* ---------- Settings ---------- */
.rn-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 var(--s4);
}
/* Round 3: loosen the dense explanatory text under the naming pattern
   (same words, more line height). */
.rn-settings-grid .field .helper { line-height: 1.7; }
.rn-settings-grid .field { margin-bottom: var(--s3); }
.rn-check { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s1); font-weight: 400; cursor: pointer; }
.rn-check input { width: 20px; height: 20px; flex: none; accent-color: var(--primary); }

/* ---------- Results table ---------- */
.rn-table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: end;
  margin-bottom: var(--s3);
}
.rn-filter-field { margin-bottom: 0; }
.rn-filter-field label { font-size: var(--fs-sm); }
.rn-table-wrap { overflow-x: auto; }
.rn-table { min-width: 760px; }
.rn-table th, .rn-table td { vertical-align: top; }
.rn-original {
  max-width: 220px;
  overflow-wrap: anywhere;
  font-size: var(--fs-sm);
}
.rn-name-input { min-width: 220px; }
.rn-name-input:disabled { opacity: .65; }
.rn-row-note {
  margin: var(--s1) 0 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.rn-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: var(--s1) var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}
.rn-size { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rn-actions { white-space: nowrap; }
.rn-actions .rn-row-btn { min-height: 32px; padding: var(--s1) var(--s2); font-size: var(--fs-xs); }
.rn-actions .rn-row-btn + .rn-row-btn { margin-left: var(--s1); }

/* ---------- Skipped files ---------- */
#skippedDetails { margin-top: var(--s3); }
#skippedDetails summary { cursor: pointer; font-weight: 650; min-height: 44px; }
#skippedDetails ul { margin: var(--s2) 0 0; padding-left: var(--s5); font-size: var(--fs-sm); color: var(--muted); }
#skippedDetails li { margin-bottom: var(--s1); overflow-wrap: anywhere; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .rn-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rn-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .rn-guide { grid-template-columns: 1fr; }
  .rn-table-tools { flex-direction: column; align-items: stretch; }
  .rn-table-tools .btn { width: 100%; }
}
