:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #1a1d23;
  --muted: #5c6570;
  --line: #d8dde3;
  --brand: #1f4b7a;
  --brand-soft: #e8f0f8;
  --pass: #1b7a3d;
  --pass-bg: #e8f7ee;
  --warn: #9a6b00;
  --warn-bg: #fff6db;
  --fail: #b42318;
  --fail-bg: #fdecea;
  --info: #345;
  --info-bg: #eef2f6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
header.app-header {
  background: var(--brand);
  color: #fff;
  padding: 1rem 1.25rem;
}
header.app-header h1 { margin: 0; font-size: 1.25rem; font-weight: 650; }
header.app-header p { margin: .35rem 0 0; opacity: .9; font-size: .9rem; }
.banner {
  background: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffe69c;
  padding: .65rem 1.25rem;
  font-size: .9rem;
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
}
.card h2 {
  margin: 0 0 .75rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.step-num {
  display: inline-flex;
  width: 1.6rem; height: 1.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .8rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
}
label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .25rem;
}
.field { margin-bottom: .75rem; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #9ec0e6;
  border-color: var(--brand);
}
.row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 600px) {
  .row-3, .row-2 { grid-template-columns: 1fr; }
}
.dropzone {
  border: 2px dashed #b7c3d0;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  background: #fafbfd;
  cursor: pointer;
}
.dropzone.drag { background: var(--brand-soft); border-color: var(--brand); }
.dropzone input { display: none; }
.preview-wrap {
  margin-top: .75rem;
  display: none;
}
.preview-wrap.show { display: block; }
.preview-wrap img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: .55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: #eef2f6; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.muted { color: var(--muted); font-size: .85rem; }
.sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}
.overall {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
}
.overall.PASS { background: var(--pass-bg); color: var(--pass); }
.overall.WARN { background: var(--warn-bg); color: var(--warn); }
.overall.FAIL { background: var(--fail-bg); color: var(--fail); }
.findings { list-style: none; padding: 0; margin: .75rem 0 0; }
.findings li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .65rem .75rem;
  margin-bottom: .5rem;
}
.findings li.PASS { background: var(--pass-bg); border-color: #b7e4c7; }
.findings li.WARN { background: var(--warn-bg); border-color: #ffe08a; }
.findings li.FAIL { background: var(--fail-bg); border-color: #f5c2c0; }
.findings li.INFO { background: var(--info-bg); }
.findings .code { font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.findings .cite { font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.panel-options { display: grid; gap: .5rem; margin-top: .5rem; }
.panel-opt {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .65rem .75rem;
  background: #fafbfd;
}
.panel-opt.invalid { opacity: .75; border-style: dashed; }
.panel-opt .tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 4px;
  margin-right: .35rem;
}
.tag.valid { background: var(--pass-bg); color: var(--pass); }
.tag.invalid { background: var(--fail-bg); color: var(--fail); }
.photo-box {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .75rem;
  margin-top: .75rem;
}
.photo-box h3 { margin: 0 0 .4rem; font-size: .95rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; margin: .35rem 0; font-size: .9rem; }
footer {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
  color: var(--muted);
  font-size: .8rem;
}
.samples { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.samples button {
  font-size: .75rem;
  padding: .3rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

/* Photo AI progress */
.photo-progress {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: .85rem 1rem;
  background: var(--brand-soft);
  border: 1px solid #c5d6ea;
  border-radius: 10px;
}
.photo-progress .spinner {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: .15rem;
  border: 3px solid #b7c9de;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: shutter-spin .8s linear infinite;
  flex: 0 0 auto;
}
.photo-progress .elapsed { margin-top: .35rem; font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes shutter-spin { to { transform: rotate(360deg); } }
