:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-muted: #f7f9fb;
  --text: #17202a;
  --muted: #637083;
  --line: #d6dee8;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --warn: #9a3412;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(25, 37, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
}

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

.tool-panel,
.summary-grid article,
.table-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: 22px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.file-field {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
}

.file-field span {
  font-size: 14px;
  font-weight: 700;
}

.file-field input {
  width: 100%;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

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

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.primary-button,
.download-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

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

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

.primary-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.download-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.download-button.disabled {
  pointer-events: none;
  color: var(--muted);
  background: #eef2f6;
}

.message {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.message.error {
  color: var(--danger);
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.summary-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-grid strong {
  font-size: 26px;
  line-height: 1;
}

.table-section {
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  font-size: 18px;
}

.section-title span {
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

.empty-cell {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 18px;
  }

  .page-header,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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