:root {
  --ink: #203c35;
  --muted: #62776f;
  --line: #dce4df;
  --green: #007e63;
  --soft: #eef5f0;
  --white: #fff;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f5f7f3;
  color: var(--ink);
  font:
    14px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 550;
}
button:hover {
  background: var(--soft);
  border-color: #aec8bb;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
a {
  color: var(--green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid #58baa5;
  outline-offset: 3px;
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 32px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 19px;
}
.brand-mark {
  height: 38px;
  width: 38px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  border-radius: 11px;
  position: relative;
  font-size: 24px;
}
.brand-mark span {
  position: absolute;
  font-size: 15px;
  right: 4px;
  top: 0;
}
.brand-sub {
  font-size: 12px;
  font-weight: 450;
  display: block;
  color: var(--muted);
}
.environment {
  display: flex;
  gap: 9px;
  align-items: center;
  font: 12px var(--mono);
  background: #edf5eb;
  padding: 7px 10px;
  border-radius: 6px;
}
.environment b {
  background: #d5eabd;
  border-radius: 4px;
  padding: 3px 5px;
  color: #346124;
}
.topbar nav {
  margin-left: auto;
  display: flex;
  gap: 24px;
  font-size: 12px;
}
main {
  max-width: 1720px;
  margin: auto;
  padding: 26px 32px;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin: 7px 0;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.3px;
  margin: 8px 0;
}
h3 {
  font-size: 15px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.intro p {
  margin: 3px 0;
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--green);
}
.safety-label {
  color: var(--muted);
  font-size: 12px;
}
.credentials {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 12px 18px;
}
.credentials summary {
  font-weight: 600;
  cursor: pointer;
}
.credentials summary span {
  float: right;
  font-weight: 450;
  color: var(--muted);
  font-size: 12px;
}
.credential-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 14px;
  align-items: end;
  margin-top: 12px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 12px 0;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fcfdfb;
  color: var(--ink);
  border-radius: 6px;
  padding: 9px 10px;
  width: 100%;
  margin-top: 5px;
  min-width: 0;
}
textarea {
  resize: vertical;
  font: 12px/1.6 var(--mono);
}
input[type='checkbox'] {
  width: auto;
  margin: 0;
}
small,
.fine {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.fine {
  overflow-wrap: anywhere;
}
.inline {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.inline button {
  margin-top: 5px;
}
.credential-grid label {
  margin: 0;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #006b54;
  color: white;
}
.notice {
  padding: 12px 2px;
  min-height: 43px;
  font-size: 12px;
  color: var(--muted);
}
.notice.error {
  color: #a53e39;
}
.workspace {
  display: grid;
  grid-template-columns: 185px minmax(310px, 0.95fr) minmax(340px, 1.15fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  overflow: hidden;
  min-height: 500px;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--muted);
  margin-bottom: 16px;
}
.panel-title span {
  letter-spacing: 0;
  font-weight: 450;
  font-family: var(--mono);
  font-size: 10px;
}
.catalog {
  padding: 20px 12px;
  background: #fafcf9;
  border-right: 1px solid var(--line);
}
.catalog input {
  font-size: 11px;
  padding: 8px;
}
.catalog h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7d9086;
  margin: 22px 8px 6px;
}
.catalog button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 450;
  font-size: 12px;
  padding: 8px;
}
.catalog button.active {
  background: #dfefe6;
  color: #00674e;
  font-weight: 650;
}
.builder,
.response {
  padding: 20px;
  min-width: 0;
}
.builder {
  border-right: 1px solid var(--line);
}
.muted {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 16px;
}
.method-path {
  display: flex;
  gap: 6px;
}
.method-path select {
  width: 80px;
  flex-shrink: 0;
  color: var(--green);
  font-weight: 700;
  font-family: var(--mono);
}
.method-path input {
  font: 12px var(--mono);
}
.url {
  font: 10px/1.6 var(--mono);
  overflow-wrap: anywhere;
  color: var(--muted);
  margin: 10px 0;
  min-height: 16px;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 17px 0;
}
.actions .primary {
  flex: 1;
}
.actions a {
  font-size: 12px;
  margin-left: 4px;
}
.code-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.code-section summary,
details summary {
  cursor: pointer;
  font-size: 12px;
}
.code-section pre {
  max-height: 180px;
  overflow: auto;
  font: 11px/1.6 var(--mono);
}
.tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  margin: 12px 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}
.tabs button {
  border: 0;
  font-size: 11px;
  padding: 6px 8px;
  font-weight: 450;
}
.tabs button[aria-pressed='true'] {
  background: var(--soft);
  color: var(--green);
  font-weight: 700;
}
.metrics {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}
.metrics > div {
  padding: 12px;
}
.metrics small {
  font-size: 9px;
  display: block;
  letter-spacing: 0.7px;
}
.metrics strong {
  display: block;
  font: 14px var(--mono);
  margin-top: 6px;
}
#response-body {
  font: 11px/1.7 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  max-height: 450px;
  min-height: 230px;
  color: #365547;
}
.json-key {
  color: #386d9c;
}
.json-string {
  color: #198164;
}
.json-number {
  color: #a56520;
}
.json-literal {
  color: #8e5a9b;
}
.response-footer {
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
#large-response {
  font-size: 12px;
  background: #fff6df;
  padding: 10px;
  border-radius: 6px;
}
#large-response button {
  margin-left: 8px;
}
.examples {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
}
.examples > div {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.examples button {
  font-size: 11px;
  border-radius: 20px;
  padding: 6px 12px;
}
.map-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.map-area {
  position: relative;
  min-width: 0;
}
.map-toolbar {
  height: 72px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.map-toolbar h2 {
  margin: 0;
  font-size: 16px;
}
#map {
  height: 440px;
  background: #e4ede5;
}
#map-placeholder {
  position: absolute;
  top: 260px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffffed;
  padding: 16px 22px;
  border-radius: 8px;
  z-index: 500;
  max-width: 80%;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 6px 24px #213b3412;
}
.map-status {
  padding: 9px 16px;
  font-size: 11px;
  color: var(--muted);
}
.map-settings {
  padding: 12px 18px;
  border-left: 1px solid var(--line);
}
.map-settings label {
  margin: 8px 0;
}
.map-settings input,
.map-settings select {
  padding: 6px;
  font-size: 12px;
}
.center-fields,
.tile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.tile-fields {
  grid-template-columns: 1.6fr 0.6fr 1fr 1fr;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.map-settings pre {
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
  font: 10px/1.6 var(--mono);
}
.history-section {
  margin: 24px 0;
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: 10px;
  background: white;
}
#history {
  font: 11px/1.7 var(--mono);
  max-height: 200px;
  overflow: auto;
  color: var(--muted);
}
.history-row {
  display: grid;
  grid-template-columns: 55px 1fr 55px 80px;
  gap: 10px;
  border-top: 1px solid #edf1ed;
  padding: 7px 0;
  overflow-wrap: anywhere;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 32px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
#raster-preview {
  max-width: 256px;
  border: 1px solid var(--line);
  margin: 8px;
}
.map-marker {
  width: 13px;
  height: 13px;
  background: #007e63;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 4px #0005;
}
.safe-popup {
  font: 12px/1.5 system-ui;
  max-width: 220px;
  overflow-wrap: anywhere;
}
.safe-popup strong {
  display: block;
}
.leaflet-container {
  font-family: inherit;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  main {
    padding: 20px;
  }
  .workspace {
    grid-template-columns: 150px 1fr 1fr;
  }
  .builder,
  .response {
    padding: 14px;
  }
  .credential-grid {
    grid-template-columns: 1fr 1fr;
  }
  .topbar {
    padding: 0 20px;
  }
  .topbar nav {
    gap: 10px;
  }
  .safety-label {
    display: none;
  }
}
@media (max-width: 800px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .catalog {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #endpoints {
    max-height: 180px;
    overflow: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  #endpoints h3 {
    width: 100%;
    margin: 8px;
  }
  #endpoints button {
    width: auto;
  }
  .builder {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .map-section {
    grid-template-columns: 1fr;
  }
  .map-settings {
    border-left: 0;
  }
  .topbar {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
  }
  .topbar nav {
    display: none;
  }
  .environment {
    margin-left: auto;
    font-size: 10px;
  }
  .intro h1 {
    font-size: 23px;
  }
  .examples {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .metrics strong {
    font-size: 12px;
  }
  footer span {
    max-width: 55%;
    text-align: right;
  }
}
@media (max-width: 480px) {
  main {
    padding: 14px;
  }
  .credential-grid {
    grid-template-columns: 1fr;
  }
  .brand {
    font-size: 16px;
  }
  .brand-sub {
    font-size: 10px;
  }
  .environment span {
    display: none;
  }
  .tabs {
    flex-wrap: wrap;
  }
}

@media (min-width: 801px) {
  .workspace {
    height: 660px;
  }
  .catalog,
  .builder,
  .response {
    overflow: auto;
  }
  .catalog {
    scrollbar-width: thin;
  }
}

#division-panel { padding: 16px; background: #f4f7f6; border-top: 1px solid #d6e0dc; }
#division-info, #boundary-state { overflow-wrap: anywhere; }
#division-results { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; margin: 10px 0; }
#division-results button { font-size: 12px; padding: 6px 10px; }
#division-results button[aria-pressed="true"] { border: 2px solid #007e69; background: #e1f2e9; }
