/* ==========================================================================
   TIS-RMS USER GUIDE & SYSTEM DOCUMENTATION
   Clean, Accessible Design System for User Documentation
   ========================================================================== */

:root {
  /* Color Palette - Minimalist Light Mode */
  --bg-primary: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F9FAFB;
  --bg-subtle: #F4F4F5;
  --header-bg: rgba(255, 255, 255, 0.85);
  --border-subtle: #E4E4E7;
  --border-strong: #D4D4D8;

  --text-primary: #09090B;
  --text-secondary: #52525B;
  --text-muted: #71717A;

  --primary: #15803D;
  --primary-hover: #166534;
  --primary-light: #F0FDF4;
  --primary-border: #BBF7D0;

  --accent-blue: #2563EB;
  --accent-blue-light: #EFF6FF;
  --accent-blue-border: #BFDBFE;
  --accent-amber: #D97706;
  --accent-amber-light: #FFFBEB;
  --accent-amber-border: #FDE68A;
  --accent-rose: #DC2626;
  --accent-rose-light: #FEF2F2;
  --accent-rose-border: #FECACA;

  --sidebar-w: 260px;
  --header-h: 56px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06);

  --transition: all 0.15s ease-in-out;
  --transition-fast: all 0.1s ease-in-out;
}

[data-theme="dark"] {
  /* Minimalist Deep Neutral Dark Palette */
  --bg-primary: #09090B;          /* Pure obsidian/charcoal background */
  --bg-surface: #111114;          /* Surface for header, sidebar, cards */
  --bg-surface-elevated: #18181C; /* Elevated cards, dropdowns & code wraps */
  --bg-subtle: #141418;           /* Subtle panels, inputs, and preview wraps */
  --header-bg: rgba(17, 17, 20, 0.85);
  --border-subtle: #222226;       /* Crisp hairline 1px border */
  --border-strong: #323238;       /* Interactive border */

  --text-primary: #F4F4F6;        /* High-clarity off-white */
  --text-secondary: #A1A1AA;      /* Balanced neutral readable body */
  --text-muted: #71717A;          /* Clean muted metadata / timestamps */

  --primary: #22C55E;             /* Vibrant minimalist emerald accent */
  --primary-hover: #16A34A;
  --primary-light: rgba(34, 197, 94, 0.1);
  --primary-border: rgba(34, 197, 94, 0.24);

  --accent-blue: #38BDF8;
  --accent-blue-light: rgba(56, 189, 248, 0.1);
  --accent-blue-border: rgba(56, 189, 248, 0.22);
  --accent-amber: #FBBF24;
  --accent-amber-light: rgba(251, 191, 36, 0.1);
  --accent-amber-border: rgba(251, 191, 36, 0.22);
  --accent-rose: #F87171;
  --accent-rose-light: rgba(248, 113, 113, 0.1);
  --accent-rose-border: rgba(248, 113, 113, 0.22);

  --shadow-sm: 0 1px 2px 0 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);
}

/* Base & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--primary-light);
  color: var(--primary);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

html {
  background-color: var(--bg-primary);
  color-scheme: light dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

[data-theme="dark"],
html[data-theme="dark"] {
  color-scheme: dark;
}

[data-theme="light"],
html[data-theme="light"] {
  color-scheme: light;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a:hover {
  text-decoration: underline;
}

code, kbd {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.85em;
}

code {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  color: var(--text-primary);
}

kbd {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.8em;
  color: var(--text-primary);
}

/* ── Top Header ─────────────────────────────────────────── */
.doc-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn,
.mobile-search-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.mobile-menu-btn:hover,
.mobile-search-btn:hover,
.mobile-menu-btn.active {
  background: var(--bg-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.sidebar-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  z-index: 105;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s;
  touch-action: none;
}

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

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-brand img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

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

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  transition: var(--transition);
}

.search-input-wrap:focus-within {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.search-icon {
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 32px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.84rem;
  color: var(--text-primary);
}

.search-kbd {
  font-size: 0.68rem;
  font-family: monospace;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Search Dropdown for Multi-Page Navigation ─────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

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

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  text-decoration: none !important;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

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

.search-result-item:hover,
.search-result-item.selected {
  background: var(--bg-subtle);
  color: var(--primary);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}

.search-result-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

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

.theme-toggle-btn, .print-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
  user-select: none;
}

.theme-toggle-btn:hover, .print-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.theme-toggle-btn:active, .print-btn:active {
  transform: translateY(0);
}

/* Theme icon switching */
[data-theme="light"] .sun-icon {
  display: none !important;
}

[data-theme="light"] .moon-icon {
  display: block !important;
}

[data-theme="dark"] .sun-icon {
  display: block !important;
}

[data-theme="dark"] .moon-icon {
  display: none !important;
}

/* ── Layout Container ───────────────────────────────────── */
.doc-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar Navigation ─────────────────────────────────── */
.doc-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 14px 48px;
  overflow-y: auto;
  background: var(--bg-surface);
}

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

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

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 22px 0 6px 8px;
}

.sidebar-heading:first-of-type {
  margin-top: 0;
}

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

.sidebar-nav li {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 450;
  text-decoration: none;
  transition: var(--transition);
  gap: 9px;
}

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

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

.nav-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

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

.nav-link.active .nav-icon {
  color: var(--primary);
}

.nav-icon svg {
  width: 15px;
  height: 15px;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.nav-link.active .nav-badge {
  background: var(--bg-surface);
  color: var(--primary);
}

/* ── Main Content Area ──────────────────────────────────── */
.doc-main {
  flex: 1;
  min-width: 0;
  padding: 40px clamp(24px, 4.5vw, 56px) 96px;
  max-width: 880px;
}

/* ── Hero Banner (Minimalist) ───────────────────────────── */
.hero-banner {
  padding: 0 0 32px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 40px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 3px 9px;
  border-radius: 9999px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 2.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.24;
  margin-bottom: 14px;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.68;
  margin-bottom: 20px;
  max-width: 820px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ── Sections & Typography ──────────────────────────────── */
.doc-section {
  margin-bottom: 56px;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.section-subtitle {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.subheading {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 34px 0 14px;
}

.paragraph {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}

/* ── Minimalist Bullet List ─────────────────────────────── */
.bullet-list {
  margin: 12px 0 20px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

.bullet-list li {
  margin-bottom: 6px;
}

.bullet-list strong {
  color: var(--text-primary);
  font-weight: 600;
}

.bullet-list ul {
  margin: 6px 0 8px 18px;
  list-style-type: circle;
}

/* ── Minimalist Module Summary ──────────────────────────── */
.module-summary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 20px 0 28px;
  box-shadow: var(--shadow-sm);
}

.module-summary-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 12px;
}

.module-summary-list {
  list-style: none;
}

.module-summary-list li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 4px 0 4px 20px;
  position: relative;
  line-height: 1.6;
}

.module-summary-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.module-summary-list strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Minimalist Callout Boxes ───────────────────────────── */
.callout {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 22px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.6;
  border: 1px solid var(--border-subtle);
}

.callout.tip {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-left: 3px solid var(--primary);
}

.callout.important {
  background: var(--accent-blue-light);
  border: 1px solid var(--accent-blue-border);
  border-left: 3px solid var(--accent-blue);
}

.callout.warning {
  background: var(--accent-amber-light);
  border: 1px solid var(--accent-amber-border);
  border-left: 3px solid var(--accent-amber);
}

.callout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout.tip .callout-icon { color: var(--primary); }
.callout.important .callout-icon { color: var(--accent-blue); }
.callout.warning .callout-icon { color: var(--accent-amber); }

.callout-icon svg {
  width: 18px;
  height: 18px;
}

/* ── Minimalist Documentation Figures (Screenshots) ─────── */
.mockup-container {
  margin: 26px 0 34px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.mockup-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 7px 14px;
}

.mockup-tab-btn {
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mockup-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.mockup-tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  font-weight: 600;
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.mockup-pane {
  background: var(--bg-surface);
}

/* Clean Document Figure */
.doc-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  cursor: zoom-in;
  position: relative;
}

.doc-figure-img-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-subtle);
  padding: 16px;
}

.doc-figure img {
  max-width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: opacity 0.2s ease;
}

.doc-figure:hover img {
  opacity: 0.97;
}

.doc-figure figcaption {
  padding: 10px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-figure figcaption .zoom-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.doc-figure figcaption .zoom-hint svg {
  width: 12px;
  height: 12px;
}

/* Android Figure Centered Display */
.doc-figure-android .doc-figure-img-wrap {
  padding: 18px;
  background: var(--bg-subtle);
}

.doc-figure-android img {
  max-width: 600px;
  margin: 0 auto;
}

/* ── Feature Grids & Step Cards ─────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 22px 0 32px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: var(--transition);
}

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

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

.card-icon svg {
  width: 16px;
  height: 16px;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Steps Container */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0 32px;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--border-strong);
}

.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-content h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Tables & Data Grids ────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin: 22px 0 32px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

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

table.doc-table th {
  background: var(--bg-subtle);
  padding: 11px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  line-height: 1.55;
}

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

table.doc-table tr:hover td {
  background: var(--bg-subtle);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.success {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.badge.info {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
}
.badge.warning {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}
.badge.danger {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose-border);
}

/* ── FAQ Accordion Section ─────────────────────────────── */
.faq-category {
  margin: 32px 0 16px;
}

.faq-category:first-of-type {
  margin-top: 16px;
}

.faq-category-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-category-title svg {
  width: 16px;
  height: 16px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--border-strong);
}

.faq-question {
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
}

.faq-question svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.active {
  border-color: var(--primary-border);
}

.faq-item.active .faq-question svg {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 18px 16px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-answer p {
  margin-top: 10px;
}

.faq-answer p:first-child {
  margin-top: 12px;
}

.faq-answer ul {
  margin: 8px 0 8px 20px;
}

.faq-answer li {
  margin-bottom: 5px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

/* ── Troubleshooting Cards & Grid ───────────────────────── */
.troubleshoot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.troubleshoot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.troubleshoot-card:hover {
  border-color: var(--border-strong);
}

.troubleshoot-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.troubleshoot-tag {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.troubleshoot-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.troubleshoot-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.troubleshoot-card ul {
  margin-left: 18px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.6;
}

.troubleshoot-card li {
  margin-bottom: 5px;
}

/* ── Lightbox Modal ─────────────────────────────────────── */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.lightbox-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 95vw;
  max-height: 92vh;
}

/* ── Minimalist Toast Notification ──────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastFadeIn 0.2s ease;
}

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

.lightbox-img {
  max-width: 95%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-caption {
  position: absolute;
  bottom: 18px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  max-width: 80%;
  text-align: center;
}

/* ── Footer ─────────────────────────────────────────────── */
.doc-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
}

.footer-left img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
}

.footer-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-size: 0.84rem;
}

.footer-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-right a {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: var(--transition);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}

.footer-right a:hover {
  color: var(--primary);
  background: var(--bg-subtle);
  text-decoration: none;
}

.footer-right .back-to-top {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Responsive Adaptations ─────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --header-h: 56px;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .mobile-search-btn {
    display: flex !important;
  }

  .print-btn {
    display: inline-flex !important;
  }

  .header-search {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    margin: 0;
    max-width: none;
    background: var(--bg-surface);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: none;
    box-shadow: var(--shadow-md);
    z-index: 115;
  }

  .header-search.mobile-open {
    display: block !important;
  }

  .search-kbd {
    display: none;
  }

  .doc-sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    z-index: 110;
    width: min(84vw, 310px);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    box-shadow: none;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
    padding: 16px 12px calc(48px + env(safe-area-inset-bottom, 16px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .doc-sidebar.open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .doc-sidebar .sidebar-heading {
    font-size: 0.72rem;
    margin: 18px 0 6px 6px;
    letter-spacing: 0.05em;
  }

  .doc-sidebar .sidebar-heading:first-of-type {
    margin-top: 4px;
  }

  .doc-sidebar .sidebar-nav li {
    margin-bottom: 3px;
  }

  .doc-sidebar .nav-link {
    padding: 10px 12px;
    min-height: 42px;
    font-size: 0.88rem;
    gap: 10px;
    border-radius: var(--radius-sm);
    line-height: 1.35;
  }

  .doc-sidebar .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .doc-sidebar .nav-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
  }

  .doc-main {
    padding: 28px 24px 64px;
  }
}

@media (max-width: 768px) {
  .doc-header {
    padding: 0 16px;
  }

  .hero-banner {
    padding-bottom: 24px;
    margin-bottom: 28px;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

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

  .section-title {
    font-size: 1.35rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mockup-container {
    margin: 20px 0;
  }

  .doc-figure-img-wrap {
    padding: 10px;
  }

  .table-wrap {
    margin: 16px 0;
  }

  table.doc-table th, table.doc-table td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .doc-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 0 28px;
  }

  .footer-left {
    width: 100%;
  }

  .footer-right {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    border-top: 1px dashed var(--border-subtle);
    padding-top: 14px;
  }
}

@media (max-width: 480px) {
  .doc-main {
    padding: 18px 14px 48px;
  }

  .brand-text span {
    display: none;
  }

  .brand-text h1 {
    font-size: 0.88rem;
  }

  .hero-title {
    font-size: 1.35rem;
  }
}

/* ── Landscape Side Tab & Low Height Responsiveness ───────── */
@media (orientation: landscape) and (max-height: 768px) {
  .doc-sidebar {
    padding: 10px 10px 36px;
    scrollbar-width: thin;
  }

  .sidebar-heading {
    margin: 10px 0 4px 6px;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }

  .sidebar-nav li {
    margin-bottom: 1px;
  }

  .nav-link {
    padding: 5px 8px;
    font-size: 0.78rem;
    gap: 6px;
    line-height: 1.25;
  }

  .nav-icon svg {
    width: 14px;
    height: 14px;
  }

  .nav-badge {
    font-size: 0.62rem;
    padding: 1px 4px;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  .doc-sidebar {
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding-bottom: 56px;
  }
}

/* ── Component Screenshots & Inline Media ───────────────── */
.component-screenshot {
  margin: 22px 0 30px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  display: flex;
  flex-direction: column;
}

.component-screenshot .doc-figure-img-wrap {
  background: var(--bg-subtle);
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.component-screenshot img {
  max-width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.component-screenshot figcaption {
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.screenshot-title {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
}

.screenshot-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

/* ── Previous and Next Page Navigation Buttons ──────────── */
.page-navigation {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
}

.page-nav-link {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  text-decoration: none !important;
  color: var(--text-primary);
  transition: var(--transition);
  box-sizing: border-box;
  width: 100%;
}

.page-nav-link:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.page-nav-link.next {
  grid-column: 2;
  text-align: right;
  align-items: flex-end;
}

.page-nav-link.prev {
  grid-column: 1;
  text-align: left;
  align-items: flex-start;
}

.page-nav-link.next:only-child {
  grid-column: 2;
}

.page-nav-link.prev:only-child {
  grid-column: 1;
}

@media (max-width: 768px) {
  .page-navigation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 36px;
    padding-top: 22px;
  }

  /* Next button stacked at the top */
  .page-nav-link.next {
    order: 1;
    width: 100%;
    grid-column: auto;
    text-align: right;
    align-items: flex-end;
  }

  /* Previous button stacked below the next button */
  .page-nav-link.prev {
    order: 2;
    width: 100%;
    grid-column: auto;
    text-align: left;
    align-items: flex-start;
  }

  .page-nav-link.next:only-child,
  .page-nav-link.prev:only-child {
    grid-column: auto;
    order: 1;
  }

  .page-nav-link {
    padding: 14px 18px;
  }

  .page-nav-link:active {
    transform: scale(0.99);
  }
}

.page-nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

/* ── Eye-Friendly Dark Mode Component Overrides ─────────── */
[data-theme="dark"] .component-screenshot,
[data-theme="dark"] .mockup-container {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .doc-figure-img-wrap,
[data-theme="dark"] .component-screenshot .doc-figure-img-wrap {
  background: var(--bg-subtle);
}

[data-theme="dark"] .doc-figure img,
[data-theme="dark"] .component-screenshot img {
  border-color: var(--border-subtle);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .component-screenshot figcaption,
[data-theme="dark"] .doc-figure figcaption {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

[data-theme="dark"] .search-dropdown {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .search-result-item:hover,
[data-theme="dark"] .search-result-item.selected {
  background: var(--bg-subtle);
}

[data-theme="dark"] .search-result-item {
  border-color: var(--border-subtle);
}

[data-theme="dark"] .page-nav-link {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

[data-theme="dark"] .page-nav-link:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
}

/* Print Styles */
@media print {
  :root, [data-theme="dark"] {
    --bg-primary: #ffffff !important;
    --bg-surface: #ffffff !important;
    --text-primary: #000000 !important;
    --text-secondary: #333333 !important;
    --border-subtle: #cccccc !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .doc-header, .doc-sidebar, .mockup-tabs, .theme-toggle-btn, .print-btn,
  .mobile-menu-btn, .mobile-search-btn, .zoom-hint,
  .page-navigation, .search-dropdown, .sidebar-backdrop, .doc-footer .footer-right {
    display: none !important;
  }

  .doc-main {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .doc-section {
    page-break-inside: avoid;
    margin-bottom: 24px;
  }

  .component-screenshot img, .doc-figure img {
    max-height: 380px !important;
  }
}

