:root {
  --cqa-patina: #57a284;
  --cqa-bunker: #222935;
  --cqa-linkwater: #d3d8de;
  --cqa-selago: #f1f0f1;
  --cqa-black: #0d1420;
  --cqa-white: #ffffff;
  --cqa-spectra: #346552;
  --cqa-dark-viridian: #3f7a63;
  --cqa-english-holly: #233d31;
  --cqa-peacoat: #213251;
  --cqa-chambray: #526281;
  --cqa-deep-oxford: #222a38;
  --cqa-viridian: #398a69;
  --cqa-jet-stream: #c6d6cf;
  --cqa-stopsign-red: #cc0202;
  --cqa-white-smoke: #f8f8f8;
  --font-brand: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --page-bg: #f5f7fa;
  --panel-bg: rgba(255, 255, 255, 0.94);
  --panel-border: rgba(34, 41, 53, 0.08);
  --card-border: rgba(34, 41, 53, 0.11);
  --heading: var(--cqa-bunker);
  --text: rgba(13, 20, 32, 0.88);
  --muted: #566273;
  --button: var(--cqa-patina);
  --button-hover: var(--cqa-dark-viridian);
  --shadow: 0 28px 70px rgba(34, 41, 53, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --code-bg: #f5f7f8;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-brand);
  font-size: 1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
.ms-choice:focus-visible,
.tooltip:focus-visible {
  outline: 3px solid rgba(87, 162, 132, 0.28);
  outline-offset: 2px;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 28px 16px 40px;
}

.page-shell::before,
.page-shell::after {
  content: none;
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
}

.page-shell::before {
  top: -120px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(87, 162, 132, 0.22) 0%, rgba(87, 162, 132, 0) 72%);
}

.page-shell::after {
  bottom: -140px;
  left: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(33, 50, 81, 0.12) 0%, rgba(33, 50, 81, 0) 72%);
}

.panel {
  position: relative;
  z-index: 1;
  max-width: 1340px;
  margin: 0 auto;
  padding: 28px 32px 32px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 18px;
}

.brand-block {
  max-width: 760px;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-logo {
  display: block;
  width: auto;
  height: clamp(34px, 4vw, 54px);
  max-width: min(280px, 42vw);
  object-fit: contain;
}

.topbar {
  display: flex;
  justify-content: flex-end;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(204, 2, 2, 0.16);
  border-radius: 999px;
  background: rgba(204, 2, 2, 0.08);
  color: #872525;
  font: 600 0.92rem/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.utility-link:hover,
.utility-link:focus-visible {
  background: rgba(204, 2, 2, 0.14);
  border-color: rgba(204, 2, 2, 0.28);
}

.eyebrow,
.section-kicker,
.path-overview-label,
.path-resources-label,
.path-detail-label,
.request-walkthrough-label {
  color: var(--cqa-dark-viridian);
  font: 700 0.78rem/1.2 var(--font-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(2.05rem, 3.4vw, 3.2rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.intro {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font: 500 0.98rem/1.55 var(--font-brand);
}

.steps-heading {
  margin: 0 0 16px;
}

.steps-heading h2,
.hero-card h2 {
  margin: 0;
  color: var(--cqa-bunker);
  font-size: clamp(1.75rem, 2.2vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-card .hero-title {
  margin-bottom: 15px;
}

.hero-card {
  margin-left: -25px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: transparent;
}

.hero-copy > p:not(.section-kicker) {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

.path-overview {
  align-self: stretch;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(34, 41, 53, 0.98) 0%, rgba(35, 61, 49, 0.96) 100%);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.path-overview h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.path-overview .path-overview-label,
.path-overview .path-detail-label {
  color: rgba(198, 214, 207, 0.88);
}

.path-overview-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.4;
}

.path-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.path-switcher {
  margin-bottom: 10px;
}

.path-select-label {
  margin-bottom: 10px;
}

.path-switcher .api-form-group {
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: #fff;
  font: 600 0.95rem/1 var(--font-ui);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(63, 122, 99, 0.24);
}

.steps,
#requestStepsContainer {
  display: grid;
  gap: 14px;
}

.step {
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(34, 41, 53, 0.04);
}

.step[data-has-walkthrough="true"] .step-body-inner {
  position: relative;
}

.step summary {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 18px 20px;
  list-style: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.step summary::-webkit-details-marker {
  display: none;
}

.step summary:hover {
  background: rgba(241, 240, 241, 0.5);
}

.step-marker {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 5px;
  border: 1.5px solid rgba(87, 162, 132, 0.72);
  border-radius: 50%;
  background: rgba(87, 162, 132, 0.12);
}

.step[open] .step-marker::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--cqa-patina);
}

.step-copy h3 {
  margin: 0 0 4px;
  color: var(--cqa-bunker);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.98rem;
}

.step-toggle {
  padding-top: 2px;
  color: #8090a5;
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.step[open] .step-toggle {
  color: var(--heading);
  transform: rotate(45deg);
}

.step-body {
  padding: 0 20px 20px 58px;
  color: #516071;
  animation: reveal 0.22s ease;
}

.step.step-no-indent .step-body {
  padding-left: 20px;
}

.step-body-inner {
  padding-top: 18px;
  border-top: 1px solid rgba(211, 216, 222, 0.75);
}

.step-body p {
  margin: 0 0 12px;
  line-height: 1.65;
}

.request-walkthrough {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 16px 18px;
  border: 1px solid rgba(63, 122, 99, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 248, 244, 0.96) 100%);
}

.request-walkthrough p:last-child {
  margin-bottom: 0;
}

.step-body ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.step-body li {
  margin-bottom: 7px;
  line-height: 1.55;
}

.required-resources-note {
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid rgba(87, 162, 132, 0.18);
  border-radius: 12px;
  font-size: 0.875rem;
  background: rgba(87, 162, 132, 0.08);
  color: var(--cqa-english-holly);
}

.api-test-section {
  margin: 0 0 16px;
  padding: 20px;
  border-radius: 18px;
  background: #ffffff;
}

.api-test-section h4 {
  margin: 0 0 6px;
  color: var(--cqa-bunker);
  font-size: 1.02rem;
  font-weight: 600;
}

.api-test-section > p {
  margin: 0 0 14px;
  color: #657286;
  line-height: 1.55;
}

.api-form-group {
  position: relative;
  margin-left: 0;
  margin-bottom: 14px;
  padding-left: 0;
  text-indent: 0;
}

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

.field-label {
  display: inline-block;
}

.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.api-form-group label {
  display: block;
  color: var(--cqa-bunker);
  font: 600 0.92rem/1.4 var(--font-ui);
}

.step[data-path-step] .step-body {
  padding-left: 20px;
}

.api-form-group input,
.api-form-group textarea,
.api-form-group select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(82, 98, 129, 0.22);
  border-radius: 12px;
  background: #ffffff;
  color: #314156;
  font: 500 0.95rem/1.5 var(--font-ui);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.api-form-group input::placeholder,
.api-form-group textarea::placeholder {
  color: #7f8a99;
}

.secret-input-row {
  position: relative;
}

.secret-input-row input {
  padding-right: 42px;
}

.secret-toggle-button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6a778a;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, color 0.2s ease;
}

.secret-toggle-button:hover,
.secret-toggle-button:focus-visible {
  background: #eef2f7;
  color: #314156;
}

.secret-toggle-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.secret-toggle-button .eye-pupil {
  fill: currentColor;
  stroke: none;
}

.secret-toggle-button .eye-slash {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.secret-toggle-button.is-visible .eye-slash {
  opacity: 1;
}

.api-form-group textarea {
  min-height: 112px;
  resize: vertical;
}

.secondary-button.geojson-map-link {
  margin-top: 0;
  min-height: 42px;
  padding: 12px 18px;
  border-color: var(--cqa-chambray);
  background: var(--cqa-chambray);
  color: #ffffff;
  font: 600 0.92rem/1 var(--font-ui);
}

.geojson-map-status {
  margin-top: 8px;
}

.secondary-button.geojson-map-link:hover,
.secondary-button.geojson-map-link:focus-visible {
  background: var(--cqa-peacoat);
  border-color: var(--cqa-peacoat);
  color: #ffffff;
}

#key-resources {
  min-height: 180px;
}

.api-form-group .ms-parent {
  width: 100% !important;
}

.api-form-group .ms-choice {
  position: relative;
  min-height: 44px;
  border: 1px solid rgba(82, 98, 129, 0.22);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
  font-family: var(--font-ui);
}

.api-form-group .ms-choice > span {
  top: 0;
  left: 0;
  right: 34px;
  padding: 10px 12px;
  color: #314156;
  font: 500 0.92rem/1.45 var(--font-ui);
}

.api-form-group .ms-choice > span.placeholder {
  color: #6a778a;
}

.api-form-group .ms-choice > div {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  border-left: 0;
  background: transparent;
  overflow: hidden;
}

.api-form-group .ms-choice > div::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #7b8799;
  border-bottom: 1.5px solid #7b8799;
  transform: translate(-50%, -65%) rotate(45deg);
}

.api-form-group .ms-choice > div b {
  display: none;
  background: none !important;
}

.api-form-group .ms-drop {
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(82, 98, 129, 0.22);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(34, 41, 53, 0.12);
}

.api-form-group .ms-search {
  padding: 10px;
  background: #f7f9fc;
  border-bottom: 1px solid #e5e9f0;
}

.api-form-group .ms-search input {
  width: 100% !important;
  height: auto !important;
  margin: 0;
  padding: 10px 12px !important;
  border: 1px solid rgba(82, 98, 129, 0.22) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #314156 !important;
  font: 500 0.95rem/1.5 var(--font-ui) !important;
}

.api-form-group .ms-select-all {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  background: #fbfcfe;
}

.api-form-group .ms-select-all label,
.api-form-group .ms-drop ul > li label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  color: #314156;
  font: 500 0.92rem/1.45 var(--font-ui);
  cursor: pointer;
}

.api-form-group .ms-drop ul {
  padding: 6px 0;
}

.api-form-group .ms-drop ul > li {
  margin: 0;
}

.api-form-group .ms-drop ul > li:hover {
  background: #f7f9fc;
}

.api-form-group .ms-drop ul > li.selected {
  background: rgba(87, 162, 132, 0.11);
}

.api-form-group .ms-drop input[type="checkbox"] {
  margin: 0;
}

.api-form-group .ms-no-results {
  padding: 12px;
  color: #6a778a;
  font-size: 0.9rem;
}

.api-form-group textarea[readonly] {
  background: #f7f8fb;
}

.helper-text {
  margin: 8px 0 0;
  color: #6a778a;
  font: 500 0.84rem/1.5 var(--font-ui);
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(198, 214, 207, 0.32);
  color: #516071;
  font-size: 0.75rem;
  cursor: help;
  user-select: none;
}

.tooltip-content {
  position: absolute;
  top: 32px;
  left: 0;
  z-index: 2;
  width: min(280px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--cqa-deep-oxford);
  color: #ffffff;
  font: 500 0.8rem/1.45 var(--font-ui);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.field-label-row:hover + .tooltip-content,
.field-label-row:focus-within + .tooltip-content {
  opacity: 1;
  visibility: visible;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.api-action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  padding: 11px 16px;
  border: 1px solid rgba(82, 98, 129, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #314156;
  font: 600 0.92rem/1 var(--font-ui);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: #f5f7fa;
  border-color: rgba(87, 162, 132, 0.28);
  transform: translateY(-1px);
}

.request-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--cqa-bunker);
  color: #ffffff;
  font: 600 0.92rem/1 var(--font-ui);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.request-button:hover,
.request-button:focus-visible {
  background: #171d27;
  transform: translateY(-1px);
}

.request-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.status-message {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(82, 98, 129, 0.16);
  border-radius: 12px;
  background: #f7f9fc;
  color: #516071;
  line-height: 1.55;
  white-space: pre-wrap;
}

.status-message[data-kind="success"] {
  border-color: rgba(90, 167, 137, 0.35);
  background: rgba(90, 167, 137, 0.1);
  color: #295745;
}

.status-message[data-kind="warning"] {
  border-color: rgba(184, 134, 11, 0.35);
  background: rgba(184, 134, 11, 0.08);
  color: #6d580f;
}

.status-message[data-kind="error"] {
  border-color: rgba(203, 90, 87, 0.35);
  background: rgba(203, 90, 87, 0.08);
  color: #7e2f2d;
}

.create-key-result {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 8px;
}

.account-link {
  color: var(--cqa-dark-viridian);
  text-decoration: none;
  font-weight: 600;
}

.account-link:hover,
.account-link:focus-visible {
  text-decoration: underline;
}

.resource-list {
  margin: 0;
  padding-left: 20px;
}

.resource-list li::marker {
  color: var(--cqa-patina);
}

pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid rgba(211, 216, 222, 0.9);
  border-radius: 16px;
  background: var(--code-bg);
  color: #243246;
  font-size: 0.92rem;
  line-height: 1.55;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.inline-code {
  padding: 2px 7px;
  border: 1px solid rgba(211, 216, 222, 0.9);
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 0.92em;
}

input:focus,
textarea:focus,
select:focus,
.api-form-group .ms-search input:focus {
  border-color: rgba(87, 162, 132, 0.52) !important;
  box-shadow: 0 0 0 4px rgba(87, 162, 132, 0.12);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .panel {
    padding: 20px 16px 20px;
  }

  .page-header {
    display: grid;
    gap: 16px;
  }

  .brand-heading {
    gap: 14px;
  }

  .brand-logo {
    height: 32px;
    max-width: 220px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .intro {
    font-size: 0.98rem;
  }

  .step summary {
    grid-template-columns: 18px 1fr auto;
    gap: 10px;
    padding: 14px;
  }

  .step-body {
    padding: 0 14px 16px 42px;
  }

  .step.step-no-indent .step-body {
    padding-left: 14px;
  }

  .step[data-path-step] .step-body {
    padding-left: 14px;
  }

  .api-test-section {
    padding: 16px;
  }

  .api-action-row {
    flex-direction: column;
  }

  .secondary-button,
  .request-button,
  .primary-button,
  .utility-link {
    width: 100%;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .request-walkthrough {
    position: static;
    width: 100%;
    margin: 0 0 16px;
    padding: 14px 16px;
  }
}

@media (min-width: 1920px) {
  .step[data-has-walkthrough="true"] .step-body-inner {
    display: block;
  }

  .step[data-has-walkthrough="true"] {
    overflow: visible;
  }

  .step[data-has-walkthrough="true"] .request-walkthrough {
    position: absolute;
    top: 0;
    left: calc(100% + 26px);
    width: 280px;
    margin: 0;
  }
}
