:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #d8dde3;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --error: #b91c1c;
  --ok: #166534;
  --shadow: 0 16px 40px rgba(31, 41, 51, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Yu Gothic UI",
    "Meiryo",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.08;
  font-weight: 800;
}

.status-pill {
  min-width: 92px;
  border: 1px solid #9fd2b1;
  border-radius: 999px;
  background: #f0f9f2;
  color: var(--ok);
  padding: 8px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 18px;
}

.upload-panel,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel {
  padding: 18px;
}

.file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.drop-zone {
  width: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 2px dashed #a7b0bb;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: #f0fdfa;
  transform: translateY(-1px);
}

.drop-title {
  font-size: 24px;
  font-weight: 800;
}

.drop-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

button,
.download {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary {
  border-color: var(--line);
  background: #243447;
  color: #ffffff;
}

.ghost {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.selected {
  margin-top: 18px;
}

.section-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.file-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fbfcfd;
  min-width: 0;
}

.file-name {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.file-size {
  color: var(--muted);
  font-size: 12px;
}

.remove-file {
  min-height: 32px;
  padding: 0 10px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.empty {
  color: var(--muted);
}

.result-panel {
  min-height: 520px;
  padding: 18px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.run-status {
  margin: 5px 0 0;
  color: var(--muted);
}

.zip-link {
  border-color: #bfd7d5;
  background: #f0fdfa;
  color: var(--accent-strong);
}

.result-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

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

.result-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  background: #fafafa;
  border-bottom: 1px solid var(--line);
}

.result-file {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.badge.ok {
  color: var(--ok);
  background: #ecfdf3;
}

.badge.error {
  color: var(--error);
  background: #fff1f2;
}

.output-table {
  width: 100%;
  border-collapse: collapse;
}

.output-table th,
.output-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.output-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: #ffffff;
}

.output-table tr:last-child td {
  border-bottom: 0;
}

.number {
  font-variant-numeric: tabular-nums;
}

.download {
  min-height: 34px;
  border-radius: 7px;
  background: #243447;
  color: #ffffff;
  padding: 0 12px;
}

.error-message {
  margin: 0;
  padding: 14px;
  color: var(--error);
  font-weight: 700;
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 24px, 720px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

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

  .result-head,
  .result-title {
    flex-direction: column;
  }

  .output-table,
  .output-table thead,
  .output-table tbody,
  .output-table th,
  .output-table td,
  .output-table tr {
    display: block;
  }

  .output-table thead {
    display: none;
  }

  .output-table tr {
    border-bottom: 1px solid var(--line);
    padding: 9px 0;
  }

  .output-table tr:last-child {
    border-bottom: 0;
  }

  .output-table td {
    border-bottom: 0;
    padding: 5px 14px;
  }
}
