
/* =====================================================
   DESIGN TOKENS
===================================================== */

:root {
  --brand-900: #1e1b4b;
  --brand-700: #4338ca;
  --brand-600: #4f46e5;
  --brand-500: #6366f1;
  --brand-100: #eef2ff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --surface-main: #ffffff;
  --surface-soft: #f8fafc;

  --border-light: #e5e7eb;
}

/* =====================================================
   DARK THEME TOKENS
===================================================== */

:root[data-bs-theme="dark"] {
  --bg-page: #0b1220;
  --bg-surface: #111827;
  --bg-surface-soft: #0f172a;

  --text-primary: #e5e7eb;
  --text-secondary: #cbd5f5;
  --text-muted: #94a3b8;

  --border-subtle: rgba(255,255,255,.08);
  --accent: #6366f1;
}

/* =====================================================
   BRANDING LOGO
===================================================== */
.fredi-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  text-decoration: none;
}

/* Logo */
.fredi-brand img {
  height: 26px;
  width: auto;
}

/* Subtitle */
.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #475569;
  margin-top: 4px; 
}

/* Dark mode */
:root[data-bs-theme="dark"] .brand-subtitle {
  color: #94a3b8;
}

.fredi-brand {
  padding-right: 24px;
  border-right: 1px solid #cbd5e1;
}


/* =====================================================
   GLOBAL BASE
===================================================== */

/* Global layout reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  color: var(--text-primary);
  scroll-padding-top: 72px;
  background-color: var(--surface-soft);
}

:root[data-bs-theme="dark"] body {
  background-color: var(--bg-page);
}

article {
  background: var(--surface-main);
  border-radius: 12px;
  padding: 32px 40px;
  box-shadow: 0 10px 24px rgba(0,0,0,.05);
}

article p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* =====================================================
   TYPOGRAPHY
===================================================== */

h1 { 
  font-size: 34px; 
  letter-spacing: -0.02em; 
}

h2 {
  font-size: 26px;
  margin-top: 48px;
  padding-top: 16px;
  padding-bottom: 16px;
  border-top: 1px solid var(--border-light);
}

h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
}

h4 { 
  font-size: 18px; 
  margin-top: 24px;
}

h5 { 
  font-size: 16px; 
  margin-top: 20px;
}

h6 { 
  font-size: 14px; 
  margin-top: 16px;
  color: var(--text-muted);
}

table th {
  font-size: 14px;
  font-weight: 600;
}

/* =====================================================
   Article DARK THEME OVERRIDES
===================================================== */

:root[data-bs-theme="dark"] article {
  background: var(--bg-surface);
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
}

:root[data-bs-theme="dark"] article p {
  color: var(--text-secondary);
}

:root[data-bs-theme="dark"] h1,
:root[data-bs-theme="dark"] h2,
:root[data-bs-theme="dark"] h3 {
  color: var(--text-primary);
}

/* =====================================================
   NAVBAR
===================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #dce3eb;
  border-bottom: 1px solid #cbd5e1;
}

.navbar-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
}

.navbar-nav .nav-item {
  margin-left: 12px;
}

.navbar .nav-link {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 500;
  color: #334155;
}

.navbar .nav-link:hover {
  background: rgba(15,23,42,.08);
  color: #0f172a;
}

/* Header search (content pages only) */
.navbar .search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar .search input {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

/* =====================================================
   NAVBAR DROPDOWN – FIT CONTENT
===================================================== */

.navbar .dropdown-menu {
  min-width: max-content;      /* 🔑 fit longest item */
  width: auto;
  padding: 8px 5px;
}

/* Prevent ugly word breaks */
.navbar .dropdown-item {
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 14px;
}

/* =====================================================
   Navbar DARK THEME OVERRIDES
===================================================== */

:root[data-bs-theme="dark"] .navbar {
  background: #020617;
  border-bottom: 1px solid var(--border-subtle);
}

:root[data-bs-theme="dark"] .navbar .nav-link {
  color: #c7d2fe;
}

:root[data-bs-theme="dark"] .navbar .nav-link:hover {
  background: rgba(99,102,241,.15);
  color: #ffffff;
}


/* =====================================================
   LANDING PAGE (SCOPED)
===================================================== */

  .landing-page + .hero {
    position: relative;
    text-align: center;
    padding: 96px 20px 80px;
    min-height: 1vh;
    background:
      linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)),
      url("https://fredi.in/wp-content/uploads/2025/01/features.webp")
      center / cover no-repeat;
    color: #fff;
    margin-top: 0;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: -1px; /* removes tiny top seam */
    border-radius: 0;
  }

  /* Remove top spacing on landing page only */

  .landing-page {
    display: none;
  }

/* Remove spacing ONLY on landing page */
body[data-layout="landing"] > main {
  padding-top: 0 !important;
}

/* Restore spacing for normal pages */
body:not([data-layout="landing"]) > main {
  padding-top: 32px;
}
  body[data-layout="landing"] article {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* Remove white gap on landing page only */

  body > main > .content > article:has(.landing-page) {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

.landing-page + .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(99,102,241,.18),
    transparent 60%
  );
  pointer-events: none;
}

.landing-page + .hero h1 {
  font-size: 3rem;
  font-weight: 700;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
  max-width: 720px;
  margin: 12px auto 36px;
  font-size: 18px;
  line-height: 1.6;
  color: #e5e7eb;
}

.landing-page + .hero p {
  color: #e5e7eb;
  margin-bottom: 32px;
}

/* Hero search */
.landing-page + .hero .search-box {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.landing-page + .hero .search-box input {
  width: 100%;
  padding: 18px 56px 18px 20px; /* space for button */
  border-radius: 14px;
  border: none;
  font-size: 17px;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
}

.hero .search-box,
.hero input[type="search"] {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  background: #ffffff;
  color: #0f172a;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35);
  border-radius: 14px;
}

.hero input[type="search"]::placeholder {
  color: #64748b;
}

.landing-page + .hero .search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  width: 40px;
  border: none;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.landing-page + .hero .search-box button:hover {
  background: #f1f5f9;
}

.landing-page + .hero .search-box button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}

.hero-hints {
  margin-top: 16px;
  font-size: 16px;
  color: #ffffff;
}

.hero-hints a {
  color: #ffffff;
  font-weight: 500;
  margin: 0 6px
}

.hero-hints span {
  cursor: pointer;
  text-decoration: underline;
}

a.hint-link {
  color: #e5e7eb;
}

/* =====================================================
   LANDING SECTIONS
===================================================== */

.landing-page ~ section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px;
}

.landing-page ~ section h2 {
  font-size: 20px;
  border: none;
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: #ffffff79;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 24px;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card.primary {
  border-color: var(--brand-600);
  border-top: 4px solid #fca311;
  background: linear-gradient(
  180deg,
  var(--brand-100),
  #ffffff
  );
}

.card.primary h3 {
  font-weight: 700;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
}

.landing-page ~ section .card a:hover {
  color: var(--brand-700);
  transform: translateX(2px);
  text-decoration: none;
  border-bottom: 1px solid var(--brand-600);
  background: rgba(99,102,241,.12);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* CTA always at bottom */
.landing-page ~ section .card a {
  margin-top: auto;
  font-weight: 600;
  color: var(--brand-600);
  position: relative;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background: var(--brand-600);
  transition: width .2s ease;
}

.card a:hover::after {
  width: 100%;
}

/* =====================================================
   LANDING PAGE – SECTION HEADING COLOR
===================================================== */

.landing-page ~ section h1,
.landing-page ~ section h2{
  color: #4f46e5; /* brand-600 */
}

/* =====================================================
   Landing DARK THEME OVERRIDES
===================================================== */

:root[data-bs-theme="dark"] .card {
  background: var(--bg-surface);
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
}

/* =====================================================
   API ENDPOINTS
===================================================== */

/* API Endpoint Container */

.api-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 20px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 20px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Method Badge Base */

.method {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
}

/* Swagger-style colors */

.method.get {
  background-color: #61affe;
}

.method.post {
  background-color: #49cc90;
}

.method.put {
  background-color: #fca130;
}

.method.delete {
  background-color: #f93e3e;
}

.method.patch {
  background-color: #50e3c2;
}

/* Endpoint URL */

.api-endpoint .url {
  font-family: monospace;
  font-size: 14px;
  color: #1e293b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 4px;
}

.toggle-box summary {
  background: #ECECFF;
  color: black;
  padding: 8px 14px;
  border-radius: 6px;
  width: fit-content;
  font-size: 14px;
}

/* ── Schema tree ─────────────────────────────────────── */

.schema-search {
  margin-bottom: 10px;
}

.schema-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  outline: none;
}

.schema-search input:focus {
  border-color: #38bdf8;
}

.tree-controls { display: flex; gap: 8px; margin-bottom: 10px; }

.tree-controls button {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
  transition: background .15s;
}

.tree-controls button:hover { background: #c8ccd8; }

.json-explorer {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  overflow-x: auto;
}

.json-explorer ul {
  list-style: none;
  margin: 0;
  padding-left: 18px;
  position: relative;
}

.json-explorer ul::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  border-left: 1px dashed #cbd5e1;
}

.json-explorer li {
  position: relative;
}

.json-explorer li::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 12px;
  width: 10px;
  border-top: 1px dashed #cbd5e1;
}

.json-explorer > ul { padding-left: 0; border-left: none; }

.tree-row {
  display: block;
  padding: 6px 4px;
  border-radius: 5px;
  cursor: pointer;
}

.tree-row:hover { background: #f8fafc; }

.tree-toggle {
  color: #94a3b8;
  font-size: 10px;
  min-width: 12px;
  cursor: pointer;
}

.tree-label { color: #0284c7; font-weight: 500; }

.tree-type {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.type-string  { background: #f3e8ff; color: #7c3aed; }
.type-number  { background: #fff7ed; color: #c2410c; }
.type-boolean { background: #f0fdf4; color: #15803d; }
.type-object  { background: #eff6ff; color: #1d4ed8; }
.type-array   { background: #fdf2f8; color: #9d174d; }

.tree-desc { font-size: 14px; color: #94a3b8; font-family: 'Segoe UI', sans-serif; }

.tree-required {
  font-size: 10px;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 600;
}

.tree-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-meta {
  padding-left: 22px;
  margin-top: 3px;
}

.tree-desc {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.4;
}

.tree-example {
  font-size: 12px;
  margin-top: 3px;
  color: #334155;
}

.tree-example code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: JetBrains Mono, monospace;
}

/* ================================
   WHAT'S NEW SECTION
================================ */

.whats-new {
  margin-top: 2rem;
}

.whats-new h2 {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

/* Card Meta Row */
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Badge Base */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* Badge Variants */
.enhancement {
  background: #e0f2fe;
  color: #0369a1;
}

.improvement {
  background: #fef3c7;
  color: #92400e;
}

.feature {
  background: #dcfce7;
  color: #166534;
}

.tool {
  background: #ede9fe;
  color: #5b21b6;
}

/* Date */
.date {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Title */
.card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

/* Description */
.card p {
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 1rem;
}

/* CTA always at bottom */
.link {
  margin-top: auto;
  font-weight: 600;
  color: var(--brand-600);
  position: relative;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background: var(--brand-600);
  transition: width .2s ease;
}

.link:hover::after {
  width: 100%;
}

/* Ribbon */
.ribbon {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 8px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 8px;
}

/* =====================================================
   CARRIER HEADER
===================================================== */

.carrier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
}

.carrier-header h1 {
  margin: 0;
}

.carrier-header p {
  margin-top: 8px;
  max-width: 600px;
  color: var(--text-secondary);
}

.carrier-search input {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  min-width: 240px;
}

/* Wrapper */
.search-input-wrapper {
  position: relative;
  display: inline-block;
}

/* Input */
.search-input-wrapper input {
  padding: 10px 40px 10px 14px; /* right padding for X */
  border-radius: 12px;
  border: 1px solid var(--border-light);
  min-width: 260px;
  background: var(--surface-main);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* Focus state */
.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* Clear Button */
.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 0;
  line-height: 1;
}

/* Hover effect */
.search-clear:hover {
  color: var(--text-primary);
}

/* =====================================================
   CARRIER GRID
===================================================== */

.carrier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

/* =====================================================
   CARRIER CARD
===================================================== */

.carrier-card {
  background: var(--surface-main);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp .5s ease forwards;
  transition:
    transform .2s ease,
    box-shadow .25s ease,
    border-color .2s ease;
}

/* Hover */
.carrier-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(15,23,42,.08);
  border-color: rgba(99,102,241,.35);
}

/* Top Accent */
.carrier-card.compact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--brand-600),
    var(--brand-500)
  );
  opacity: 0;
  transition: opacity .2s ease;
}

.carrier-card.compact:hover::before {
  opacity: 1;
}

/* Logo */
.carrier-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  margin-bottom: 14px;
  filter: grayscale(100%);
  opacity: 0.9;
  transition: all .2s ease;
}

.carrier-card:hover .carrier-logo {
  filter: grayscale(0%);
  opacity: 1;
}

/* Text */
.carrier-region {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.carrier-feature {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.carrier-labels {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Badges */
.carrier-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.carrier-badges span {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}

/* CTA */
.carrier-link {
  margin-top: auto;
  font-weight: 600;
  font-size: 13px;
  color: var(--brand-600);
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.carrier-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background: var(--brand-600);
  transition: width .2s ease;
}

.carrier-link:hover::after {
  width: 100%;
}

/* Dark Mode Card */
:root[data-bs-theme="dark"] .carrier-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

:root[data-bs-theme="dark"] .carrier-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
  border-color: rgba(99,102,241,.4);
}

/* =====================================================
   CARRIER DETAILS TABLE
===================================================== */

.carrier-details {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 3rem;
}

.carrier-details th {
  width: 220px;
  text-align: left;
  padding: 12px;
  background: #f3f4f6;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  vertical-align: top;
}

.carrier-details td {
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  border-bottom: 1px solid var(--border-light);
}

.carrier-details tr:nth-child(even) td {
  background: rgba(0,0,0,0.015);
}

.carrier-cta {
  font-weight: 600;
  color: var(--brand-600);
  font-size: 14px;
}

/* Dark Table */
:root[data-bs-theme="dark"] .carrier-details th {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

:root[data-bs-theme="dark"] .carrier-details td {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

/* =====================================================
   CARRIER CONTROLS (RIGHT ALIGNED + SMART ACTION STYLE)
===================================================== */

.carrier-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;   /* 🔥 Perfect vertical alignment */
  margin-top: 48px;
  margin-bottom: 24px;
}

/* Remove default h2 border from this section */
.carrier-details-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}

.carrier-controls {
  display: flex;
  justify-content: flex-end;   /* 🔥 Right align */
  gap: 12px;
  margin-bottom: 24px;
}

/* Button base */
.carrier-control-btn {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all .2s ease;
}

/* Hover */
.carrier-control-btn:hover {
  border-color: var(--brand-500);
  color: var(--brand-600);
}

/* ACTIVE STATE (when clicked) */
.carrier-control-btn.active-expand {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #ffffff;
}

.carrier-control-btn.active-collapse {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

/* Dark mode */
:root[data-bs-theme="dark"] .carrier-control-btn {
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

:root[data-bs-theme="dark"] .carrier-control-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =====================================================
   CARRIER ACCORDION
===================================================== */

.carrier-accordion {
  border-radius: 16px;
  margin-bottom: 18px;
  background: var(--surface-main);
  transition: box-shadow .2s ease;
}

.carrier-accordion[open] {
  box-shadow: 0 18px 40px rgba(15,23,42,.06);
}

.carrier-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  background: #f3f4f6;
  transition: background 0.2s ease;
}

.carrier-accordion summary:hover {
  background: #e5e7eb;
}

.carrier-accordion summary::-webkit-details-marker {
  display: none;
}

.carrier-accordion summary::after {
  content: "▸";
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.carrier-accordion[open] summary::after {
  transform: rotate(90deg);
}

.carrier-content {
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
}

/* Dark Accordion */
:root[data-bs-theme="dark"] .carrier-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

:root[data-bs-theme="dark"] .carrier-accordion summary {
  background: var(--bg-surface-soft);
  color: var(--text-primary);
}

:root[data-bs-theme="dark"] .carrier-content {
  border-top: 1px solid var(--border-subtle);
}

/* =====================================================
   ANIMATIONS
===================================================== */

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   SIDEBAR & IN-ARTICLE TOC
===================================================== */

/* Reduce left TOC width */
@media (min-width: 768px) {

  body:not([data-search]) > main > .toc-offcanvas {
    flex: 0 0 240px !important;   /* fixed width */
    max-width: 240px !important;
  }

}

.sidetoc {
  background: var(--surface-soft);
  border-right: 1px solid var(--border-light);
}

.toc a.active {
  color: var(--brand-600);
  border-left: 2px solid var(--brand-600);
}

.toc ul {
    font-size: 16px
}
.affix {
    font-size: 16px;
}

.toc .expand-stub::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-right: 8px;
  position: relative;
  top: -1px;
}

/* When expanded */
.toc li.expanded > .expand-stub::before {
  transform: rotate(45deg);
}

.toc .expand-stub:hover::before {
  border-color: #6366f1;
}

/* =====================================================
   SIDEBAR & TOC Dark THEME OVERRIDES
===================================================== */

:root[data-bs-theme="dark"] .sidetoc {
  background: var(--bg-surface-soft);
  border-right: 1px solid var(--border-subtle);
}

:root[data-bs-theme="dark"] .toc a {
  color: var(--text-muted);
}

:root[data-bs-theme="dark"] .toc a:hover {
  color: var(--text-primary);
}

:root[data-bs-theme="dark"] .toc a.active {
  color: var(--accent);
  border-left: 2px solid var(--accent);
  background: linear-gradient(
    to right,
    rgba(99,102,241,.15),
    transparent
  );
}

:root[data-bs-theme="dark"] .toc .expand-stub::before {
  border-color: #cbd5f5;
}

/* =====================================================
   BACK TO TOP (ABOVE FOOTER)
   ===================================================== */

.back-to-top-wrapper {
  background: #f1f5f9;   /* lighter than footer */
  text-align: center;
  border-top: 1px solid #e5e7eb;
  padding: 10px 0;
}

.back-to-top {
  font-size: 14px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
}

.back-to-top:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* =====================================================
   FOOTER – CENTERED & STACKED
   ===================================================== */

/* Footer base */
.footer {
  background: #0f172a;
  margin-top: 0;
  border-top: none;
}

/* Center footer content container */
.footer .container-xxl {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Center column group */
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 96px;
  padding: 40px 0 24px;
  text-align: center;
  flex-wrap: wrap;
}

/* Footer columns */
.footer-section {
  min-width: 160px;
}

.footer-section strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #dce3eb;
}

.footer-section a {
  display: block;
  font-size: 14px;
  line-height: 1.8;
  color: #a0aec0;
  text-decoration: none;
}

.footer-section a:hover {
  color: #dce3eb;
  text-decoration: underline;
}

/* Copyright BELOW columns */
.footer-copy {
  margin-top: 16px;
  padding-bottom: 32px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}

/* =====================================================
   DOCFX FOOTER OVERRIDE (CRITICAL)
===================================================== */

body > footer,
body[data-layout="landing"] footer {
  height: auto !important;      /* 🔥 remove hard cap */
  padding: 32px 0 24px !important;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {

  article { padding: 24px; }
  .footer-nav { gap: 32px; }

  /* Allow DocFX to stack nav items */
  .navbar-nav {
    flex-direction: column !important;
    align-items: flex-start;
    width: 100%;
  }

  .navbar-nav .nav-item {
    margin-left: 0;
    width: 100%;
  }

  .navbar-nav .nav-link {
    width: 100%;
    padding: 10px 16px;
    border-radius: 0;
  }

  .navbar .container-xxl {
    flex-wrap: wrap;
    align-items: center;
  }

  .navbar-brand {
    margin-right: auto;
  }

  .navbar .search {
    width: 100%;
    margin: 8px 0;
  }

  .navbar .search input {
    width: 100%;
  }

  .navbar-collapse {
    flex-grow: 1;
  }

  .navbar .dropdown-menu {
    min-width: 100%;
    width: 100%;
  }

  .navbar .dropdown-item {
    white-space: normal; /* allow wrapping on mobile */
  }
}

/* =====================================================
   API TRY-IT WIDGET
===================================================== */

.try-container {
  display: block;
}

.try-left {
  flex: 2;
}

.try-right {
  flex: 1;
}

.try-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #475569;
  margin-bottom: 6px;
}

.try-textarea {
  width: 100%;
  height: 280px;
  background: #07090f;
  border: 1px solid #1e2d3d;
  border-radius: 7px;
  padding: 11px;
  color: #c9d1d9;
  font-size: 12px;
  font-family: monospace;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.try-textarea:focus { border-color: #38bdf8; }

.try-input {
  width: 100%;
  background: #0a0f1a;
  border: 1px solid #1e2d3d;
  border-radius: 7px;
  padding: 9px 11px;
  color: #f1f5f9;
  font-size: 13px;
  font-family: monospace;
  outline: none;
}

.try-input:focus { border-color: #38bdf8; }

.try-button {
  width: 100%;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  border: none;
  border-radius: 8px;
  padding: 11px;
  color: #000;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: opacity .2s;
  letter-spacing: .02em;
}

.try-button:hover { opacity: .88; }
.try-button:disabled { opacity: .45; cursor: not-allowed; }

.try-status {
  font-size: 12.5px;
  font-family: monospace;
  padding: 7px 11px;
  border-radius: 7px;
  display: none;
}

.try-status.ok   { background: #052e16; color: #4ade80; border: 1px solid #4ade8044; display: block; }
.try-status.err  { background: #1f0808; color: #f87171; border: 1px solid #f8717144; display: block; }
.try-status.info { background: #001824; color: #38bdf8; border: 1px solid #38bdf844; display: block; }

.try-response {
  background: #07090f;
  border: 1px solid #1e2d3d;
  border-radius: 8px;
  padding: 14px;
  color: #c9d1d9;
  font-size: 12px;
  font-family: monospace;
  line-height: 1.7;
  overflow-x: auto;
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-all;
}

.try-hint {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.6;
}

.try-hint code {
  background: #1e293b;
  color: #38bdf8;
  padding: 1px 5px;
  border-radius: 4px;
}

.api-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: start;
}

.api-content {
  min-width: 0;
  padding: 10px;
}

.api-try {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #0f172a;
  border-left: 1px solid #1e293b;
  border-radius: 12px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Try Header */

.try-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.try-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.expand-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: transform .2s ease;
}

.expand-btn:hover {
  transform: scale(1.1);
}

/* Animate grid resize */
.api-layout {
  transition: grid-template-columns .3s ease;
}

/* Expanded width */
.api-layout.expanded {
  grid-template-columns: 1fr 750px;
}

.api-layout.expanded .api-try {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 750px;
  z-index: 2000;
  border-radius: 0;
  box-shadow: -20px 0 50px rgba(0,0,0,.25);
}


.label-download {
  margin-top: 10px;
}

.download-label-btn {
  width: 100%;
  background: #111827;
  border: 1px solid #1e2d3d;
  border-radius: 8px;
  padding: 10px 12px;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: all .18s ease;
}

/* hover */
.download-label-btn:hover {
  background: #1f2937;
  border-color: #38bdf8;
  color: #38bdf8;
}

/* active click */
.download-label-btn:active {
  transform: translateY(1px);
}

/* Dark theme overrides for try-it widget */

:root[data-bs-theme="dark"] .api-try {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
}

/* Mobile view */
@media (max-width: 1100px) {
  .api-layout {
    grid-template-columns: 1fr;
  }

  .api-try {
    position: relative;
    top: auto;
  }
}
