:root {
  color-scheme: light;
  --report-ink: #173b35;
  --report-muted: #60766c;
  --report-line: #d7e1d7;
  --report-paper: #fffefa;
  --report-green: #176452;
  --report-green-soft: #e8f2ea;
  --report-coral: #d56a49;
  --report-warm: #fbf1e5;
  --report-red: #a64b37;
}

* { box-sizing: border-box; }

html { background: #f2f5ee; }

body {
  margin: 0;
  color: var(--report-ink);
  background: #f2f5ee;
  font: 16px/1.58 "Instrument Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-wrap: anywhere;
}

a { color: var(--report-green); text-underline-offset: 3px; }
button, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--report-coral);
  outline-offset: 3px;
}

#report {
  width: min(100% - 64px, 1080px);
  margin: 0 auto;
  padding-bottom: 56px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  border-bottom: 1px solid var(--report-line);
}

.top a {
  color: var(--report-ink);
  text-decoration: none;
  font-size: 14px;
}

.top a:first-child { font-weight: 740; }
.top a:last-child { color: var(--report-muted); }

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 16px 0 8px;
}

.report-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--report-line);
  border-radius: 6px;
  background: var(--report-paper);
  padding: 8px 13px;
  color: var(--report-green);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.report-action:hover { border-color: #9eb9a8; background: #f8fbf6; }
.report-action.primary { border-color: var(--report-green); background: var(--report-green); color: #fff; }
.report-action.primary:hover { background: #105243; }
.report-action.secondary { border-color: var(--report-line); background: transparent; }
.report-action.delete { border-color: #e8c7bd; background: #fff8f4; color: var(--report-red); }
.report-action.delete:hover { border-color: #cf9e90; background: #fff0e9; }
.report-action:disabled { opacity: .6; cursor: wait; }

.report-actions .delete { margin-left: auto; }
.preview-note { color: #80552c; font-size: 13px; }
.help, .report-help { margin: 5px 0 10px; color: var(--report-muted); font-size: 13px; }

.report-content { padding-top: 18px; }
.report-title {
  max-width: 800px;
  margin: 0 0 12px;
  color: var(--report-ink);
  font-size: 30px;
  font-weight: 760;
  line-height: 1.25;
}

.report-demo-note {
  margin: 0 0 12px;
  color: var(--report-muted);
  font-size: 13px;
}

.report-overview {
  margin-bottom: 24px;
  border-top: 1px solid var(--report-line);
  border-bottom: 1px solid var(--report-line);
  padding: 14px 0;
}

.overview-summary {
  margin: 0 0 9px;
  color: var(--report-green);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.overview-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 21px;
}

.overview-fields > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  font-size: 13px;
}

.overview-fields span { color: var(--report-muted); }
.overview-fields strong { font-weight: 650; }

.report-section {
  margin: 27px 0 0;
  scroll-margin-top: 20px;
}

.report-section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--report-ink);
  font-size: 21px;
  font-weight: 740;
  line-height: 1.35;
}

.report-section > h2::before {
  width: 4px;
  height: 19px;
  flex: 0 0 4px;
  border-radius: 2px;
  background: var(--report-coral);
  content: "";
}

.photo-group-card,
.issue-unpictured-card,
.action-card {
  min-width: 0;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--report-line);
  border-radius: 7px;
  background: var(--report-paper);
  box-shadow: 0 2px 6px rgb(28 57 44 / 4%);
}

.photo-group-title {
  margin: 0;
  padding: 13px 16px;
  color: var(--report-ink);
  font-size: 17px;
  font-weight: 730;
  line-height: 1.4;
}

.photo-group-card .photo-group-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.issue-unpictured-card { padding: 14px 16px; }
.issue-unpictured-card h3 { margin: 8px 0; color: var(--report-ink); font-size: 17px; }
.issue-unpictured-card p { margin: 7px 0; color: #40594d; }

.finding-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.risk-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border-radius: 4px;
  padding: 3px 7px;
  background: #eaf1ea;
  color: #466654;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.risk-high { background: #fbeae2; color: #983f2c; }
.risk-medium { background: #fbefd8; color: #7a5725; }
.risk-low { background: #eaf1ea; color: #466654; }
.risk-pending, .risk-confirm { background: #eceff2; color: #4e6370; }
.risk-level { color: var(--report-muted); font-size: 13px; font-weight: 650; }

.photo-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 176px), 1fr));
  align-items: start;
  gap: 8px;
  margin: 0 16px;
}

.issue-photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid #e5ebe3;
  border-radius: 5px;
  background: #edf1eb;
}

.photo-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.photo-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 390px;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 1px #fff);
}

.issue-photo figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  border-top: 1px solid #e5ebe3;
  background: #f8faf6;
  padding: 6px 9px;
  color: var(--report-muted);
  font-size: 12px;
}

.issue-photo figcaption span { color: var(--report-ink); font-weight: 670; }
.annotated-photo { border-color: #dfbf83; }
.annotation-note { color: var(--report-muted); }
.annotation-status { margin: 0 0 9px; color: var(--report-muted); font-size: 13px; }
.annotation-status.failed { color: #8b5035; }

.photo-findings {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px 16px 15px;
  list-style: none;
}

.photo-finding {
  display: grid;
  gap: 4px 9px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  border-top: 1px solid #e8ece6;
  padding-top: 10px;
}

.photo-finding:first-child { border-top: 0; padding-top: 0; }
.photo-finding .finding-labels { grid-row: span 2; }
.photo-finding > strong { color: var(--report-ink); font-size: 14px; }
.photo-finding > p { grid-column: 2; margin: 0; color: #40594d; font-size: 13px; }

.photo-unavailable {
  display: grid;
  align-content: center;
  min-height: 66px;
  border: 1px dashed #bbc9bd;
  border-radius: 5px;
  padding: 8px 10px;
  color: var(--report-muted);
  font-size: 13px;
}

.photo-unavailable strong { color: var(--report-ink); }
.issue-no-photo { margin: 0 16px; color: var(--report-muted); font-size: 13px; }

.action-card { padding: 14px 16px; }
.action-card header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; margin-bottom: 9px; }
.action-card header span { color: var(--report-muted); font-size: 13px; font-weight: 650; }
.action-card h3 { margin: 0; color: var(--report-ink); font-size: 17px; line-height: 1.4; }
.action-card p { margin: 8px 0 0; color: #40594d; font-size: 14px; }
.action-card p strong { display: block; margin-bottom: 2px; color: var(--report-ink); font-size: 13px; }
.action-card .action-now { border-left: 3px solid #72a48a; border-radius: 0 4px 4px 0; background: var(--report-green-soft); padding: 9px 10px; font-size: 15px; }
.action-card .action-followup { border-left: 3px solid #d7a75e; border-radius: 0 4px 4px 0; background: var(--report-warm); padding: 8px 10px; }
.action-card .action-check { border-top: 1px solid #e8ece6; padding-top: 8px; }

.action-steps { margin: 7px 0 0; padding-left: 1.35em; color: #40594d; }
.action-steps li { margin: 5px 0; padding-left: 2px; }
.coverage-note, .report-disclaimer, .report-service { border-top: 1px solid var(--report-line); padding-top: 15px; }
.coverage-note ul { margin: 0; padding-left: 1.35em; }
.coverage-note li { margin-bottom: 4px; }
.coverage-note, .report-disclaimer, .coverage-clear, .empty-state, .quote-note { color: #41594d; font-size: 14px; }
.coverage-clear, .empty-state, .quote-note, .report-disclaimer p { margin: 0 0 8px; }
.quote-note { border-left: 3px solid #79a18b; border-radius: 0 5px 5px 0; background: #eef5ed; padding: 10px 12px; }
.report-references { color: var(--report-muted); font-size: 13px; }
.report-references summary { width: fit-content; cursor: pointer; color: var(--report-green); font-weight: 650; }
.report-references ul { margin: 7px 0; padding-left: 1.3em; }
.report-references li { margin: 4px 0; }

.report-service { margin-top: 32px; }

#feedback label {
  display: block;
  max-width: 720px;
  margin: 0 0 10px;
  color: var(--report-ink);
  font-size: 14px;
  font-weight: 650;
}

#feedback textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  margin-top: 7px;
  border: 1px solid #b8c8bb;
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  color: var(--report-ink);
  resize: vertical;
}

#feedback .report-action { min-width: 112px; }
#message { min-height: 1.5em; margin: 10px 0 0; color: var(--report-muted); font-size: 14px; }

@media (min-width: 761px) {
  .report-section:has(> .photo-group-card),
  .report-section:has(> .issue-unpictured-card),
  .report-section:has(> .action-card) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px 16px;
  }

  .report-section > .photo-group-card, .report-section > .issue-unpictured-card,
  .report-section > .action-card { margin-bottom: 0; }
  .report-section:has(> .photo-group-card) > h2,
  .report-section:has(> .issue-unpictured-card) > h2,
  .report-section:has(> .action-card) > h2 { margin-bottom: 0; }
  .report-section > h2, .coverage-clear, .quote-note { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  #report { width: min(100% - 36px, 620px); padding-bottom: 38px; }
  .top { min-height: 60px; }
  .report-actions { gap: 7px; padding-top: 13px; }
  .report-action { min-height: 42px; padding: 8px 10px; }
  .report-content { padding-top: 15px; }
  .report-title { margin-bottom: 10px; font-size: 26px; }
  .report-overview { margin-bottom: 21px; }
  .report-section { margin-top: 23px; }
  .report-section > h2 { font-size: 19px; }
  .report-section:has(> .photo-group-card),
  .report-section:has(> .issue-unpictured-card),
  .report-section:has(> .action-card) { grid-template-columns: minmax(0, 1fr); }
  .photo-group-title { padding: 11px 13px; }
  .photo-comparison { margin-inline: 13px; }
  .photo-findings { padding: 11px 13px 13px; }
  .issue-no-photo { margin-inline: 13px; }
  .issue-unpictured-card { padding: 12px 13px; }
  .action-card { padding: 12px 13px; }
}

@media (max-width: 430px) {
  #report { width: min(100% - 28px, 620px); }
  .top { gap: 9px; }
  .top a { font-size: 13px; }
  .report-actions { align-items: stretch; }
  .report-actions .report-action { min-width: 0; flex: 1 1 calc(50% - 7px); text-align: center; }
  .report-actions .delete { flex-basis: 100%; margin-left: 0; }
  .overview-fields { gap: 5px 11px; }
  .photo-group-title { font-size: 16px; }
  .action-card h3 { font-size: 16px; }
  .photo-comparison { grid-template-columns: minmax(0, 1fr); }
  .photo-frame img { max-height: 350px; }
}
