:root {
  --orange: #f49a00;
  --cream: #fff1d8;
  --ink: #2c231b;
  --line: #4d3b2c;
  --panel: #ffffff;
  --error: #8a2432;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  padding: 12px 0;
  color: var(--ink);
  background: #fffaf1;
  font-family: "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0;
  place-items: center;
}

.result-page {
  width: min(1180px, calc(100% - 36px));
  min-height: calc(100vh - 24px);
  margin: 0 auto;
  padding: 38px 30px 26px;
  background:
    linear-gradient(to bottom, var(--orange) 0 106px, var(--cream) 106px);
  border: 3px solid var(--line);
  box-shadow: 0 18px 36px rgba(76, 54, 28, 0.2);
}

.result-box {
  margin-top: 34px;
  overflow: hidden;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 rgba(77, 59, 44, 0.15);
}

.box-title {
  padding: 9px 16px;
  color: var(--ink);
  background: #fff7e8;
  border-bottom: 3px solid var(--line);
  font-size: 16px;
  font-weight: 900;
}

.result-content {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 22px;
}

.photo-area {
  min-width: 0;
}

.photo-frame {
  position: relative;
  width: 100%;
  height: min(470px, calc(100vh - 205px));
  min-height: 330px;
  max-height: 470px;
  overflow: hidden;
  background: #fffaf1;
  border: 3px solid var(--line);
}

.result-photo {
  display: block;
  max-width: 100%;
  width: 100%;
  max-height: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-error {
  position: absolute;
  inset: 0;
  display: none;
  padding: 18px;
  align-content: center;
  justify-items: center;
  background: #fff8ed;
  color: #6f4b15;
  text-align: center;
}

.photo-error strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 15px;
}

.photo-error span {
  display: block;
  font-size: 12px;
}

.information-area {
  min-width: 0;
}

.information-label {
  margin: 0 0 3px;
  color: #8b6124;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.result-name {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(28px, 2.8vw, 38px);
  font-weight: 700;
  line-height: 1.3;
}

.details {
  margin: 0;
  padding: 0;
  border-top: 2px solid rgba(77, 59, 44, 0.28);
}

.detail-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-bottom: 2px solid rgba(77, 59, 44, 0.28);
}

.detail-row dt,
.detail-row dd {
  margin: 0;
  padding: 7px 12px;
}

.detail-row dt {
  display: flex;
  align-items: center;
  background: #fff8ed;
  color: #6f4b15;
  font-size: 13px;
  font-weight: 900;
}

.detail-row dd {
  min-width: 0;
  color: #3a2d22;
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: left;
}

.comment-cell {
  display: block;
  line-height: 1.65;
  text-align: left !important;
  white-space: normal;
}

.result-actions {
  margin-top: 14px;
}

.search-back-button,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 34px;
  padding: 6px 20px;
  color: var(--ink);
  background: #fff7e8;
  border: 2px solid var(--line);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.search-back-button:hover,
.back-button:hover {
  background: #ffe0a3;
}

.error-page {
  display: grid;
  min-height: 100vh;
  padding: 25px;
  place-items: center;
  background: #fffaf1;
}

.error-box {
  width: min(100%, 650px);
  overflow: hidden;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 rgba(77, 59, 44, 0.15);
}

.error-content {
  padding: 50px 25px;
  text-align: center;
}

.error-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fff1d8;
  color: var(--error);
  font-size: 29px;
  font-weight: 900;
  place-items: center;
}

.error-content h1 {
  margin: 0 0 15px;
  color: var(--ink);
  font-size: 23px;
}

.error-content p {
  margin: 0 0 25px;
  color: #6f4b15;
}

@media (max-width: 650px) {
  body {
    display: block;
    padding: 0;
  }

  .result-page {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 36px 14px 24px;
    border-right: 0;
    border-left: 0;
  }

  .result-content {
    display: block;
    padding: 18px;
  }

  .photo-area {
    max-width: 290px;
    margin: 0 auto 22px;
  }

  .detail-row {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .detail-row dt,
  .detail-row dd {
    padding: 11px 10px;
  }

  .search-back-button,
  .back-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .result-content {
    padding: 13px;
  }

  .detail-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .detail-row dd {
    font-size: 14px;
  }

  .error-page {
    padding: 12px;
  }

  .error-content {
    padding: 38px 18px;
  }

  .error-content h1 {
    font-size: 20px;
  }
}
