/* CSV to JSON. The hero, the content sections, the cards and the FAQ come from
   tool_page.css; only the converter's own panels are here. */

/* The star field behind the hero is a positioned image, so the panels need
   their own stacking context or it swallows every click. */
.cj {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto 56px auto;
  padding: 0 16px;
}

.cj [hidden] {
  display: none !important;
}

.cj-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cj-panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.cj-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cj-panel-title {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.cj-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* The document sits beside its settings on a wide screen and above them on a
   narrow one, which is also the order they are used in. */
.cj-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 991px) {
  .cj-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cj-mini {
  padding: 5px 12px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.cj-mini:hover {
  background: rgba(110, 0, 255, 0.35);
  color: #fff;
}

.cj-drop {
  position: relative;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  padding: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cj-drop.is-over {
  border-color: #6e00ff;
  background: rgba(110, 0, 255, 0.12);
}

.cj-textarea {
  width: 100%;
  min-height: 260px;
  padding: 12px;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.92);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  tab-size: 4;
}

.cj-textarea:focus {
  outline: none;
  border-color: #6e00ff;
}

.cj-textarea:disabled {
  opacity: 0.4;
}

.cj-drop-hint {
  margin: 8px 2px 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.cj-drop-hint i {
  margin-inline-end: 6px;
  color: rgba(255, 255, 255, 0.7);
}

.cj-file-label {
  color: #c9a7ff;
  cursor: pointer;
  text-decoration: underline;
}

.cj-file-label input {
  display: none;
}

.cj-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(110, 0, 255, 0.18);
  color: #fff;
  font-size: 13px;
}

.cj-chip button {
  margin-inline-start: auto;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.cj-chip button:hover {
  color: #fff;
}

.cj-error {
  margin: 10px 0 0;
  color: #ff8ba0;
  font-size: 13px;
  line-height: 1.5;
}

.cj-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cj-field-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cj-segment {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
}

.cj-segment-item {
  padding: 6px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
}

.cj-segment-item.is-active {
  background: #6e00ff;
  color: #fff;
}

.cj-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
}

.cj-select:focus {
  outline: none;
  border-color: #6e00ff;
}

.cj-select option {
  color: #0d001f;
}

.cj-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cj-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.cj-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #6e00ff;
}

.cj-check small {
  display: block;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.cj-summary {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.cj-notes {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cj-note {
  position: relative;
  padding-inline-start: 18px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.5;
}

.cj-note::before {
  content: "•";
  position: absolute;
  inset-inline-start: 4px;
  color: #6e00ff;
}

.cj-preview {
  max-height: 420px;
  overflow: auto;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
}

.cj-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: nowrap;
}

.cj-table th,
.cj-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cj-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1a0733;
  color: #fff;
  font-weight: 600;
}

.cj-table thead th.cj-forced {
  color: #ffce6b;
}

.cj-rownum {
  color: rgba(255, 255, 255, 0.3);
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.cj-cell--text {
  color: #8ee6b4;
}

.cj-cell--number {
  color: #ffce6b;
}

.cj-cell--boolean,
.cj-cell--date {
  color: #8ab4ff;
}

.cj-cell--null {
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

.cj-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.cj-legend span::before {
  content: "■";
  margin-inline-end: 5px;
}

.cj-legend .cj-cell--text::before {
  color: #8ee6b4;
}

.cj-legend .cj-cell--number::before {
  color: #ffce6b;
}

.cj-legend .cj-cell--boolean::before {
  color: #8ab4ff;
}

.cj-legend .cj-cell--null::before {
  color: rgba(255, 255, 255, 0.35);
}

.cj-legend span {
  color: rgba(255, 255, 255, 0.55);
  font-style: normal;
}

.cj-hint {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.cj-out {
  margin: 0;
  max-height: 480px;
  overflow: auto;
  padding: 14px;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.88);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}

.cj-status {
  margin: 0;
  min-height: 18px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.cj-copy-status {
  margin: 8px 0 0;
  min-height: 18px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.cj-copy-status--error {
  color: #ff8ba0;
}

.cj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 575px) {
  .cj-panel {
    padding: 16px;
  }

  .cj-textarea {
    min-height: 200px;
  }
}
