:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --border: #e0e2e8;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --accent: #4f5bd5;
  --accent-hover: #3f4ab8;
  --accent-contrast: #ffffff;
  --accent-soft: #eef0ff;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1c1f26;
  --surface-2: #242832;
  --border: #2e323d;
  --text: #e6e8ec;
  --text-muted: #9298a5;
  --accent: #7c86f2;
  --accent-hover: #949cf5;
  --accent-contrast: #12131a;
  --accent-soft: #222646;
  --green: #4ade80;
  --green-bg: #14301f;
  --red: #f87171;
  --red-bg: #3a1a1a;
  --amber: #fbbf24;
  --amber-bg: #3a2c0f;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1c1f26;
    --surface-2: #242832;
    --border: #2e323d;
    --text: #e6e8ec;
    --text-muted: #9298a5;
    --accent: #7c86f2;
    --accent-hover: #949cf5;
    --accent-contrast: #12131a;
    --accent-soft: #222646;
    --green: #4ade80;
    --green-bg: #14301f;
    --red: #f87171;
    --red-bg: #3a1a1a;
    --amber: #fbbf24;
    --amber-bg: #3a2c0f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--border));
  border-radius: 8px;
  background: var(--amber-bg);
  color: var(--text);
  font-size: 12.5px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.hint {
  margin: -4px 0 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline span { white-space: nowrap; }

input[type="text"], input[type="url"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  width: 100%;
  min-width: 0;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.checkbox-line input { width: auto; }

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.danger-ghost { background: transparent; color: var(--red); border-color: var(--red); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.btn-row.compact { margin: 10px 0 0; }
.spacer { flex: 1; }

#pasteBox { margin-top: 4px; }

.drop-zone {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  margin: 12px 0;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.drop-zone span {
  color: var(--text-muted);
  font-size: 12px;
}
.drop-zone.dragging,
.drop-zone:focus {
  outline: none;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.row-head { display: none; }

.row-grid {
  display: grid;
  grid-template-columns: 28px 90px 1.5fr 130px 1.3fr 80px 1fr 32px;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.row-grid.row-head { display: none; }

.request-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
}
.request-card:last-child { border-bottom: none; }
.request-card.row-drop-before {
  border-top: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.request-main {
  display: grid;
  grid-template-columns: 92px minmax(260px, 1fr) 132px 86px minmax(120px, 150px) auto;
  gap: 8px;
  align-items: start;
}
.request-method,
.request-path,
.request-meta,
.result-cell,
.actions-cell {
  min-width: 0;
}
.method-select {
  font-weight: 800;
  letter-spacing: 0;
}
.request-note {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.compact-field > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.request-chips {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -2px;
}
.request-chip {
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.request-extra {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 2px;
}
.request-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.panel-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.panel-head strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.panel-head span {
  color: var(--text-muted);
  font-size: 12px;
}
.panel-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.body-editor {
  display: block;
  min-height: 190px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}
.body-editor:focus {
  outline-offset: -2px;
}
.response-url {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.response-body,
.request-sent pre {
  margin: 0;
  padding: 12px;
  max-height: 440px;
  overflow: auto;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
}
.request-sent {
  border-bottom: 1px solid var(--border);
}
.request-sent summary {
  cursor: pointer;
  padding: 9px 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.actions-cell .btn {
  min-width: 54px;
}
.row-grid.row-drop-before {
  border-top: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.drag-cell { display: flex; align-items: flex-start; justify-content: center; padding-top: 6px; }
.row-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  user-select: none;
}
.row-drag-handle:active { cursor: grabbing; }

.stage-lane {
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.stage-lane.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
#rowsList.single-lane .stage-lane { border: none; margin-bottom: 0; }
#rowsList.single-lane .stage-lane-header { display: none; }
#rowsList.single-lane .stage-lane-body { padding: 0; }

.stage-lane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-radius: 9px 9px 0 0;
  cursor: grab;
}
.stage-lane-header:active { cursor: grabbing; }
.lane-drag-handle { color: var(--text-muted); font-size: 15px; }
.lane-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.lane-hint { font-size: 11px; color: var(--text-muted); flex: 1; }

.stage-lane-body { padding: 4px 12px; }
.lane-empty-hint {
  padding: 18px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

.advanced-line {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 0 6px;
  margin-top: -6px;
}

.custom-var-input { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.vars-panel { margin: 4px 0 14px; }
.vars-box {
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 12px;
  max-height: 220px;
  overflow: auto;
}
.var-line { padding: 2px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.var-line code { background: none; padding: 0; color: var(--accent); }
.row-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}
.row-item textarea { min-height: 34px; }
.row-item .path-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.row-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px;
}
.row-remove:hover { color: var(--red); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.idle { background: var(--surface-2); color: var(--text-muted); }
.badge.pending { background: var(--surface-2); color: var(--text-muted); }
.badge.pass { background: var(--green-bg); color: var(--green); }
.badge.fail { background: var(--red-bg); color: var(--red); }
.badge.bug { background: var(--amber-bg); color: var(--amber); }
.badge.error { background: var(--red-bg); color: var(--red); }

.result-cell { display: flex; flex-direction: column; gap: 4px; }
.result-toggle {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 12px; padding: 0; text-align: left;
}
.run-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  z-index: 20;
}
.run-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.summary { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.summary .pass { color: var(--green); font-weight: 700; }
.summary .bug { color: var(--amber); font-weight: 700; }
.summary .fail { color: var(--red); font-weight: 700; }
.muted { color: var(--text-muted); }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 30;
  box-shadow: var(--shadow);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 70;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 22%, transparent);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.back-to-top[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 9, 15, 0.64);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.modal-head {
  padding: 18px 20px 8px;
}

.modal h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.modal-message {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.btn.danger:hover {
  filter: brightness(1.06);
}

@media (max-width: 860px) {
  .row-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }
  .row-head { display: none; }
  .row-item::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
  }
  .row-item.actions-cell { display: flex; justify-content: flex-end; }
  .drag-cell { display: none; }
  .request-card {
    grid-template-columns: 1fr;
    padding: 12px 10px;
  }
  .request-main {
    grid-template-columns: 1fr;
  }
  .request-chips,
  .request-extra {
    grid-column: 1;
  }
  .actions-cell {
    justify-content: stretch;
  }
  .actions-cell .btn {
    flex: 1;
  }
  .body-editor {
    min-height: 220px;
  }
  .panel-head {
    flex-wrap: wrap;
  }
  .panel-actions {
    margin-left: 0;
    width: 100%;
  }
  .panel-actions .btn {
    flex: 1;
  }
  .stage-lane-header { flex-wrap: wrap; }
  .lane-hint { flex-basis: 100%; order: 3; }
  .drop-zone { min-height: 78px; padding: 12px; }
}

/* Polished workspace refresh */
:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #edf3f7;
  --border: #d9e1ea;
  --text: #142033;
  --text-muted: #637083;
  --accent: #0f8b8d;
  --accent-hover: #0b7375;
  --accent-contrast: #ffffff;
  --accent-soft: #dff7f5;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #a16207;
  --amber-bg: #fef3c7;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(23, 36, 52, 0.08);
}

:root[data-theme="dark"] {
  --bg: #0f141b;
  --surface: #171d26;
  --surface-2: #202733;
  --surface-3: #111820;
  --border: #2d3746;
  --text: #eff5fb;
  --text-muted: #9caabd;
  --accent: #39c7bd;
  --accent-hover: #63d8d0;
  --accent-contrast: #061014;
  --accent-soft: #143638;
  --green: #55d987;
  --green-bg: #153522;
  --red: #fb7185;
  --red-bg: #3b1721;
  --amber: #facc15;
  --amber-bg: #382c0c;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --surface: #171d26;
    --surface-2: #202733;
    --surface-3: #111820;
    --border: #2d3746;
    --text: #eff5fb;
    --text-muted: #9caabd;
    --accent: #39c7bd;
    --accent-hover: #63d8d0;
    --accent-contrast: #061014;
    --accent-soft: #143638;
    --green: #55d987;
    --green-bg: #153522;
    --red: #fb7185;
    --red-bg: #3b1721;
    --amber: #facc15;
    --amber-bg: #382c0c;
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  }
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 85%, var(--bg)) 0, var(--bg) 360px);
}

.topbar {
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.topbar-inner,
.container,
.run-bar-inner {
  max-width: 1540px;
}

.topbar-inner {
  padding: 16px 28px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 53px;
  height: 40px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(37, 84, 255, 0.2));
}

.brand h1 {
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
}

.brand p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.container {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 22px 28px 108px;
  width: 100%;
}

.setup-rail {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.card {
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.setup-card {
  padding: 16px;
}

.setup-card .grid-2,
.setup-card .grid-3 {
  grid-template-columns: 1fr;
  min-width: 0;
}

.workspace-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 76%, var(--surface));
}

.workspace-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
}

.workspace-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.workspace-head > div:first-child {
  min-width: 0;
}

.swagger-source-status {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.swagger-source-status[hidden],
.swagger-refresh-btn[hidden] {
  display: none;
}

.swagger-source-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent);
}

.swagger-source-status.is-loading {
  color: var(--accent);
}

.swagger-source-status.is-loading .swagger-source-status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
  animation: swagger-source-pulse 1.1s ease-in-out infinite;
}

.swagger-source-status.has-error {
  color: var(--red);
}

.swagger-source-status.has-error .swagger-source-status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent);
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.swagger-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.swagger-refresh-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.swagger-refresh-btn.is-loading svg {
  animation: swagger-import-spin 0.75s linear infinite;
}

@keyframes swagger-source-pulse {
  50% { opacity: 0.45; transform: scale(0.82); }
}

.workspace-card > .hint,
.workspace-card > .route-composer,
.workspace-card > .drop-zone,
.workspace-card > .btn-row,
.workspace-card > .endpoint-search,
.workspace-card > .vars-panel,
.workspace-card > #rowsHeader,
.workspace-card > #rowsList {
  margin-left: 20px;
  margin-right: 20px;
}

.workspace-card > .hint {
  margin-top: 16px;
  max-width: 960px;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  min-height: 40px;
  border-radius: 8px;
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.btn {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 13px;
}

.btn.small {
  min-height: 32px;
  padding: 5px 10px;
}

.btn.primary {
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 20%, transparent);
}

#pasteBox {
  min-height: 94px;
  padding: 12px;
  border-style: dashed;
}

.drop-zone {
  min-height: 78px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
}

.endpoint-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 78%, var(--surface));
}

.endpoint-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.endpoint-search-head label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.endpoint-search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.endpoint-search-input-wrap {
  position: relative;
  min-width: 0;
}

.endpoint-search-input-wrap svg {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 12px;
  z-index: 1;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.endpoint-search-input-wrap input {
  min-height: 42px;
  padding-inline-start: 38px;
}

.search-count {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--surface));
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.endpoint-search-clear {
  min-width: 82px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.endpoint-search-clear > span {
  font-size: 17px;
  line-height: 1;
}

.search-empty {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 150px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
  color: var(--text-muted);
  text-align: center;
}

.search-empty strong {
  color: var(--text);
  font-size: 15px;
}

.token-list {
  display: grid;
  gap: 10px;
}

.token-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.token-card > input {
  grid-column: 1 / -1;
}

.token-card-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.token-card-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.token-card-name-row.has-remove {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.token-card-name-row > input,
.token-card-meta > input {
  min-width: 0;
}

.token-card-name-row > input {
  font-weight: 750;
}

.token-card-name-row + input {
  margin-top: 2px;
}

.token-remove-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--red-bg) 65%, transparent);
  color: var(--red);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.token-remove-btn:hover {
  border-color: color-mix(in srgb, var(--red) 58%, var(--border));
  background: var(--red-bg);
  transform: translateY(-1px);
}

.token-remove-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

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

.token-card-actions[hidden],
.token-apply-all-btn[hidden] {
  display: none;
}

.token-apply-all-btn,
.token-info-toggle {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-color: color-mix(in srgb, var(--action, var(--accent)) 38%, var(--border));
  background: color-mix(in srgb, var(--action, var(--accent)) 9%, var(--surface));
  color: color-mix(in srgb, var(--action, var(--accent)) 80%, var(--text));
}

.token-apply-all-btn svg,
.token-info-toggle svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.token-apply-all-btn:hover:not(:disabled),
.token-info-toggle:hover:not(:disabled),
.token-info-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--action, var(--accent)) 58%, var(--border));
  background: color-mix(in srgb, var(--action, var(--accent)) 15%, var(--surface));
  color: var(--action, var(--accent));
}

.token-info-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 34%, var(--surface));
}

.token-info-panel[hidden] {
  display: none;
}

.token-info-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.token-info-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--text-muted);
  content: '';
}

.token-info-status.is-ready::before {
  background: var(--green);
}

.token-info-status.is-expired {
  color: var(--amber);
}

.token-info-status.is-expired::before {
  background: var(--amber);
}

.token-info-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  font-size: 12px;
}

.token-info-row > span {
  color: var(--text-muted);
  font-weight: 650;
}

.token-info-row > code {
  min-width: 0;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .token-card-actions {
    flex-wrap: wrap;
  }

  .token-apply-all-btn,
  .token-info-toggle {
    min-height: 40px;
  }

  .token-info-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
}

.notice {
  border-radius: 8px;
  overflow-wrap: anywhere;
}

#rowsList {
  margin-top: 12px;
}

.stage-lane {
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--surface);
  overflow: hidden;
}

.stage-lane-header {
  padding: 11px 14px;
  background: color-mix(in srgb, var(--surface-2) 86%, var(--surface));
  border-radius: 0;
}

.lane-title {
  color: var(--text);
}

.lane-hint {
  font-size: 12px;
}

.lane-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.lane-remove {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.lane-remove:hover {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
  background: var(--red-bg);
}

.stage-lane-body {
  padding: 8px;
}

.request-card {
  grid-template-columns: 26px minmax(0, 1fr);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-2));
}

.request-card:last-child {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.request-main {
  grid-template-columns: 92px minmax(220px, 1fr) 136px 92px minmax(86px, 104px) 168px;
  gap: 12px;
  align-items: start;
}

.request-path .path-input {
  font-size: 14px;
  font-weight: 650;
}

.request-note {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-subline {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding-left: 104px;
  margin-top: -4px;
  min-width: 0;
}

.compact-field > span {
  display: none;
}

.compact-field {
  gap: 0;
}

.request-chip {
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
  color: var(--text-muted);
  flex: 0 0 auto;
}

.badge {
  min-height: 28px;
  border-radius: 8px;
  padding: 4px 10px;
}

.result-cell {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.result-stack {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-width: 0;
}

.result-toggle {
  margin-top: 0;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.row-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  border: 1px solid transparent;
}

.row-remove:hover {
  background: var(--red-bg);
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
}

.actions-cell {
  min-height: 40px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 168px;
}

.actions-cell .row-action {
  min-width: 58px;
  padding-left: 12px;
  padding-right: 12px;
}

.actions-cell .btn.primary {
  box-shadow: none;
}

.request-extra {
  gap: 14px;
}

.request-panel {
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 5%, transparent);
}

.body-editor {
  min-height: 240px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface-3) 45%, transparent);
  font-size: 13px;
  color: var(--text);
}

.response-body,
.request-sent pre {
  padding: 14px;
  max-height: 560px;
}

.run-bar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
}

.run-bar-inner {
  padding: 12px 28px;
}

.run-bar .field.inline input {
  width: 240px;
}

.run-bar .danger-ghost {
  background: color-mix(in srgb, var(--red-bg) 45%, transparent);
}

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

  .setup-rail {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .topbar-inner,
  .container,
  .run-bar-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand p {
    display: none;
  }

  .brand h1 {
    font-size: 17px;
  }

  .brand-logo {
    width: 50px;
    height: 38px;
  }

  #themeToggle {
    flex: 0 0 auto;
    padding-left: 10px;
    padding-right: 10px;
  }

  .setup-rail {
    grid-template-columns: 1fr;
  }

  .checkbox-line {
    align-items: flex-start;
  }

  .workspace-head {
    flex-direction: column;
    padding: 16px;
  }

  .workspace-actions {
    width: 100%;
  }

  .workspace-actions .btn {
    flex: 1;
  }

  .endpoint-search-controls .btn {
    width: auto;
  }

  .workspace-card > .hint,
.workspace-card > .route-composer,
.workspace-card > .drop-zone,
.workspace-card > .btn-row,
.workspace-card > .endpoint-search,
.workspace-card > .vars-panel,
  .workspace-card > #rowsHeader,
  .workspace-card > #rowsList {
    margin-left: 12px;
    margin-right: 12px;
  }

  .request-main {
    grid-template-columns: 1fr;
  }

  .run-bar {
    position: sticky;
  }

  .run-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .run-bar .field.inline {
    grid-column: 1 / -1;
    width: 100%;
  }

  .run-bar .field.inline input {
    width: 100%;
  }

  .run-bar .summary {
    grid-column: 1 / -1;
  }

  .run-bar .spacer {
    display: none;
  }

  .run-bar .btn {
    width: 100%;
  }

  .back-to-top {
    right: 14px;
    bottom: 118px;
  }
}

@media (max-width: 460px) {
  .topbar-inner {
    gap: 10px;
  }

  .container {
    padding-bottom: 132px;
  }

  .workspace-actions,
  .workspace-card > .btn-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-actions .btn,
  .workspace-card > .btn-row .btn {
    width: 100%;
  }
}

/* Final responsive pass: keep endpoint cards comfortable on tablets and phones. */
@media (max-width: 1080px) and (min-width: 861px) {
  .request-main {
    grid-template-columns: 92px minmax(220px, 1fr) 136px 92px;
  }

  .result-cell {
    grid-column: 1 / 3;
  }

  .actions-cell {
    grid-column: 3 / 5;
    min-width: 0;
  }
}

@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workspace-card {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .workspace-card > .hint,
  .workspace-card > .route-composer,
  .workspace-card > .drop-zone,
  .workspace-card > .btn-row,
  .workspace-card > .endpoint-search,
  .workspace-card > .vars-panel,
  .workspace-card > #rowsHeader,
  .workspace-card > #rowsList {
    margin-left: 10px;
    margin-right: 10px;
  }

  .stage-lane {
    border-radius: 8px;
  }

  .stage-lane-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
  }

  .lane-drag-handle {
    grid-column: 1;
    grid-row: 1;
  }

  .lane-title {
    grid-column: 2;
    grid-row: 1;
  }

  .lane-hint {
    grid-column: 1 / -1;
    grid-row: 2;
    order: initial;
    flex-basis: auto;
    line-height: 1.35;
  }

  .lane-actions {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
  }

  .stage-lane-body {
    padding: 8px;
  }

  .request-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    overflow: hidden;
  }

  .drag-cell {
    display: none;
  }

  .request-main {
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    width: 100%;
    min-width: 0;
  }

  .request-method,
  .request-path,
  .request-meta,
  .result-cell,
  .actions-cell {
    min-width: 0;
    width: 100%;
  }

  .request-path {
    grid-column: 2;
  }

  .request-meta {
    grid-column: 1 / -1;
  }

  .request-meta + .request-meta {
    grid-column: 1;
  }

  .result-cell {
    grid-column: 2;
    min-height: 40px;
    align-items: stretch;
    justify-content: center;
  }

  .actions-cell {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
    gap: 8px;
    min-width: 0;
    justify-content: stretch;
  }

  .actions-cell .btn,
  .actions-cell .row-action {
    width: 100%;
    min-width: 0;
  }

  .row-remove {
    width: 36px;
    height: 36px;
    justify-self: end;
  }

  .compact-field {
    gap: 5px;
  }

  .compact-field > span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .request-path .path-input,
  .method-select,
  .request-meta input,
  .request-meta select {
    min-height: 42px;
  }

  .request-note {
    max-width: 100%;
    white-space: normal;
  }

  .request-subline {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    min-height: 0;
    margin-top: 0;
    padding-left: 0;
    width: 100%;
    min-width: 0;
  }

  .request-chip {
    flex: 0 1 auto;
    max-width: 100%;
    line-height: 1.3;
  }

  .badge {
    width: max-content;
    max-width: 100%;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .result-stack {
    width: 100%;
  }

  .result-toggle {
    white-space: normal;
  }

  .request-extra {
    grid-column: 1;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .topbar-inner,
  .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .brand-logo {
    width: 45px;
    height: 34px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .card,
  .setup-card {
    padding: 14px;
  }

  .workspace-head {
    padding: 14px 12px;
  }

  .request-main {
    grid-template-columns: minmax(84px, 0.4fr) minmax(0, 1fr);
    gap: 8px;
  }

  .request-card {
    padding: 9px;
  }

  .stage-lane-body {
    padding: 7px;
  }

  .method-select,
  .request-path .path-input,
  .request-meta input,
  .request-meta select {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 13px;
  }

  .actions-cell {
    grid-template-columns: 1fr 1fr 34px;
  }

  .run-bar-inner {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    right: 12px;
    bottom: 98px;
  }
}

/* Named, collapsible execution groups. */
.stage-lane-body[hidden] {
  display: none !important;
}

.stage-lane.is-collapsed .stage-lane-header {
  border-bottom: 0;
}

.stage-lane {
  scroll-margin-top: 86px;
}

.stage-lane.is-run-active {
  border-color: color-mix(in srgb, var(--action, var(--accent)) 72%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--action, var(--accent)) 12%, transparent);
}

.stage-lane.is-run-active .stage-lane-header {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--action, var(--accent)) 18%, var(--surface)),
    color-mix(in srgb, var(--accent-soft) 76%, var(--surface-2)));
}

.lane-collapse-toggle {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--accent);
  cursor: pointer;
}

.lane-collapse-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
}

.lane-collapse-toggle:disabled {
  opacity: 0.68;
  cursor: default;
}

.lane-collapse-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lane-collapse-toggle span {
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.16s ease;
}

.stage-lane.is-collapsed .lane-collapse-toggle span {
  transform: rotate(-90deg);
}

[dir="rtl"] .stage-lane.is-collapsed .lane-collapse-toggle span {
  transform: rotate(90deg);
}

.lane-title {
  min-width: 0;
  max-width: min(360px, 42vw);
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.lane-count {
  min-width: 25px;
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 66%, var(--surface));
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
}

.lane-actions {
  margin-left: 0;
  margin-inline-start: auto;
}

@media (max-width: 640px) {
  .stage-lane-header {
    gap: 7px;
    padding: 10px;
  }

  .lane-drag-handle {
    display: none;
  }

  .lane-title {
    max-width: calc(100vw - 190px);
    font-size: 12px;
  }

  .lane-hint {
    flex-basis: 100%;
    order: 4;
    padding-inline-start: 37px;
  }

  .lane-actions {
    gap: 4px;
  }

  .lane-actions .btn.small {
    min-width: 0;
    padding-inline: 8px;
  }
}

/* Request uploads and streamed file responses. */
.body-panel-head {
  flex-wrap: wrap;
}

.body-panel-title {
  min-width: 180px;
  display: grid;
  gap: 2px;
}

.body-panel-title > strong,
.body-panel-title > span {
  display: block;
}

.body-mode-select {
  width: auto;
  min-width: 150px;
  min-height: 32px;
  margin-inline-start: auto;
  padding-block: 5px;
  font-size: 12px;
  font-weight: 750;
}

.body-panel-head .panel-actions {
  margin-inline-start: 0;
}

.multipart-editor,
.binary-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface-3) 45%, transparent);
}

.multipart-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) 105px minmax(220px, 1.35fr) 34px;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.multipart-row input,
.multipart-row select {
  min-height: 40px;
}

.multipart-value {
  min-width: 0;
}

.multipart-remove {
  align-self: center;
}

.multipart-empty {
  min-height: 110px;
  display: grid;
  place-content: center;
  gap: 3px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}

.multipart-empty strong {
  color: var(--text);
  font-size: 14px;
}

.request-file-picker {
  position: relative;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 2px 12px;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.request-file-picker:hover,
.request-file-picker:focus-visible,
.request-file-picker.is-dragging {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.request-file-picker.needs-file {
  border-color: color-mix(in srgb, var(--amber) 62%, var(--border));
  background: color-mix(in srgb, var(--amber-bg) 70%, var(--surface));
}

.request-file-picker strong,
.request-file-picker > span:not(.file-picker-action) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-file-picker strong {
  color: var(--text);
  font-size: 13px;
}

.request-file-picker > span:not(.file-picker-action) {
  color: var(--text-muted);
  font-size: 11.5px;
}

.request-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker-action {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 7px;
  color: var(--accent) !important;
  font-size: 11px;
  font-weight: 800;
}

.binary-editor {
  padding: 18px;
}

.binary-editor .request-file-picker {
  min-height: 112px;
}

.binary-editor > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.response-file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent-soft) 36%, var(--surface));
}

.response-file-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.response-file-meta span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11.5px;
}

.binary-response {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}

.binary-response > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
}

.binary-response strong {
  color: var(--text);
  font-size: 15px;
}

.binary-response p {
  max-width: 440px;
  margin: 0;
  font-size: 12px;
}

.response-preview-notice {
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  background: var(--amber-bg);
  color: var(--text-muted);
  font-size: 11.5px;
}

@media (max-width: 860px) {
  .body-panel-title {
    flex: 1 1 100%;
  }

  .body-mode-select {
    flex: 1 1 150px;
    width: 100%;
    margin-inline-start: 0;
  }

  .body-panel-head .panel-actions {
    flex: 1 1 100%;
  }

  .multipart-row {
    grid-template-columns: minmax(0, 1fr) 100px 34px;
  }

  .multipart-value {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .multipart-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .actions-cell {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 36px;
  }
}

@media (max-width: 520px) {
  .multipart-editor,
  .binary-editor {
    padding: 10px;
  }

  .multipart-row {
    grid-template-columns: minmax(0, 1fr) 92px 34px;
    padding: 8px;
  }

  .request-file-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-picker-action {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: 5px;
  }

  .response-file-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions-cell {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 34px;
    gap: 5px;
  }

  .actions-cell .row-action {
    padding-inline: 6px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lane-collapse-toggle span {
    transition: none;
  }

  .swagger-source-status.is-loading .swagger-source-status-dot,
  .swagger-refresh-btn.is-loading svg {
    animation: none;
  }
}

/* Swagger / OpenAPI URL import */
.swagger-import-modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.swagger-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 8px;
}

.swagger-import-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.swagger-import-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.swagger-import-intro {
  margin: 0;
  padding: 0 20px 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.swagger-url-field,
.swagger-import-options,
.swagger-base-option,
.swagger-import-feedback {
  margin-inline: 20px;
}

.swagger-url-field input {
  min-height: 46px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.swagger-import-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.swagger-base-option {
  align-items: flex-start;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.swagger-base-option input {
  margin-top: 3px;
}

.swagger-import-feedback {
  min-height: 42px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 74%, var(--surface));
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.swagger-import-feedback.is-loading {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  color: var(--accent);
}

.swagger-import-feedback.has-error {
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
  background: color-mix(in srgb, var(--red-bg) 74%, var(--surface));
  color: var(--red);
  font-weight: 700;
}

.swagger-import-actions {
  margin-top: 18px;
}

.swagger-import-actions .btn {
  min-width: 116px;
}

.swagger-import-submit-loading::before {
  content: '';
  width: 13px;
  height: 13px;
  display: inline-block;
  margin-inline-end: 7px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: swagger-import-spin 0.7s linear infinite;
}

@keyframes swagger-import-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 560px) {
  .swagger-import-head {
    padding: 16px 14px 8px;
  }

  .swagger-import-intro {
    padding-inline: 14px;
  }

  .swagger-url-field,
  .swagger-import-options,
  .swagger-base-option,
  .swagger-import-feedback {
    margin-inline: 14px;
  }

  .swagger-import-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .swagger-import-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 14px;
  }

  .swagger-import-actions .btn {
    min-width: 0;
    width: 100%;
  }
}

/* Final responsive polish for group search, endpoint actions, and collapse controls. */
.endpoint-headers-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-inline-size: max-content;
  white-space: nowrap;
}

.endpoint-headers-label {
  min-width: 0;
}

.endpoint-headers-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding-inline: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface));
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.lane-collapse-toggle {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-2));
  color: var(--text-muted);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.lane-collapse-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.stage-lane:not(.is-collapsed) .lane-collapse-toggle {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  color: var(--accent);
}

.lane-collapse-toggle:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 88%, var(--surface));
  color: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 14%, transparent);
}

.stage-lane.is-collapsed .lane-collapse-toggle svg {
  transform: rotate(-90deg);
}

[dir="rtl"] .stage-lane.is-collapsed .lane-collapse-toggle svg {
  transform: rotate(90deg);
}

.stage-lane.is-group-search-match {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 9%, transparent);
}

.stage-lane.is-group-search-match .stage-lane-header {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent-soft) 88%, var(--surface)),
    color-mix(in srgb, var(--surface-2) 82%, var(--surface)));
}

.lane-drag-handle.is-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

@media (max-width: 1080px) and (min-width: 861px) {
  .result-cell,
  .actions-cell {
    grid-column: 1 / -1;
  }

  .actions-cell {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(72px, 1fr) minmax(100px, auto) minmax(72px, 1fr) 40px;
  }
}

@media (max-width: 860px) {
  .endpoint-headers-btn {
    min-inline-size: 0;
  }

  .endpoint-headers-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 520px) {
  .endpoint-search-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .search-count {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  .lane-collapse-toggle {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lane-collapse-toggle,
  .lane-collapse-toggle svg {
    transition: none;
  }
}

/* Inline group naming. */
.lane-title-editor {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: visible;
}

.lane-title-value {
  min-width: 0;
  max-width: 100%;
  padding: 3px 4px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: text;
  font: inherit;
  letter-spacing: inherit;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-title-value:hover:not(:disabled),
.lane-title-value:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 48%, transparent);
  outline: none;
}

.lane-name-edit-btn,
.lane-name-editor-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.lane-name-edit-btn svg,
.lane-name-editor-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.lane-name-edit-btn:hover:not(:disabled),
.lane-name-edit-btn:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
  color: var(--accent);
  outline: none;
}

.lane-name-edit-btn:disabled,
.lane-title-value:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.lane-title-editor.is-editing {
  width: min(430px, 42vw);
  max-width: min(430px, 42vw);
}

.lane-name-input {
  min-width: 120px;
  width: 100%;
  height: 34px;
  padding: 6px 9px;
  border-color: var(--accent);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.lane-name-input.has-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 13%, transparent);
}

.lane-name-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lane-name-editor-btn.is-save {
  border-color: color-mix(in srgb, var(--action, var(--accent)) 44%, var(--border));
  background: color-mix(in srgb, var(--action, var(--accent)) 14%, var(--surface));
  color: var(--action, var(--accent));
}

.lane-name-editor-btn.is-save:hover,
.lane-name-editor-btn.is-save:focus-visible {
  background: var(--action, var(--accent));
  color: var(--action-contrast, var(--accent-contrast));
  outline: none;
}

.lane-name-editor-btn.is-cancel {
  font-size: 18px;
  line-height: 1;
}

.lane-name-editor-btn.is-cancel:hover,
.lane-name-editor-btn.is-cancel:focus-visible {
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
  background: var(--red-bg);
  color: var(--red);
  outline: none;
}

/* Full endpoint path editor. */
.endpoint-path-modal {
  width: min(760px, 100%);
}

.endpoint-path-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
}

.endpoint-path-head .guide-eyebrow {
  display: block;
  margin-bottom: 4px;
}

.endpoint-path-method {
  min-width: 62px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: center;
}

.endpoint-path-method[data-method="POST"] { color: var(--action); border-color: color-mix(in srgb, var(--action) 42%, var(--border)); }
.endpoint-path-method[data-method="PUT"],
.endpoint-path-method[data-method="PATCH"] { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 42%, var(--border)); }
.endpoint-path-method[data-method="DELETE"] { color: var(--red); border-color: color-mix(in srgb, var(--red) 42%, var(--border)); }

.endpoint-path-content {
  padding: 2px 20px 20px;
}

.endpoint-path-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.endpoint-path-label label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.endpoint-path-label span {
  color: var(--text-muted);
  font-size: 10.5px;
  white-space: nowrap;
}

#endpointPathInput {
  width: 100%;
  min-height: 170px;
  max-height: 46vh;
  resize: vertical;
  padding: 13px 14px;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: pre-wrap;
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--text) 6%, transparent);
}

#endpointPathInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

#endpointPathHelp {
  margin: 7px 0 12px;
  color: var(--text-muted);
  font-size: 10.5px;
}

#endpointPathHelp kbd {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.endpoint-path-preview {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.endpoint-path-preview span,
.endpoint-path-preview code {
  display: block;
}

.endpoint-path-preview span {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.endpoint-path-preview code {
  max-height: 112px;
  overflow: auto;
  color: color-mix(in srgb, var(--text) 84%, var(--accent));
  font-size: 11.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.endpoint-path-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.endpoint-path-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.endpoint-path-copy.is-copied {
  border-color: color-mix(in srgb, var(--green) 42%, var(--border));
  background: var(--green-bg);
  color: var(--green);
}

@media (max-width: 640px) {
  .lane-title-editor.is-editing {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
  }

  .stage-lane-header:has(.lane-title-editor.is-editing) .lane-actions {
    grid-row: 3;
  }

  .stage-lane-header:has(.lane-title-editor.is-editing) .lane-hint {
    grid-row: 4;
  }

  .lane-name-edit-btn,
  .lane-name-editor-btn {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .endpoint-path-content {
    padding-inline: 14px;
  }

  .endpoint-path-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 14px;
  }

  .endpoint-path-actions .btn {
    min-width: 0;
  }

  #endpointPathSave {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (max-width: 420px) {
  .lane-title-value {
    padding-inline: 2px;
  }

  .lane-name-edit-btn {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .endpoint-path-head {
    align-items: flex-start;
  }

  #endpointPathInput {
    min-height: 150px;
    font-size: 12.5px;
  }
}

@media (max-width: 360px) {
  .request-main {
    grid-template-columns: 1fr;
  }

  .request-path,
  .request-meta,
  .request-meta + .request-meta,
  .result-cell,
  .actions-cell {
    grid-column: 1;
  }
}

/* Theme refresh: calm, distinct, and less generic in both light and dark modes. */
:root {
  --bg: #f6f8f4;
  --surface: #ffffff;
  --surface-2: #eef4ef;
  --surface-3: #f2f5f7;
  --border: #d6dfd7;
  --text: #18201b;
  --text-muted: #667265;
  --accent: #0f9f7b;
  --accent-2: #e15f3f;
  --accent-3: #c8901f;
  --accent-hover: #0b8467;
  --accent-contrast: #ffffff;
  --accent-soft: #dff5ec;
  --green: #138a4f;
  --green-bg: #dcf8e8;
  --red: #d93f55;
  --red-bg: #fde5e9;
  --amber: #a66c00;
  --amber-bg: #fff1c9;
  --shadow: 0 18px 38px rgba(33, 47, 37, 0.1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #10130f;
  --surface: #181d17;
  --surface-2: #22291f;
  --surface-3: #11170f;
  --border: #344131;
  --text: #f0f5eb;
  --text-muted: #a4af9b;
  --accent: #2dd4bf;
  --accent-2: #fb805f;
  --accent-3: #f0b23d;
  --accent-hover: #58dfce;
  --accent-contrast: #06110f;
  --accent-soft: #173d35;
  --green: #63d98b;
  --green-bg: #163622;
  --red: #fb7185;
  --red-bg: #3c1822;
  --amber: #f5c451;
  --amber-bg: #372b10;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10130f;
    --surface: #181d17;
    --surface-2: #22291f;
    --surface-3: #11170f;
    --border: #344131;
    --text: #f0f5eb;
    --text-muted: #a4af9b;
    --accent: #2dd4bf;
    --accent-2: #fb805f;
    --accent-3: #f0b23d;
    --accent-hover: #58dfce;
    --accent-contrast: #06110f;
    --accent-soft: #173d35;
    --green: #63d98b;
    --green-bg: #163622;
    --red: #fb7185;
    --red-bg: #3c1822;
    --amber: #f5c451;
    --amber-bg: #372b10;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 88%, var(--bg)) 0, var(--bg) 380px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-2));
  border-color: transparent;
}

.topbar {
  border-bottom-color: color-mix(in srgb, var(--accent) 18%, var(--border));
}

.stage-lane-header {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 54%, var(--surface-2)), var(--surface-2));
}

.request-card {
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
}

@media (max-width: 860px) {
  .request-main {
    grid-template-columns: minmax(88px, 104px) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
  }

  .request-method {
    grid-column: 1;
    grid-row: 1;
  }

  .request-path {
    grid-column: 2;
    grid-row: 1;
  }

  .request-main > .request-meta:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .request-main > .request-meta:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
  }

  .result-cell {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 5px;
    min-height: 0;
  }

  .result-cell::before {
    content: "Result";
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
  }

  .result-stack {
    width: 100%;
  }

  .result-stack .badge {
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
    border-radius: 8px;
  }

  .actions-cell {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 2px;
  }

  .request-subline {
    margin-top: 2px;
  }
}

@media (max-width: 420px) {
  .request-main {
    grid-template-columns: minmax(82px, 96px) minmax(0, 1fr);
    gap: 8px;
  }

  .method-select,
  .request-path .path-input {
    font-size: 12.5px;
  }

  .result-stack .badge {
    padding-left: 9px;
    padding-right: 9px;
  }
}

@media (max-width: 360px) {
  .request-main {
    grid-template-columns: minmax(76px, 88px) minmax(0, 1fr);
    gap: 8px;
  }
}

/* Final color polish: crisp product UI colors, with solid readable action buttons. */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --surface-3: #eaf1f7;
  --border: #d5dee9;
  --text: #142033;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --accent-soft: #e8f0ff;
  --action: #0f9f8f;
  --action-hover: #0d8276;
  --action-contrast: #ffffff;
  --green: #16834f;
  --green-bg: #ddf7e8;
  --red: #d83b5b;
  --red-bg: #fde7ed;
  --amber: #a76a00;
  --amber-bg: #fff1cb;
  --shadow: 0 18px 42px rgba(20, 32, 51, 0.1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #212833;
  --surface-3: #111820;
  --border: #303b49;
  --text: #eef4fb;
  --text-muted: #9aa8ba;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-contrast: #07111f;
  --accent-soft: #132946;
  --action: #2dd4bf;
  --action-hover: #5eead4;
  --action-contrast: #061311;
  --green: #58d68b;
  --green-bg: #143521;
  --red: #fb7185;
  --red-bg: #3b1721;
  --amber: #f4bf50;
  --amber-bg: #35280d;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #212833;
    --surface-3: #111820;
    --border: #303b49;
    --text: #eef4fb;
    --text-muted: #9aa8ba;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-contrast: #07111f;
    --accent-soft: #132946;
    --action: #2dd4bf;
    --action-hover: #5eead4;
    --action-contrast: #061311;
    --green: #58d68b;
    --green-bg: #143521;
    --red: #fb7185;
    --red-bg: #3b1721;
    --amber: #f4bf50;
    --amber-bg: #35280d;
    --shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
    color-scheme: dark;
  }
}

body {
  background:
    radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--accent-soft) 72%, transparent), transparent 28rem),
    linear-gradient(180deg, var(--surface-3) 0, var(--bg) 390px);
}

.btn.primary {
  background: var(--action);
  border-color: color-mix(in srgb, var(--action) 88%, #000000);
  color: var(--action-contrast);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--action) 18%, transparent);
}

.btn.primary:hover {
  background: var(--action-hover);
  border-color: color-mix(in srgb, var(--action-hover) 88%, #000000);
}

.actions-cell .btn.primary,
.btn.primary.small {
  box-shadow: none;
}

.btn.ghost {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.btn.ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface));
}

.stage-lane-header {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 74%, var(--surface-2)), var(--surface-2));
}

.request-card {
  background: color-mix(in srgb, var(--surface) 95%, var(--accent-soft));
}

.badge.pass {
  background: color-mix(in srgb, var(--green-bg) 82%, var(--surface));
}

.badge.idle,
.badge.pending {
  background: color-mix(in srgb, var(--surface-2) 84%, var(--surface));
}

/* More colorful finish: richer accents without hurting readability. */
:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #ecebff;
  --action: #0ea5a4;
  --action-hover: #0f8f8e;
  --violet: #8b5cf6;
  --rose: #f05273;
  --sky: #0ea5e9;
  --gold: #f59e0b;
  --mint: #10b981;
}

:root[data-theme="dark"] {
  --accent: #8b9cff;
  --accent-hover: #a8b5ff;
  --accent-soft: #242342;
  --action: #2dd4bf;
  --action-hover: #5eead4;
  --violet: #a78bfa;
  --rose: #fb7185;
  --sky: #38bdf8;
  --gold: #fbbf24;
  --mint: #34d399;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #8b9cff;
    --accent-hover: #a8b5ff;
    --accent-soft: #242342;
    --action: #2dd4bf;
    --action-hover: #5eead4;
    --violet: #a78bfa;
    --rose: #fb7185;
    --sky: #38bdf8;
    --gold: #fbbf24;
    --mint: #34d399;
  }
}

body {
  background:
    linear-gradient(125deg, color-mix(in srgb, var(--accent-soft) 72%, transparent) 0 18rem, transparent 18rem 100%),
    linear-gradient(180deg, var(--surface-3) 0, var(--bg) 390px);
}

.topbar {
  position: sticky;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--sky), var(--action), var(--gold), var(--rose));
}

.workspace-head {
  background:
    linear-gradient(100deg,
      color-mix(in srgb, var(--accent-soft) 80%, var(--surface)) 0%,
      color-mix(in srgb, var(--surface-2) 82%, var(--sky)) 52%,
      color-mix(in srgb, var(--surface-2) 84%, var(--gold)) 100%);
}

.setup-card:nth-child(1) {
  border-top: 3px solid var(--sky);
}

.setup-card:nth-child(2) {
  border-top: 3px solid var(--violet);
}

.endpoint-search {
  border-color: color-mix(in srgb, var(--sky) 30%, var(--border));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface) 86%, var(--sky)),
      color-mix(in srgb, var(--surface) 90%, var(--violet)));
}

.drop-zone {
  border-color: color-mix(in srgb, var(--violet) 42%, var(--border));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent-soft) 74%, var(--surface)),
      color-mix(in srgb, var(--surface) 84%, var(--mint)));
}

.stage-lane {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
}

.stage-lane-header {
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--accent-soft) 82%, var(--surface-2)),
      color-mix(in srgb, var(--surface-2) 80%, var(--sky)),
      color-mix(in srgb, var(--surface-2) 88%, var(--mint)));
}

.request-card {
  border-color: color-mix(in srgb, var(--sky) 18%, var(--border));
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 96%, var(--accent-soft)),
      color-mix(in srgb, var(--surface) 98%, var(--mint)));
}

.request-card:nth-child(4n + 1) {
  border-left: 3px solid var(--sky);
}

.request-card:nth-child(4n + 2) {
  border-left: 3px solid var(--action);
}

.request-card:nth-child(4n + 3) {
  border-left: 3px solid var(--violet);
}

.request-card:nth-child(4n + 4) {
  border-left: 3px solid var(--gold);
}

.request-chip {
  border-color: color-mix(in srgb, var(--sky) 32%, var(--border));
  background: color-mix(in srgb, var(--sky) 12%, var(--surface-2));
  color: color-mix(in srgb, var(--text) 72%, var(--sky));
}

.request-chip:nth-child(2n) {
  border-color: color-mix(in srgb, var(--violet) 34%, var(--border));
  background: color-mix(in srgb, var(--violet) 13%, var(--surface-2));
  color: color-mix(in srgb, var(--text) 74%, var(--violet));
}

.btn.primary {
  background: linear-gradient(135deg, var(--action), color-mix(in srgb, var(--action) 74%, var(--sky)));
  border-color: color-mix(in srgb, var(--action) 82%, #000000);
}

.actions-cell .btn.primary,
.btn.primary.small {
  background: var(--action);
  border-color: color-mix(in srgb, var(--action) 84%, #000000);
}

.actions-cell .btn.primary:hover,
.btn.primary.small:hover {
  background: var(--action-hover);
}

.badge.pass {
  background: color-mix(in srgb, var(--mint) 18%, var(--surface));
  color: var(--green);
}

.badge.fail,
.badge.error {
  background: color-mix(in srgb, var(--rose) 16%, var(--surface));
}

.badge.bug {
  background: color-mix(in srgb, var(--gold) 18%, var(--surface));
}

.run-bar {
  border-top-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

/* Drag feedback: make endpoint reordering obvious while the user moves a row. */
.request-card,
.stage-lane,
.stage-lane-header {
  transition:
    transform 0.16s ease,
    opacity 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.request-card {
  position: relative;
}

body.is-row-dragging {
  cursor: grabbing;
}

body.is-row-dragging .row-drag-handle {
  cursor: grabbing;
}

body.is-row-dragging .request-card:not(.is-dragging):not(.row-drop-before) {
  opacity: 0.64;
  transform: scale(0.995);
}

.request-card.is-dragging {
  opacity: 0.78;
  transform: rotate(0.4deg) scale(1.015);
  border-color: color-mix(in srgb, var(--action) 58%, var(--border));
  box-shadow:
    0 18px 42px color-mix(in srgb, var(--action) 18%, transparent),
    0 0 0 3px color-mix(in srgb, var(--action) 20%, transparent);
}

.request-card.row-drop-before {
  opacity: 1;
  transform: translateY(6px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 14%, transparent);
}

.request-card.row-drop-before::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: -8px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--sky), var(--action));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  animation: dropPulse 0.72s ease-in-out infinite alternate;
}

.request-card.row-drop-before::after {
  content: "Drop here";
  position: absolute;
  top: -22px;
  left: 18px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stage-lane.drag-over {
  border-color: color-mix(in srgb, var(--action) 58%, var(--border));
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--action) 10%, transparent),
      color-mix(in srgb, var(--sky) 7%, transparent));
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--action) 22%, transparent),
    0 14px 34px color-mix(in srgb, var(--action) 10%, transparent);
}

body.is-lane-dragging .stage-lane:not(:has(.stage-lane-header.is-dragging)):not(.drag-over) {
  opacity: 0.68;
}

.stage-lane-header.is-dragging {
  opacity: 0.78;
  transform: scale(1.01);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 14%, transparent);
}

@keyframes dropPulse {
  from {
    transform: scaleX(0.96);
    opacity: 0.72;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .request-card,
  .stage-lane,
  .stage-lane-header {
    transition: none;
  }

  .request-card.row-drop-before::before {
    animation: none;
  }
}

/* Quick guide */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-label-compact {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.guide-backdrop {
  opacity: 0;
  transition: opacity 180ms ease;
}

.guide-backdrop.is-visible {
  opacity: 1;
}

.guide-modal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(780px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, var(--accent-soft));
  box-shadow: 0 30px 90px rgba(3, 7, 18, 0.42), 0 0 0 1px color-mix(in srgb, #ffffff 5%, transparent);
  opacity: 0;
  overflow: hidden;
  transform: translateY(18px) scale(0.975);
  transition: opacity 180ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.guide-backdrop.is-visible .guide-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.guide-glow {
  position: absolute;
  z-index: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(80px);
  opacity: 0.08;
  pointer-events: none;
}

.guide-glow-one {
  inset-block-start: -130px;
  inset-inline-start: -70px;
}

.guide-glow-two {
  inset-block-end: -150px;
  inset-inline-end: -80px;
  opacity: 0.05;
}

.guide-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 14px;
}

.guide-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.guide-logo-wrap {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 86%, var(--surface)), var(--surface));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}

.guide-logo-wrap img {
  width: 44px;
  height: 33px;
  object-fit: contain;
}

.guide-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.guide-head h3 {
  max-width: 550px;
  font-size: clamp(19px, 3vw, 24px);
  letter-spacing: -0.02em;
}

.guide-head h3:focus,
.guide-page-heading h4:focus {
  outline: none;
}

.guide-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.guide-close:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft);
  transform: rotate(3deg);
}

.guide-progress {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 26px 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.guide-progress > span:first-child {
  white-space: nowrap;
}

.guide-progress-track {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.guide-progress-track > span {
  width: var(--guide-progress, 50%);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, var(--green)));
  transition: width 280ms ease;
}

.guide-content {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 38%, var(--border)) transparent;
}

.guide-page {
  padding: 0 26px 24px;
}

.guide-page[hidden] {
  display: none;
}

.guide-page.is-active {
  animation: guidePageIn 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes guidePageIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.guide-intro {
  max-width: 680px;
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}

.guide-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.guide-feature-card {
  min-width: 0;
  min-height: 168px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 62%, var(--surface));
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.guide-feature-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-2px);
}

.guide-feature-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.guide-feature-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.guide-feature-card strong,
.guide-feature-card div > span {
  display: block;
}

.guide-feature-card strong {
  margin-bottom: 6px;
  font-size: 13px;
}

.guide-feature-card div > span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.guide-flow-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 52%, transparent);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}

.guide-flow-preview > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guide-flow-preview small {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  font-size: 9px;
}

.guide-flow-preview i {
  color: var(--accent);
  font-size: 15px;
  font-style: normal;
}

[dir="rtl"] .guide-flow-preview i,
[dir="rtl"] .guide-next span {
  transform: rotate(180deg);
}

.guide-page-heading {
  margin-bottom: 14px;
}

.guide-page-heading h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.01em;
}

.guide-page-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-2) 66%, var(--surface));
}

.guide-step-number {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.guide-steps strong,
.guide-steps div > span {
  display: block;
}

.guide-steps strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.guide-steps div > span {
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.guide-steps b {
  color: var(--text);
  font-weight: 700;
}

.guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
}

.guide-tip > span {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 16px;
}

.guide-tip p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.guide-tip strong {
  color: var(--text);
}

.guide-actions {
  position: relative;
  z-index: 2;
  align-items: center;
  padding: 14px 26px 18px;
  background: color-mix(in srgb, var(--surface) 90%, var(--surface-2));
}

.guide-actions .btn:not(.guide-skip) {
  min-width: 104px;
}

.guide-action-spacer {
  flex: 1;
}

.guide-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 20%, transparent);
}

.guide-next span {
  display: inline-block;
  transition: transform 150ms ease;
}

.guide-next:hover span {
  transform: translateX(2px);
}

[dir="rtl"] .guide-next:hover span {
  transform: rotate(180deg) translateX(2px);
}

.guide-actions [hidden] {
  display: none;
}

.site-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 16px 2px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .btn {
    padding-left: 9px;
    padding-right: 9px;
  }

  .guide-label-full {
    display: none;
  }

  .guide-label-compact {
    display: inline;
  }

  .guide-backdrop {
    align-items: end;
    padding: 0;
  }

  .guide-modal {
    width: 100%;
    max-height: calc(100dvh - 12px);
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
    transform: translateY(26px);
  }

  .guide-head {
    gap: 10px;
    padding: 18px 16px 12px;
  }

  .guide-heading {
    gap: 10px;
    align-items: flex-start;
  }

  .guide-logo-wrap {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 11px;
  }

  .guide-logo-wrap img {
    width: 36px;
    height: 27px;
  }

  .guide-head h3 {
    font-size: 18px;
    line-height: 1.3;
  }

  .guide-close {
    width: 34px;
    height: 34px;
  }

  .guide-progress {
    padding: 0 16px 14px;
  }

  .guide-page {
    padding: 0 16px 18px;
  }

  .guide-intro {
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.55;
  }

  .guide-feature-grid,
  .guide-steps {
    grid-template-columns: 1fr;
  }

  .guide-feature-card {
    min-height: 0;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px;
  }

  .guide-feature-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0;
  }

  .guide-feature-card strong {
    margin-bottom: 3px;
  }

  .guide-flow-preview {
    justify-content: space-between;
    gap: 4px;
    padding: 9px 10px;
    font-size: 10px;
  }

  .guide-flow-preview small {
    display: none;
  }

  .guide-page-heading h4 {
    font-size: 16px;
  }

  .guide-actions {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .guide-skip {
    padding-inline: 8px;
  }
}

@media (max-width: 360px) {
  .guide-logo-wrap {
    display: none;
  }

  .guide-actions {
    gap: 6px;
  }

  .guide-actions .btn {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-backdrop,
  .guide-modal,
  .guide-page.is-active,
  .guide-feature-card,
  .guide-close,
  .guide-next span,
  .guide-progress-track > span {
    animation: none;
    transition: none;
  }
}

/* Compact copy actions for endpoints and responses. */
.path-input-wrap {
  position: relative;
  min-width: 0;
}

.path-input-wrap .path-input {
  padding-inline-end: 76px;
}

.path-input-actions {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  transform: translateY(-50%);
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 78%, var(--surface-2));
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 64%, var(--surface));
  transform: translateY(-1px);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-btn.is-copied {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 45%, var(--border));
  background: var(--green-bg);
}

.endpoint-copy-btn {
  position: static;
}

.endpoint-copy-btn:hover {
  transform: translateY(-1px);
}

.panel-actions .response-copy-btn:not(.is-copied) {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

@media (max-width: 860px) {
  .icon-btn {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .path-input-wrap .path-input {
    padding-inline-end: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-btn {
    transition: none;
  }
}

.request-card.run-failure-focus {
  position: relative;
  z-index: 4;
  scroll-margin-block: 132px;
  outline: 2px solid color-mix(in srgb, var(--red) 78%, transparent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--red-bg) 48%, var(--surface));
  animation: endpointFailureFocus 2.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.request-card.run-failure-focus:focus {
  outline: 2px solid color-mix(in srgb, var(--red) 78%, transparent);
}

@keyframes endpointFailureFocus {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 42%, transparent);
    filter: saturate(0.92);
  }
  24% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--red) 17%, transparent), 0 15px 32px color-mix(in srgb, var(--red) 16%, transparent);
    filter: saturate(1.08);
  }
  62% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 12%, transparent), 0 10px 22px color-mix(in srgb, var(--red) 10%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .request-card.run-failure-focus {
    animation: none;
  }
}

/* Per-endpoint request header editor. */
@media (min-width: 1081px) {
  .request-main {
    grid-template-columns: 92px minmax(180px, 1fr) 136px 92px minmax(86px, 104px) 252px;
  }

  .actions-cell {
    min-width: 252px;
  }
}

.endpoint-headers-btn {
  color: color-mix(in srgb, var(--text) 78%, var(--accent));
}

.request-headers-panel {
  overflow: visible;
}

.headers-panel-head {
  align-items: center;
}

.headers-panel-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.headers-panel-title > strong {
  white-space: nowrap;
}

.headers-panel-title > span {
  white-space: nowrap;
}

.headers-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface-3) 38%, transparent);
}

.header-editor-labels,
.header-editor-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr) 34px;
  gap: 8px;
  align-items: center;
}

.header-editor-labels {
  padding-inline: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-name-input,
.header-value-input {
  min-height: 40px;
  border-color: color-mix(in srgb, var(--border) 84%, var(--accent));
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.header-name-input {
  color: color-mix(in srgb, var(--text) 82%, var(--accent));
  font-weight: 750;
}

.header-name-input:focus,
.header-value-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.header-remove-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.header-remove-btn:hover {
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
  background: var(--red-bg);
  color: var(--red);
}

.header-remove-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.headers-empty {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 24%, transparent);
  text-align: center;
}

.headers-empty strong {
  font-size: 12.5px;
}

.headers-empty span {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 12px;
}

.managed-headers {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface));
}

.managed-headers > strong {
  flex: 0 0 auto;
  padding-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.managed-header-list {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.managed-header-list span {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .actions-cell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 40px;
  }

  .actions-cell .row-action,
  .actions-cell .row-remove {
    min-height: 42px;
  }

  .headers-panel-head {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .headers-panel-head {
    flex-wrap: wrap;
  }

  .headers-panel-head .panel-actions {
    width: 100%;
    margin-inline-start: 0;
  }

  .headers-panel-head .panel-actions .btn {
    flex: 1 1 0;
  }

  .header-editor-labels {
    display: none;
  }

  .header-editor-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 7px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }

  .header-editor-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .header-name-input {
    grid-column: 1;
    grid-row: 1;
  }

  .header-value-input {
    grid-column: 1;
    grid-row: 2;
  }

  .header-remove-btn {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .managed-headers {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .actions-cell {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .endpoint-body-btn {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .endpoint-headers-btn {
    grid-column: 3 / 5;
    grid-row: 1;
  }

  .run-endpoint-btn {
    grid-column: 1 / 4;
    grid-row: 2;
  }

  .actions-cell .row-remove {
    grid-column: 4;
    grid-row: 2;
    width: 42px;
    height: 42px;
    justify-self: end;
  }

  .headers-editor {
    padding: 9px;
  }
}

/* Prominent response inspection control. */
.response-panel-toggle {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 68%, var(--surface));
  color: color-mix(in srgb, var(--accent) 86%, var(--text));
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 9%, transparent);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.response-panel-toggle svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.response-panel-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 88%, var(--surface));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 14%, transparent);
}

.response-panel-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

.response-panel-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .response-panel-toggle {
    min-height: 42px;
    font-size: 12.5px;
  }

  .response-panel-toggle svg {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .response-panel-toggle {
    transition: none;
  }

  .response-panel-toggle:hover {
    transform: none;
  }
}

/* Interactive quick-add endpoint composer. */
.route-composer {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 5%, transparent);
}

.route-composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent), 0 10px 28px color-mix(in srgb, var(--text) 7%, transparent);
}

.route-composer-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

.route-composer-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.route-composer-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.route-composer-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.route-composer-heading p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.route-composer-count {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.route-composer-count.is-ready {
  border-color: color-mix(in srgb, var(--green) 38%, var(--border));
  background: var(--green-bg);
  color: var(--green);
}

.route-composer-count.is-curl {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface));
  color: var(--accent);
}

.route-composer-icon.is-curl {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.route-composer-count.has-error {
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
  background: var(--red-bg);
  color: var(--red);
}

.route-editor-shell {
  min-width: 0;
  background: color-mix(in srgb, var(--surface-3) 66%, var(--surface));
}

.route-editor-shell #pasteBox {
  width: 100%;
  max-width: 100%;
  min-height: 112px;
  max-height: 240px;
  display: block;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  tab-size: 2;
}

.route-editor-shell #pasteBox.is-curl {
  max-height: 360px;
  background: color-mix(in srgb, var(--accent-soft) 16%, transparent);
}

.route-editor-shell #pasteBox:focus {
  box-shadow: none;
}

.route-editor-shell #pasteBox[aria-invalid="true"] {
  background: color-mix(in srgb, var(--red-bg) 24%, transparent);
}

.route-composer-footer {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
}

.route-composer-help {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.route-composer-feedback {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.route-composer-feedback.has-error {
  color: var(--red);
  font-weight: 700;
}

.route-composer-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.route-composer-shortcut kbd {
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
}

.route-add-btn {
  min-width: 150px;
}

@media (max-width: 720px) {
  .route-composer-head {
    align-items: flex-start;
  }

  .route-composer-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-add-btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .route-composer-head {
    flex-direction: column;
    gap: 9px;
    padding: 11px;
  }

  .route-composer-count {
    margin-inline-start: 44px;
  }

  .route-composer-help {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .route-editor-shell #pasteBox {
    padding: 12px;
    font-size: 12.5px;
  }


  .route-editor-shell #pasteBox.is-curl {
    max-height: 320px;
  }

  .route-composer-footer {
    padding: 10px;
  }
}

/* Shared select system: one theme-aware control for every dropdown. */
.shared-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

select.shared-select-native {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.shared-select-trigger {
  --select-tone: var(--accent);
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 11px;
  border: 1px solid color-mix(in srgb, var(--select-tone) 22%, var(--border));
  border-radius: 9px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 94%, var(--select-tone)),
    color-mix(in srgb, var(--surface-2) 94%, var(--select-tone)));
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s, transform 0.16s;
}

[dir="rtl"] .shared-select-trigger {
  padding: 7px 11px 7px 7px;
}

.shared-select-trigger:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--select-tone) 58%, var(--border));
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 88%, var(--select-tone)),
    color-mix(in srgb, var(--surface-2) 89%, var(--select-tone)));
}

.shared-select-trigger:focus-visible,
.shared-select.is-open .shared-select-trigger {
  outline: none;
  border-color: var(--select-tone);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--select-tone) 16%, transparent);
}

.shared-select-trigger:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.shared-select-value {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.3;
}

.shared-select-chevron {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--select-tone) 10%, var(--surface));
  color: var(--select-tone);
}

.shared-select-chevron svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.16s ease;
}

.shared-select.is-open .shared-select-chevron svg {
  transform: rotate(180deg);
}

.shared-select-menu {
  position: fixed;
  z-index: 160;
  display: grid;
  gap: 3px;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 97%, var(--accent-soft));
  box-shadow: 0 24px 64px rgba(10, 18, 30, 0.22), 0 6px 18px rgba(10, 18, 30, 0.12);
  color: var(--text);
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--accent) 42%, var(--border)) transparent;
  animation: sharedSelectIn 0.14s ease-out both;
}

:root[data-theme="dark"] .shared-select-menu {
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.56), 0 8px 20px rgba(0, 0, 0, 0.34);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shared-select-menu {
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.56), 0 8px 20px rgba(0, 0, 0, 0.34);
  }
}

.shared-select-option {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 9px;
  padding: 8px 9px 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: start;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

[dir="rtl"] .shared-select-option {
  padding: 8px 11px 8px 9px;
}

.shared-select-option.is-active {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
}

.shared-select-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
}

.shared-select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shared-select-option-copy {
  min-width: 0;
  display: block;
}

.shared-select-option-copy strong,
.shared-select-option-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shared-select-option-copy strong {
  font-size: 12.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.shared-select-option-copy small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
}

.shared-select-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.12s, transform 0.12s;
}

.shared-select-option.is-selected .shared-select-check {
  opacity: 1;
  transform: scale(1);
}

.shared-select[data-variant="method"] .shared-select-trigger {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.shared-select[data-variant="method"] .shared-select-value {
  overflow-wrap: normal;
  white-space: nowrap;
}

.shared-select[data-variant="method"] .shared-select-trigger[data-value="GET"] { --select-tone: var(--green); }
.shared-select[data-variant="method"] .shared-select-trigger[data-value="POST"] { --select-tone: var(--action, var(--accent)); }
.shared-select[data-variant="method"] .shared-select-trigger[data-value="PUT"] { --select-tone: var(--amber); }
.shared-select[data-variant="method"] .shared-select-trigger[data-value="PATCH"] { --select-tone: var(--violet, var(--accent)); }
.shared-select[data-variant="method"] .shared-select-trigger[data-value="DELETE"] { --select-tone: var(--red); }
.shared-select[data-variant="method"] .shared-select-trigger[data-value="HEAD"] { --select-tone: var(--sky, var(--accent)); }
.shared-select[data-variant="method"] .shared-select-trigger[data-value="OPTIONS"] { --select-tone: var(--text-muted); }

@keyframes sharedSelectIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Keep the expanded group header balanced after adding collapse/count controls. */
@media (max-width: 860px) {
  .stage-lane-header {
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  }

  .lane-drag-handle { grid-column: 1; grid-row: 1; }
  .lane-collapse-toggle { grid-column: 2; grid-row: 1; }
  .lane-title { grid-column: 3; grid-row: 1; max-width: none; }
  .lane-count { grid-column: 4; grid-row: 1; }
  .lane-actions { grid-column: 5; grid-row: 1; }
  .lane-hint {
    grid-column: 2 / -1;
    grid-row: 2;
    padding-inline-start: 0;
  }
}

@media (max-width: 520px) {
  .shared-select-trigger {
    min-height: 44px;
    font-size: 12.5px;
  }

  .shared-select-menu {
    border-radius: 10px;
  }

  .shared-select-option {
    min-height: 46px;
  }

  .stage-lane-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .lane-drag-handle { display: none; }
  .lane-collapse-toggle { grid-column: 1; }
  .lane-title { grid-column: 2; }
  .lane-count { grid-column: 3; }
  .lane-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(68px, 1fr) 38px minmax(68px, 1fr) 38px;
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }
  .lane-actions .run-group-btn,
  .lane-actions .lane-add-row-btn {
    width: 100%;
    min-width: 0;
  }
  .lane-actions .lane-icon-action,
  .lane-actions .lane-remove {
    width: 38px;
    min-width: 38px;
  }
  .lane-hint {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shared-select-trigger,
  .shared-select-chevron svg,
  .shared-select-option,
  .shared-select-check {
    transition: none;
  }

  .shared-select-menu {
    animation: none;
  }
}

/* Flexible group actions and multi-group selection. */
.stage-lane.is-selected {
  border-color: color-mix(in srgb, var(--action, var(--accent)) 68%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--action, var(--accent)) 11%, transparent);
}

.stage-lane.is-selected .stage-lane-header {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--action, var(--accent)) 15%, var(--surface)),
    color-mix(in srgb, var(--accent-soft) 74%, var(--surface-2)));
}

.lane-select-toggle {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text-muted) 46%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--accent-contrast);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s, transform 0.14s;
}

.lane-select-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.14s, transform 0.14s;
}

.lane-select-toggle:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--action, var(--accent)) 62%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface));
}

.lane-select-toggle[aria-checked="true"] {
  border-color: var(--action, var(--accent));
  background: var(--action, var(--accent));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--action, var(--accent)) 24%, transparent);
}

.lane-select-toggle[aria-checked="true"] svg {
  opacity: 1;
  transform: scale(1);
}

.lane-select-toggle[aria-checked="true"]:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--action, var(--accent)) 82%, var(--text));
  background: color-mix(in srgb, var(--action, var(--accent)) 88%, var(--text));
  color: var(--accent-contrast);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--action, var(--accent)) 30%, transparent);
}

.lane-select-toggle:focus-visible {
  outline: 2px solid var(--action, var(--accent));
  outline-offset: 2px;
}

.lane-select-toggle:disabled,
.lane-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lane-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lane-action-btn,
.bulk-group-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lane-action-btn svg,
.bulk-group-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.run-group-btn svg,
.run-selected-groups-btn svg {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.4;
}

.lane-icon-action {
  width: 32px;
  min-width: 32px;
  padding-inline: 0 !important;
}

.group-selection-bar {
  position: sticky;
  top: 76px;
  z-index: 12;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--action, var(--accent)) 44%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--text) 9%, transparent);
  backdrop-filter: blur(14px);
}

.group-selection-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-selection-summary > span:last-child {
  min-width: 0;
}

.group-selection-summary strong,
.group-selection-summary small {
  display: block;
}

.group-selection-summary strong {
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.3;
}

.group-selection-summary small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.group-selection-indicator {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 9px;
  background: var(--action, var(--accent));
  color: var(--accent-contrast);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--action, var(--accent)) 22%, transparent);
}

.group-selection-indicator svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.group-selection-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 860px) {
  .stage-lane-header {
    grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
  }

  .lane-drag-handle { grid-column: 1; grid-row: 1; }
  .lane-select-toggle { grid-column: 2; grid-row: 1; }
  .lane-collapse-toggle { grid-column: 3; grid-row: 1; }
  .lane-title { grid-column: 4; grid-row: 1; }
  .lane-count { grid-column: 5; grid-row: 1; }
  .lane-actions { grid-column: 6; grid-row: 1; }
  .lane-hint { grid-column: 3 / -1; grid-row: 2; }
}

@media (max-width: 640px) {
  .group-selection-bar {
    top: 66px;
    align-items: stretch;
    flex-direction: column;
    padding: 10px;
  }

  .group-selection-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  }

  .group-selection-actions .btn {
    min-width: 0;
  }

  .stage-lane-header {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .lane-drag-handle { display: none; }
  .lane-select-toggle { grid-column: 1; grid-row: 1; }
  .lane-collapse-toggle { grid-column: 2; grid-row: 1; }
  .lane-title { grid-column: 3; grid-row: 1; }
  .lane-count { grid-column: 4; grid-row: 1; }
  .lane-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
  }
  .lane-hint {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

@media (max-width: 420px) {
  .group-selection-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .run-selected-groups-btn {
    grid-column: 1 / -1;
  }

  .lane-actions {
    grid-template-columns: minmax(62px, 1fr) 38px minmax(62px, 1fr) 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lane-select-toggle,
  .lane-select-toggle svg {
    transition: none;
  }
}

/* JSON import conflict choice. */
.import-choice-modal {
  width: min(560px, 100%);
}

.import-choice-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
}

.import-choice-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface));
  color: var(--accent);
  font-size: 21px;
  font-weight: 900;
}

.import-choice-head .guide-eyebrow {
  display: block;
  margin-bottom: 4px;
}

.import-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 20px;
}

.import-choice-options > span {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-2) 78%, var(--surface));
}

.import-choice-options strong,
.import-choice-options small {
  display: block;
}

.import-choice-options strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12.5px;
}

.import-choice-options small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.import-choice-actions {
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .import-choice-options {
    grid-template-columns: 1fr;
  }

  .import-choice-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-choice-actions .btn {
    min-width: 0;
  }

  #jsonImportChoiceAppend {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (min-width: 1081px) {
  .request-main {
    grid-template-columns: 92px minmax(160px, 1fr) 136px 92px minmax(78px, 96px) minmax(276px, max-content);
  }

  .actions-cell {
    width: max-content;
    min-width: 276px;
  }

  .actions-cell .row-action {
    flex: 0 0 auto;
  }
}

/* A real zero-state: clearing the workspace no longer leaves a placeholder group. */
#rowsHeader[hidden] {
  display: none;
}

.workspace-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: clamp(28px, 6vw, 56px) clamp(18px, 5vw, 44px);
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent-soft) 52%, transparent), transparent 48%),
    color-mix(in srgb, var(--surface-2) 62%, var(--surface));
  color: var(--text-muted);
  text-align: center;
}

.workspace-empty-icon {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
  color: var(--accent);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 12%, transparent);
}

.workspace-empty-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-empty-copy {
  max-inline-size: 580px;
  display: grid;
  gap: 7px;
}

.workspace-empty-copy strong {
  color: var(--text);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.25;
}

.workspace-empty-copy span {
  font-size: 13px;
  line-height: 1.65;
}

.workspace-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.workspace-empty-actions .btn {
  min-height: 40px;
}

.endpoint-search-input-wrap input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 560px) {
  .workspace-empty-state {
    min-height: 240px;
    border-radius: 10px;
  }

  .workspace-empty-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-empty-actions .btn {
    width: 100%;
  }
}

/* Endpoint cards: give long routes a dedicated, readable line. */
.request-main {
  grid-template-columns: 118px 136px 92px minmax(180px, 210px) minmax(276px, 1fr);
  gap: 10px 12px;
  align-items: center;
}

.request-path {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: 10px;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--accent-soft) 68%, var(--surface)),
      color-mix(in srgb, var(--surface-2) 56%, var(--surface)));
}

.request-route-label {
  min-width: 124px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 8px 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.request-route-label span {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
}

.request-path .path-input-wrap,
.request-path .path-input {
  width: 100%;
}

.request-path .path-input {
  min-height: 40px;
  border-color: color-mix(in srgb, var(--border) 84%, var(--accent));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  font-size: 14px;
  font-weight: 680;
}

.request-path .path-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.request-method {
  grid-column: 1;
  grid-row: 2;
}

.request-main > .request-meta:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.request-main > .request-meta:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.result-cell {
  grid-column: 4;
  grid-row: 2;
}

.actions-cell {
  grid-column: 5;
  grid-row: 2;
  width: 100%;
}

.request-subline {
  padding-inline-start: 0;
  margin-top: -2px;
}

.result-stack {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.result-stack .badge {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-start;
  white-space: nowrap;
}

.result-stack .response-panel-toggle {
  width: auto;
  min-width: 58px;
  min-height: 30px;
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 8px;
  box-shadow: none;
}

.result-stack .response-panel-toggle svg {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

@media (max-width: 1080px) and (min-width: 861px) {
  .request-main {
    grid-template-columns: 118px minmax(150px, 1fr) 96px minmax(96px, 1fr);
  }

  .request-path {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .request-method,
  .request-main > .request-meta:nth-child(3),
  .request-main > .request-meta:nth-child(4) {
    grid-row: 2;
  }

  .request-method { grid-column: 1; }
  .request-main > .request-meta:nth-child(3) { grid-column: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 3; }

  .result-cell {
    grid-column: 4;
    grid-row: 2;
  }

  .actions-cell {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 860px) {
  .request-main {
    grid-template-columns: minmax(118px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
  }

  .request-path {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .request-method {
    grid-column: 1;
    grid-row: 2;
  }

  .request-main > .request-meta:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .request-main > .request-meta:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
  }

  .result-cell {
    grid-column: 2;
    grid-row: 3;
  }

  .actions-cell {
    grid-column: 1 / -1;
    grid-row: 4;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 36px;
    width: 100%;
    min-width: 0;
  }

  .request-subline {
    padding-inline-start: 0;
  }
}

@media (max-width: 520px) {
  .request-path {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 7px;
  }

  .request-route-label {
    min-width: 0;
    padding-inline: 2px;
    font-size: 10px;
  }

  .request-route-label span {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .request-path .path-input {
    min-height: 44px;
    font-size: 13px;
  }

  .actions-cell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  }

  .actions-cell .run-endpoint-btn {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .actions-cell .row-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .result-stack {
    gap: 5px;
  }

  .result-stack .response-panel-toggle {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
  }

  .result-stack .response-panel-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 360px) {
  .request-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .request-path {
    grid-column: 1;
    grid-row: 1;
  }

  .request-method {
    grid-column: 1;
    grid-row: 2;
  }

  .request-main > .request-meta:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }

  .request-main > .request-meta:nth-child(4) {
    grid-column: 1;
    grid-row: 4;
  }

  .result-cell {
    grid-column: 1;
    grid-row: 5;
  }

  .actions-cell {
    grid-column: 1;
    grid-row: 6;
  }
}

[dir="rtl"] .request-route-label span {
  transform: scaleX(-1);
}

/* Aurora light theme: expressive color with accessible, calm working surfaces. */
:root[data-resolved-theme="light"] {
  --bg: #f6f7ff;
  --surface: #ffffff;
  --surface-2: #f7f8fe;
  --surface-3: #eef1fb;
  --border: #d9def0;
  --text: #17213b;
  --text-muted: #5d6982;
  --accent: #6257d9;
  --accent-hover: #5044c4;
  --accent-contrast: #ffffff;
  --accent-soft: #efedff;
  --action: #087f75;
  --action-hover: #06675f;
  --action-contrast: #ffffff;
  --green: #128048;
  --green-bg: #def7e9;
  --red: #c83255;
  --red-bg: #ffe6ed;
  --amber: #9a5d00;
  --amber-bg: #fff1c7;
  --violet: #7c4ddb;
  --rose: #d93872;
  --sky: #087eb8;
  --gold: #b76a00;
  --mint: #078663;
  --lavender-soft: #f2efff;
  --sky-soft: #eaf7ff;
  --mint-soft: #e9faf3;
  --peach-soft: #fff1e8;
  --shadow: 0 18px 46px rgba(47, 52, 105, 0.1), 0 4px 14px rgba(47, 52, 105, 0.06);
  color-scheme: light;
}

:root[data-resolved-theme="light"] body {
  background:
    radial-gradient(circle at 4% 3%, rgba(98, 87, 217, 0.18), transparent 24rem),
    radial-gradient(circle at 96% 7%, rgba(8, 126, 184, 0.15), transparent 27rem),
    radial-gradient(circle at 48% 38%, rgba(11, 148, 136, 0.09), transparent 32rem),
    radial-gradient(circle at 82% 82%, rgba(217, 56, 114, 0.07), transparent 26rem),
    linear-gradient(180deg, #eef1ff 0, #f8f9ff 560px, #f5f8ff 100%);
}

:root[data-resolved-theme="light"] ::selection {
  background: #dcd8ff;
  color: #292071;
}

:root[data-resolved-theme="light"] .topbar {
  border-bottom-color: #ced5ef;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.94), rgba(244, 241, 255, 0.92) 48%, rgba(235, 249, 255, 0.92));
  box-shadow: 0 8px 28px rgba(47, 52, 105, 0.08);
}

:root[data-resolved-theme="light"] .topbar::before {
  height: 4px;
  background: linear-gradient(90deg, #6257d9, #8b5cf6 24%, #0ea5e9 48%, #10b981 70%, #f59e0b 86%, #e94b7b);
}

:root[data-resolved-theme="light"] .brand-logo {
  filter: drop-shadow(0 7px 13px rgba(74, 70, 190, 0.24));
}

:root[data-resolved-theme="light"] .brand h1 {
  color: #352d96;
  letter-spacing: -0.015em;
}

:root[data-resolved-theme="light"] .card {
  border-color: #d5daef;
  box-shadow: var(--shadow);
}

:root[data-resolved-theme="light"] .setup-card {
  position: relative;
  overflow: hidden;
}

:root[data-resolved-theme="light"] .setup-card::after {
  content: "";
  position: absolute;
  inset-block-start: -42px;
  inset-inline-end: -34px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--card-glow, rgba(8, 126, 184, 0.12));
  pointer-events: none;
}

:root[data-resolved-theme="light"] .setup-card:nth-child(1) {
  --card-glow: rgba(14, 165, 233, 0.13);
  border-color: #b9ddf1;
  border-top-color: #1598d0;
  background: linear-gradient(145deg, #ffffff 38%, #ecf8ff);
}

:root[data-resolved-theme="light"] .setup-card:nth-child(2) {
  --card-glow: rgba(124, 77, 219, 0.13);
  border-color: #d5c5f2;
  border-top-color: #7c4ddb;
  background: linear-gradient(145deg, #ffffff 38%, #f4efff);
}

:root[data-resolved-theme="light"] .setup-card:nth-child(1) h2 {
  color: #0873aa;
}

:root[data-resolved-theme="light"] .setup-card:nth-child(2) h2 {
  color: #6540b5;
}

:root[data-resolved-theme="light"] .workspace-card {
  border-color: #cbd2ed;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 58px rgba(43, 51, 103, 0.12), 0 4px 14px rgba(43, 51, 103, 0.05);
}

:root[data-resolved-theme="light"] .workspace-head {
  position: relative;
  border-bottom-color: #ccd4ee;
  background:
    radial-gradient(circle at 96% -30%, rgba(245, 158, 11, 0.2), transparent 15rem),
    linear-gradient(108deg, #eeeaff 0%, #e8f6ff 53%, #e9faf3 100%);
}

:root[data-resolved-theme="light"] .workspace-head h2 {
  color: #30277f;
}

:root[data-resolved-theme="light"] input,
:root[data-resolved-theme="light"] textarea,
:root[data-resolved-theme="light"] select {
  border-color: #c4cde2;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(42, 52, 91, 0.035);
}

:root[data-resolved-theme="light"] input:hover,
:root[data-resolved-theme="light"] textarea:hover,
:root[data-resolved-theme="light"] select:hover {
  border-color: #aebbd5;
}

:root[data-resolved-theme="light"] input:focus,
:root[data-resolved-theme="light"] textarea:focus,
:root[data-resolved-theme="light"] select:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(98, 87, 217, 0.14), 0 5px 14px rgba(50, 46, 120, 0.08);
}

:root[data-resolved-theme="light"] input[type="checkbox"] {
  accent-color: var(--accent);
}

:root[data-resolved-theme="light"] .request-note,
:root[data-resolved-theme="light"] .hint,
:root[data-resolved-theme="light"] .response-url,
:root[data-resolved-theme="light"] .field span {
  color: #56647c;
}

:root[data-resolved-theme="light"] .btn {
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

:root[data-resolved-theme="light"] .btn:hover:not(:disabled) {
  filter: none;
  transform: translateY(-1px);
}

:root[data-resolved-theme="light"] .btn:focus-visible {
  outline: 3px solid rgba(98, 87, 217, 0.24);
  outline-offset: 2px;
}

:root[data-resolved-theme="light"] .btn.primary {
  border-color: #076f78;
  background: linear-gradient(135deg, #087f75, #0878a0);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(8, 135, 157, 0.24);
}

:root[data-resolved-theme="light"] .btn.primary:hover:not(:disabled) {
  border-color: #076c7a;
  background: linear-gradient(135deg, #066b64, #086889);
  box-shadow: 0 13px 28px rgba(8, 112, 142, 0.28);
}

:root[data-resolved-theme="light"] .actions-cell .btn.primary,
:root[data-resolved-theme="light"] .btn.primary.small {
  background: var(--action);
  box-shadow: none;
}

:root[data-resolved-theme="light"] .btn.ghost {
  border-color: #d0d5ed;
  background: linear-gradient(180deg, #ffffff, #f0f2ff);
  color: #454ba0;
  box-shadow: 0 2px 6px rgba(49, 55, 117, 0.06);
}

:root[data-resolved-theme="light"] .btn.ghost:hover:not(:disabled) {
  border-color: #b7b9e8;
  background: linear-gradient(180deg, #f6f3ff, #e9eaff);
  color: #342b91;
  box-shadow: 0 7px 16px rgba(72, 64, 161, 0.12);
}

:root[data-resolved-theme="light"] #themeToggle {
  border-color: #f0c77d;
  background: linear-gradient(145deg, #fffaf0, #fff0c8);
  color: #855000;
}

:root[data-resolved-theme="light"] .icon-btn {
  border-color: #d3d9ec;
  background: #ffffff;
  color: #53627a;
  box-shadow: 0 3px 9px rgba(53, 65, 101, 0.11);
}

:root[data-resolved-theme="light"] .row-remove,
:root[data-resolved-theme="light"] .lane-remove {
  border-color: #f0c2cf;
  background: #fff0f4;
  color: #ad2e4e;
}

:root[data-resolved-theme="light"] .route-composer {
  border-color: #cfbfef;
  background: linear-gradient(135deg, #f5f1ff, #edf8ff 58%, #edfaf6);
  box-shadow: 0 9px 24px rgba(74, 67, 147, 0.1);
}

:root[data-resolved-theme="light"] .route-composer-head {
  background: linear-gradient(90deg, rgba(124, 77, 219, 0.07), rgba(8, 126, 184, 0.05));
}

:root[data-resolved-theme="light"] .route-composer-icon {
  border-color: #c9b7ef;
  background: #ece6ff;
  color: #6540b5;
}

:root[data-resolved-theme="light"] .route-editor-shell {
  border-color: #d8dced;
  background: rgba(255, 255, 255, 0.82);
}

:root[data-resolved-theme="light"] .drop-zone {
  border-color: rgba(7, 134, 99, 0.42);
  background:
    radial-gradient(circle at 88% 18%, rgba(14, 165, 233, 0.12), transparent 10rem),
    linear-gradient(135deg, #edfaf4, #eaf7ff);
  color: #125c50;
}

:root[data-resolved-theme="light"] .drop-zone:hover,
:root[data-resolved-theme="light"] .drop-zone:focus,
:root[data-resolved-theme="light"] .drop-zone.dragging {
  border-color: #078663;
  background: linear-gradient(135deg, #e3f9ee, #e2f4ff);
  box-shadow: 0 0 0 4px rgba(7, 134, 99, 0.11), 0 10px 25px rgba(7, 126, 133, 0.1);
}

:root[data-resolved-theme="light"] .endpoint-search {
  border-color: #bcdced;
  background: linear-gradient(135deg, #eaf7ff, #f2eeff 54%, #fff3ea);
  box-shadow: 0 6px 18px rgba(41, 91, 135, 0.07);
}

:root[data-resolved-theme="light"] .search-count {
  border-color: #b9bce8;
  background: #eceaff;
  color: #4a42a2;
}

:root[data-resolved-theme="light"] .vars-panel {
  border-color: #c9d5ee;
  background: linear-gradient(90deg, #eef3ff, #edf9f6);
}

:root[data-resolved-theme="light"] .token-card {
  border-color: #d6c8ef;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 4px 14px rgba(67, 54, 126, 0.07);
}

:root[data-resolved-theme="light"] #rowsList .stage-lane {
  --lane-accent: var(--accent);
  border-color: color-mix(in srgb, var(--lane-accent) 30%, #d3d9e9);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(42, 54, 99, 0.09);
}

:root[data-resolved-theme="light"] #rowsList .stage-lane:nth-child(4n + 2) { --lane-accent: var(--sky); }
:root[data-resolved-theme="light"] #rowsList .stage-lane:nth-child(4n + 3) { --lane-accent: var(--mint); }
:root[data-resolved-theme="light"] #rowsList .stage-lane:nth-child(4n + 4) { --lane-accent: var(--violet); }

:root[data-resolved-theme="light"] #rowsList .stage-lane-header {
  border-bottom-color: color-mix(in srgb, var(--lane-accent) 22%, #d4daeb);
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--lane-accent) 12%, #ffffff),
      color-mix(in srgb, var(--lane-accent) 6%, #f6f8fc) 62%,
      #f8f9fd);
  color: #17213b;
}

:root[data-resolved-theme="light"] .request-card {
  border-color: #ced6e8;
  border-inline-start-width: 4px;
  background: linear-gradient(180deg, #ffffff, #fafbff);
  box-shadow: 0 5px 16px rgba(50, 62, 98, 0.07);
}

:root[data-resolved-theme="light"] .request-card:nth-child(4n + 1) { border-inline-start-color: var(--sky); }
:root[data-resolved-theme="light"] .request-card:nth-child(4n + 2) { border-inline-start-color: var(--action); }
:root[data-resolved-theme="light"] .request-card:nth-child(4n + 3) { border-inline-start-color: var(--violet); }
:root[data-resolved-theme="light"] .request-card:nth-child(4n + 4) { border-inline-start-color: var(--gold); }

:root[data-resolved-theme="light"] .request-path {
  border-color: #c5c2eb;
  background: linear-gradient(105deg, #f0edff, #eaf7ff 58%, #eaf9f3);
}

:root[data-resolved-theme="light"] .request-path .path-input {
  border-color: #bec9dd;
  background: #ffffff;
  color: #17213b;
}

:root[data-resolved-theme="light"] .request-chip {
  border-color: #c7c1ec;
  background: #eceaff;
  color: #473ca7;
}

:root[data-resolved-theme="light"] .request-chip:nth-child(2n) {
  border-color: #b8dbea;
  background: #e8f7fc;
  color: #17688d;
}

:root[data-resolved-theme="light"] .request-panel {
  border-color: #d0d7e9;
  box-shadow: 0 8px 22px rgba(48, 61, 98, 0.09);
}

:root[data-resolved-theme="light"] .response-body,
:root[data-resolved-theme="light"] .request-sent pre,
:root[data-resolved-theme="light"] .body-editor {
  background: #f8faff;
  color: #17283d;
}

:root[data-resolved-theme="light"] .response-panel-toggle {
  border-color: #c4bdec;
  background: linear-gradient(180deg, #f0edff, #e7e6ff);
  color: #493da8;
  box-shadow: none;
}

:root[data-resolved-theme="light"] .badge.pass {
  border: 1px solid #b9e5cb;
  background: #def6e8;
  color: #08723e;
}

:root[data-resolved-theme="light"] .badge.fail,
:root[data-resolved-theme="light"] .badge.error {
  border: 1px solid #f2bdca;
  background: #ffe5ec;
  color: #b52d4d;
}

:root[data-resolved-theme="light"] .badge.bug {
  border: 1px solid #eed59b;
  background: #fff0c8;
  color: #875300;
}

:root[data-resolved-theme="light"] .badge.idle,
:root[data-resolved-theme="light"] .badge.pending {
  border: 1px solid #d5d9e9;
  background: #f1f3f9;
  color: #5d6982;
}

:root[data-resolved-theme="light"] .workspace-empty-state {
  border-color: #c8c1ec;
  background:
    radial-gradient(circle at 18% 0%, rgba(124, 77, 219, 0.13), transparent 19rem),
    radial-gradient(circle at 90% 80%, rgba(11, 148, 136, 0.12), transparent 18rem),
    linear-gradient(135deg, #faf9ff, #f0f8ff);
}

:root[data-resolved-theme="light"] .modal,
:root[data-resolved-theme="light"] .guide-modal {
  border-color: #cfd3ed;
  background: linear-gradient(145deg, #ffffff, #f8f7ff);
}

:root[data-resolved-theme="light"] .shared-select-menu {
  border-color: #cbc6ed;
  background: linear-gradient(180deg, #ffffff, #f7f5ff);
  box-shadow: 0 24px 64px rgba(43, 47, 98, 0.2), 0 6px 18px rgba(43, 47, 98, 0.1);
}

:root[data-resolved-theme="light"] .notice {
  border-color: #e7ca83;
  background: linear-gradient(135deg, #fff5d7, #fff9e9);
}

:root[data-resolved-theme="light"] .run-bar {
  border-top-color: #cbd2ec;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.94), rgba(243, 241, 255, 0.94) 52%, rgba(235, 249, 247, 0.94));
  box-shadow: 0 -12px 34px rgba(47, 52, 105, 0.11);
}

:root[data-resolved-theme="light"] .site-footer a {
  color: #4d43bd;
}

@media (max-width: 860px) {
  :root[data-resolved-theme="light"] .card,
  :root[data-resolved-theme="light"] .workspace-card {
    box-shadow: 0 10px 28px rgba(47, 52, 105, 0.09);
  }

  :root[data-resolved-theme="light"] .workspace-head {
    background: linear-gradient(135deg, #eeeaff, #e8f6ff 55%, #e9faf3);
  }
}

@media (max-width: 520px) {
  :root[data-resolved-theme="light"] body {
    background:
      radial-gradient(circle at 5% 0%, rgba(98, 87, 217, 0.16), transparent 17rem),
      radial-gradient(circle at 100% 18%, rgba(8, 126, 184, 0.11), transparent 18rem),
      #f6f7ff;
  }

  :root[data-resolved-theme="light"] .topbar {
    background: rgba(250, 249, 255, 0.95);
  }

  :root[data-resolved-theme="light"] .btn:not(.small),
  :root[data-resolved-theme="light"] input,
  :root[data-resolved-theme="light"] textarea,
  :root[data-resolved-theme="light"] select {
    min-height: 44px;
  }

  :root[data-resolved-theme="light"] .setup-card::after {
    width: 92px;
    height: 92px;
  }

  :root[data-resolved-theme="light"] #rowsList .stage-lane,
  :root[data-resolved-theme="light"] .request-card {
    box-shadow: 0 6px 18px rgba(47, 52, 105, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-resolved-theme="light"] .btn {
    transition: none;
  }
}

/* Responsive endpoint search feedback and per-endpoint workspace variables. */
:root {
  --teal: var(--green);
  --teal-bg: var(--green-bg);
}

.endpoint-search-input-wrap.is-searching input {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.search-results-limit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 9px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-soft) 62%, var(--surface)),
    color-mix(in srgb, var(--green-bg) 34%, var(--surface)));
}

.search-results-limit > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.search-results-limit strong {
  color: var(--text);
  font-size: 12.5px;
}

.search-results-limit span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.search-results-limit .btn {
  flex: 0 0 auto;
  min-height: 36px;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  background: var(--surface);
  color: var(--accent);
}

.endpoint-variables-btn {
  color: color-mix(in srgb, var(--text) 74%, var(--teal));
}

.endpoint-variables-btn[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--teal) 42%, var(--border));
  background: color-mix(in srgb, var(--teal-bg) 76%, var(--surface));
  color: var(--teal);
}

.endpoint-variables-count {
  min-width: 19px;
  min-height: 19px;
  display: inline-grid;
  place-items: center;
  margin-inline-start: 5px;
  padding-inline: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 15%, var(--surface));
  color: var(--teal);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.endpoint-variables-panel {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--teal) 24%, var(--border));
}

.endpoint-variables-head {
  align-items: center;
  background: color-mix(in srgb, var(--teal-bg) 34%, var(--surface-2));
}

.endpoint-variables-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.endpoint-variables-title > span {
  color: var(--text-muted);
  font-size: 11px;
}

.endpoint-variables-intro {
  display: grid;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-3) 34%, transparent);
}

.endpoint-variables-intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.endpoint-variable-preview {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--teal) 20%, var(--border));
  border-radius: 8px;
  background: var(--surface);
}

.endpoint-variable-preview > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.endpoint-variable-preview code {
  min-width: 0;
  direction: ltr;
  color: var(--text);
  font-size: 11.5px;
  overflow-wrap: anywhere;
  text-align: start;
}

.endpoint-variable-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.endpoint-variable-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(300px, 1.2fr);
  gap: 14px;
  align-items: center;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--teal) 16%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  transition: border-color 150ms ease, background 150ms ease;
}

.endpoint-variable-item:focus-within {
  border-color: color-mix(in srgb, var(--teal) 54%, var(--border));
  background: var(--surface);
}

.endpoint-variable-item.is-missing {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--border));
}

.endpoint-variable-meta {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.endpoint-variable-name-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.endpoint-variable-name-row code {
  min-width: 0;
  direction: ltr;
  color: color-mix(in srgb, var(--text) 76%, var(--teal));
  font-size: 12.5px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: start;
}

.endpoint-variable-state {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  color: var(--teal);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.is-missing .endpoint-variable-state {
  background: color-mix(in srgb, var(--amber) 13%, var(--surface));
  color: var(--amber);
}

.endpoint-variable-source {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-variable-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.endpoint-variable-tags span {
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
}

.endpoint-variable-tags .is-capture {
  border-color: color-mix(in srgb, var(--teal) 28%, var(--border));
  background: color-mix(in srgb, var(--teal-bg) 58%, var(--surface));
  color: var(--teal);
}

.endpoint-variable-value {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.endpoint-variable-value input {
  min-height: 40px;
  direction: ltr;
  border-color: color-mix(in srgb, var(--teal) 18%, var(--border));
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-align: start;
}

.endpoint-variable-value input:focus {
  border-color: var(--teal);
  outline-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 10%, transparent);
}

.endpoint-variable-control {
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 750;
}

.endpoint-variable-control:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--teal) 40%, var(--border));
  background: color-mix(in srgb, var(--teal-bg) 42%, var(--surface));
  color: var(--teal);
}

.endpoint-variable-control:disabled {
  cursor: default;
  opacity: 0.45;
}

.endpoint-variable-control:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.endpoint-variables-empty {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 18px;
  color: var(--text-muted);
  text-align: center;
}

.endpoint-variables-empty strong {
  color: var(--text);
  font-size: 13px;
}

.endpoint-variables-empty span {
  max-width: 620px;
  font-size: 11.5px;
  line-height: 1.55;
}

@media (min-width: 1081px) {
  .request-main {
    grid-template-columns: 92px minmax(150px, 1fr) 136px 92px minmax(78px, 96px) minmax(332px, max-content);
  }

  .actions-cell {
    min-width: 332px;
  }
}

@media (max-width: 860px) {
  .actions-cell {
    grid-template-columns: repeat(4, minmax(0, 1fr)) 40px;
  }

  .endpoint-variable-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }
}

@media (max-width: 620px) {
  .search-results-limit {
    align-items: stretch;
    flex-direction: column;
  }

  .search-results-limit .btn {
    width: 100%;
    min-height: 42px;
  }

  .actions-cell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  }

  .endpoint-body-btn { grid-column: 1; grid-row: 1; }
  .endpoint-headers-btn { grid-column: 2; grid-row: 1; }
  .endpoint-variables-btn { grid-column: 1; grid-row: 2; }
  .run-endpoint-btn { grid-column: 2; grid-row: 2; }
  .actions-cell .row-remove { grid-column: 3; grid-row: 1 / 3; align-self: stretch; height: auto; }

  .endpoint-variables-title {
    display: grid;
    gap: 3px;
  }

  .endpoint-variable-preview {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .endpoint-variable-list {
    padding: 9px;
  }

  .endpoint-variable-item {
    padding: 9px;
  }
}

@media (max-width: 440px) {
  .endpoint-variable-value {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .endpoint-variable-value input {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .endpoint-variable-control {
    grid-row: 2;
  }

  .endpoint-variable-control:first-of-type {
    grid-column: 1;
    justify-self: end;
  }

  .endpoint-variable-clear {
    grid-column: 2;
  }
}

:root[data-resolved-theme="light"] .endpoint-variables-panel {
  border-color: #c9dfdf;
}

:root[data-resolved-theme="light"] .endpoint-variable-item {
  background: linear-gradient(135deg, #fbffff, #f7f8ff);
}

@media (prefers-reduced-motion: reduce) {
  .endpoint-variable-item {
    transition: none;
  }
}

/* Group headers open on click; reordering belongs only to the drag handle. */
.stage-lane-header,
.stage-lane-header:active {
  cursor: pointer;
}

.lane-drag-handle {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: grab;
  line-height: 1;
  user-select: none;
}

.lane-drag-handle:hover:not(.is-disabled) {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface));
  color: var(--accent);
}

.lane-drag-handle:active:not(.is-disabled) {
  cursor: grabbing;
}

.lane-title-value {
  cursor: pointer;
}

@media (hover: hover) {
  .stage-lane-header:hover {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 13%, transparent);
  }
}

@media (max-width: 640px) {
  .lane-drag-handle {
    display: none;
  }
}

/* Selected groups become a contextual dock above the persistent run bar. */
.group-selection-bar {
  position: fixed;
  inset-inline: 12px;
  top: auto;
  bottom: calc(var(--run-bar-dock-offset, 76px) + 10px);
  z-index: 24;
  width: min(1520px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 10px 12px;
  border-color: color-mix(in srgb, var(--action, var(--accent)) 58%, var(--border));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow:
    0 -4px 18px color-mix(in srgb, var(--text) 7%, transparent),
    0 16px 42px color-mix(in srgb, var(--text) 18%, transparent);
}

body.has-group-selection .container {
  padding-bottom: calc(
    var(--run-bar-height, 76px) +
    var(--group-selection-bar-height, 64px) +
    34px
  );
}

body.has-group-selection .toast,
body.has-group-selection .back-to-top {
  bottom: calc(
    var(--run-bar-dock-offset, 76px) +
    var(--group-selection-bar-height, 64px) +
    24px
  );
}

@media (max-width: 860px) {
  .group-selection-bar {
    inset-inline: 10px;
    width: calc(100vw - 20px);
    bottom: calc(var(--run-bar-dock-offset, 0px) + 8px);
    gap: 9px;
    padding: 9px 10px;
  }

  .group-selection-summary {
    gap: 8px;
  }

  .group-selection-indicator {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .group-selection-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
  }

  .group-selection-actions .btn {
    min-height: 40px;
  }
}

/* Endpoint card controls: balanced status and actions with corner utilities. */
.request-card {
  overflow: visible;
}

.request-main {
  padding-inline-end: 38px;
}

.endpoint-remove-btn {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 10px;
  z-index: 4;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--red) 22%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text-muted);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--text) 6%, transparent);
}

.endpoint-remove-btn:hover {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 48%, var(--border));
  background: var(--red-bg);
  transform: translateY(-1px);
}

.endpoint-remove-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.request-main > .request-meta:nth-child(4),
.result-cell {
  min-width: 0;
  align-self: stretch;
}

.request-main > .request-meta:nth-child(4) .compact-field,
.request-main > .request-meta:nth-child(4) input {
  width: 100%;
  min-height: 40px;
}

.result-cell {
  min-height: 44px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.result-stack {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  align-items: stretch;
  gap: 5px;
}

.result-stack .badge {
  min-height: 34px;
  padding: 6px 10px;
  justify-content: center;
  text-align: center;
}

.actions-cell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 72px), 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.actions-cell .row-action {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 6px 11px;
  border-radius: 7px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
}

.actions-cell .endpoint-body-btn,
.actions-cell .endpoint-headers-btn,
.actions-cell .endpoint-variables-btn,
.actions-cell .run-endpoint-btn {
  grid-column: auto;
  grid-row: auto;
  min-inline-size: 0;
}

.actions-cell .endpoint-headers-btn,
.actions-cell .endpoint-variables-btn {
  gap: 6px;
}

.actions-cell .endpoint-headers-label,
.actions-cell .endpoint-variables-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions-cell .endpoint-headers-count,
.actions-cell .endpoint-variables-count {
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-inline-start: 0;
  padding-inline: 4px;
  font-size: 9px;
}

.new-endpoint-focus {
  border-color: color-mix(in srgb, var(--action, var(--accent)) 68%, var(--border));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--action, var(--accent)) 17%, transparent),
    0 16px 36px color-mix(in srgb, var(--action, var(--accent)) 13%, transparent);
  animation: new-endpoint-arrival 0.7s ease-out;
}

@keyframes new-endpoint-arrival {
  from { transform: translateY(10px); opacity: 0.72; }
  to { transform: translateY(0); opacity: 1; }
}

.back-to-top {
  right: auto;
  inset-inline-end: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px color-mix(in srgb, var(--accent) 30%, transparent);
}

@media (min-width: 1081px) {
  .request-main {
    grid-template-columns:
      92px
      minmax(150px, 1fr)
      136px
      minmax(90px, 110px)
      minmax(332px, max-content);
  }

  .result-cell {
    grid-column: 4;
  }

  .actions-cell {
    grid-column: 5;
    grid-template-columns:
      minmax(58px, 0.8fr)
      minmax(76px, 1fr)
      minmax(96px, 1.25fr)
      minmax(62px, 0.85fr);
    min-width: 332px;
  }
}

@media (max-width: 620px) {
  .request-main {
    padding-inline-end: 34px;
  }

  .endpoint-remove-btn {
    inset-block-start: 10px;
    inset-inline-end: 8px;
    width: 34px;
    height: 34px;
  }

  .actions-cell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .actions-cell .row-action {
    width: 100%;
    min-height: 40px;
    padding-inline: 8px;
  }

  .back-to-top {
    inset-inline-end: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .new-endpoint-focus {
    animation: none;
  }
}

/* Compact group results appear only after at least one endpoint has completed. */
.lane-run-summary {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0;
}

.lane-run-summary > span {
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.lane-run-summary .lane-summary-total {
  color: var(--text-muted);
}

.lane-run-summary .lane-summary-pass {
  border-color: color-mix(in srgb, var(--green) 30%, var(--border));
  background: color-mix(in srgb, var(--green-bg) 64%, var(--surface));
  color: var(--green);
}

.lane-run-summary .lane-summary-bug {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--border));
  background: color-mix(in srgb, var(--amber-bg) 64%, var(--surface));
  color: var(--amber);
}

.lane-run-summary .lane-summary-fail {
  border-color: color-mix(in srgb, var(--red) 30%, var(--border));
  background: color-mix(in srgb, var(--red-bg) 64%, var(--surface));
  color: var(--red);
}

/* Keep a large token collection compact without scrolling the whole page rail. */
.tokens-card {
  --tokens-card-max-height: min(680px, calc(100vh - 180px));
  display: flex;
  flex-direction: column;
  max-height: var(--tokens-card-max-height);
  min-height: 0;
  overflow: hidden;
}

.token-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-inline-end: 5px;
  margin-inline-end: -5px;
}

.tokens-card > h2,
.tokens-card > .hint,
.tokens-card > .btn-row {
  flex: 0 0 auto;
}

.token-list::-webkit-scrollbar {
  width: 7px;
}

.token-list::-webkit-scrollbar-track {
  background: transparent;
}

.token-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 42%, var(--border));
  background-clip: padding-box;
}

@media (min-width: 1181px) {
  .setup-rail {
    position: relative;
    top: auto;
    align-self: stretch;
  }

  .tokens-card {
    position: sticky;
    top: 86px;
    z-index: 8;
  }
}

/* Route line: the HTTP method replaces the decorative endpoint label. */
.request-route-label {
  display: none;
}

.request-path {
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
  padding-inline-start: 112px;
}

.request-method {
  grid-column: 1;
  grid-row: 1;
  z-index: 3;
  width: 96px;
  margin-inline-start: 8px;
  align-self: center;
}

.request-method .shared-select,
.request-method .shared-select-trigger {
  width: 100%;
}

/* One balanced control row whenever the endpoint card has enough room. */
.request-main {
  grid-template-columns:
    minmax(120px, 1fr)
    minmax(90px, 110px)
    minmax(125px, 150px)
    minmax(300px, 340px);
}

.request-main > .request-meta:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.request-main > .request-meta:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.result-cell {
  grid-column: 3;
  grid-row: 2;
}

.actions-cell {
  grid-column: 4;
  grid-row: 2;
  grid-template-columns:
    minmax(52px, 0.72fr)
    minmax(68px, 0.92fr)
    minmax(92px, 1.18fr)
    minmax(56px, 0.78fr);
  min-width: 0;
}

.actions-cell .endpoint-variables-btn {
  column-gap: 8px;
}

.actions-cell .endpoint-variables-label {
  margin-inline-end: 1px;
}

.actions-cell .endpoint-variables-count {
  flex: 0 0 auto;
}

@container endpoint-card (max-width: 740px) {
  .request-main {
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
  }

  .request-main > .request-meta:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 1; grid-row: 3; }
  .result-cell { grid-column: 2; grid-row: 3; }

  .actions-cell {
    grid-column: 1 / -1;
    grid-row: 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container endpoint-card (max-width: 440px) {
  .request-path {
    padding-inline-start: 100px;
  }

  .request-method {
    width: 86px;
    margin-inline-start: 6px;
  }

  .request-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .request-main > .request-meta:nth-child(3) { grid-column: 1; grid-row: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 1; grid-row: 3; }
  .result-cell { grid-column: 1; grid-row: 4; }
  .actions-cell { grid-column: 1; grid-row: 5; }
}

/* A failed endpoint remains unmistakable after the transient failure alert closes. */
.request-card.has-result-error {
  border-color: color-mix(in srgb, var(--red) 74%, var(--border));
  border-inline-start-width: 3px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--red-bg) 30%, var(--surface)),
      color-mix(in srgb, var(--surface) 94%, var(--red-bg)));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--red) 9%, transparent),
    0 12px 28px color-mix(in srgb, var(--red) 10%, transparent);
}

.request-card.has-result-error .request-path {
  border-color: color-mix(in srgb, var(--red) 28%, var(--border));
}

@media (max-width: 520px) {
  .lane-run-summary {
    width: 100%;
    flex-wrap: wrap;
  }

  .lane-run-summary > span {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .group-selection-bar {
    inset-inline: 8px;
    width: calc(100vw - 16px);
    flex-direction: column;
    align-items: stretch;
    border-radius: 12px;
  }

  .group-selection-summary small {
    display: none;
  }

  .group-selection-summary strong {
    font-size: 12px;
  }

  .group-selection-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
    gap: 6px;
  }

  .group-selection-actions .btn,
  .run-selected-groups-btn {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
    padding-inline: 8px;
    font-size: 11px;
  }
}

@media (max-width: 350px) {
  .group-selection-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .run-selected-groups-btn {
    grid-column: 1 / -1;
  }
}

/* Endpoint controls respond to the card width, including sidebar layouts. */
.request-card {
  container-name: endpoint-card;
  container-type: inline-size;
}

.result-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.result-stack .badge {
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-stack .response-panel-toggle {
  width: 36px;
  min-width: 36px;
  min-height: 34px;
  padding: 0;
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-2));
  color: var(--accent);
}

.result-stack .response-panel-toggle span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.result-cell:has(.badge.fail),
.result-cell:has(.badge.error) {
  border-color: color-mix(in srgb, var(--red) 48%, var(--border));
  background: color-mix(in srgb, var(--red-bg) 52%, var(--surface));
}

.actions-cell .row-action {
  text-overflow: ellipsis;
}

@container endpoint-card (max-width: 1050px) {
  .request-main {
    grid-template-columns: 92px minmax(150px, 1fr) 136px minmax(150px, 180px);
  }

  .request-method { grid-column: 1; grid-row: 2; }
  .request-main > .request-meta:nth-child(3) { grid-column: 2; grid-row: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 3; grid-row: 2; }
  .result-cell { grid-column: 4; grid-row: 2; }

  .actions-cell {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns:
      minmax(68px, 0.8fr)
      minmax(92px, 1fr)
      minmax(108px, 1.15fr)
      minmax(68px, 0.8fr);
    min-width: 0;
  }
}

@container endpoint-card (max-width: 680px) {
  .request-main {
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
  }

  .request-method { grid-column: 1; grid-row: 2; }
  .request-main > .request-meta:nth-child(3) { grid-column: 2; grid-row: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 1; grid-row: 3; }
  .result-cell { grid-column: 2; grid-row: 3; }

  .actions-cell {
    grid-column: 1 / -1;
    grid-row: 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions-cell .row-action {
    min-height: 40px;
  }
}

@container endpoint-card (max-width: 390px) {
  .request-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .request-method { grid-column: 1; grid-row: 2; }
  .request-main > .request-meta:nth-child(3) { grid-column: 1; grid-row: 3; }
  .request-main > .request-meta:nth-child(4) { grid-column: 1; grid-row: 4; }
  .result-cell { grid-column: 1; grid-row: 5; }
  .actions-cell { grid-column: 1; grid-row: 6; }
}

/* The complete setup rail remains available while the workspace scrolls. */
@media (min-width: 1181px) {
  .container {
    grid-template-rows: auto;
  }

  .setup-rail {
    position: relative;
    top: auto;
    display: flex;
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
  }

  .tokens-card {
    position: relative;
    top: auto;
    z-index: auto;
    align-self: start;
  }

  .tokens-card.has-scrollable-tokens {
    max-height: var(--tokens-card-max-height);
  }

  .workspace-card {
    grid-column: 2;
    grid-row: 1;
  }

  .token-card-placeholder {
    width: 100%;
    flex: 0 0 auto;
  }

  .tokens-card.is-docked {
    position: fixed;
    left: var(--token-card-dock-left);
    top: 86px;
    z-index: 23;
    width: var(--token-card-dock-width);
    max-height: var(--tokens-card-max-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
  }

  .tokens-card.is-docked .token-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .tokens-card.is-docked > h2,
  .tokens-card.is-docked > .hint,
  .tokens-card.is-docked > .btn-row {
    flex: 0 0 auto;
  }
}

/* Final endpoint composition overrides legacy card-width rules above. */
.request-method {
  grid-column: 1;
  grid-row: 1;
}

.actions-cell .endpoint-variables-count {
  margin-inline-start: 4px;
}

@container endpoint-card (max-width: 1050px) {
  .request-main {
    grid-template-columns:
      minmax(140px, 1fr)
      minmax(96px, 116px)
      minmax(135px, 160px)
      minmax(300px, 340px);
  }

  .request-method { grid-column: 1; grid-row: 1; }
  .request-main > .request-meta:nth-child(3) { grid-column: 1; grid-row: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 2; grid-row: 2; }
  .result-cell { grid-column: 3; grid-row: 2; }

  .actions-cell {
    grid-column: 4;
    grid-row: 2;
    grid-template-columns:
      minmax(52px, 0.72fr)
      minmax(68px, 0.92fr)
      minmax(92px, 1.18fr)
      minmax(56px, 0.78fr);
    min-width: 0;
  }
}

@container endpoint-card (max-width: 780px) {
  .request-main {
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
  }

  .request-method { grid-column: 1; grid-row: 1; }
  .request-main > .request-meta:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 1; grid-row: 3; }
  .result-cell { grid-column: 2; grid-row: 3; }

  .actions-cell {
    grid-column: 1 / -1;
    grid-row: 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container endpoint-card (max-width: 440px) {
  .request-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .request-method { grid-column: 1; grid-row: 1; }
  .request-main > .request-meta:nth-child(3) { grid-column: 1; grid-row: 2; }
  .request-main > .request-meta:nth-child(4) { grid-column: 1; grid-row: 3; }
  .result-cell { grid-column: 1; grid-row: 4; }
  .actions-cell { grid-column: 1; grid-row: 5; }
}

/* Wide endpoint cards: keep auth compact and reserve room for counted actions. */
@container endpoint-card (min-width: 781px) {
  .request-main {
    grid-template-columns:
      minmax(140px, 210px)
      minmax(96px, 116px)
      minmax(135px, 160px)
      minmax(332px, 1fr);
  }

  .actions-cell {
    grid-template-columns:
      minmax(56px, 0.72fr)
      minmax(98px, 1.12fr)
      minmax(92px, 1.08fr)
      minmax(60px, 0.78fr);
  }
}
