:root {
  --ink: #363840;
  --muted: #686b73;
  --line: #ededed;
  --soft: #f8f8f8;
  --paper: #ffffff;
  --brand: #0b8039;
  --brand-dark: #09672e;
  --focus: #0b8039;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(54, 56, 64, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 44px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand h1,
.brand p,
.intro-kicker,
.section-heading h2,
.section-heading p,
.intro-band h2,
.intro-band p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(1.1rem, 1.7vw, 1.42rem);
  letter-spacing: 0;
}

.eyebrow,
.step-label {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.export-actions,
.card-actions,
.split-heading {
  align-items: center;
  display: flex;
  gap: 10px;
}

.topbar-actions,
.export-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

main {
  margin: 0 auto;
  max-width: 800px;
  padding: 30px 20px 54px;
}

.intro-band {
  background: var(--paper);
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 0;
}

.intro-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-band h2 {
  color: var(--ink);
  font-size: clamp(1.95rem, 4.4vw, 2.55rem);
  font-weight: 800;
  line-height: 1.08;
  max-width: 720px;
  margin-top: 4px;
}

.intro-band p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
  margin-top: 8px;
  max-width: 720px;
}

.intro-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.intro-highlights span {
  background: #f1f7f3;
  border: 1px solid #d6eadc;
  border-radius: 4px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 8px;
}

.form-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 12px;
  padding: 20px 22px;
}

.section-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 9px;
}

.section-heading h2 {
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.split-heading {
  justify-content: space-between;
}

.field-grid,
.contact-entry,
.summary-grid {
  display: grid;
  gap: 10px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-entry {
  align-items: end;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  color: var(--ink);
  display: grid;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 4px;
}

input {
  background: #fff;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 10px;
  width: 100%;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(11, 128, 57, 0.16);
  outline: none;
}

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

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  align-items: center;
  border-radius: 4px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.primary-button {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
}

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

.primary-button:disabled {
  background: #91aaa6;
  border-color: #91aaa6;
  cursor: not-allowed;
}

.secondary-button {
  background: #fff;
  border: 1px solid var(--brand);
  color: var(--brand-dark);
}

.secondary-button.danger-button {
  border-color: #e3b7b2;
  color: var(--danger);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--brand-dark);
  min-height: auto;
  padding: 4px 0;
  text-align: center;
  white-space: normal;
}

.danger {
  color: var(--danger);
}

.list-stack {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.record-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.record-card {
  padding: 12px;
}

.contact-card,
.location-record-card {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.contact-card span,
.location-record-card span {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  margin-top: 2px;
}

.contact-assignment {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.contact-assignment h3 {
  font-size: 0.86rem;
  margin: 0;
}

.add-record-button {
  margin-top: 11px;
}

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

.checkbox-row {
  align-items: center;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  display: flex;
  gap: 9px;
  min-height: 38px;
  padding: 7px 8px;
}

.checkbox-row input {
  flex: 0 0 auto;
  min-height: auto;
  width: auto;
}

.empty-state,
.validation-message {
  color: var(--muted);
  font-size: 0.9rem;
}

.validation-message {
  margin-top: 8px;
}

.validation-message.error {
  color: var(--danger);
  font-weight: 700;
}

.validation-message.success {
  color: var(--brand-dark);
  font-weight: 700;
}

.summary-tile {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px;
}

.summary-tile strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.summary-tile span {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.summary-grid {
  grid-template-columns: 1fr;
}

.review-location {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.review-location-heading {
  display: grid;
  gap: 2px;
}

.review-location-heading span {
  color: var(--muted);
  font-size: 0.9rem;
}

.review-contacts {
  margin: 0;
  padding-left: 20px;
}

.review-contacts li + li {
  margin-top: 3px;
}

.success-panel {
  margin-top: 18px;
}

.success-panel p {
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 680px;
}

.submission-card {
  display: grid;
  gap: 16px;
}

.submission-heading {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.submission-heading h3,
.submission-heading p {
  margin: 0;
}

.submission-heading p,
.submission-location span {
  color: var(--muted);
}

.submission-location {
  display: grid;
  gap: 8px;
}

.submission-location {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}

.submission-location ul {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 900px) {
  .contact-entry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .add-record-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  main {
    padding: 24px 14px 40px;
  }

  .intro-band h2 {
    font-size: 1.9rem;
    line-height: 1.08;
  }

  .form-section {
    box-shadow: 0 10px 28px rgba(54, 56, 64, 0.08);
    padding: 16px;
  }

  .topbar,
  .contact-card,
  .location-record-card,
  .submission-heading,
  .split-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .export-actions,
  .card-actions,
  .submission-heading {
    justify-content: stretch;
  }

  .topbar-actions > *,
  .export-actions > *,
  .card-actions > *,
  .split-heading > button {
    width: 100%;
  }

  .field-grid,
  .contact-entry,
  .summary-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .topbar-actions,
  .export-actions,
  .contact-entry,
  .text-button,
  .secondary-button,
  .primary-button,
  .ghost-button {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .topbar {
    position: static;
  }

  .form-section,
  .intro-band {
    box-shadow: none;
    break-inside: avoid;
  }
}
