/* ==========================================================================
   Innora Cloud — Official Onboarding & Launch Documentation Styles
   Version 3.5 — Perfect Mobile Header, Universal Sidebar Icons & Robust Layout
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  /* Innora Brand Palette */
  --innora-dark: #0b3d4a;
  --innora-teal: #5eead4;
  --innora-cyan: #0284c7;

  /* Colors - Light Theme */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0b1528;
  --bg-sidebar-active: #152238;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
  --bg-code: #0f172a;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  --text-sidebar-bright: #ffffff;

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-sidebar: #1e293b;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-light: #e0f2fe;
  --accent-text: #0369a1;

  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #047857;
  --success-accent: #10b981;

  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #b45309;
  --warning-accent: #f59e0b;

  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;
  --danger-accent: #ef4444;

  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1d4ed8;
  --info-accent: #3b82f6;

  --sidebar-width: 320px;
  --header-height: 60px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --bg-page: #080e1a;
  --bg-card: #0f172a;
  --bg-sidebar: #050a14;
  --bg-sidebar-active: #131e33;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.05);
  --bg-code: #020617;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-color: #1e293b;
  --border-subtle: #0f172a;
  --border-sidebar: #131e33;

  --accent-primary: #38bdf8;
  --accent-primary-hover: #7dd3fc;
  --accent-light: rgba(56, 189, 248, 0.15);
  --accent-text: #38bdf8;

  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);
  --success-text: #34d399;

  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);
  --warning-text: #fbbf24;

  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);
  --danger-text: #f87171;

  --info-bg: rgba(59, 130, 246, 0.12);
  --info-border: rgba(59, 130, 246, 0.3);
  --info-text: #60a5fa;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.layout-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

/* Backdrop for mobile drawer */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Left Sidebar Navigation
   ========================================================================== */
.docs-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-sidebar);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

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

.brand-mark-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 12px rgba(94, 234, 212, 0.25);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #ffffff;
}

.brand-text span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--innora-teal);
  font-weight: 700;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Progress summary widget */
.progress-widget {
  padding: 12px 14px;
  margin: 10px 12px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.progress-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: #f1f5f9;
  font-weight: 600;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--innora-teal), #38bdf8, #10b981);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 999px;
}

/* Sidebar Search */
.sidebar-search {
  padding: 6px 12px 6px;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 8px 32px 8px 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--innora-teal);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.2);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}

.search-kbd-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  pointer-events: none;
}

/* Navigation List */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 10px 40px;
  overscroll-behavior: contain;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 14px 6px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Nav Item Layout */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  margin-bottom: 2px;
  width: 100%;
  box-sizing: border-box;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-bright);
}

.nav-item:hover .nav-item-icon {
  color: var(--innora-teal);
}

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--innora-teal);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--innora-teal);
}

.nav-item.active .nav-item-icon {
  color: var(--innora-teal);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: #718096;
  transition: color 0.15s ease;
}

.nav-item-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-badge.done {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

/* ==========================================================================
   Header & Main Viewport (Fixed Mobile Overflow)
   ========================================================================== */
.docs-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
}

.docs-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  gap: 12px;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.mobile-toggle-btn {
  display: none;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  min-height: 38px;
  min-width: 38px;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.mobile-toggle-btn:hover {
  background: var(--border-color);
}

.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.breadcrumbs span.current {
  color: var(--text-primary);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

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

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

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-page);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

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

/* ==========================================================================
   Content Body
   ========================================================================== */
.docs-content {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Hero Section */
.docs-hero {
  background: linear-gradient(135deg, #0b3d4a 0%, #0f172a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 38px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(94, 234, 212, 0.2);
}

.docs-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.18) 0%, rgba(94, 234, 212, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(94, 234, 212, 0.15);
  color: var(--innora-teal);
  border: 1px solid rgba(94, 234, 212, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.docs-hero h1 {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.docs-hero p {
  color: #cbd5e1;
  font-size: clamp(14px, 1.6vw, 16px);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.hero-stat-card .val {
  font-size: 22px;
  font-weight: 800;
  color: var(--innora-teal);
}

.hero-stat-card .lbl {
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 500;
}

/* ==========================================================================
   Role Tabs
   ========================================================================== */
.role-tabs-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.role-tabs-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-chip {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  touch-action: manipulation;
}

.role-chip:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.role-chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

/* ==========================================================================
   Stage Sections & Cards
   ========================================================================== */
.stage-section {
  margin-bottom: 52px;
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.stage-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-color);
}

.stage-number {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0b3d4a 0%, #0284c7 100%);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.stage-title-wrap h2 {
  font-size: clamp(19px, 2.3vw, 23px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
}

.stage-title-wrap p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Step Card */
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.step-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.step-card.completed {
  border-left: 5px solid var(--success-accent);
}

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

.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(15.5px, 1.8vw, 18px);
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 200px;
}

.step-badge {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-text);
  font-weight: 800;
  white-space: nowrap;
}

.step-toggle-done {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 34px;
  touch-action: manipulation;
}

.step-toggle-done:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.step-toggle-done.is-done {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.step-body p {
  color: var(--text-secondary);
  font-size: 14.5px;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* Bullet Instructions */
.instruction-list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}

.instruction-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.instruction-list li::before {
  content: '→';
  position: absolute;
  left: 6px;
  top: 0;
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 15px;
}

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

.fields-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 520px;
}

.fields-table th, .fields-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.fields-table th {
  background: var(--bg-page);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fields-table td.field-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-text);
  white-space: nowrap;
}

.fields-table td.req {
  color: var(--danger-accent);
  font-weight: 700;
  text-align: center;
  width: 70px;
}

/* Callout Alerts */
.callout {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.55;
}

.callout-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-content {
  flex: 1;
}

.callout-content strong {
  display: block;
  font-weight: 700;
  margin-bottom: 3px;
}

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

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

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

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

/* Document Screenshot Card & Window Frame */
.doc-screenshot-card {
  margin: 20px 0 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.doc-screenshot-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.doc-screenshot-header {
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.window-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.window-dot.red { background: #ef4444; }
.window-dot.yellow { background: #f59e0b; }
.window-dot.green { background: #10b981; }

.window-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

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

.doc-screenshot-body {
  position: relative;
  background: #020617;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: zoom-in;
  overflow: hidden;
}

.doc-screenshot-img {
  width: 100%;
  height: auto;
  max-height: 580px;
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}

.doc-screenshot-card:hover .doc-screenshot-img {
  transform: scale(1.006);
}

.doc-screenshot-caption {
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 210;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.lightbox-img-wrapper {
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 14px;
  color: #e2e8f0;
  font-size: 13.5px;
  text-align: center;
  max-width: 800px;
}

/* Code Snippet Box */
.code-box {
  background: var(--bg-code);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-sidebar);
  color: #f8fafc;
  margin: 16px 0;
  overflow: hidden;
}

.code-box-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.code-box-content {
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}

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

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

/* Checklist Box */
.checklist-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-text strong {
  font-size: 14px;
  color: var(--text-primary);
  display: block;
}

.checklist-text span {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Footer */
.docs-footer {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   Documentation Screenshot Cards & Fullscreen Lightbox
   ========================================================================== */
.doc-screenshot-card {
  margin: 20px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.doc-screenshot-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

.doc-screenshot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #0f172a;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  user-select: none;
}

[data-theme="dark"] .doc-screenshot-header {
  background: #020617;
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.window-dot.red { background: #ff5f56; }
.window-dot.yellow { background: #ffbd2e; }
.window-dot.green { background: #27c93f; }

.window-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #cbd5e1;
  font-weight: 500;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.doc-screenshot-body {
  position: relative;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
}

.doc-screenshot-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.doc-screenshot-card:hover .doc-screenshot-img {
  transform: scale(1.008);
}

.doc-screenshot-caption {
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 14, 26, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 20px;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-close-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 1);
  transform: rotate(90deg) scale(1.05);
}

.lightbox-img-wrapper {
  max-width: 94vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: zoomInLight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomInLight {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-caption {
  margin-top: 14px;
  color: #e2e8f0;
  font-size: 14px;
  text-align: center;
  max-width: 800px;
  padding: 0 16px;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}


/* ==========================================================================
   Mobile Responsive Adjustments & Zero-Overflow Header
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }
  .docs-content {
    padding: 26px 20px 70px;
  }
}

@media (max-width: 860px) {
  .docs-sidebar {
    transform: translateX(-100%);
    width: 300px;
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: inline-flex;
  }
  .docs-main {
    margin-left: 0;
    width: 100%;
  }
  .mobile-toggle-btn {
    display: inline-flex;
  }
  .docs-header {
    padding: 0 12px;
  }
  .docs-content {
    padding: 16px 12px 50px;
  }
  .docs-hero {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .step-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
  .step-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .step-title {
    font-size: 16px;
  }
  .step-toggle-done {
    width: 100%;
    justify-content: center;
  }
  .role-chips {
    gap: 5px;
  }
  .role-chip {
    padding: 5px 10px;
    font-size: 12px;
  }
  .docs-footer {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .breadcrumbs span:not(.current):not(.brand-crumb) {
    display: none;
  }
  .breadcrumbs i:not(.brand-sep) {
    display: none;
  }
  .breadcrumbs span.current {
    max-width: 160px;
  }
  .header-btn span {
    display: none;
  }
  .header-btn {
    padding: 6px 10px;
    min-height: 36px;
  }
}

@media (max-width: 420px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .breadcrumbs span.brand-crumb, .breadcrumbs i.brand-sep {
    display: none;
  }
  .breadcrumbs span.current {
    max-width: 140px;
    font-size: 12.5px;
  }
  .docs-header {
    padding: 0 8px;
  }
}

/* Print Friendly Styles */
@media print {
  .docs-sidebar, .docs-header, .sidebar-backdrop, .role-tabs-wrapper, .step-toggle-done, .copy-btn, .mobile-toggle-btn {
    display: none !important;
  }
  .docs-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .docs-content {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .step-card, .docs-hero, .checklist-box {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }
}
