:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #23332b;
  background: #f3f6f1;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
.shell { max-width: 860px; padding: 20px 16px 48px; margin: auto; }
.hero { padding: 20px 4px 10px; }
.eyebrow { color: #3b7955; font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 6px 0; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.05; color: #214b35; }
h2 { margin: 0; font-size: 1.22rem; }
h3 { margin-bottom: 4px; }
.intro { max-width: 650px; line-height: 1.6; color: #53645a; }
.notice { padding: 12px 14px; border-left: 4px solid #d59b28; border-radius: 8px; background: #fff8e7; line-height: 1.5; font-size: .92rem; }
.panel { margin-top: 16px; padding: 20px; border: 1px solid #dfe7df; border-radius: 16px; background: white; box-shadow: 0 5px 18px #23332b0b; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-heading p { margin: 4px 0 0; color: #65756a; line-height: 1.45; }
.step { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: white; background: #32734d; font-weight: 800; }
.camera-frame { position: relative; overflow: hidden; min-height: 240px; aspect-ratio: 4 / 3; border-radius: 12px; background: #18221b; }
video { display: block; width: 100%; height: 100%; min-height: 240px; object-fit: cover; }
.guide { position: absolute; inset: 14% 21%; border: 2px dashed #fff9; border-radius: 48% 48% 43% 43%; pointer-events: none; box-shadow: 0 0 0 999px #0002; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button { min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.primary { color: white; background: #286541; }
.secondary { color: #24543a; border-color: #aac4b2; background: #f4faf5; }
.text-button { color: #53645a; background: transparent; }
.upload-panel { margin-top: 16px; }
.upload-panel > .help { margin: 0 0 12px; }
.upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.upload-grid label { display: grid; gap: 7px; color: #32473a; font-size: .9rem; font-weight: 650; }
.photo-upload { width: 100%; min-width: 0; min-height: 44px; padding: 7px; border: 1px solid #cbd7cd; border-radius: 9px; color: #53645a; background: #fff; font: inherit; font-size: .8rem; font-weight: 400; }
.photo-upload::file-selector-button { max-width: 100%; min-height: 28px; margin-right: 6px; padding: 4px 7px; border: 1px solid #aac4b2; border-radius: 6px; color: #24543a; background: #f4faf5; font: inherit; cursor: pointer; }
.image-result { margin-top: 12px; color: #5c6e61; font-size: .92rem; line-height: 1.5; }
.image-result p { margin: 4px 0; }
.photo-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-shot { min-width: 0; margin: 0; }
.photo-shot img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.photo-shot figcaption { padding-top: 4px; color: #53645a; font-size: .82rem; }
.status { min-height: 1.3em; margin: 8px 0 0; color: #385e46; font-size: .92rem; }
.help { color: #64746a; font-size: .84rem; line-height: 1.5; }
code { padding: 1px 5px; border-radius: 4px; background: #eff3ef; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.grid > label, .feedback label { display: grid; align-content: start; gap: 7px; color: #32473a; font-size: .94rem; font-weight: 650; }
.grid > label { grid-template-rows: 42px 44px auto; }
.photo-feature { display: grid; gap: 4px; color: #32473a; font-size: .94rem; font-weight: 650; }
.photo-feature .status { margin-top: 0; font-weight: 400; }
.field-title { align-self: end; }
select { width: 100%; height: 44px; padding: 8px 10px; border: 1px solid #cbd7cd; border-radius: 9px; color: #26392d; background: #fff; font: inherit; font-weight: 400; }
fieldset { min-width: 0; padding: 12px; border: 1px solid #d8e1d9; border-radius: 10px; }
legend { padding: 0 5px; font-weight: 700; }
legend span { color: #69796e; font-size: .85rem; font-weight: 400; }
.full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: #32734d; }
fieldset small { display: block; margin-top: 10px; color: #69796e; }
.analyze-button { width: 100%; margin-top: 18px; }
.result-card { margin: 12px 0; padding: 15px; border: 1px solid #dce5dd; border-radius: 12px; background: #fbfdfb; }
.result-card.top { border-color: #79a888; background: #f4faf5; }
.result-title { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.result-title h3 { margin: 0; font-size: 1.05rem; }
.result-badge { white-space: nowrap; color: #286541; font-size: .82rem; font-weight: 800; }
.result-card.tentative { border-color: #dfc67a; background: #fffaf0; }
.no-prediction { padding: 14px; border-radius: 10px; color: #725b22; background: #fff8e7; line-height: 1.5; }
.result-card p { margin: 7px 0; color: #53645a; font-size: .91rem; line-height: 1.45; }
.result-card .match-detail { color: #385e46; }
.technical { margin-top: 16px; color: #526358; font-size: .91rem; line-height: 1.5; }
.technical summary { cursor: pointer; font-weight: 700; color: #2d5139; }
.feedback { margin-top: 22px; padding-top: 16px; border-top: 1px solid #e2e8e2; }
.feedback p { color: #66766b; font-size: .9rem; }
.feedback select { margin: 8px 0; }
footer { padding: 16px 5px; color: #67776c; font-size: .85rem; line-height: 1.5; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .grid > label { grid-template-rows: auto 44px auto; }
}

@media (max-width: 600px) {
  .shell { padding: 12px 12px 36px; }
  .panel { padding: 16px; }
  .full { grid-column: auto; }
  .upload-grid { grid-template-columns: 1fr; }
  .camera-frame, video { min-height: 210px; }
}
