:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --text: #15231c;
  --muted: #607068;
  --border: #d8e0dc;
  --accent: #176b4a;
  --accent-dark: #0f5037;
  --shadow: 0 18px 50px rgba(28, 55, 43, 0.10);
  --red: #b42318;
  --red-soft: #fef3f2;
  --yellow: #a15c00;
  --yellow-soft: #fff4d6;
  --green: #247a43;
  --green-soft: #edf8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, #e6f1eb 0, transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 32px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow,
.result-label {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

h2 {
  margin-top: 0;
}

.lead {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.notice {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid #e1d7a6;
  border-radius: 14px;
  background: #fffbea;
  color: #514717;
}

.photo-guidance {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f7faf8;
  color: var(--text);
}

.photo-guidance strong {
  display: block;
  margin-bottom: 8px;
}

.photo-guidance ul {
  margin: 0;
  padding-left: 20px;
}

.photo-guidance li + li {
  margin-top: 6px;
}

.panel,
.result-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(20px, 5vw, 34px);
}

.drop-zone {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  border: 2px dashed #aebdb5;
  border-radius: 18px;
  background: #f9fbfa;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: 160ms ease;
}

.drop-zone strong {
  color: var(--text);
  font-size: 1.05rem;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background: #f1f8f4;
  transform: translateY(-1px);
}

.drop-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background: #e1f0e8;
  color: var(--accent);
  font-size: 2rem;
}

.preview-wrap {
  display: grid;
  grid-template-columns: minmax(0, 220px) 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.preview-wrap img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  background: #eef2ef;
}

.file-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.file-meta strong {
  overflow-wrap: anywhere;
}

.file-meta span {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

button {
  min-height: 46px;
  padding: 0 19px;
  border: 0;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.secondary {
  background: #edf1ef;
  color: var(--text);
}

.status {
  min-height: 1.5em;
  margin-bottom: 0;
  color: var(--muted);
}

.error {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 650;
}

.quality-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.quality-heading {
  display: flex;
  gap: 13px;
  align-items: center;
}

.quality-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.6);
}

.quality-label {
  margin: 0 0 3px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quality-heading h3 {
  margin: 0;
  font-size: 1.25rem;
}

.quality-message {
  margin: 14px 0 0;
}

.quality-reasons {
  margin: 12px 0 0;
  padding-left: 20px;
}

.quality-reasons li + li {
  margin-top: 6px;
}

.quality-warn {
  border-color: #e2c675;
  background: #fff8df;
  color: #5b4200;
}

.quality-reject {
  border-color: #e2aaa4;
  background: var(--red-soft);
  color: #5d1711;
}

.result-card {
  margin-top: 26px;
  overflow: hidden;
}

.result-band {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 26px 30px 20px;
}

.result-dot {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.6);
}

.result-band h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.result-message,
.action-box,
.technical,
.result-notice {
  margin-left: 30px;
  margin-right: 30px;
}

.result-message {
  font-size: 1.08rem;
}

.action-box {
  margin-top: 22px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.70);
}

.action-box p {
  margin-bottom: 0;
}

.technical {
  margin-top: 22px;
  padding: 16px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
}

.technical summary {
  cursor: pointer;
  font-weight: 750;
}

.technical dl {
  display: grid;
  gap: 10px;
}

.technical dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
}

.technical dt {
  color: var(--muted);
}

.technical dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
}

.technical-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-notice {
  margin-top: 24px;
  margin-bottom: 30px;
}

.result-red {
  background: var(--red-soft);
  color: #49120e;
}

.result-red .result-band,
.result-red .result-label {
  color: var(--red);
}

.result-yellow {
  background: var(--yellow-soft);
  color: #4d3000;
}

.result-yellow .result-band,
.result-yellow .result-label {
  color: var(--yellow);
}

.result-green {
  background: var(--green-soft);
  color: #123f24;
}

.result-green .result-band,
.result-green .result-label {
  color: var(--green);
}

footer {
  padding: 28px 4px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 860px);
    padding-top: 26px;
  }

  .preview-wrap {
    grid-template-columns: 1fr;
  }

  .quality-panel {
    padding: 16px;
  }

  .result-band,
  .result-message,
  .action-box,
  .technical,
  .result-notice {
    margin-left: 20px;
    margin-right: 20px;
  }

  .result-band {
    padding-left: 20px;
    padding-right: 20px;
  }

  .technical dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .technical dd {
    text-align: left;
  }
}
