/* =========================================================
   ISBN Converter & Validator — tool-specific styles.
   Layered on top of /tools/_shared/tool.css.
   ========================================================= */

/* The results table has five columns (input, status, ISBN-13, ISBN-10,
   note) and squeezed at the shared 600px card. Wider on desktop, the same
   way the attendance sheet generator widens its card. */
.widget-card {
  max-width: var(--container-wide);
}

.isbn-input {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: var(--space-4);
  background: var(--surface-inset);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
  transition: var(--transition-colors);
}
.isbn-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.input-hint { margin-top: var(--space-2); font-size: 13px; color: var(--text-subtle); }

.input-actions,
.result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
@media (min-width: 640px) {
  .input-actions { grid-template-columns: 1.6fr 1fr 1fr; }
  .result-actions { grid-template-columns: 1fr 1fr; }
}
#btn-copy.is-success {
  background: var(--success);
  color: var(--success-fg);
  border-color: var(--success);
}

.summary {
  margin: var(--space-5) 0 var(--space-3);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---------- Results table ---------- */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.results-table th,
.results-table td {
  padding: var(--space-3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.results-table thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--surface-2);
}
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table .mono { font-family: var(--font-mono); overflow-wrap: anywhere; }
/* With the wide card there is room for a whole ISBN per line; let the
   note column take the wrapping instead. Phone width (below) stacks rows. */
@media (min-width: 640px) {
  .results-table .mono { white-space: nowrap; overflow-wrap: normal; }
}
.status { font-weight: 600; white-space: nowrap; }
.status-valid { color: var(--success); }
.status-invalid { color: var(--danger); }
.status-incomplete { color: var(--warning); }

/* Phone width: stack each result into a card so nothing scrolls sideways. */
@media (max-width: 639px) {
  .results-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .results-table, .results-table tbody, .results-table tr, .results-table td { display: block; }
  .results-table tr { padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
  .results-table tbody tr:last-child { border-bottom: 0; }
  .results-table td {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-1) var(--space-3);
    border: 0;
  }
  .results-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-subtle);
  }
}

/* ---------- Step-by-step working ---------- */
.working {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.working-block + .working-block { margin-top: var(--space-5); }
.working-block h3 { font-size: 15px; font-weight: 600; margin-bottom: var(--space-3); }
.working-scroll { max-width: 100%; overflow-x: auto; }
.working-table { border-collapse: collapse; font-family: var(--font-mono); font-size: 14px; }
.working-table th {
  padding: var(--space-1) var(--space-3) var(--space-1) 0;
  font-family: inherit;
  font-weight: 500;
  text-align: left;
  color: var(--text-subtle);
  white-space: nowrap;
}
.working-table td { padding: var(--space-1) var(--space-2); text-align: center; min-width: 28px; }
.working-table tr:nth-child(3) td { font-weight: 600; }
.working-steps {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-5);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.working-result { margin-top: var(--space-2); font-family: var(--font-mono); font-weight: 600; }
