/* Text to CSV Converter.
   Every value from a token (§4.2). Scoped to .ftb-tool-tcsv. */

.ftb-tool-tcsv textarea{width:100%;font-family:var(--ftb-mono);
  font-size:var(--ftb-text-code);line-height:1.5;resize:vertical}

/* The file button is a styled <label> for a visually-hidden input, so the
   native "No file chosen" text never appears and the control matches every
   other button on the site. The input keeps a real focus ring because
   .ftb-visually-hidden does not remove it from the tab order. */
.ftb-tcsv-file{display:flex;flex-wrap:wrap;align-items:center;
  gap:var(--ftb-space-3);margin:var(--ftb-space-4) 0}
.ftb-tool-tcsv .ftb-tcsv-file label{cursor:pointer;margin:0}
.ftb-tool-tcsv input[type=file]:focus-visible + .ftb-tool-stat,
.ftb-tool-tcsv input[type=file]:focus-visible{outline:2px solid var(--ftb-primary);
  outline-offset:2px}

.ftb-tcsv-settings{display:grid;gap:var(--ftb-space-4);
  grid-template-columns:1fr;margin-bottom:var(--ftb-space-4)}
@media (min-width:640px){
  .ftb-tcsv-settings{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* ---- the report: the reason this tool exists ---- */

.ftb-tcsv-report{margin:var(--ftb-space-6) 0;padding:var(--ftb-space-5);
  background:var(--ftb-surface);border:1px solid var(--ftb-border);
  border-radius:var(--ftb-radius-lg)}
.ftb-tcsv-report h3{margin:0 0 var(--ftb-space-4);font-size:var(--ftb-text-lg)}

.ftb-tcsv-issues{margin:0 0 var(--ftb-space-5);padding:0 0 0 var(--ftb-space-5);
  display:flex;flex-direction:column;gap:var(--ftb-space-3);
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug)}
.ftb-tcsv-issues li{margin:0}
/* Kind is carried by the marker glyph AND the wording of each message, never
   by colour alone — §9 forbids colour as the only signal. */
.ftb-tcsv-issues li.is-error{color:var(--ftb-error)}
.ftb-tcsv-issues li.is-error::marker{content:"\2716  "}
.ftb-tcsv-issues li.is-warn{color:var(--ftb-warning)}
.ftb-tcsv-issues li.is-warn::marker{content:"\26A0  "}
.ftb-tcsv-issues li.is-info{color:var(--ftb-text-muted)}
.ftb-tcsv-issues li.is-info::marker{content:"\2139  "}
.ftb-tcsv-issues li.is-clean{color:var(--ftb-success)}
.ftb-tcsv-issues li.is-clean::marker{content:"\2713  "}

.ftb-tcsv-stats{display:flex;flex-wrap:wrap;gap:var(--ftb-space-6);margin:0}
.ftb-tcsv-stats div{display:flex;flex-direction:column;gap:2px}
.ftb-tcsv-stats dt{font-size:var(--ftb-text-xs);color:var(--ftb-text-subtle);
  letter-spacing:var(--ftb-ls-wide);text-transform:uppercase}
.ftb-tcsv-stats dd{margin:0;font-size:var(--ftb-text-lg);
  font-weight:var(--ftb-fw-semi);font-variant-numeric:tabular-nums}

/* ---- preview table ---- */

.ftb-tcsv-preview{margin:var(--ftb-space-6) 0}
.ftb-tcsv-preview h3{margin:0 0 var(--ftb-space-4);font-size:var(--ftb-text-lg)}
.ftb-tcsv-table{width:100%;border-collapse:collapse;font-size:var(--ftb-text-sm);
  font-family:var(--ftb-mono)}
.ftb-tcsv-table th,.ftb-tcsv-table td{padding:var(--ftb-space-2) var(--ftb-space-3);
  border:1px solid var(--ftb-border);text-align:left;vertical-align:top;
  white-space:nowrap}
.ftb-tcsv-table th{background:var(--ftb-surface-2);font-weight:var(--ftb-fw-semi);
  position:sticky;top:0}
.ftb-tcsv-table tbody tr:nth-child(even){background:var(--ftb-surface-2)}

.ftb-tcsv-idle{color:var(--ftb-text-muted);font-size:var(--ftb-text-sm);
  margin:var(--ftb-space-6) 0}

/* Reserve height so the report and preview appearing does not shove the
   actions down as you type (§10, CLS under 0.05). */
.ftb-tool-tcsv .ftb-tool-actions{margin-top:var(--ftb-space-6)}
