:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #16211f;
  --muted: #66736f;
  --line: #dbe3e0;
  --primary: #126e5a;
  --primary-dark: #0e5848;
  --accent: #c83f2b;
  --soft: #edf5f2;
  --warning: #fff5df;
  --warning-border: #e2b34d;
  --shadow: 0 18px 45px rgba(22, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.is-hidden {
  display: none;
}

.login-shell {
  align-items: center;
}

.login-panel {
  max-width: 720px;
}

.login-form {
  margin-top: 20px;
}

.panel {
  width: min(860px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.instruction-block {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.disclaimer {
  margin-bottom: 16px;
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--warning);
  font-weight: 900;
}

.instruction-section {
  border-left: 4px solid var(--primary);
  padding: 10px 12px;
  background: #f8faf9;
}

.instruction-section h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
}

.instruction-section p,
.instruction-section ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.instruction-section ul {
  padding-left: 20px;
}

.progress {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.progress-track {
  height: 8px;
  background: #e8eeee;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 160ms ease;
}

#wizardForm {
  display: flex;
  flex: 1;
  flex-direction: column;
}

#screen {
  flex: 1;
}

.intro {
  display: grid;
  align-content: center;
  min-height: 460px;
  gap: 20px;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
  max-width: 620px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 7px;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.warning-text {
  margin: 0;
  color: #9b5d00;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.examples-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 14px 16px;
}

.examples-box ul {
  columns: 2;
  margin: 8px 0 0;
  padding-left: 22px;
}

label,
.label {
  color: #263532;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid #bfcac6;
  border-radius: 6px;
  padding: 13px 14px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(18, 110, 90, 0.18);
  border-color: var(--primary);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.choice-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span,
.check-choice {
  min-height: 62px;
  border: 2px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-weight: 800;
  background: #fff;
}

.choice input:checked + span,
.check-choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary-dark);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.checkbox-grid.single {
  grid-template-columns: 1fr;
}

.check-choice {
  justify-content: flex-start;
  gap: 10px;
}

.check-choice input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--primary);
}

.conditional {
  margin-top: 14px;
}

.validation {
  min-height: 24px;
  margin-top: 14px;
  color: var(--accent);
  font-weight: 800;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
}

.button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 0 24px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.button.primary {
  background: var(--primary);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: #e8eeee;
  color: var(--ink);
}

.button.compact {
  min-height: 48px;
  padding: 0 16px;
  white-space: nowrap;
}

.button.small-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.inline-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.review-card,
.flag-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.review-card dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 12px;
  margin: 0;
}

.review-card dt {
  color: var(--muted);
  font-weight: 800;
}

.review-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.flag-box {
  margin-top: 18px;
  background: var(--warning);
  border-color: var(--warning-border);
}

.pdf-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.pdf-debug {
  margin-top: 16px;
}

.advisor-overview {
  grid-column: 1 / -1;
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 18px;
  background: #f7fbf9;
}

.advisor-overview h3 {
  margin-bottom: 14px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.overview-grid h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.grouped-concerns,
.concern-group {
  display: grid;
  gap: 8px;
}

.concern-title {
  margin: 0;
  font-weight: 900;
}

.flag-list {
  margin: 0;
  padding-left: 22px;
  font-weight: 800;
}

.photo-preview {
  width: min(100%, 520px);
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.photo-preview.small {
  max-height: 220px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.photo-grid figure {
  margin: 0;
}

.photo-grid figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.quiet {
  color: var(--muted);
}

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

@media (max-width: 680px) {
  .app-shell {
    align-items: stretch;
    padding: 0;
  }

  .panel {
    min-height: 100vh;
    border-radius: 0;
    padding: 20px;
  }

  .topbar,
  .nav-row {
    flex-direction: column;
  }

  .progress {
    width: 100%;
    text-align: center;
  }

  .field-grid,
  .choice-grid,
  .choice-grid.two,
  .checkbox-grid,
  .photo-grid,
  .overview-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .review-card dl {
    grid-template-columns: 1fr;
  }

  .inline-action {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
