: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 !important;
}

.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;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.config-source {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.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;
}

.save-status {
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
}

.save-status.info {
  color: #5a4115;
  background: #f4ead8;
}

.save-status.success {
  color: #075a45;
  background: #dff4ec;
}

.save-status.error {
  color: #9f1d15;
  background: #ffe5e1;
}

.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;
}

.optional {
  color: var(--muted);
  font-weight: 700;
}

.file-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  overflow-wrap: anywhere;
}

.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;
  align-items: start;
}

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

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

.review-card dt {
  color: var(--muted);
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
  white-space: normal;
}

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

.paused-alert {
  border: 3px solid #b42318;
  border-radius: 8px;
  padding: 22px;
  background: #fff7f5;
}

.paused-alert.urgent {
  border-color: #8f1d14;
  background: #fff0ed;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.paused-kicker {
  margin: 0 0 6px;
  color: #b42318;
  font-size: 1rem;
  font-weight: 900;
}

.paused-alert h2 {
  margin-bottom: 6px;
  color: #8f1d14;
  font-size: clamp(2rem, 5vw, 3rem);
}

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

.paused-detail {
  border: 1px solid #e4a29a;
  border-radius: 6px;
  padding: 14px;
  background: #ffffff;
}

.paused-detail h3,
.paused-detail p {
  margin: 0;
}

.paused-detail h3 {
  margin-bottom: 6px;
}

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

.draft-prompt {
  max-width: 680px;
  margin: 0 auto;
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button.danger {
  background: #b42318;
}

.button.danger:hover {
  background: #8f1d14;
}

.button.danger-text {
  color: #b42318;
  border: 1px solid #f0b5ad;
}

.button.alert-button {
  color: #ffffff;
  background: #b42318;
}

.button.alert-button:hover {
  background: #8f1d14;
}

.success-text {
  margin-top: 14px;
  color: #126e5a;
  font-weight: 800;
}

.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;
  align-items: start;
}

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

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

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

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

.flag-list li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.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);
  overflow-wrap: anywhere;
}

.muted-text {
  color: var(--muted);
  font-weight: 700;
}

.settings-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

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

.settings-readonly {
  margin-top: 14px;
}

.settings-table-wrap {
  overflow-x: auto;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.settings-table th,
.settings-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.settings-table th {
  background: #f4f8f6;
  font-weight: 900;
}

.compact-input,
.settings-table select {
  width: 100%;
  min-width: 120px;
  padding: 8px;
}

.table-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 800;
  white-space: nowrap;
}

.report-list-item {
  display: grid;
  gap: 12px;
}

.report-queue {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  width: 100%;
}

.report-queue-header,
.report-queue-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.7fr) minmax(86px, 0.8fr) minmax(64px, 0.6fr) minmax(116px, 1.1fr) minmax(128px, 1.2fr) minmax(112px, 1fr) minmax(132px, 1fr);
  gap: 8px;
  align-items: center;
}

.report-queue-header {
  padding: 0 12px 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-queue-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(9, 35, 31, 0.04);
}

.queue-cell {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.vehicle-cell,
.concerns-cell {
  font-weight: 700;
}

.queue-muted {
  color: var(--muted);
  font-weight: 700;
}

.queue-badges,
.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status-badge,
.concern-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.15;
}

.status-progress {
  color: #075a45;
  background: #dff4ec;
}

.status-paused,
.concern-badge.hard-stop,
.concern-badge.red {
  color: #9f1d15;
  background: #ffe5e1;
}

.status-completed {
  color: #38504a;
  background: #edf3f1;
}

.status-archived {
  color: #5f5547;
  background: #eee8df;
}

.concern-badge.yellow {
  color: #805400;
  background: #fff1c6;
}

.concern-badge.warning {
  color: #5a4115;
  background: #f4ead8;
}

.report-json {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.84rem;
}

.advisor-overview-column,
.report-concern-card,
.saved-report-concern-section,
.saved-report-section-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.advisor-overview-column,
.report-concern-card,
.saved-report-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.saved-report-section {
  background: #ffffff;
}

.saved-photo-groups {
  display: grid;
  gap: 18px;
}

.saved-photo-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.saved-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.saved-photo-card {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  min-width: 0;
}

.saved-photo-card img,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #edf3f1;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.saved-file-card .photo-placeholder {
  background: #eef5f4;
  color: var(--primary);
}

.saved-photo-card figcaption {
  display: grid;
  gap: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.saved-photo-card figcaption strong {
  color: var(--ink);
}

.severity-red {
  border-color: #d92d20;
  background: #fff3f0;
}

.severity-yellow {
  border-color: #d9a441;
  background: #fff8e8;
}

.severity-na {
  border-color: #c8bfae;
  background: #f8f5ef;
}

.severity-neutral {
  border-color: var(--line);
  background: #f8faf9;
}

.severity-green {
  border-color: #cfe3dd;
  background: #f7fbf9;
}

.saved-report-concern-section.severity-red > h3,
.advisor-overview-column.severity-red h4 {
  color: #b42318;
}

.saved-report-concern-section.severity-yellow > h3,
.advisor-overview-column.severity-yellow h4 {
  color: #8a6116;
}

.debug-details summary {
  cursor: pointer;
  font-weight: 900;
}

.debug-details[open] summary {
  margin-bottom: 10px;
}

.shop-selection-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.shop-selection-card {
  display: grid;
  gap: 12px;
}

.shop-selection-card h3 {
  margin: 0;
}

.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,
  .paused-grid {
    grid-template-columns: 1fr;
  }

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

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

  .button {
    width: 100%;
  }

  .report-queue-header {
    display: none;
  }

  .report-queue-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .queue-cell {
    display: grid;
    gap: 4px;
  }

  .queue-cell::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .status-cell::before,
  .actions-cell::before {
    display: none;
  }

  .queue-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
