*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
}
button, input, select, textarea {
  font: inherit;
}
[hidden] {
  display: none !important;
}

.page {
  --paper: #f6f4ed;
  --card: #fffdf7;
  --ink: #172b26;
  --green: #215844;
  --green-dark: #153f31;
  --alert: #a44925;
  --muted: #465c53;
  --line: #cdd5ca;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.68;
}

.page :is(h1, h2, h3, p, figure) {
  margin: 0;
}

.page :is(h1, h2, h3) {
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  font-weight: 750;
  color: var(--ink);
}

.page .header,
.main,
.page .footer {
  width: min(860px, 100% - 40px);
  margin-inline: auto;
}

.page .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 16px;
  background: transparent;
  color: var(--ink);
  border-bottom: 2px solid var(--green);
}

.headerLeft {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.backLink {
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
}

.header h1 {
  font-size: clamp(20px, 3.6vw, 28px);
}

.progress {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.main {
  padding-block: 24px 64px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 26px);
}

.intro {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.fieldGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.fieldLabel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.fieldLabel input,
.fieldLabel select,
.answerInput {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #9aa9a0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.figureBox {
  display: grid;
  place-items: center;
  min-height: 170px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 12px;
  margin-block: 14px 18px;
}

.figureBox img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.page button,
.buttonSecondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #9aa9a0;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.page .primaryBtn {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.page .primaryBtn:hover {
  background: var(--green-dark);
}

.page button:focus-visible,
.page input:focus-visible,
.page select:focus-visible,
.page a:focus-visible {
  outline: 3px solid var(--alert);
  outline-offset: 3px;
}

.summaryBox {
  background: #eff2ea;
  border-left: 4px solid var(--green);
  padding: 14px 16px;
  border-radius: 4px;
  margin-bottom: 18px;
}

.summaryBox p + p {
  margin-top: 4px;
}

.tableWrap {
  overflow-x: auto;
}

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

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

.resultList {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.resultItem {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
}

.resultSweet {
  border-left: 4px solid var(--green);
}

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

.resultImg {
  display: block;
  max-width: 100%;
  max-height: 76px;
  margin-block: 8px;
}

.okTag {
  color: var(--green);
  font-weight: 700;
}

.errTag {
  color: var(--alert);
  font-weight: 700;
}

.page .footer {
  padding-block: 18px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: transparent;
}

@media (max-width: 700px) {
  .fieldGrid {
    grid-template-columns: 1fr;
  }

  .page .header,
  .main,
  .page .footer {
    width: calc(100% - 28px);
  }
}
