:root {
  --colorPrimary: #0284c7;
  --colorPrimaryHover: #0270ab;

  --colorSuccess: #4caf50;
  --colorSuccessLight: #d1fae5;
  --colorSuccessDark: #065f46;
  --colorSuccessBorder: #6ee7b7;

  --colorError: #ef4444;
  --colorErrorDark: #b91c1c;
  --colorErrorBg: #fef2f2;

  --colorWarning: #fbbf24;
  --colorWarningDark: #92400e;
  --colorWarningBg: #fffbeb;

  --colorBg: #f5f7fa;
  --colorBgCard: #fff;
  --colorBgCode: #1e1e2e;

  --colorText: #333;
  --colorTextHeading: #1a1a2e;
  --colorTextMuted: #666;
  --colorTextLight: #888;

  --colorBorder: #e0e0e0;
  --colorBorderInput: #ccc;
  --colorBorderFocus: #0284c7;

  --colorInputHighlight: #d1fae5;

  --radiusSm: 4px;
  --radiusMd: 8px;
  --radiusLg: 12px;

  --fontSizeXxs: 0.625rem;
  --fontSizeXs: 0.7rem;
  --fontSizeSm: 0.8rem;
  --fontSizeMd: 0.85rem;
  --fontSizeLg: 1rem;
  --fontSizeXl: 1.25rem;
  --fontSizeXxl: 1.75rem;

  --statusSuccessBg: #dcfce7;
  --statusSuccessText: #166534;
  --statusErrorBg: #fef2f2;
  --statusErrorText: #b91c1c;
  --statusWarningBg: #fffbeb;
  --statusWarningText: #92400e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--colorBg);
  color: var(--colorText);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* Admin / info inline links (next to field labels) */
.label-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--colorPrimary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  padding: 1px 5px;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.label-link:hover {
  background: rgba(2, 132, 199, 0.1);
  color: var(--colorPrimaryHover);
  text-decoration: none;
}
[data-theme="dark"] .label-link:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* Input auto-correction highlight flash */
.input-highlight {
  animation: inputHighlightFlash 1s ease-out;
}
@keyframes inputHighlightFlash {
  0% { background-color: var(--colorInputHighlight); }
  100% { background-color: transparent; }
}

/* Success result box */
.result-success {
  background: var(--colorSuccessLight);
  border-color: var(--colorSuccessBorder);
  color: var(--colorSuccessDark);
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.breadcrumb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.breadcrumb-docs-link {
  color: var(--colorPrimary) !important;
  font-size: var(--fontSizeSm);
}

.breadcrumb a {
  color: var(--colorTextMuted);
  text-decoration: none;
  font-size: var(--fontSizeMd);
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--colorPrimary);
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: var(--fontSizeXxl);
  color: var(--colorTextHeading);
}

.subtitle {
  color: var(--colorTextMuted);
  margin-top: 0.25rem;
}

/* Config Panel */
.config-panel {
  background: var(--colorBgCard);
  border: 1px solid var(--colorBorder);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.config-panel summary {
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
}
.config-panel summary .btn-icon:first-of-type {
  margin-left: auto;
}

.btn-icon:hover {
  background: #eee;
  color: var(--colorPrimaryHover);
}

.config-status {
  font-size: var(--fontSizeXs);
  font-weight: 400;
  color: var(--colorTextMuted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.config-status.saved {
  color: #4caf50;
}

.config-name {
  font-weight: 500;
}

.config-badge-browser {
  font-size: var(--fontSizeXxs);
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  background: #fff7ed;
  color: #c2410c;
  border-radius: 3px;
  border: 1px solid #fed7aa;
}

.config-fields {
  padding: 0 1.25rem 1.25rem;
}

.config-row {
  margin-bottom: 0.75rem;
}

.config-row-split {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.config-row-half {
  flex: 1;
}

.config-row-half label {
  display: block;
  font-size: var(--fontSizeSm);
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #555;
}

.config-row-half input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeMd);
}

.config-row-half input:focus,
.config-row-half select:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.config-row-half select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeMd);
  font-family: inherit;
  background: var(--colorBgCard);
}

.config-section-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0 0.75rem;
  gap: 0.75rem;
}

.config-section-divider::before,
.config-section-divider::after {
  content: '';
  flex: 1;
  border-top: 1px dashed var(--colorBorderInput);
}

.config-section-divider span {
  font-size: var(--fontSizeXs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--colorTextLight);
  white-space: nowrap;
}

.config-row label {
  display: block;
  font-size: var(--fontSizeSm);
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #555;
}

.config-row input,
.config-row textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeMd);
  font-family: inherit;
}

.config-row textarea {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  resize: vertical;
}

.redirect-uri-input {
  flex: 1;
  min-width: 0;
}
.redirect-uri-input[hidden] {
  display: none;
}

.param-mode-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.param-mode-group select {
  width: auto;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeMd);
  font-family: inherit;
  background: var(--colorBgCard);
}

.param-mode-group input {
  flex: 1;
  min-width: 120px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeMd);
}

.config-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Stepper */
.stepper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-narration {
  padding: 0.75rem 1.25rem;
}

.step-narration h3 {
  font-size: var(--fontSizeLg);
  font-weight: 600;
  color: var(--colorText);
  margin: 0 0 0.25rem 0;
}

.step-narration p {
  font-size: var(--fontSizeMd);
  color: var(--colorTextMuted);
  margin: 0;
}

/* Step Tabs */
.step-tabs {
  margin-top: 0.5rem;
}
.step-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--colorBorder);
  overflow-x: auto;
}
.step-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  font-size: var(--fontSizeSm);
  font-weight: 500;
  color: #777;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.step-tab-close {
  margin-left: auto;
  border: none;
  background: none;
  color: #aaa;
  font-size: var(--fontSizeLg);
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  line-height: 1;
  border-radius: 4px;
  visibility: hidden;
}
.step-tabs-bar:has(.step-tab-btn.active) .step-tab-close {
  visibility: visible;
}
.step-tab-close:hover {
  color: var(--colorTextMuted);
  background: rgba(0,0,0,0.05);
}
[data-theme="dark"] .step-tab-close:hover {
  color: #ccc;
  background: rgba(255,255,255,0.08);
}

.step-tab-btn:hover {
  color: var(--colorText);
}
.step-tab-btn.active {
  color: var(--colorPrimary);
  border-bottom-color: var(--colorPrimary);
  font-weight: 600;
}
.step-tab-btn .step-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--colorBorder);
  color: #555;
  font-size: var(--fontSizeXs);
  font-weight: 700;
  flex-shrink: 0;
}
.step-tab-btn.active .step-tab-num {
  background: var(--colorPrimary);
  color: #fff;
}
.step-tab-btn.tab-locked {
  opacity: 0.45;
  cursor: default;
}
.step-tab-btn.tab-completed .step-tab-num {
  background: #4caf50;
  color: #fff;
}
.step-tab-btn.tab-error .step-tab-num {
  background: #f44336;
  color: #fff;
}
.step-tab-btn .step-tab-badge {
  font-size: var(--fontSizeXxs);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  font-weight: 500;
}
.step-note {
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.step-tab-panel {
  display: none;
}
.step-tab-panel.active {
  display: block;
}

.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--fontSizeMd);
  color: #555;
}

.step {
  background: var(--colorBgCard);
  border: 1px solid var(--colorBorder);
  border-radius: 8px;
  padding: 1.25rem;
  padding-bottom: 1.75rem;
  transition: opacity 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.step-log-link {
  position: absolute;
  bottom: 0.35rem;
  right: 0.75rem;
  font-size: var(--fontSizeXxs);
  color: #999;
  text-decoration: none;
  background: var(--colorBgCard);
  padding: 0.1rem 0.25rem;
  border-radius: 2px;
}

.step-log-link:hover {
  color: var(--colorTextMuted);
  text-decoration: underline;
}

.step.locked {
  opacity: 0.5;
}

.step.completed {
  border-color: #4caf50;
  background: #f1f8e9;
}

.step.error {
  border-color: #f44336;
  background: #fde8e7;
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.scope-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: var(--fontSizeSm);
  margin-top: 0.25rem;
}

.scope-warning .btn-add-scope {
  background: none;
  border: 1px solid #856404;
  color: #856404;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fontSizeSm);
  cursor: pointer;
  margin-left: 0.4rem;
  font-weight: 600;
}
.scope-warning .btn-add-scope:hover {
  background: #856404;
  color: #fff;
}

[data-theme="dark"] .scope-warning {
  background: rgba(255, 193, 7, 0.12);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}
[data-theme="dark"] .scope-warning .btn-add-scope {
  border-color: #ffc107;
  color: #ffc107;
}
[data-theme="dark"] .scope-warning .btn-add-scope:hover {
  background: #ffc107;
  color: #1a1a2e;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--colorBorder);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fontSizeMd);
  flex-shrink: 0;
}

.step.completed .step-number {
  background: #4caf50;
  color: #fff;
}

.step.error .step-number {
  background: #f44336;
  color: #fff;
}

.step-info {
  flex: 1;
  min-width: 0;
}

.step-info h3 {
  font-size: var(--fontSizeLg);
  margin-bottom: 0.125rem;
}

.step-info p {
  font-size: var(--fontSizeSm);
  color: var(--colorTextMuted);
}

.step-option {
  margin-top: 0.5rem;
  font-size: var(--fontSizeSm);
}

.step-option .uri-template {
  background: #f0f0f0;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fontSizeXs);
  color: #555;
  display: inline-flex;
  align-items: center;
}

.step-option .uri-template select {
  background: var(--colorBgCard);
  border: 1px solid var(--colorBorderInput);
  border-radius: 3px;
  padding: 0.15rem 0.3rem;
  font-family: inherit;
  font-size: inherit;
  color: var(--colorPrimary);
  cursor: pointer;
  margin: 0 1px;
}

.step-option .uri-template select:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.step-option .grant-type {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.step-option .grant-type-badge {
  display: inline-block;
  font-size: var(--fontSizeXxs);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  background: rgba(0, 102, 204, 0.1);
  color: var(--colorPrimary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 102, 204, 0.2);
  white-space: nowrap;
}

.step-option .option-label {
  font-size: var(--fontSizeXs);
  color: var(--colorTextMuted);
  margin-right: 0.15rem;
}

.step-option .step-select {
  padding: 0.2rem 0.35rem;
  font-size: var(--fontSizeXs);
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  background: var(--colorBgCard);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.step-option-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.step-input-inline {
  padding: 0.25rem 0.5rem;
  font-size: var(--fontSizeXs);
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  width: 180px;
}

.step-input-inline:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.step-input-inline[hidden] {
  display: none;
}

.step-option label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--colorTextMuted);
  font-weight: 500;
}

.step-option .step-input {
  width: 100%;
  max-width: 350px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeSm);
  font-family: inherit;
}

.step-option .step-input:focus {
  outline: none;
  border-color: var(--colorPrimary);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Buttons */
.btn {
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: var(--fontSizeMd);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  background: var(--colorPrimary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--colorPrimaryHover);
}

.btn-secondary {
  background: #eee;
  color: var(--colorText);
}

.btn-secondary:hover {
  background: #ddd;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: var(--fontSizeXs);
}

/* Results */
.step-result {
  margin-top: 0.75rem;
  display: none;
}

.step-result.visible {
  display: block;
}

.result-box {
  background: #f8f9fa;
  border: 1px solid var(--colorBorder);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

.result-box-closable {
  position: relative;
  padding-right: 2rem;
}

.result-box-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: none;
  border: none;
  font-size: var(--fontSizeXl);
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 0.2rem;
}

.result-box-close:hover {
  color: var(--colorText);
}

.result-box .claim-key,
.result-box .json-key {
  color: #7c3aed;
}

.result-box .claim-value,
.result-box .json-string {
  color: #059669;
}

.result-box .json-number {
  color: #d97706;
}

.result-box .json-bool {
  color: #0284c7;
  font-weight: 600;
}

.result-box .json-null {
  color: #9ca3af;
  font-style: italic;
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  color: var(--colorErrorDark);
  font-size: var(--fontSizeSm);
}

.loading {
  color: var(--colorTextMuted);
  font-style: italic;
  font-size: var(--fontSizeSm);
}

/* Step 4: API Test Config */
.step-optional-badge {
  display: inline-block;
  font-size: var(--fontSizeXxs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.1rem 0.4rem;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.api-test-config {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border: 1px solid var(--colorBorder);
  border-radius: 6px;
}

.api-test-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.api-method-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeSm);
  font-weight: 600;
  background: var(--colorBgCard);
  cursor: pointer;
  min-width: 90px;
}

.api-method-select:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.api-url-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeSm);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.api-url-input:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.api-test-body {
  margin-top: 0.5rem;
}

.api-test-body label {
  display: block;
  font-size: var(--fontSizeXs);
  color: #555;
  margin-bottom: 0.25rem;
}

.api-test-body textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeXs);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  resize: vertical;
}

.api-test-body textarea:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.api-response-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: var(--fontSizeSm);
  color: #22c55e;
}

.api-status {
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: var(--fontSizeXs);
}

.api-status.status-success {
  background: var(--statusSuccessBg);
  color: var(--statusSuccessText);
}

.api-status.status-error {
  background: var(--statusErrorBg);
  color: var(--statusErrorText);
}

/* Actor Badges */
.actor {
  display: inline-block;
  font-size: var(--fontSizeXxs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.25rem;
}

.actor-app {
  background: #e3f2fd;
  color: var(--colorPrimary);
}

.actor-user {
  background: #f3e5f5;
  color: #7b1fa2;
}

.actor-agent {
  background: #f3e5f5;
  color: #7b1fa2;
}

.actor-device {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.actor-mcp {
  background: #e8f5e9;
  color: #2e7d32;
}

/* Collapsible step sections (config + cURL) */
.config-section,
.curl-section {
  margin-top: 0.75rem;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background: var(--colorBgCard);
}

.config-section summary,
.curl-section summary {
  padding: 0.4rem 0.75rem;
  font-size: var(--fontSizeXs);
  font-weight: 600;
  color: #555;
  cursor: pointer;
}

.curl-step-label {
  padding: 0.4rem 0.75rem 0.15rem;
  font-size: var(--fontSizeXs);
  color: #777;
  font-weight: 600;
}

.curl-box {
  position: relative;
  margin: 0 0.75rem 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.curl-box .curl-cmd {
  color: #89b4fa;
}

.curl-box .curl-flag {
  color: #f9e2af;
}

.curl-box .curl-url {
  color: #a6e3a1;
}

.curl-box .curl-data {
  color: #f5c2e7;
}

.curl-box .curl-eq {
  color: #cdd6f4;
}

.curl-box .curl-param {
  color: #cba6f7;
}

.curl-box .curl-value {
  color: #89dceb;
}

.curl-box .curl-null {
  color: #f38ba8;
  font-weight: 600;
}

.curl-box .curl-value {
  color: #f9e2af;
}

.curl-box .curl-comment {
  color: #6c7086;
  font-style: italic;
}

/* JSON syntax highlighting inside response pre boxes */
.curl-box .json-key {
  color: #89b4fa;
}
.curl-box .json-string {
  color: #a6e3a1;
}
.curl-box .json-number {
  color: #fab387;
}
.curl-box .json-bool {
  color: #f9e2af;
  font-weight: 600;
}
.curl-box .json-null {
  color: #6c7086;
  font-style: italic;
}

/* Response body block (under cURL sections) */
.curl-box.response-body {
  background: #1a1b2e;
  color: #cdd6f4;
  border-left: 3px solid #89b4fa;
}

.curl-box.response-body .claim-key {
  color: #89b4fa;
}

.curl-box.response-body .claim-value {
  color: #a6e3a1;
}

[data-theme="dark"] .curl-box.response-body {
  background: #131324;
  border-left-color: #7c8ef7;
}

/* cURL copy button (injected by utils.js) */
.curl-copy-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  background: rgba(30, 30, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #a0a0a0;
  cursor: pointer;
  padding: 3px 4px;
  display: inline-flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.curl-copy-btn:hover {
  opacity: 1;
  color: #cdd6f4;
}
.curl-copy-btn.copied {
  color: #4ade80;
  opacity: 1;
}

/* Regenerate cURL link */
.curl-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: var(--fontSizeXs);
}

.curl-links-separator {
  color: var(--colorTextMuted);
  opacity: 0.5;
}

.curl-regenerate-link,
.curl-explain-link {
  color: #a0c4ff;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.curl-regenerate-link:hover,
.curl-explain-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Use Existing Token */
.step-action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.use-existing-link {
  color: var(--colorTextLight);
  font-size: var(--fontSizeXs);
  text-decoration: none;
}

.use-existing-link:hover {
  color: #555;
  text-decoration: underline;
}

.use-existing-panel {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid var(--colorBorder);
  border-radius: 6px;
}

.use-existing-panel label {
  display: block;
  font-size: var(--fontSizeSm);
  font-weight: 500;
  color: #555;
  margin-bottom: 0.5rem;
}

.use-existing-panel textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  resize: vertical;
  min-height: 80px;
}

.use-existing-panel textarea:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.use-existing-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--colorTextLight);
  cursor: pointer;
  font-size: var(--fontSizeXs);
  padding: 0.4rem 0.5rem;
}

.btn-link:hover {
  color: #555;
  text-decoration: underline;
}

.existing-token-note {
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  font-style: italic;
  margin-bottom: 0.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

/* Dialog modal needs higher z-index to appear above other modals */
#dialog-modal {
  z-index: 1100;
}

.modal {
  background: var(--colorBgCard);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--colorBorder);
}

.modal-header h3 {
  font-size: var(--fontSizeLg);
}

.modal-header .btn-icon {
  font-size: var(--fontSizeXl);
  line-height: 1;
}

#configs-filter {
  flex: 0 1 200px;
  padding: 4px 8px;
  font-size: var(--fontSizeSm);
  border: 1px solid var(--colorBorder);
  border-radius: var(--radiusSm);
  background: var(--colorBgInput, var(--colorBg));
  color: var(--colorText, #111);
  outline: none;
}
#configs-filter::placeholder {
  color: var(--colorTextMuted, #888);
}
#configs-filter:focus {
  border-color: var(--colorPrimary);
}

.modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.config-list-empty {
  text-align: center;
  color: #999;
  padding: 2rem 0;
  font-size: var(--fontSizeMd);
}

.config-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.config-item:last-child {
  border-bottom: none;
}

.config-item-info {
  flex: 1;
  min-width: 0;
}

.config-item-name {
  font-weight: 600;
  font-size: var(--fontSizeMd);
}

.config-item-meta {
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
}

.config-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-load {
  background: #e3f2fd;
  color: var(--colorPrimary);
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: var(--fontSizeXs);
  font-weight: 600;
  cursor: pointer;
}

.btn-load:hover {
  background: #bbdefb;
}

.btn-delete {
  background: #fef2f2;
  color: var(--colorErrorDark);
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: var(--fontSizeXs);
  font-weight: 600;
  cursor: pointer;
}

.btn-delete:hover {
  background: #fca5a5;
}

.btn-export {
  background: #f0fdf4;
  color: var(--colorSuccessDark);
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: var(--fontSizeXs);
  font-weight: 600;
  cursor: pointer;
}

.btn-export:hover {
  background: #bbf7d0;
}


/* Dialog Modal */
.modal-dialog {
  max-width: 380px;
}

.modal-dialog .modal-body p {
  font-size: var(--fontSizeMd);
  color: var(--colorText);
  margin-bottom: 0.5rem;
}

.dialog-field {
  margin-bottom: 0.75rem;
}

.dialog-field label {
  display: block;
  font-size: var(--fontSizeSm);
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #555;
}

.label-optional {
  font-weight: 400;
  color: #999;
}

.dialog-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeMd);
  font-family: inherit;
}

textarea.dialog-input {
  resize: vertical;
}

.dialog-input[hidden] {
  display: none;
}

.dialog-select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeMd);
  font-family: inherit;
  background: var(--colorBgCard);
  cursor: pointer;
}

.dialog-select:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

/* Save Configuration Modal */
.save-modal-wide {
  max-width: 560px;
}

.save-destination-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--colorBorder);
}
.save-destination-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  cursor: pointer;
}
.save-destination-option input[type="checkbox"] {
  accent-color: var(--colorPrimary);
  width: 16px;
  height: 16px;
}
.save-destination-hint {
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  font-style: italic;
}

.save-new-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.save-new-row .dialog-input {
  flex: 1;
}

.save-new-row .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.save-existing-list {
  border-top: 1px solid var(--colorBorder);
  padding-top: 0.75rem;
}

.save-existing-list .save-existing-heading {
  font-size: var(--fontSizeXs);
  font-weight: 600;
  color: var(--colorTextLight);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.save-config-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.save-config-item:last-child {
  border-bottom: none;
}

.save-config-item-info {
  flex: 1;
  min-width: 0;
}

.save-config-item-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.save-config-item-name {
  font-weight: 600;
  font-size: var(--fontSizeMd);
}

.save-config-item-meta {
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  white-space: nowrap;
}

.save-config-current-badge {
  font-size: var(--fontSizeXs);
  font-weight: 400;
  color: #4caf50;
}

.save-config-item-note {
  font-size: var(--fontSizeXs);
  color: var(--colorTextMuted);
  font-style: italic;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-overwrite {
  background: #fff3e0;
  color: #e65100;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: var(--fontSizeXs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-overwrite:hover {
  background: #ffe0b2;
}

.config-item-note {
  font-size: var(--fontSizeXs);
  color: var(--colorTextMuted);
  font-style: italic;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--colorBorder);
}

/* Stepper actions */
.stepper-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Log link in error messages */
.log-link {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: var(--fontSizeXs);
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}
.log-link:hover {
  color: #1d4ed8;
}

/* Token copy buttons */
.token-copy-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.btn-copy-token {
  font-size: var(--fontSizeXs);
  padding: 0.3rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-copy-token:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.btn-copy-token.copied {
  background: var(--colorSuccessLight);
  border-color: #6ee7b7;
  color: #065f46;
}

.btn-copy-token.active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.token-jwt-link {
  font-size: var(--fontSizeXs);
  color: var(--colorPrimary);
  text-decoration: none;
  margin-left: auto;
}

.token-jwt-link:hover {
  text-decoration: underline;
}

.token-copy-label {
  font-size: var(--fontSizeXs);
  color: #22c55e;
  margin-right: 0.75rem;
}

.success-indicator {
  font-weight: 600;
  margin-right: 0.25rem;
}

.token-display-area {
  margin-top: 0.5rem;
}

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

/* Actual cURL display - slightly lighter background to indicate sent */
.curl-actual {
  border: 1px solid rgba(134, 239, 172, 0.5) !important;
  background: #252535 !important;
}

/* Token Details Panel */
.token-details {
  background: var(--colorBgCard);
  border: 1px solid var(--colorBorder);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.token-details h3 {
  font-size: var(--fontSizeLg);
  margin-bottom: 1rem;
  color: var(--colorTextHeading);
}

.token-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--colorBorder);
  padding-bottom: 0.5rem;
}

.token-tab {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: var(--fontSizeMd);
  font-weight: 500;
  color: var(--colorTextMuted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.token-tab:hover {
  background: #f0f0f0;
  color: var(--colorText);
}

.token-tab.active {
  background: #e3f2fd;
  color: var(--colorPrimary);
}

.token-content {
  min-height: 200px;
}

.token-section {
  margin-bottom: 1rem;
}

.token-section h4 {
  font-size: var(--fontSizeSm);
  font-weight: 600;
  color: #555;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.token-json {
  background: #f8f9fa;
  border: 1px solid var(--colorBorder);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 250px;
  overflow-y: auto;
}

.token-raw {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
}

.token-empty {
  color: #999;
  font-style: italic;
  font-size: var(--fontSizeMd);
  text-align: center;
  padding: 2rem;
}

.token-raw-container {
  position: relative;
}

.token-raw-container .copy-raw-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.empty-state,
.error-state {
  text-align: center;
  color: #999;
  padding: 2rem;
  font-size: var(--fontSizeMd);
}

.error-state {
  color: var(--colorErrorDark);
}

.token-copy-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Config cards for modal */
.config-card {
  background: #f8f9fa;
  border: 1px solid var(--colorBorder);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.config-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.config-card-header strong {
  font-size: var(--fontSizeMd);
}

.config-card-creator {
  font-size: var(--fontSizeXs);
  color: var(--colorTextMuted);
}

.config-card-domain {
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  margin-bottom: 0.5rem;
}

.config-card-actions {
  display: flex;
  gap: 0.5rem;
}

/* Scope Selector */
.scope-selector {
  border: 1px solid var(--colorBorder);
  border-radius: 6px;
  padding: 0.75rem;
  background: #fafafa;
}

/* Response Type Selector — flat tiles, no container box */
#response-type-selector {
  border: none;
  background: transparent;
  padding: 0;
}
#response-type-selector .scope-tiles {
  margin-bottom: 0;
}

.scope-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  min-height: 32px;
}

.scope-loading {
  font-size: var(--fontSizeXs);
  color: #999;
  font-style: italic;
}

.scope-tile {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: var(--fontSizeXxs);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.scope-tile.available {
  background: #e5e7eb;
  color: #6b7280;
  border-color: #d1d5db;
}

.scope-tile.available:hover {
  background: #d1d5db;
  color: #374151;
}

/* Standard scopes - yellow/amber when unselected */
.scope-tile.available.standard {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.scope-tile.available.standard:hover {
  background: #fde68a;
  color: #78350f;
}

.scope-tile.selected {
  background: var(--colorSuccessLight);
  color: #065f46;
  border-color: #6ee7b7;
}

.scope-tile.selected:hover {
  background: #a7f3d0;
}

/* Warning state - orange for recommended scopes that are deselected */
.scope-tile.warning {
  background: #fed7aa;
  color: #c2410c;
  border-color: #fb923c;
}

.scope-tile.warning:hover {
  background: #fdba74;
  color: #9a3412;
}

.scope-tile.custom {
  background: var(--colorSuccessLight);
  color: #065f46;
  border-color: #6ee7b7;
}

.scope-tile.custom .scope-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #065f46;
  color: var(--colorSuccessLight);
  font-size: var(--fontSizeXxs);
  font-weight: bold;
  line-height: 1;
  margin-left: 0.2rem;
  cursor: pointer;
}

.scope-tile.custom .scope-remove:hover {
  background: #064e3b;
}

.scope-tile.custom.deselected {
  background: #e5e7eb;
  color: #6b7280;
  border-color: #d1d5db;
}
.scope-tile.custom.deselected .scope-remove {
  background: #9ca3af;
  color: #e5e7eb;
}
.scope-tile.custom.deselected:hover {
  background: #d1d5db;
  color: #374151;
}

.scope-custom-input {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.scope-custom-input input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeSm);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.scope-custom-input input:focus {
  outline: none;
  border-color: #10b981;
}

.scope-clear-link {
  font-size: var(--fontSizeXs);
  color: #dc2626;
  text-decoration: none;
  margin-left: 0.5rem;
  cursor: pointer;
}

.scope-clear-link:hover {
  text-decoration: underline;
}

.scope-error {
  font-size: var(--fontSizeXs);
  color: #dc2626;
  margin-top: 0.25rem;
}

/* Well-Known Info Modal */
.well-known-filter {
  margin-left: auto;
  margin-right: 0.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--colorBorderInput);
  border-radius: 4px;
  font-size: var(--fontSizeSm);
  width: 140px;
  font-family: inherit;
}

.well-known-filter:focus {
  outline: none;
  border-color: var(--colorPrimary);
}

.well-known-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: var(--fontSizeSm);
}

.well-known-item {
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.well-known-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.well-known-key {
  font-weight: 600;
  color: #555;
  font-size: var(--fontSizeXs);
  margin-bottom: 0.15rem;
}

.well-known-value {
  word-break: break-word;
}

.well-known-tag {
  display: inline-block;
  background: #f0f4ff;
  color: var(--colorText);
  border: 1px solid #d0d8e8;
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  margin: 0.1rem 0.15rem;
  font-size: var(--fontSizeXs);
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.well-known-tag:hover {
  background: #dce4f5;
  border-color: #a0b0d0;
}

.well-known-tag-copied {
  background: var(--colorSuccessLight);
  border-color: #6ee7b7;
  color: #065f46;
}

/* Parameter Details Modal (movable/resizable) */
.param-modal {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 950px;
  height: 750px;
  min-width: 350px;
  min-height: 200px;
  max-width: 95vw;
  max-height: 90vh;
  background: var(--colorBgCard);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.param-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #1a1a2e;
  color: #fff;
  cursor: move;
  user-select: none;
}

.param-modal-header h3 {
  font-size: var(--fontSizeLg);
  font-weight: 600;
  margin: 0;
}

.param-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: var(--fontSizeXl);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.param-modal-close:hover {
  opacity: 1;
}

.param-modal-body {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  font-size: var(--fontSizeMd);
  min-height: 0;
}

.param-modal-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 30%, #999 30%, #999 35%, transparent 35%),
    linear-gradient(135deg, transparent 45%, #999 45%, #999 50%, transparent 50%),
    linear-gradient(135deg, transparent 60%, #999 60%, #999 65%, transparent 65%);
}

.param-modal-resize:hover {
  background:
    linear-gradient(135deg, transparent 30%, #666 30%, #666 35%, transparent 35%),
    linear-gradient(135deg, transparent 45%, #666 45%, #666 50%, transparent 50%),
    linear-gradient(135deg, transparent 60%, #666 60%, #666 65%, transparent 65%);
}

/* Parameter table inside modal */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.param-table th,
.param-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--colorBorder);
  vertical-align: top;
}

.param-table th {
  background: var(--colorBg);
  font-weight: 600;
  font-size: var(--fontSizeSm);
  color: #555;
}

.param-table td {
  font-size: var(--fontSizeSm);
}

.param-name {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  color: var(--colorPrimary);
  font-weight: 500;
  white-space: nowrap;
}

.param-source {
  color: var(--colorTextMuted);
}

.param-source code {
  background: #f0f0f0;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: var(--fontSizeXs);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.param-section {
  margin-bottom: 1.25rem;
}

.param-section-title {
  font-weight: 600;
  font-size: var(--fontSizeMd);
  color: var(--colorTextHeading);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--colorPrimary);
}

.param-note {
  background: #f0f9ff;
  border: 1px solid var(--colorPrimary);
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: var(--fontSizeSm);
  color: #0369a1;
}

.param-note-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.jwt-structure {
  background: #1e1e2e;
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  line-height: 1.5;
  overflow-x: auto;
}

.jwt-structure .jwt-header {
  color: #f38ba8;
}

.jwt-structure .jwt-payload {
  color: #a6e3a1;
}

.jwt-structure .jwt-signature {
  color: #89b4fa;
}

.jwt-structure .jwt-label {
  color: #6c7086;
  font-style: italic;
}

.jwt-claim {
  display: flex;
  margin: 0.25rem 0;
}

.jwt-claim-key {
  color: #cba6f7;
  min-width: 60px;
}

.jwt-claim-value {
  color: #f9e2af;
}

.jwt-claim-desc {
  color: #6c7086;
  margin-left: 0.5rem;
  font-style: italic;
}

/* Inline step config fields (compact config inside steps) */
.step-config-fields {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.step-config-fields.step-config-inline {
  flex-direction: row;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}
.step-config-row {
  display: flex;
  flex-direction: column;
}
.step-config-row-flex {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.step-config-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 0;
  min-width: 120px;
}
.step-config-field.step-config-wide {
  flex: 2 1 0;
}
.step-config-field.step-config-fullwidth {
  flex: 1 1 100%;
  max-width: 100%;
}
.step-config-field label {
  font-size: var(--fontSizeXs);
  color: var(--colorTextMuted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-config-field input,
.step-config-field select,
.step-config-field textarea {
  padding: 0.25rem 0.4rem;
  font-size: var(--fontSizeSm);
  border: 1px solid var(--colorBorderInput);
  border-radius: 3px;
  background: white;
  width: 100%;
  box-sizing: border-box;
}
.step-config-field input:focus,
.step-config-field select:focus,
.step-config-field textarea:focus {
  border-color: var(--colorPrimary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}
.step-config-field textarea {
  resize: vertical;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  line-height: 1.4;
}
.step-config-field select {
  cursor: pointer;
}

/* Override width:100% for inputs/selects inside inline groups */
.step-config-field .auth-server-inline select {
  width: auto;
  flex-shrink: 0;
}
.step-config-field .auth-server-inline .auth-server-path-input,
.step-config-field .auth-server-inline .redirect-uri-input {
  width: auto;
  flex: 1;
  min-width: 0;
}

/* Compact auth server picker (stacked) */
.auth-server-compact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.auth-server-compact select {
  padding: 0.25rem 0.4rem;
  font-size: var(--fontSizeSm);
  border: 1px solid var(--colorBorderInput);
  border-radius: 3px;
  cursor: pointer;
}

/* Inline auth server picker (dropdown + path side by side) */
.auth-server-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}
.auth-server-inline select {
  width: auto;
  flex-shrink: 0;
  padding: 0.25rem 0.4rem;
  font-size: var(--fontSizeSm);
  border: 1px solid var(--colorBorderInput);
  border-radius: 3px;
  cursor: pointer;
}
.auth-server-path-text {
  font-size: var(--fontSizeSm);
  color: var(--colorTextLight);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  white-space: nowrap;
}
.auth-server-path-custom {
  display: flex;
  align-items: center;
  gap: 0;
}
.auth-server-path-custom[hidden] {
  display: none;
}
.auth-server-path-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.auth-server-path-row[hidden] {
  display: none;
}
.auth-server-path-affix {
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  white-space: nowrap;
}
.auth-server-path-input {
  border: none;
  border-bottom: 1px solid var(--colorBorderInput);
  border-radius: 0;
  padding: 0.15rem 0.25rem;
  font-size: var(--fontSizeSm);
  width: 100%;
  min-width: 60px;
  outline: none;
  background: transparent;
}
.auth-server-path-input:focus {
  border-bottom-color: var(--colorPrimary);
}

/* Secret field with eye toggle */
.secret-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.secret-input-wrap input {
  padding-right: 1.75rem;
}
.secret-toggle {
  position: absolute;
  right: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}
.secret-toggle:hover {
  color: #555;
}
.secret-toggle .eye-icon[hidden] {
  display: none;
}

/* State / Nonce inline pair */
.state-nonce-group {
  display: flex;
  gap: 0.35rem;
}
.state-nonce-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.state-nonce-item label {
  font-size: var(--fontSizeXs);
  color: var(--colorTextMuted);
  font-weight: 500;
}
.state-nonce-item input {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: var(--fontSizeXs);
  color: var(--colorTextLight);
  width: 100%;
  box-sizing: border-box;
}

/* Regenerate button (inline in labels) */
.regen-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--fontSizeSm);
  line-height: 1;
  padding: 0 0.15rem;
  color: var(--colorTextLight);
  vertical-align: middle;
  transition: color 0.15s;
}
.regen-btn:hover {
  color: var(--accent-color, #6c8cff);
}
[data-theme="dark"] .regen-btn {
  color: #666;
}
[data-theme="dark"] .regen-btn:hover {
  color: #a0c4ff;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: rgba(128, 128, 128, 0.1);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fontSizeXl);
  z-index: 1200;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  line-height: 1;
}
.theme-toggle:hover {
  background: rgba(128, 128, 128, 0.2);
  border-color: rgba(128, 128, 128, 0.5);
}

/* Toast Notification Bar */
.toast-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1300;
  background: #4caf50;
  color: #fff;
  text-align: center;
  font-size: var(--fontSizeMd);
  font-weight: 600;
  padding: 0.5rem 1rem;
  transform: translateY(-100%);
  transition: transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.toast-bar.visible {
  transform: translateY(0);
}
.toast-bar.toast-error {
  background: #e53935;
}
.toast-close {
  background: none;
  border: none;
  color: #fff;
  font-size: var(--fontSizeXl);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  opacity: 0.8;
  position: absolute;
  right: 0.75rem;
}
.toast-close:hover {
  opacity: 1;
}

/* ============================================================
   Dark Theme Overrides
   Applied via data-theme="dark" on <html>
   ============================================================ */

[data-theme="dark"] body {
  background: #1a1a2e;
  color: #e0e0e0;
}

/* Header */
[data-theme="dark"] header h1 {
  color: #fff;
}
[data-theme="dark"] .subtitle {
  color: #a0a0a0;
}
[data-theme="dark"] .breadcrumb a {
  color: #a0a0a0;
}
[data-theme="dark"] .breadcrumb a:hover {
  color: #a0c4ff;
}

/* Config Panel */
[data-theme="dark"] .config-panel {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .config-panel summary {
  color: #e0e0e0;
}
[data-theme="dark"] .config-status {
  color: #a0a0a0;
}
[data-theme="dark"] .config-badge-browser {
  background: rgba(194, 65, 12, 0.2);
  color: #fb923c;
  border-color: rgba(194, 65, 12, 0.4);
}
[data-theme="dark"] .config-row label,
[data-theme="dark"] .config-row-half label {
  color: #a0a0a0;
}
[data-theme="dark"] .config-row input,
[data-theme="dark"] .config-row textarea,
[data-theme="dark"] .config-row-half input,
[data-theme="dark"] .config-row-half select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .config-row input:focus,
[data-theme="dark"] .config-row textarea:focus,
[data-theme="dark"] .config-row-half input:focus,
[data-theme="dark"] .config-row-half select:focus {
  border-color: #3b82f6;
}
[data-theme="dark"] .config-section-divider::before,
[data-theme="dark"] .config-section-divider::after {
  border-top-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .config-section-divider span {
  color: #a0a0a0;
}
[data-theme="dark"] .config-fields {
  color: #e0e0e0;
}
[data-theme="dark"] .param-mode-group select,
[data-theme="dark"] .param-mode-group input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}

/* Buttons */
[data-theme="dark"] .btn-icon {
  color: #a0a0a0;
}
[data-theme="dark"] .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #a0c4ff;
}
[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}
[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .btn-link {
  color: #a0a0a0;
}
[data-theme="dark"] .btn-link:hover {
  color: #e0e0e0;
}

/* Stepper */
[data-theme="dark"] .stepper-header {
  color: #a0a0a0;
}
[data-theme="dark"] .step-narration h3 {
  color: #e0e0e0;
}
[data-theme="dark"] .step-narration p {
  color: #a0a0a0;
}
[data-theme="dark"] .step-tabs-bar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .step-tab-btn {
  color: #888;
}
[data-theme="dark"] .step-tab-btn:hover {
  color: #ccc;
}
[data-theme="dark"] .step-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}
[data-theme="dark"] .step-tab-btn .step-tab-num {
  background: rgba(255, 255, 255, 0.1);
  color: #a0a0a0;
}
[data-theme="dark"] .step-tab-btn.active .step-tab-num {
  background: #0284c7;
  color: #fff;
}
[data-theme="dark"] .step-tab-btn .step-tab-badge {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
}

/* Steps */
[data-theme="dark"] .step {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .step.completed {
  background: rgba(76, 175, 80, 0.12);
  border-color: #4caf50;
}
[data-theme="dark"] .step.error {
  background: rgba(244, 67, 54, 0.12);
  border-color: #f44336;
}
[data-theme="dark"] .step-number {
  background: rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
}
[data-theme="dark"] .step.completed .step-number {
  background: #4caf50;
  color: #fff;
}
[data-theme="dark"] .step.error .step-number {
  background: #f44336;
  color: #fff;
}
[data-theme="dark"] .step-info h3 {
  color: #fff;
}
[data-theme="dark"] .step-info p {
  color: #a0a0a0;
}
[data-theme="dark"] .step-log-link {
  color: #666;
  background: #1e293b;
}
[data-theme="dark"] .step-log-link:hover {
  color: #a0a0a0;
}
[data-theme="dark"] .step-optional-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #a0a0a0;
}

/* Step requires badge (e.g. "Requires Client Secret") */
.step-requires-badge {
  display: inline-block;
  font-size: var(--fontSizeXxs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.1rem 0.4rem;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-radius: 3px;
  margin-left: 0.25rem;
  vertical-align: middle;
}
[data-theme="dark"] .step-requires-badge {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* Step options */
[data-theme="dark"] .step-option .uri-template {
  background: rgba(255, 255, 255, 0.08);
  color: #a0a0a0;
}
[data-theme="dark"] .step-option .uri-template select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #a0c4ff;
}
[data-theme="dark"] .step-option .grant-type {
  color: #666;
}
[data-theme="dark"] .step-option .grant-type-badge {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.25);
}
[data-theme="dark"] .step-option .option-label {
  color: #a0a0a0;
}
[data-theme="dark"] .step-option .step-select {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}
[data-theme="dark"] .step-option label {
  color: #a0a0a0;
}
[data-theme="dark"] .step-option .step-input {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}
[data-theme="dark"] .step-option .step-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] .step-input-inline {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}
[data-theme="dark"] .step-input-inline:focus {
  border-color: #3b82f6;
}

/* Inline step config fields */
[data-theme="dark"] .step-config-field label {
  color: #a0a0a0;
}
[data-theme="dark"] .step-config-field input,
[data-theme="dark"] .step-config-field select,
[data-theme="dark"] .step-config-field textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .step-config-field input:focus,
[data-theme="dark"] .step-config-field select:focus,
[data-theme="dark"] .step-config-field textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Config section & cURL section */
[data-theme="dark"] .config-section,
[data-theme="dark"] .curl-section {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1e293b;
}
[data-theme="dark"] .config-section summary,
[data-theme="dark"] .curl-section summary {
  color: #a0a0a0;
}
[data-theme="dark"] .curl-step-label {
  color: #a0a0a0;
}
[data-theme="dark"] .curl-links-separator {
  color: #a0a0a0;
}

/* Auth server picker */
[data-theme="dark"] .auth-server-inline select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .auth-server-path-text {
  color: #666;
}
[data-theme="dark"] .auth-server-path-affix {
  color: #666;
}
[data-theme="dark"] .auth-server-path-input {
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .auth-server-path-input:focus {
  border-bottom-color: #3b82f6;
}
[data-theme="dark"] .auth-server-compact select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}

/* Secret field */
[data-theme="dark"] .secret-toggle {
  color: #666;
}
[data-theme="dark"] .secret-toggle:hover {
  color: #a0a0a0;
}

/* State/Nonce */
[data-theme="dark"] .state-nonce-item label {
  color: #a0a0a0;
}
[data-theme="dark"] .state-nonce-item input {
  color: #666;
}

/* Results */
[data-theme="dark"] .result-box-close {
  color: #666;
}
[data-theme="dark"] .result-box-close:hover {
  color: #e0e0e0;
}
[data-theme="dark"] .result-box {
  background: #252535;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}
[data-theme="dark"] .result-box .claim-key,
[data-theme="dark"] .result-box .json-key {
  color: #89b4fa;
}
[data-theme="dark"] .result-box .claim-value,
[data-theme="dark"] .result-box .json-string {
  color: #a6e3a1;
}
[data-theme="dark"] .result-box .json-number {
  color: #fab387;
}
[data-theme="dark"] .result-box .json-bool {
  color: #f9e2af;
}
[data-theme="dark"] .result-box .json-null {
  color: #6c7086;
}
[data-theme="dark"] .error-box {
  background: rgba(244, 67, 54, 0.12);
  border-color: rgba(252, 165, 165, 0.4);
  color: #fca5a5;
}
[data-theme="dark"] .loading {
  color: #a0a0a0;
}

/* API Test Config */
[data-theme="dark"] .api-test-config {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .api-method-select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .api-method-select:focus {
  border-color: #3b82f6;
}
[data-theme="dark"] .api-url-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .api-url-input:focus {
  border-color: #3b82f6;
}
[data-theme="dark"] .api-test-body label {
  color: #a0a0a0;
}
[data-theme="dark"] .api-test-body textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .api-test-body textarea:focus {
  border-color: #3b82f6;
}
[data-theme="dark"] .api-status.status-success {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}
[data-theme="dark"] .api-status.status-error {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}
[data-theme="dark"] .api-status.status-warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

/* Actor badges */
[data-theme="dark"] .actor-app {
  background: rgba(21, 101, 192, 0.2);
  color: #a0c4ff;
}
[data-theme="dark"] .actor-user {
  background: rgba(123, 31, 162, 0.2);
  color: #ce93d8;
}
[data-theme="dark"] .actor-agent {
  background: rgba(123, 31, 162, 0.2);
  color: #ce93d8;
}
[data-theme="dark"] .actor-device {
  background: rgba(194, 65, 12, 0.15);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.3);
}
[data-theme="dark"] .actor-mcp {
  background: rgba(46, 125, 50, 0.2);
  color: #81c784;
}

/* Use Existing Token */
[data-theme="dark"] .use-existing-link {
  color: #666;
}
[data-theme="dark"] .use-existing-link:hover {
  color: #a0a0a0;
}
[data-theme="dark"] .use-existing-panel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .use-existing-panel label {
  color: #a0a0a0;
}
[data-theme="dark"] .use-existing-panel textarea {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .use-existing-panel textarea:focus {
  border-color: #3b82f6;
}
[data-theme="dark"] .existing-token-note {
  color: #666;
}

/* Token copy buttons */
[data-theme="dark"] .btn-copy-token {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}
[data-theme="dark"] .btn-copy-token:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}
[data-theme="dark"] .btn-copy-token.copied {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
[data-theme="dark"] .token-jwt-link {
  color: #60a5fa;
}
[data-theme="dark"] .btn-copy-token.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #a0c4ff;
}
[data-theme="dark"] .token-copy-label {
  color: #4ade80;
}

/* Token Details */
[data-theme="dark"] .token-details {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .token-details h3 {
  color: #fff;
}
[data-theme="dark"] .token-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .token-tab {
  color: #a0a0a0;
}
[data-theme="dark"] .token-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}
[data-theme="dark"] .token-tab.active {
  background: rgba(59, 130, 246, 0.2);
  color: #a0c4ff;
}
[data-theme="dark"] .token-json {
  background: #252535;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}
[data-theme="dark"] .token-empty {
  color: #666;
}

/* Modals */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .modal {
  background: #1e293b;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .modal-header h3 {
  color: #fff;
}
[data-theme="dark"] .modal-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .modal-dialog .modal-body p {
  color: #e0e0e0;
}

/* Dialog */
[data-theme="dark"] .dialog-field label {
  color: #a0a0a0;
}
[data-theme="dark"] .dialog-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .dialog-select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .dialog-select:focus {
  border-color: #3b82f6;
}
[data-theme="dark"] .label-optional {
  color: #666;
}
[data-theme="dark"] .save-destination-toggle {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .save-existing-list {
  border-top-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .save-existing-list .save-existing-heading {
  color: #666;
}
[data-theme="dark"] .save-config-item {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .save-config-item-name {
  color: #fff;
}
[data-theme="dark"] .save-config-current-badge {
  color: #66bb6a;
}
[data-theme="dark"] .save-config-item-meta {
  color: #666;
}
[data-theme="dark"] .save-config-item-note {
  color: #a0a0a0;
}
[data-theme="dark"] .btn-overwrite {
  background: rgba(230, 81, 0, 0.15);
  color: #ffb74d;
}
[data-theme="dark"] .btn-overwrite:hover {
  background: rgba(230, 81, 0, 0.25);
}

/* Config list in modal */
[data-theme="dark"] .config-list-empty {
  color: #666;
}
[data-theme="dark"] .config-item {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .config-item-name {
  color: #fff;
}
[data-theme="dark"] .config-item-meta {
  color: #666;
}
[data-theme="dark"] .config-item-note {
  color: #a0a0a0;
}
[data-theme="dark"] .btn-load {
  background: rgba(59, 130, 246, 0.2);
  color: #a0c4ff;
}
[data-theme="dark"] .btn-load:hover {
  background: rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .btn-delete {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}
[data-theme="dark"] .btn-delete:hover {
  background: rgba(248, 113, 113, 0.25);
}
[data-theme="dark"] .btn-export {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}
[data-theme="dark"] .btn-export:hover {
  background: rgba(74, 222, 128, 0.25);
}

/* Config cards */
[data-theme="dark"] .config-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .config-card-creator {
  color: #a0a0a0;
}
[data-theme="dark"] .config-card-domain {
  color: #666;
}

/* Scope Selector */
[data-theme="dark"] .scope-selector {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] #response-type-selector {
  border-color: transparent;
  background: transparent;
}
[data-theme="dark"] .scope-loading {
  color: #666;
}
[data-theme="dark"] .scope-tile.available {
  background: rgba(255, 255, 255, 0.1);
  color: #a0a0a0;
  border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .scope-tile.available:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
}
[data-theme="dark"] .scope-tile.available.standard {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}
[data-theme="dark"] .scope-tile.available.standard:hover {
  background: rgba(251, 191, 36, 0.25);
  color: #fde68a;
}
[data-theme="dark"] .scope-tile.selected {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}
[data-theme="dark"] .scope-tile.selected:hover {
  background: rgba(74, 222, 128, 0.3);
}
[data-theme="dark"] .scope-tile.warning {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.35);
}
[data-theme="dark"] .scope-tile.warning:hover {
  background: rgba(251, 146, 60, 0.3);
}
[data-theme="dark"] .scope-tile.custom {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}
[data-theme="dark"] .scope-tile.custom .scope-remove {
  background: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}
[data-theme="dark"] .scope-tile.custom.deselected {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .scope-tile.custom.deselected .scope-remove {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .scope-tile.custom.deselected:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .scope-custom-input input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .scope-custom-input input:focus {
  border-color: #4ade80;
}
[data-theme="dark"] .scope-clear-link {
  color: #f87171;
}
[data-theme="dark"] .scope-error {
  color: #f87171;
}

/* Well-Known Info Modal */
[data-theme="dark"] .well-known-filter {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}
[data-theme="dark"] .well-known-filter:focus {
  border-color: #3b82f6;
}
[data-theme="dark"] .well-known-item {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .well-known-key {
  color: #a0a0a0;
}
[data-theme="dark"] .well-known-tag {
  background: rgba(100, 100, 255, 0.15);
  color: #a0c4ff;
  border-color: rgba(100, 100, 255, 0.25);
}
[data-theme="dark"] .well-known-tag:hover {
  background: rgba(100, 100, 255, 0.25);
  border-color: rgba(100, 100, 255, 0.4);
}
[data-theme="dark"] .well-known-tag-copied {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

/* Param Details Modal */
[data-theme="dark"] .param-modal {
  background: #1e293b;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .param-table th {
  background: rgba(255, 255, 255, 0.05);
  color: #a0a0a0;
}
[data-theme="dark"] .param-table th,
[data-theme="dark"] .param-table td {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .param-table td {
  color: #e0e0e0;
}
[data-theme="dark"] .param-name {
  color: #a0c4ff;
}
[data-theme="dark"] .param-source {
  color: #a0a0a0;
}
[data-theme="dark"] .param-source code {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}
[data-theme="dark"] .param-section-title {
  color: #fff;
  border-bottom-color: #3b82f6;
}
[data-theme="dark"] .param-note {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: #7dd3fc;
}
[data-theme="dark"] .param-modal-resize {
  background:
    linear-gradient(135deg, transparent 30%, #666 30%, #666 35%, transparent 35%),
    linear-gradient(135deg, transparent 45%, #666 45%, #666 50%, transparent 50%),
    linear-gradient(135deg, transparent 60%, #666 60%, #666 65%, transparent 65%);
}

/* Toast bar */
[data-theme="dark"] .toast-bar {
  background: #4caf50;
}
[data-theme="dark"] .toast-bar.toast-error {
  background: #e53935;
}

/* Light theme toast overrides (default is dark-mode green) */
[data-theme="light"] .toast-bar {
  background: #2e7d32;
}
[data-theme="light"] .toast-bar.toast-error {
  background: #c62828;
}

/* Log link */
[data-theme="dark"] .log-link {
  color: #a0c4ff;
}
[data-theme="dark"] .log-link:hover {
  color: #fff;
}

/* ---- Disclaimer banner (inline in breadcrumb) ---- */
.disclaimer-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--fontSizeXs);
}
.disclaimer-banner-text {
  color: #92400e;
  font-weight: 500;
}
.disclaimer-banner-link {
  color: var(--colorPrimary);
  text-decoration: none;
  font-size: var(--fontSizeXxs);
  opacity: 0.7;
}
.disclaimer-banner-link:hover {
  text-decoration: underline;
  opacity: 1;
}

.disclaimer-modal .modal-body p {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}
.disclaimer-modal .modal-body p:last-child {
  margin-bottom: 0;
}
.disclaimer-modal .modal-body strong {
  color: #92400e;
}

/* Dark overrides */
[data-theme="dark"] .disclaimer-banner-text {
  color: #fbbf24;
}
[data-theme="dark"] .disclaimer-banner-link {
  color: #a0c4ff;
}
[data-theme="dark"] .disclaimer-modal .modal-body strong {
  color: #fbbf24;
}

/* ---- Secret Input Controls (Show/Hide + Copy) ---- */
.secret-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.secret-input-wrap input {
  flex: 1;
  padding-right: 2rem;
}

.secret-toggle {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.secret-toggle:hover {
  color: var(--text-primary, #fff);
}

.secret-copy {
  background: transparent;
  border: none;
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  vertical-align: middle;
}

.secret-copy:hover,
.text-copy:hover {
  color: var(--text-primary, #fff);
}

.text-copy {
  background: transparent;
  border: none;
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  vertical-align: middle;
}

.eye-icon {
  display: block;
}

/* ==================== IDX Pipeline Branch Tabs ==================== */

.branch-tabs {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radiusLg, 12px);
}

.branch-narration {
  margin-bottom: 1.5rem;
}

.branch-narration h3 {
  font-size: 1.1rem;
  color: var(--colorTextHeading, #1a1a2e);
  margin-bottom: 0.5rem;
}

.branch-narration p {
  font-size: 0.9rem;
  color: var(--colorTextMuted, #666);
}

.branch-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .branch-tabs-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.branch-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radiusMd, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}

.branch-tab:not([disabled]):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(100, 200, 255, 0.4);
  transform: translateY(-2px);
}

.branch-tab.available {
  border-color: rgba(74, 222, 128, 0.4);
}

.branch-tab.unavailable {
  opacity: 0.4;
  cursor: not-allowed;
}

.branch-tab[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.branch-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.branch-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.branch-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--colorTextHeading, #1a1a2e);
}

.branch-sublabel {
  font-size: 0.75rem;
  color: var(--colorTextMuted, #666);
}

.branch-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.branch-badge.implemented {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.branch-badge.preview {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.branch-info {
  padding: 1rem;
  background: rgba(100, 100, 255, 0.1);
  border: 1px solid rgba(100, 100, 255, 0.2);
  border-radius: var(--radiusMd, 8px);
}

.branch-hint {
  text-align: center;
  color: var(--colorTextMuted, #666);
  font-size: 0.9rem;
  margin: 0;
}

.branch-indicator {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radiusMd, 8px);
  text-align: center;
  font-weight: 600;
  color: var(--colorSuccessDark, #065f46);
  font-size: 0.95rem;
}

.branch-steps {
  margin: 2rem 0;
}

.branch-header {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--colorPrimary, #0284c7);
  border-radius: var(--radiusMd, 8px);
}

.branch-header h3 {
  font-size: 1.15rem;
  color: var(--colorTextHeading, #1a1a2e);
  margin-bottom: 0.5rem;
}

.branch-badge-large {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.branch-badge-large.implemented {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.branch-badge-large.preview {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.branch-note {
  font-size: 0.85rem;
  color: var(--colorTextMuted, #666);
  margin-top: 0.5rem;
}

.preview-step {
  opacity: 0.7;
}

.preview-notice {
  padding: 0.75rem 1rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radiusMd, 8px);
  margin-bottom: 1rem;
}

.preview-notice p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--colorWarningDark, #92400e);
}

/* State-nonce-group for PKCE fields */
.state-nonce-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .state-nonce-group {
    grid-template-columns: 1fr;
  }
}

/* Polling status */
.polling-status {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(100, 100, 255, 0.1);
  border: 1px solid rgba(100, 100, 255, 0.2);
  border-radius: var(--radiusMd, 8px);
}

.poll-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.poll-info span {
  font-size: 0.9rem;
  color: var(--colorTextMuted, #666);
}

.poll-info strong {
  color: var(--colorTextHeading, #1a1a2e);
}

.polling-config {
  margin: 1rem 0;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Log entries for polling */
.log-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.log-entry {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radiusMd, 8px);
}

.log-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--colorTextMuted, #666);
}

.log-time {
  color: var(--colorPrimary, #0284c7);
}

.log-poll {
  font-weight: 600;
}

.log-entry pre {
  margin: 0;
  padding: 0.5rem;
  background: var(--colorBgCode, #1e1e2e);
  border-radius: var(--radiusSm, 4px);
  font-size: 0.75rem;
  overflow-x: auto;
}

/* Info box */
.info-box {
  padding: 1rem;
  background: rgba(100, 100, 255, 0.1);
  border: 1px solid rgba(100, 100, 255, 0.2);
  border-radius: var(--radiusMd, 8px);
  margin-bottom: 1rem;
}

.info-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--colorTextMuted, #666);
}

.info-box strong {
  color: var(--colorTextHeading, #1a1a2e);
}
