:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;
  --primary-border: #bfdbfe;
  --success: #16a34a;
  --success-subtle: #f0fdf4;
  --warning: #d97706;
  --warning-subtle: #fffbeb;
  --danger: #dc2626;
  --danger-subtle: #fef2f2;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --sidebar-width: 270px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

/* Layout */
.app-container {
  min-height: 100vh;
  width: 100%;
}

/* Mobile Header (visible on screens <= 900px) */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
  z-index: 50;
  align-items: center;
  justify-content: space-between;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.05rem;
}

.mobile-menu-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  z-index: 40;
  transition: transform 0.25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.75rem 1rem;
  text-decoration: none !important;
  color: var(--text-main);
}

.brand:hover,
.brand:focus {
  text-decoration: none !important;
  color: var(--text-main);
}

.brand:hover .brand-title {
  color: var(--primary);
  text-decoration: none !important;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background-color: var(--primary-subtle);
  color: var(--primary);
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid var(--primary-border);
}

/* Segmented Documentation Switcher */
.doc-switcher {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
  gap: 3px;
}

.doc-switcher-btn {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.doc-switcher-btn:hover {
  color: var(--text-main);
  text-decoration: none !important;
}

.doc-switcher-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.35rem;
}

.nav-links {
  list-style: none;
}

.nav-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.nav-item a:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item a.active {
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.nav-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

/* Badges */
.badge-get { background-color: #e0f2fe; color: #0369a1; }
.badge-post { background-color: #dcfce7; color: #15803d; }
.badge-delete { background-color: #fee2e2; color: #b91c1c; }
.badge-tool { background-color: #e0f2fe; color: #0369a1; }
.badge-client { background-color: #fef3c7; color: #92400e; }
.badge-guide { background-color: #dcfce7; color: #15803d; }

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 3rem 4rem;
  max-width: 1100px;
  box-sizing: border-box;
}

.doc-header {
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2.5rem;
}

.doc-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.doc-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 820px;
  line-height: 1.6;
}

.header-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.meta-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 0.8125rem;
}

.meta-label {
  color: var(--text-light);
  font-weight: 500;
}

.meta-value {
  font-weight: 600;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

/* Sections */
.doc-section {
  margin-bottom: 4rem;
  scroll-margin-top: 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.subsection-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Endpoint & Feature Cards */
.endpoint-card,
.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
  overflow: hidden;
  scroll-margin-top: 2rem;
}

.endpoint-header,
.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: #fafbfc;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.endpoint-left,
.feature-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.http-method {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.http-method.get { background-color: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.http-method.post { background-color: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.http-method.delete { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.feature-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.feature-card:not([id^="tool-"]) .feature-tag {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.feature-name {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

[id^="tool-"] .feature-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: normal;
}

.endpoint-credit,
.feature-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.endpoint-credit.free,
.feature-badge.free {
  background-color: var(--success-subtle);
  color: var(--success);
  border-color: #bbf7d0;
}

.endpoint-credit.cost,
.feature-badge.cost {
  background-color: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

.endpoint-body,
.feature-body {
  padding: 1.5rem;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.grid-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

th {
  background-color: var(--bg-subtle);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--text-muted);
}

tr:last-child td {
  border-bottom: none;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  background-color: var(--bg-subtle);
  color: #db2777;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

td code {
  color: #0f172a;
  font-weight: 600;
}

.param-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.param-required {
  font-size: 0.7rem;
  font-weight: 700;
  color: #dc2626;
  background-color: #fee2e2;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.param-optional {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  background-color: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Code Blocks */
.code-tabs {
  background-color: var(--code-bg);
  border-radius: 8px;
  margin: 1.25rem 0;
  overflow: hidden;
  border: 1px solid #1e293b;
}

.tab-header,
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1e293b;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #334155;
}

.tab-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.copy-button {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #475569;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-button:hover {
  background: #475569;
  color: #ffffff;
}

pre {
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--code-text);
  background-color: var(--code-bg);
  border-radius: 0 0 8px 8px;
  box-sizing: border-box;
  max-width: 100%;
}

pre code {
  font-family: inherit;
  font-size: inherit;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  color: inherit;
}

/* Syntax Highlighting Tokens */
.hljs-keyword, .hljs-selector-tag, .hl-keyword { color: #f472b6 !important; font-weight: 600; }
.hljs-built_in, .hljs-title.function_, .hljs-name { color: #60a5fa !important; font-weight: 500; }
.hljs-type, .hljs-class { color: #38bdf8 !important; }
.hljs-string, .hl-string { color: #34d399 !important; }
.hljs-number, .hl-number { color: #fbbf24 !important; }
.hljs-literal, .hljs-boolean { color: #f87171 !important; font-weight: 600; }
.hljs-attr, .hljs-attribute { color: #7dd3fc !important; font-weight: 500; }
.hljs-variable, .hljs-template-variable { color: #a5b4fc !important; }
.hljs-comment, .hljs-quote, .hl-comment { color: #64748b !important; font-style: italic; }
.hljs-punctuation, .hljs-meta { color: #94a3b8 !important; }
.hljs-params { color: #cbd5e1 !important; }

/* Alerts */
.alert-box,
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  border-left: 4px solid;
}

.alert-info,
.alert-box.info,
.alert.alert-info {
  background-color: var(--primary-subtle);
  border-color: var(--primary);
  color: #1e3a8a;
}

.alert-warning,
.alert-box.warning,
.alert.alert-warning {
  background-color: var(--warning-subtle);
  border-color: var(--warning);
  color: #78350f;
}

.alert-success,
.alert-box.success,
.alert.alert-success {
  background-color: var(--success-subtle);
  border-color: var(--success);
  color: #166534;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

/* Headers, Titles, Brand & Navigation - Never show underline */
h1, h2, h3, h4, h5, h6,
.doc-title, .doc-subtitle, .section-title, .brand-title, .nav-header,
header, .doc-header {
  text-decoration: none !important;
}

h1:hover, h2:hover, h3:hover, h4:hover, h5:hover, h6:hover,
.doc-title:hover, .doc-subtitle:hover, .section-title:hover, .brand-title:hover, .nav-header:hover,
header:hover, .doc-header:hover,
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
.section-title a, .section-title a:hover,
.brand, .brand:hover, .brand:focus, .brand *, .brand:hover *,
.nav-item a, .nav-item a:hover, .nav-item a:focus, .nav-item a.active,
.copy-button, .copy-button:hover,
.nav-badge, .nav-badge:hover {
  text-decoration: none !important;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.status-valid { background-color: #dcfce7; color: #166534; }
.status-invalid { background-color: #fee2e2; color: #991b1b; }
.status-disposable { background-color: #ffedd5; color: #9a3412; }
.status-role { background-color: #e0e7ff; color: #3730a3; }
.status-catchall { background-color: #fef3c7; color: #854d0e; }
.status-inboxfull { background-color: #f3e8ff; color: #6b21a8; }
.status-unknown { background-color: #f1f5f9; color: #475569; }

/* Footer */
footer.doc-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 0.875rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    top: 60px;
    height: calc(100vh - 60px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 5rem 1.25rem 2rem;
  }
}
