:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --ink: #18212b;
  --muted: #64717f;
  --line: #d8e0e7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #b45309;
  --warn-bg: #fff4d8;
  --bad: #b42318;
  --bad-bg: #fff0ee;
  --good-bg: #e8f7f3;
}

* {
  box-sizing: border-box;
}

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

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto;
}

.workbench {
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 0;
}

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

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
}

h2 {
  font-size: 16px;
}

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

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.drop-card,
.panel,
.summary-band,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.drop-card {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 18px;
  cursor: pointer;
}

.drop-card input {
  width: 100%;
}

.label {
  font-size: 15px;
  font-weight: 800;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.file-name {
  overflow: hidden;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f5f7f9;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  align-self: stretch;
  min-width: 144px;
  padding: 0 20px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: .62;
}

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

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
}

.summary-band strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.download-button {
  min-width: 180px;
  padding: 0 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
}

.panel {
  min-height: 320px;
  overflow: hidden;
}

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

.center-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.center-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfc;
}

.center-item strong {
  font-size: 15px;
}

.center-item span {
  color: var(--muted);
  font-size: 12px;
}

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

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

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

th {
  position: sticky;
  top: 0;
  background: #f6f8fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  z-index: 1;
}

.empty,
.empty-cell {
  color: var(--muted);
  font-size: 13px;
}

.empty-cell {
  padding: 22px;
  text-align: center;
}

.badge {
  display: inline-flex;
  max-width: 220px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--good-bg);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.notice {
  padding: 14px 16px;
  color: var(--bad);
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 20px, 720px);
    margin: 12px auto;
  }

  .topbar,
  .upload-grid,
  .summary-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

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

  table {
    min-width: 640px;
  }
}
