:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #5f6b78;
  --line: #d8dee7;
  --surface: #ffffff;
  --page: #f4f7fb;
  --accent: #006d77;
  --accent-strong: #004f57;
  --warm: #f2a541;
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

.app {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 38px rgba(28, 43, 59, 0.08);
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1.25;
}

h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.source-link {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--warm);
  padding-bottom: 2px;
}

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

.help-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

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

.drop-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
}

.drop-subtitle {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}

.switch input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

button {
  justify-self: start;
  min-width: 160px;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0 22px;
}

button:disabled {
  cursor: progress;
  background: #7f9297;
}

.status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 12px;
  margin-top: 8px;
  accent-color: var(--accent);
}

.schema,
.citation {
  margin-top: 24px;
  padding: 0 4px;
}

.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.columns span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.92rem;
}

.citation {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.citation p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.secondary-button {
  min-width: 140px;
  background: var(--surface);
  color: var(--accent-strong);
  border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 20px, 980px);
    padding: 20px 0;
  }

  .panel {
    padding: 20px;
  }

  .masthead {
    display: grid;
  }

  button {
    width: 100%;
  }

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