:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #202938;
  --muted: #66758a;
  --line: #d8e0ea;
  --blue: #1d4ed8;
  --blue-soft: #eaf1ff;
  --green: #087f5b;
  --orange: #b86416;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --shadow: 0 10px 24px rgba(32, 41, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  line-height: 1.35;
}

.topbar__meta {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  min-width: 0;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel--wide {
  grid-column: 1 / -1;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.section-heading--split {
  justify-content: space-between;
}

.section-heading--split > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading--split p {
  color: var(--muted);
  font-size: 14px;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.upload-form {
  display: grid;
  gap: 14px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  border: 2px dashed #8aa0bb;
  border-radius: 8px;
  background: #fbfcfe;
  cursor: pointer;
  text-align: center;
}

.dropzone:hover {
  border-color: var(--blue);
  background: #f2f7ff;
}

.dropzone__icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.dropzone__main {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.dropzone__sub {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.file-input {
  display: none;
}

.selected-file {
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sample-form {
  margin-top: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  background: var(--blue);
  color: #fff;
}

.button--secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button:focus-visible,
input:focus-visible,
.dropzone:focus-within {
  outline: 3px solid #9cc2ff;
  outline-offset: 2px;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #ffd2cc;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
}

.status-list,
.idle-list {
  margin: 0;
  padding: 0;
}

.status-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.status-list div:last-child {
  border-bottom: 0;
}

.status-list dt {
  color: var(--muted);
  font-weight: 700;
}

.status-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.idle-list {
  list-style: none;
}

.idle-list li {
  position: relative;
  padding: 10px 0 10px 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.idle-list li::before {
  position: absolute;
  left: 0;
  color: var(--green);
  content: "✓";
  font-weight: 900;
}

.idle-list li:last-child {
  border-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf2f7;
  color: #1f2937;
  font-weight: 900;
}

td {
  overflow-wrap: anywhere;
}

tbody tr:last-child td {
  border-bottom: 0;
}

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

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-bar p {
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .topbar,
  .result-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 20px;
  }

  .topbar__meta {
    text-align: left;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .panel {
    padding: 18px;
  }

  .status-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .download-actions,
  .download-actions .button {
    width: 100%;
  }
}
