:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #d8e0ea;
  --text: #1e2a36;
  --muted: #5f6f82;
  --brand: #184f90;
  --brand-2: #2f76c7;
  --warn-bg: #fff8eb;
  --warn-border: #f0b15a;
  --ok-bg: #ecfdf3;
  --ok-border: #73d8a6;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  border-radius: 24px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  opacity: 0.85;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.hero-sub {
  margin: 0;
  max-width: 820px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  background: white;
  color: var(--brand);
}

button.secondary {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-btn {
  text-align: left;
  background: #f8fafc;
  color: var(--text);
  border: 1px solid var(--line);
}

.nav-btn.active {
  background: #eaf2ff;
  color: var(--brand);
  border-color: #b6cef5;
}

.progress-block {
  margin-top: 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-track {
  height: 14px;
  background: #e9eef5;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.version-box {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
}

.version-box span,
.version-box small {
  color: var(--muted);
  font-size: 0.95rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

label.full,
.stack {
  grid-column: 1 / -1;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 32px;
  font-weight: 500;
}

.inline-check input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  font: inherit;
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.check-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  font-weight: 500;
  text-align: left;
}

.check-card input {
  width: auto;
  margin: 0;
}

.check-card span {
  flex: 1;
}

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.notice.warning {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-border);
}

.notice.success {
  background: var(--ok-bg);
  border-left: 4px solid var(--ok-border);
}

.risk-flags {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.risk-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.risk-item.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.photo-upload-block {
  margin-bottom: 14px;
}

.uploaded-photo-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.uploaded-photo-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.uploaded-photo-card img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
}

.uploaded-photo-meta {
  display: grid;
  gap: 8px;
}

.photo-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.photo-actions input {
  flex: 1;
  min-width: 220px;
}

.photo-list {
  display: grid;
  gap: 10px;
}

.photo-entry {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.photo-entry button {
  background: #eef2ff;
  color: var(--brand);
}

.signature-pad {
  width: 100%;
  height: 220px;
  border: 2px dashed #b6c2d2;
  border-radius: 16px;
  background: #ffffff;
  margin-top: 12px;
  touch-action: none;
  display: block;
  cursor: crosshair;
}

.report-output {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}

.report-output table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.report-output th,
.report-output td {
  border: 1px solid #d0d5dd;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.report-output th {
  background: #f8fafc;
}

.checklist-box {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.checklist-box h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.four,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .uploaded-photo-card {
    grid-template-columns: 1fr;
  }

  .uploaded-photo-card img {
    width: 100%;
    height: auto;
    max-height: 220px;
  }
}