.mystery-inspection {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.mystery-score-hero {
  min-height: 168px;
  border: 1px solid #bbb2a4;
  background: #171717;
  color: #fffdf8;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.mystery-score-hero > div:first-child { max-width: 680px; }
.mystery-score-hero small { font-size: 12px; letter-spacing: .12em; color: #e9c6cb; }
.mystery-score-hero h2 { margin: 8px 0 10px; font: 700 clamp(28px, 4vw, 48px)/1.05 "Songti SC", STSong, SimSun, serif; }
.mystery-score-hero p { margin: 0; color: #d8d2c9; line-height: 1.6; }
.mystery-score-total { min-width: 132px; text-align: right; }
.mystery-score-total span { display: block; color: #d8d2c9; font-size: 13px; }
.mystery-score-total strong { display: inline-block; margin-top: 4px; color: #fff; font: 700 54px/1 Georgia, serif; }
.mystery-score-total small { margin-left: 5px; color: #fff; letter-spacing: 0; }

.mystery-progress {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #ddd6ca;
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(8px);
  font-size: 13px;
}

.mystery-progress > b { height: 7px; overflow: hidden; background: #e8e1d6; }
.mystery-progress i { display: block; width: 0; height: 100%; background: #c8192e; transition: width 180ms ease; }
.mystery-visit-meta { margin: 0; }

.mystery-section-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid #ddd6ca;
  background: #fffdf8;
}

.mystery-section-nav button {
  min-height: 72px;
  border: 0;
  border-right: 1px solid #ddd6ca;
  background: transparent;
  color: #6f6a63;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "code count" "title title";
  gap: 3px 8px;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.mystery-section-nav button:last-child { border-right: 0; }
.mystery-section-nav button span { grid-area: code; color: #c8192e; font-weight: 800; }
.mystery-section-nav button b { grid-area: title; font-size: 13px; line-height: 1.3; }
.mystery-section-nav button small { grid-area: count; justify-self: end; }
.mystery-section-nav button.complete small { color: #177245; }
.mystery-section-nav button.active { color: #171717; background: #f8e8e8; box-shadow: inset 0 -3px #c8192e; }
.mystery-section-nav button:focus-visible,
.mystery-score-options button:focus-visible,
.mystery-photo-picker:focus-within { outline: 3px solid rgba(200, 25, 46, .24); outline-offset: -3px; }

.mystery-section-card { border: 1px solid #bbb2a4; background: #fffdf8; }
.mystery-section-card > header {
  padding: 20px 22px;
  border-bottom: 1px solid #bbb2a4;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.mystery-section-card > header small { color: #c8192e; letter-spacing: .12em; }
.mystery-section-card > header h3 { margin: 4px 0; font: 700 28px/1.15 "Songti SC", STSong, SimSun, serif; }
.mystery-section-card > header p { margin: 0; color: #6f6a63; font-size: 13px; }
.mystery-section-card > header > strong { color: #c8192e; font: 700 34px/1 Georgia, serif; white-space: nowrap; }
.mystery-section-card > header > strong small { color: #6f6a63; letter-spacing: 0; font: 500 13px/1 sans-serif; }

.mystery-score-item { padding: 18px 22px; border-bottom: 1px solid #ddd6ca; transition: background-color 180ms ease; }
.mystery-score-item.scored { background: #fffdfa; }
.mystery-item-copy { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; gap: 14px; }
.mystery-item-copy > span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #c8192e; color: #c8192e; font-weight: 800; }
.mystery-item-copy strong { display: block; margin-bottom: 4px; font-size: 15px; }
.mystery-item-copy p { margin: 0; color: #4f4a44; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.mystery-item-copy em { color: #6f6a63; font-style: normal; font-size: 12px; }
.mystery-score-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px 56px; }
.mystery-score-options button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #bbb2a4;
  background: #fff;
  color: #171717;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.mystery-score-options button:hover { border-color: #c8192e; }
.mystery-score-options button.active { border-color: #c8192e; background: #c8192e; color: #fff; }
.mystery-score-item > label { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; margin-left: 56px; color: #6f6a63; font-size: 12px; }
.mystery-score-item > label input { min-width: 0; min-height: 42px; border: 0; border-bottom: 1px solid #bbb2a4; background: transparent; color: #171717; font-size: 14px; }
.mystery-score-item > label input:focus { outline: 0; border-color: #c8192e; box-shadow: 0 2px rgba(200, 25, 46, .18); }
.mystery-section-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; }
.mystery-section-card > footer span { color: #6f6a63; font-size: 13px; }
.mystery-section-card > footer .btn { display: inline-flex; align-items: center; gap: 8px; }

.mystery-photo-picker { min-height: 64px; border: 1px dashed #bbb2a4; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; background: #fffdf8; }
.mystery-photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mystery-photo-picker svg { width: 20px; height: 20px; }
.mystery-photo-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.mystery-photo-preview figure { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid #ddd6ca; }
.mystery-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.mystery-photo-preview button { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: rgba(23,23,23,.84); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mystery-photo-preview button svg { width: 18px; height: 18px; }
.mystery-submit { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }

.inspection-report-modal-card { width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.inspection-report-modal-card > header,
.inspection-report-modal-card > footer { background: #fffdf8; z-index: 2; }
.inspection-report-modal-card > header button svg { width: 20px; height: 20px; }
.inspection-report-content { overflow: auto; padding: 0 24px 28px; }
.inspection-report-hero { min-height: 178px; margin: 0 -24px 18px; padding: 26px 30px; background: #171717; color: #fffdf8; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.inspection-report-hero small { color: #e9c6cb; letter-spacing: .1em; }
.inspection-report-hero h3 { margin: 7px 0; font: 700 38px/1 "Songti SC", STSong, SimSun, serif; }
.inspection-report-hero p { margin: 0; color: #d8d2c9; }
.inspection-report-hero > strong { color: #fff; font: 700 58px/1 Georgia, serif; }
.inspection-report-hero > strong small { color: #fff; letter-spacing: 0; font-size: 14px; }
.inspection-report-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 18px; border: 1px solid #ddd6ca; }
.inspection-report-facts div { padding: 13px 15px; border-right: 1px solid #ddd6ca; }
.inspection-report-facts div:last-child { border-right: 0; }
.inspection-report-facts dt { color: #6f6a63; font-size: 12px; }
.inspection-report-facts dd { margin: 5px 0 0; font-weight: 700; }
.inspection-report-sections { display: grid; gap: 14px; }
.inspection-report-sections > section { border: 1px solid #ddd6ca; }
.inspection-report-sections > section > header { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd6ca; background: #f7f3eb; }
.inspection-report-sections header div { display: flex; align-items: center; gap: 10px; }
.inspection-report-sections header span { color: #c8192e; font-weight: 800; }
.inspection-report-sections h4 { margin: 0; font: 700 18px/1.2 "Songti SC", STSong, SimSun, serif; }
.inspection-report-sections header > strong { color: #c8192e; }
.inspection-report-sections header > strong small { color: #6f6a63; }
.inspection-report-sections article { display: grid; grid-template-columns: 46px minmax(0, 1fr) 86px; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #eee8df; align-items: start; }
.inspection-report-sections article:last-child { border-bottom: 0; }
.inspection-report-sections article > span { color: #c8192e; font-weight: 800; }
.inspection-report-sections article p { margin: 0; line-height: 1.55; white-space: pre-line; }
.inspection-report-sections article small { display: block; margin-top: 6px; padding-left: 9px; border-left: 2px solid #c8192e; color: #6f6a63; }
.inspection-report-sections article > b { text-align: right; white-space: nowrap; }
.inspection-report-overall { margin-top: 18px; padding: 20px; border: 1px solid #bbb2a4; background: #f7f3eb; }
.inspection-report-overall > small,
.inspection-report-photos > header small { color: #c8192e; letter-spacing: .1em; }
.inspection-report-overall h4,
.inspection-report-photos h4 { margin: 5px 0 10px; font: 700 24px/1.2 "Songti SC", STSong, SimSun, serif; }
.inspection-report-overall p { margin: 0; line-height: 1.75; white-space: pre-line; }
.inspection-report-photos { margin-top: 18px; }
.inspection-report-photos > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.inspection-report-photos button { padding: 0; border: 1px solid #ddd6ca; background: #fff; aspect-ratio: 4 / 3; overflow: hidden; cursor: pointer; }
.inspection-report-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.inspection-report-photos button:hover img { transform: scale(1.025); }

@media (max-width: 980px) {
  .mystery-section-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mystery-section-nav button:nth-child(4n) { border-right: 0; }
  .mystery-section-nav button { border-bottom: 1px solid #ddd6ca; }
  .inspection-report-facts { grid-template-columns: repeat(2, 1fr); }
  .inspection-report-facts div:nth-child(2) { border-right: 0; }
  .inspection-report-facts div:nth-child(-n+2) { border-bottom: 1px solid #ddd6ca; }
}

@media (max-width: 600px) {
  .mystery-score-hero { min-height: 190px; padding: 18px; align-items: stretch; flex-direction: column; }
  .mystery-score-hero h2 { font-size: 32px; }
  .mystery-score-total { align-self: flex-end; }
  .mystery-score-total strong { font-size: 46px; }
  .mystery-progress { grid-template-columns: 1fr; gap: 7px; }
  .mystery-section-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mystery-section-nav button:nth-child(odd) { border-right: 1px solid #ddd6ca; }
  .mystery-section-nav button:nth-child(even) { border-right: 0; }
  .mystery-section-card > header { align-items: start; padding: 16px; }
  .mystery-section-card > header h3 { font-size: 23px; }
  .mystery-section-card > header > strong { font-size: 28px; }
  .mystery-score-item { padding: 16px; }
  .mystery-item-copy { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .mystery-item-copy em { grid-column: 2; }
  .mystery-score-options { margin-left: 48px; }
  .mystery-score-item > label { grid-template-columns: 1fr; margin-left: 48px; gap: 5px; }
  .mystery-section-card > footer { padding: 14px; }
  .mystery-section-card > footer > span { display: none; }
  .mystery-section-card > footer .btn { min-width: 0; padding-inline: 12px; }
  .mystery-photo-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection-report-modal-card { width: 100%; max-width: none; max-height: 100dvh; border-radius: 0; }
  .inspection-report-content { padding: 0 14px 22px; }
  .inspection-report-hero { min-height: 164px; margin: 0 -14px 14px; padding: 20px 18px; }
  .inspection-report-hero h3 { font-size: 30px; }
  .inspection-report-hero > strong { font-size: 44px; }
  .inspection-report-facts { grid-template-columns: 1fr 1fr; }
  .inspection-report-sections article { grid-template-columns: 40px minmax(0, 1fr); padding: 12px; }
  .inspection-report-sections article > b { grid-column: 2; text-align: left; color: #c8192e; }
  .inspection-report-photos > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .mystery-progress i,
  .mystery-section-nav button,
  .mystery-score-options button,
  .inspection-report-photos img { transition: none; }
  .inspection-report-photos button:hover img { transform: none; }
}
