:root {
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(0.975 0.006 260);
  --surface-strong: oklch(0.945 0.012 260);
  --ink: oklch(0.22 0.025 260);
  --muted: oklch(0.46 0.03 260);
  --line: oklch(0.86 0.018 260);
  --primary: oklch(0.49 0.18 355);
  --primary-hover: oklch(0.43 0.18 355);
  --primary-soft: oklch(0.95 0.035 355);
  --accent: oklch(0.57 0.12 185);
  --accent-soft: oklch(0.94 0.04 185);
  --warning: oklch(0.66 0.13 72);
  --warning-soft: oklch(0.96 0.05 72);
  --danger: oklch(0.55 0.18 24);
  --danger-soft: oklch(0.95 0.04 24);
  --shadow: 0 8px 24px oklch(0.25 0.025 260 / 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--surface) 0, var(--bg) 360px);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-label {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  max-width: 680px;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
}

.subhead {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

.preserve-note {
  display: grid;
  gap: 4px;
  min-width: 280px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.preserve-note strong {
  color: var(--accent);
  font-size: 14px;
}

.preserve-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.upload-panel,
.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.upload-panel {
  padding: 18px;
}

.status-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 244px;
  place-items: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-main,
.dropzone-sub,
.dropzone-action {
  pointer-events: none;
}

.dropzone-main {
  font-size: 22px;
  font-weight: 760;
  line-height: 1.2;
}

.dropzone-sub {
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dropzone-action {
  margin-top: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--primary);
  font-size: 14px;
  font-weight: 740;
}

.file-board {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.file-board-header span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.file-list {
  display: grid;
  gap: 0;
  min-height: 52px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list:empty::before {
  content: "No files selected yet.";
  padding: 16px 14px;
  color: var(--muted);
  font-size: 14px;
}

.file-chip {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.file-chip:first-child {
  border-top: 0;
}

.file-type {
  justify-self: start;
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 760;
}

.file-type-workbook {
  background: var(--primary);
  color: var(--bg);
}

.file-type-csv {
  background: var(--accent);
  color: var(--bg);
}

.file-type-unsupported {
  background: var(--danger);
  color: var(--bg);
}

.file-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 13px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--bg);
  font-weight: 760;
  padding: 0 18px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

button:hover {
  background: var(--primary-hover);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

button:focus-visible,
.dropzone:focus-within {
  outline: 3px solid oklch(0.8 0.11 185 / 0.45);
  outline-offset: 3px;
}

.action-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.result {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.result strong {
  font-size: 15px;
}

.result span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
}

.result-ready,
.result-success {
  border-color: oklch(0.78 0.08 185);
  background: var(--accent-soft);
}

.result-warning,
.result-processing {
  border-color: oklch(0.81 0.11 72);
  background: var(--warning-soft);
}

.result-error {
  border-color: oklch(0.78 0.11 24);
  background: var(--danger-soft);
}

.trust-list {
  display: grid;
  gap: 12px;
}

.trust-list div {
  display: grid;
  gap: 3px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.trust-list strong {
  font-size: 13px;
}

.trust-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 820px) {
  .shell {
    padding: 28px 0;
  }

  .page-header {
    display: grid;
    align-items: start;
  }

  .preserve-note {
    min-width: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .action-row {
    display: grid;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1080px);
  }

  h1 {
    font-size: 30px;
  }

  .upload-panel,
  .status-panel {
    padding: 12px;
  }

  .dropzone {
    min-height: 210px;
    padding: 22px 16px;
  }

  .file-chip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .file-type {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
