:root {
  --peatz-dark: #203e3d;
  --peatz-light: #9ad0bc;
  --peatz-dark-50: rgba(32, 62, 61, 0.5);
  --peatz-surface: #ffffff;
  --peatz-muted: #6b7280;
  --peatz-border: #e5e7eb;
  --peatz-radius: 12px;
  --peatz-shadow: 0 4px 24px rgba(32, 62, 61, 0.08);
  --header-timeline-gap: 2rem;
  --content-max: 72rem;
  --narrow-max: 48rem;
}

html,
body {
  min-height: 100%;
  background: var(--peatz-surface);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell > main {
  flex: 1;
}

[x-cloak] {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--peatz-surface);
  border-bottom: 1px solid var(--peatz-border);
}

.app-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.app-header__logo {
  height: 2rem;
  width: auto;
  max-width: min(42vw, 9rem);
  object-fit: contain;
}

.app-header__product {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--peatz-dark);
  white-space: nowrap;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.org-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--peatz-light) 45%, white);
  color: var(--peatz-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.welcome {
  padding: 3rem 1rem 2.5rem;
}

.welcome__inner {
  max-width: var(--narrow-max);
  margin: 0 auto;
  text-align: center;
}

.welcome__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--peatz-muted);
}

.welcome__title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.15;
  font-weight: 700;
  color: #111827;
}

.welcome__lede {
  margin: 0 auto 2rem;
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #374151;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  text-align: left;
}

.feature-card {
  border: 1px solid var(--peatz-border);
  border-radius: var(--peatz-radius);
  padding: 1.1rem 1.15rem;
  background: var(--peatz-surface);
  box-shadow: var(--peatz-shadow);
}

.feature-card__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--peatz-dark);
}

.feature-card__body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #4b5563;
}

.welcome__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.welcome__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--peatz-dark);
  text-decoration: none;
}

.welcome__link:hover {
  text-decoration: underline;
}

.welcome__disclaimer {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--peatz-muted);
}

.workspace {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.workspace__help {
  text-align: center;
  color: #4b5563;
  margin: 0 0 1rem;
}

.workspace__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.workspace__selection-count {
  font-size: 0.875rem;
  color: var(--peatz-muted);
}

.workspace__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-card {
  border: 1px solid var(--peatz-border);
  border-radius: var(--peatz-radius);
  overflow: hidden;
  box-shadow: var(--peatz-shadow);
  background: #fff;
}

.workspace__actions {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.report-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.report-action__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--peatz-muted);
}

.report-action__label {
  white-space: nowrap;
}

.report-action__select {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0 1rem 0 0;
  font-size: 0.75rem;
  color: var(--peatz-muted);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239ca3af' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

.report-action__select:focus {
  outline: none;
  color: var(--peatz-dark);
}

.report-action__submit {
  min-width: 11rem;
}

.workspace__progress {
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
}

.workspace__progress-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.workspace__progress-hint {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--peatz-muted);
}

.success-card {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px solid var(--peatz-border);
  border-radius: var(--peatz-radius);
  box-shadow: var(--peatz-shadow);
  background: #fff;
}

.success-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--peatz-light);
  color: var(--peatz-dark);
  font-weight: 700;
}

.success-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.success-card__body {
  margin: 0 0 1.5rem;
  color: #4b5563;
}

.success-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #f9fafb;
  text-align: left;
}

.success-card__stats div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.success-card__stats dt {
  font-size: 0.75rem;
  color: var(--peatz-muted);
}

.success-card__stats dd {
  margin: 0;
  font-weight: 700;
  color: var(--peatz-dark);
}

.success-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.contact-band {
  border-top: 1px solid var(--peatz-border);
  padding: 2.5rem 1rem;
  background: #fafafa;
}

.contact-band__inner {
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
}

.contact-band__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
}

.contact-band__text {
  margin: 0 0 1.25rem;
  color: #4b5563;
  line-height: 1.55;
}

.contact-band__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.contact-band__sent {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--peatz-dark);
}

.btn-peatz-outline {
  border-color: var(--peatz-dark) !important;
  color: var(--peatz-dark) !important;
}

.btn-peatz-outline:hover {
  background: color-mix(in srgb, var(--peatz-light) 35%, white) !important;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
}

.login-modal__card {
  position: relative;
  z-index: 1;
  width: min(100%, 24rem);
  background: #fff;
  border: 2px solid var(--peatz-dark);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 12px 32px rgba(32, 62, 61, 0.18);
}

.login-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.login-modal__close:hover {
  color: #374151;
}

.login-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--peatz-dark);
  text-align: center;
}

.login-modal__hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--peatz-muted);
  text-align: center;
}

.login-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.login-modal__error {
  margin: 0;
  font-size: 0.8rem;
  color: #b42318;
  text-align: center;
}

.language-dropdown {
  position: static;
}

.language-dropdown__trigger {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  color: var(--peatz-dark) !important;
}

.language-dropdown__menu {
  background: #fff !important;
}

.language-option {
  width: 100%;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.875rem;
}

.language-option--active,
.language-dropdown__menu li .language-option--active {
  background: var(--peatz-dark) !important;
  color: #fff !important;
}

.site-footer--dark {
  background: var(--peatz-dark);
  color: #fff;
  text-align: center;
  padding: 2rem 1.25rem 2.5rem;
}

.site-footer__disclaimer {
  margin: 0 auto 0.85rem;
  max-width: 42rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.site-footer__copyright {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .app-header__product {
    display: none;
  }

  .success-card__stats {
    grid-template-columns: 1fr;
  }
}

.header-logo {
  display: block;
}

/* Step timeline — same width as map instruction text (max-w-4xl) */
.step-tracker {
  --step-circle-size: 2.25rem;
  --step-line-height: 4px;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: start;
  column-gap: 0;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.step-tracker__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--step-circle-size);
  overflow: visible;
  z-index: 1;
}

.step-tracker__line {
  align-self: start;
  width: 100%;
  height: var(--step-line-height);
  margin-top: calc(var(--step-circle-size) / 2 - var(--step-line-height) / 2);
  background: #e8ecea;
  z-index: 0;
}

.step-tracker__line--active {
  background: var(--peatz-light);
}

.step-tracker__circle {
  width: var(--step-circle-size);
  height: var(--step-circle-size);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: #e8ecea;
  color: #6b7280;
  border: 2px solid #e8ecea;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.step-tracker__item--active .step-tracker__circle {
  background: var(--peatz-light);
  border-color: var(--peatz-light);
  color: #111827;
}

.step-tracker__label {
  margin-top: 0.5rem;
  width: 7.5rem;
  margin-left: calc((7.5rem - var(--step-circle-size)) / -2);
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1.25;
}

.step-tracker__item--active .step-tracker__label {
  color: var(--peatz-dark);
  font-weight: 600;
}

/* Peatz buttons */
.btn-peatz-dark {
  background-color: var(--peatz-dark) !important;
  border-color: var(--peatz-dark) !important;
  color: #fff !important;
}

.btn-peatz-dark:hover {
  background-color: color-mix(in srgb, var(--peatz-dark) 88%, white) !important;
  border-color: color-mix(in srgb, var(--peatz-dark) 88%, white) !important;
  color: #fff !important;
}

.report-progress {
  height: 0.5rem;
  border: none;
  border-radius: 9999px;
  background-color: #e5e7eb;
  overflow: hidden;
  appearance: none;
}

.report-progress::-webkit-progress-bar {
  background-color: #e5e7eb;
  border-radius: 9999px;
}

.report-progress::-webkit-progress-value {
  background-color: var(--peatz-light);
  border-radius: 9999px;
}

.report-progress::-moz-progress-bar {
  background-color: var(--peatz-light);
  border-radius: 9999px;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.bfe-search {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  min-width: min(100%, 20rem);
  width: min(100%, 20rem);
}

.bfe-search__label {
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6b7280;
  flex-shrink: 0;
  line-height: 1.25;
}

.bfe-search__divider {
  width: 1px;
  align-self: stretch;
  background: #e5e7eb;
  margin: 0.4rem 0;
  flex-shrink: 0;
}

.bfe-search__input {
  border: none;
  outline: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
  background: transparent;
  color: #111827;
}

.bfe-search__input::placeholder {
  color: #9ca3af;
}

.bfe-search:focus-within {
  outline: 2px solid color-mix(in srgb, var(--peatz-dark) 35%, transparent);
  outline-offset: 1px;
}

.map-stage {
  position: relative;
}

.map-intro {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: auto;
}

.map-intro__scrim {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

.map-intro__card {
  position: relative;
  z-index: 1;
  width: min(50%, 26rem);
  min-height: min(50%, 18rem);
  max-width: calc(100% - 2rem);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--peatz-dark);
  border-radius: 0.75rem;
  padding: 2rem 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  box-shadow: 0 8px 28px rgba(32, 62, 61, 0.12);
}

.map-intro__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.map-intro__body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #4b5563;
  max-width: 22rem;
}

.map-container {
  width: 100%;
  height: min(70vh, 720px);
  min-height: 420px;
}

.parcel-area-label {
  font-family: "Nunito Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--peatz-dark);
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.2;
}

.layer-panel-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 11;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: var(--peatz-dark);
  cursor: pointer;
}

.layer-panel-toggle:hover {
  background: #fff;
}

.layer-panel-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.layer-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
  width: min(320px, calc(100% - 24px));
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  max-height: calc(100% - 24px);
  overflow: visible;
}

.layer-panel--hidden {
  display: none;
}

.layer-panel__body {
  max-height: min(58vh, 560px);
  overflow-y: auto;
}

.layer-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 0.5rem 0.5rem 0 0;
}

.layer-panel__header h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--peatz-dark);
  margin: 0;
}

.layer-panel__close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.layer-panel__close:hover {
  color: #374151;
}

.layer-group {
  border-top: 1px solid #f3f4f6;
  padding: 0.55rem 0.75rem 0.65rem;
  overflow: visible;
}

.layer-group:first-of-type {
  border-top: none;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.layer-row:hover {
  z-index: 30;
}

.layer-row label.layer-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-weight: 600;
  color: #111827;
  flex: 1;
  margin: 0;
}

.layer-checkbox {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid #9ca3af;
  border-radius: 0.2rem;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  background: #fff;
}

.layer-checkbox:checked {
  background: var(--peatz-light);
  border-color: var(--peatz-dark);
}

.layer-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 0.22rem;
  top: 0.02rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid var(--peatz-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.layer-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.layer-info__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: help;
  line-height: 0;
}

.layer-info__icon svg {
  display: block;
}

.layer-info__tooltip {
  display: none;
  position: fixed;
  z-index: 1000;
  width: 15rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.35rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  color: #4b5563;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
}

.layer-info__tooltip--visible {
  display: block;
}

.legend-list {
  margin: 0.35rem 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.legend-list--hidden {
  display: none;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0;
  color: #374151;
  font-size: 0.72rem;
  line-height: 1.25;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.swatch.hatch {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    currentColor 2px,
    currentColor 3px
  );
  background-color: transparent !important;
}

.layer-panel__hint {
  margin: 0;
  padding: 0.5rem 0.75rem 0.75rem;
  color: #9ca3af;
  font-size: 0.68rem;
  line-height: 1.35;
}

.layer-panel__hint--hidden {
  display: none;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  color: var(--peatz-dark);
  pointer-events: none;
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}

.layer-row--nested {
  margin-top: 0.35rem;
  padding-left: 1.35rem;
}

.layer-subgroup {
  border-left: 2px solid #e5e7eb;
  margin: 0.25rem 0 0 0.75rem;
  padding-left: 0.35rem;
}

.layer-insights {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.layer-insights__heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--peatz-dark);
}

.layer-insight {
  border: 1px solid color-mix(in srgb, var(--peatz-dark) 18%, #e5e7eb);
  border-left: 4px solid var(--peatz-light);
  border-radius: 0.5rem;
  background: #fff;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 8px rgba(32, 62, 61, 0.06);
}

.layer-insight__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--peatz-dark);
}

.layer-insight__body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #374151;
}

.layer-insight__link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--peatz-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.layer-insight__link:hover {
  color: color-mix(in srgb, var(--peatz-dark) 75%, #000);
}
