/**
 * 亮色为默认；暗色沿用原 DB 区调试台配色。
 * 未设置 data-theme 时跟随 prefers-color-scheme。
 */
:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0d9488;
  --accent-dim: rgba(13, 148, 136, 0.12);
  --accent-hover: #0f766e;
  --danger: #dc2626;
  --code-bg: #0c1222;
  --code-fg: #e2e8f0;
  --code-border: rgba(148, 163, 184, 0.12);
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --sidebar-w: 268px;
  --sidebar-brand-color: var(--text);
  --btn-primary-fg: #ffffff;
  --btn-ghost-hover-bg: #e2e8f0;
  --pill-ok-bg: rgba(13, 148, 136, 0.15);
  --pill-ok-fg: var(--accent-hover);
  --pill-warn-bg: rgba(220, 38, 38, 0.1);
  --pill-warn-fg: var(--danger);
  --badge-ok-bg: #dcfce7;
  --badge-ok-fg: #166534;
  --badge-warn-bg: #fef9c3;
  --badge-warn-fg: #854d0e;
  --badge-err-bg: #fee2e2;
  --badge-err-fg: #991b1b;
  --editor-bg: #ffffff;
  --editor-fg: #24292f;
  --editor-border: #d0d7de;
  --editor-tab-bg: #f6f8fa;
  --editor-gutter: #e8eaed;
  --syntax-key: #0550ae;
  --syntax-str: #0a3069;
  --syntax-num: #055a2f;
  --syntax-kw: #0969da;
  --syntax-punc: #59636e;
  --line-num-fg: #656d76;
  --method-get-fg: #1d4ed8;
  --method-get-bg: rgba(29, 78, 216, 0.14);
  --method-post-fg: #047857;
  --method-post-bg: rgba(4, 120, 87, 0.14);
  --method-mix-fg: #6d28d9;
  --method-mix-bg: rgba(109, 40, 217, 0.14);
  --method-doc-fg: #475569;
  --method-doc-bg: rgba(71, 85, 105, 0.16);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  color-scheme: light;
}

html[data-theme="light"] {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0d9488;
  --accent-dim: rgba(13, 148, 136, 0.12);
  --accent-hover: #0f766e;
  --danger: #dc2626;
  --code-bg: #0c1222;
  --code-fg: #e2e8f0;
  --code-border: rgba(148, 163, 184, 0.12);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --sidebar-brand-color: var(--text);
  --btn-primary-fg: #ffffff;
  --btn-ghost-hover-bg: #e2e8f0;
  --pill-ok-bg: rgba(13, 148, 136, 0.15);
  --pill-ok-fg: var(--accent-hover);
  --pill-warn-bg: rgba(220, 38, 38, 0.1);
  --pill-warn-fg: var(--danger);
  --badge-ok-bg: #dcfce7;
  --badge-ok-fg: #166534;
  --badge-warn-bg: #fef9c3;
  --badge-warn-fg: #854d0e;
  --badge-err-bg: #fee2e2;
  --badge-err-fg: #991b1b;
  --editor-bg: #ffffff;
  --editor-fg: #24292f;
  --editor-border: #d0d7de;
  --editor-tab-bg: #f6f8fa;
  --editor-gutter: #e8eaed;
  --syntax-key: #0550ae;
  --syntax-str: #0a3069;
  --syntax-num: #055a2f;
  --syntax-kw: #0969da;
  --syntax-punc: #59636e;
  --line-num-fg: #656d76;
  --method-get-fg: #1d4ed8;
  --method-get-bg: rgba(29, 78, 216, 0.14);
  --method-post-fg: #047857;
  --method-post-bg: rgba(4, 120, 87, 0.14);
  --method-mix-fg: #6d28d9;
  --method-mix-bg: rgba(109, 40, 217, 0.14);
  --method-doc-fg: #475569;
  --method-doc-bg: rgba(71, 85, 105, 0.16);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #0c1117;
    --surface: #161b22;
    --surface-2: #21262d;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #3fb950;
    --accent-dim: rgba(63, 185, 80, 0.14);
    --accent-hover: #56d364;
    --danger: #f85149;
    --code-bg: #010409;
    --code-fg: #c9d1d9;
    --code-border: #30363d;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --sidebar-brand-color: var(--accent-hover);
    --btn-primary-fg: #041108;
    --btn-ghost-hover-bg: #30363d;
    --pill-ok-bg: rgba(63, 185, 80, 0.18);
    --pill-ok-fg: var(--accent-hover);
    --pill-warn-bg: rgba(248, 81, 73, 0.15);
    --pill-warn-fg: var(--danger);
    --badge-ok-bg: rgba(63, 185, 80, 0.25);
    --badge-ok-fg: #56d364;
    --badge-warn-bg: rgba(240, 136, 62, 0.2);
    --badge-warn-fg: #db6d28;
    --badge-err-bg: rgba(248, 81, 73, 0.2);
    --badge-err-fg: #f85149;
    --editor-bg: #1e1e1e;
    --editor-fg: #d4d4d4;
    --editor-border: #3c3c3c;
    --editor-tab-bg: #252526;
    --editor-gutter: #252526;
    --syntax-key: #9cdcfe;
    --syntax-str: #ce9178;
    --syntax-num: #b5cea8;
    --syntax-kw: #569cd6;
    --syntax-punc: #808080;
    --line-num-fg: #858585;
    --method-get-fg: #79b8ff;
    --method-get-bg: rgba(88, 166, 255, 0.18);
    --method-post-fg: #56d364;
    --method-post-bg: rgba(63, 185, 80, 0.22);
    --method-mix-fg: #d2a8ff;
    --method-mix-bg: rgba(163, 113, 247, 0.22);
    --method-doc-fg: #8b949e;
    --method-doc-bg: rgba(139, 148, 158, 0.2);
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --bg: #0c1117;
  --surface: #161b22;
  --surface-2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3fb950;
  --accent-dim: rgba(63, 185, 80, 0.14);
  --accent-hover: #56d364;
  --danger: #f85149;
  --code-bg: #010409;
  --code-fg: #c9d1d9;
  --code-border: #30363d;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --sidebar-brand-color: var(--accent-hover);
  --btn-primary-fg: #041108;
  --btn-ghost-hover-bg: #30363d;
  --pill-ok-bg: rgba(63, 185, 80, 0.18);
  --pill-ok-fg: var(--accent-hover);
  --pill-warn-bg: rgba(248, 81, 73, 0.15);
  --pill-warn-fg: var(--danger);
  --badge-ok-bg: rgba(63, 185, 80, 0.25);
  --badge-ok-fg: #56d364;
  --badge-warn-bg: rgba(240, 136, 62, 0.2);
  --badge-warn-fg: #db6d28;
  --badge-err-bg: rgba(248, 81, 73, 0.2);
  --badge-err-fg: #f85149;
  --editor-bg: #1e1e1e;
  --editor-fg: #d4d4d4;
  --editor-border: #3c3c3c;
  --editor-tab-bg: #252526;
  --editor-gutter: #252526;
  --syntax-key: #9cdcfe;
  --syntax-str: #ce9178;
  --syntax-num: #b5cea8;
  --syntax-kw: #569cd6;
  --syntax-punc: #808080;
  --line-num-fg: #858585;
  --method-get-fg: #79b8ff;
  --method-get-bg: rgba(88, 166, 255, 0.18);
  --method-post-fg: #56d364;
  --method-post-bg: rgba(63, 185, 80, 0.22);
  --method-mix-fg: #d2a8ff;
  --method-mix-bg: rgba(163, 113, 247, 0.22);
  --method-doc-fg: #8b949e;
  --method-doc-bg: rgba(139, 148, 158, 0.2);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}
.app {
  display: flex;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sidebar-header {
  flex-shrink: 0;
  padding: 1rem 0.75rem 0.75rem;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  -webkit-overflow-scrolling: touch;
}
.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.sidebar-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0;
  color: var(--sidebar-brand-color);
  min-width: 0;
}
.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.theme-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.theme-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
}
.theme-icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.theme-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.theme-icon-btn.is-active {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-color: var(--border);
}
.theme-icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.nav-group {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0.45rem 0.35rem 0.2rem;
}
.nav-group:first-child {
  margin-top: 0;
}
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  line-height: 1.35;
}
.nav-item:hover {
  background: var(--surface-2);
}
.nav-item.is-active {
  background: var(--accent-dim);
  color: var(--accent-hover);
  font-weight: 600;
}
.nav-item .nav-meta {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  margin-top: 0.15rem;
}
.nav-meta-path {
  font-weight: 400;
  color: var(--muted);
  vertical-align: baseline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.nav-meta-vendor {
  display: block;
  font-size: 0.62rem;
  font-weight: 400;
  font-family: "JetBrains Mono", monospace;
  margin-top: 0.1rem;
  color: var(--muted);
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-meta-method {
  display: inline-block;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  line-height: 1.35;
  padding: 0.07rem 0.32rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  vertical-align: baseline;
}
.nav-meta-method--get {
  color: var(--method-get-fg);
  background: var(--method-get-bg);
}
.nav-meta-method--post {
  color: var(--method-post-fg);
  background: var(--method-post-bg);
}
.nav-meta-method--mix {
  color: var(--method-mix-fg);
  background: var(--method-mix-bg);
}
.nav-meta-method--doc {
  color: var(--method-doc-fg);
  background: var(--method-doc-bg);
}
.nav-item.is-active .nav-meta-path {
  color: var(--accent-hover);
  opacity: 0.92;
}
.nav-item.is-active .nav-meta-vendor {
  color: var(--accent-hover);
  opacity: 0.88;
}
.sidebar-foot {
  flex-shrink: 0;
  margin: 0;
  padding: 0.65rem 0.75rem 1.15rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  border-top: 1px solid var(--border);
}
.main-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 1.15rem 1.25rem 2rem;
  overflow: auto;
}
.main-header {
  margin-bottom: 0.65rem;
}
.main-header-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.32rem;
  min-width: 0;
  width: 100%;
}
.main-header-heading h1 {
  text-align: left;
}
@media (min-width: 761px) {
  .main-header-heading {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.45rem 0.65rem;
  }
}
.main-header .route {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.38rem;
  border-radius: 5px;
  display: inline-block;
  margin: 0;
  line-height: 1.35;
  vertical-align: baseline;
  max-width: 100%;
  word-break: break-word;
}
.main-header .route.route--get {
  color: var(--method-get-fg);
  background: var(--method-get-bg);
}
.main-header .route.route--post {
  color: var(--method-post-fg);
  background: var(--method-post-bg);
}
.main-header .route.route--mix {
  color: var(--method-mix-fg);
  background: var(--method-mix-bg);
}
.main-header .route.route--doc {
  color: var(--method-doc-fg);
  background: var(--method-doc-bg);
}
.main-header h1 {
  font-size: clamp(1.02rem, 1.65vw, 1.28rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.22;
  margin: 0;
}
.main-header p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: none;
  width: 100%;
}
.workspace-doc-stack.is-hidden,
.workspace-debug-stack.is-hidden {
  display: none !important;
}
.md-doc-card {
  margin-bottom: 1rem;
  overflow-x: auto;
}
.md-doc {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
}
.md-doc h1,
.md-doc h2,
.md-doc h3,
.md-doc h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.25rem 0 0.5rem;
  line-height: 1.35;
}
.md-doc h1 {
  font-size: 1.35rem;
}
.md-doc h2 {
  font-size: 1.12rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.md-doc h3 {
  font-size: 1rem;
}
.md-doc h1:first-child,
.md-doc h2:first-child {
  margin-top: 0;
}
.md-doc p {
  margin: 0.65rem 0;
}
.md-doc ul,
.md-doc ol {
  margin: 0.5rem 0;
  padding-left: 1.35rem;
}
.md-doc li {
  margin: 0.25rem 0;
}
.md-doc blockquote {
  margin: 0.75rem 0;
  padding: 0.4rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 0 6px 6px 0;
}
.md-doc a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.md-doc code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.84em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.md-doc pre {
  margin: 0.85rem 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--code-border);
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.5;
}
.md-doc pre code {
  padding: 0;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}
.md-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.82rem;
}
.md-doc th,
.md-doc td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  text-align: left;
}
.md-doc th {
  background: var(--surface-2);
  font-weight: 600;
}
.md-doc hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}
.md-doc-loading,
.md-doc-empty,
.md-doc-error {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
}
.md-doc-error {
  color: var(--danger);
}
.panel {
  display: none;
}
.panel.is-active {
  display: block;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 1rem;
}
.card h2 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.lead {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
}
.form-row {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
@media (min-width: 540px) {
  .form-row.two {
    grid-template-columns: 1fr 1fr;
  }
  .form-row.method-path {
    grid-template-columns: 7rem 1fr;
  }
}
.grid-db {
  display: grid;
  gap: 0.65rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
}
label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input,
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
textarea {
  min-height: 4.5rem;
  resize: vertical;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  tab-size: 2;
  -moz-tab-size: 2;
  letter-spacing: 0.01em;
}
textarea.vscode-input {
  background: var(--editor-bg);
  color: var(--editor-fg);
  border: 1px solid var(--editor-border);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.06);
  caret-color: var(--accent);
}
textarea.vscode-input:focus {
  outline-color: var(--accent);
  border-color: var(--editor-border);
  box-shadow:
    inset 0 0 0 1px rgba(127, 127, 127, 0.06),
    0 0 0 1px var(--accent);
}
.vscode-input-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--editor-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--editor-bg);
}
.vscode-input-wrap:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.vscode-input-line-gutter {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: calc(1ch + 0.95rem);
  min-width: 2.75rem;
  padding: 0.65rem 0.45rem 0.65rem 0.5rem;
  border-right: 1px solid var(--editor-border);
  background: var(--editor-tab-bg);
  color: var(--line-num-fg);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre;
  text-align: right;
  overflow: hidden;
  user-select: none;
  tab-size: 2;
  -moz-tab-size: 2;
  letter-spacing: 0.01em;
}
.vscode-input-wrap textarea.vscode-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 4.5rem;
  resize: vertical;
}
.vscode-input-wrap textarea.vscode-input:focus {
  box-shadow: none !important;
  outline: none;
}
.vscode-input-wrap textarea.vscode-input.tall-db {
  min-height: 6rem;
}
.vscode-input-wrap textarea.vscode-input.short-db {
  min-height: 3rem;
}
.vscode-json-editor {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
}
.vscode-json-hl-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 0;
}
pre.vscode-json-hl {
  margin: 0;
  padding: 0.65rem 0.85rem;
  background: transparent;
  color: var(--editor-fg);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  tab-size: 2;
  -moz-tab-size: 2;
  letter-spacing: 0.01em;
  border: none;
  transform: translate(0, 0);
  will-change: transform;
}
pre.vscode-json-hl code {
  font: inherit;
}
pre.vscode-json-hl .tok-key {
  color: var(--syntax-key);
}
pre.vscode-json-hl .tok-str {
  color: var(--syntax-str);
}
pre.vscode-json-hl .tok-num {
  color: var(--syntax-num);
}
pre.vscode-json-hl .tok-kw {
  color: var(--syntax-kw);
}
pre.vscode-json-hl .tok-punc {
  color: var(--syntax-punc);
}
.vscode-json-editor textarea.vscode-input {
  background: transparent !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  caret-color: var(--accent);
  position: relative;
  z-index: 1;
  white-space: pre-wrap;
}
.vscode-json-editor textarea.vscode-input::placeholder {
  color: var(--muted);
  opacity: 0.9;
  -webkit-text-fill-color: var(--muted);
}
.vscode-json-editor textarea.vscode-input::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  align-items: center;
}
button.btn {
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
button.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: var(--btn-primary-fg);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--btn-ghost-hover-bg);
}
.btn-preset {
  font-size: 0.72rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.btn-preset:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.chk-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.chk-row input {
  width: auto;
}
.chk-row label {
  margin: 0;
  text-transform: none;
  font-weight: 500;
}
.param-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}
.param-mode > span.param-mode-title {
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.25rem;
}
.param-mode label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  text-transform: none;
}
.param-mode input {
  width: auto;
  margin: 0;
}
.param-block.is-hidden {
  display: none !important;
}
label .req-mark {
  color: var(--danger);
  font-weight: 600;
}
textarea.tall-db {
  min-height: 6rem;
}
textarea.short-db {
  min-height: 3rem;
}
.kbd-hint {
  font-size: 0.75rem;
  color: var(--muted);
}
.kbd-hint kbd {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.db-creds {
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
  margin-bottom: 1rem;
}
.env-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}
.env-badge--ok {
  background: var(--badge-ok-bg);
  color: var(--badge-ok-fg);
}
.env-badge--warn {
  background: var(--badge-warn-bg);
  color: var(--badge-warn-fg);
}
.env-badge--err {
  background: var(--badge-err-bg);
  color: var(--badge-err-fg);
}
.result-card h2 {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}
.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.result-head span {
  font-size: 0.78rem;
  color: var(--muted);
}
.pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
}
.pill.ok {
  background: var(--pill-ok-bg);
  color: var(--pill-ok-fg);
}
.pill.warn {
  background: var(--pill-warn-bg);
  color: var(--pill-warn-fg);
}
.vscode-out-shell {
  border-radius: 8px;
  border: 1px solid var(--editor-border);
  background: var(--editor-tab-bg);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.vscode-out-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--editor-fg);
  background: var(--editor-tab-bg);
  border-bottom: 1px solid var(--editor-border);
  letter-spacing: 0.02em;
}
.vscode-out-tab::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  opacity: 0.9;
}
.vscode-code-scroll {
  overflow: auto;
  max-height: min(52vh, 26rem);
  background: var(--editor-bg);
}
.vscode-code-row {
  display: flex;
  align-items: stretch;
  min-width: min-content;
}
.vscode-line-gutter {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: calc(1ch + 0.95rem);
  min-width: 2.75rem;
  padding: 0.65rem 0.45rem 0.65rem 0.5rem;
  border-right: 1px solid var(--editor-border);
  background: var(--editor-tab-bg);
  color: var(--line-num-fg);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre;
  text-align: right;
  overflow: hidden;
  user-select: none;
  tab-size: 2;
  -moz-tab-size: 2;
  letter-spacing: 0.01em;
}
pre.out {
  margin: 0;
  flex: 1 1 auto;
  min-width: 12rem;
  padding: 0.65rem 0.85rem;
  background: var(--editor-bg);
  color: var(--editor-fg);
  border-radius: 0;
  overflow: visible;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  border: none;
  tab-size: 2;
  -moz-tab-size: 2;
  letter-spacing: 0.01em;
}
pre.out .tok-key {
  color: var(--syntax-key);
}
pre.out .tok-str {
  color: var(--syntax-str);
}
pre.out .tok-num {
  color: var(--syntax-num);
}
pre.out .tok-kw {
  color: var(--syntax-kw);
}
pre.out .tok-punc {
  color: var(--syntax-punc);
}
.main-header-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.22rem;
}
@media (max-width: 480px) {
  .main-header .route {
    font-size: 0.68rem;
    padding: 0.08rem 0.32rem;
  }
  .main-header h1 {
    font-size: 1.02rem;
    line-height: 1.24;
  }
  .main-header p {
    font-size: 0.8rem;
    line-height: 1.42;
  }
}
.nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  margin: -0.1rem 0 0 -0.2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-menu-btn:hover {
  background: var(--btn-ghost-hover-bg);
}
.nav-menu-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-menu-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}
.sidebar-backdrop {
  display: none;
}
@media (max-width: 760px) {
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(15, 23, 42, 0.42);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  html[data-theme="dark"] .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.55);
  }
  .app.is-nav-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .app {
    display: block;
    height: 100%;
    min-height: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(20.5rem, calc(100vw - 2.25rem));
    max-width: var(--sidebar-w);
    z-index: 150;
    flex-shrink: 0;
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border);
    border-bottom: none;
    box-shadow: none;
    max-height: none;
  }
  .app.is-nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.14);
  }
  html[data-theme="dark"] .app.is-nav-open .sidebar {
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  }

  .sidebar-header {
    padding: 1rem 0.75rem 0.65rem;
    padding-top: max(0.85rem, env(safe-area-inset-top));
  }
  .sidebar-brand-row {
    width: 100%;
  }
  .sidebar-scroll {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: 0 0.75rem 0.5rem;
  }
  .nav-group {
    width: auto;
    margin: 0.45rem 0.35rem 0.2rem;
  }
  .nav-group:first-child {
    margin-top: 0;
  }
  .nav-item {
    flex: none;
    min-width: 0;
    width: 100%;
  }
  .sidebar-foot {
    width: 100%;
    padding: 0.65rem 0.75rem max(1rem, env(safe-area-inset-bottom));
  }

  .nav-menu-btn {
    display: inline-flex;
  }
  .main-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
  }
  .main-header-text {
    flex: 1;
    min-width: 0;
  }

  .main-col {
    width: 100%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.9rem
      max(1.25rem, env(safe-area-inset-bottom));
    padding-left: max(0.9rem, env(safe-area-inset-left));
    padding-right: max(0.9rem, env(safe-area-inset-right));
  }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
  .sidebar-backdrop {
    transition: none;
  }
}
