.spreadsheet-conversion-notes {
  margin: 12px 0 0;
  padding-left: 21px;
  color: var(--color-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.spreadsheet-conversion-notes li {
  margin: 4px 0;
}

.progress-panel .spreadsheet-conversion-notes {
  max-width: 100%;
  text-align: left;
}

.spreadsheet-options {
  --option-columns: 5;
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

[data-spreadsheet="csv"] .spreadsheet-options {
  --option-columns: 4;
}

.spreadsheet-options legend {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 12px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
}

.spreadsheet-options .spreadsheet-reset-options {
  margin-inline-start: auto;
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}

.spreadsheet-option-fields,
.spreadsheet-option-checks {
  display: grid;
  grid-template-columns: repeat(var(--option-columns), minmax(0, 1fr));
  gap: 12px;
}

.spreadsheet-option-field,
.spreadsheet-option {
  min-width: 0;
}

.spreadsheet-option {
  position: relative;
}

.spreadsheet-option-select {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 5px;
}

.spreadsheet-option-select label {
  color: var(--color-muted);
  font-size: 13px;
}

.spreadsheet-option-select select {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
}

.spreadsheet-option-select select:disabled {
  color: var(--color-muted);
}

.spreadsheet-option-checks {
  row-gap: 8px;
  margin-top: 12px;
}

.spreadsheet-option-field > .spreadsheet-option-check {
  margin-top: 12px;
}

.spreadsheet-option-check {
  font-size: 13px;
}

.spreadsheet-option-check label {
  display: grid;
  min-width: 0;
  cursor: pointer;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-height: 24px;
}

.spreadsheet-option-check input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--color-accent-hover);
}

.spreadsheet-tooltip {
  position: absolute;
  z-index: 10;
  inset-inline: var(--spreadsheet-tooltip-inset, 0 auto);
  bottom: 100%;
  width: min(240px, calc(100vw - 76px));
  padding: 7px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 7px;
  background: var(--color-surface);
  box-shadow: 0 3px 12px rgb(0 0 0 / 14%);
  color: var(--color-text);
  font: 400 13px/1.4 var(--font-sans);
  visibility: hidden;
}

.spreadsheet-option-check > .spreadsheet-tooltip {
  top: 100%;
  bottom: auto;
}

.spreadsheet-option:not([data-help-dismissed]):has(:focus-visible) > .spreadsheet-tooltip {
  visibility: visible;
}

@media (hover: hover) {
  .spreadsheet-option:not([data-help-dismissed]):hover > .spreadsheet-tooltip { visibility: visible; }
}

.spreadsheet-option-field:last-child,
.spreadsheet-option-checks > :last-child:not(:first-child) {
  --spreadsheet-tooltip-inset: auto 0;
}

@media (max-width: 1060px) {
  .spreadsheet-options, [data-spreadsheet="csv"] .spreadsheet-options { --option-columns: 3; }
  .spreadsheet-option-field:nth-child(3n), .spreadsheet-option-checks > :nth-child(3n) { --spreadsheet-tooltip-inset: auto 0; }
}

@media (max-width: 720px) {
  .spreadsheet-options, [data-spreadsheet="csv"] .spreadsheet-options { --option-columns: 2; }
  .spreadsheet-option-field:nth-child(odd), .spreadsheet-option-checks > :nth-child(odd) { --spreadsheet-tooltip-inset: 0 auto; }
  .spreadsheet-option-field:nth-child(even), .spreadsheet-option-checks > :nth-child(even) { --spreadsheet-tooltip-inset: auto 0; }
}

@media (max-width: 360px) {
  .spreadsheet-options legend { column-gap: 8px; font-size: 14px; }
  .spreadsheet-options .spreadsheet-reset-options { padding-inline: 5px; font-size: 12px; }
}
