:root {
  --paper: #f4f3ef;
  --surface: #ffffff;
  --ink: #171a1d;
  --muted: #656b70;
  --line: #d7d9d6;
  --line-strong: #aeb3b0;
  --test: #087f5b;
  --test-soft: #dff3eb;
  --production: #c92a2a;
  --production-soft: #fff0ee;
  --amber: #b35c00;
  --focus: #1769aa;
  --sidebar: #202427;
  --sidebar-muted: #aeb6ba;
  --radius: 6px;
  font-family: "Avenir Next", "IBM Plex Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

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

body {
  background: var(--paper);
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
  outline-offset: 1px;
}

[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: #191d20;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 42px;
  border: 1px solid #454b4f;
  border-radius: var(--radius);
  background: #f8f8f5;
  box-shadow: 14px 14px 0 #0e1012;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 4px;
  background: var(--ink);
  color: white;
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: 24px;
  font-weight: 800;
}

.brand-mark-small {
  width: 32px;
  height: 32px;
  font-size: 17px;
}

.eyebrow,
.method-label,
.field-label {
  margin: 20px 0 4px;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 0 0 34px;
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: 38px;
  line-height: 1;
}

label {
  display: grid;
  gap: 8px;
  color: #393e41;
  font-size: 13px;
  font-weight: 650;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.password-row button,
.primary-button,
.danger-button,
.secondary-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 9px 16px;
  font-weight: 750;
}

.password-row button,
.primary-button {
  background: var(--ink);
  color: white;
}

.primary-button:hover,
.password-row button:hover {
  background: #34393c;
}

.secondary-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.danger-button {
  background: var(--production);
  color: white;
}

.quiet-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 700;
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--production);
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: grid;
  min-height: 64px;
  grid-template-columns: minmax(210px, 1fr) auto minmax(280px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand-lockup,
.account-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: 15px;
}

.brand-lockup span {
  color: var(--muted);
  font-size: 11px;
}

.environment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #eceeeb;
}

.environment-option {
  min-width: 104px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.environment-option.is-active[data-environment="test"] {
  background: var(--test);
  color: white;
}

.environment-option.is-active[data-environment="production"] {
  background: var(--production);
  color: white;
}

.account-state {
  justify-content: flex-end;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ba19e;
}

.status-dot.is-ready {
  background: var(--test);
  box-shadow: 0 0 0 3px var(--test-soft);
}

.status-dot.is-missing {
  background: var(--production);
  box-shadow: 0 0 0 3px var(--production-soft);
}

.production-banner {
  padding: 7px 18px;
  border-bottom: 1px solid #e3a8a2;
  background: var(--production-soft);
  color: #8f1f1f;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  min-height: calc(100vh - 64px);
  grid-template-columns: 224px minmax(420px, 1fr) minmax(330px, 38vw);
}

.sidebar {
  background: var(--sidebar);
  color: white;
  padding: 18px 10px;
}

.nav-group-title {
  margin: 16px 10px 6px;
  color: var(--sidebar-muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-operation {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #dce0e2;
  padding: 7px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
}

.nav-operation:hover {
  background: #2c3134;
}

.nav-operation.is-active {
  border-left-color: #52d6a4;
  background: #343a3d;
  color: white;
}

.nav-method {
  color: #8f999e;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 9px;
}

.operation-workspace {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.operation-header {
  display: flex;
  min-height: 104px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.method-label {
  margin: 0 0 4px;
  color: var(--test);
}

.operation-header h1 {
  margin: 0;
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: 26px;
}

.operation-path {
  max-width: 55%;
  overflow: hidden;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-form {
  padding: 28px;
}

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

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

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.execution-controls {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.switch-control {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
}

.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: #aeb3b0;
  transition: background 150ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  content: "";
  transition: transform 150ms ease;
}

.switch-control input:checked + .switch-track {
  background: var(--test);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(15px);
}

.response-panel {
  min-width: 0;
  background: #15191b;
  color: #dfe6e2;
}

.response-header {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #343a3d;
  color: #9fa8ac;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 10px;
}

.response-status {
  margin-right: 8px;
  color: #58d6a6;
  font-weight: 800;
}

.response-status.is-error {
  color: #ff756b;
}

.response-panel pre {
  width: 100%;
  min-height: calc(100vh - 112px);
  margin: 0;
  overflow: auto;
  padding: 20px;
  color: #dfe6e2;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.callback-panel {
  padding: 28px;
}

.callback-url-row,
.callback-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.callback-url-row {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.callback-url-row code {
  display: block;
  max-width: 540px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-toolbar {
  margin-top: 26px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.callback-events {
  display: grid;
}

.callback-event {
  display: grid;
  grid-template-columns: 120px minmax(100px, 1fr) 90px;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 11px;
}

.callback-event button {
  grid-column: 1 / -1;
  border: 0;
  background: transparent;
  color: var(--focus);
  padding: 0;
  text-align: left;
  font-size: 11px;
}

.empty-state {
  padding: 42px 0;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(12, 15, 17, 0.72);
}

.confirmation-form {
  padding: 28px;
}

.confirmation-form h2 {
  margin: 0 0 8px;
}

.confirmation-form p {
  color: var(--muted);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

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

  .response-panel {
    grid-column: 1 / -1;
  }

  .response-panel pre {
    min-height: 320px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .environment-control {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .account-state {
    max-width: 48vw;
  }

  #active-account {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    overflow-x: auto;
    padding: 8px;
  }

  #operation-nav {
    display: flex;
    width: max-content;
    gap: 4px;
  }

  .nav-group-title {
    display: none;
  }

  .nav-operation {
    width: auto;
    min-width: max-content;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .nav-operation.is-active {
    border-bottom-color: #52d6a4;
  }

  .nav-method {
    margin-left: 8px;
  }

  .operation-header {
    min-height: 92px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
  }

  .operation-path {
    max-width: 100%;
  }

  .operation-form,
  .callback-panel {
    padding: 18px;
  }

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

  .field-full {
    grid-column: auto;
  }

  .callback-url-row {
    align-items: stretch;
    flex-direction: column;
  }

  .callback-event {
    grid-template-columns: 1fr;
  }
}
