:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --line: #cbd5e1;
  --line-strong: #94a3b8;
  --text: #172033;
  --muted: #5b6678;
  --primary: #1f6feb;
  --primary-dark: #174ea6;
  --success-bg: #e7f7ed;
  --success-text: #146c43;
  --warn-bg: #fff4d8;
  --warn-text: #8a5a00;
  --error-bg: #fde8e8;
  --error-text: #a12020;
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.18;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.privacy-note {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
  padding-top: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.step-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.drop-zone {
  display: grid;
  min-height: 220px;
  place-items: center;
  gap: 8px;
  padding: 28px;
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.drop-zone:hover,
.drop-zone:focus-within,
.drop-zone.is-dragging {
  border-color: var(--primary);
  background: #eef5ff;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-icon {
  display: inline-grid;
  width: 72px;
  height: 48px;
  place-items: center;
  border: 1px solid #b7c7dc;
  border-radius: 6px;
  color: var(--primary-dark);
  font-weight: 800;
  background: #ffffff;
}

.drop-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.drop-sub {
  max-width: 100%;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.field-row {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field-row label {
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

select:focus,
button:focus-visible,
a:focus-visible,
.drop-zone:focus-within {
  outline: 3px solid rgba(31, 111, 235, 0.28);
  outline-offset: 2px;
}

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

.primary-button {
  width: 100%;
  margin-top: 18px;
  border: 0;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

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

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

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: #ffffff;
}

.link-button {
  width: auto;
  margin-top: 0;
}

.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.mini-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.86rem;
  background: #ffffff;
}

.storage-policy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.result-policy {
  margin-bottom: 18px;
}

.alert {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 14px 16px;
}

.alert span {
  overflow-wrap: anywhere;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.alert-warning {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.summary-grid div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

dd {
  margin: 6px 0 0;
  font-size: 1.08rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.issue-box {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

th {
  background: #f1f5f9;
  color: var(--muted);
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.empty-mark {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 640px);
    padding-top: 18px;
  }

  .page-heading {
    display: block;
  }

  .privacy-note {
    margin-top: 10px;
    text-align: left;
  }

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

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 1.55rem;
  }

  .panel {
    padding: 16px;
  }

  .drop-zone {
    min-height: 190px;
    padding: 20px;
  }

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

  .download-row > * {
    width: 100%;
  }
}
