/**
 * LankaAds v1.0.0 Customer Documentation Stylesheet
 * 100% Offline — Zero external CDN dependencies
 */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Color Palette */
  --color-primary: #008a5e;
  --color-primary-dark: #006847;
  --color-primary-light: #e6f4ea;
  --color-accent: #f59e0b;
  --color-accent-light: #fef3c7;

  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-dark: #cbd5e1;

  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-subtle: #64748b;

  --color-code-bg: #1e293b;
  --color-code-text: #f8fafc;

  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-success-text: #065f46;

  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-warning-text: #92400e;

  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-danger-text: #991b1b;

  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --color-info-text: #1e40af;

  /* Dimensions */
  --sidebar-width: 300px;
  --header-height: 64px;
  --content-max-width: 1080px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Dark Mode Palette */
[data-theme="dark"] {
  --color-primary: #10b981;
  --color-primary-dark: #059669;
  --color-primary-light: rgba(16, 185, 129, 0.15);
  --color-accent: #fbbf24;
  --color-accent-light: rgba(251, 191, 36, 0.15);

  --color-bg: #0b1120;
  --color-surface: #131c2e;
  --color-surface-hover: #1e293b;
  --color-border: #233044;
  --color-border-dark: #334155;

  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-subtle: #64748b;

  --color-code-bg: #0f172a;
  --color-code-text: #e2e8f0;

  --color-success-bg: rgba(6, 95, 70, 0.25);
  --color-success-border: #047857;
  --color-success-text: #6ee7b7;

  --color-warning-bg: rgba(146, 64, 14, 0.25);
  --color-warning-border: #b45309;
  --color-warning-text: #fde68a;

  --color-danger-bg: rgba(153, 27, 27, 0.25);
  --color-danger-border: #b91c1c;
  --color-danger-text: #fca5a5;

  --color-info-bg: rgba(30, 64, 175, 0.25);
  --color-info-border: #1d4ed8;
  --color-info-text: #93c5fd;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] code {
  background: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .code-header {
  background: #090e17;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .doc-table th {
  background: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .doc-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .badge-neutral {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

[data-theme="dark"] .lightbox-content {
  background: #131c2e;
}

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

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  max-width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.doc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
}

.brand-logo-badge {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  padding: 6px 12px;
  border-radius: 6px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.version-badge {
  font-size: 12px;
  font-weight: 600;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 138, 94, 0.2);
}

.header-search {
  flex: 1;
  max-width: 460px;
  margin: 0 24px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--color-text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 36px;
  font-size: 13.5px;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: all 0.15s ease;
}

.search-input:focus {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 138, 94, 0.15);
}

.search-shortcut-hint {
  position: absolute;
  right: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--color-text-subtle);
  pointer-events: none;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 101;
}

.search-results-dropdown.active {
  display: block;
}

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  display: block;
  text-decoration: none;
  color: var(--color-text);
  font-size: 13.5px;
  transition: background 0.15s ease;
}

.search-result-item:hover, .search-result-item.highlighted {
  background: var(--color-surface-hover);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-section {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 2px;
}

.search-result-title {
  font-weight: 600;
  color: var(--color-text);
}

.search-result-snippet {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.search-empty {
  padding: 18px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border-color: var(--color-primary);
}

.theme-toggle-btn:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 138, 94, 0.2);
}

.theme-toggle-btn .sun-icon {
  display: none;
}
.theme-toggle-btn .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
  color: #fbbf24;
}
[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.header-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
}

/* Back to Top Floating Button */
.back-to-top-btn {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.15s ease, color 0.15s ease;
  z-index: 95;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .back-to-top-btn {
    transition: none;
  }
}

/* Layout */
.doc-layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
  max-width: 100%;
}

/* Sidebar */
.doc-sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-dark) transparent;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 24px 16px;
  flex-shrink: 0;
}

.doc-sidebar::-webkit-scrollbar {
  width: 6px;
}

.doc-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.doc-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 3px;
}

.doc-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-border-dark);
}

.sidebar-group {
  margin-bottom: 24px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  padding: 0 10px 8px 10px;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.sidebar-link.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--color-border);
  color: var(--color-text-subtle);
}

/* Main Content */
.doc-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px;
  display: flex;
  justify-content: center;
}

.doc-content {
  width: 100%;
  max-width: var(--content-max-width);
}

/* Typography */
h1.doc-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.25;
  color: var(--color-text);
  margin-bottom: 12px;
}

p.doc-subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  line-height: 1.55;
}

.doc-section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

h2.section-heading {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

h2.section-heading .heading-anchor {
  color: var(--color-text-subtle);
  opacity: 0;
  text-decoration: none;
  font-weight: 400;
  font-size: 18px;
  transition: opacity 0.15s ease;
}

h2.section-heading:hover .heading-anchor {
  opacity: 1;
}

h3.sub-heading {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--color-text);
  margin: 28px 0 12px 0;
}

h4.card-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

p {
  margin-bottom: 16px;
  color: var(--color-text);
}

/* Cards & Callouts */
.callout {
  padding: 16px 18px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid;
  font-size: 14px;
  line-height: 1.6;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info-text);
}

.callout-success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

.callout-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

.callout-danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 20px 0;
}

.grid-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.grid-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* Steps Walkthrough */
.step-container {
  margin: 32px 0;
  position: relative;
  padding-left: 40px;
}

.step-container::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.step-item-block {
  position: relative;
  margin-bottom: 36px;
}

.step-badge {
  position: absolute;
  left: -40px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--color-bg);
}

.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.step-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

/* Tables */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.doc-table th {
  background: var(--color-surface-hover);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

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

.doc-table tr:hover td {
  background: #fbfcfe;
}

/* Code & Snippets */
p, li, td, th {
  overflow-wrap: break-word;
}

code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #0f172a;
  word-break: break-word;
  overflow-wrap: break-word;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  border-radius: 0;
  word-break: normal;
  overflow-wrap: normal;
}

.code-block-wrapper {
  position: relative;
  margin: 18px 0;
  border-radius: 8px;
  background: var(--color-code-bg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 100%;
  min-width: 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: #94a3b8;
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 8px;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-code-text);
  -webkit-overflow-scrolling: touch;
}

/* Image Figures */
.doc-figure {
  margin: 22px 0;
  text-align: center;
}

.figure-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
}

.figure-wrapper img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: transform 0.2s ease;
}

.figure-wrapper:hover img {
  transform: scale(1.008);
}

.figure-caption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--color-text-subtle);
  font-style: italic;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.88);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 92vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
  padding: 4px;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success-text); border: 1px solid var(--color-success-border); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border: 1px solid var(--color-warning-border); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger-text);  border: 1px solid var(--color-danger-border); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info-text);    border: 1px solid var(--color-info-border); }
.badge-neutral { background: var(--color-surface-hover); color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* Quick Navigation Cards */
.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0 40px 0;
}

.quick-nav-item {
  display: block;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.quick-nav-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-nav-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.quick-nav-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.quick-nav-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* Footer */
.doc-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-subtle);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 16px;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  .doc-header,
  .doc-sidebar,
  .header-actions,
  .copy-btn,
  .heading-anchor,
  .quick-nav-grid,
  .back-to-top-btn,
  .sidebar-backdrop {
    display: none !important;
  }

  .doc-layout {
    margin-top: 0;
  }

  .doc-main {
    padding: 0;
  }

  .doc-content {
    max-width: 100%;
  }

  .step-card,
  .info-card,
  .table-responsive,
  .doc-figure {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #cccccc !important;
  }

  code, pre {
    background: #f5f5f5 !important;
    color: #000000 !important;
    border: 1px solid #dddddd;
  }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .doc-main {
    padding: 32px 24px;
  }

  .version-badge {
    display: none;
  }

  .header-search {
    margin: 0 16px;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .doc-layout {
    overflow-x: hidden;
  }

  :root {
    --header-height: 110px;
  }

  .doc-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "brand actions"
      "search search";
    height: auto;
    min-height: var(--header-height);
    padding: 8px 14px 10px 14px;
    gap: 8px 10px;
    align-items: center;
  }

  .header-brand-wrap {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .header-brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-logo-badge {
    padding: 4px 8px;
    font-size: 13.5px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 15.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .version-badge {
    display: none;
  }

  .header-actions {
    grid-area: actions;
    justify-self: end;
  }

  /* Mobile Search: Visible, 100% Usable and Independent of Sidebar */
  .header-search {
    grid-area: search;
    display: block !important;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  .search-input {
    height: 36px;
    font-size: 13px;
    padding: 0 12px 0 34px;
  }

  .search-shortcut-hint {
    display: none;
  }

  .search-results-dropdown {
    max-height: calc(100vh - 130px);
    width: 100%;
  }

  /* Mobile Sidebar Navigation */
  .doc-sidebar {
    position: fixed;
    left: -100%;
    top: var(--header-height);
    bottom: 0;
    width: min(300px, 85vw);
    height: calc(100vh - var(--header-height));
    z-index: 90;
    transition: left 0.25s ease;
    box-shadow: var(--shadow-lg);
    background: var(--color-surface);
  }

  .doc-sidebar.open {
    left: 0;
  }

  .doc-main {
    padding: 20px 14px;
  }

  h1.doc-title {
    font-size: 22px;
    line-height: 1.3;
  }

  p.doc-subtitle {
    font-size: 14.5px;
    margin-bottom: 24px;
  }

  h2.section-heading {
    font-size: 19px;
    flex-wrap: wrap;
    line-height: 1.35;
  }

  h3.sub-heading {
    font-size: 16.5px;
  }

  .doc-section {
    margin-bottom: 44px;
  }

  .quick-nav-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0 32px 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .step-card {
    padding: 16px 14px;
  }

  .callout {
    padding: 14px;
    margin: 16px 0;
  }

  .figure-caption {
    font-size: 12px;
    padding: 0 4px;
  }

  .doc-footer {
    margin-top: 48px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 14px;
  }

  .doc-main {
    padding: 16px 12px;
  }

  .back-to-top-btn {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    width: 38px;
    height: 38px;
  }
}

