[data-csv-repair] { background: #f6f9f5; --csv-green: #245c48; --csv-line: #dbe5dc; }
[data-csv-repair] [hidden] { display: none !important; }
[data-csv-repair] .page::before, [data-csv-repair] .page::after { display: none; }
[data-csv-repair] .site-header { padding-block: 24px; }
.csv-private { color: #526857; font-size: 13px; }
.csv-intro { padding: 30px 0 32px; max-width: 840px; }
.csv-eyebrow { color: #4f7761; font-size: 11px; letter-spacing: .09em; font-weight: 800; margin: 0 0 10px; }
.csv-intro h1 { margin: 0; font-size: clamp(32px, 4.2vw, 54px); line-height: 1.12; letter-spacing: -.04em; }
.csv-intro h1 span { color: var(--csv-green); }
.csv-intro > p:not(.csv-eyebrow) { font-size: 18px; line-height: 1.6; color: #526257; max-width: 62ch; margin: 18px 0; }
.csv-benefits { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 13px; font-weight: 600; color: #42624c; }
.csv-benefits span::before { content: '✓'; padding-right: 7px; }
.csv-workbench { background: #fff; border: 1px solid var(--csv-line); border-radius: 18px; box-shadow: 0 20px 70px #214a2910; overflow: hidden; }
.csv-drop { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 24px; background: #f8fcf7; border-bottom: 1px solid var(--csv-line); transition: background .15s; }
.csv-drop.is-dragging { background: #dceedd; outline: 3px solid #5a8b68; outline-offset: -3px; }
.csv-file-icon { width: 52px; height: 62px; display: grid; place-items: center; color: #36724f; border: 1px solid #cde0ce; background: #e9f3e8; border-radius: 12px; flex-shrink: 0; }
.csv-file-icon svg { width: 34px; height: 34px; }
.csv-source-title { flex: 1; min-width: 180px; overflow-wrap: anywhere; }
.csv-source-title strong { display: block; font-size: 18px; }
.csv-source-title > span { display: block; font-size: 12px; color: #5e7263; margin-top: 6px; line-height: 1.6; }
.csv-source-actions.upload-box { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
[data-csv-repair] .button:not(:disabled) { background: var(--csv-green); }
[data-csv-repair] .button:not(:disabled):hover { background: #1a4837; }
[data-csv-repair] :is(.button,.tool-button,.csv-text-button,.csv-example) { min-height: 44px; border-radius: 8px; font-size: 14px; padding: 10px 14px; box-shadow: none; }
.csv-example, .csv-text-button { border: 0; background: none; color: #3e654d; text-decoration: underline; text-underline-offset: 4px; font: inherit; cursor: pointer; }
[data-csv-repair] button:disabled { opacity: .45; cursor: default; }
.csv-status { margin: 0; padding: 14px 24px; font-size: 14px; color: #42624a; border-bottom: 1px solid #e9eee9; overflow-wrap: anywhere; }
.csv-status.is-error { color: #9e2d3c; background: #fff6f4; }
.csv-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); }
.csv-settings { padding: 24px; border-right: 1px solid var(--csv-line); background: #fcfdfb; }
.csv-settings h2 { margin: 0 0 8px; font-size: 17px; }
.csv-settings > p { font-size: 13px; line-height: 1.6; color: #637066; margin: 0 0 20px; }
.csv-field { display: block; font-size: 13px; font-weight: 700; color: #344d3d; margin-top: 18px; }
.csv-field select { display: block; width: 100%; margin-top: 7px; border: 1px solid #cedbce; border-radius: 7px; padding: 10px 30px 10px 10px; min-height: 42px; background-color: #fff; color: #2b4232; font: inherit; font-size: 13px; font-weight: 500; }
.csv-field select:disabled { background-color: #f1f4ef; color: #738174; }
.csv-field-hint, .csv-settings > .csv-field-hint { font-size: 12px; line-height: 1.5; margin: 7px 0 15px; color: #677467; }
.csv-check { display: flex; align-items: start; gap: 9px; margin-top: 16px; font-size: 13px; color: #3d5945; line-height: 1.5; cursor: pointer; }
.csv-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: #286245; flex-shrink: 0; }
.csv-check:has(:disabled) { color: #7a847a; }
.csv-output-setting { margin-top: 22px; border-top: 1px solid var(--csv-line); }
.csv-preview-panel { min-width: 0; display: flex; flex-direction: column; }
.csv-preview-heading { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 24px 24px 16px; }
.csv-preview-heading .csv-eyebrow { font-size: 10px; }
.csv-preview-heading h2 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.csv-preview-heading .csv-text-button { font-size: 12px; padding: 6px 0; }
.csv-diagnosis { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 24px 16px; }
.csv-diagnosis span { padding: 6px 9px; background: #edf6eb; color: #41604a; border-radius: 5px; font-size: 12px; }
.csv-diagnosis a { padding: 6px 3px; font-size: 12px; color: #365e40; text-decoration: underline; text-underline-offset: 3px; }
.csv-empty { min-height: 330px; flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 24px; color: #637769; background: linear-gradient(135deg,#fff,#f7fbf5); }
.csv-empty > span { font: 700 24px/1.5 Consolas,monospace; background: #eaf4e6; border: 1px solid #d9e8d2; color: #507544; border-radius: 10px; padding: 14px 20px; align-self: center; margin-bottom: 15px; }
.csv-empty h3 { margin: 0; font-size: 19px; color: #375b3f; }
.csv-empty p { font-size: 14px; line-height: 1.7; }
.csv-table-scroll { overflow: auto; height: 350px; max-width: 100%; border-block: 1px solid var(--csv-line); }
.csv-table-scroll table { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.csv-table-scroll :is(td,th) { border-bottom: 1px solid #e2e9df; border-right: 1px solid #e2e9df; padding: 11px 14px; text-align: left; white-space: pre-wrap; min-width: 110px; max-width: 320px; overflow-wrap: anywhere; }
.csv-table-scroll thead th { position: sticky; top: 0; z-index: 2; text-align: center; background: #e9f0e6; color: #54704c; font-weight: 600; padding-block: 8px; }
.csv-table-scroll tbody th { position: sticky; left: 0; background: #f5f8f2; color: #71806c; font-size: 12px; text-align: center; }
.csv-table-scroll tr > th:first-child { min-width: 40px; width: 40px; padding-inline: 8px; }
.csv-table-scroll tbody tr:nth-child(even) td { background: #fcfdfb; }
.csv-preview-limit { padding: 10px 24px; font-size: 12px; color: #6a786c; margin: 0; }
.csv-warnings { padding: 12px 24px 12px 40px; margin: 0; color: #855b2f; background: #fff8e8; font-size: 13px; line-height: 1.6; }
.csv-download-bar { margin-top: auto; padding: 20px 24px; background: #f2f8ed; border-top: 1px solid #dbe8d4; }
.csv-download-bar strong { font-size: 14px; color: #31593a; }
.csv-download-bar p { color: #647361; font-size: 12px; line-height: 1.6; margin: 5px 0 14px; }
.csv-download-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.csv-source-editor { padding: 16px 24px; border-top: 1px solid var(--csv-line); }
.csv-source-editor summary { font-size: 13px; color: #536f58; cursor: pointer; min-height: 28px; padding-block: 4px; }
.csv-source-editor textarea, .csv-copy-fallback textarea { display: block; width: 100%; min-height: 180px; margin-top: 12px; border: 1px solid #d7e1d5; border-radius: 8px; padding: 14px; background: #fbfdf9; color: #293f30; font: 13px/1.7 Consolas,monospace; resize: vertical; }
.csv-copy-fallback { padding: 16px 24px; font-size: 14px; }
.csv-explanation { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; padding-block: 46px 24px; }
.csv-explanation h2 { font-size: 18px; margin: 0 0 10px; }
.csv-explanation p { font-size: 14px; line-height: 1.75; color: #607164; margin: 0; }
.csv-related { font-size: 14px; color: #617065; line-height: 1.8; padding-bottom: 20px; }
.csv-related a { color: #355e41; text-decoration: underline; text-underline-offset: 3px; }
[data-csv-repair] .google-drive-button { width: auto; min-height: 44px; margin: 0; font-size: 13px; padding: 10px; }
@media (max-width: 900px) {
  .csv-layout { grid-template-columns: minmax(0,1fr); }
  .csv-settings { order: 1; }
  .csv-preview-panel { order: 0; }
  .csv-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 20px; border-right: 0; border-bottom: 1px solid var(--csv-line); }
  .csv-settings h2, .csv-settings > p:first-of-type { grid-column: 1 / -1; }
  .csv-settings > p:first-of-type { margin-bottom: 0; }
  .csv-settings .csv-field { margin-top: 12px; }
  .csv-settings #csv-encoding-hint { grid-column: 2; grid-row: 4; }
  .csv-settings .csv-check { grid-column: 1 / -1; }
  .csv-settings #csv-fix-hint, .csv-output-setting { grid-column: 1 / -1; }
  .csv-output-setting { margin-top: 6px; }
  .csv-output-setting .csv-field { max-width: 400px; }
  .csv-explanation { grid-template-columns: minmax(0,1fr); gap: 24px; }
}
@media (max-width: 520px) {
  .csv-private { display: none; }
  .csv-intro { padding-block: 20px 24px; }
  .csv-intro > p:not(.csv-eyebrow) { font-size: 16px; }
  .csv-drop { padding: 18px; gap: 12px; }
  .csv-file-icon { width: 40px; height: 48px; }
  .csv-source-title { min-width: 160px; }
  .csv-source-title strong { font-size: 16px; }
  .csv-source-actions.upload-box { width: 100%; }
  [data-csv-repair] .csv-source-actions > button { width: auto; flex: 1 1 auto; padding-inline: 10px; font-size: 13px; }
  [data-csv-repair] .csv-source-actions .csv-example { flex-basis: 100%; }
  .csv-settings { padding: 18px; column-gap: 12px; }
  .csv-field { font-size: 12px; }
  .csv-field select { font-size: 12px; padding-left: 7px; }
  .csv-preview-heading, .csv-diagnosis, .csv-status, .csv-download-bar { padding-inline: 18px; }
  .csv-preview-heading h2 { font-size: 19px; }
  .csv-preview-heading .csv-eyebrow { font-size: 9px; }
  [data-csv-repair] .csv-download-actions .button, [data-csv-repair] .csv-download-actions .tool-button { flex: 1; width: auto; }
  .csv-download-actions .csv-text-button { width: 100%; }
  .csv-source-editor { padding-inline: 18px; }
  .csv-benefits { font-size: 12px; gap: 8px 12px; }
}
