/* ==========================================================================
   docs.slashml.ai — Developer Documentation Portal
   / ml — Sanzo Wada Salvia Blue + Kronbergs Green Design System
   Inter Thin/Light (300) Typography + Cool Mist Porcelain Gallery Surfaces
   ========================================================================== */

:root,
html[data-theme="light"] {
  --salvia-blue: #3456ae;
  --salvia-blue-deep: #26428b;
  --salvia-blue-light: #4d6fc2;
  --slate-teal: #4e7c92;
  --kronbergs-green: #7a8b56;
  --kronbergs-green-deep: #5c6c3b;

  --slashml-blue: #3456ae;
  --slashml-blue-hover: #26428b;
  --slashml-blue-mid: #4d6fc2;
  --slashml-blue-soft: rgba(52, 86, 174, 0.08);
  --emerald: #5c6c3b;
  --emerald-soft: rgba(122, 139, 86, 0.14);
  --amber: #4e7c92;
  --amber-soft: rgba(78, 124, 146, 0.12);
  --danger: #9B2C2C;
  --danger-soft: rgba(155, 44, 44, 0.1);
  --purple: #3456ae;
  --purple-soft: rgba(52, 86, 174, 0.1);

  --bg-page: #f6f8fc;
  --bg-subtle: #edf1f8;
  --surface-card: #ffffff;
  --surface-pill: #eaf0f8;
  --surface-code: #f2f5fb;
  --surface-code-header: #e7edf7;
  --ink-strong: #132038;
  --ink-body: #324460;
  --ink-muted: #5e718d;
  --ink-subtle: #8496b0;

  --border-subtle: #dbe3f0;
  --border-strong: #c2cfe3;
  --border-rule-heavy: #3456ae;
  --shadow-sm: 0 2px 8px rgba(19, 32, 56, 0.04);
  --shadow-md: 0 12px 32px -8px rgba(19, 32, 56, 0.08);

  --font-serif: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-brand: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html[data-theme="dark"] {
  --slashml-blue: #7d9cf0;
  --slashml-blue-hover: #9bb4f8;
  --slashml-blue-mid: #4d6fc2;
  --slashml-blue-soft: rgba(125, 156, 240, 0.15);
  --emerald: #9db074;
  --emerald-soft: rgba(157, 176, 116, 0.16);
  --amber: #74a5bc;
  --amber-soft: rgba(116, 165, 188, 0.15);
  --danger: #E06C75;
  --danger-soft: rgba(224, 108, 117, 0.14);
  --purple: #9bb4f8;
  --purple-soft: rgba(155, 180, 248, 0.14);

  --bg-page: #0f1726;
  --bg-subtle: #152033;
  --surface-card: #19263c;
  --surface-pill: #20304b;
  --surface-code: #121c2e;
  --surface-code-header: #1a2740;
  --ink-strong: #f0f4fc;
  --ink-body: #cbd5e8;
  --ink-muted: #8ea0be;
  --ink-subtle: #647694;

  --border-subtle: #253552;
  --border-strong: #33476b;
  --border-rule-heavy: #7d9cf0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  font-size: 15.5px;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  background:
    radial-gradient(ellipse 90% 50% at 15% 0%, rgba(52, 86, 174, 0.06) 0%, transparent 65%),
    radial-gradient(ellipse 80% 50% at 88% 12%, rgba(122, 139, 86, 0.06) 0%, transparent 65%),
    var(--bg-page);
  color: var(--ink-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--slashml-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-pill);
  color: var(--ink-strong);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--ink-strong);
  font-size: 0.85rem;
}

/* Top Navbar — Salvia Blue + Kronbergs Green Glass Header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: linear-gradient(125deg, rgba(38, 66, 139, 0.92) 0%, rgba(52, 86, 174, 0.88) 48%, rgba(78, 124, 146, 0.86) 78%, rgba(92, 108, 59, 0.88) 100%);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 24px rgba(19, 32, 56, 0.12);
}

.docs-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-slashml {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: -0.04em;
}

.brand-docs-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.brand-sep {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.brand-slash-ml {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-link {
  font-size: 0.86rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-link:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
  color: #ffffff;
}

.header-cta-glass {
  background: rgba(255, 255, 255, 0.18) !important;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-weight: 500 !important;
  padding: 0.38rem 0.9rem !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 16px rgba(14, 34, 148, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.header-cta-glass:hover {
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.72);
  color: #ffffff !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8d88b;
  box-shadow: 0 0 8px rgba(184, 216, 139, 0.8);
}

.theme-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 2-Column Documentation Layout */
.docs-shell {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3rem;
  padding: 0 1.5rem;
}

/* Left Sidebar */
.docs-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 1.5rem 1rem 3rem 0;
  border-right: 1px solid var(--border-subtle);
}

.sidebar-search {
  margin-bottom: 1.25rem;
}

.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--ink-strong);
  outline: none;
}

.sidebar-search input:focus {
  border-color: var(--slashml-blue);
}

.nav-group {
  margin-bottom: 1.4rem;
}

.nav-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
  padding-left: 0.5rem;
}

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

.nav-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.38rem 0.6rem;
  border-radius: 6px;
  font-size: 0.87rem;
  color: var(--ink-body);
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item a:hover,
.nav-item a.active {
  background: var(--slashml-blue-soft);
  color: var(--slashml-blue);
  text-decoration: none;
  font-weight: 600;
}

/* Main Content */
.docs-main {
  padding: 2.25rem 0 5rem;
  max-width: 980px;
}

.doc-section {
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slashml-blue);
  margin-bottom: 0.4rem;
}

.doc-section h1 {
  font-family: var(--font-sans);
  font-size: 2.35rem;
  font-weight: 300;
  color: var(--ink-strong);
  letter-spacing: -0.028em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.doc-section h2 {
  font-family: var(--font-sans);
  font-size: 1.55rem;
  font-weight: 300;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0.75rem;
}

.doc-section h3 {
  font-family: var(--font-sans);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
  margin: 1.35rem 0 0.5rem;
}

.doc-lead {
  font-size: 1.06rem;
  color: var(--ink-body);
  margin-bottom: 1.5rem;
}

.doc-section p {
  margin-bottom: 0.9rem;
}

/* Callout Boxes */
.callout {
  padding: 1rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  margin: 1.25rem 0;
  font-size: 0.92rem;
}

.callout-info {
  border-left: 4px solid var(--slashml-blue);
}

.callout-success {
  border-left: 4px solid var(--emerald);
}

.callout-title {
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Code Blocks & Tabs */
.code-card {
  background: var(--surface-code);
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  margin: 1.1rem 0 1.5rem;
  box-shadow: var(--shadow-sm);
}

.code-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  background: var(--surface-code-header);
  border-bottom: 1px solid var(--border-subtle);
}

.code-tabs {
  display: flex;
  gap: 0.35rem;
}

.code-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
}

.code-tab.active {
  background: var(--surface-card);
  color: var(--slashml-blue);
  border-color: var(--border-subtle);
  font-weight: 600;
}

.code-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.copy-btn {
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  color: var(--ink-body);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--slashml-blue);
  color: var(--slashml-blue);
}

.code-pane {
  display: none;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  line-height: 1.55;
}

.code-pane.active {
  display: block;
}

/* Endpoint Reference Badges & Cards */
.endpoint-card {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-card);
  padding: 1.25rem;
  margin: 1.25rem 0;
  box-shadow: var(--shadow-sm);
}

.endpoint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.endpoint-title-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.endpoint-meta-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auth-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  background: var(--surface-pill);
  color: var(--ink-muted);
  border: 1px solid var(--border-subtle);
}

.copy-spec-btn {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  background: var(--slashml-blue-soft);
  color: var(--slashml-blue);
  border: 1px solid color-mix(in srgb, var(--slashml-blue) 28%, transparent);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.copy-spec-btn:hover {
  background: color-mix(in srgb, var(--slashml-blue) 18%, transparent);
}

.agent-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  border-radius: 10px;
  border: 1px solid rgba(52, 86, 174, 0.22);
  background: linear-gradient(135deg, rgba(52, 86, 174, 0.08) 0%, rgba(122, 139, 86, 0.08) 100%);
  box-shadow: var(--shadow-sm);
  margin: 1.25rem 0 1.75rem;
}

.agent-banner-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  background: var(--surface-card);
  color: var(--ink-strong);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.agent-pill:hover {
  border-color: var(--slashml-blue);
  color: var(--slashml-blue);
  text-decoration: none;
}

.req-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.opt-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-pill);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.method-badge,
.method-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.method-pill-sm {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.method-post {
  background: #3456ae;
  color: #FFFFFF;
  border: 1px solid #26428b;
}

.method-get {
  background: #5c6c3b;
  color: #FFFFFF;
  border: 1px solid #49562e;
}

.method-put {
  background: #4e7c92;
  color: #FFFFFF;
  border: 1px solid #3c6274;
}

.method-patch {
  background: #4d6fc2;
  color: #FFFFFF;
  border: 1px solid #3456ae;
}

.method-delete {
  background: #9B2C2C;
  color: #FFFFFF;
  border: 1px solid #7f2222;
}

html[data-theme="dark"] .method-post {
  background: rgba(59, 130, 246, 0.25);
  color: #93C5FD;
  border: 1px solid rgba(96, 165, 250, 0.55);
}

html[data-theme="dark"] .method-get {
  background: rgba(16, 185, 129, 0.25);
  color: #6EE7B7;
  border: 1px solid rgba(52, 211, 153, 0.55);
}

html[data-theme="dark"] .method-put {
  background: rgba(245, 158, 11, 0.25);
  color: #FCD34D;
  border: 1px solid rgba(251, 191, 36, 0.55);
}

html[data-theme="dark"] .method-patch {
  background: rgba(139, 92, 246, 0.28);
  color: #C4B5FD;
  border: 1px solid rgba(167, 139, 250, 0.55);
}

html[data-theme="dark"] .method-delete {
  background: rgba(239, 68, 68, 0.26);
  color: #FCA5A5;
  border: 1px solid rgba(248, 113, 113, 0.55);
}

.nav-item a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.38rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--ink-body);
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-route-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h2-with-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-strong);
}

/* Tables */
.doc-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-table th {
  background: var(--bg-subtle);
  color: var(--ink-strong);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

/* Right TOC */
.docs-toc {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  padding: 2rem 0;
  font-size: 0.82rem;
}

.toc-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-bottom: 0.65rem;
}

.toc-list {
  list-style: none;
  border-left: 1px solid var(--border-subtle);
}

.toc-list li a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.85rem;
  color: var(--ink-muted);
}

.toc-list li a:hover {
  color: var(--slashml-blue);
  text-decoration: none;
}

/* Quick Cards Grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.quick-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.1rem;
  background: var(--surface-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.quick-card:hover {
  border-color: var(--slashml-blue);
  transform: translateY(-2px);
  text-decoration: none;
}

.quick-card h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--ink-strong);
}

.quick-card p {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0;
}

@media (max-width: 1120px) {
  .docs-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}

@media (max-width: 780px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
  }
}
