:root {
  --bg: #f7f5ef;
  --paper: #fffdf8;
  --ink: #1e241f;
  --muted: #667067;
  --line: #ded8ca;
  --accent: #275f4f;
  --accent-dark: #173f35;
  --warn: #ffed99;
  --soft: #ece7db;
  --shadow: 0 24px 70px rgba(30, 36, 31, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at top right, #fff7cf 0, transparent 32rem), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: max(14px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid rgba(30, 36, 31, .08);
  background: rgba(247, 245, 239, .88);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 7px;
  color: white;
  background: var(--accent);
}

.status-pill, .proof-tags span {
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--warn);
  font-size: 12px;
  font-weight: 830;
}

.status-pill { padding: 7px 10px; }

main {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 26px 18px calc(36px + env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: center;
  gap: 34px;
  min-height: min(680px, calc(100svh - 90px));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0;
}

h1, h2 { margin: 0; line-height: 1.05; }
h1 { max-width: 620px; font-size: clamp(46px, 7vw, 84px); }
h2 { font-size: 30px; }

.subtitle {
  max-width: 590px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.48;
}

.proof-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.proof-tags span {
  padding: 9px 11px;
  background: rgba(255, 237, 153, .75);
}

.hero-card {
  padding: 18px;
  border: 1px solid rgba(30, 36, 31, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .48);
  box-shadow: var(--shadow);
}

.paper, .panel, .proof-record {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.paper {
  min-height: 430px;
  padding: 24px;
}

.paper-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.paper-head span { color: var(--muted); }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.mini-grid span {
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(39, 95, 79, .16), rgba(255, 237, 153, .36)),
    var(--soft);
}

.paper li { margin: 9px 0; color: var(--muted); }

.builder {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 18px;
}

.section-title {
  margin-bottom: 16px;
}

.progress-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e6dfd1;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6f8f43);
  transition: width .2s ease;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.scenario {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  text-align: left;
}

.scenario.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(39, 95, 79, .15);
}

.scenario strong, .scenario span { display: block; }
.scenario span { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.35; }

.checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.check-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 110px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.check-copy strong, .check-copy span { display: block; }
.check-copy span { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.35; }

.photo-picker {
  display: grid;
  place-items: center;
  min-width: 92px;
  min-height: 46px;
  padding: 9px 12px;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.photo-picker input { display: none; }

.thumb {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.hidden { display: none !important; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.wide { grid-column: 1 / -1; }

input, textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
}

textarea { resize: vertical; }

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
}

.preview-warning {
  margin: 2px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(148, 109, 10, .2);
  border-radius: 8px;
  color: #674d0b;
  background: rgba(255, 237, 153, .45);
  font-size: 13px;
  line-height: 1.4;
}

.primary-button, .secondary-button {
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 820;
}

.primary-button {
  border: 1px solid var(--accent);
  color: white;
  background: linear-gradient(180deg, #327565, var(--accent));
  box-shadow: 0 12px 24px rgba(39, 95, 79, .2);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.compact {
  width: auto;
  min-height: 44px;
  padding: 11px 16px;
}

.preview-section {
  margin-top: 22px;
}

.preview-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.proof-record {
  padding: 24px;
}

.record-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.record-meta {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.record-meta div {
  padding: 11px;
  border-radius: 8px;
  background: var(--soft);
}

.record-meta span, .photo-caption { display: block; color: var(--muted); font-size: 12px; }
.record-meta strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.record-missing {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #674d0b;
  background: rgba(255, 237, 153, .44);
  font-size: 13px;
  line-height: 1.4;
}

.record-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.record-photo {
  break-inside: avoid;
}

.record-photo img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-caption { margin-top: 5px; }
.record-notes { margin-top: 20px; white-space: pre-wrap; line-height: 1.5; }
.export-help {
  display: flex;
  gap: 8px;
  margin: 12px 0 8px;
  padding: 12px 14px;
  border: 1px solid rgba(39, 95, 79, .14);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 248, .72);
  font-size: 13px;
  line-height: 1.4;
}
.export-help strong { color: var(--ink); }
.disclaimer { color: var(--muted); font-size: 13px; line-height: 1.45; }

@media (max-width: 760px) {
  main { padding-inline: 14px; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 12px 0 20px; }
  .hero-card { display: none; }
  h1 { font-size: 40px; }
  h2 { font-size: 27px; }
  .subtitle { margin-top: 14px; font-size: 16px; }
  .proof-tags { margin-top: 16px; }
  .panel { padding: 16px; }
  .scenario-grid, .checklist, .form-grid, .record-meta, .record-photos, .actions {
    grid-template-columns: 1fr;
  }
  .actions { gap: 8px; }
  .preview-actions { align-items: stretch; flex-direction: column; }
  .compact { width: 100%; }
}

@media print {
  body { background: white; }
  .topbar, .hero, .builder, .preview-actions, .export-help, .disclaimer { display: none !important; }
  main { width: 100%; padding: 0; }
  .preview-section { display: block !important; margin: 0; }
  .proof-record { border: 0; padding: 0; }
}
