/* ──────────────────────────────────────────────────────────────
   PP:UNDOC  —  Power Platform Undocumented APIs
   Corporate theme with light/dark modes
   ────────────────────────────────────────────────────────────── */

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

/* ── CSS Custom Properties ── */
:root {
  --bg: #fcfcfc;
  --bg-alt: #f5f5f5;
  --text: #0f0f0f;
  --text-muted: #000000;
  --text-ghost: #6a6a6a;
  --text-faint: #e2e2e2;
  --border: #ebebeb;
  --border-light: #f5f5f5;
  --accent: #e85d04;
  --method-get: #22c55e;
  --method-post: #3b82f6;
  --method-put: #f59e0b;
  --method-patch: #a855f7;
  --method-delete: #ef4444;
  --card-number: #e85d04;
  --hero-stroke: #0f0f0f;
  --font: 'Outfit', system-ui, sans-serif;
  --pad-x: 5rem;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --text: #f0f0f0;
  --text-muted: #777;
  --text-ghost: #444;
  --text-faint: #222;
  --border: #222;
  --border-light: #1a1a1a;
  --card-number: #e85d04;
  --hero-stroke: #f0f0f0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }

#colEndpointCount{
  color:var(--card-number)
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5rem var(--pad-x);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}
.logo {
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.nav-right { display: flex; align-items: center; gap: 2rem; }
#menu { display: flex; align-items: center; gap: 2rem; }
.nav-right a {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  transition: color 0.2s;
}
.nav-right a:hover { color: var(--text); }
.nav-right a.active {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.hamburger:hover { border-color: var(--text); color: var(--text); }
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.ext-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-left: 0.75rem;
  vertical-align: middle;
}
.ext-status-error {
  color: #ff4d4f;
  border: 1px solid #ff4d4f;
}
.ext-status-success {
  color: #52c41a;
  border: 1px solid #52c41a;
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--text); color: var(--text); }

/* ── Mega Typography Hero ── */
.mega-hero {
  padding: 12rem var(--pad-x) 10rem;
  position: relative;
}
.mega-hero h1 {
  font-size: clamp(4rem, 12vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-transform: uppercase;
}
.mega-hero h1 .line-2 {
  display: block;
  color: transparent;
  -webkit-text-stroke: 2px var(--hero-stroke);
}
.mega-hero h1 .line-3 {
  display: block;
  color: var(--text-faint);
}
.mega-hero-aside {
  position: absolute;
  right: var(--pad-x);
  bottom: 12rem;
  max-width: 300px;
  text-align: right;
}
.mega-hero-aside p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 300;
}
.mega-hero-aside .line-accent {
  width: 40px;
  height: 2px;
  background: var(--text);
  margin-left: auto;
  margin-bottom: 1.5rem;
}

/* ── Horizontal Scroll Cards ── */
.h-scroll-wrap {
  padding: 4rem var(--pad-x) 8rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.h-scroll-wrap::-webkit-scrollbar { display: none; }
.h-scroll {
  display: flex;
  gap: 1.5rem;
  width: max-content;
}
.h-card {
  width: 340px;
  flex-shrink: 0;
  padding: 3rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
  cursor: pointer;
  background: var(--bg);
}
.h-card:hover {
  border-color: var(--text);
  transform: translateY(-4px);
}
.h-card-number {
  font-size: 5rem;
  font-weight: 800;
  color: var(--text-ghost);
  line-height: 1;
  margin-bottom: 1.5rem;
}
.h-card:nth-child(1) .h-card-number,
.h-card:nth-child(5) .h-card-number,
.h-card:nth-child(10) .h-card-number,
.h-card:nth-child(15) .h-card-number,
.h-card:nth-child(20) .h-card-number  {
  color: var(--card-number);
}
.h-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}
.h-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.h-card-tag {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
}
.h-card-count {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Big Statement ── */
.big-statement {
  padding: 12rem var(--pad-x);
  max-width: 900px;
}
.big-statement h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.big-statement h2 span { color: var(--text-ghost); }

/* ── Collections Table ── */
.table-section {
  padding: 2rem var(--pad-x) 8rem;
}
.table-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  margin-bottom: 2rem;
  font-weight: 500;
}
.table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.5fr;
  padding: 1rem 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.5fr;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  transition: padding-left 0.2s;
  cursor: pointer;
}
.table-row:hover { padding-left: 0.5rem; }
.table-name { font-size: 1rem; font-weight: 600; }
.table-type { font-size: 0.8rem; color: var(--text-muted); }
.table-endpoints { font-size: 0.8rem; font-weight: 500; }
.table-arrow {
  font-size: 1.2rem;
  color: var(--text-ghost);
  transition: color 0.2s;
}
.table-row:hover .table-arrow { color: var(--text); }

/* ── Collection Detail Page ── */
.collection-page {
  display: none;
  padding: 6rem var(--pad-x) 4rem;
  min-height: 100vh;
}
.collection-page.active { display: block; }
.collection-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 3rem;
  transition: color 0.2s;
}
.collection-back:hover { color: var(--text); }
.collection-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 1rem;
}
.collection-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 700px;
  margin-bottom: 3rem;
}
.collection-meta {
  display: flex;
  gap: 3rem;
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.collection-meta-item {
  display: flex;
  flex-direction: column;
}
.collection-meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
  margin-bottom: 0.25rem;
}
.collection-meta-value {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── Folder Section ── */
.folder-section {
  margin-bottom: 3rem;
}
.folder-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Search / Filter ── */
.search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  align-items: center;
}
.search-input {
  flex: 1;
  max-width: 500px;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--text); }
.search-input::placeholder { color: var(--text-ghost); }
.filter-pill {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg);
  transition: all 0.2s;
}
.filter-pill:hover, .filter-pill.active {
  border-color: var(--text);
  color: var(--text);
  background: var(--bg-alt);
}

/* ── Endpoint Card ── */
.endpoint-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.endpoint-card:hover { border-color: var(--text-muted); }
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  user-select: none;
}
.method-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  min-width: 56px;
  text-align: center;
}
.method-badge.get { background: var(--method-get); }
.method-badge.post { background: var(--method-post); }
.method-badge.put { background: var(--method-put); }
.method-badge.patch { background: var(--method-patch); }
.method-badge.delete { background: var(--method-delete); }
.endpoint-name {
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
}
.endpoint-toggle {
  font-size: 1rem;
  color: var(--text-ghost);
  transition: transform 0.3s, color 0.2s;
}
.endpoint-toggle.open { transform: rotate(180deg); }
.endpoint-body {
  display: none;
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border-light);
}
.endpoint-body.open { display: block; }
.endpoint-url {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  word-break: break-all;
  line-height: 1.5;
}
.endpoint-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.55rem;
}
.endpoint-link {
  display: block;
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  color: var(--card-number);
  text-decoration: underline;
  text-underline-offset: 0.14em;
  word-break: break-all;
}
.endpoint-link:hover {
  opacity: 0.82;
}
.endpoint-section-label {
  font-size: 1.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
  font-weight: 600;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
}
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.param-table th {
  text-align: left;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-ghost);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.param-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
}
.param-table td:first-child {
  color: var(--text);
  font-weight: 500;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
}
.body-preview {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.variable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.variable-chip {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: var(--text-muted);
}
.variable-chip--editable {
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.variable-chip--editable:hover {
  border-color: var(--accent, #646cff);
  background: rgba(100, 108, 255, 0.06);
}
.variable-chip--overridden {
  border-color: var(--accent, #646cff);
  color: var(--text);
}
.variable-chip--editing {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-color: var(--accent, #646cff);
}
.variable-chip-label {
  white-space: nowrap;
}
.variable-chip-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--text);
  width: 10rem;
  padding: 0.1rem 0;
}
.variable-chip-reset {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
  line-height: 1;
}
.variable-chip-reset:hover {
  color: var(--text);
}

/* ── Variable Editor (collection edit mode) ── */
.var-editor { display: flex; flex-direction: column; gap: 0.5rem; }
.var-editor-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.var-editor-key,
.var-editor-val {
  flex: 1;
  margin-bottom: 0;
}
.var-editor-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.var-editor-remove:hover { border-color: #e74c3c; color: #e74c3c; }
.var-editor-add {
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--border);
  color: var(--accent);
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: border-color 0.2s, background 0.2s;
}
.var-editor-add:hover { border-color: var(--accent); background: rgba(0,120,212,0.06); }

/* ── Footer ── */
footer {
  padding: 6rem var(--pad-x) 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.footer-left { max-width: 300px; }
.footer-left h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.footer-left p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-right { text-align: right; }
.footer-right a {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  transition: color 0.2s;
}
.footer-right a:hover { color: var(--text); }
.footer-bottom {
  padding: 2rem var(--pad-x);
  font-size: 0.7rem;
  color: var(--text-ghost);
}

/* ── Admin Login Gate ── */
.admin-login-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem var(--pad-x);
}
.admin-login-gate.admin-hidden {
  display: none;
}
.admin-login-box {
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.admin-login-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}
.admin-login-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.admin-login-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.2s;
}
.admin-login-input:focus {
  outline: none;
  border-color: var(--text-muted);
}
.admin-login-error {
  font-size: 0.82rem;
  color: var(--method-delete);
  min-height: 1.2em;
}
.admin-hidden {
  display: none !important;
}

/* ── Admin Page ── */
.admin-page {
  padding: 6rem var(--pad-x) 4rem;
  min-height: 100vh;
}
.admin-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}
.admin-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 3rem;
}
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  margin-bottom: 3rem;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--text-muted);
  background: var(--bg-alt);
}
.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-ghost);
}
.upload-zone-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.upload-zone-sub {
  font-size: 0.75rem;
  color: var(--text-ghost);
}
.upload-zone-hint {
  font-size: 0.75rem;
  color: var(--text-ghost);
}
.upload-zone.drag-over {
  border-color: var(--text);
  background: var(--bg-alt);
}
.upload-result {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
}
.upload-result.success {
  border-color: var(--method-get);
  color: var(--method-get);
}
.upload-result.error {
  border-color: var(--method-delete);
  color: var(--method-delete);
}
.upload-result.info {
  border-color: var(--method-put);
  color: var(--method-put);
}

.admin-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 3rem;
}
.admin-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.admin-collection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}
.admin-col-info {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-col-info strong {
  font-size: 0.95rem;
}
.admin-col-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.admin-col-actions {
  display: flex;
  gap: 0.5rem;
}
.admin-delete-btn {
  background: none;
  border: 1px solid var(--method-delete);
  color: var(--method-delete);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.admin-delete-btn:hover {
  background: var(--method-delete);
  color: #fff;
}
.admin-export-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.admin-export-btn:hover {
  background: var(--text-muted);
  color: var(--bg);
}
.admin-reset-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.admin-reset-btn:hover {
  border-color: var(--method-delete);
  color: var(--method-delete);
}
.admin-empty {
  font-size: 0.88rem;
  color: var(--text-ghost);
}

/* ── Admin Tabs ── */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.admin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-tab:hover {
  color: var(--text);
}
.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}
.admin-tab-panel {
  display: none;
}
.admin-tab-panel.active {
  display: block;
}

/* ── Admin Forms ── */
.admin-form {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.form-group-wide {
  flex: 3;
}
.form-group-narrow {
  flex: 1;
  max-width: 140px;
}
.admin-form label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--text-muted);
}
.admin-form input[type="text"],
.admin-form select,
.admin-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.2s;
}
.admin-form input[type="text"]:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--text-muted);
}
.admin-form textarea {
  resize: vertical;
  min-height: 80px;
}
.admin-form select {
  cursor: pointer;
}
.admin-submit-btn {
  align-self: flex-start;
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: opacity 0.2s;
}
.admin-submit-btn:hover {
  opacity: 0.85;
}
.admin-approve-btn {
  background: none;
  border: 1px solid var(--method-get);
  color: var(--method-get);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.admin-approve-btn:hover {
  background: var(--method-get);
  color: #fff;
}

/* ── Pending Cards (expandable) ── */
.pending-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.pending-card:hover {
  border-color: var(--border);
}
.pending-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.pending-summary:hover {
  background: var(--bg-alt);
}
.pending-toggle-icon {
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: color 0.2s;
}
.pending-detail {
  display: none;
  padding: 0 1.25rem 1.25rem;
}
.pending-card.expanded .pending-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pending-edit-row {
  display: flex;
  gap: 1rem;
}
.pending-edit-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.pending-edit-wide {
  flex: 3;
}
.pending-edit-narrow {
  flex: 1;
  max-width: 140px;
}
.pending-edit-group label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--text-ghost);
}
.pending-edit-input,
.pending-edit-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.2s;
}
.pending-edit-input:focus,
.pending-edit-textarea:focus {
  outline: none;
  border-color: var(--text-muted);
}
.pending-edit-textarea {
  resize: vertical;
  min-height: 60px;
}
.pending-edit-mono {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
}
.pending-edit-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.pending-detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.collection-list {
  margin-top: 3rem;
}
.collection-list-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.collection-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}
.collection-list-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.collection-list-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.btn-delete {
  background: none;
  border: 1px solid var(--method-delete);
  color: var(--method-delete);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-delete:hover {
  background: var(--method-delete);
  color: #fff;
}

/* ── Inline Edit ── */
.collection-title-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}
.collection-title-row .collection-title { flex: 1; }

.edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.5rem;
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.5rem;
}
.download-btn:hover { border-color: var(--text); color: var(--text); }

.edit-btn:hover { border-color: var(--text); color: var(--text); }

.edit-btn--inline {
  margin: 0.5rem 0 0.5rem 0.75rem;
}

.edit-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0.5rem;
}
.edit-input:focus { border-color: var(--text); }

.edit-input--title {
  font-size: 1.6rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
}
.edit-input--desc {
  resize: vertical;
  line-height: 1.6;
}
.edit-input--code {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  resize: vertical;
}

textarea.edit-input {
  resize: vertical;
}

select.edit-input {
  cursor: pointer;
  max-width: 180px;
}

.edit-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.edit-save-btn,
.edit-cancel-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: opacity 0.2s, transform 0.15s;
  border: none;
}
.edit-save-btn {
  background: var(--accent);
  color: #fff;
}
.edit-save-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.edit-save-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.edit-cancel-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.edit-cancel-btn:hover { border-color: var(--text); color: var(--text); }

#colEditBtnWrap {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-shrink: 0;
}

/* ── Try It Button ── */
.try-api-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--method-post);
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1rem 0 0.5rem;
  transition: opacity 0.2s, transform 0.15s;
}
.try-api-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ── Share Button ── */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1rem 0 0.5rem 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}
.share-btn:hover { border-color: var(--text); color: var(--text); }

/* ── Endpoint highlight on deep-link ── */
.endpoint-card--highlight {
  outline: 2px solid var(--card-number);
  outline-offset: 2px;
  border-radius: 10px;
  animation: endpointHighlightFade 2s ease-out forwards;
}
@keyframes endpointHighlightFade {
  0%   { outline-color: var(--card-number); }
  100% { outline-color: transparent; }
}

/* ── Try It Popup Overlay ── */
.tryit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.tryit-popup {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem 2.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}
.tryit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.tryit-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.tryit-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.tryit-close-btn:hover {
  color: var(--text);
  background: var(--bg-alt);
}
.tryit-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 0.75rem;
}
.tryit-response-label {
  margin-top: 1.25rem;
}
.tryit-url-input,
.tryit-body-input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text);
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.2s;
}
.tryit-url-input:focus,
.tryit-body-input:focus {
  outline: none;
  border-color: var(--text-muted);
}
.tryit-submit-btn {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: opacity 0.2s;
}
.tryit-submit-btn:hover { opacity: 0.85; }
.tryit-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tryit-action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.tryit-save-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}
.tryit-save-btn:hover {
  border-color: var(--text);
  color: var(--text);
}
.tryit-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tryit-save-btn.is-hidden {
  display: none;
}
.tryit-status {
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 0.75rem;
  min-height: 1.2em;
}
.tryit-save-status {
  font-size: 0.76rem;
  color: var(--text-muted);
  min-height: 1.2em;
}
.tryit-success { color: var(--method-get); }
.tryit-error { color: var(--method-delete); }
.tryit-response {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 60px;
}

/* ── Extension Install Popup ── */
.ext-install-popup {
  max-width: 540px;
}
.ext-install-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1.25rem;
}
.ext-install-heading {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-ghost);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.ext-install-steps {
  padding-left: 1.25rem;
  margin: 0;
  list-style: decimal;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ext-install-steps li {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
}
.ext-install-steps code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.78rem;
  font-family: 'Courier New', monospace;
}
.ext-install-steps a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ext-install-steps a:hover {
  opacity: 0.7;
}

/* ── Studio Page ── */
.studio-test-btn {
  background: var(--method-post);
}
.studio-response-panel {
  max-width: 640px;
  margin-bottom: 2rem;
}
.studio-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.studio-response-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.studio-save-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}
.studio-save-btn:hover {
  border-color: var(--text);
  color: var(--text);
}
.studio-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.studio-save-btn.is-hidden {
  display: none;
}
.tryit-response-wrap {
  position: relative;
}
.copy-response-btn {
  position: absolute;
  top: 6px;
  right: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  z-index: 1;
}
.copy-response-btn:hover {
  color: var(--accent, #22c55e);
  border-color: var(--accent, #22c55e);
}
.param-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #22c55e);
  cursor: pointer;
}

/* ── Custom Collection Detail (Studio) ── */
.custom-col-detail {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  background: var(--bg-alt);
}
.col-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.col-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.col-detail-field:first-child {
  grid-column: 1 / -1;
}
.col-detail-field:last-child {
  grid-column: 1 / -1;
}
.col-detail-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--text-ghost);
}
.col-detail-input {
  font-size: 0.82rem !important;
  padding: 0.4rem 0.65rem !important;
}
.col-detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  :root { --pad-x: 2rem; }
  .hamburger { display: block; }
  #menu {
    display: none;
    position: absolute;
    top: 100%;
    right: var(--pad-x);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 200;
  }
  #menu.open { display: flex; }
  #menu a { font-size: 0.9rem; }
  #menu .theme-toggle { width: 100%; text-align: center; }
  .nav-right { position: static; }
  nav { position: sticky; }
  .mega-hero { padding-top: 6rem; padding-bottom: 6rem; }
  .mega-hero-aside { position: static; text-align: left; margin-top: 3rem; }
  .mega-hero-aside .line-accent { margin-left: 0; }
  .table-header, .table-row { grid-template-columns: 2fr 1fr 0.5fr; }
  .table-type { display: none; }
  footer { flex-direction: column; gap: 2rem; align-items: flex-start; }
  .footer-right { text-align: left; }
  .collection-meta { flex-wrap: wrap; gap: 1.5rem; }
  .search-bar { flex-wrap: wrap; }
}
