/* One-time Excel import. Orange stays on var(--mark); this sheet adds none. */

.excel-import.card {
  width: 100%;
  max-width: 60rem;
  min-width: 0;
  overflow: hidden;
}

.excel-import h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.excel-import h3 {
  margin: 18px 0 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.excel-import .quiet {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.excel-drop {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r-12);
  min-width: 0;
}

.excel-drop-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.excel-choose {
  display: inline-block;
  margin: 0;
  padding: 6px 11px;
  background: var(--ink);
  color: var(--chip);
  border: 0;
  border-radius: var(--r-10);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.excel-drop.is-locked .excel-choose {
  opacity: 0.6;
  cursor: default;
}

.excel-status {
  margin-top: 8px;
}

.excel-meta {
  margin: 14px 0 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.excel-scroll {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.excel-scroll table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.excel-scroll th,
.excel-scroll td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.excel-scroll th {
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
}

.excel-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.excel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.excel-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.excel-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  cursor: pointer;
}

.excel-sheets {
  margin-top: 4px;
}

.excel-note {
  margin-top: 4px;
}

.excel-confirm {
  margin: 12px 0 0;
}

.excel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.excel-import button.ghost {
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: var(--r-10);
}

.excel-result {
  margin: 14px 0 0;
}

.excel-failed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
}

.excel-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
}

.excel-pill-ok {
  background: var(--free-bg);
  color: var(--free-ink);
}

.excel-pill-bad {
  background: var(--sold-bg);
  color: var(--sold-ink);
}

.excel-notice {
  margin-top: 12px;
}

.excel-backups {
  margin-top: 16px;
}

.excel-backup-schedule {
  margin-top: 8px;
}

.excel-backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  min-width: 0;
}

.excel-backup-last {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.excel-backup-make {
  flex: 0 0 auto;
}

.excel-backup-file {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.excel-backup-meta {
  display: none;
}

.excel-backup-more {
  margin-top: 8px;
}

@media (max-width: 700px) {
  .excel-drop-row,
  .excel-actions,
  .excel-backup-row {
    flex-direction: column;
    align-items: stretch;
  }
  .excel-choose,
  .excel-actions .primary,
  .excel-actions .ghost,
  .excel-backup-make {
    width: 100%;
    text-align: center;
  }
  .excel-backups .excel-scroll {
    overflow-x: hidden;
  }
  .excel-backups .excel-scroll table {
    width: 100%;
    min-width: 0;
  }
  .excel-backups .excel-scroll th,
  .excel-backups .excel-scroll td {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .excel-backups thead,
  .excel-backup-date,
  .excel-backup-size,
  .excel-backup-rows,
  .excel-backup-by {
    display: none;
  }
  .excel-backups tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .excel-backup-meta {
    display: block;
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
  }
  .excel-scroll:has(#excel-runs) {
    overflow-x: hidden;
  }
  #excel-runs {
    width: 100%;
    min-width: 0;
  }
  #excel-runs thead { display: none; }
  #excel-runs tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  #excel-runs tbody tr::after { content: ""; order: 2; flex: 0 0 100%; height: 0; }
  #excel-runs td {
    border: 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #excel-runs td:nth-child(1) {
    order: 1;
    flex: 1 1 auto;
  }
  #excel-runs td:nth-child(3) {
    order: 2;
    flex: 0 0 auto;
  }
  #excel-runs td:nth-child(2) {
    order: 3;
    flex: 0 0 auto;
  }
  #excel-runs td:nth-child(2)::after { content: "·"; padding-inline: 4px; }
  #excel-runs td:nth-child(4) {
    order: 4;
    flex: 1 1 auto;
    min-width: 0;
  }
  #excel-runs td:nth-child(n + 5) {
    order: 5;
    flex: 0 1 auto;
    font-variant-numeric: tabular-nums;
  }
  #excel-runs td:nth-child(n + 5)::before {
    content: attr(data-label) " ";
    color: var(--muted);
  }
  #excel-runs td:nth-child(n + 5):not(:last-child)::after { content: "·"; padding-inline: 4px; }
}
