:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  background: #f2f5f8;
}

.demo-header {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 16px;
  color: #fff;
  background: #27628f;
  box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}

.demo-header strong {
  margin-right: 10px;
  font-size: 18px;
}

.demo-header span,
.status {
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.status {
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.status.error {
  color: #ffe0e0;
}

#map {
  min-width: 0;
  min-height: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.header-button,
.icon-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 6px;
}

.header-button {
  padding: 7px 11px;
  color: #174362;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.workspace.explorer-open {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
}

.api-explorer {
  min-width: 0;
  overflow: hidden;
  color: #22313d;
  background: #fff;
  border-left: 1px solid #d9e1e8;
  box-shadow: -4px 0 14px rgb(16 42 67 / 12%);
}

.workspace:not(.explorer-open) .api-explorer {
  visibility: hidden;
}

.explorer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #e4eaf0;
}

.explorer-header h1,
.response-header h2 {
  margin: 0;
  color: #183b56;
}

.explorer-header h1 {
  font-size: 19px;
}

.explorer-header p {
  margin: 5px 0 0;
  color: #61758a;
  font-size: 12px;
  line-height: 1.4;
}

.icon-button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: #53697d;
  background: #eef3f7;
  font-size: 21px;
  line-height: 1;
}

.explorer-content {
  height: calc(100% - 86px);
  padding: 15px 18px 24px;
  overflow-y: auto;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.field > span {
  color: #334e68;
  font-size: 12px;
  font-weight: 650;
}

.field small {
  color: #8293a3;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 10px;
  color: #243b53;
  background: #fbfcfe;
  border: 1px solid #cbd6e0;
  border-radius: 6px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #2e75a7;
  box-shadow: 0 0 0 3px rgb(46 117 167 / 13%);
}

.field textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.method-summary {
  margin: -2px 0 14px;
  padding: 10px;
  background: #f4f7fa;
  border-radius: 6px;
}

.method-summary p {
  margin: 7px 0 0;
  color: #52677a;
  font-size: 12px;
  line-height: 1.4;
}

.safety-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.safety-badge.allowed {
  color: #116530;
  background: #dff5e6;
}

.safety-badge.blocked {
  color: #8a3b12;
  background: #ffeadb;
}

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

.path-params:empty {
  display: none;
}

.api-warning {
  min-height: 18px;
  margin: -2px 0 10px;
  color: #9a4b16;
  font-size: 12px;
  line-height: 1.4;
}

.explorer-buttons {
  display: flex;
  gap: 9px;
  margin-bottom: 17px;
}

.primary-button,
.secondary-button {
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 650;
}

.primary-button {
  color: #fff;
  background: #276b99;
}

.primary-button:disabled {
  cursor: not-allowed;
  color: #8b9aa8;
  background: #dfe6ec;
}

.secondary-button {
  color: #285a7d;
  background: #e7f0f6;
}

.response-section {
  border-top: 1px solid #e4eaf0;
  padding-top: 13px;
}

.response-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.response-header h2 {
  font-size: 15px;
}

.response-header span {
  color: #6f8191;
  font-size: 11px;
  text-align: right;
}

#api-response {
  min-height: 150px;
  max-height: 420px;
  margin: 0;
  padding: 11px;
  overflow: auto;
  color: #dce7ef;
  background: #172a3a;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 900px) {
  .workspace,
  .workspace.explorer-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-explorer {
    position: absolute;
    z-index: 20;
    top: 48px;
    right: 0;
    bottom: 0;
    width: min(92vw, 460px);
  }

  .workspace:not(.explorer-open) .api-explorer {
    display: none;
  }

  .status {
    display: none;
  }
}
