/* ==========================================================================
   Timelier Documentation Design System
   Modern SaaS Documentation Theme (Stripe / Mintlify / GitBook aesthetic)
   ========================================================================== */

:root {
  /* Core Brand Colors */
  --brand-primary: #3665C1;
  --brand-primary-hover: #2a52a3;
  --brand-primary-light: #e8f0fe;
  --brand-accent: #7991D1;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Light Theme (Default) */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-code: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #3665C1;
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-border: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-modal: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Callout Colors */
  --callout-info-bg: #eff6ff;
  --callout-info-border: #3b82f6;
  --callout-info-text: #1e40af;
  --callout-tip-bg: #ecfdf5;
  --callout-tip-border: #10b981;
  --callout-tip-text: #065f46;
  --callout-warning-bg: #fffbeb;
  --callout-warning-border: #f59e0b;
  --callout-warning-text: #92400e;
  --callout-important-bg: #eff6ff;
  --callout-important-border: #3665C1;
  --callout-important-text: #1e3a8a;

  /* Sizing & Layout */
  --header-height: 64px;
  --sidebar-width: 270px;
  --toc-width: 220px;
  --content-max-width: 860px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: 0.18s ease-in-out;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-sidebar: #0b1120;
  --bg-card: #131d31;
  --bg-subtle: #1e293b;
  --bg-code: #020617;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #1e293b;
  --border-focus: #60a5fa;
  --header-bg: rgba(11, 17, 32, 0.85);
  --header-border: #1e293b;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);

  --callout-info-bg: rgba(59, 130, 246, 0.12);
  --callout-info-border: #3b82f6;
  --callout-info-text: #93c5fd;
  --callout-tip-bg: rgba(16, 185, 129, 0.12);
  --callout-tip-border: #10b981;
  --callout-tip-text: #6ee7b7;
  --callout-warning-bg: rgba(245, 158, 11, 0.12);
  --callout-warning-border: #f59e0b;
  --callout-warning-text: #fcd34d;
  --callout-important-bg: rgba(54, 101, 193, 0.15);
  --callout-important-border: #3b82f6;
  --callout-important-text: #bfdbfe;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-app);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-toggle {
  display: none;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #3665C1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-shadow: 0 2px 4px rgba(54, 101, 193, 0.25);
}

.brand-icon img,
.brand-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  letter-spacing: normal;
}

.header-search-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  width: 240px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.header-search-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-secondary);
  background: var(--bg-app);
}

.search-shortcut {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--bg-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
}

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

.theme-toggle-btn,
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.theme-toggle-btn:hover,
.header-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-subtle);
}

.app-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand-primary);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.app-link-btn:hover {
  background: var(--brand-primary-hover);
}

/* ==========================================================================
   Layout Container
   ========================================================================== */
.docs-container {
  display: flex;
  flex: 1;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
}

/* ==========================================================================
   Left Sidebar Navigation
   ========================================================================== */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 1.5rem 1rem 2rem 1.5rem;
  border-right: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.sidebar-category {
  margin-bottom: 1.5rem;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.5rem;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

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

[data-theme="dark"] .nav-link.active {
  background: rgba(54, 101, 193, 0.2);
  color: #93c5fd;
}

.nav-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  background: #dbeafe;
  color: #1e40af;
}

.nav-badge.badge-new {
  background: #dcfce7;
  color: #15803d;
}

[data-theme="dark"] .nav-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

[data-theme="dark"] .nav-badge.badge-new {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

/* ==========================================================================
   Main Article Container
   ========================================================================== */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 4rem;
  display: flex;
  justify-content: center;
}

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

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--text-muted);
}

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

.breadcrumb-separator {
  opacity: 0.5;
}

.article-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Markdown Content Elements */
.markdown-body {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.75;
}

.markdown-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.25rem 0 0.9rem;
  padding-top: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
  color: var(--text-primary);
}

.markdown-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  color: var(--text-primary);
}

.markdown-body p {
  margin-bottom: 1.15rem;
  color: var(--text-secondary);
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--text-secondary);
}

.markdown-body li {
  margin-bottom: 0.35rem;
}

.markdown-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-subtle);
  color: var(--brand-primary);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.markdown-body pre {
  background: var(--bg-code);
  color: #f8fafc;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  border: 1px solid #1e293b;
}

/* Callout Alerts */
.callout {
  border-left: 4px solid;
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

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

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

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

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

/* Screenshot Mockup Container */
.screenshot-frame {
  margin: 1.75rem 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.screenshot-frame:hover {
  box-shadow: var(--shadow-lg);
}

.frame-titlebar {
  background: var(--bg-subtle);
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--border-color);
}

.frame-titlebar .browser-nav-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.frame-titlebar .browser-address-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.frame-titlebar .browser-address-bar svg {
  color: var(--text-muted);
}

.screenshot-img-wrapper {
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  background: var(--bg-card);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Placeholder Graphic when screenshot file is missing or in progress */
.screenshot-placeholder {
  padding: 3.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  color: var(--text-muted);
  width: 100%;
}

.placeholder-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--brand-primary);
}

.placeholder-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.placeholder-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.screenshot-caption {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

/* Document Screenshots & Lightbox Standards */
.doc-screenshot {
  position: relative;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: zoom-in;
}

.doc-screenshot-wrapper {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: var(--bg-surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.doc-screenshot:hover .doc-screenshot-wrapper {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.doc-screenshot img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: opacity var(--transition);
}

/* Zoom Hint Badge */
.doc-screenshot-zoom-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}

.doc-screenshot:hover .doc-screenshot-zoom-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Screenshot Sizing Categories */
/* Type A: Compact form / dialog / modal */
.doc-screenshot--compact,
.doc-screenshot.compact {
  max-width: 420px;
  width: 100%;
}

/* Type B: Medium feature crop / table / panel */
.doc-screenshot--medium,
.doc-screenshot.medium {
  max-width: 640px;
  width: 100%;
}

/* Type C: Fullscreen desktop application capture */
.doc-screenshot--wide,
.doc-screenshot.wide {
  max-width: 100%;
  width: 100%;
}

.doc-screenshot--wide .doc-screenshot-wrapper,
.doc-screenshot.wide .doc-screenshot-wrapper {
  width: 100%;
}

.doc-screenshot--wide img,
.doc-screenshot.wide img {
  width: 100%;
}

/* Global Documentation Lightbox */
.docs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.5rem;
}

.docs-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.docs-lightbox-content {
  position: relative;
  max-width: 94vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.docs-lightbox-img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
  transform: scale(0.94);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.docs-lightbox.active .docs-lightbox-img {
  transform: scale(1);
}

.docs-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition);
  z-index: 10;
}

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

.docs-lightbox-close svg {
  width: 20px;
  height: 20px;
}

.docs-lightbox-caption {
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  max-width: 600px;
}

/* Step Sequence Cards */
.steps-container {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.step-body p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* Feature Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

[data-theme="dark"] .feature-icon {
  background: rgba(54, 101, 193, 0.2);
  color: #93c5fd;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

/* Table Styling */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.markdown-body th,
.markdown-body td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.markdown-body th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Article Navigation Footer */
.article-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.page-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-nav-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.page-nav-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.page-nav-card.next {
  text-align: right;
  margin-left: auto;
  width: 100%;
}

.page-nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.page-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Feedback Widget */
.feedback-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.feedback-buttons {
  display: flex;
  gap: 0.5rem;
}

.feedback-btn {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  transition: all var(--transition);
}

.feedback-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

/* ==========================================================================
   Right Table of Contents (On this page)
   ========================================================================== */
.docs-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  align-self: flex-start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 2.5rem 1.25rem 2rem 0;
  z-index: 10;
}

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

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  padding: 0.2rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  transition: all var(--transition);
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--brand-primary);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

.toc-link.toc-h3 {
  padding-left: 1.2rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   Search Modal Overlay
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal {
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modalSlide 0.15s ease-out;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: inherit;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
  list-style: none;
}

.search-result-item a {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.search-result-item a:hover {
  background: var(--bg-subtle);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.search-result-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.search-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Image Lightbox Modal
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

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

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  object-fit: contain;
}

.lightbox-caption {
  color: #f1f5f9;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  color: #ffffff;
  font-size: 1.5rem;
  padding: 0.5rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }

  .docs-main {
    padding: 2rem;
  }
}

@media (max-width: 860px) {
  .mobile-menu-toggle {
    display: block;
  }

  .header-search-btn {
    width: 140px;
  }

  .search-shortcut {
    display: none;
  }

  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    z-index: 90;
    width: 280px;
    height: calc(100vh - var(--header-height));
    transition: left 0.25s ease-in-out;
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface);
  }

  .docs-sidebar.mobile-open {
    left: 0;
  }

  .docs-main {
    padding: 1.5rem 1rem 3rem;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .page-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Table of Contents (Right Sidebar & Mobile Drawer)
   ========================================================================== */
.docs-toc {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  align-self: flex-start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 2.5rem 1.25rem 2rem 1rem;
  border-left: 1px solid var(--border-color);
  font-size: 0.85rem;
  z-index: 10;
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-link {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.4;
  padding: 0.2rem 0 0.2rem 0.65rem;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.toc-link:hover {
  color: var(--text-primary);
  border-left-color: var(--border-focus);
}

.toc-link.active {
  color: var(--brand-primary);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

.toc-sublink {
  padding-left: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toc-sublink:hover {
  color: var(--text-secondary);
}

.toc-sublink.active {
  color: var(--brand-primary);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

/* Mobile In-Page TOC Drawer */
.mobile-toc {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 1.25rem 0 2rem;
  overflow: hidden;
  transition: all var(--transition);
}

.mobile-toc[open] {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-focus);
}

.mobile-toc-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.mobile-toc-trigger::-webkit-details-marker {
  display: none;
}

.mobile-toc-trigger .chevron {
  margin-left: auto;
  transition: transform var(--transition);
}

.mobile-toc[open] .mobile-toc-trigger .chevron {
  transform: rotate(180deg);
}

.mobile-toc-dropdown {
  padding: 0.5rem 1rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.mobile-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-toc-list a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.25rem 0;
}

.mobile-toc-list a:hover {
  color: var(--brand-primary);
}

.mobile-toc-list .sub-step {
  padding-left: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 1150px) {
  .docs-toc {
    display: none !important;
  }
  .mobile-toc {
    display: block;
  }
}

/* ==========================================================================
   Workflow Choice Cards
   ========================================================================== */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.workflow-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.workflow-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.workflow-card-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.workflow-card.recommended .workflow-card-badge {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

[data-theme="dark"] .workflow-card.recommended .workflow-card-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

.workflow-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.workflow-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.workflow-card-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

[data-theme="dark"] .workflow-card-cta {
  color: #93c5fd;
}

/* ==========================================================================
   Step Timeline & Numbered Badges
   ========================================================================== */
.step-timeline {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  margin: 1.5rem 0 2.5rem;
}

.step-timeline .step-card {
  display: block;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.75rem 1.75rem 4.5rem;
  box-shadow: var(--shadow-sm);
}

.step-timeline .step-badge {
  position: absolute;
  top: 1.75rem;
  left: 1.5rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(54, 101, 193, 0.2);
}

[data-theme="dark"] .step-timeline .step-badge {
  background: rgba(54, 101, 193, 0.25);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.3);
}

.step-timeline .step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .step-timeline .step-card {
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  }
  .step-timeline .step-badge {
    left: 1rem;
    top: 1.25rem;
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Interactive Tabbed Switcher Component
   ========================================================================== */
.doc-tabs {
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.doc-tabs-header {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0.5rem 0;
}

.doc-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.doc-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.doc-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .doc-tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.doc-tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: var(--bg-surface);
}

[data-theme="dark"] .doc-tab-btn.active {
  color: #93c5fd;
  border-bottom-color: #3b82f6;
}

.doc-tab-panel {
  display: none;
  padding: 1.5rem;
  animation: fadeInTab 0.2s ease-in-out;
}

.doc-tab-panel.active {
  display: block;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Documentation Tables & Data Placeholders
   ========================================================================== */
.doc-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

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

.doc-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.doc-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: top;
  line-height: 1.5;
}

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

.token-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 600;
}

[data-theme="dark"] .token-code {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.prop-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-top: 0.25rem;
  white-space: nowrap;
}

.prop-badge--msft {
  background: #e5f0fa;
  color: #0067b8;
  border: 1px solid #cce4f7;
}

[data-theme="dark"] .prop-badge--msft {
  background: rgba(0, 103, 184, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

.prop-badge--goog {
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #d2e3fc;
}

[data-theme="dark"] .prop-badge--goog {
  background: rgba(26, 115, 232, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

.doc-screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
  background: var(--bg-subtle);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.doc-screenshot-placeholder svg {
  color: var(--brand-primary);
  opacity: 0.7;
}

[data-theme="dark"] .doc-screenshot-placeholder {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.15);
}