/* ─────────────────────────────────────────────────────────────────────────────
   http.mtex.dev  ·  Global Stylesheet  ·  v2
   Aesthetic: Dark precision tool · Teal accent · Monospace-first
   ───────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Syne:wght@400;500;600;700;800&display=swap');

/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  --c-bg:         #07090d;
  --c-surface:    #0d1117;
  --c-elevated:   #141922;
  --c-hover:      #1a2130;
  --c-active:     #1e2738;
  --c-border:     #1e2738;
  --c-border-mid: #27334a;
  --c-border-hi:  #3a4a66;

  --c-text-1:     #dde4f0;
  --c-text-2:     #8898b8;
  --c-text-3:     #4a5878;
  --c-text-inv:   #000;

  --c-accent:     #00d4aa;
  --c-accent-h:   #00f0c4;
  --c-accent-dim: rgba(0, 212, 170, .1);
  --c-accent-glow:rgba(0, 212, 170, .22);

  --c-red:        #ff6b6b;
  --c-red-dim:    rgba(255,107,107,.1);
  --c-orange:     #f0883e;
  --c-yellow:     #e3b341;
  --c-green:      #3fb950;
  --c-green-dim:  rgba(63,185,80,.1);
  --c-blue:       #58a6ff;
  --c-purple:     #bc8cff;

  --method-get:     #3fb950;
  --method-post:    #58a6ff;
  --method-put:     #e3b341;
  --method-patch:   #f0883e;
  --method-delete:  #ff6b6b;
  --method-head:    #bc8cff;
  --method-options: #00d4aa;

  --f-ui:   'Syne', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --r-sm: 4px;
  --r-md: 7px;
  --r-lg: 11px;
  --r-xl: 15px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.5);
  --shadow-md: 0 4px 18px rgba(0,0,0,.55);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.65);
  --focus-ring: 0 0 0 3px var(--c-accent-glow);

  --topbar-h:   52px;
  --sidebar-w:  258px;
  --trans:      .14s ease;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13.5px; -webkit-font-smoothing: antialiased; color-scheme: dark; }
body { font-family: var(--f-ui); background: var(--c-bg); color: var(--c-text-1); min-height: 100vh; overflow: hidden; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; color: var(--c-text-1); }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
kbd {
  display: inline-block;
  padding: 2px 7px;
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-sm);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-text-2);
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-border-hi); }

/* ═══════════════════════════════════════════════════════════════════════════
   REQUEST PROGRESS BAR
   ══════════════════════════════════════════════════════════════════════════ */
.req-progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.req-progress-bar.active { opacity: 1; }
.req-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-h));
  width: 0%;
  transition: width .4s ease;
  box-shadow: 0 0 10px var(--c-accent-glow);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: var(--sidebar-w);
  flex-shrink: 0;
}
.brand-link { display: flex; align-items: center; gap: 8px; text-decoration: none !important; }
.brand-icon { width: 20px; height: 20px; stroke: var(--c-accent); flex-shrink: 0; }
.brand-name { font-family: var(--f-mono); font-size: 15px; font-weight: 600; color: var(--c-text-1); letter-spacing: -.4px; }
.brand-accent { color: var(--c-accent); }
.brand-tld, .brand-muted { color: var(--c-text-3); font-family: var(--f-mono); font-size: 15px; }

.topbar-center { flex: 1; display: flex; justify-content: center; }

.topbar-guest-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--c-text-3);
}
.topbar-guest-note svg { width: 13px; height: 13px; }
.topbar-guest-note a { color: var(--c-accent); }

.settings-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--c-text-2);
  letter-spacing: .05em; text-transform: uppercase;
}
.settings-breadcrumb svg { width: 14px; height: 14px; }

.env-selector {
  display: flex; align-items: center; gap: 6px;
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-pill);
  padding: 5px 11px;
  cursor: pointer;
  font-size: 12px;
  color: var(--c-text-2);
  user-select: none;
  transition: all var(--trans);
}
.env-selector svg { width: 13px; height: 13px; }
.env-selector:hover { border-color: var(--c-accent); color: var(--c-text-1); }
.env-selector.has-env { color: var(--c-accent); border-color: var(--c-accent-dim); background: var(--c-accent-dim); }

.topbar-nav { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

.nav-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-2);
  transition: all var(--trans);
}
.nav-btn svg { width: 16px; height: 16px; }
.nav-btn:hover { background: var(--c-hover); color: var(--c-text-1); }

.nav-btn-text {
  padding: 5px 11px;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  color: var(--c-text-2);
  transition: color var(--trans);
}
.nav-btn-text:hover { color: var(--c-text-1); text-decoration: none; }

.nav-btn-primary {
  padding: 5px 14px;
  background: var(--c-accent);
  color: #000;
  font-size: 13px; font-weight: 700;
  border-radius: var(--r-md);
  transition: opacity var(--trans);
}
.nav-btn-primary:hover { opacity: .85; text-decoration: none; }

.nav-divider { width: 1px; height: 20px; background: var(--c-border); margin: 0 3px; }

/* ── GitHub button ───────────────────────────────────────────────────────── */
.github-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-md);
  font-size: 12px; font-weight: 600;
  color: var(--c-text-2);
  transition: all var(--trans);
  text-decoration: none !important;
  white-space: nowrap;
}
.github-btn svg:first-child { width: 15px; height: 15px; }
.star-svg { width: 11px; height: 11px; color: var(--c-yellow); }
.github-btn:hover { border-color: var(--c-border-hi); color: var(--c-text-1); background: var(--c-hover); }

/* ── User pill & dropdown ────────────────────────────────────────────────── */
.user-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 9px 3px 4px;
  border-radius: var(--r-pill);
  cursor: pointer; position: relative;
  transition: background var(--trans);
}
.user-pill:hover { background: var(--c-hover); }
.user-pill > svg { width: 13px; height: 13px; color: var(--c-text-3); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), #007acc);
  color: #000; font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }

.dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-lg);
  padding: 4px; min-width: 170px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: all var(--trans);
  z-index: 200;
}
.user-pill.open .dropdown { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  border-radius: var(--r-md);
  font-size: 13px; color: var(--c-text-2);
  transition: all var(--trans);
  text-decoration: none !important;
}
.dropdown-item svg { width: 14px; height: 14px; }
.dropdown-item:hover { background: var(--c-hover); color: var(--c-text-1); }
.dropdown-item.danger:hover { background: var(--c-red-dim); color: var(--c-red); }
.dropdown-divider { height: 1px; background: var(--c-border); margin: 3px 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--topbar-h);
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px 9px;
  border-bottom: 1px solid var(--c-border);
}
.sidebar-title { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-text-3); }
.sidebar-search {
  display: flex; align-items: center; gap: 7px;
  margin: 8px 10px 4px;
  background: var(--c-elevated);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 5px 9px;
}
.sidebar-search svg { width: 13px; height: 13px; color: var(--c-text-3); flex-shrink: 0; }
.sidebar-search input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 12px; color: var(--c-text-1);
}
.sidebar-search input::placeholder { color: var(--c-text-3); }
.sidebar-body { flex: 1; overflow-y: auto; padding: 6px 0 14px; }

/* Collection groups */
.collection-group { margin-bottom: 1px; }
.collection-header {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; cursor: pointer;
  border-radius: var(--r-md); margin: 0 6px;
  transition: background var(--trans);
  position: relative;
}
.collection-header:hover { background: var(--c-hover); }
.collection-header:hover .collection-actions { opacity: 1; }
.collection-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.collection-name { flex: 1; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { width: 13px; height: 13px; color: var(--c-text-3); transition: transform var(--trans); flex-shrink: 0; }
.collection-group.open .chevron { transform: rotate(90deg); }
.collection-actions { display: flex; gap: 1px; opacity: 0; transition: opacity var(--trans); }
.collection-items { display: none; padding: 2px 8px 4px 20px; }
.collection-group.open .collection-items { display: block; }

.saved-req {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; border-radius: var(--r-md);
  cursor: pointer; transition: background var(--trans);
  margin-bottom: 1px;
}
.saved-req:hover { background: var(--c-hover); }
.saved-req:hover .delete-saved-req { opacity: 1; }
.saved-req .delete-saved-req { opacity: 0; transition: opacity var(--trans); margin-left: auto; }
.req-name { flex: 1; font-size: 12px; color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-req:hover .req-name { color: var(--c-text-1); }

.sidebar-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 40px 20px;
  color: var(--c-text-3); text-align: center;
}
.sidebar-empty svg { width: 30px; height: 30px; opacity: .35; }
.sidebar-empty p { font-size: 12.5px; }

/* ── Workspace ───────────────────────────────────────────────────────────── */
.workspace {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REQUEST PANEL
   ══════════════════════════════════════════════════════════════════════════ */
.request-panel {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  min-height: 220px; max-height: 65vh;
  overflow: hidden;
}

/* URL Toolbar */
.request-toolbar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.method-select {
  appearance: none;
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-md);
  padding: 7px 10px;
  font-family: var(--f-mono);
  font-size: 11.5px; font-weight: 700;
  color: var(--method-get);
  cursor: pointer; outline: none;
  min-width: 88px;
  transition: border-color var(--trans);
}
.method-select:focus { border-color: var(--c-accent); box-shadow: var(--focus-ring); }
.method-select option { background: var(--c-elevated); color: var(--c-text-1); }
.method-select[data-method="GET"]     { color: var(--method-get); }
.method-select[data-method="POST"]    { color: var(--method-post); }
.method-select[data-method="PUT"]     { color: var(--method-put); }
.method-select[data-method="PATCH"]   { color: var(--method-patch); }
.method-select[data-method="DELETE"]  { color: var(--method-delete); }
.method-select[data-method="HEAD"]    { color: var(--method-head); }
.method-select[data-method="OPTIONS"] { color: var(--method-options); }

.url-wrap { flex: 1; }
.url-input {
  width: 100%;
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-family: var(--f-mono); font-size: 13px;
  color: var(--c-text-1); outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.url-input::placeholder { color: var(--c-text-3); }
.url-input:focus { border-color: var(--c-accent); box-shadow: var(--focus-ring); }

.send-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 18px;
  background: var(--c-accent);
  color: #000; font-size: 13px; font-weight: 700;
  border-radius: var(--r-md);
  transition: all var(--trans); flex-shrink: 0;
  position: relative; overflow: hidden;
}
.send-btn svg { width: 14px; height: 14px; }
.send-btn:hover { background: var(--c-accent-h); box-shadow: 0 0 20px var(--c-accent-glow); }
.send-btn:active { transform: scale(.97); }
.send-btn.loading { pointer-events: none; opacity: .8; }
.send-spin { animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.abort-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid rgba(255,107,107,.4);
  background: var(--c-red-dim);
  color: var(--c-red);
  border-radius: var(--r-md); flex-shrink: 0;
  transition: all var(--trans);
}
.abort-btn svg { width: 16px; height: 16px; }
.abort-btn:hover { background: rgba(255,107,107,.2); border-color: var(--c-red); }

.save-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--c-border-mid);
  background: var(--c-elevated);
  color: var(--c-text-2);
  border-radius: var(--r-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans);
}
.save-btn svg { width: 15px; height: 15px; }
.save-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.tab-bar, .response-tab-bar {
  display: flex; padding: 0 14px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0; background: var(--c-surface);
}
.tab {
  padding: 8px 13px;
  font-size: 12px; font-weight: 500;
  color: var(--c-text-3);
  border-bottom: 2px solid transparent;
  transition: all var(--trans);
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 5px;
}
.tab:hover { color: var(--c-text-2); }
.tab.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.tab-count {
  font-family: var(--f-mono);
  font-size: 10px; font-weight: 700;
  background: var(--c-accent-dim);
  color: var(--c-accent);
  padding: 1px 5px;
  border-radius: var(--r-pill);
}

/* ── Tab panels ──────────────────────────────────────────────────────────── */
.tab-panel { display: none; padding: 12px 14px; overflow-y: auto; }
.tab-panel.active { display: block; }

/* ── KV Editor ───────────────────────────────────────────────────────────── */
.kv-header {
  display: grid; grid-template-columns: 1fr 1fr 26px;
  gap: 6px; padding: 0 0 6px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--c-text-3);
}
.kv-rows { display: flex; flex-direction: column; gap: 4px; }
.kv-row {
  display: grid; grid-template-columns: 1fr 1fr 26px;
  gap: 6px; align-items: center;
}
.kv-key, .kv-value {
  background: var(--c-elevated);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  font-family: var(--f-mono); font-size: 12px;
  color: var(--c-text-1); outline: none;
  transition: border-color var(--trans);
  width: 100%;
}
.kv-key:focus, .kv-value:focus { border-color: var(--c-accent); }
.kv-key::placeholder, .kv-value::placeholder { color: var(--c-text-3); }

.add-kv-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px; font-size: 12px;
  color: var(--c-text-3); transition: color var(--trans);
}
.add-kv-btn svg { width: 13px; height: 13px; }
.add-kv-btn:hover { color: var(--c-accent); }

/* ── Auth ────────────────────────────────────────────────────────────────── */
.auth-type-select { margin-bottom: 14px; }
.auth-fields { display: flex; flex-direction: column; gap: 10px; }

/* ── Body ────────────────────────────────────────────────────────────────── */
.body-type-bar { margin-bottom: 10px; }
.code-editor-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--c-elevated);
  border: 1px solid var(--c-border); border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  padding: 4px 9px;
  font-family: var(--f-mono); font-size: 10.5px;
  color: var(--c-text-3);
}
.code-textarea {
  width: 100%; min-height: 140px;
  background: var(--c-elevated);
  border: 1px solid var(--c-border);
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 10px;
  font-family: var(--f-mono); font-size: 12.5px;
  color: #79c0ff; line-height: 1.65;
  outline: none; resize: vertical;
  transition: border-color var(--trans);
}
.code-textarea:focus { border-color: var(--c-accent); }
.code-textarea::placeholder { color: var(--c-text-3); }

/* ── Segmented ───────────────────────────────────────────────────────────── */
.segmented {
  display: inline-flex;
  background: var(--c-elevated);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: 2px; gap: 1px;
}
.seg-btn {
  padding: 4px 11px;
  border-radius: calc(var(--r-md) - 2px);
  font-size: 12px; font-weight: 500;
  color: var(--c-text-3);
  transition: all var(--trans);
}
.seg-btn:hover { color: var(--c-text-2); background: var(--c-hover); }
.seg-btn.active {
  background: var(--c-bg);
  color: var(--c-text-1);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANE DIVIDER (resizable)
   ══════════════════════════════════════════════════════════════════════════ */
.pane-divider {
  height: 5px; flex-shrink: 0;
  background: var(--c-border);
  cursor: ns-resize;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans);
  position: relative; z-index: 10;
}
.pane-divider:hover, .pane-divider.dragging { background: var(--c-accent); }
.pane-divider-dots {
  display: flex; gap: 3px;
}
.pane-divider-dots::before,
.pane-divider-dots::after,
.pane-divider-dots {
  /* Three dots visual */
}
.pane-divider::before {
  content: '• • •';
  font-size: 8px; letter-spacing: 2px;
  color: var(--c-border-hi);
  line-height: 1;
}
.pane-divider:hover::before { color: var(--c-accent-h); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSE PANEL
   ══════════════════════════════════════════════════════════════════════════ */
.response-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: var(--c-bg);
  min-height: 100px;
}

/* Empty state */
.response-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.response-empty-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; color: var(--c-text-3); text-align: center;
}
.response-empty-inner svg { width: 38px; height: 38px; opacity: .25; }
.response-empty-inner p { font-size: 13px; }
.response-empty-inner kbd { margin-top: 4px; }

/* Loading state */
.response-loading {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.loading-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.loading-dots {
  display: flex; gap: 6px; align-items: center;
}
.loading-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-accent);
  animation: bounce .8s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-5px); opacity: 1; } }

.loading-label { font-size: 13px; color: var(--c-text-2); }
.loading-elapsed {
  font-family: var(--f-mono); font-size: 22px; font-weight: 600;
  color: var(--c-accent); letter-spacing: -.5px;
}

/* Response content */
.response-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Status bar */
.response-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.statusbar-left { display: flex; align-items: center; gap: 10px; }
.statusbar-right { display: flex; align-items: center; gap: 4px; }
.statusbar-sep { color: var(--c-text-3); }

.status-badge {
  font-family: var(--f-mono); font-size: 12.5px; font-weight: 700;
  padding: 2px 10px; border-radius: var(--r-pill);
}
.status-badge.s2xx { background: var(--c-green-dim); color: var(--c-green); }
.status-badge.s3xx { background: rgba(88,166,255,.1); color: var(--c-blue); }
.status-badge.s4xx { background: var(--c-red-dim); color: var(--c-red); }
.status-badge.s5xx { background: rgba(240,136,62,.1); color: var(--c-orange); }

.meta-chip {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-family: var(--f-mono);
  color: var(--c-text-2);
}
.meta-chip svg { width: 12px; height: 12px; color: var(--c-text-3); }

/* Response panels */
.res-tab-panel { display: none; flex: 1; overflow: auto; }
.res-tab-panel.active { display: flex; flex-direction: column; }
.response-body {
  flex: 1; padding: 12px 14px;
  font-family: var(--f-mono); font-size: 12.5px;
  line-height: 1.65; color: #79c0ff;
  white-space: pre; overflow: auto; tab-size: 2;
}
.response-body.wrap { white-space: pre-wrap; word-break: break-all; }
.json-key    { color: #79c0ff; }
.json-string { color: #a5d6ff; }
.json-number { color: #f0883e; }
.json-bool   { color: #ff7b72; }
.json-null   { color: #8b949e; }

.res-headers-table { padding: 12px 14px; }
.res-header-row {
  display: grid; grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 10px; padding: 5px 0;
  border-bottom: 1px solid var(--c-border);
  font-family: var(--f-mono); font-size: 12px;
}
.res-header-row:last-child { border-bottom: none; }
.res-header-key { color: var(--c-text-2); }
.res-header-val { color: var(--c-text-1); word-break: break-all; }

/* ═══════════════════════════════════════════════════════════════════════════
   DRAWERS
   ══════════════════════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed; inset: var(--topbar-h) 0 0 0;
  background: rgba(0,0,0,.55);
  z-index: 150; backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0;
  width: 360px;
  background: var(--c-elevated);
  border-left: 1px solid var(--c-border-mid);
  display: flex; flex-direction: column;
  z-index: 160;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.drawer-header h3 {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600;
}
.drawer-header h3 svg { width: 15px; height: 15px; color: var(--c-text-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px; }
.drawer-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 30px;
  color: var(--c-text-3); font-size: 13px; text-align: center;
}
.drawer-empty svg { width: 28px; height: 28px; opacity: .3; }

/* History */
.history-item {
  padding: 9px 10px; border-radius: var(--r-md);
  cursor: pointer; transition: background var(--trans);
  margin-bottom: 2px; border: 1px solid transparent;
}
.history-item:hover { background: var(--c-hover); border-color: var(--c-border); }
.history-top { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.history-status { font-family: var(--f-mono); font-size: 12px; font-weight: 700; }
.status-ok   { color: var(--c-green); }
.status-err  { color: var(--c-red); }
.status-muted{ color: var(--c-text-3); }
.history-time { font-size: 11px; color: var(--c-text-3); margin-left: auto; }
.history-url {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--c-text-3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* Environments */
.env-list { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.env-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: all var(--trans);
}
.env-item:hover { background: var(--c-hover); }
.env-item.active { border-color: var(--c-accent-dim); background: var(--c-accent-dim); }
.env-indicator {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-border-hi); flex-shrink: 0;
}
.env-indicator.on { background: var(--c-accent); box-shadow: 0 0 5px var(--c-accent); }
.env-info { flex: 1; min-width: 0; }
.env-name { font-size: 13px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-var-count { font-size: 11px; color: var(--c-text-3); font-family: var(--f-mono); }
.env-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--trans); }
.env-item:hover .env-actions { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 300; display: flex;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-xl);
  width: 440px; max-width: 95vw;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s cubic-bezier(.34,1.56,.64,1);
}
.modal-lg { width: 600px; }
@keyframes slideUp { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 17px; border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 17px; display: flex; flex-direction: column; gap: 15px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 13px 17px; border-top: 1px solid var(--c-border);
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--c-text-3);
  display: flex; align-items: center; gap: 6px;
}
.field-optional { font-size: 10px; font-weight: 500; color: var(--c-text-3); letter-spacing: 0; text-transform: none; }
.field-hint { font-size: 12px; color: var(--c-text-3); line-height: 1.5; }
.field-error { font-size: 12px; color: var(--c-red); }
.inline-code {
  font-family: var(--f-mono); font-size: 11.5px;
  background: var(--c-bg); border: 1px solid var(--c-border-mid);
  border-radius: var(--r-sm); padding: 1px 5px; color: var(--c-accent);
}

.field-input, .field-select, .field-textarea {
  background: var(--c-bg);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-md);
  padding: 8px 10px; font-size: 13px;
  color: var(--c-text-1); outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
  width: 100%;
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--c-text-3); }
.field-input:focus, .field-select:focus, .field-textarea:focus { border-color: var(--c-accent); box-shadow: var(--focus-ring); }
.field-input.is-error, .field-select.is-error { border-color: var(--c-red); }
.field-select { cursor: pointer; }
.field-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

.input-with-unit { display: flex; align-items: center; gap: 8px; }
.input-unit { font-size: 12px; color: var(--c-text-3); white-space: nowrap; }

/* Color swatches */
.color-swatches, .accent-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.color-swatch, .accent-swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent;
  transition: all var(--trans); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.color-swatch:hover, .accent-swatch:hover { transform: scale(1.1); border-color: rgba(255,255,255,.5); }
.color-swatch.selected, .accent-swatch.selected { border-color: #fff; transform: scale(1.1); }

/* Toggle */
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.toggle-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.toggle { position: relative; flex-shrink: 0; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  display: block; width: 38px; height: 22px;
  background: var(--c-border-mid); border-radius: var(--r-pill);
  transition: background var(--trans);
  position: relative;
}
.toggle-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--trans);
}
.toggle input:checked ~ .toggle-track { background: var(--c-accent); }
.toggle input:checked ~ .toggle-track::after { transform: translateX(16px); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; background: var(--c-accent);
  color: #000; font-size: 13px; font-weight: 700;
  border-radius: var(--r-md); transition: all var(--trans);
}
.btn-primary:hover { background: var(--c-accent-h); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--c-border-mid);
  color: var(--c-text-2); font-size: 13px; font-weight: 500;
  border-radius: var(--r-md); transition: all var(--trans);
}
.btn-ghost:hover { border-color: var(--c-border-hi); color: var(--c-text-1); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--c-red-dim);
  border: 1px solid rgba(255,107,107,.3);
  color: var(--c-red); font-size: 13px; font-weight: 600;
  border-radius: var(--r-md); transition: all var(--trans);
}
.btn-danger:hover { background: rgba(255,107,107,.2); }

.btn-full { width: 100%; justify-content: center; }

.btn-full-primary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 9px;
  background: var(--c-accent-dim);
  border: 1px dashed rgba(0,212,170,.3);
  color: var(--c-accent); font-size: 13px; font-weight: 600;
  border-radius: var(--r-md); transition: all var(--trans);
  margin-bottom: 6px;
}
.btn-full-primary svg { width: 14px; height: 14px; }
.btn-full-primary:hover { background: rgba(0,212,170,.15); border-style: solid; }

.btn-sm-primary {
  padding: 5px 13px; background: var(--c-accent);
  color: #000; font-size: 12px; font-weight: 700;
  border-radius: var(--r-md); transition: opacity var(--trans);
}
.btn-sm-primary:hover { opacity: .85; }

/* Icon buttons */
.icon-btn {
  width: 28px; height: 28px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-3); transition: all var(--trans);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--c-hover); color: var(--c-text-1); }

.icon-btn-xs {
  width: 22px; height: 22px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-3); transition: all var(--trans); flex-shrink: 0;
}
.icon-btn-xs svg { width: 13px; height: 13px; }
.icon-btn-xs:hover { background: var(--c-hover); color: var(--c-text-1); }
.icon-btn-xs.danger:hover { background: var(--c-red-dim); color: var(--c-red); }
.icon-btn-xs.active { color: var(--c-accent); }

/* Method badges */
.method-badge {
  font-family: var(--f-mono); font-size: 9.5px; font-weight: 700;
  padding: 2px 5px; border-radius: var(--r-sm);
  letter-spacing: .02em; flex-shrink: 0;
}
.method-get     { background: rgba(63,185,80,.14);   color: var(--method-get); }
.method-post    { background: rgba(88,166,255,.14);  color: var(--method-post); }
.method-put     { background: rgba(227,179,65,.14);  color: var(--method-put); }
.method-patch   { background: rgba(240,136,62,.14);  color: var(--method-patch); }
.method-delete  { background: rgba(255,107,107,.14); color: var(--method-delete); }
.method-head    { background: rgba(188,140,255,.14); color: var(--method-head); }
.method-options { background: rgba(0,212,170,.14);   color: var(--method-options); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 18px; right: 18px;
  display: flex; flex-direction: column; gap: 7px;
  z-index: 500;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  font-size: 13px; min-width: 230px; max-width: 360px;
  animation: toastIn .22s cubic-bezier(.34,1.56,.64,1);
}
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast.success { border-left: 3px solid var(--c-green); }
.toast.success svg { color: var(--c-green); }
.toast.error   { border-left: 3px solid var(--c-red); }
.toast.error svg { color: var(--c-red); }
.toast.info    { border-left: 3px solid var(--c-accent); }
.toast.info svg { color: var(--c-accent); }
.toast.leaving { animation: toastOut .18s ease forwards; }
@keyframes toastIn  { from { transform: translateX(28px); opacity: 0; } }
@keyframes toastOut { to   { transform: translateX(28px); opacity: 0; } }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════════════════ */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--c-bg);
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,170,.05) 0%, transparent 65%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}
.auth-container {
  width: 100%; max-width: 400px; padding: 20px;
  display: flex; flex-direction: column; gap: 22px;
  position: relative; z-index: 1;
}
.auth-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; text-decoration: none !important;
}
.auth-brand svg { width: 22px; height: 22px; stroke: var(--c-accent); }
.auth-brand span { font-family: var(--f-mono); font-size: 18px; font-weight: 600; color: var(--c-text-1); }
.auth-card {
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-xl); padding: 28px;
  box-shadow: var(--shadow-lg);
}
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 5px; }
.auth-subtitle { font-size: 13px; color: var(--c-text-3); margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-link { text-align: center; font-size: 13px; color: var(--c-text-3); margin-top: 18px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-2); cursor: pointer; }
.checkbox { width: 14px; height: 14px; accent-color: var(--c-accent); }
.alert-error {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--c-red-dim);
  border: 1px solid rgba(255,107,107,.25);
  border-radius: var(--r-md);
  color: var(--c-red); font-size: 13px; margin-bottom: 14px;
}
.alert-error svg { width: 15px; height: 15px; flex-shrink: 0; }
.alert-success {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--c-green-dim);
  border: 1px solid rgba(63,185,80,.25);
  border-radius: var(--r-md);
  color: var(--c-green); font-size: 13px; margin-bottom: 14px;
}
.alert-success svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */
.settings-page { overflow: auto !important; }
.settings-layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
  padding-top: var(--topbar-h);
}
.settings-nav {
  width: 220px; flex-shrink: 0;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  padding: 20px 10px;
  display: flex; flex-direction: column; gap: 24px;
}
.settings-nav-section { display: flex; flex-direction: column; gap: 1px; }
.settings-nav-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--c-text-3); padding: 0 10px 6px;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; color: var(--c-text-2);
  transition: all var(--trans); text-decoration: none !important;
}
.settings-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.settings-nav-item:hover { background: var(--c-hover); color: var(--c-text-1); }
.settings-nav-item.active { background: var(--c-accent-dim); color: var(--c-accent); }

.settings-content {
  flex: 1; padding: 32px 40px;
  max-width: 720px;
  overflow-y: auto;
}

.settings-section { margin-bottom: 36px; }
.settings-section-header { margin-bottom: 14px; }
.settings-section-title {
  font-size: 17px; font-weight: 700; margin-bottom: 4px;
}
.settings-section-title.danger { color: var(--c-red); }
.settings-section-desc { font-size: 13px; color: var(--c-text-3); }

.settings-card {
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--r-xl);
  padding: 22px;
}
.settings-card-danger { border-color: rgba(255,107,107,.25); }

.settings-form { display: flex; flex-direction: column; gap: 18px; }
.settings-form-footer { display: flex; justify-content: flex-end; padding-top: 4px; }

/* Info grid */
.info-grid { display: flex; flex-direction: column; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 13px; color: var(--c-text-2); }
.info-value { font-size: 13px; font-weight: 500; }
.info-mono { font-family: var(--f-mono); font-size: 11.5px; color: var(--c-text-2); }

/* Danger zone */
.danger-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
}
.danger-action-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.danger-action-desc { font-size: 12.5px; color: var(--c-text-3); line-height: 1.5; max-width: 380px; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar-brand { min-width: auto; }
  .github-btn span:not(.star-svg) { display: none; }
}
