:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #20231f;
  --muted: #646b60;
  --line: #d6dccf;
  --surface: #ffffff;
  --accent: #2f6f58;
  --accent-strong: #205542;
  --warn: #a96516;
  --bad: #a53b36;
  --good-bg: #e9f4ed;
  --warn-bg: #fff3df;
  --bad-bg: #fae8e6;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  min-height: 86px;
  padding: 18px clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: clamp(22px, 3vw, 32px);
}

h2 {
  font-size: 18px;
}

.status-pill {
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  background: #f9faf7;
}

.layout {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 48px;
  display: grid;
  gap: 16px;
}

.band {
  width: 100%;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.panel {
  min-width: 0;
}

.panel-head,
.validation-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.step {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 3px solid var(--line);
}

.step span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #eef1ea;
}

.step.active {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.upload-zone {
  display: grid;
  gap: 12px;
}

.upload-zone p {
  margin: 0;
  color: var(--muted);
}

.drop-zone {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 2px dashed #aeb8a7;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcf8;
  font-weight: 700;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: var(--good-bg);
  color: var(--accent-strong);
}

button,
.download {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

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

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

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

.secondary,
.ghost,
.download {
  color: var(--accent-strong);
  background: #eef4ef;
  border-color: #bfd0c3;
}

.ghost {
  min-height: 34px;
  padding: 6px 10px;
}

.large {
  width: min(100%, 280px);
}

.file-list,
.messages,
.result,
.summary,
.mapping {
  display: grid;
  gap: 8px;
}

.file-chip,
.message,
.readback {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.message.blocker {
  border-color: #e4b5b1;
  background: var(--bad-bg);
  color: var(--bad);
}

.message.warn {
  border-color: #edcf9e;
  background: var(--warn-bg);
  color: var(--warn);
}

.message.ok {
  border-color: #b8d7c2;
  background: var(--good-bg);
  color: var(--accent-strong);
}

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

.form-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  background: white;
  color: var(--ink);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

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

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

.actions {
  min-width: 260px;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.result {
  margin-top: 14px;
}

@media (max-width: 820px) {
  .topbar,
  .panel-head,
  .validation-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .two-column,
  .step-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    width: min(100% - 16px, 1180px);
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
