:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #182029;
  --muted: #66717f;
  --line: #d9e0e8;
  --panel: #ffffff;
  --soft: #f4f7fa;
  --accent: #087f83;
  --accent-dark: #066166;
  --warn: #9b5a00;
  --error: #a82d2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f6f2ea 0%, #edf6f4 55%, #f5f8fb 100%);
}

button,
a {
  font: inherit;
}

.app {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 18px;
}

.workspace,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(24, 32, 41, 0.08);
}

.workspace {
  padding: 24px;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.ghost-button,
.primary-button,
.download-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.ghost-button {
  background: #fff;
  color: var(--muted);
}

.primary-button {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover,
.download-button:hover {
  background: var(--accent-dark);
}

.download-button {
  width: 100%;
  border-color: var(--accent);
  background: #0b8f72;
  color: #fff;
  font-weight: 700;
}

button:disabled,
.disabled {
  opacity: 0.48;
  cursor: not-allowed;
  pointer-events: none;
}

.dropzone {
  margin-top: 16px;
  min-height: 230px;
  border: 1.5px dashed #9eb4bf;
  border-radius: 8px;
  background: #f7fbfb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 26px;
  cursor: pointer;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #eef8f6;
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #dcefed;
  color: var(--accent-dark);
  display: inline-grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
}

.dropzone strong {
  font-size: 18px;
}

.dropzone span:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.file-row {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
}

.option-row,
.select-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344453;
  font-size: 14px;
}

.option-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.select-row {
  justify-content: space-between;
}

.select-row select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  max-width: 190px;
}

.label,
.file-row span,
.metrics span,
.preview-head span {
  color: var(--muted);
  font-size: 12px;
}

#fileName {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metrics div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  min-width: 0;
}

.metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.status {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--muted);
  margin-bottom: 14px;
}

.status.success {
  border-color: #94c9b8;
  color: #17664c;
  background: #f2fbf7;
}

.status.error {
  border-color: #e0aaa5;
  color: var(--error);
  background: #fff6f5;
}

.status.warn {
  border-color: #e1c27c;
  color: var(--warn);
  background: #fffaf0;
}

.preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid #edf1f4;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f7f9fb;
  z-index: 1;
  color: #40505e;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    margin-block: 16px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .app {
    width: calc(100vw - 20px);
  }

  .workspace,
  .panel {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
  }
}
