.excel-csv-hero {
  padding-top: clamp(40px, 7vw, 88px);
}

.excel-csv-hero > p:not(.eyebrow) {
  max-width: 760px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.75;
}

.excel-csv-tool {
  padding-block: clamp(28px, 6vw, 72px);
}

.excel-csv-card {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--color-border, #dedbd1);
  border-radius: 20px;
  background: var(--color-surface, #fff);
  box-shadow: 0 18px 50px rgba(43, 43, 40, .08);
}

.excel-csv-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.excel-csv-heading h2,
.excel-csv-heading p {
  margin-top: 0;
}

.excel-csv-step {
  display: grid;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 10px;
  background: var(--color-primary, #6f8348);
  color: #fff;
  font-weight: 800;
  place-items: center;
}

.excel-csv-dropzone {
  display: grid;
  gap: 7px;
  min-height: 112px;
  margin-top: 10px;
  padding: 24px;
  border: 1px dashed var(--color-border, #cbc9bf);
  border-radius: 14px;
  background: var(--color-surface-subtle, #f7f6f1);
  cursor: pointer;
  text-align: center;
  place-content: center;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.excel-csv-dropzone[data-dragging="true"] {
  border-color: var(--color-primary, #6f8348);
  background: rgba(111, 131, 72, .09);
  transform: translateY(-2px);
}

.excel-csv-dropzone small,
.excel-csv-mode small,
.excel-csv-sheet-field small,
.excel-csv-section-heading small {
  display: block;
  margin-top: 4px;
  color: var(--color-text-muted, #66685f);
  line-height: 1.55;
}

#excelCsvFile {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.excel-csv-summary,
.excel-csv-preview-more,
.excel-csv-limit {
  overflow-wrap: anywhere;
}

.excel-csv-summary {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--color-surface-subtle, #f7f6f1);
  font-weight: 700;
}

.excel-csv-sheet-field,
.excel-csv-preview-section {
  margin-top: 24px;
}

.excel-csv-sheet-field label,
.excel-csv-section-heading > div {
  display: block;
  margin-bottom: 10px;
}

#excelCsvSheet {
  width: 100%;
  min-height: 46px;
  padding: 10px 40px 10px 12px;
  border: 1px solid var(--color-border, #cbc9bf);
  border-radius: 10px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2b28);
  font: inherit;
}

#excelCsvSheet:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.excel-csv-preview {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border, #dedbd1);
  border-radius: 12px;
  background: #fff;
}

.excel-csv-preview[hidden] {
  display: none;
}

.excel-csv-preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.excel-csv-preview-table th,
.excel-csv-preview-table td {
  min-width: 120px;
  max-width: 280px;
  padding: 11px 12px;
  border-right: 1px solid #e7e4da;
  border-bottom: 1px solid #e7e4da;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.excel-csv-preview-table th {
  position: sticky;
  top: 0;
  background: #f2f4ec;
  font-weight: 800;
}

.excel-csv-preview-table tr:last-child td,
.excel-csv-preview-table tr:last-child th {
  border-bottom: 0;
}

.excel-csv-warnings {
  margin-top: 20px;
  padding: 18px;
  border-left: 4px solid var(--color-warning, #d4a23a);
  border-radius: 0 12px 12px 0;
  background: rgba(212, 162, 58, .10);
}

.excel-csv-warnings h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.excel-csv-warnings ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.excel-csv-warnings li {
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.excel-csv-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 18px;
  padding: 0;
  border: 0;
}

.excel-csv-modes legend {
  grid-column: 1 / -1;
  margin-bottom: 10px;
  font-size: 1.08rem;
  font-weight: 800;
}

.excel-csv-mode {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--color-border, #dedbd1);
  border-radius: 12px;
  background: var(--color-surface, #fff);
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}

.excel-csv-mode:has(input:checked) {
  border-color: var(--color-primary, #6f8348);
  background: rgba(111, 131, 72, .08);
}

.excel-csv-mode input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--color-primary, #6f8348);
}

.excel-csv-modes:disabled,
.excel-csv-modes:disabled .excel-csv-mode {
  cursor: not-allowed;
  opacity: .58;
}

.excel-csv-limit {
  color: var(--color-text-muted, #66685f);
  font-size: .92rem;
  line-height: 1.6;
}

.excel-csv-status {
  min-height: 26px;
  margin: 18px 0;
  color: var(--color-text-muted, #66685f);
  font-weight: 700;
}

.excel-csv-status[data-kind="error"] {
  color: #a33b32;
}

.excel-csv-status[data-kind="success"] {
  color: var(--color-primary-dark, #526336);
}

.excel-csv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.excel-csv-actions button,
.excel-csv-results a {
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--color-primary, #6f8348);
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

#excelCsvButton,
.excel-csv-results a {
  background: var(--color-primary, #6f8348);
  color: #fff;
}

#excelCsvReset {
  background: transparent;
  color: var(--color-text, #2b2b28);
}

.excel-csv-actions button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.excel-csv-results {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid rgba(111, 131, 72, .35);
  border-radius: 14px;
  background: rgba(111, 131, 72, .08);
}

.excel-csv-results[hidden] {
  display: none;
}

.excel-csv-results h3,
.excel-csv-results p {
  margin: 0;
}

.excel-csv-results a {
  display: inline-grid;
  justify-self: start;
  margin-top: 6px;
  text-decoration: none;
  place-items: center;
}

.excel-csv-info-grid,
.excel-csv-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.excel-csv-source-grid a {
  overflow-wrap: anywhere;
}

.excel-csv-dropzone:focus-within,
.excel-csv-mode:focus-within,
#excelCsvSheet:focus-visible,
.excel-csv-actions button:focus-visible,
.excel-csv-results a:focus-visible {
  outline: 3px solid rgba(111, 131, 72, .35);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .excel-csv-modes,
  .excel-csv-info-grid,
  .excel-csv-source-grid {
    grid-template-columns: 1fr;
  }

  .excel-csv-card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .excel-csv-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .excel-csv-actions button {
    width: 100%;
  }

  .excel-csv-preview-table th,
  .excel-csv-preview-table td {
    min-width: 108px;
    max-width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .excel-csv-dropzone,
  .excel-csv-mode,
  .excel-csv-actions button {
    transition: none;
  }
}
