/* ======= Fonts =======
   IBM Plex, served from /fonts so the app looks the same offline and on every machine.
   Sans for the interface, Mono for anything that is sent over the wire. */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url('../fonts/ibm-plex-sans-var.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 100 700; font-display: swap;
  src: url('../fonts/ibm-plex-sans-var-italic.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/ibm-plex-mono-600.woff2') format('woff2'); }

/* ======= Design tokens =======
   One semantic set, defined twice: light here, dark below. Dark applies when the OS
   asks for it and nobody chose light, or when someone chose dark with the header
   toggle (js/core/theme.js sets data-theme on <html>). Everything else in the app,
   including convert.css and n8n.css, reads only these names. */
:root {
  color-scheme: light;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --canvas: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef3;
  --border: #e0e3e9;
  --border-strong: #c9ced8;
  --fg: #161a22;
  --fg-muted: #535a69;
  --fg-faint: #828998;

  --accent: #3347d1;
  --accent-solid: #3347d1;
  --accent-solid-hover: #2738b4;
  --accent-soft: #eceffd;
  --accent-ring: rgba(51, 71, 209, .2);
  --on-accent: #ffffff;

  --ok: #1a7446;
  --ok-soft: #e5f3eb;
  --ok-dot: #22a15f;
  --warn: #875600;
  --warn-soft: #fcf2dd;
  --warn-dot: #e09a18;
  --danger: #bd2d22;
  --danger-soft: #fbeae8;
  --danger-solid: #c4372c;
  --danger-solid-hover: #a62a20;

  --code-bg: #eef0f4;
  --term-bg: #161a22;
  --term-fg: #e8eaee;
  --term-muted: #828998;
  --hit: #ffe98a;
  --toast: #1e232c;

  --m-get: #0f64b8;    --m-get-bg: #e6f0fb;
  --m-post: #16804c;   --m-post-bg: #e3f3ea;
  --m-put: #995400;    --m-put-bg: #fcefd9;
  --m-patch: #7040c0;  --m-patch-bg: #f0e9fc;
  --m-delete: #bd2d22; --m-delete-bg: #fbe8e6;

  --json-key: #0f5fb3;
  --json-string: #a3361f;
  --json-number: #0c7a55;
  --json-boolean: #b0247a;
  --json-null: #7040c0;

  --shadow-sm: 0 1px 2px rgba(18, 22, 33, .06);
  --shadow-md: 0 1px 2px rgba(18, 22, 33, .05), 0 6px 16px rgba(18, 22, 33, .07);
  --shadow-lg: 0 2px 6px rgba(18, 22, 33, .08), 0 24px 56px rgba(18, 22, 33, .18);
  --scrim: rgba(14, 17, 24, .5);

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --app-top-h: 104px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0d0f13;
    --surface: #15181e;
    --surface-2: #1b1f26;
    --surface-3: #232830;
    --border: #2a2f38;
    --border-strong: #3b414c;
    --fg: #e8eaee;
    --fg-muted: #a5abb7;
    --fg-faint: #767d8a;
    --accent: #95a2ff;
    --accent-solid: #5063ec;
    --accent-solid-hover: #6273f5;
    --accent-soft: #1d2346;
    --accent-ring: rgba(149, 162, 255, .3);
    --on-accent: #ffffff;
    --ok: #6fd6a1;        --ok-soft: #11281c;     --ok-dot: #3cc27c;
    --warn: #eabd66;      --warn-soft: #2b2211;   --warn-dot: #e5a93a;
    --danger: #ff8d83;    --danger-soft: #341a1a; --danger-solid: #d2463b; --danger-solid-hover: #e0584d;
    --code-bg: #1f232b;
    --term-bg: #0d0f13;
    --term-fg: #e8eaee;
    --term-muted: #767d8a;
    --hit: #5c4b0d;
    --toast: #2b313c;
    --m-get: #74bdf2;    --m-get-bg: #122a3e;
    --m-post: #66d6a0;   --m-post-bg: #10291d;
    --m-put: #f1b65f;    --m-put-bg: #2f2311;
    --m-patch: #c6a2ff;  --m-patch-bg: #261b3e;
    --m-delete: #ff8d83; --m-delete-bg: #371b1b;
    --json-key: #8cbcff;
    --json-string: #f2a88f;
    --json-number: #8ddab3;
    --json-boolean: #f39ad0;
    --json-null: #c6a2ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 24px 60px rgba(0, 0, 0, .55);
    --scrim: rgba(0, 0, 0, .6);
  }
}
/* The same dark values, for an explicit choice. Kept in step with the block above. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0d0f13;
  --surface: #15181e;
  --surface-2: #1b1f26;
  --surface-3: #232830;
  --border: #2a2f38;
  --border-strong: #3b414c;
  --fg: #e8eaee;
  --fg-muted: #a5abb7;
  --fg-faint: #767d8a;
  --accent: #95a2ff;
  --accent-solid: #5063ec;
  --accent-solid-hover: #6273f5;
  --accent-soft: #1d2346;
  --accent-ring: rgba(149, 162, 255, .3);
  --on-accent: #ffffff;
  --ok: #6fd6a1;        --ok-soft: #11281c;     --ok-dot: #3cc27c;
  --warn: #eabd66;      --warn-soft: #2b2211;   --warn-dot: #e5a93a;
  --danger: #ff8d83;    --danger-soft: #341a1a; --danger-solid: #d2463b; --danger-solid-hover: #e0584d;
  --code-bg: #1f232b;
  --term-bg: #0d0f13;
  --term-fg: #e8eaee;
  --term-muted: #767d8a;
  --hit: #5c4b0d;
  --toast: #2b313c;
  --m-get: #74bdf2;    --m-get-bg: #122a3e;
  --m-post: #66d6a0;   --m-post-bg: #10291d;
  --m-put: #f1b65f;    --m-put-bg: #2f2311;
  --m-patch: #c6a2ff;  --m-patch-bg: #261b3e;
  --m-delete: #ff8d83; --m-delete-bg: #371b1b;
  --json-key: #8cbcff;
  --json-string: #f2a88f;
  --json-number: #8ddab3;
  --json-boolean: #f39ad0;
  --json-null: #c6a2ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 24px 60px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 0, 0, .6);
}

/* Legacy names. Older rules (and convert.css) were written against literal colours;
   these aliases point each one at the semantic token it meant, so they follow the
   theme without being rewritten one by one. */
:root {
  --n-bg-ffffff: var(--surface);
  --n-fg-333333: var(--fg);
  --n-fg-666666: var(--fg-muted);
  --n-bg-dddddd: var(--border-strong);
  --n-bg-f0f0f0: var(--surface-3);
  --n-bg-e0e0e0: var(--border);
  --n-fg-999999: var(--fg-faint);
  --n-bg-ffeeee: var(--danger-soft);
  --n-fg-cc3333: var(--danger);
  --n-bg-eeffee: var(--ok-soft);
  --n-fg-33cc33: var(--ok);
  --n-bg-f3f3f3: var(--surface-2);
  --n-fg-1a1a2e: var(--fg);
  --n-bg-f5f5f5: var(--surface-2);
  --n-bg-efefef: var(--surface-3);
  --n-bg-e3f2fd: var(--m-get-bg);
  --n-fg-1976d2: var(--m-get);
  --n-bg-f3e5f5: var(--m-patch-bg);
  --n-fg-7b1fa2: var(--m-patch);
  --n-bg-fff3e0: var(--warn-soft);
  --n-fg-f57c00: var(--warn);
  --n-bg-ffebee: var(--danger-soft);
  --n-fg-c62828: var(--danger);
  --n-bg-eeeeee: var(--border);
  --n-fg-4a4a58: var(--fg-muted);
  --n-bg-dcdce6: var(--border);
  --n-bg-f5f5fa: var(--surface-2);
  --n-fg-2f2f3a: var(--fg);
  --n-bg-ececf4: var(--surface-3);
  --n-fg-8a8a99: var(--fg-faint);
  --n-bg-f2f2f7: var(--surface-2);
  --n-fg-55555f: var(--fg-muted);
  --n-fg-c0392b: var(--danger);
  --n-bg-f0c8c2: var(--danger-soft);
  --n-bg-fdf1ef: var(--danger-soft);
  --n-fg-a33224: var(--danger);
  --n-bg-e8f7ee: var(--ok-soft);
  --n-fg-227a45: var(--ok);
  --n-bg-fdecea: var(--danger-soft);
  --n-bg-f0b3ab: var(--danger-soft);
  --n-fg-b3392b: var(--danger);
  --n-fg-85858f: var(--fg-faint);
  --n-bg-d0d0d8: var(--border-strong);
  --n-bg-f0f0f6: var(--surface-3);
  --n-fg-7a7a88: var(--fg-faint);
  --n-fg-4a5bd0: var(--accent);
  --n-bg-e8f5e9: var(--ok-soft);
  --n-fg-2e7d32: var(--ok);
  --n-bg-f8f9fa: var(--surface-2);
  --n-bg-e9ecef: var(--border);
  --n-fg-0066cc: var(--json-key);
  --n-fg-a31515: var(--json-string);
  --n-fg-098658: var(--json-number);
  --n-fg-d73a49: var(--json-boolean);
  --n-fg-6f42c1: var(--json-null);
  --n-fg-555555: var(--fg-muted);
  --n-bg-eef0ff: var(--accent-soft);
  --n-fg-764ba2: var(--accent);
  --n-bg-f9f9f9: var(--surface-2);
  --n-bg-f0f0ff: var(--accent-soft);
  --n-bg-fff5f5: var(--danger-soft);
  --n-fg-888888: var(--fg-faint);
  --n-bg-fafafa: var(--surface-2);
  --n-bg-f4f4f7: var(--surface-2);
  --n-fg-2ecc71: var(--ok-dot);
  --n-bg-fff8ec: var(--warn-soft);
  --n-fg-8a6d3b: var(--warn);
  --n-fg-444444: var(--fg);
  --n-bg-f0f0f4: var(--surface-3);
  --n-bg-c9c9d6: var(--border-strong);
  --n-fg-6a6a7a: var(--fg-muted);
  --n-bg-f0d9ae: var(--warn-soft);
  --n-bg-f7f7fb: var(--surface-2);
  --n-bg-ececf2: var(--border);
  --n-bg-fafafc: var(--surface-2);
  --n-fg-777777: var(--fg-faint);
  --n-bg-eef0fb: var(--accent-soft);
}

/* ======= Base ======= */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--app-top-h) + 16px); }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--canvas);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; color: inherit; }
code, pre, kbd, samp { font-family: var(--font-mono); }
code { font-size: .92em; }
a { color: var(--accent); }
::selection { background: var(--accent-ring); }

/* Native form controls: one look for every <select> and text field, so a picker in a
   modal matches the one on the page. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23828998' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px;
  cursor: pointer;
}
select::-ms-expand { display: none; }
input::placeholder, textarea::placeholder { color: var(--fg-faint); opacity: 1; }
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--accent-solid); }

/* Scrollbars that belong to the theme rather than the OS. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.container { min-height: 100vh; }

/* ======= Brand mark ======= */

.brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--accent-solid);
  color: var(--on-accent);
}
.brand-mark svg { width: 18px; height: 18px; display: block; }
.brand-mark.is-large { width: 40px; height: 40px; border-radius: 10px; }
.brand-mark.is-large svg { width: 24px; height: 24px; }

/* ======= Theme toggle ======= */

.theme-toggle {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--fg-muted);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--fg); border-color: var(--border-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
/* Shows where a click takes you: the moon in light mode, the sun in dark. */
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ======= Sign-in and sub-account screens ======= */

.login-screen {
  display: flex;
  justify-content: center;
  /* Top-aligned, not centred. Centring a card taller than the viewport pushes half
     the overflow ABOVE the top edge, and on a fixed overlay that part is
     unreachable — the sub-account form is 1090px tall, so on a 800px laptop the
     heading and the Save button were simply gone with no way to scroll to them. */
  align-items: flex-start;
  overflow-y: auto;
  padding: 48px 20px;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 22px 22px,
    var(--canvas);
  z-index: 1000;
}

/* Short cards still sit optically centred rather than pinned to the top. */
.login-screen > .login-card { margin: auto; }
.login-screen.hidden { display: none; }

.login-card {
  position: relative;
  background: var(--surface);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
}

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding-right: 44px; }
.login-brand h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; color: var(--fg); line-height: 1.2; }
.login-brand-sub { font-size: 13px; color: var(--fg-faint); }
.login-card .theme-toggle { position: absolute; top: 20px; right: 20px; }

.login-card p { color: var(--fg-muted); margin-bottom: 22px; font-size: 14px; }

.login-footnote {
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.6; color: var(--fg-faint);
}
.login-card .login-footnote p { margin: 0 0 4px; font-size: 12.5px; color: var(--fg-faint); }
.login-footnote strong { display: block; margin-bottom: 6px; color: var(--fg-muted); font-weight: 600; }
.login-footnote-actions { margin-top: 14px; }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--fg);
  font-weight: 500;
  font-size: 13px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--fg);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input[type="password"] { font-family: var(--font-mono); letter-spacing: .04em; }

.form-group input:hover, .form-group textarea:hover, .form-group select:hover { border-color: var(--fg-faint); }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-group textarea {
  height: auto;
  padding: 10px 12px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-mono);
}

/* ======= Buttons =======
   .btn is the full-width primary used in forms; .btn-mini is the compact button
   used everywhere else. Solid colour, no gradients, no hover lift. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 18px;
  background: var(--accent-solid);
  color: var(--on-accent);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { background: var(--accent-solid-hover); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-solid); }

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border-strong);
  box-shadow: none;
  margin-top: 10px;
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--fg-faint); }
.btn-secondary:disabled,
.btn-secondary:disabled:hover { background: var(--surface-2); color: var(--fg-faint); border-color: var(--border); cursor: not-allowed; }

/* ======= Messages ======= */

.error-message,
.success-message {
  padding: 10px 12px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  display: none;
}
.error-message { background: var(--danger-soft); color: var(--danger); }
.success-message { background: var(--ok-soft); color: var(--ok); }
.error-message.show, .success-message.show { display: block; }

.loading { display: none; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px;
  color: var(--fg-muted); font-size: 13.5px; }
.loading.show { display: flex; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

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

/* ======= App shell =======
   A sticky two-row bar (brand and status, then tabs and tools), the endpoint list
   docked on the left and the workspace filling the rest. The page itself scrolls,
   because popovers are positioned against window scroll. */

.app-top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  min-height: 56px;
}

.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-size: 15px; font-weight: 650; color: var(--fg); line-height: 1.2; letter-spacing: -.01em; }
.brand-subtitle { font-size: 12px; color: var(--fg-faint); line-height: 1.3; }

.header-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

.main-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - var(--app-top-h));
}

.sidebar {
  position: sticky;
  top: var(--app-top-h);
  height: calc(100vh - var(--app-top-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0 10px 20px;
}


.sidebar-section { margin-bottom: 14px; }

.sidebar-title {
  position: sticky;
  top: 60px;
  z-index: 1;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .01em;
  color: var(--fg-faint);
  padding: 8px 10px 6px;
  background: var(--surface);
}

.endpoint-list { list-style: none; }
.endpoint-item { margin-bottom: 1px; }

.endpoint-link {
  display: flex;
  align-items: center;
  gap: 10px;
  /* A <button> shrink-to-fits even at display:block, so without this the row
     collapses to the width of its own text. Invisible in the sidebar, but below the
     1024px breakpoint the sidebar goes full width and every endpoint became a stub
     floating in an empty row. */
  width: 100%;
  min-height: 34px;
  text-align: left;
  border: none;
  font: inherit;
  padding: 6px 10px;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--fg-muted);
  font-size: 13.5px;
  line-height: 1.35;
  cursor: pointer;
  position: relative;
  transition: background .12s, color .12s;
}
.endpoint-link:hover { background: var(--surface-2); color: var(--fg); }
.endpoint-link.active { background: var(--accent-soft); color: var(--fg); font-weight: 550; }
.endpoint-link.active::before {
  content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.endpoint-link-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Methods are the one place colour carries meaning, so each has its own and they
   use the colours people already know from other API tools. */
.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--fg-muted);
}
.endpoint-link .method-badge { width: 54px; padding-left: 0; padding-right: 0; }

.method-get { background: var(--m-get-bg); color: var(--m-get); }
.method-post { background: var(--m-post-bg); color: var(--m-post); }
.method-put { background: var(--m-put-bg); color: var(--m-put); }
.method-patch { background: var(--m-patch-bg); color: var(--m-patch); }
.method-delete { background: var(--m-delete-bg); color: var(--m-delete); }

.content {
  min-width: 0;
  padding: 28px 36px 64px;
}
.content > * { max-width: 1180px; }

/* ======= Endpoint detail ======= */

.endpoint-detail { display: none; }
.endpoint-detail.active { display: block; }

.endpoint-detail h2 {
  color: var(--fg);
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.25;
}

.endpoint-meta {
  display: flex;
  gap: 8px 20px;
  margin-bottom: 18px;
  font-size: 13px;
}

.meta-item { font-size: 13px; color: var(--fg-faint); display: inline-flex; align-items: center; gap: 6px; }
.meta-item strong { color: var(--fg-muted); font-weight: 500; font-family: var(--font-mono); font-size: 12.5px; }
.meta-item code { color: var(--fg-muted); }

/* The request line: the one loud element on the page. It is what will actually be
   sent, so it reads like a command line. */
.api-url {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
  word-break: break-all;
}

.section { margin-bottom: 28px; }

.section-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--fg);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* On an endpoint each group of fields is one panel, the same panel the request and
   the response use, so the page reads top to bottom as: what it is, what you fill
   in, what is sent, what came back. */
.endpoint-detail .section {
  margin-bottom: 16px;
  padding: 18px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.endpoint-detail .section-title { margin: 0 -22px 18px; padding: 0 22px 14px; }
.endpoint-detail .section-hint { margin-top: -8px; }
.endpoint-detail .extra-block { background: var(--surface-2); }

.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px 20px;
}

.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px -36px 0;
  padding: 12px 36px;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Sized to be the obvious primary action without stretching edge to edge on a
   wide screen; the secondary cluster is pushed to the far side by the margin. */
.btn-execute {
  flex: 0 0 auto;
  width: auto;
  min-width: 170px;
  height: 40px;
  padding: 0 22px;
  white-space: nowrap;
}

.action-bar-aside {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Deliberately NOT `.btn`: that class sets width: 100%, which is what made the
   copy button expand to fill the row. These size to their own content. */
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 550;
  font-family: inherit;
  line-height: 1;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, color .12s;
}
.btn-mini:hover { background: var(--surface-2); border-color: var(--fg-faint); color: var(--fg); }
.btn-mini:active { background: var(--surface-3); }

.btn-mini-icon { display: inline-flex; align-items: center; opacity: .7; }

.btn-mini-ghost { border-color: transparent; color: var(--fg-muted); background: transparent; box-shadow: none; }
.btn-mini-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--fg); }

.btn-mini-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); }
.btn-mini-primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); color: var(--on-accent); }

.btn-mini-danger { color: var(--danger); border-color: var(--border-strong); }
.btn-mini-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn-mini.is-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn-mini.is-error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.n8n-binding {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--fg-faint);
}
.n8n-binding:empty { display: none; }
.n8n-binding strong { color: var(--fg-muted); font-weight: 600; }

.n8n-binding-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.n8n-binding-dot.bound { background: var(--ok-dot); }

.n8n-binding-type {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  font-weight: 550;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px;
}
.link-button:hover { text-decoration-color: currentColor; }

/* ======= Response ======= */

.response-container {
  margin-top: 16px;
  padding: 20px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.response-container h3 { color: var(--fg); margin-bottom: 14px; font-size: 15px; font-weight: 650; }

.response-meta { display: flex; gap: 20px; margin-bottom: 14px; font-size: 13px; color: var(--fg-muted); }

.status-code { font-weight: 600; padding: 3px 8px; border-radius: 4px; font-family: var(--font-mono); }
.status-code.success { background: var(--ok-soft); color: var(--ok); }
.status-code.error { background: var(--danger-soft); color: var(--danger); }

.response-body {
  background: var(--surface-2);
  color: var(--fg);
  padding: 16px 18px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  line-height: 1.65;
  border: 1px solid var(--border);
}

.response-toolbar { display: flex; gap: 8px; margin-bottom: 12px; justify-content: flex-end; }

.response-toolbar button {
  height: 30px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.response-toolbar button:hover { background: var(--surface-2); border-color: var(--fg-faint); }
.response-toolbar button.copied { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

/* Example response (dummy data from the catalogue) */
.sample-response {
  margin-top: 16px;
  padding: 16px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.sample-response > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  cursor: pointer; font-size: 15px; font-weight: 650; color: var(--fg);
}
.sample-response[open] > summary { margin-bottom: 12px; }
.sample-tag {
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--accent-soft); color: var(--fg-muted);
}
.sample-tag-warn { background: var(--warn-soft); color: var(--warn); }
.sample-status { font-family: var(--font-mono); font-size: 12.5px; color: var(--ok); font-weight: 600; }
.sample-copy { margin-left: auto; }
.sample-note { margin: 0 0 12px; font-size: 13px; color: var(--fg-muted); }
.sample-empty { margin: 0; font-size: 13px; color: var(--fg-muted); }
.sample-json {
  margin: 0; max-height: 480px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre; color: var(--fg);
}

/* JSON tree */
.json-tree { margin: 0; padding: 0; list-style: none; }
.json-item { margin: 0; padding: 0; }
.json-key { color: var(--json-key); font-weight: 500; }
.json-string { color: var(--json-string); }
.json-number { color: var(--json-number); }
.json-boolean { color: var(--json-boolean); font-weight: 600; }
.json-null { color: var(--json-null); font-style: italic; }

.json-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  color: var(--fg-faint);
  font-size: 11px;
  vertical-align: top;
  width: 20px;
  text-align: center;
  transition: transform .15s, color .15s;
}
.json-toggle:hover { color: var(--accent); }
.json-toggle.collapsed { transform: rotate(-90deg); }

.json-content { display: block; margin-left: 9px; border-left: 1px solid var(--border); padding-left: 14px; }
.json-content.hidden { display: none; }
.json-bracket { color: var(--fg-faint); }
.json-item-row { display: flex; padding: 1px 4px; border-radius: 4px; }
.json-row-content { flex: 1; }

/* ======= Empty states ======= */

/* Laid out as a plain block: the pages toggle it with an inline display:block.
   No frame: an empty workspace is not a thing to look at, it says what to do next. */
.placeholder {
  color: var(--fg-muted);
  text-align: center;
  padding: clamp(48px, 14vh, 136px) 24px 64px;
  font-size: 14px;
  line-height: 1.6;
}
.placeholder-title { margin-bottom: 4px; font-size: 20px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; color: var(--fg); }
.placeholder-keys {
  list-style: none;
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--fg-faint);
}
.placeholder-keys kbd { margin-right: 3px; }
.placeholder::before {
  content: '';
  display: block;
  width: 44px; height: 44px; margin: 0 auto 18px;
  border-radius: var(--r-lg);
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237283f5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* ======= Inputs in forms ======= */

.form-group select { height: 40px; cursor: pointer; }

/* Param type: multicheck chips + text input */
.multicheck-group { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 2px; }

.multicheck-chip {
  height: 28px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
  color: var(--fg-muted);
  line-height: 1;
}
.multicheck-chip:hover { border-color: var(--accent); color: var(--accent); }
.multicheck-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ======= Sub-account picker ======= */

.saved-accounts-section { margin-bottom: 0; }
.saved-accounts-section h3 { font-size: 13px; color: var(--fg); margin-bottom: 10px; font-weight: 600; }

.account-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.account-card:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-sm); }

.account-card-info { flex: 1; min-width: 0; }
.account-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card-key { font-size: 12px; color: var(--fg-faint); margin-top: 2px; }

.account-card-delete {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--fg-faint);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.account-card-delete:hover { color: var(--danger); background: var(--danger-soft); }

.form-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.form-toggle-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  padding: 0;
  display: inline-block;
}
.form-toggle-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }
.checkbox-row label { margin: 0; font-weight: normal; cursor: pointer; font-size: 14px; }

/* ======= Account switcher ======= */

.account-switcher { position: relative; }

.account-switcher-btn {
  height: 34px;
  padding: 0 10px 0 6px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: 240px;
  transition: background .12s, border-color .12s;
}
.account-switcher-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.account-switcher-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.account-avatar {
  width: 22px; height: 22px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
}
#accountSwitcherLabel { overflow: hidden; text-overflow: ellipsis; }
.account-switcher-caret { width: 12px; height: 12px; color: var(--fg-faint); flex-shrink: 0; }

.account-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  z-index: 200;
  overflow: hidden;
  padding: 6px;
  display: none;
}
.account-dropdown.open { display: block; }

.account-dropdown-header { padding: 8px 10px 6px; font-size: 12px; color: var(--fg-faint); font-weight: 600; }

.account-dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .12s;
  gap: 8px;
}
.account-dropdown-item:hover { background: var(--surface-2); }
.account-dropdown-item.active { background: var(--accent-soft); }

.account-dropdown-item-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-dropdown-item-badge {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  flex-shrink: 0;
}

.account-dropdown-empty { padding: 8px 10px; font-size: 12.5px; color: var(--fg-faint); }
.account-dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 6px -6px; }

.account-dropdown-action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--fg);
  transition: background .12s;
}
.account-dropdown-action:hover { background: var(--surface-2); }
.account-dropdown-action.danger { color: var(--danger); }
.account-dropdown-action.danger:hover { background: var(--danger-soft); }

/* ======= Page nav ======= */

.page-nav {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-top: 1px solid var(--border);
}

.page-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 14px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 550;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color .12s;
}
.page-tab:hover { color: var(--fg); }
.page-tab.active { color: var(--fg); }
.page-tab.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--accent);
}
/* js/core/tabs-indicator.js replaces the per-tab underline with one that slides. */
.page-tabs { position: relative; }
.page-tabs.has-indicator .page-tab.active::after { content: none; }
.page-tab-indicator { position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  border-radius: 2px 2px 0 0; background: var(--accent); pointer-events: none; }

/* ======= Sidebar filter ======= */

.sidebar-filter {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -10px 4px;
  padding: 12px 12px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sidebar-filter input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23828998' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 11px center / 15px no-repeat;
  color: var(--fg);
  transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.sidebar-filter input:focus { outline: none; border-color: var(--accent); background-color: var(--surface); box-shadow: 0 0 0 3px var(--accent-ring); }
.sidebar-section.filtered-out, .endpoint-item.filtered-out { display: none; }

/* ======= Status chips in the header ======= */

.provider-chips { display: flex; gap: 6px; }
.provider-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--fg-muted);
  white-space: nowrap;
}
.provider-chip:empty { display: none; }
.provider-chip .chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.provider-chip.connected .chip-dot { background: var(--ok-dot); box-shadow: 0 0 0 3px var(--ok-soft); }
.provider-chip.saved .chip-dot { background: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-soft); }
.provider-chip.error .chip-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.provider-chip button {
  border: none; background: none; cursor: pointer; color: var(--accent);
  font-size: 12.5px; font-weight: 550; padding: 0 2px; font-family: inherit;
}
.provider-chip button:hover { text-decoration: underline; text-underline-offset: 2px; }

.connect-card {
  max-width: 520px;
  margin: 48px auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.connect-card h3 { margin-bottom: 8px; font-size: 17px; font-weight: 650; }
.connect-card p { color: var(--fg-muted); font-size: 13.5px; margin-bottom: 18px; }

.main-layout.gated { grid-template-columns: minmax(0, 1fr); }
.main-layout.gated .sidebar,
.main-layout.gated .placeholder,
.main-layout.gated [id$="-endpointDetails"] { display: none; }

.documented-dot { margin-left: auto; color: var(--ok-dot); font-size: 9px; }

.inferred-note {
  padding: 10px 12px;
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  border-radius: var(--r-md);
}

/* ======= Add sub-account form ======= */

.provider-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 14px 14px 2px; margin-bottom: 14px; background: var(--surface-2); }
.provider-fieldset-title { font-size: 13px; font-weight: 650; color: var(--fg); margin-bottom: 12px; }
.provider-fieldset-title span { font-weight: 400; color: var(--fg-faint); font-size: 12px; margin-left: 6px; }

.account-card-badges { display: flex; gap: 4px; align-items: center; }
.account-badge {
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 5px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.account-badge.add { background: transparent; color: var(--fg-faint); cursor: pointer; border: 1px dashed var(--border-strong); }
.account-badge.add:hover { color: var(--accent); border-color: var(--accent); }
/* A stored credential that will not decrypt — distinct from "not configured", because
   the fix is different: the server's ENCRYPTION_KEY changed and it must be re-entered. */
.account-badge.warn { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }

/* ======= Body editor ======= */

.body-section .section-title { display: flex; align-items: center; justify-content: space-between; }

/* Segmented control, used for the body mode and the response view. */
.mode-toggle {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r-md);
  background: var(--surface-3);
}
.mode-btn {
  height: 26px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s;
}
.mode-btn:hover { color: var(--fg); }
.mode-btn.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }

.raw-json { width: 100%; font-family: var(--font-mono); font-size: 12.5px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 12px; line-height: 1.55; }
.raw-json-toolbar { margin-top: 8px; }
.body-error { display: none; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--danger-soft); color: var(--danger); font-size: 12.5px; }
.body-error.show { display: block; }
.body-empty { color: var(--fg-faint); font-size: 13px; }
.free-query { margin-top: 20px; }
.query-row { display: flex; gap: 8px; margin-bottom: 8px; }
.query-row input { flex: 1; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font-family: inherit; background: var(--surface); color: var(--fg); }
.query-row button { width: 36px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
  color: var(--fg-muted); cursor: pointer; }
.query-row button:hover { color: var(--danger); border-color: var(--danger); }

/* ===== Workspace / n8n settings ===== */

.modal-backdrop { display: none; position: fixed; inset: 0; z-index: 100;
  background: var(--scrim); padding: 6vh 20px 40px; overflow-y: auto; }
.modal-backdrop.open { display: block; }
.modal-card { max-width: 640px; margin: 0 auto; background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; font-weight: 650; color: var(--fg); }
.modal-close { width: 32px; height: 32px; border: none; border-radius: var(--r-md); background: none; font-size: 22px;
  line-height: 1; color: var(--fg-faint); cursor: pointer; font-family: inherit; }
.modal-close:hover { color: var(--fg); background: var(--surface-3); }
.modal-body { padding: 4px 20px 22px; }

/* ===== Sign-in ===== */

.signin-card { max-width: 400px; }
.signin-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.6; color: var(--fg-faint); }
.signin-note code { padding: 1px 5px; border-radius: 4px; background: var(--code-bg);
  font-size: 11.5px; color: var(--fg-muted); }
#signinButton:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ===== One-time import banner ===== */

.import-banner { padding: 14px; margin-bottom: 20px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.import-banner-text { font-size: 13px; line-height: 1.6; color: var(--warn); margin-bottom: 12px; }
.import-banner-actions { display: flex; gap: 8px; }
/* Once the import has run the banner reports the outcome instead of asking. */
.import-banner.done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.import-banner.done .import-banner-text { color: var(--ok); }

.account-card-warn { color: var(--danger); font-weight: 600; }

/* Workspace header on the login card — states the container the sub-accounts sit in. */
.ws-login-header { padding: 12px 14px; margin-bottom: 18px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; }
.ws-login-label { display: block; font-size: 12px; font-weight: 500; color: var(--fg-faint); margin-bottom: 2px; }
.ws-login-name { width: 100%; padding: 3px 6px; margin-left: -6px; font-size: 16px; font-weight: 650;
  font-family: inherit; color: var(--fg); background: transparent; border: 1px solid transparent;
  border-radius: var(--r-sm); }
.ws-login-name:hover { border-color: var(--border-strong); background: var(--surface); }
.ws-login-name:focus { outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-ring); }
.ws-login-n8n { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px;
  font-size: 12px; line-height: 1.5; color: var(--fg-faint); }
.ws-login-n8n strong { color: var(--fg-muted); font-weight: 600; }

.ws-section { padding: 18px 0; border-bottom: 1px solid var(--border); }
.ws-section:last-child { border-bottom: none; }
.ws-section h4 { font-size: 14px; font-weight: 650; color: var(--fg); margin-bottom: 12px; }
.ws-muted { font-size: 13px; color: var(--fg-muted); line-height: 1.6; margin-bottom: 12px; }

.ws-status { font-size: 13px; padding: 9px 12px; border-radius: var(--r-md); margin-bottom: 12px;
  background: var(--surface-2); color: var(--fg-muted); }
.ws-status.ok { background: var(--ok-soft); color: var(--ok); }
.ws-status.bad { background: var(--danger-soft); color: var(--danger); }

.ws-note { font-size: 12.5px; line-height: 1.6; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); background: var(--warn-soft); color: var(--warn); border-radius: var(--r-md); }
.ws-note.bad { border-color: color-mix(in srgb, var(--danger) 25%, transparent); background: var(--danger-soft); color: var(--danger); }

.ws-subs { margin-top: 16px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.ws-subs-title { font-size: 13px; font-weight: 650; color: var(--fg); margin-bottom: 10px; }
.ws-sub-list { list-style: none; margin-bottom: 10px; }
.ws-sub-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0;
  font-size: 13px; color: var(--fg); border-bottom: 1px solid var(--border); }
.ws-sub-list li:last-child { border-bottom: none; }
.ws-sub-name { font-weight: 600; }
.ws-sub-tags { display: flex; gap: 4px; }
.ws-tag { padding: 1px 8px; border-radius: 10px; background: var(--surface-3); color: var(--fg-muted); font-size: 11.5px; }
.ws-tag.active { background: var(--accent-soft); color: var(--accent); margin-left: auto; font-weight: 600; }
.ws-empty { color: var(--fg-faint); font-style: italic; }

.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.modal-body select,
.modal-body input[type="text"],
.modal-body input[type="url"],
.modal-body input[type="password"] {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--r-md); font-size: 14px; font-family: inherit; background: var(--surface); color: var(--fg); }
.modal-body select:focus, .modal-body input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring); }

/* ======= Make → n8n converter =======
   Uses the same sidebar + content layout as the API pages: the scenario list is the
   sidebar's job, exactly as the endpoint list is on the other two pages. */

.convert-heading { font-size: 17px; font-weight: 650; color: var(--fg); margin: 0 0 4px; letter-spacing: -.01em; }
.convert-heading + .response-body, .convert-report + .convert-heading { margin-top: 24px; }

.convert-hint { margin: 0 0 12px; font-size: 13px; color: var(--fg-muted); line-height: 1.5; }
.convert-hint-small { font-size: 12.5px; margin-bottom: 10px; color: var(--fg-faint); }
.convert-warning { margin: 0 0 12px; font-size: 13px; color: var(--danger); }
.convert-alert { color: var(--danger); font-weight: 600; }

/* Stacked in the sidebar, so the fields go full width and the button follows. */
.convert-connect { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.convert-field { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--fg); transition: border-color .12s, box-shadow .12s; }
.convert-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.convert-connect .btn { width: 100%; margin: 0; height: 36px; }

.convert-connected { display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--fg); margin-bottom: 6px; }
.convert-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12.5px; }

.convert-search { margin-bottom: 10px; }

/* Capped so a long list scrolls inside the sidebar rather than stretching the page. */
.convert-scenarios { display: grid; gap: 4px; max-height: 52vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }

.convert-scenario { display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer; font-family: inherit;
  transition: border-color .12s, background .12s; }
.convert-scenario:hover { border-color: var(--accent); background: var(--accent-soft); }
.convert-scenario:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.convert-scenario-name { font-size: 13px; font-weight: 600; color: var(--fg); line-height: 1.3; }
.convert-scenario-meta { font-size: 11.5px; color: var(--fg-faint); }

.convert-result-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 14px; }
.convert-result-head > div { flex: 1 1 auto; min-width: 0; }
/* .btn is width:100% app-wide (it suits the login forms). Here it sits beside a
   heading, so it has to size to its label or it pushes past the card edge. */
.convert-result-head .btn { margin: 0; width: auto; flex: 0 0 auto; height: 36px; padding: 0 16px; font-size: 13.5px; }
.convert-source { margin: 0; font-size: 12.5px; color: var(--fg-faint); }

/* Monospace so the symbol, id and module name line up down the left edge and the
   report can be scanned rather than read. */
.convert-report { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--fg); }

/* Secondary by design: pasting is the fallback once Make is connected. */
.convert-paste { margin-top: 24px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 0; overflow: hidden; }
.convert-paste summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--fg);
  padding: 14px 16px; list-style-position: inside; }
.convert-paste summary:hover { background: var(--surface-2); }
.convert-paste summary { display: flex; align-items: center; gap: 10px; list-style: none; }
.convert-paste summary::-webkit-details-marker { display: none; }
.convert-paste summary::before { content: ''; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid var(--fg-faint);
  border-bottom: 1.5px solid var(--fg-faint); transform: rotate(-45deg); transition: transform .15s; }
.convert-paste[open] summary::before { transform: rotate(45deg); }
.convert-paste[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 0; }
.convert-paste > :not(summary) { margin: 14px 16px; }
.convert-paste > .btn { width: auto; height: 36px; }
.convert-input { width: calc(100% - 32px); padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; resize: vertical;
  background: var(--surface-2); color: var(--fg); display: block; }
.convert-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }

.convert-status { margin: 14px 0 0; font-size: 13px; color: var(--accent); min-height: 18px; }

.convert-folder { margin-bottom: 8px; cursor: pointer; }

/* The row IS the convert action, so it has to look like one. */
.convert-scenario { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.convert-scenario-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Overlaid rather than laid out, so the name gets the full row width. */
.convert-scenario { position: relative; }
.convert-scenario-go { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  padding: 3px 8px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm);
  font-size: 11.5px; font-weight: 600; color: var(--accent); opacity: 0; transition: opacity .15s; }
.convert-scenario:hover .convert-scenario-go,
.convert-scenario:focus-visible .convert-scenario-go { opacity: 1; }
.convert-scenario.is-busy { border-color: var(--accent); background: var(--accent-soft); }
.convert-scenario.is-busy .convert-scenario-go { opacity: 1; content: none; }

/* Credential mapping, chosen per conversion. */
.convert-credentials:not(:empty) { margin-top: 24px; }
.convert-cred-table { width: 100%; border-collapse: collapse; }
.convert-cred-table td { padding: 10px 0; border-top: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.convert-cred-table td:first-child { width: 45%; padding-right: 20px; }
.convert-cred-type { font-size: 11.5px; color: var(--fg-faint); }
.convert-cred-none { display: block; margin-top: 6px; font-size: 11.5px; color: var(--danger); }

.convert-result-actions { display: flex; gap: 8px; flex-shrink: 0; }
.convert-result-actions .btn { margin: 0; width: auto; height: 36px; padding: 0 16px; font-size: 13.5px; }

#convert-result { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* ======= Setup progress =======
   Three connections in three places; without this the path is invisible. */
.setup-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
/* Inside the app it is a strip under the nav, not a card: one line of status, the
   three steps side by side, and a button on the step that is next. */
#setup-app:not(:empty) { background: var(--surface); border-bottom: 1px solid var(--border); }
#setup-app .setup-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px;
  margin: 0; padding: 12px 20px; border: 0; border-radius: 0; box-shadow: none; background: none; }
#setup-app .setup-head { flex: 0 0 auto; flex-direction: column; align-items: flex-start; gap: 0; margin: 0; }
#setup-app .setup-steps { flex: 1 1 560px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; }
#setup-app .setup-step { align-items: center; }
#setup-app .setup-step-mark { margin-top: 0; }
#setup-app .setup-step-blurb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#setup-app .setup-step.is-next .setup-step-blurb { display: none; }
.setup-step.is-next .setup-step-mark { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.setup-step-go { flex-shrink: 0; margin-left: 6px; }
.login-card .setup-card { box-shadow: none; padding: 14px; margin-bottom: 20px; }

.setup-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 12px; }
.setup-head strong { font-size: 14px; font-weight: 650; color: var(--fg); }
.setup-count { font-size: 12.5px; color: var(--fg-faint); white-space: nowrap; }

.setup-steps { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.setup-step { display: flex; align-items: flex-start; gap: 10px; }

.setup-step-mark { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--surface); color: var(--fg-muted);
  border: 1px solid var(--border-strong); margin-top: 1px; }
.setup-step.is-done .setup-step-mark { background: var(--ok-dot); border-color: var(--ok-dot); color: #fff; }

.setup-step-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.setup-step-title { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.setup-step.is-done .setup-step-title { color: var(--fg-faint); font-weight: 500; text-decoration: line-through;
  text-decoration-color: var(--border-strong); }
.setup-step-blurb { font-size: 12.5px; color: var(--fg-muted); }
.setup-step.is-done .setup-step-blurb { color: var(--fg-faint); }

/* ≤ 1024px: the list stacks above the workspace instead of beside it. */
@media (max-width: 1024px) {
  .main-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-title { position: static; }
  .header { flex-wrap: wrap; }
  .header-right { flex-wrap: wrap; }
  .content { padding: 22px 20px 48px; }
  #setup-app .setup-steps { flex-basis: 100%; }
  .placeholder::before { transform: rotate(90deg); }
}

/* ======= API centre: typed forms, response panel, export menu ======= */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.section-hint { margin: -6px 0 14px; font-size: 12px; color: var(--fg-faint); line-height: 1.5; }
.no-params { color: var(--fg-muted); font-size: 13px; margin-bottom: 10px; }
.endpoint-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.endpoint-title-row h2 { margin-bottom: 0; }
.danger-tag { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--danger-soft); color: var(--danger); }
.endpoint-meta { flex-wrap: wrap; align-items: center; }
.endpoint-meta code { font-size: 12.5px; }
.docs-link { color: var(--accent); font-weight: 550; text-decoration: none; }
.docs-link:hover { text-decoration: underline; }
.api-url-label { flex-shrink: 0; font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: var(--fg-faint); }
.endpoint-description { color: var(--fg-muted); font-size: 14.5px; line-height: 1.65; margin-bottom: 28px; max-width: 76ch; }
.endpoint-description p + p { margin-top: 8px; }
.endpoint-description code, .param-help code, .param-meta code { padding: 1px 5px; border-radius: 4px;
  background: var(--code-bg); font-size: 12px; font-family: var(--font-mono); }
.info-card { padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--fg);
  font-size: 14px; line-height: 1.6; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* Fields */
.field { min-width: 0; margin: 0; }
.field-wide { grid-column: 1 / -1; }
.field-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.field-label { font-weight: 500; font-size: 13px; color: var(--fg); font-family: var(--font-mono); }
.req-badge { font-size: 11.5px; font-weight: 600; color: var(--danger); }
.type-pill { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--surface-3); color: var(--fg-muted); font-family: var(--font-mono); }
.type-pill.pill-warn { background: var(--warn-soft); color: var(--warn); }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .chip-entry {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--r-md); font-size: 14px;
  font-family: inherit; background: var(--surface); color: var(--fg); transition: border-color .12s, box-shadow .12s; }
.field input:not([type="checkbox"]):not([type="radio"]):hover, .field select:hover, .field textarea:hover { border-color: var(--fg-faint); }
.field textarea { resize: vertical; min-height: 70px; }
.field textarea.mono, .field input.mono, .raw-json { font-family: var(--font-mono); font-size: 12.5px; }
.field input:focus, .field select:focus, .field textarea:focus, .chip-entry:focus,
.extra-row input:focus, .resp-filter:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.param-help { margin-top: 5px; font-size: 12px; line-height: 1.5; color: var(--fg-muted); }
.param-help p + p { margin-top: 4px; }
.param-meta { margin-top: 4px; font-size: 11.5px; color: var(--fg-faint); }
.field-error:empty { display: none; }
.field-error { margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--danger); }
.field.has-error > .field-control input, .field.has-error > .field-control select,
.field.has-error > .field-control textarea, .field.has-error > .field-control .multicheck-group,
.field.has-error > .field-control .raw-json { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field.has-error > .field-control .multicheck-group { border: 1px solid var(--danger); border-radius: 6px; padding: 6px; }
fieldset.field-object { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; background: var(--surface-2); }
fieldset.field-object .params-grid { gap: 12px; }
.field-children { margin-top: 4px; }
.date-control { display: flex; gap: 6px; align-items: center; }
.date-control input { flex: 1; }
.array-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.array-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.array-row-body { flex: 1; min-width: 0; }
.array-index { flex-shrink: 0; width: 22px; padding-top: 9px; font-size: 11px; font-weight: 700; color: var(--fg-faint); text-align: center; }
.row-remove { flex-shrink: 0; width: 38px; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--fg-muted); cursor: pointer; font-size: 16px; line-height: 1; }
.row-remove:hover { color: var(--danger); border-color: var(--danger); }
.multicheck-chip.chip-free, .multicheck-chip.chip-custom { border-style: dashed; }
.chip-entry-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.chip-entry-row .chip-entry { flex: 1 1 200px; width: auto; padding: 7px 9px; font-size: 13px; }
.chip-tools { font-size: 12px; color: var(--fg-faint); display: inline-flex; gap: 8px; }
.custom-fields-status { font-size: 12px; color: var(--fg-muted); }
.search-builder, .sort-builder { display: grid; gap: 8px; }
.sb-rows, .sort-rows { display: grid; gap: 6px; }
.sb-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr) 34px; gap: 6px; }
.sort-row { display: grid; grid-template-columns: minmax(0, 1fr) 210px 34px; gap: 6px; }
.field-pick { display: grid; gap: 4px; min-width: 0; }
.field-pick [hidden] { display: none; }
.sb-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sb-cond { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-muted); }
.sb-cond select { width: auto !important; padding: 6px 8px !important; font-size: 13px !important; }
.sb-raw-label { font-size: 12px; color: var(--fg-faint); margin-top: 4px; }
.sb-note:empty { display: none; }
.sb-note { font-size: 12px; color: var(--warn); }
.sort-preview { font-size: 12px; color: var(--fg-faint); margin-left: 10px; }
.extra-block { margin-top: 20px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.extra-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.extra-title { font-weight: 600; font-size: 13px; color: var(--fg); }
.extra-block .section-hint { margin: 0 0 8px; }
.extra-rows { display: grid; gap: 6px; }
.extra-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 34px; gap: 6px; }
.extra-row input { height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); font-family: inherit;
  background: var(--surface); color: var(--fg); min-width: 0; }
.body-section [hidden] { display: none !important; }
.raw-json { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.raw-json-toolbar { display: flex; gap: 10px; align-items: center; }
.raw-json-toolbar .section-hint { margin: 0; }
.form-errors { margin-top: 20px; padding: 12px 14px; border-radius: 8px; background: var(--danger-soft);
  color: var(--danger); font-size: 13px; }
.form-errors ul { margin: 6px 0 0 18px; }
.form-errors .link-button { color: var(--danger); font-family: var(--font-mono); }

/* Action bar */
.btn:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: none; }
.btn-danger { background: var(--danger-solid); }
.btn-danger:hover { background: var(--danger-solid-hover); }
.account-note { font-size: 13px; color: var(--fg-faint); }
.account-note strong { color: var(--fg-muted); }
.btn-mini-danger-solid { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.btn-mini-danger-solid:hover { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); color: #fff; }
.export-menu { position: relative; }
.export-list { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  display: grid; gap: 2px; }
.export-item { text-align: left; padding: 8px 10px; border: none; border-radius: 5px; background: none;
  font: inherit; font-size: 13px; color: var(--fg); cursor: pointer; white-space: nowrap; }
.export-item:hover, .export-item:focus-visible { background: var(--accent-soft); outline: none; }

/* Response panel */
.response-container.is-loading .response-body, .response-container.is-loading .response-meta { opacity: .45; }
.response-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.response-head h3 { margin: 0; }
.status-badge { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; font-family: var(--font-mono); }
.tone-ok.status-badge { background: var(--ok-soft); color: var(--ok); }
.tone-error.status-badge { background: var(--danger-soft); color: var(--danger); }
.tone-warn.status-badge { background: var(--warn-soft); color: var(--warn); }
.tone-pending.status-badge { background: var(--surface-3); color: var(--fg-muted); }
.status-explain { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-md); font-size: 13px; line-height: 1.5;
  background: var(--surface-2); color: var(--fg-muted); }
.status-explain.tone-error { background: var(--danger-soft); color: var(--danger); }
.status-explain.tone-warn { background: var(--warn-soft); color: var(--warn); }
.status-explain.tone-ok { background: var(--ok-soft); color: var(--ok); }
.status-actions { display: inline-flex; gap: 6px; }
.field-error-list { margin: 0 0 12px 18px; font-size: 13px; color: var(--danger); }
.response-meta { flex-wrap: wrap; gap: 8px 18px; }
.meta-fact { font-size: 12.5px; color: var(--fg-muted); }
.meta-label { color: var(--fg-faint); margin-right: 3px; }
.meta-fact.is-warn { color: var(--danger); font-weight: 600; }
.response-headers { margin-bottom: 12px; font-size: 12.5px; }
.response-headers summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.headers-table { margin-top: 8px; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.headers-table th { text-align: left; padding: 3px 14px 3px 0; color: var(--fg-muted); font-weight: 600; vertical-align: top; }
.headers-table td { padding: 3px 0; color: var(--fg); word-break: break-all; }
.response-toolbar { flex-wrap: wrap; align-items: center; justify-content: flex-start; }
.view-tabs { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-md); background: var(--surface-3); }
.response-toolbar .view-tab { height: 26px; background: transparent; border: none; color: var(--fg-muted); border-radius: 6px; box-shadow: none; }
.response-toolbar .view-tab:hover { background: transparent; color: var(--fg); }
.response-toolbar .view-tab.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.resp-filter { flex: 1 1 180px; min-width: 140px; height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--fg); }
.filter-count { font-size: 12px; color: var(--fg-faint); }
.toolbar-group { display: inline-flex; gap: 6px; align-items: center; }
.response-container[data-view="table"] .only-tree,
.response-container[data-view="raw"] .only-tree,
.response-container[data-view="tree"] .only-table,
.response-container[data-view="raw"] .only-table { display: none; }
.col-picker { position: relative; font-size: 12px; }
.col-picker summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); font-size: 12.5px; font-weight: 550; }
.col-picker summary:hover { background: var(--surface-2); }
.col-picker summary::-webkit-details-marker { display: none; }
.col-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; max-height: 300px; overflow: auto; min-width: 220px;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); display: grid; gap: 3px; }
.col-tools { display: flex; gap: 10px; margin-bottom: 4px; }
.col-option { display: flex; gap: 6px; align-items: center; color: var(--fg); white-space: nowrap; cursor: pointer; }
.response-body { max-height: 70vh; overflow: auto; background: var(--surface-2); color: var(--fg); border-color: var(--border); }
.table-wrap { overflow: auto; max-height: 64vh; }
.resp-table { border-collapse: collapse; font-size: 12.5px; font-family: var(--font-mono); }
.resp-table th, .resp-table td { padding: 6px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resp-table thead th { position: sticky; top: 0; background: var(--surface-3); color: var(--fg-muted); font-family: var(--font-sans); font-weight: 600; z-index: 1; }
.resp-table td { cursor: copy; }
.resp-table tbody tr:hover td { background: var(--accent-soft); }
.resp-table .row-num { color: var(--fg-faint); text-align: right; cursor: default; }
.table-note { margin-top: 8px; font-size: 12px; color: var(--fg-faint); }
.raw-response { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: 12.5px; }
.json-count { margin-left: 6px; font-size: 11px; color: var(--fg-faint); }
.json-index { color: var(--fg-faint); margin-right: 8px; cursor: copy; }
.json-key { cursor: copy; }
.json-value { cursor: copy; border-radius: 3px; }
.json-value:hover, .json-key:hover, .json-index:hover { text-decoration: underline dotted; }
.json-hit { background: var(--hit); border-radius: 3px; }
.json-item-row.json-filtered { display: none; }
.json-more { padding: 6px 0; font-size: 12px; color: var(--fg-faint); font-style: italic; }
.json-item-row:hover { background: var(--surface-3); }

/* Confirm dialog + toast */
.confirm-backdrop { position: fixed; inset: 0; z-index: 2000; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.confirm-card { width: 100%; max-width: 440px; padding: 22px 24px; border-radius: 14px; background: var(--surface);
  color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.confirm-card.is-danger { border-top: 3px solid var(--danger-solid); }
.confirm-card h3 { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.confirm-card p { font-size: 14px; color: var(--fg-muted); line-height: 1.5; }
.confirm-details { margin: 14px 0 4px; display: grid; gap: 6px; }
.confirm-detail { display: flex; gap: 10px; font-size: 13px; }
.confirm-detail span { width: 70px; color: var(--fg-faint); flex-shrink: 0; }
.confirm-detail code { word-break: break-all; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 2100; max-width: min(560px, 90vw);
  padding: 11px 16px; border-radius: 10px; background: var(--toast); color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.toast-error { background: #a3281f; }
.toast.toast-ok { background: #17663e; }
.toast.toast-warn { background: #7a4f00; }

/* Sidebar */
.sidebar-empty { padding: 10px 12px; font-size: 13px; color: var(--fg-faint); }
.destructive-dot { margin-left: auto; width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 10px; font-weight: 700; color: var(--danger); background: var(--danger-soft); }

@media (max-width: 600px) {
  .content { padding: 18px 16px 40px; }
  .params-grid { grid-template-columns: 1fr; }
  .sb-row { grid-template-columns: 1fr 34px; }
  .sb-row [data-role="sb-op"], .sb-row [data-role="sb-value"] { grid-column: 1 / 2; }
  .sort-row { grid-template-columns: 1fr 34px; }
  .sort-row [data-role="sort-dir"] { grid-column: 1 / 2; }
  .action-bar-aside { margin-left: 0; }
  .export-list { right: auto; left: 0; }
}

/* ======= API centre features: pager, lookups, variables, chaining, library, bulk ======= */

/* Focus is always visible for keyboard users (WCAG 2.4.7); mouse clicks stay quiet. */
:where(button, a, input, select, textarea, summary, [tabindex], [role="button"]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface-2); color: var(--fg); font: 12px var(--font-mono); }

/* Page nav: tabs on the left, the API-centre tools on the right. */
.page-nav { align-items: center; flex-wrap: wrap; }
.page-tabs { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.page-tab { white-space: nowrap; }
.nav-tools { display: flex; gap: 2px; margin-left: auto; padding: 6px 0; }
.nav-tool { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; color: var(--fg-muted); font-weight: 550; font-size: 13px; font-family: inherit; cursor: pointer;
  transition: background .12s, color .12s; }
.nav-tool:hover { color: var(--fg); background: var(--surface-3); }
.nav-tool svg { width: 15px; height: 15px; opacity: .8; }
.nav-tool-icon { width: 32px; padding: 0; justify-content: center; border-color: var(--border); margin-left: 6px; }
.shortcut-hint { font-size: 12px; color: var(--fg-faint); }
.shortcut-hint kbd { font-size: 11px; }
.action-bar-aside { flex-wrap: wrap; }

/* Sidebar search: match count and the narrow-screen drawer toggle. */
.sidebar-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sidebar-filter input { flex: 1 1 160px; }
.sidebar-count { font-size: 12px; color: var(--fg-faint); min-width: 0; }
.sidebar-count:empty { display: none; }
.sidebar-toggle { display: none; }

/* Pager under list responses. */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 4px; padding: 8px 12px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--fg); }
.pager-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.pager-note { font-size: 12px; color: var(--fg-faint); }
.pager-progress { display: flex; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.pager-progress progress { flex: 1 1 160px; height: 8px; accent-color: var(--accent); }
.pager-progress-text { font-size: 12px; color: var(--fg-muted); }
.btn-mini[disabled], .nav-tool[disabled] { opacity: .5; cursor: not-allowed; }
.fa-plan p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--fg-muted); }
.fa-caps { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 13px; color: var(--fg); }
.fa-caps input { width: 90px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); }

/* After a create: the returned id and where to take it. */
.created-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; padding: 10px 12px;
  border-radius: 8px; background: var(--ok-soft); color: var(--fg); font-size: 13px; border-left: 3px solid var(--ok); }
.created-banner.is-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.created-banner select { max-width: 100%; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); }
.created-open { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }

/* Variables: the {{ }} button, the picker and "{{" autocomplete. */
.var-btn { margin-left: auto; padding: 1px 6px; border: 1px solid transparent; border-radius: 5px; background: transparent;
  color: var(--fg-faint); font: 600 11px var(--font-mono); cursor: pointer; opacity: .55; }
.field:hover .var-btn, .field:focus-within .var-btn, .var-btn:focus-visible { opacity: 1; }
.var-btn:hover { color: var(--accent); border-color: var(--border); }
.var-suggest { position: absolute; z-index: 2200; margin: 0; padding: 4px; list-style: none; max-height: 240px; overflow: auto;
  background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
.var-suggest li { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.var-suggest li span { color: var(--fg-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-suggest li.is-active, .var-suggest li:hover { background: var(--accent-soft); }
.var-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.var-table th, .var-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.var-table input { width: 100%; min-width: 120px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); }
.var-scope { color: var(--fg-muted); white-space: nowrap; }
.var-actions { white-space: nowrap; }
.var-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.var-add label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fg-muted); }
.var-add input, .var-add select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); font-family: inherit; }

/* Lookups: the Pick… button beside an id field. */
.lookup-control { display: flex; gap: 6px; align-items: stretch; }
.lookup-control > input, .lookup-control > select { flex: 1 1 auto; min-width: 0; }
.lookup-btn { flex-shrink: 0; }
.lookup-chosen { font-size: 12px; color: var(--ok); margin-top: 4px; }
.lookup-chosen:empty { display: none; }

/* Popovers (pickers and the value menu). */
.popover { position: absolute; z-index: 2150; width: min(380px, calc(100vw - 16px)); padding: 10px; border-radius: 10px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.pop-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.pop-status { flex: 1; font-size: 12px; color: var(--fg-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-search { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--fg); font-family: inherit; }
.pop-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.pop-option { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pop-option.is-active, .pop-option:hover { background: var(--accent-soft); }
.opt-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.opt-value { font-size: 11.5px; color: var(--fg-muted); background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.opt-hint { width: 100%; font-size: 11.5px; color: var(--fg-faint); }
.pop-empty { padding: 8px; font-size: 12.5px; color: var(--fg-faint); }
.pop-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; }
.popover-menu { width: min(420px, calc(100vw - 16px)); padding: 6px; }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 12px; }
.menu-head code { color: var(--fg-muted); overflow-wrap: anywhere; }
.menu-value { font-weight: 600; overflow-wrap: anywhere; }
.menu-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent;
  color: var(--fg); font-size: 13px; font-family: inherit; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent-soft); outline: none; }
.menu-item code { font-size: 12px; }
.menu-sep { padding: 8px 8px 3px; font-size: 12px; font-weight: 600; color: var(--fg-faint); }
.menu-item .method-badge { font-size: 10px; padding: 1px 5px; }

/* Tree: value focus and chunked children. */
.json-value:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.json-more-btn { margin: 4px 0 4px 20px; padding: 3px 10px; border: 1px dashed var(--border); border-radius: 6px; background: transparent;
  color: var(--accent); font-size: 12px; font-family: inherit; cursor: pointer; }
.resp-table td[data-action="copy-cell"] { cursor: pointer; }
.resp-table td[data-action="copy-cell"]:hover { background: var(--accent-soft); }

/* General dialogs (modal()). */
.modal-layer { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; background: var(--scrim); overflow-y: auto; }
.modal-panel { width: 100%; max-width: 520px; border-radius: 12px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); }
.modal-panel.is-wide { max-width: 900px; }
.modal-panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; }
.modal-panel-head h3 { flex: 1; font-size: 17px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.modal-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-x:hover { background: var(--surface-2); color: var(--fg); }
.modal-panel-body { padding: 4px 20px 16px; font-size: 14px; }
.modal-panel-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.modal-text { margin: 0 0 12px; color: var(--fg-muted); line-height: 1.5; font-size: 13.5px; }
.modal-text code, .lib-sub code, .bulk-map code { font-size: 12px; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.modal-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--fg); }
.modal-field input, .modal-field textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--fg); font-weight: 400; font-size: 13px; font-family: inherit; }
.modal-field textarea { font-family: var(--font-mono); font-size: 12.5px; resize: vertical; }
.form-status { min-height: 1em; margin: 8px 0 0; font-size: 12.5px; color: var(--fg-muted); }
.form-status:empty { display: none; }
.empty-note { padding: 14px 0; color: var(--fg-faint); font-size: 13px; }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 13.5px; }
.shortcut-list dt { white-space: nowrap; }
.shortcut-list dd { margin: 0; color: var(--fg-muted); }

/* History and saved requests. */
.lib-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.lib-toolbar input[type="search"] { flex: 1 1 220px; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--fg); font-family: inherit; }
.lib-toolbar select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); }
.lib-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg-muted); }
.lib-count { margin: 4px 0 8px; font-size: 12px; color: var(--fg-faint); }
.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.lib-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lib-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-sub { grid-column: 1; font-size: 12px; color: var(--fg-muted); overflow-wrap: anywhere; }
.lib-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: center; }
.lib-response { grid-column: 1 / -1; max-height: 260px; overflow: auto; margin: 6px 0 0; padding: 8px; border-radius: 6px; background: var(--surface-2);
  font: 12px var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.lib-folder { margin-bottom: 8px; }
.lib-folder > summary { cursor: pointer; padding: 6px 2px; font-weight: 700; font-size: 13px; }
.lib-count-inline { margin-left: 4px; padding: 0 7px; border-radius: 10px; background: var(--surface-3); font-size: 11px; font-weight: 600; color: var(--fg-muted); }
.lib-footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.status-pill { padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 700; }
.status-pill.is-ok { background: var(--ok-soft); color: var(--ok); }
.status-pill.is-error { background: var(--danger-soft); color: var(--danger); }

/* Bulk runs. */
.bulk-input { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-input .modal-field { flex: 1 1 100%; margin-bottom: 4px; }
.bulk-h { margin: 16px 0 8px; font-size: 14px; }
.bulk-map { width: 100%; border-collapse: collapse; font-size: 13px; }
.bulk-map th, .bulk-map td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.bulk-map select { width: 100%; max-width: 360px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.bulk-preview { margin: 0 0 8px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border);
  font: 12px var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.bulk-preview.has-error { border-color: var(--danger); }
.bulk-row-no { font-weight: 700; color: var(--fg-muted); }
.bulk-verdict { font-size: 13px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); }
.bulk-verdict.is-ok { background: var(--ok-soft); }
.bulk-verdict.is-warn { background: var(--warn-soft); }
.bulk-errors { font-size: 12.5px; margin-top: 6px; }
.bulk-errors ul { margin: 6px 0 0 18px; }
[data-role="bulk-progress"] { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
[data-role="bulk-progress"] progress { flex: 1 1 200px; height: 10px; accent-color: var(--accent); }
[data-role="bulk-progress"][hidden] { display: none; }
.bulk-results-table tr.is-failed td, .bulk-results-table tr.is-skipped td { color: var(--danger); }

/* ≤ 768px: one column, the endpoint list becomes a drawer under its search box,
   nothing scrolls sideways except inside tables and code. */
@media (max-width: 768px) {
  .app-top { position: static; }
  .container, .main-layout, .content, .sidebar { min-width: 0; max-width: 100%; }
  .main-layout { grid-template-columns: minmax(0, 1fr); }
  .header { padding: 10px 16px; }
  .header-right { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
  .header-divider { display: none; }
  .provider-chips { flex-wrap: wrap; }
  .page-nav { padding: 0 8px; }
  .page-tab { height: 42px; padding: 0 10px; font-size: 13.5px; }
  .nav-tools { margin-left: 0; width: 100%; justify-content: flex-start; flex-wrap: wrap; padding: 2px 0 8px; }
  .sidebar { padding: 0; max-height: none; overflow: visible; }
  .sidebar-filter { position: static; margin: 0; border-bottom: none; }
  .sidebar-toggle { display: block; flex: 1 1 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
    background: var(--surface); color: var(--fg); font-weight: 600; font-size: 13px; font-family: inherit; text-align: left; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-toggle::after { content: ' ▾'; color: var(--fg-faint); }
  .sidebar.is-open .sidebar-toggle::after { content: ' ▴'; }
  .sidebar-lists { display: none; padding: 8px 12px 12px; max-height: 60vh; overflow-y: auto; }
  .sidebar.is-open .sidebar-lists { display: block; }
  .params-grid { grid-template-columns: minmax(0, 1fr); }
  .endpoint-meta, .api-url { flex-wrap: wrap; overflow-wrap: anywhere; word-break: break-word; }
  .api-url span { min-width: 0; overflow-wrap: anywhere; }
  .action-bar { flex-wrap: wrap; }
  .action-bar-aside { margin-left: 0; flex-wrap: wrap; }
  .shortcut-hint { display: none; }
  .response-toolbar { flex-wrap: wrap; }
  .resp-filter { min-width: 0; flex: 1 1 100%; }
  .lib-row { grid-template-columns: minmax(0, 1fr); }
  .lib-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .modal-layer { padding: 8px; }
  .modal-panel-body { padding: 4px 14px 14px; }
  pre, code { overflow-wrap: anywhere; }
}

/* ======= loading feedback =======
   Anything that waits on the server shows it: a bar across the top for every request
   (api.js), a spinner on the control that started it (App.ui.busy), and a spinner on
   status lines that describe a wait. */
.app-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000;
  overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .2s; }
.app-progress::before { content: ''; position: absolute; top: 0; bottom: 0; width: 35%;
  background: var(--accent); border-radius: 2px; animation: app-progress 1.1s ease-in-out infinite; }
.app-progress.show { opacity: 1; }
@keyframes app-progress { from { left: -35%; } to { left: 100%; } }

.spin-inline, .is-busy::before, .convert-status.is-working::before {
  content: ''; display: inline-block; width: .9em; height: .9em; margin-right: .45em;
  vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
/* The scenario row carries its own spinner on the right, next to "Converting…". */
.convert-scenario.is-busy::before { content: none; }
.convert-scenario.is-busy .convert-scenario-go::before { content: ''; display: inline-block;
  width: .9em; height: .9em; margin-right: .4em; vertical-align: -.12em; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
button.is-busy { cursor: progress; }
.link-button.is-busy { text-decoration: none; opacity: .8; }

/* Pinned while working: the wait may have started from the sidebar or the top of a
   long report, far from where this line normally sits. */
.convert-status.is-working { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center;
  padding: 8px 12px; border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--accent); }

.convert-loading { display: flex; align-items: center; }
.convert-scenarios.is-loading, #convert-result.is-loading { opacity: .5; pointer-events: none;
  transition: opacity .15s; }

.convert-apps { margin: 6px 0 10px; font-size: 12px; }
.convert-apps summary { cursor: pointer; color: var(--fg-muted); }
.convert-apps ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px;
  max-height: 30vh; overflow-y: auto; }
.convert-app { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  text-align: left; padding: 6px 9px; border: 1px solid var(--n-bg-e9ecef); border-radius: 6px;
  background: var(--n-bg-f8f9fa); cursor: pointer; font-family: inherit; }
.convert-app:hover { border-color: var(--accent); background: var(--n-bg-ffffff); }
.convert-app.is-busy { flex-direction: row; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .app-progress::before { animation-duration: 3s; }
  .spin-inline, .is-busy::before, .convert-status.is-working::before,
  .convert-scenario.is-busy .convert-scenario-go::before { animation-duration: 2s; }
}

.convert-apps-key { margin: 6px 0 10px; font-size: 12px; }
.convert-apps-key summary { cursor: pointer; color: var(--fg-muted); }
.convert-apps-key[open] summary { margin-bottom: 8px; }
.convert-apps-key .convert-field { margin-bottom: 6px; }
.convert-apps-key .btn { width: auto; padding: 7px 12px; font-size: 12px; margin: 0; }

/* ======= Converter: sidebar and start screen =======
   The sidebar is one full-height column: the Make account on top, and the scenario
   list filling whatever is left with its own single scrollbar. */

.sidebar.convert-sidebar { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.convert-sidebar .sidebar-section { margin: 0; padding: 16px; }
.convert-sidebar .sidebar-title { position: static; padding: 0 0 10px; background: none; }
.convert-sidebar .convert-account { flex-shrink: 0; max-height: 58%; overflow-y: auto; border-bottom: 1px solid var(--border); }
.convert-sidebar .convert-picker { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 0; }

/* Connected account */
.mk-card { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.mk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mk-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ok); }
.mk-disconnect { border: 0; background: none; padding: 2px 6px; margin-right: -6px; border-radius: 5px;
  font: inherit; font-size: 12px; color: var(--fg-faint); cursor: pointer; }
.mk-disconnect:hover { color: var(--danger); background: var(--danger-soft); }
.mk-zone { margin: 6px 0 2px; font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; color: var(--fg); overflow-wrap: anywhere; }
.mk-key-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 12px; color: var(--fg-faint); }
.mk-key-line .link-button { font-size: 12px; }
.mk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.mk-actions .btn-mini { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mk-actions .btn-mini svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--fg-faint); }
.mk-alert { margin-top: 10px; padding: 9px 11px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn);
  font-size: 12.5px; line-height: 1.5; }

/* Custom app definitions: a quiet disclosure with a count, compact rows inside. */
.convert-apps { margin: 10px 0 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 13px; }
.convert-apps summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; list-style: none;
  cursor: pointer; font-weight: 600; color: var(--fg); }
.convert-apps summary::-webkit-details-marker { display: none; }
.convert-apps summary:hover { background: var(--surface-2); }
.convert-apps summary::after { content: ''; width: 6px; height: 6px; margin: 0 2px 2px 2px; border-right: 1.5px solid var(--fg-faint);
  border-bottom: 1.5px solid var(--fg-faint); transform: rotate(-45deg); transition: transform .15s; }
.convert-apps[open] summary::after { transform: rotate(45deg); }
.mk-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3);
  color: var(--fg-muted); font-size: 11.5px; font-weight: 600; text-align: center; }
.convert-apps ul { display: block; margin: 0; padding: 4px; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--border); }
.convert-app { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: var(--r-sm); background: transparent; font-family: inherit; text-align: left; cursor: pointer; }
.convert-app:hover { background: var(--accent-soft); }
.convert-app-name { min-width: 0; font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convert-app-version { flex-shrink: 0; font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }

.convert-apps-key { margin: 10px 0 0; font-size: 12.5px; }
.convert-apps-key summary { color: var(--accent); font-weight: 550; cursor: pointer; }
.convert-apps-key .btn { width: 100%; height: 34px; }

/* Scenario picker */
.convert-filters { display: grid; gap: 8px; margin-bottom: 10px; }
.convert-filters .convert-field { margin: 0; }
.convert-search { padding-left: 32px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23828998' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 10px center / 14px no-repeat; }
.convert-sidebar .convert-scenarios { flex: 1 1 auto; min-height: 0; max-height: none; display: block;
  margin: 0 -16px; padding: 2px 8px 16px; overflow-y: auto; border-top: 1px solid var(--border); }
.convert-sidebar .convert-scenarios > .convert-hint { padding: 12px 8px; }

.convert-scenario { display: flex; flex-direction: row; align-items: center; gap: 10px; width: 100%; margin: 2px 0;
  padding: 8px 10px; border: 0; border-radius: var(--r-md); background: transparent; }
.convert-scenario:hover { border: 0; background: var(--surface-2); }
.convert-scenario-text { flex: 1 1 auto; min-width: 0; gap: 3px; }
.convert-scenario-name { font-size: 13.5px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.convert-scenario-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--fg-faint); }
.convert-scenario-meta > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convert-scenario-id { flex-shrink: 0; font-family: var(--font-mono); font-size: 11.5px; }
.convert-scenario-state { flex-shrink: 0; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; }
.convert-scenario-state.is-active { background: var(--ok-soft); color: var(--ok); }
.convert-scenario-go { background: var(--accent-solid); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.convert-scenario.is-busy { border: 0; background: var(--accent-soft); }

/* Start screen: the two ways in, side by side. */
.convert-start { padding: 4px 0 0; }
.convert-start-title { font-size: 24px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; color: var(--fg); margin-bottom: 8px; }
.convert-start-lead { max-width: 66ch; margin-bottom: 22px; font-size: 14.5px; line-height: 1.6; color: var(--fg-muted); }
.convert-start-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.convert-route { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.convert-route-icon { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.convert-route-icon svg { width: 18px; height: 18px; }
.convert-route h3 { margin-bottom: 3px; font-size: 14px; font-weight: 600; color: var(--fg); }
.convert-route p { font-size: 13px; line-height: 1.5; color: var(--fg-muted); }
.convert-start + #convert-result + .convert-paste, .convert-start ~ .convert-paste { margin-top: 16px; }

@media (max-width: 1024px) {
  .sidebar.convert-sidebar { display: block; overflow: visible; }
  .convert-sidebar .convert-account { max-height: none; }
  .convert-sidebar .convert-scenarios { max-height: 60vh; }
}

/* ======= Custom app definition dialog =======
   Facts about the app first, then a filterable list: method and path lead each row
   (that is what the converter uses), the Make label and module name sit under it. */

.mk-app-dialog .modal-panel { max-width: 960px; }
.mk-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 18px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.mk-facts div { min-width: 0; }
.mk-facts dt { font-size: 12px; color: var(--fg-faint); margin-bottom: 2px; }
.mk-facts dd { margin: 0; font-size: 13.5px; color: var(--fg); overflow-wrap: anywhere; }
.mk-facts dd code { font-size: 12.5px; }
.mk-pill { display: inline-flex; align-items: center; gap: 5px; margin: 0 6px 2px 0; padding: 1px 9px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; }
.mk-pill em { font-style: normal; color: var(--fg-faint); font-size: 11.5px; }

.mk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.mk-filter { flex: 1 1 240px; min-width: 0; height: 34px; padding: 0 12px 0 32px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font: inherit; font-size: 13.5px; color: var(--fg);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23828998' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 10px center / 14px no-repeat; }
.mk-filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.mk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.mk-chip { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 12.5px; font-weight: 550; color: var(--fg-muted); cursor: pointer; }
.mk-chip span { margin-left: 3px; color: var(--fg-faint); font-weight: 500; }
.mk-chip:hover { border-color: var(--border-strong); color: var(--fg); }
.mk-chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.mk-chip.is-on span { color: inherit; }
.mk-note { margin: 0 0 12px; font-size: 12.5px; color: var(--fg-faint); }

.mk-modules { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mk-module { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  padding: 10px 12px 10px 14px; border-top: 1px solid var(--border); }
.mk-module:first-child { border-top: 0; }
.mk-module:hover { background: var(--surface-2); }
.mk-module[hidden] { display: none; }
.mk-module-main { min-width: 0; }
.mk-module-request { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.mk-module-request .method-badge { width: 54px; padding-left: 0; padding-right: 0; align-self: center; }
.mk-path { min-width: 0; font-family: var(--font-mono); font-size: 13px; color: var(--fg); overflow-wrap: anywhere; line-height: 1.6; }
.mk-param { display: inline-block; padding: 0 5px; margin: 0 1px; border-radius: 4px; line-height: 1.5;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: .92em; }
.mk-norequest { font-size: 13px; color: var(--fg-faint); font-style: italic; }
.mk-module-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 3px; padding-left: 64px; }
.mk-module-name strong { font-size: 13px; font-weight: 500; color: var(--fg-muted); }
.mk-module-name code { font-size: 11.5px; color: var(--fg-faint); }
.mk-module-actions { display: flex; gap: 6px; }
.mk-copy-n8n, .mk-spec-toggle { height: 28px; }
.mk-spec-toggle[aria-expanded="true"] { background: var(--surface-3); color: var(--fg); }
.mk-spec { grid-column: 1 / -1; margin: 8px 0 2px; max-height: 320px; overflow: auto; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--code-bg); color: var(--fg);
  font: 12px/1.6 var(--font-mono); white-space: pre; }
.mk-copy-note { grid-column: 1 / -1; margin: 4px 0 0; font-size: 12.5px; color: var(--fg-muted); }
.mk-copy-note::before { content: "~ "; color: var(--warn); }
.mk-empty { padding: 16px; text-align: center; color: var(--fg-faint); font-size: 13px; }

@media (max-width: 600px) {
  .mk-module-name { padding-left: 0; }
  .mk-module-request { flex-wrap: wrap; gap: 4px 8px; }
  .mk-module-actions { grid-column: 1 / -1; }
}

/* ======= Conversion result: set-up steps before the report =======
   A real sequence (credentials, settings, create), so the steps are numbered. */

#convert-result .convert-result-head { margin-bottom: 18px; }
.convert-steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 0;
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.convert-step { padding: 16px 18px 18px; background: var(--surface); border-top: 1px solid var(--border); }
.convert-step:first-child { border-top: 0; }
.convert-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.convert-step-head h3 { font-size: 15px; font-weight: 650; color: var(--fg); }
.convert-step-num { width: 24px; height: 24px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.convert-step-state { margin-left: auto; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.convert-step-state:empty { display: none; }
.convert-step-state.is-done { background: var(--ok-soft); color: var(--ok); }
.convert-step-state.is-open { background: var(--warn-soft); color: var(--warn); }
.convert-step .convert-hint { margin-bottom: 12px; }
.convert-step-empty { font-size: 13px; color: var(--fg-muted); }
.convert-step-push { background: var(--surface-2); }

/* Credential rows: which ones are still open is visible at a glance. */
.convert-cred-table { border-collapse: separate; border-spacing: 0 6px; margin-top: -6px; }
.convert-cred-table td { border-top: 0; padding: 10px 12px; background: var(--surface-2); vertical-align: top; }
.convert-cred-table td:first-child { border-radius: var(--r-md) 0 0 var(--r-md); border-left: 3px solid var(--ok-dot); padding-right: 20px; }
.convert-cred-table td:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
.convert-cred-table tr.is-open td:first-child { border-left-color: var(--warn-dot); }
.convert-cred-table td .convert-field { width: 100%; }
.convert-cred-table td .link-button { display: inline-block; margin-top: 6px; font-size: 12.5px; }

/* Settings: fields side by side, labels above. */
.convert-fixups { margin: 0; }
.convert-fixup-row { gap: 12px 16px; align-items: flex-start; }
.convert-fixup-row label { font-size: 12.5px; font-weight: 550; color: var(--fg-muted); min-width: 200px; flex: 1 1 200px; }
.convert-fixup-row label .convert-field { font-weight: 400; }
.convert-fixup-row .convert-small { width: 100%; }

/* Readiness list above the push button. */
.convert-ready-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.convert-ready-list li { position: relative; padding: 8px 12px 8px 34px; border-radius: var(--r-md); font-size: 13px; line-height: 1.5; }
.convert-ready-list li::before { content: ''; position: absolute; left: 12px; top: 13px; width: 10px; height: 10px; border-radius: 50%; }
.convert-ready-list li.is-ok { background: var(--ok-soft); color: var(--ok); }
.convert-ready-list li.is-ok::before { background: var(--ok-dot); }
.convert-ready-list li.is-warn { background: var(--warn-soft); color: var(--warn); }
.convert-ready-list li.is-warn::before { background: var(--warn-dot); }
.convert-ready-list li.is-bad { background: var(--danger-soft); color: var(--danger); }
.convert-ready-list li.is-bad::before { background: var(--danger); }
.convert-ready-list .link-button { color: inherit; margin-left: 4px; }
.convert-push-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.convert-push-row .btn { width: auto; min-width: 170px; }
.convert-push-note { font-size: 12.5px; color: var(--fg-faint); }
.convert-push-panel:not(:empty) { margin-top: 10px; }

.convert-section-title { margin-bottom: 10px; }
.convert-workflow-box { margin-top: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.convert-workflow-box > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600; color: var(--fg); background: var(--surface); }
.convert-workflow-box > summary::-webkit-details-marker { display: none; }
.convert-workflow-box > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--fg-faint);
  border-bottom: 1.5px solid var(--fg-faint); transform: rotate(-45deg); transition: transform .15s; }
.convert-workflow-box[open] > summary::before { transform: rotate(45deg); }
.convert-workflow-box > .response-body { border: 0; border-top: 1px solid var(--border); border-radius: 0; }

@media (max-width: 700px) {
  .convert-cred-table tr { display: grid; }
  .convert-cred-table td:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }
  .convert-cred-table td:last-child { border-radius: 0 0 var(--r-md) var(--r-md); border-left: 3px solid transparent; }
}

/* Pushed before: which n8n workflow the main button will update. */
.convert-pushed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.convert-pushed-text { min-width: 0; font-size: 13.5px; color: var(--fg-muted); overflow-wrap: anywhere; }
.convert-pushed-text a { color: var(--fg); font-weight: 600; }
.convert-pushed-state { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  line-height: 20px; background: var(--surface-3); color: var(--fg-muted); vertical-align: 1px; }
.convert-pushed-state.is-active { background: var(--ok-soft); color: var(--ok); }
.convert-push-panel:not(:empty) { margin-top: 0; }

.convert-push-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; margin: 4px 0 10px; }
.convert-push-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.convert-push-form .convert-cred-type { font-weight: 400; }
@media (max-width: 720px) { .convert-push-form { grid-template-columns: 1fr; } }

/* ======= Motion =======
   Quiet, and only where it explains something: what just opened, where the selection
   went. Three pieces, all switched off under prefers-reduced-motion.

   1. Opening an endpoint: Magic UI "Blur Fade" (0.4s ease-out after 0.04s, 6px
      offset coming down, 6px blur). The one entrance on the page.
   2. The tab underline slides: Aceternity UI "Tabs" (spring, bounce 0.3, 0.6s),
      approximated with an overshooting curve. See js/core/tabs-indicator.js.
   3. Menus, pickers and dialogs grow from where they are anchored, fast enough
      (0.14s to 0.18s) never to be waited for.

   fill-mode is `backwards` everywhere: the start state holds during the delay and
   nothing lingers afterwards, so a finished animation leaves no transform or filter
   behind to interfere with sticky or fixed children. */

@keyframes blur-fade { from { opacity: 0; transform: translateY(-6px); filter: blur(6px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes pop-up { from { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

.endpoint-detail.active { animation: blur-fade .4s ease-out .04s backwards; }
.response-container:not([hidden]) { animation: rise-in .28s ease-out backwards; }

.page-tabs.is-animated .page-tab-indicator { transition: transform .6s cubic-bezier(.3, 1.35, .5, 1), width .6s cubic-bezier(.3, 1.35, .5, 1); }
.endpoint-link.active::before { animation: fade-in .2s ease-out backwards; }

.account-dropdown.open, .col-picker[open] .col-list, .var-suggest, .popover { animation: pop-in .14s ease-out backwards; transform-origin: top; }
.export-list { animation: pop-up .14s ease-out backwards; transform-origin: bottom; }
.modal-backdrop.open, .modal-layer, .confirm-backdrop { animation: fade-in .16s ease-out backwards; }
.modal-backdrop.open .modal-card, .modal-panel, .confirm-card { animation: dialog-in .18s ease-out backwards; }

.account-switcher-caret { transition: transform .15s ease-out; }
.account-switcher-btn[aria-expanded="true"] .account-switcher-caret { transform: rotate(180deg); }
.setup-step-mark, .provider-chip .chip-dot { transition: background-color .2s, border-color .2s, box-shadow .2s, color .2s; }

@media (prefers-reduced-motion: reduce) {
  .endpoint-detail.active, .response-container:not([hidden]), .endpoint-link.active::before,
  .account-dropdown.open, .col-picker[open] .col-list, .var-suggest, .popover, .export-list,
  .modal-backdrop.open, .modal-layer, .confirm-backdrop,
  .modal-backdrop.open .modal-card, .modal-panel, .confirm-card { animation: none; }
  .page-tabs.is-animated .page-tab-indicator, .account-switcher-caret { transition: none; }
}

@media (max-width: 768px) {
  #setup-app .setup-steps { grid-template-columns: minmax(0, 1fr); }
  #setup-app .setup-step.is-next .setup-step-blurb { display: block; white-space: normal; }
  .setup-step-go { margin-left: auto; }
  .placeholder-keys { display: none; }
  .endpoint-detail .section { padding: 16px 16px 18px; }
  .endpoint-detail .section-title { margin: 0 -16px 16px; padding: 0 16px 12px; }
}

/* ======= Workspace, second pass =======
   Wide screens were mostly empty: the page stopped at 1180px. From 1480px the
   endpoint splits in two, the form on the left and the request, the response and the
   example on the right, pinned while the form scrolls. Controls are larger and say
   what they are: fields you can tick look tickable, the bar with Execute floats. */

.app-top { background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5); }
/* Only where the list is docked beside the workspace; below 1025px it stacks. */
@media (min-width: 1025px) { .main-layout:not(.gated) { grid-template-columns: clamp(288px, 17vw, 340px) minmax(0, 1fr); } }
.content { background: radial-gradient(900px 340px at 18% 0, color-mix(in srgb, var(--accent) 9%, transparent), transparent 72%) no-repeat; }
.content > [id$="-endpointDetails"] { max-width: 1960px; }
.endpoint-main, .endpoint-side { min-width: 0; }
.endpoint-main { max-width: 1180px; }

/* Head */
.endpoint-detail h2 { font-size: 28px; font-weight: 680; letter-spacing: -.022em; line-height: 1.2; }
.endpoint-meta { margin-bottom: 16px; }
.endpoint-meta .method-badge { font-size: 11.5px; padding: 5px 8px; border-radius: 6px; }

/* The request line reads as a terminal line, dark in both themes. */
.api-url { position: relative; align-items: center; padding: 15px 18px; margin-bottom: 20px;
  background: var(--term-bg); color: var(--term-fg); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--term-bg));
  border-radius: var(--r-lg); box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.api-url-label { color: var(--term-muted); }
.api-url-label::before { content: '$'; margin-right: 8px; font-family: var(--font-mono); color: var(--accent-solid-hover); }

/* Magic UI "Border Beam": a light travels the edge of the request line while the
   request is out. Same construction (masked border box, a square moving along an
   offset-path, linear, endless); 2.4s a lap instead of 6s because most requests are
   back within a second or two, and the app's accent instead of the demo colours. */
.border-beam { display: none; position: absolute; inset: -1px; border: 1.5px solid transparent; border-radius: inherit; pointer-events: none;
  -webkit-mask: linear-gradient(transparent, transparent), linear-gradient(#000, #000);
  mask: linear-gradient(transparent, transparent), linear-gradient(#000, #000);
  -webkit-mask-clip: padding-box, border-box; mask-clip: padding-box, border-box;
  -webkit-mask-composite: source-in, xor; mask-composite: intersect; }
.border-beam > span { position: absolute; width: 90px; aspect-ratio: 1;
  background: linear-gradient(to left, var(--accent), var(--json-null), transparent);
  offset-path: rect(0 auto auto 0 round 90px); offset-distance: 0%; animation: border-beam 2.4s linear infinite; }
@keyframes border-beam { to { offset-distance: 100%; } }
.endpoint-main:has(form[aria-busy="true"]) .border-beam { display: block; }

/* Panels: a titled band on top. */
.endpoint-detail .section { padding: 0 22px 22px; }
.endpoint-detail .section-title { margin: 0 -22px 18px; padding: 12px 22px; font-size: 13.5px;
  background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.endpoint-detail .params-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px 22px; }

/* Fields and the buttons that sit beside them share one height. */
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .chip-entry { min-height: 40px; }
.lookup-btn, .chip-entry-row > .btn-mini, .sb-actions > .btn-mini, .sort-builder > .btn-mini, .extra-head .btn-mini { height: 40px; padding: 0 14px; }
.chip-entry-row .chip-entry { padding: 8px 11px; font-size: 14px; }
.row-remove, .sb-row > button, .sort-row > button, .extra-row > button { height: 40px; }
.extra-row input { height: 40px; }

/* Buttons */
.btn-mini { height: 34px; padding: 0 13px; border-radius: var(--r-md); transition: background .12s, border-color .12s, color .12s, transform .08s; }
.btn-mini:active, .btn:active { transform: scale(.98); }
.btn-mini:not(.btn-mini-primary):not(.btn-mini-ghost):not(.btn-mini-danger):not(.btn-mini-danger-solid):not(.is-ok):not(.is-error):hover {
  border-color: var(--accent); color: var(--accent); background: var(--surface); }
.chip-tools { gap: 2px; margin-left: auto; }
.chip-tools .btn-mini { height: 30px; padding: 0 9px; font-size: 12.5px; color: var(--accent); }

/* Tickable values: a box that fills when chosen, so "selected" is not just a tint. */
.multicheck-group { gap: 8px; padding: 2px 0 4px; }
.multicheck-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 9px;
  border-radius: var(--r-md); border-color: var(--border); background: var(--surface-2); color: var(--fg);
  font-family: var(--font-mono); font-size: 12.5px; transition: background .12s, border-color .12s, color .12s, transform .08s; }
.multicheck-chip::before { content: ''; flex-shrink: 0; width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid var(--border-strong); background: var(--surface) center / 11px no-repeat; transition: background-color .12s, border-color .12s; }
.multicheck-chip:hover { border-color: var(--accent); color: var(--fg); background: var(--surface); }
.multicheck-chip:hover::before { border-color: var(--accent); }
.multicheck-chip:active { transform: scale(.97); }
.multicheck-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); font-weight: 500; }
.multicheck-chip.active::before { border-color: var(--accent-solid); background-color: var(--accent-solid);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.3 5 8.6l4.5-5'/%3E%3C/svg%3E"); }
.multicheck-chip.chip-free { padding-left: 12px; }
.multicheck-chip.chip-free::before { content: none; }

/* Segmented controls: larger targets. */
.mode-btn, .response-toolbar .view-tab { height: 30px; padding: 0 14px; }

/* The bar with Execute floats over the form instead of running edge to edge. */
.action-bar { bottom: 16px; margin: 20px 0 0; padding: 10px 12px; gap: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.btn-execute { height: 42px; min-width: 184px; font-size: 14.5px; border-radius: 10px;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent-solid) 75%, transparent), var(--shadow-sm); }
.btn-execute.btn-danger { box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--danger-solid) 75%, transparent), var(--shadow-sm); }
.shortcut-hint { padding: 2px 7px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface-2); font: 11.5px var(--font-mono); color: var(--fg-muted); }

/* Sidebar rows */
.endpoint-link { min-height: 36px; padding: 7px 10px; border-radius: var(--r-md); }
.endpoint-link.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }

@media (min-width: 1480px) {
  .endpoint-detail.active { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .endpoint-main { max-width: none; }
  /* One scrollbar for the whole right column, not one per block inside it. */
  .endpoint-side { position: sticky; top: calc(var(--app-top-h) + 20px); max-height: calc(100vh - var(--app-top-h) - 36px);
    overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 4px 0; margin-right: -6px; }
  .endpoint-side > :first-child, .endpoint-side > [hidden]:first-child + * { margin-top: 0; }
  .endpoint-side .response-body, .endpoint-side .table-wrap, .endpoint-side .sample-json { max-height: none; }
}

@media (max-width: 768px) {
  .endpoint-detail h2 { font-size: 24px; }
  .action-bar { bottom: 8px; }
  .endpoint-detail .section { padding: 0 16px 18px; }
  .endpoint-detail .section-title { margin: 0 -16px 16px; padding: 11px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .border-beam > span { animation: none; offset-distance: 12%; }
  .btn-mini:active, .btn:active, .multicheck-chip:active { transform: none; }
}
