/* CSV ⇄ JSON converter — extends tool-page.css shell.
   JS hooks: #csvFile, #csvInput, #csvOutput, #csvDelimiter, #csvHeader,
   #csvInfer, #csvPretty, #csvFlatten, #csvCopy, #csvDownload,
   #csvClear, #csvStatus, #csvError, .us-tool-seg[data-mode] */

.us-tool-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
}
.us-tool-seg {
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--t-fast) ease-out,
    color var(--t-fast) ease-out,
    box-shadow var(--t-fast) ease-out;
}
.us-tool-seg:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.us-tool-seg[aria-pressed="true"] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  color: var(--accent);
}
@media (max-width: 640px) {
  .us-tool-segmented { width: 100%; }
  .us-tool-seg { flex: 1; }
}

/* Options row */
.us-tool-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

/* Data wells */
#csvInput,
#csvOutput {
  min-height: 320px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  tab-size: 2;
}
#csvOutput[readonly] {
  background: var(--surface-sunken);
  color: var(--text-muted);
  cursor: text;
}

/* Feedback */
#csvError {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}
