/* ==========================================================================
   nullen.cc — csv <-> json specifics
   The shared tool chrome lives in tool.css; this file only adds the findings
   panel and the delimiter option.
   ========================================================================== */

/* ---------- Findings panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
}

.detect {
  display: grid;
  gap: var(--space-4);
}

.detect__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.detect__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

/* the delimiter row disappears for JSON input */
.detect__row.is-hidden {
  display: none;
}

.detect__label {
  color: var(--muted);
  font-size: var(--text-sm);
}

.detect__value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: right;
}

.detect__number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}

/* ---------- Format badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge[data-format="csv"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---------- Column names ---------- */
.detect__fields {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.detect__field {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.detect__empty {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* ---------- Delimiter option ---------- */
#csv-options {
  display: none;
}

#csv-options.is-visible {
  display: flex;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .panel {
    padding: var(--space-5);
  }

  .detect__number {
    font-size: var(--text-xl);
  }
}
